repo_id stringclasses 563
values | file_path stringlengths 40 166 | content stringlengths 1 2.94M | __index_level_0__ int64 0 0 |
|---|---|---|---|
solana_public_repos/solana-playground/solana-playground/wasm/solana-client/src | solana_public_repos/solana-playground/solana-playground/wasm/solana-client/src/utils/rpc_filter.rs | use serde_with::{serde_as, skip_serializing_none, DisplayFromStr};
use solana_extra_wasm::program::spl_token_2022::{
generic_token_account::GenericTokenAccount, state::Account,
};
use solana_sdk::{
account::{AccountSharedData, ReadableAccount},
pubkey::Pubkey,
};
use std::borrow::Cow;
use thiserror::Error;
... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm/solana-client/src | solana_public_repos/solana-playground/solana-playground/wasm/solana-client/src/utils/rpc_request.rs | pub const MAX_GET_SIGNATURE_STATUSES_QUERY_ITEMS: usize = 256;
pub const MAX_GET_CONFIRMED_SIGNATURES_FOR_ADDRESS_SLOT_RANGE: u64 = 10_000;
pub const MAX_GET_CONFIRMED_BLOCKS_RANGE: u64 = 500_000;
pub const MAX_GET_CONFIRMED_SIGNATURES_FOR_ADDRESS2_LIMIT: usize = 1_000;
pub const MAX_MULTIPLE_ACCOUNTS: usize = 100;
pub... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm/solana-client/src | solana_public_repos/solana-playground/solana-playground/wasm/solana-client/src/utils/nonce_utils.rs | //! Durable transaction nonce helpers.
use {
crate::{utils::rpc_config::RpcAccountInfoConfig, WasmClient},
solana_sdk::{
account::{Account, ReadableAccount},
account_utils::StateMut,
commitment_config::CommitmentConfig,
hash::Hash,
nonce::{
state::{Data, Vers... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm/solana-client/src | solana_public_repos/solana-playground/solana-playground/wasm/solana-client/src/utils/rpc_response.rs | use serde_with::{serde_as, DisplayFromStr};
use solana_extra_wasm::{
account_decoder::parse_token::UiTokenAmount,
transaction_status::{TransactionConfirmationStatus, UiConfirmedBlock},
};
use solana_sdk::{
clock::{Epoch, Slot, UnixTimestamp},
inflation::Inflation,
pubkey::Pubkey,
transaction::Tr... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm/solana-client/src | solana_public_repos/solana-playground/solana-playground/wasm/solana-client/src/utils/mod.rs | pub mod nonce_utils;
pub mod rpc_config;
pub mod rpc_filter;
pub mod rpc_request;
pub mod rpc_response;
| 0 |
solana_public_repos/solana-playground/solana-playground/wasm/solana-client/src | solana_public_repos/solana-playground/solana-playground/wasm/solana-client/src/utils/rpc_config.rs | use bincode::serialize;
use serde_with::{serde_as, skip_serializing_none, DisplayFromStr};
use solana_extra_wasm::{
account_decoder::{UiAccount, UiAccountEncoding, UiDataSliceConfig},
transaction_status::{TransactionDetails, UiTransactionEncoding},
};
use solana_sdk::{
clock::{Epoch, Slot},
commitment_c... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm | solana_public_repos/solana-playground/solana-playground/wasm/anchor-cli/Cargo.toml | [package]
name = "anchor-cli-wasm"
version = "0.29.0" # mirror Anchor version
description = "Anchor CLI for Solana Playground with WASM"
authors = ["Acheron <acheroncrypto@gmail.com>"]
repository = "https://github.com/solana-playground/solana-playground"
license = "GPL-3.0"
homepage = "https://beta.solpg.io"
edition = ... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm/anchor-cli | solana_public_repos/solana-playground/solana-playground/wasm/anchor-cli/src/lib.rs | pub mod cli;
mod commands;
mod utils;
| 0 |
solana_public_repos/solana-playground/solana-playground/wasm/anchor-cli | solana_public_repos/solana-playground/solana-playground/wasm/anchor-cli/src/utils.rs | use std::str::FromStr;
use anchor_lang::prelude::Pubkey;
use anchor_syn::idl::types::Idl;
use anyhow::anyhow;
use solana_client_wasm::WasmClient;
use solana_playground_utils_wasm::js::{PgProgramInfo, PgSettings, PgWallet};
use solana_sdk::{
commitment_config::{CommitmentConfig, CommitmentLevel},
signature::Key... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm/anchor-cli | solana_public_repos/solana-playground/solana-playground/wasm/anchor-cli/src/cli.rs | use clap::Parser;
use solana_playground_utils_wasm::js::PgTerminal;
use wasm_bindgen::prelude::*;
use crate::commands::idl::{process_idl, IdlCommand};
#[derive(Parser)]
#[clap(version, about)]
enum Cli {
/// Commands for interacting with interface definitions
Idl {
#[clap(subcommand)]
subcmd: ... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm/anchor-cli/src | solana_public_repos/solana-playground/solana-playground/wasm/anchor-cli/src/commands/idl.rs | use std::io::{Read, Write};
use anchor_lang::{
idl::{IdlAccount, IdlInstruction, ERASED_AUTHORITY},
prelude::AccountMeta,
AccountDeserialize, AnchorDeserialize, AnchorSerialize,
};
use anchor_syn::idl::types::Idl;
use anyhow::anyhow;
use clap::Parser;
use flate2::{read::ZlibDecoder, write::ZlibEncoder, Com... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm/anchor-cli/src | solana_public_repos/solana-playground/solana-playground/wasm/anchor-cli/src/commands/mod.rs | pub mod idl;
| 0 |
solana_public_repos/solana-playground/solana-playground/wasm | solana_public_repos/solana-playground/solana-playground/wasm/playnet/Cargo.toml | [package]
name = "playnet"
version = "0.1.0"
description = "A minimal runtime to execute Solana programs"
authors = ["Acheron <acheroncrypto@gmail.com>"]
repository = "https://github.com/solana-playground/solana-playground"
license = "GPL-3.0"
homepage = "https://beta.solpg.io"
edition = "2021"
keywords = ["playnet", "... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm | solana_public_repos/solana-playground/solana-playground/wasm/playnet/Cargo.lock | # This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
[[package]]
name = "aead"
version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0b613b8e1e3cf911a086f53f03bf286f52fd7a7258e4fa606f0ef220d39d8877"
dependencies = [
"generic-ar... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm/playnet | solana_public_repos/solana-playground/solana-playground/wasm/playnet/src/types.rs | use solana_sdk::{
account::Account,
clock::UnixTimestamp,
hash::Hash,
pubkey::Pubkey,
slot_history::Slot,
stake_history::Epoch,
transaction::{self, TransactionError, TransactionVersion},
transaction_context::{TransactionAccount, TransactionReturnData},
};
use wasm_bindgen::prelude::*;
u... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm/playnet | solana_public_repos/solana-playground/solana-playground/wasm/playnet/src/serde.rs | // Custom de/serializations
use std::{collections::HashMap, str::FromStr};
use serde::{
ser::{SerializeMap, Serializer},
Deserialize, Deserializer,
};
/// `Pubkey` is getting de/serialized as bytes but JSON keys must be strings.
/// We do the necessary conversion with custom de/serialization implementation.
... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm/playnet | solana_public_repos/solana-playground/solana-playground/wasm/playnet/src/playnet.rs | // Playnet creates a minimal custom runtime to allow testing Solana programs
// in browsers(though not limited to) without restrictions with the help of WASM.
//
// Playnet is not `solana-test-validator`, it's specifically designed for single
// user in mind to consume as little resources as possible.
use std::{rc::Rc... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm/playnet | solana_public_repos/solana-playground/solana-playground/wasm/playnet/src/lib.rs | // Project structure:
// ./playnet -> Starting point. Lifecycle starts when a Playnet instance gets created.
// ./runtime -> Where all internal logic for Playnet runtime lives.
// ./rpc -> Methods for clients to interact with the Playnet.
mod playnet;
mod rpc;
mod runtime;
mod serde;
mod types;
mod utils;
#[cfg(t... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm/playnet | solana_public_repos/solana-playground/solana-playground/wasm/playnet/src/utils.rs | use solana_sdk::{
hash::{Hash, Hasher},
transaction::{self, MessageHash, SanitizedTransaction, Transaction, VersionedTransaction},
};
use crate::runtime::bank::PgAddressLoader;
/// Tries to convert a serialized transaction into `SanitizedTransaction`
pub fn get_sanitized_tx_from_serialized_tx(
serialized_... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm/playnet | solana_public_repos/solana-playground/solana-playground/wasm/playnet/src/rpc.rs | // Since there is no networking access from WASM, all JSON-RPC methods need to be
// implemented from scratch to interact with the Playnet runtime.
use std::{
rc::Rc,
str::FromStr,
sync::{RwLock, RwLockReadGuard, RwLockWriteGuard},
};
use solana_sdk::{
feature_set::FeatureSet,
message::{Message, S... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm/playnet/src | solana_public_repos/solana-playground/solana-playground/wasm/playnet/src/test_programs/transfer_cpi.rs | pub const PROGRAM_BYTES: &[u8] = &[
127, 69, 76, 70, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 247, 0, 1, 0, 0, 0, 176, 11, 0, 0,
0, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 16, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 0, 56, 0, 4, 0,
64, 0, 9, 0, 8, 0, 1, 0, 0, 0, 5, 0, 0, 0, 32, 1, 0, 0, 0, 0, 0, 0, 32, 1, 0, 0, 0, ... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm/playnet/src | solana_public_repos/solana-playground/solana-playground/wasm/playnet/src/test_programs/hello_world.rs | pub const PROGRAM_BYTES: &[u8] = &[
127, 69, 76, 70, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 247, 0, 1, 0, 0, 0, 32, 1, 0, 0, 0,
0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 8, 74, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 0, 56, 0, 4, 0, 64,
0, 9, 0, 8, 0, 1, 0, 0, 0, 5, 0, 0, 0, 32, 1, 0, 0, 0, 0, 0, 0, 32, 1, 0, 0, 0, 0,... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm/playnet/src | solana_public_repos/solana-playground/solana-playground/wasm/playnet/src/test_programs/mod.rs | pub mod hello_world;
pub mod transfer_cpi;
| 0 |
solana_public_repos/solana-playground/solana-playground/wasm/playnet/src | solana_public_repos/solana-playground/solana-playground/wasm/playnet/src/runtime/bank.rs | use std::{
cell::RefCell,
collections::HashMap,
num::NonZeroUsize,
rc::Rc,
sync::{Arc, RwLock},
};
use serde::{Deserialize, Serialize};
use solana_bpf_loader_program::process_instruction as process_bpf_loader_instruction;
use solana_program_runtime::{
compute_budget::ComputeBudget, executor_cac... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm/playnet/src | solana_public_repos/solana-playground/solana-playground/wasm/playnet/src/runtime/nonce_keyed_account.rs | use std::collections::HashSet;
use {
solana_program_runtime::{ic_msg, invoke_context::InvokeContext},
solana_sdk::{
feature_set,
instruction::{checked_add, InstructionError},
nonce::{
self,
state::{AuthorizeNonceError, DurableNonce, Versions},
State,
... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm/playnet/src | solana_public_repos/solana-playground/solana-playground/wasm/playnet/src/runtime/system_instruction_processor.rs | use std::collections::HashSet;
use {
solana_program_runtime::{
ic_msg, invoke_context::InvokeContext, sysvar_cache::get_sysvar_with_account_check,
},
solana_sdk::{
account::AccountSharedData,
account_utils::StateMut,
feature_set,
instruction::InstructionError,
... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm/playnet/src | solana_public_repos/solana-playground/solana-playground/wasm/playnet/src/runtime/mod.rs | pub mod bank;
pub mod message_processor;
pub mod nonce_keyed_account;
pub mod system_instruction_processor;
pub mod transaction_history;
| 0 |
solana_public_repos/solana-playground/solana-playground/wasm/playnet/src | solana_public_repos/solana-playground/solana-playground/wasm/playnet/src/runtime/transaction_history.rs | use serde::{Deserialize, Serialize};
use solana_sdk::{
clock::UnixTimestamp,
instruction::CompiledInstruction,
message::v0::LoadedAddresses,
pubkey::Pubkey,
slot_history::Slot,
transaction::{TransactionError, VersionedTransaction},
};
use wasm_bindgen::prelude::*;
#[derive(Clone, Debug, Seriali... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm/playnet/src | solana_public_repos/solana-playground/solana-playground/wasm/playnet/src/runtime/message_processor.rs | use {
serde::{Deserialize, Serialize},
solana_program_runtime::{
compute_budget::ComputeBudget,
executor_cache::TransactionExecutorCache,
invoke_context::{BuiltinProgram, InvokeContext},
log_collector::LogCollector,
sysvar_cache::SysvarCache,
timings::{ExecuteDeta... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm | solana_public_repos/solana-playground/solana-playground/wasm/rust-analyzer/Cargo.toml | [package]
name = "rust-analyzer-wasm"
version = "0.0.100" # mirror RA version
description = "Rust Analyzer WASM"
authors = ["Acheron <acheroncrypto@gmail.com>"]
repository = "https://github.com/solana-playground/solana-playground"
license = "GPL-3.0"
homepage = "https://beta.solpg.io"
edition = "2021"
keywords = ["rust... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm | solana_public_repos/solana-playground/solana-playground/wasm/rust-analyzer/Cargo.lock | # This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
[[package]]
name = "always-assert"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fbf688625d06217d5b1bb0ea9d9c44a1635fd0ee3534466388d18203174f4d11"
dependencies = [
"l... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm | solana_public_repos/solana-playground/solana-playground/wasm/rust-analyzer/rust-toolchain.toml | [toolchain]
channel = "nightly-2022-12-12"
targets = ["wasm32-unknown-unknown"]
components = ["rust-src"]
| 0 |
solana_public_repos/solana-playground/solana-playground/wasm/rust-analyzer | solana_public_repos/solana-playground/solana-playground/wasm/rust-analyzer/.cargo/config | [target.wasm32-unknown-unknown]
rustflags = ["-C", "target-feature=+atomics,+bulk-memory,+mutable-globals"]
[unstable]
build-std = ["panic_abort", "std"] | 0 |
solana_public_repos/solana-playground/solana-playground/wasm/rust-analyzer | solana_public_repos/solana-playground/solana-playground/wasm/rust-analyzer/src/snippet.rs | use ide::{Snippet, SnippetScope};
use serde::Deserialize;
/// Get snippets from JSON string.
pub fn get_snippets_from_str(snippets: &str) -> Vec<Snippet> {
serde_json::from_str::<serde_json::Value>(snippets)
.unwrap()
.as_object()
.unwrap()
.iter()
.map(|(name, snippet)| {
... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm/rust-analyzer | solana_public_repos/solana-playground/solana-playground/wasm/rust-analyzer/src/proc_macro.rs | use cargo_toml::Manifest;
use ide_db::base_db::ProcMacro;
/// Get whether the crate is a proc macro crate from manifest.
pub fn get_is_proc_macro(manifest: &Manifest) -> bool {
manifest
.lib
.as_ref()
.map(|lib| lib.proc_macro)
.unwrap_or_default()
}
/// Get proc macros from the gi... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm/rust-analyzer | solana_public_repos/solana-playground/solana-playground/wasm/rust-analyzer/src/lib.rs | //! This crate is a fork of https://github.com/rust-analyzer/rust-analyzer-wasm
mod proc_macro;
mod return_types;
mod snippet;
mod to_proto;
mod utils;
mod world_state;
use wasm_bindgen::prelude::*;
// Export rayon thread pool
pub use wasm_bindgen_rayon::init_thread_pool;
/// Show better error messages.
#[wasm_bind... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm/rust-analyzer | solana_public_repos/solana-playground/solana-playground/wasm/rust-analyzer/src/return_types.rs | use serde::{Deserialize, Serialize};
use serde_repr::Serialize_repr;
#[derive(Serialize)]
pub struct Hover {
pub range: Range,
pub contents: Vec<MarkdownString>,
}
#[derive(Serialize, Deserialize, Clone, Copy)]
#[serde(rename_all = "camelCase")]
pub struct Range {
pub start_line_number: u32,
pub start... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm/rust-analyzer | solana_public_repos/solana-playground/solana-playground/wasm/rust-analyzer/src/to_proto.rs | //! Conversion of `rust-analyzer` specific types to `return_types` equivalents.
use ide_db::rust_doc::is_rust_fence;
use crate::return_types;
/// Convert text range.
pub(crate) fn text_range(
range: ide::TextRange,
line_index: &ide::LineIndex,
) -> return_types::Range {
let start = line_index.line_col(ra... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm/rust-analyzer | solana_public_repos/solana-playground/solana-playground/wasm/rust-analyzer/src/world_state.rs | use std::{collections::BTreeMap, fmt::Display, sync::Arc};
use cargo_toml::Manifest;
use cfg::CfgOptions;
use hir::db::DefDatabase;
use ide::{
Analysis, AnalysisHost, Change, CompletionConfig, CrateGraph, CrateId, DiagnosticsConfig,
Edition, FileId, FilePosition, HoverConfig, HoverDocFormat, Indel, InlayHintsC... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm/rust-analyzer | solana_public_repos/solana-playground/solana-playground/wasm/rust-analyzer/src/utils.rs | use ide_db::base_db::{CrateGraph, CrateId, FileId, FileSet, SourceRoot, VfsPath};
/// Search the given source roots to find the crate with a matching name.
pub fn get_file_id<'a, 'b>(name: &'a str, source_roots: &'b Vec<SourceRoot>) -> Option<&'b FileId> {
source_roots
.iter()
.find_map(|root| root... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm | solana_public_repos/solana-playground/solana-playground/wasm/solana-cli/Cargo.toml | [package]
name = "solana-cli-wasm"
version = "1.11.0"
description = "Solana CLI for Solana Playground with WASM."
authors = ["Acheron <acheroncrypto@gmail.com>"]
repository = "https://github.com/solana-playground/solana-playground"
license = "GPL-3.0"
homepage = "https://beta.solpg.io"
edition = "2021"
keywords = ["sol... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm/solana-cli | solana_public_repos/solana-playground/solana-playground/wasm/solana-cli/src/lib.rs | #![allow(clippy::arithmetic_side_effects)]
#![allow(dead_code)]
macro_rules! ACCOUNT_STRING {
() => {
r#", one of:
* a base58-encoded public key"#
};
}
macro_rules! pubkey {
($arg:expr, $help:expr) => {
$arg.takes_value(true)
.validator(solana_clap_v3_utils_wasm::input_... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm/solana-cli | solana_public_repos/solana-playground/solana-playground/wasm/solana-cli/src/clap.rs | use clap::{Arg, Command};
use solana_clap_v3_utils_wasm::{
input_validators::{is_url, is_url_or_moniker},
keypair::SKIP_SEED_PHRASE_VALIDATION_ARG,
};
use crate::{
cli::{DEFAULT_CONFIRM_TX_TIMEOUT_SECONDS, DEFAULT_RPC_TIMEOUT_SECONDS},
commands::{
cluster_query::ClusterQuerySubCommands, config:... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm/solana-cli | solana_public_repos/solana-playground/solana-playground/wasm/solana-cli/src/wasm.rs | use std::{collections::HashMap, panic, rc::Rc, time::Duration};
use clap::ArgMatches;
use solana_clap_v3_utils_wasm::{
input_validators::normalize_to_url_if_moniker, keypair::CliSigners,
};
use solana_cli_config_wasm::{Config, ConfigInput};
use solana_cli_output_wasm::cli_output::{get_name_value_or, OutputFormat};... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm/solana-cli | solana_public_repos/solana-playground/solana-playground/wasm/solana-cli/src/cli.rs | use std::{collections::HashMap, error, rc::Rc, time::Duration};
use clap::ArgMatches;
use num_traits::FromPrimitive;
use solana_clap_v3_utils_wasm::{
input_parsers::value_of,
keypair::{CliSigners, SignerIndex},
};
use solana_cli_output_wasm::cli_output::{
get_name_value, CliSignature, CliValidatorsSortOrde... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm/solana-cli/src | solana_public_repos/solana-playground/solana-playground/wasm/solana-cli/src/utils/memo.rs | use solana_sdk::{instruction::Instruction, pubkey::Pubkey};
pub trait WithMemo {
fn with_memo<T: AsRef<str>>(self, memo: Option<T>) -> Self;
}
impl WithMemo for Vec<Instruction> {
fn with_memo<T: AsRef<str>>(mut self, memo: Option<T>) -> Self {
if let Some(memo) = &memo {
let memo = memo.a... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm/solana-cli/src | solana_public_repos/solana-playground/solana-playground/wasm/solana-cli/src/utils/checks.rs | use solana_client_wasm::WasmClient;
use solana_client_wasm::{ClientError, ClientResult};
use solana_sdk::{
commitment_config::CommitmentConfig, message::Message, native_token::lamports_to_sol,
pubkey::Pubkey,
};
use crate::cli::CliError;
pub async fn check_account_for_fee(
rpc_client: &WasmClient,
acc... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm/solana-cli/src | solana_public_repos/solana-playground/solana-playground/wasm/solana-cli/src/utils/spend_utils.rs | use clap::ArgMatches;
use solana_clap_v3_utils_wasm::{input_parsers::lamports_of_sol, offline::SIGN_ONLY_ARG};
use solana_client_wasm::WasmClient;
use solana_sdk::{
commitment_config::CommitmentConfig, hash::Hash, message::Message,
native_token::lamports_to_sol, pubkey::Pubkey,
};
use crate::{
cli::CliErro... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm/solana-cli/src | solana_public_repos/solana-playground/solana-playground/wasm/solana-cli/src/utils/blockhash_query.rs | use clap::ArgMatches;
use solana_clap_v3_utils_wasm::{
input_parsers::{pubkey_of, value_of},
nonce::NONCE_ARG,
offline::{BLOCKHASH_ARG, SIGN_ONLY_ARG},
};
use solana_client_wasm::utils::rpc_config::BlockhashQuery;
pub fn blockhash_query_from_matches(matches: &ArgMatches) -> BlockhashQuery {
let blockha... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm/solana-cli/src | solana_public_repos/solana-playground/solana-playground/wasm/solana-cli/src/utils/mod.rs | pub mod blockhash_query;
pub mod checks;
pub mod memo;
pub mod spend_utils;
| 0 |
solana_public_repos/solana-playground/solana-playground/wasm/solana-cli/src | solana_public_repos/solana-playground/solana-playground/wasm/solana-cli/src/commands/feature.rs | use std::{cmp::Ordering, collections::HashMap, fmt, rc::Rc, str::FromStr};
use clap::{Arg, ArgMatches, Command};
use console::style;
use serde::{Deserialize, Serialize};
use solana_clap_v3_utils_wasm::{input_parsers::*, input_validators::*};
use solana_cli_output_wasm::{
cli_output::{QuietDisplay, VerboseDisplay},... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm/solana-cli/src | solana_public_repos/solana-playground/solana-playground/wasm/solana-cli/src/commands/inflation.rs | use std::rc::Rc;
use clap::{Arg, ArgMatches, Command};
use solana_clap_v3_utils_wasm::input_parsers::{pubkeys_of, value_of};
use solana_cli_output_wasm::cli_output::{
CliEpochRewardshMetadata, CliInflation, CliKeyedEpochReward, CliKeyedEpochRewards,
};
use solana_client_wasm::WasmClient;
use solana_remote_wallet::... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm/solana-cli/src | solana_public_repos/solana-playground/solana-playground/wasm/solana-cli/src/commands/config.rs | use clap::{Arg, ArgGroup, Command};
pub trait ConfigSubCommands {
fn config_subcommands(self) -> Self;
}
impl ConfigSubCommands for Command<'_> {
fn config_subcommands(self) -> Self {
self.subcommand(
Command::new("config")
.about("Solana command-line tool configuration set... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm/solana-cli/src | solana_public_repos/solana-playground/solana-playground/wasm/solana-cli/src/commands/stake.rs | use std::{ops::Deref, rc::Rc};
use clap::{Arg, ArgMatches, Command};
use solana_clap_v3_utils_wasm::{input_parsers::*, input_validators::*};
use solana_cli_output_wasm::cli_output::{
CliEpochReward, CliStakeHistory, CliStakeHistoryEntry, CliStakeState, CliStakeType,
OutputFormat,
};
use solana_client_wasm::{ut... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm/solana-cli/src | solana_public_repos/solana-playground/solana-playground/wasm/solana-cli/src/commands/cluster_query.rs | use std::{
collections::{BTreeMap, HashMap},
fmt,
rc::Rc,
str::FromStr,
time::Duration,
};
use clap::{Arg, ArgMatches, Command};
use serde::{Deserialize, Serialize};
use solana_clap_v3_utils_wasm::{
input_parsers::{pubkey_of_signer, pubkeys_of_multiple_signers, value_of},
input_validators::... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm/solana-cli/src | solana_public_repos/solana-playground/solana-playground/wasm/solana-cli/src/commands/validator_info.rs | // use {
// crate::{
// cli::{CliCommand, CliCommandInfo, CliConfig, CliError, ProcessResult},
// spend_utils::{resolve_spend_tx_and_check_account_balance, SpendAmount},
// },
// bincode::deserialize,
// clap::{App, AppSettings, Arg, ArgMatches, SubCommand},
// reqwest::blocking::Cli... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm/solana-cli/src | solana_public_repos/solana-playground/solana-playground/wasm/solana-cli/src/commands/nonce.rs | use clap::{Arg, ArgMatches, Command};
use solana_clap_v3_utils_wasm::{
input_parsers::*,
input_validators::*,
keypair::{generate_unique_signers, SignerIndex},
memo::{memo_arg, MEMO_ARG},
nonce::*,
};
use solana_cli_output_wasm::cli_output::CliNonceAccount;
use solana_client_wasm::{
utils::nonce_... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm/solana-cli/src | solana_public_repos/solana-playground/solana-playground/wasm/solana-cli/src/commands/mod.rs | pub mod cluster_query;
pub mod config;
pub mod feature;
pub mod inflation;
pub mod nonce;
pub mod program;
pub mod stake;
pub mod validator_info;
pub mod vote;
pub mod wallet;
| 0 |
solana_public_repos/solana-playground/solana-playground/wasm/solana-cli/src | solana_public_repos/solana-playground/solana-playground/wasm/solana-cli/src/commands/wallet.rs | use std::rc::Rc;
use clap::{Arg, ArgMatches, Command};
use solana_clap_v3_utils_wasm::{
fee_payer::{fee_payer_arg, FEE_PAYER_ARG},
input_parsers::{lamports_of_sol, pubkey_of, pubkey_of_signer, signer_of},
input_validators::{is_amount_or_all, is_derived_address_seed},
keypair::{generate_unique_signers, ... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm/solana-cli/src | solana_public_repos/solana-playground/solana-playground/wasm/solana-cli/src/commands/vote.rs | use std::rc::Rc;
use clap::{Arg, ArgMatches, Command};
use solana_clap_v3_utils_wasm::{
fee_payer::{fee_payer_arg, FEE_PAYER_ARG},
input_parsers::*,
input_validators::*,
keypair::{generate_unique_signers, SignerIndex},
memo::{memo_arg, MEMO_ARG},
nonce::*,
offline::*,
};
use solana_cli_outp... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm/solana-cli/src | solana_public_repos/solana-playground/solana-playground/wasm/solana-cli/src/commands/program.rs | use std::{mem::size_of, rc::Rc, str::FromStr};
use clap::{Arg, ArgMatches, Command};
use solana_clap_v3_utils_wasm::{
input_parsers::{pubkey_of, pubkey_of_signer, signer_of},
input_validators::is_valid_signer,
keypair::{generate_unique_signers, SignerIndex},
};
use solana_cli_output_wasm::cli_output::{
... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm/utils | solana_public_repos/solana-playground/solana-playground/wasm/utils/solana-cli-config/Cargo.toml | [package]
name = "solana-cli-config-wasm"
authors = ["Acheron <acheroncrypto@gmail.com>"]
description = "Solana CLI config for WASM."
version = "1.11.0"
repository = "https://github.com/solana-playground/solana-playground"
license = "Apache-2.0"
homepage = "https://beta.solpg.io"
edition = "2021"
keywords = ["solana", ... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm/utils/solana-cli-config | solana_public_repos/solana-playground/solana-playground/wasm/utils/solana-cli-config/src/config.rs | // Wallet settings that can be configured for long-term use
use {
serde_derive::{Deserialize, Serialize},
std::{collections::HashMap, io, path::Path},
url::Url,
};
lazy_static! {
/// The default path to the CLI configuration file.
///
/// This is a [lazy_static] of `Option<String>`, the value o... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm/utils/solana-cli-config | solana_public_repos/solana-playground/solana-playground/wasm/utils/solana-cli-config/src/lib.rs | //! Loading and saving the Solana CLI configuration file.
//!
//! The configuration file used by the Solana CLI includes information about the
//! RPC node to connect to, the path to the user's signing source, and more.
//! Other software than the Solana CLI may wish to access the same configuration
//! and signer.
//!... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm/utils/solana-cli-config | solana_public_repos/solana-playground/solana-playground/wasm/utils/solana-cli-config/src/config_input.rs | use {
crate::Config, solana_clap_v3_utils_wasm::input_validators::normalize_to_url_if_moniker,
solana_sdk::commitment_config::CommitmentConfig, std::str::FromStr,
};
pub enum SettingType {
Explicit,
Computed,
SystemDefault,
}
pub struct ConfigInput {
pub json_rpc_url: String,
pub websocket... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm/utils | solana_public_repos/solana-playground/solana-playground/wasm/utils/solana-playground-utils/Cargo.toml | [package]
name = "solana-playground-utils-wasm"
version = "0.1.0"
description = "WASM utils for Solana Playground."
authors = ["Acheron <acheroncrypto@gmail.com>"]
repository = "https://github.com/solana-playground/solana-playground"
license = "Apache-2.0"
homepage = "https://beta.solpg.io"
edition = "2021"
keywords = ... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm/utils/solana-playground-utils | solana_public_repos/solana-playground/solana-playground/wasm/utils/solana-playground-utils/src/js.rs | use wasm_bindgen::prelude::*;
#[wasm_bindgen(raw_module = "/src/utils/pg/program-info.ts")]
extern "C" {
pub type PgProgramInfo;
/// Get the current program's IDL.
#[wasm_bindgen(static_method_of = PgProgramInfo, js_name = "getIdlStr")]
pub fn idl_string() -> Option<String>;
/// Get the current p... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm/utils/solana-playground-utils | solana_public_repos/solana-playground/solana-playground/wasm/utils/solana-playground-utils/src/lib.rs | #[cfg(feature = "js")]
pub mod js;
| 0 |
solana_public_repos/solana-playground/solana-playground/wasm/utils | solana_public_repos/solana-playground/solana-playground/wasm/utils/solana-cli-output/Cargo.toml | [package]
name = "solana-cli-output-wasm"
version = "1.11.0"
description = "Solana WASM CLI output."
authors = ["Acheron <acheroncrypto@gmail.com>"]
repository = "https://github.com/solana-playground/solana-playground"
license = "Apache-2.0"
homepage = "https://beta.solpg.io"
edition = "2021"
keywords = ["solana", "pla... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm/utils/solana-cli-output | solana_public_repos/solana-playground/solana-playground/wasm/utils/solana-cli-output/src/lib.rs | #![allow(dead_code)]
#![allow(unused_imports)]
#![allow(unused_variables)]
#[macro_use]
extern crate serde_derive;
pub mod cli_output;
pub mod cli_version;
| 0 |
solana_public_repos/solana-playground/solana-playground/wasm/utils/solana-cli-output | solana_public_repos/solana-playground/solana-playground/wasm/utils/solana-cli-output/src/cli_output.rs | use std::{
collections::{BTreeMap, HashMap},
fmt, io,
time::Duration,
};
use chrono::{DateTime, Local, NaiveDateTime, SecondsFormat, TimeZone, Utc};
use clap::ArgMatches;
use console::{style, Emoji};
use serde::Serialize;
use solana_cli_config_wasm::SettingType;
use solana_client_wasm::utils::rpc_response:... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm/utils/solana-cli-output | solana_public_repos/solana-playground/solana-playground/wasm/utils/solana-cli-output/src/cli_version.rs | use {
serde::{Deserialize, Deserializer, Serialize, Serializer},
std::{fmt, str::FromStr},
};
#[derive(Default, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone)]
pub struct CliVersion(Option<semver::Version>);
impl CliVersion {
pub fn unknown_version() -> Self {
Self(None)
}
}
impl fmt::Di... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm/utils | solana_public_repos/solana-playground/solana-playground/wasm/utils/solana-extra/Cargo.toml | [package]
name = "solana-extra-wasm"
version = "1.18.0" # mirror solana-sdk version
description = "Solana WASM compatible utilities."
authors = ["Acheron <acheroncrypto@gmail.com>"]
repository = "https://github.com/solana-playground/solana-playground"
license = "Apache-2.0"
homepage = "https://beta.solpg.io"
edition = ... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm/utils | solana_public_repos/solana-playground/solana-playground/wasm/utils/solana-extra/build.rs | extern crate rustc_version;
use rustc_version::{version_meta, Channel};
fn main() {
// Copied and adapted from
// https://github.com/Kimundi/rustc-version-rs/blob/1d692a965f4e48a8cb72e82cda953107c0d22f47/README.md#example
// Licensed under Apache-2.0 + MIT
match version_meta().unwrap().channel {
... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm/utils/solana-extra | solana_public_repos/solana-playground/solana-playground/wasm/utils/solana-extra/src/runtime.rs | use std::fmt;
#[derive(Debug, PartialEq, Eq, Serialize, Deserialize, AbiExample, AbiEnumVisitor, Clone, Copy)]
pub enum RewardType {
Fee,
Rent,
Staking,
Voting,
}
impl fmt::Display for RewardType {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(
f,
... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm/utils/solana-extra | solana_public_repos/solana-playground/solana-playground/wasm/utils/solana-extra/src/lib.rs | #![cfg_attr(NIGHTLY, feature(min_specialization))]
#![allow(dead_code)]
#[macro_use]
extern crate serde_derive;
#[macro_use]
extern crate solana_frozen_abi_macro;
pub mod account_decoder;
pub mod program;
pub mod runtime;
pub mod transaction_status;
pub mod utils;
| 0 |
solana_public_repos/solana-playground/solana-playground/wasm/utils/solana-extra | solana_public_repos/solana-playground/solana-playground/wasm/utils/solana-extra/src/transaction_status.rs | use std::fmt;
use serde_json::Value;
use solana_sdk::{
clock::{Slot, UnixTimestamp},
instruction::CompiledInstruction,
message::{
v0::{self, LoadedAddresses, LoadedMessage, MessageAddressTableLookup},
AccountKeys, Message, MessageHeader, VersionedMessage,
},
transaction::{
R... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm/utils/solana-extra | solana_public_repos/solana-playground/solana-playground/wasm/utils/solana-extra/src/utils.rs | use std::time::Duration;
use fluvio_wasm_timer::Delay;
pub async fn sleep(ms: u64) {
Delay::new(Duration::from_millis(ms)).await.ok();
}
| 0 |
solana_public_repos/solana-playground/solana-playground/wasm/utils/solana-extra/src | solana_public_repos/solana-playground/solana-playground/wasm/utils/solana-extra/src/program/mod.rs | pub mod spl_associated_token_account;
pub mod spl_memo;
pub mod spl_token;
pub mod spl_token_2022;
pub mod vote;
| 0 |
solana_public_repos/solana-playground/solana-playground/wasm/utils/solana-extra/src/program | solana_public_repos/solana-playground/solana-playground/wasm/utils/solana-extra/src/program/vote/vote_instruction.rs | //! Vote program instructions
use {
crate::program::vote::{
id,
vote_state::{Vote, VoteAuthorize, VoteInit, VoteState, VoteStateUpdate},
},
serde_derive::{Deserialize, Serialize},
solana_sdk::{
hash::Hash,
instruction::{AccountMeta, Instruction},
pubkey::Pubkey,
... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm/utils/solana-extra/src/program | solana_public_repos/solana-playground/solana-playground/wasm/utils/solana-extra/src/program/vote/authorized_voters.rs | use {
serde_derive::{Deserialize, Serialize},
solana_sdk::{clock::Epoch, pubkey::Pubkey},
std::collections::BTreeMap,
};
#[derive(Debug, Default, Serialize, Deserialize, PartialEq, Eq, Clone, AbiExample)]
pub struct AuthorizedVoters {
authorized_voters: BTreeMap<Epoch, Pubkey>,
}
impl AuthorizedVoters... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm/utils/solana-extra/src/program | solana_public_repos/solana-playground/solana-playground/wasm/utils/solana-extra/src/program/vote/mod.rs | pub mod authorized_voters;
pub mod vote_error;
pub mod vote_instruction;
pub mod vote_state;
pub use solana_sdk::vote::program::{check_id, id};
| 0 |
solana_public_repos/solana-playground/solana-playground/wasm/utils/solana-extra/src/program | solana_public_repos/solana-playground/solana-playground/wasm/utils/solana-extra/src/program/vote/vote_error.rs | //! Vote program errors
use {
num_derive::{FromPrimitive, ToPrimitive},
solana_sdk::decode_error::DecodeError,
thiserror::Error,
};
/// Reasons the vote might have had an error
#[derive(Error, Debug, Clone, PartialEq, Eq, FromPrimitive, ToPrimitive)]
pub enum VoteError {
#[error("vote already recorded... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm/utils/solana-extra/src/program/vote | solana_public_repos/solana-playground/solana-playground/wasm/utils/solana-extra/src/program/vote/vote_state/vote_state_versions.rs | use {super::*, crate::program::vote::vote_state::vote_state_0_23_5::VoteState0_23_5};
#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, Clone)]
pub enum VoteStateVersions {
V0_23_5(Box<VoteState0_23_5>),
Current(Box<VoteState>),
}
impl VoteStateVersions {
pub fn new_current(vote_state: VoteState) -> ... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm/utils/solana-extra/src/program/vote | solana_public_repos/solana-playground/solana-playground/wasm/utils/solana-extra/src/program/vote/vote_state/mod.rs | use {
crate::program::vote::{authorized_voters::AuthorizedVoters, id, vote_error::VoteError},
bincode::{deserialize, serialize_into, ErrorKind},
serde_derive::{Deserialize, Serialize},
solana_sdk::{
account::{AccountSharedData, ReadableAccount, WritableAccount},
clock::{Epoch, Slot, Unix... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm/utils/solana-extra/src/program/vote | solana_public_repos/solana-playground/solana-playground/wasm/utils/solana-extra/src/program/vote/vote_state/vote_state_0_23_5.rs | use super::*;
const MAX_ITEMS: usize = 32;
#[derive(Debug, Default, Serialize, Deserialize, PartialEq, Eq, Clone)]
pub struct VoteState0_23_5 {
/// the node that votes in this account
pub node_pubkey: Pubkey,
/// the signer for vote transactions
pub authorized_voter: Pubkey,
/// when the authoriz... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm/utils/solana-extra/src/program | solana_public_repos/solana-playground/solana-playground/wasm/utils/solana-extra/src/program/spl_token/error.rs | //! Error types
use num_derive::FromPrimitive;
use solana_sdk::{decode_error::DecodeError, program_error::ProgramError};
use thiserror::Error;
/// Errors that may be returned by the Token program.
#[derive(Clone, Debug, Eq, Error, FromPrimitive, PartialEq)]
pub enum TokenError {
// 0
/// Lamport balance below... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm/utils/solana-extra/src/program | solana_public_repos/solana-playground/solana-playground/wasm/utils/solana-extra/src/program/spl_token/mod.rs | pub mod instruction;
pub mod native_mint;
pub mod state;
mod error;
use solana_sdk::{
declare_id, entrypoint::ProgramResult, program_error::ProgramError, pubkey::Pubkey,
};
// Convert the UI representation of a token amount (using the decimals field defined in its mint)
/// to the raw amount
pub fn ui_amount_to_... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm/utils/solana-extra/src/program | solana_public_repos/solana-playground/solana-playground/wasm/utils/solana-extra/src/program/spl_token/native_mint.rs | //! The Mint that represents the native token
/// There are 10^9 lamports in one SOL
pub const DECIMALS: u8 = 9;
// The Mint for native SOL Token accounts
solana_sdk::declare_id!("So11111111111111111111111111111111111111112");
| 0 |
solana_public_repos/solana-playground/solana-playground/wasm/utils/solana-extra/src/program | solana_public_repos/solana-playground/solana-playground/wasm/utils/solana-extra/src/program/spl_token/state.rs | //! State transition types
use super::instruction::MAX_SIGNERS;
use arrayref::{array_mut_ref, array_ref, array_refs, mut_array_refs};
use num_enum::TryFromPrimitive;
use solana_sdk::{
incinerator,
program_error::ProgramError,
program_option::COption,
program_pack::{IsInitialized, Pack, Sealed},
pub... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm/utils/solana-extra/src/program | solana_public_repos/solana-playground/solana-playground/wasm/utils/solana-extra/src/program/spl_token/instruction.rs | //! Instruction types
use std::{convert::TryInto, mem::size_of};
use solana_sdk::{
instruction::{AccountMeta, Instruction},
program_error::ProgramError,
program_option::COption,
pubkey::Pubkey,
sysvar,
};
use super::{check_program_account, error::TokenError};
/// Minimum number of multisignature... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm/utils/solana-extra/src/program | solana_public_repos/solana-playground/solana-playground/wasm/utils/solana-extra/src/program/spl_associated_token_account/mod.rs | //! Convention for associating token accounts with a user wallet
#![deny(missing_docs)]
#![forbid(unsafe_code)]
// mod entrypoint;
// pub mod error;
pub mod instruction;
// pub mod processor;
// pub mod tools;
use solana_sdk::{
declare_id,
instruction::{AccountMeta, Instruction},
pubkey::Pubkey,
syste... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm/utils/solana-extra/src/program | solana_public_repos/solana-playground/solana-playground/wasm/utils/solana-extra/src/program/spl_associated_token_account/instruction.rs | //! Program instructions
use {
super::{get_associated_token_address_with_program_id, id},
assert_matches::assert_matches,
borsh::{BorshDeserialize, BorshSchema, BorshSerialize},
solana_sdk::{
instruction::{AccountMeta, Instruction},
pubkey::Pubkey,
system_program,
},
};
///... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm/utils/solana-extra/src/program | solana_public_repos/solana-playground/solana-playground/wasm/utils/solana-extra/src/program/spl_token_2022/processor.rs | //! Program state processor
use {
crate::program::spl_token_2022::{
amount_to_ui_amount_string_trimmed, check_program_account, cmp_pubkeys,
error::TokenError,
extension::{
// TODO:
// confidential_transfer::{self, ConfidentialTransferAccount},
default_acc... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm/utils/solana-extra/src/program | solana_public_repos/solana-playground/solana-playground/wasm/utils/solana-extra/src/program/spl_token_2022/pod.rs | //! Solana program utilities for Plain Old Data types
use {
bytemuck::{Pod, Zeroable},
solana_sdk::{program_error::ProgramError, program_option::COption, pubkey::Pubkey},
std::convert::TryFrom,
};
/// A Pubkey that encodes `None` as all `0`, meant to be usable as a Pod type,
/// similar to all NonZero* num... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm/utils/solana-extra/src/program | solana_public_repos/solana-playground/solana-playground/wasm/utils/solana-extra/src/program/spl_token_2022/error.rs | //! Error types
use {
num_derive::FromPrimitive,
solana_sdk::{decode_error::DecodeError, program_error::ProgramError},
thiserror::Error,
};
/// Errors that may be returned by the Token program.
#[derive(Clone, Debug, Eq, Error, FromPrimitive, PartialEq)]
pub enum TokenError {
// 0
/// Lamport bala... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm/utils/solana-extra/src/program | solana_public_repos/solana-playground/solana-playground/wasm/utils/solana-extra/src/program/spl_token_2022/mod.rs | pub mod extension;
pub mod generic_token_account;
pub mod instruction;
pub mod native_mint;
pub mod processor;
pub mod state;
mod error;
mod pod;
use solana_sdk::{
declare_id,
entrypoint::ProgramResult,
program_error::ProgramError,
program_memory::sol_memcmp,
pubkey::{Pubkey, PUBKEY_BYTES},
};
us... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm/utils/solana-extra/src/program | solana_public_repos/solana-playground/solana-playground/wasm/utils/solana-extra/src/program/spl_token_2022/native_mint.rs | //! The Mint that represents the native token
/// There are 10^9 lamports in one SOL
pub const DECIMALS: u8 = 9;
// The Mint for native SOL Token accounts
solana_sdk::declare_id!("So11111111111111111111111111111111111111112");
// New token id is causing incorrect program id since it's not deployed yet
// solana_sdk:... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm/utils/solana-extra/src/program | solana_public_repos/solana-playground/solana-playground/wasm/utils/solana-extra/src/program/spl_token_2022/state.rs | //! State transition types
use {
crate::program::{
spl_token,
spl_token_2022::{
extension::AccountType,
generic_token_account::{is_initialized_account, GenericTokenAccount},
instruction::MAX_SIGNERS,
},
},
arrayref::{array_mut_ref, array_ref, arra... | 0 |
solana_public_repos/solana-playground/solana-playground/wasm/utils/solana-extra/src/program | solana_public_repos/solana-playground/solana-playground/wasm/utils/solana-extra/src/program/spl_token_2022/generic_token_account.rs | //! Generic Token Account, copied from spl_token::state
// Remove all of this and use spl-token's version once token 3.4.0 is released
use {
super::state::AccountState,
solana_sdk::pubkey::{Pubkey, PUBKEY_BYTES},
};
const SPL_TOKEN_ACCOUNT_MINT_OFFSET: usize = 0;
const SPL_TOKEN_ACCOUNT_OWNER_OFFSET: usize = 3... | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.