#![allow(clippy::large_enum_variant, clippy::too_many_arguments)]
use std::collections::BTreeMap;
use serde::{Deserialize, Serialize};
use serde_json::{Map, Number, Value};
use crate::transport::{arg, positional};
use crate::{Carbium, Result};
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
#[non_exhaustive]
pub enum AccountKeySource {
#[serde(rename = "transaction")]
Transaction,
#[serde(rename = "lookupTable")]
LookupTable,
#[serde(untagged)]
Other(String),
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
#[non_exhaustive]
pub enum AddressHistoryDetails {
#[serde(rename = "signatures")]
Signatures,
#[serde(rename = "full")]
Full,
#[serde(untagged)]
Other(String),
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
#[non_exhaustive]
pub enum BinaryEncoding {
#[serde(rename = "base58")]
Base58,
#[serde(rename = "base64")]
Base64,
#[serde(untagged)]
Other(String),
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
#[non_exhaustive]
pub enum Commitment {
#[serde(rename = "processed")]
Processed,
#[serde(rename = "confirmed")]
Confirmed,
#[serde(rename = "finalized")]
Finalized,
#[serde(untagged)]
Other(String),
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
#[non_exhaustive]
pub enum DasSortBy {
#[serde(rename = "id")]
Id,
#[serde(rename = "created")]
Created,
#[serde(rename = "updated")]
Updated,
#[serde(rename = "recent_action")]
RecentAction,
#[serde(rename = "none")]
None,
#[serde(untagged)]
Other(String),
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
#[non_exhaustive]
pub enum DasTokenType {
#[serde(rename = "fungible")]
Fungible,
#[serde(rename = "nonFungible")]
NonFungible,
#[serde(rename = "regularNft")]
RegularNft,
#[serde(rename = "compressedNft")]
CompressedNft,
#[serde(rename = "all")]
All,
#[serde(untagged)]
Other(String),
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
#[non_exhaustive]
pub enum Encoding {
#[serde(rename = "base58")]
Base58,
#[serde(rename = "base64")]
Base64,
#[serde(rename = "base64+zstd")]
Base64Zstd,
#[serde(rename = "jsonParsed")]
JsonParsed,
#[serde(untagged)]
Other(String),
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
#[non_exhaustive]
pub enum HistoryStatusFilter {
#[serde(rename = "succeeded")]
Succeeded,
#[serde(rename = "failed")]
Failed,
#[serde(rename = "any")]
Any,
#[serde(untagged)]
Other(String),
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
#[non_exhaustive]
pub enum HistoryTokenAccounts {
#[serde(rename = "none")]
None,
#[serde(rename = "balanceChanged")]
BalanceChanged,
#[serde(rename = "all")]
All,
#[serde(untagged)]
Other(String),
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
#[non_exhaustive]
pub enum PriorityLevel {
#[serde(rename = "Min")]
Min,
#[serde(rename = "Low")]
Low,
#[serde(rename = "Medium")]
Medium,
#[serde(rename = "High")]
High,
#[serde(rename = "VeryHigh")]
VeryHigh,
#[serde(rename = "UnsafeMax")]
UnsafeMax,
#[serde(untagged)]
Other(String),
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
#[non_exhaustive]
pub enum SortOrder {
#[serde(rename = "asc")]
Asc,
#[serde(rename = "desc")]
Desc,
#[serde(untagged)]
Other(String),
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
#[non_exhaustive]
pub enum TransactionDetails {
#[serde(rename = "full")]
Full,
#[serde(rename = "accounts")]
Accounts,
#[serde(rename = "signatures")]
Signatures,
#[serde(rename = "none")]
None,
#[serde(untagged)]
Other(String),
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
#[non_exhaustive]
pub enum TransactionEncoding {
#[serde(rename = "json")]
Json,
#[serde(rename = "jsonParsed")]
JsonParsed,
#[serde(rename = "base58")]
Base58,
#[serde(rename = "base64")]
Base64,
#[serde(untagged)]
Other(String),
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
#[non_exhaustive]
pub enum TransferDirection {
#[serde(rename = "in")]
In,
#[serde(rename = "out")]
Out,
#[serde(rename = "any")]
Any,
#[serde(untagged)]
Other(String),
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(untagged)]
#[non_exhaustive]
pub enum AccountDataEncoding {
BinaryEncoding(BinaryEncoding),
Text(String),
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct AccountInfo {
pub lamports: Number,
pub owner: Base58,
pub data: EncodedData,
pub executable: bool,
#[serde(rename = "rentEpoch")]
pub rent_epoch: Number,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub space: Option<Number>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
#[non_exhaustive]
pub struct AccountInfoConfig {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub commitment: Option<Commitment>,
#[serde(
rename = "minContextSlot",
default,
skip_serializing_if = "Option::is_none"
)]
pub min_context_slot: Option<u64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub encoding: Option<Encoding>,
#[serde(rename = "dataSlice", default, skip_serializing_if = "Option::is_none")]
pub data_slice: Option<DataSlice>,
}
pub type Base58 = String;
pub type Base64 = String;
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct Block {
pub blockhash: Base58,
#[serde(rename = "previousBlockhash")]
pub previous_blockhash: Base58,
#[serde(rename = "parentSlot")]
pub parent_slot: Number,
#[serde(rename = "blockHeight", default)]
pub block_height: Option<Number>,
#[serde(rename = "blockTime", default)]
pub block_time: Option<Number>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub transactions: Option<Vec<BlockTransactionsItem>>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub signatures: Option<Vec<Base58>>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub rewards: Option<Vec<Reward>>,
#[serde(
rename = "numRewardPartitions",
default,
skip_serializing_if = "Option::is_none"
)]
pub num_reward_partitions: Option<Number>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct BlockTransactionsItem {
pub transaction: EncodedTransaction,
#[serde(default)]
pub meta: Option<TransactionMeta>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub version: Option<TransactionVersion>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
#[non_exhaustive]
pub enum TransactionVersionText {
#[serde(rename = "legacy")]
Legacy,
#[serde(untagged)]
Other(String),
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
#[serde(untagged)]
#[non_exhaustive]
pub enum TransactionVersion {
Text(TransactionVersionText),
Number(u8),
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct BlockCommitment {
#[serde(default)]
pub commitment: Option<Vec<Number>>,
#[serde(rename = "totalStake")]
pub total_stake: Number,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
#[non_exhaustive]
pub struct BlockConfig {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub commitment: Option<Commitment>,
#[serde(
rename = "minContextSlot",
default,
skip_serializing_if = "Option::is_none"
)]
pub min_context_slot: Option<u64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub encoding: Option<TransactionEncoding>,
#[serde(
rename = "maxSupportedTransactionVersion",
default,
skip_serializing_if = "Option::is_none"
)]
pub max_supported_transaction_version: Option<u64>,
#[serde(
rename = "transactionDetails",
default,
skip_serializing_if = "Option::is_none"
)]
pub transaction_details: Option<TransactionDetails>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub rewards: Option<bool>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct BlockProduction {
#[serde(rename = "byIdentity")]
pub by_identity: RecordBase58NumberNumber,
pub range: BlockProductionRange,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct BlockProductionRange {
#[serde(rename = "firstSlot")]
pub first_slot: Number,
#[serde(rename = "lastSlot")]
pub last_slot: Number,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
#[non_exhaustive]
pub struct BlockProductionConfig {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub commitment: Option<Commitment>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub identity: Option<Base58>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub range: Option<BlockProductionConfigRange>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
#[non_exhaustive]
pub struct BlockProductionConfigRange {
#[serde(rename = "firstSlot")]
pub first_slot: u64,
#[serde(rename = "lastSlot", default, skip_serializing_if = "Option::is_none")]
pub last_slot: Option<u64>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
#[non_exhaustive]
pub struct ClusterNode {
pub pubkey: Base58,
#[serde(default)]
pub gossip: Option<String>,
#[serde(default)]
pub tpu: Option<String>,
#[serde(rename = "tpuQuic", default, skip_serializing_if = "Option::is_none")]
pub tpu_quic: Option<String>,
#[serde(default)]
pub rpc: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub pubsub: Option<String>,
#[serde(default)]
pub version: Option<String>,
#[serde(rename = "featureSet", default)]
pub feature_set: Option<Number>,
#[serde(rename = "shredVersion", default)]
pub shred_version: Option<Number>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
#[non_exhaustive]
pub struct CommitmentConfig {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub commitment: Option<Commitment>,
#[serde(
rename = "minContextSlot",
default,
skip_serializing_if = "Option::is_none"
)]
pub min_context_slot: Option<u64>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct Context {
pub slot: Number,
#[serde(
rename = "apiVersion",
default,
skip_serializing_if = "Option::is_none"
)]
pub api_version: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
#[non_exhaustive]
pub struct DasAsset {
pub interface: String,
pub id: Base58,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub content: Option<RecordStringUnknown>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub authorities: Option<Vec<DasAssetAuthoritiesItem>>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub compression: Option<RecordStringUnknown>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub grouping: Option<Vec<DasAssetGroupingItem>>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub royalty: Option<RecordStringUnknown>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub creators: Option<Vec<DasAssetCreatorsItem>>,
pub ownership: DasAssetOwnership,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub supply: Option<RecordStringUnknown>,
pub mutable: bool,
pub burnt: bool,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub token_info: Option<RecordStringUnknown>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub mint_extensions: Option<RecordStringUnknown>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub plugins: Option<RecordStringUnknown>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub external_plugins: Option<Vec<Value>>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub mpl_core_info: Option<RecordStringUnknown>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub inscription: Option<RecordStringUnknown>,
#[serde(flatten)]
pub extra: Map<String, Value>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
#[non_exhaustive]
pub struct DasAssetAuthoritiesItem {
pub address: Base58,
pub scopes: Vec<String>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
#[non_exhaustive]
pub struct DasAssetGroupingItem {
pub group_key: String,
pub group_value: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub verified: Option<bool>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct DasAssetCreatorsItem {
pub address: Base58,
pub share: Number,
pub verified: bool,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
#[non_exhaustive]
pub struct DasAssetOwnership {
pub frozen: bool,
pub delegated: bool,
#[serde(default)]
pub delegate: Option<Base58>,
pub ownership_model: String,
pub owner: Base58,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct DasAssetList {
pub total: Number,
pub limit: Number,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub page: Option<Number>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub cursor: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub before: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub after: Option<String>,
pub items: Vec<DasAsset>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub grand_total: Option<Number>,
#[serde(
rename = "nativeBalance",
default,
skip_serializing_if = "Option::is_none"
)]
pub native_balance: Option<DasAssetListNativeBalance>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub last_indexed_slot: Option<Number>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct DasAssetListNativeBalance {
pub lamports: Number,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
#[non_exhaustive]
pub struct DasDisplayOptions {
#[serde(
rename = "showFungible",
default,
skip_serializing_if = "Option::is_none"
)]
pub show_fungible: Option<bool>,
#[serde(
rename = "showNativeBalance",
default,
skip_serializing_if = "Option::is_none"
)]
pub show_native_balance: Option<bool>,
#[serde(
rename = "showZeroBalance",
default,
skip_serializing_if = "Option::is_none"
)]
pub show_zero_balance: Option<bool>,
#[serde(
rename = "showCollectionMetadata",
default,
skip_serializing_if = "Option::is_none"
)]
pub show_collection_metadata: Option<bool>,
#[serde(
rename = "showUnverifiedCollections",
default,
skip_serializing_if = "Option::is_none"
)]
pub show_unverified_collections: Option<bool>,
#[serde(
rename = "showGrandTotal",
default,
skip_serializing_if = "Option::is_none"
)]
pub show_grand_total: Option<bool>,
#[serde(
rename = "showInscription",
default,
skip_serializing_if = "Option::is_none"
)]
pub show_inscription: Option<bool>,
#[serde(
rename = "showRawData",
default,
skip_serializing_if = "Option::is_none"
)]
pub show_raw_data: Option<bool>,
#[serde(
rename = "requireFullIndex",
default,
skip_serializing_if = "Option::is_none"
)]
pub require_full_index: Option<bool>,
#[serde(
rename = "showSystemMetadata",
default,
skip_serializing_if = "Option::is_none"
)]
pub show_system_metadata: Option<bool>,
#[serde(
rename = "showClosedAccounts",
default,
skip_serializing_if = "Option::is_none"
)]
pub show_closed_accounts: Option<bool>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct DasEdition {
pub mint: Base58,
pub edition_address: Base58,
pub edition: Number,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct DasEditionList {
pub total: Number,
pub limit: Number,
pub page: Number,
pub master_edition_address: Base58,
pub supply: Number,
#[serde(default)]
pub max_supply: Option<Number>,
pub editions: Vec<DasEdition>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(untagged)]
#[non_exhaustive]
pub enum DasGrouping {
Tuple(String, String),
Collection(DasGroupingCollection),
GroupKey(DasGroupingGroupKey),
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
#[non_exhaustive]
pub struct DasGroupingCollection {
pub collection: String,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
#[non_exhaustive]
pub struct DasGroupingGroupKey {
pub group_key: String,
pub group_value: String,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct DasSort {
#[serde(rename = "sortBy")]
pub sort_by: DasSortBy,
#[serde(
rename = "sortDirection",
default,
skip_serializing_if = "Option::is_none"
)]
pub sort_direction: Option<SortOrder>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct DasTokenAccount {
pub address: Base58,
pub mint: Base58,
pub owner: Base58,
pub amount: Number,
pub delegated_amount: Number,
pub frozen: bool,
#[serde(flatten)]
pub extra: Map<String, Value>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct DasTokenAccountList {
pub total: Number,
pub limit: Number,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub page: Option<Number>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub cursor: Option<String>,
pub token_accounts: Vec<DasTokenAccount>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub last_indexed_slot: Option<Number>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
#[non_exhaustive]
pub struct DataSlice {
pub offset: u64,
pub length: u64,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(untagged)]
#[non_exhaustive]
pub enum EncodedData {
Tuple(String, AccountDataEncoding),
ParsedData(ParsedData),
Text(String),
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(untagged)]
#[non_exhaustive]
pub enum EncodedTransaction {
Tuple(String, BinaryEncoding),
Message(EncodedTransactionMessage),
AccountKeys(EncodedTransactionAccountKeys),
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
#[non_exhaustive]
pub struct EncodedTransactionMessage {
pub signatures: Vec<Base58>,
pub message: RecordStringUnknown,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
#[non_exhaustive]
pub struct EncodedTransactionAccountKeys {
pub signatures: Vec<Base58>,
#[serde(rename = "accountKeys")]
pub account_keys: Vec<TransactionAccountKey>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct EpochInfo {
#[serde(rename = "absoluteSlot")]
pub absolute_slot: Number,
#[serde(rename = "blockHeight")]
pub block_height: Number,
pub epoch: Number,
#[serde(rename = "slotIndex")]
pub slot_index: Number,
#[serde(rename = "slotsInEpoch")]
pub slots_in_epoch: Number,
#[serde(rename = "transactionCount", default)]
pub transaction_count: Option<Number>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct EpochSchedule {
#[serde(rename = "slotsPerEpoch")]
pub slots_per_epoch: Number,
#[serde(rename = "leaderScheduleSlotOffset")]
pub leader_schedule_slot_offset: Number,
pub warmup: bool,
#[serde(rename = "firstNormalEpoch")]
pub first_normal_epoch: Number,
#[serde(rename = "firstNormalSlot")]
pub first_normal_slot: Number,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct HighestSnapshotSlot {
pub full: Number,
#[serde(default)]
pub incremental: Option<Number>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct InflationGovernor {
pub initial: Number,
pub terminal: Number,
pub taper: Number,
pub foundation: Number,
#[serde(rename = "foundationTerm")]
pub foundation_term: Number,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct InflationRate {
pub total: Number,
pub validator: Number,
pub foundation: Number,
pub epoch: Number,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct InflationReward {
pub epoch: Number,
#[serde(rename = "effectiveSlot")]
pub effective_slot: Number,
pub amount: Number,
#[serde(rename = "postBalance")]
pub post_balance: Number,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub commission: Option<Number>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct InnerInstructions {
pub index: Number,
pub instructions: Vec<Value>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct KeyedAccount {
pub pubkey: Base58,
pub account: AccountInfo,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct LargestAccount {
pub address: Base58,
pub lamports: Number,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct LatestBlockhash {
pub blockhash: Base58,
#[serde(rename = "lastValidBlockHeight")]
pub last_valid_block_height: Number,
}
pub type LeaderSchedule = Option<RecordBase58NumberArray>;
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
#[non_exhaustive]
pub struct LeaderScheduleConfig {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub commitment: Option<Commitment>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub identity: Option<Base58>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
#[non_exhaustive]
pub struct LoadedAddresses {
pub writable: Vec<Base58>,
pub readonly: Vec<Base58>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct ParsedData {
pub program: String,
pub parsed: Value,
pub space: Number,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct PerformanceSample {
pub slot: Number,
#[serde(rename = "numTransactions")]
pub num_transactions: Number,
#[serde(
rename = "numNonVoteTransactions",
default,
skip_serializing_if = "Option::is_none"
)]
pub num_non_vote_transactions: Option<Number>,
#[serde(rename = "numSlots")]
pub num_slots: Number,
#[serde(rename = "samplePeriodSecs")]
pub sample_period_secs: Number,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct Prices {
#[serde(rename = "solUsd")]
pub sol_usd: Number,
#[serde(rename = "builtUnix")]
pub built_unix: Number,
pub priced: Number,
pub stale: Number,
pub noroute: Number,
pub total: Number,
pub rows: Vec<(Base58, Option<Number>, Number, Base58)>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
#[non_exhaustive]
pub struct PricesParams {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub mints: Option<Vec<Base58>>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct PrioritizationFee {
pub slot: Number,
#[serde(rename = "prioritizationFee")]
pub prioritization_fee: Number,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
#[non_exhaustive]
pub struct PriorityFeeEstimate {
#[serde(
rename = "priorityFeeEstimate",
default,
skip_serializing_if = "Option::is_none"
)]
pub priority_fee_estimate: Option<Number>,
#[serde(
rename = "priorityFeeLevels",
default,
skip_serializing_if = "Option::is_none"
)]
pub priority_fee_levels: Option<PriorityFeeEstimatePriorityFeeLevels>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct PriorityFeeEstimatePriorityFeeLevels {
pub min: Number,
pub low: Number,
pub medium: Number,
pub high: Number,
#[serde(rename = "veryHigh")]
pub very_high: Number,
#[serde(rename = "unsafeMax")]
pub unsafe_max: Number,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
#[non_exhaustive]
pub struct PriorityFeeEstimateParams {
#[serde(
rename = "accountKeys",
default,
skip_serializing_if = "Option::is_none"
)]
pub account_keys: Option<Vec<Base58>>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub transaction: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub options: Option<PriorityFeeEstimateParamsOptions>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
#[non_exhaustive]
pub struct PriorityFeeEstimateParamsOptions {
#[serde(
rename = "priorityLevel",
default,
skip_serializing_if = "Option::is_none"
)]
pub priority_level: Option<PriorityLevel>,
#[serde(
rename = "includeAllPriorityFeeLevels",
default,
skip_serializing_if = "Option::is_none"
)]
pub include_all_priority_fee_levels: Option<bool>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub recommended: Option<bool>,
#[serde(
rename = "lookbackSlots",
default,
skip_serializing_if = "Option::is_none"
)]
pub lookback_slots: Option<u64>,
#[serde(
rename = "transactionEncoding",
default,
skip_serializing_if = "Option::is_none"
)]
pub transaction_encoding: Option<BinaryEncoding>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
#[non_exhaustive]
pub struct ProgramAccountsConfig {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub commitment: Option<Commitment>,
#[serde(
rename = "minContextSlot",
default,
skip_serializing_if = "Option::is_none"
)]
pub min_context_slot: Option<u64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub encoding: Option<Encoding>,
#[serde(rename = "dataSlice", default, skip_serializing_if = "Option::is_none")]
pub data_slice: Option<DataSlice>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub filters: Option<Vec<ProgramAccountsFilter>>,
#[serde(
rename = "withContext",
default,
skip_serializing_if = "Option::is_none"
)]
pub with_context: Option<bool>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
#[non_exhaustive]
pub struct ProgramAccountsFilter {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub memcmp: Option<ProgramAccountsFilterMemcmp>,
#[serde(rename = "dataSize", default, skip_serializing_if = "Option::is_none")]
pub data_size: Option<u64>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
#[non_exhaustive]
pub struct ProgramAccountsFilterMemcmp {
pub offset: u64,
pub bytes: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub encoding: Option<BinaryEncoding>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct QnPriorityFeeLevels {
pub extreme: Number,
pub high: Number,
pub medium: Number,
pub low: Number,
pub percentiles: RecordStringNumber,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct QnPriorityFees {
pub context: QnPriorityFeesContext,
pub per_compute_unit: QnPriorityFeeLevels,
pub per_transaction: QnPriorityFeeLevels,
pub recommended: Number,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct QnPriorityFeesContext {
pub slot: Number,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
#[non_exhaustive]
pub struct QnPriorityFeesParams {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub last_n_blocks: Option<u64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub account: Option<Base58>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub api_version: Option<u64>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct Quote {
#[serde(rename = "srcAmountIn")]
pub src_amount_in: String,
#[serde(rename = "destAmountOut")]
pub dest_amount_out: String,
#[serde(rename = "minAmountOut")]
pub min_amount_out: String,
#[serde(rename = "slippageBps")]
pub slippage_bps: Number,
#[serde(rename = "swapMode")]
pub swap_mode: String,
#[serde(rename = "inputMint")]
pub input_mint: Base58,
#[serde(rename = "outputMint")]
pub output_mint: Base58,
#[serde(rename = "routePlan")]
pub route_plan: Vec<RouteLeg>,
#[serde(rename = "quoteId")]
pub quote_id: String,
#[serde(
rename = "platformFee",
default,
skip_serializing_if = "Option::is_none"
)]
pub platform_fee: Option<QuotePlatformFee>,
#[serde(rename = "txVersion", default, skip_serializing_if = "Option::is_none")]
pub tx_version: Option<Number>,
#[serde(rename = "swapTag", default, skip_serializing_if = "Option::is_none")]
pub swap_tag: Option<Number>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub partial: Option<bool>,
#[serde(
rename = "requestedAmountIn",
default,
skip_serializing_if = "Option::is_none"
)]
pub requested_amount_in: Option<String>,
#[serde(flatten)]
pub extra: Map<String, Value>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct QuotePlatformFee {
pub amount: String,
#[serde(rename = "feeBps")]
pub fee_bps: Number,
pub mint: Base58,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct QuoteHealth {
pub ok: bool,
#[serde(rename = "quoteUpstream")]
pub quote_upstream: Value,
#[serde(rename = "canBuild")]
pub can_build: bool,
pub families: Vec<String>,
#[serde(rename = "poolStore")]
pub pool_store: Value,
#[serde(rename = "chainRpc")]
pub chain_rpc: Value,
pub priced: Number,
pub total: Number,
pub stale: Number,
#[serde(rename = "tableAgeSecs")]
pub table_age_secs: Number,
pub quote_refusal_ratio: Number,
#[serde(flatten)]
pub extra: Map<String, Value>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct QuoteParams {
pub src_mint: Base58,
pub dst_mint: Base58,
pub amount_in: QuoteParamsAmountIn,
pub slippage_bps: u64,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub dex: Option<QuoteParamsDex>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub dexes: Option<QuoteParamsDexes>,
#[serde(rename = "txVersion", default, skip_serializing_if = "Option::is_none")]
pub tx_version: Option<u8>,
#[serde(rename = "swapTag", default, skip_serializing_if = "Option::is_none")]
pub swap_tag: Option<u8>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(untagged)]
#[non_exhaustive]
pub enum QuoteParamsAmountIn {
Number(u64),
Text(String),
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(untagged)]
#[non_exhaustive]
pub enum QuoteParamsDex {
Text(String),
List(Vec<String>),
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(untagged)]
#[non_exhaustive]
pub enum QuoteParamsDexes {
Text(String),
List(Vec<String>),
}
pub type RecordBase58NumberArray = BTreeMap<String, Vec<Number>>;
pub type RecordBase58NumberNumber = BTreeMap<String, (Number, Number)>;
pub type RecordStringNumber = BTreeMap<String, Number>;
pub type RecordStringUnknown = Map<String, Value>;
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct Reward {
pub pubkey: Base58,
pub lamports: Number,
#[serde(rename = "postBalance")]
pub post_balance: Number,
#[serde(rename = "rewardType", default)]
pub reward_type: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub commission: Option<Number>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct RouteLeg {
pub hop: Number,
pub percent: String,
#[serde(rename = "swapInfo")]
pub swap_info: RouteLegSwapInfo,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
#[non_exhaustive]
pub struct RouteLegSwapInfo {
#[serde(rename = "ammKey")]
pub amm_key: Base58,
pub label: String,
#[serde(rename = "inputMint")]
pub input_mint: Base58,
#[serde(rename = "outputMint")]
pub output_mint: Base58,
#[serde(rename = "inAmount")]
pub in_amount: String,
#[serde(rename = "outAmount")]
pub out_amount: String,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
#[non_exhaustive]
pub struct SearchAssetsParams {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub page: Option<u64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub limit: Option<u64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub cursor: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub before: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub after: Option<String>,
#[serde(rename = "sortBy", default, skip_serializing_if = "Option::is_none")]
pub sort_by: Option<DasSort>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub options: Option<DasDisplayOptions>,
#[serde(
rename = "displayOptions",
default,
skip_serializing_if = "Option::is_none"
)]
pub display_options: Option<DasDisplayOptions>,
#[serde(
rename = "ownerAddress",
default,
skip_serializing_if = "Option::is_none"
)]
pub owner_address: Option<Base58>,
#[serde(
rename = "creatorAddress",
default,
skip_serializing_if = "Option::is_none"
)]
pub creator_address: Option<Base58>,
#[serde(
rename = "creatorVerified",
default,
skip_serializing_if = "Option::is_none"
)]
pub creator_verified: Option<bool>,
#[serde(
rename = "authorityAddress",
default,
skip_serializing_if = "Option::is_none"
)]
pub authority_address: Option<Base58>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub grouping: Option<DasGrouping>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub interface: Option<String>,
#[serde(rename = "tokenType", default, skip_serializing_if = "Option::is_none")]
pub token_type: Option<DasTokenType>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub frozen: Option<bool>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub delegate: Option<Base58>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub burnt: Option<bool>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub compressed: Option<bool>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub negate: Option<bool>,
#[serde(
rename = "conditionType",
default,
skip_serializing_if = "Option::is_none"
)]
pub condition_type: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
#[non_exhaustive]
pub struct SendTransactionConfig {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub encoding: Option<BinaryEncoding>,
#[serde(
rename = "skipPreflight",
default,
skip_serializing_if = "Option::is_none"
)]
pub skip_preflight: Option<bool>,
#[serde(
rename = "preflightCommitment",
default,
skip_serializing_if = "Option::is_none"
)]
pub preflight_commitment: Option<Commitment>,
#[serde(
rename = "maxRetries",
default,
skip_serializing_if = "Option::is_none"
)]
pub max_retries: Option<u64>,
#[serde(
rename = "minContextSlot",
default,
skip_serializing_if = "Option::is_none"
)]
pub min_context_slot: Option<u64>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct SignatureInfo {
pub signature: Base58,
pub slot: Number,
#[serde(default)]
pub err: Option<TransactionError>,
#[serde(default)]
pub memo: Option<String>,
#[serde(rename = "blockTime", default)]
pub block_time: Option<Number>,
#[serde(
rename = "confirmationStatus",
default,
skip_serializing_if = "Option::is_none"
)]
pub confirmation_status: Option<Commitment>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
#[non_exhaustive]
pub struct SignaturesForAddressConfig {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub commitment: Option<Commitment>,
#[serde(
rename = "minContextSlot",
default,
skip_serializing_if = "Option::is_none"
)]
pub min_context_slot: Option<u64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub limit: Option<u64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub before: Option<Base58>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub until: Option<Base58>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct SignatureStatus {
pub slot: Number,
#[serde(default)]
pub confirmations: Option<Number>,
#[serde(default)]
pub err: Option<TransactionError>,
#[serde(rename = "confirmationStatus", default)]
pub confirmation_status: Option<Commitment>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub status: Option<SignatureStatusStatus>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(untagged)]
#[non_exhaustive]
pub enum SignatureStatusStatus {
Ok(SignatureStatusStatusOk),
Err(SignatureStatusStatusErr),
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
#[non_exhaustive]
pub struct SignatureStatusStatusOk {
#[serde(rename = "Ok")]
pub ok: (),
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct SignatureStatusStatusErr {
#[serde(rename = "Err")]
pub err: TransactionError,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
#[non_exhaustive]
pub struct SimulateTransactionConfig {
#[serde(rename = "sigVerify", default, skip_serializing_if = "Option::is_none")]
pub sig_verify: Option<bool>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub commitment: Option<Commitment>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub encoding: Option<BinaryEncoding>,
#[serde(
rename = "replaceRecentBlockhash",
default,
skip_serializing_if = "Option::is_none"
)]
pub replace_recent_blockhash: Option<bool>,
#[serde(
rename = "minContextSlot",
default,
skip_serializing_if = "Option::is_none"
)]
pub min_context_slot: Option<u64>,
#[serde(
rename = "innerInstructions",
default,
skip_serializing_if = "Option::is_none"
)]
pub inner_instructions: Option<bool>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub accounts: Option<SimulateTransactionConfigAccounts>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
#[non_exhaustive]
pub struct SimulateTransactionConfigAccounts {
pub addresses: Vec<Base58>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub encoding: Option<Encoding>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
#[non_exhaustive]
pub struct SimulateTransactionResult {
#[serde(default)]
pub err: Option<TransactionError>,
#[serde(default)]
pub logs: Option<Vec<String>>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub accounts: Option<Vec<Option<AccountInfo>>>,
#[serde(
rename = "unitsConsumed",
default,
skip_serializing_if = "Option::is_none"
)]
pub units_consumed: Option<Number>,
#[serde(
rename = "returnData",
default,
skip_serializing_if = "Option::is_none"
)]
pub return_data: Option<SimulateTransactionResultReturnData>,
#[serde(
rename = "innerInstructions",
default,
skip_serializing_if = "Option::is_none"
)]
pub inner_instructions: Option<Vec<InnerInstructions>>,
#[serde(
rename = "replacementBlockhash",
default,
skip_serializing_if = "Option::is_none"
)]
pub replacement_blockhash: Option<SimulateTransactionResultReplacementBlockhash>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct SimulateTransactionResultReturnData {
#[serde(rename = "programId")]
pub program_id: Base58,
pub data: (Base64, String),
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct SimulateTransactionResultReplacementBlockhash {
pub blockhash: Base58,
#[serde(rename = "lastValidBlockHeight")]
pub last_valid_block_height: Number,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
#[non_exhaustive]
pub struct SlotRange {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub gte: Option<u64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub gt: Option<u64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub lte: Option<u64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub lt: Option<u64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub eq: Option<u64>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct Supply {
pub total: Number,
pub circulating: Number,
#[serde(rename = "nonCirculating")]
pub non_circulating: Number,
#[serde(rename = "nonCirculatingAccounts")]
pub non_circulating_accounts: Vec<Base58>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct Swap {
pub transaction: Base64,
pub blockhash: Base58,
#[serde(rename = "lastValidBlockHeight")]
pub last_valid_block_height: Number,
#[serde(rename = "minAmountOut")]
pub min_amount_out: String,
#[serde(rename = "computeUnitLimit")]
pub compute_unit_limit: Number,
#[serde(rename = "priorityFeeLamports")]
pub priority_fee_lamports: String,
#[serde(rename = "rentLamports", default)]
pub rent_lamports: Option<String>,
#[serde(rename = "ataCreates")]
pub ata_creates: Number,
#[serde(rename = "txVersion", default, skip_serializing_if = "Option::is_none")]
pub tx_version: Option<Number>,
#[serde(rename = "swapTag", default, skip_serializing_if = "Option::is_none")]
pub swap_tag: Option<Number>,
#[serde(
rename = "routeRerouted",
default,
skip_serializing_if = "Option::is_none"
)]
pub route_rerouted: Option<SwapRouteRerouted>,
#[serde(flatten)]
pub extra: Map<String, Value>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
#[non_exhaustive]
pub struct SwapRouteRerouted {
pub why: String,
#[serde(rename = "deadPool", default, skip_serializing_if = "Option::is_none")]
pub dead_pool: Option<Base58>,
#[serde(rename = "quotedOut")]
pub quoted_out: String,
#[serde(rename = "reroutedOut")]
pub rerouted_out: String,
pub floor: String,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
#[non_exhaustive]
pub struct SwapParams {
pub quote_id: String,
pub user_pubkey: Base58,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub compute_unit_price_micro_lamports: Option<u64>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(untagged)]
#[non_exhaustive]
pub enum TokenAccountsFilter {
Mint(TokenAccountsFilterMint),
ProgramId(TokenAccountsFilterProgramId),
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
#[non_exhaustive]
pub struct TokenAccountsFilterMint {
pub mint: Base58,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
#[non_exhaustive]
pub struct TokenAccountsFilterProgramId {
#[serde(rename = "programId")]
pub program_id: Base58,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct TokenAmount {
pub amount: String,
pub decimals: Number,
#[serde(rename = "uiAmount", default)]
pub ui_amount: Option<Number>,
#[serde(rename = "uiAmountString")]
pub ui_amount_string: String,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct TokenBalance {
#[serde(rename = "accountIndex")]
pub account_index: Number,
pub mint: Base58,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub owner: Option<Base58>,
#[serde(rename = "programId", default, skip_serializing_if = "Option::is_none")]
pub program_id: Option<Base58>,
#[serde(rename = "uiTokenAmount")]
pub ui_token_amount: TokenAmount,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct TransactionAccountKey {
pub pubkey: Base58,
pub signer: bool,
pub writable: bool,
pub source: AccountKeySource,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
#[non_exhaustive]
pub struct TransactionConfig {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub commitment: Option<Commitment>,
#[serde(
rename = "minContextSlot",
default,
skip_serializing_if = "Option::is_none"
)]
pub min_context_slot: Option<u64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub encoding: Option<TransactionEncoding>,
#[serde(
rename = "maxSupportedTransactionVersion",
default,
skip_serializing_if = "Option::is_none"
)]
pub max_supported_transaction_version: Option<u64>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(untagged)]
#[non_exhaustive]
pub enum TransactionError {
Text(String),
RecordStringUnknown(RecordStringUnknown),
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct TransactionMeta {
#[serde(default)]
pub err: Option<TransactionError>,
pub fee: Number,
#[serde(rename = "preBalances")]
pub pre_balances: Vec<Number>,
#[serde(rename = "postBalances")]
pub post_balances: Vec<Number>,
#[serde(
rename = "innerInstructions",
default,
skip_serializing_if = "Option::is_none"
)]
pub inner_instructions: Option<Vec<InnerInstructions>>,
#[serde(
rename = "preTokenBalances",
default,
skip_serializing_if = "Option::is_none"
)]
pub pre_token_balances: Option<Vec<TokenBalance>>,
#[serde(
rename = "postTokenBalances",
default,
skip_serializing_if = "Option::is_none"
)]
pub post_token_balances: Option<Vec<TokenBalance>>,
#[serde(
rename = "logMessages",
default,
skip_serializing_if = "Option::is_none"
)]
pub log_messages: Option<Vec<String>>,
#[serde(
rename = "loadedAddresses",
default,
skip_serializing_if = "Option::is_none"
)]
pub loaded_addresses: Option<LoadedAddresses>,
#[serde(
rename = "returnData",
default,
skip_serializing_if = "Option::is_none"
)]
pub return_data: Option<TransactionMetaReturnData>,
#[serde(
rename = "computeUnitsConsumed",
default,
skip_serializing_if = "Option::is_none"
)]
pub compute_units_consumed: Option<Number>,
#[serde(rename = "costUnits", default, skip_serializing_if = "Option::is_none")]
pub cost_units: Option<Number>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub rewards: Option<Vec<Reward>>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub status: Option<TransactionMetaStatus>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct TransactionMetaReturnData {
#[serde(rename = "programId")]
pub program_id: Base58,
pub data: (Base64, String),
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(untagged)]
#[non_exhaustive]
pub enum TransactionMetaStatus {
Ok(TransactionMetaStatusOk),
Err(TransactionMetaStatusErr),
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
#[non_exhaustive]
pub struct TransactionMetaStatusOk {
#[serde(rename = "Ok")]
pub ok: (),
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct TransactionMetaStatusErr {
#[serde(rename = "Err")]
pub err: TransactionError,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
#[non_exhaustive]
pub struct TransactionsForAddress {
pub data: Vec<TransactionsForAddressDataItem>,
#[serde(rename = "paginationToken", default)]
pub pagination_token: Option<String>,
#[serde(
rename = "historyFloor",
default,
skip_serializing_if = "Option::is_none"
)]
pub history_floor: Option<Number>,
#[serde(
rename = "droppedRows",
default,
skip_serializing_if = "Option::is_none"
)]
pub dropped_rows: Option<Number>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(untagged)]
#[non_exhaustive]
pub enum TransactionsForAddressDataItem {
SignatureInfo(SignatureInfo),
Meta(TransactionsForAddressDataItemMeta),
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct TransactionsForAddressDataItemMeta {
#[serde(rename = "transactionIndex")]
pub transaction_index: Number,
pub slot: Number,
pub transaction: EncodedTransaction,
#[serde(default)]
pub meta: Option<TransactionMeta>,
#[serde(rename = "blockTime", default, skip_serializing_if = "Option::is_none")]
pub block_time: Option<Number>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub version: Option<TransactionVersion>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
#[non_exhaustive]
pub struct TransactionsForAddressConfig {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub commitment: Option<Commitment>,
#[serde(
rename = "minContextSlot",
default,
skip_serializing_if = "Option::is_none"
)]
pub min_context_slot: Option<u64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub encoding: Option<TransactionEncoding>,
#[serde(
rename = "maxSupportedTransactionVersion",
default,
skip_serializing_if = "Option::is_none"
)]
pub max_supported_transaction_version: Option<u64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub limit: Option<u64>,
#[serde(
rename = "transactionDetails",
default,
skip_serializing_if = "Option::is_none"
)]
pub transaction_details: Option<AddressHistoryDetails>,
#[serde(rename = "sortOrder", default, skip_serializing_if = "Option::is_none")]
pub sort_order: Option<SortOrder>,
#[serde(
rename = "paginationToken",
default,
skip_serializing_if = "Option::is_none"
)]
pub pagination_token: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub filters: Option<TransactionsForAddressConfigFilters>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
#[non_exhaustive]
pub struct TransactionsForAddressConfigFilters {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub slot: Option<SlotRange>,
#[serde(rename = "blockTime", default, skip_serializing_if = "Option::is_none")]
pub block_time: Option<SlotRange>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub status: Option<HistoryStatusFilter>,
#[serde(
rename = "tokenAccounts",
default,
skip_serializing_if = "Option::is_none"
)]
pub token_accounts: Option<HistoryTokenAccounts>,
#[serde(
rename = "tokenTransfer",
default,
skip_serializing_if = "Option::is_none"
)]
pub token_transfer: Option<TransactionsForAddressConfigFiltersTokenTransfer>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
#[non_exhaustive]
pub struct TransactionsForAddressConfigFiltersTokenTransfer {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub with: Option<Base58>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub mint: Option<Base58>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub direction: Option<TransferDirection>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub amount: Option<SlotRange>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct TransactionWithMeta {
pub slot: Number,
pub transaction: EncodedTransaction,
#[serde(default)]
pub meta: Option<TransactionMeta>,
#[serde(rename = "blockTime", default, skip_serializing_if = "Option::is_none")]
pub block_time: Option<Number>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub version: Option<TransactionVersion>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
#[non_exhaustive]
pub struct Version {
#[serde(rename = "solana-core")]
pub solana_core: String,
#[serde(
rename = "feature-set",
default,
skip_serializing_if = "Option::is_none"
)]
pub feature_set: Option<Number>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct VoteAccount {
#[serde(rename = "votePubkey")]
pub vote_pubkey: Base58,
#[serde(rename = "nodePubkey")]
pub node_pubkey: Base58,
#[serde(rename = "activatedStake")]
pub activated_stake: Number,
#[serde(rename = "epochVoteAccount")]
pub epoch_vote_account: bool,
pub commission: Number,
#[serde(rename = "lastVote")]
pub last_vote: Number,
#[serde(rename = "epochCredits")]
pub epoch_credits: Vec<(Number, Number, Number)>,
#[serde(rename = "rootSlot")]
pub root_slot: Number,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
#[non_exhaustive]
pub struct VoteAccounts {
pub current: Vec<VoteAccount>,
pub delinquent: Vec<VoteAccount>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
#[non_exhaustive]
pub struct VoteAccountsConfig {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub commitment: Option<Commitment>,
#[serde(
rename = "votePubkey",
default,
skip_serializing_if = "Option::is_none"
)]
pub vote_pubkey: Option<Base58>,
#[serde(
rename = "keepUnstakedDelinquents",
default,
skip_serializing_if = "Option::is_none"
)]
pub keep_unstaked_delinquents: Option<bool>,
#[serde(
rename = "delinquentSlotDistance",
default,
skip_serializing_if = "Option::is_none"
)]
pub delinquent_slot_distance: Option<u64>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct WithContextAccountInfoNull {
pub context: Context,
#[serde(default)]
pub value: Option<AccountInfo>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct WithContextAccountInfoNullArray {
pub context: Context,
pub value: Vec<Option<AccountInfo>>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct WithContextBlockProduction {
pub context: Context,
pub value: BlockProduction,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct WithContextBoolean {
pub context: Context,
pub value: bool,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct WithContextKeyedAccountArray {
pub context: Context,
pub value: Vec<KeyedAccount>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct WithContextLargestAccountArray {
pub context: Context,
pub value: Vec<LargestAccount>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct WithContextLatestBlockhash {
pub context: Context,
pub value: LatestBlockhash,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct WithContextNumber {
pub context: Context,
pub value: Number,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct WithContextNumberNull {
pub context: Context,
#[serde(default)]
pub value: Option<Number>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct WithContextSignatureStatusNullArray {
pub context: Context,
pub value: Vec<Option<SignatureStatus>>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct WithContextSimulateTransactionResult {
pub context: Context,
pub value: SimulateTransactionResult,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct WithContextSupply {
pub context: Context,
pub value: Supply,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct WithContextTokenAmount {
pub context: Context,
pub value: TokenAmount,
}
#[cfg(feature = "ws")]
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
#[non_exhaustive]
pub enum BlockEncoding {
#[serde(rename = "json")]
Json,
#[serde(rename = "base64")]
Base64,
#[serde(rename = "base58")]
Base58,
#[serde(untagged)]
Other(String),
}
#[cfg(feature = "ws")]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(untagged)]
#[non_exhaustive]
pub enum BlockFilter {
Text(String),
MentionsAccountOrProgram(BlockFilterMentionsAccountOrProgram),
}
#[cfg(feature = "ws")]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
#[non_exhaustive]
pub struct BlockFilterMentionsAccountOrProgram {
#[serde(rename = "mentionsAccountOrProgram")]
pub mentions_account_or_program: Base58,
}
#[cfg(feature = "ws")]
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
#[non_exhaustive]
pub enum BlockSubscribeDetails {
#[serde(rename = "full")]
Full,
#[serde(rename = "signatures")]
Signatures,
#[serde(rename = "none")]
None,
#[serde(untagged)]
Other(String),
}
#[cfg(feature = "ws")]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(untagged)]
#[non_exhaustive]
pub enum LogsFilter {
Text(String),
Text1(String),
Mentions(LogsFilterMentions),
}
#[cfg(feature = "ws")]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
#[non_exhaustive]
pub struct LogsFilterMentions {
pub mentions: Vec<Base58>,
}
#[cfg(feature = "ws")]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(untagged)]
#[non_exhaustive]
pub enum MemcmpEncoding {
BinaryEncoding(BinaryEncoding),
Text(String),
}
#[cfg(feature = "ws")]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(untagged)]
#[non_exhaustive]
pub enum ProgramSubscribeFilter {
DataSize(ProgramSubscribeFilterDataSize),
Memcmp(ProgramSubscribeFilterMemcmp),
}
#[cfg(feature = "ws")]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
#[non_exhaustive]
pub struct ProgramSubscribeFilterDataSize {
#[serde(rename = "dataSize")]
pub data_size: u64,
}
#[cfg(feature = "ws")]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
#[non_exhaustive]
pub struct ProgramSubscribeFilterMemcmp {
pub memcmp: ProgramSubscribeFilterMemcmpMemcmp,
}
#[cfg(feature = "ws")]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
#[non_exhaustive]
pub struct ProgramSubscribeFilterMemcmpMemcmp {
pub offset: u64,
pub bytes: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub encoding: Option<MemcmpEncoding>,
}
#[cfg(feature = "ws")]
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
#[non_exhaustive]
pub enum SettledCommitment {
#[serde(rename = "confirmed")]
Confirmed,
#[serde(rename = "finalized")]
Finalized,
#[serde(untagged)]
Other(String),
}
#[cfg(feature = "ws")]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct WithContextAccountInfo {
pub context: Context,
pub value: AccountInfo,
}
#[cfg(feature = "ws")]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct WithContextBlockNotification {
pub context: Context,
pub value: WithContextBlockNotificationValue,
}
#[cfg(feature = "ws")]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct WithContextBlockNotificationValue {
pub slot: Number,
#[serde(default)]
pub err: Option<TransactionError>,
#[serde(default)]
pub block: Option<Block>,
}
#[cfg(feature = "ws")]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct WithContextKeyedAccount {
pub context: Context,
pub value: KeyedAccount,
}
#[cfg(feature = "ws")]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct WithContextLogsNotification {
pub context: Context,
pub value: WithContextLogsNotificationValue,
}
#[cfg(feature = "ws")]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
#[non_exhaustive]
pub struct WithContextLogsNotificationValue {
pub signature: Base58,
#[serde(default)]
pub err: Option<TransactionError>,
pub logs: Vec<String>,
}
#[cfg(feature = "ws")]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct WithContextSignatureNotification {
pub context: Context,
pub value: WithContextSignatureNotificationValue,
}
#[cfg(feature = "ws")]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
#[non_exhaustive]
pub struct WithContextSignatureNotificationValue {
#[serde(default)]
pub err: Option<TransactionError>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
#[non_exhaustive]
pub struct GetAssetParams {
pub id: Base58,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub options: Option<DasDisplayOptions>,
#[serde(
rename = "displayOptions",
default,
skip_serializing_if = "Option::is_none"
)]
pub display_options: Option<DasDisplayOptions>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
#[non_exhaustive]
pub struct GetAssetBatchParams {
pub ids: Vec<Base58>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub options: Option<DasDisplayOptions>,
#[serde(
rename = "displayOptions",
default,
skip_serializing_if = "Option::is_none"
)]
pub display_options: Option<DasDisplayOptions>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
#[non_exhaustive]
pub struct GetAssetsParams {
pub ids: Vec<Base58>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub options: Option<DasDisplayOptions>,
#[serde(
rename = "displayOptions",
default,
skip_serializing_if = "Option::is_none"
)]
pub display_options: Option<DasDisplayOptions>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
#[non_exhaustive]
pub struct GetAssetsByAuthorityParams {
#[serde(rename = "authorityAddress")]
pub authority_address: Base58,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub page: Option<u64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub limit: Option<u64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub cursor: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub before: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub after: Option<String>,
#[serde(rename = "sortBy", default, skip_serializing_if = "Option::is_none")]
pub sort_by: Option<DasSort>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub options: Option<DasDisplayOptions>,
#[serde(
rename = "displayOptions",
default,
skip_serializing_if = "Option::is_none"
)]
pub display_options: Option<DasDisplayOptions>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
#[non_exhaustive]
pub struct GetAssetsByCreatorParams {
#[serde(rename = "creatorAddress")]
pub creator_address: Base58,
#[serde(
rename = "onlyVerified",
default,
skip_serializing_if = "Option::is_none"
)]
pub only_verified: Option<bool>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub page: Option<u64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub limit: Option<u64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub cursor: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub before: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub after: Option<String>,
#[serde(rename = "sortBy", default, skip_serializing_if = "Option::is_none")]
pub sort_by: Option<DasSort>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub options: Option<DasDisplayOptions>,
#[serde(
rename = "displayOptions",
default,
skip_serializing_if = "Option::is_none"
)]
pub display_options: Option<DasDisplayOptions>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
#[non_exhaustive]
pub struct GetAssetsByGroupParams {
#[serde(rename = "groupKey")]
pub group_key: String,
#[serde(rename = "groupValue")]
pub group_value: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub page: Option<u64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub limit: Option<u64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub cursor: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub before: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub after: Option<String>,
#[serde(rename = "sortBy", default, skip_serializing_if = "Option::is_none")]
pub sort_by: Option<DasSort>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub options: Option<DasDisplayOptions>,
#[serde(
rename = "displayOptions",
default,
skip_serializing_if = "Option::is_none"
)]
pub display_options: Option<DasDisplayOptions>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
#[non_exhaustive]
pub struct GetAssetsByOwnerParams {
#[serde(rename = "ownerAddress")]
pub owner_address: Base58,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub page: Option<u64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub limit: Option<u64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub cursor: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub before: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub after: Option<String>,
#[serde(rename = "sortBy", default, skip_serializing_if = "Option::is_none")]
pub sort_by: Option<DasSort>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub options: Option<DasDisplayOptions>,
#[serde(
rename = "displayOptions",
default,
skip_serializing_if = "Option::is_none"
)]
pub display_options: Option<DasDisplayOptions>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
#[non_exhaustive]
pub struct GetBlocksConfig {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub commitment: Option<Commitment>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
#[non_exhaustive]
pub struct GetBlocksWithLimitConfig {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub commitment: Option<Commitment>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
#[non_exhaustive]
pub struct GetIdentityResult {
pub identity: Base58,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
#[non_exhaustive]
pub struct GetInflationGovernorConfig {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub commitment: Option<Commitment>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
#[non_exhaustive]
pub struct GetInflationRewardConfig {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub commitment: Option<Commitment>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub epoch: Option<u64>,
#[serde(
rename = "minContextSlot",
default,
skip_serializing_if = "Option::is_none"
)]
pub min_context_slot: Option<u64>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
#[non_exhaustive]
pub struct GetMinimumBalanceForRentExemptionConfig {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub commitment: Option<Commitment>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
#[non_exhaustive]
pub struct GetNftEditionsParams {
pub mint: Base58,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub page: Option<u64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub limit: Option<u64>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(untagged)]
#[non_exhaustive]
pub enum GetProgramAccountsResult {
List(Vec<KeyedAccount>),
WithContextKeyedAccountArray(WithContextKeyedAccountArray),
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
#[non_exhaustive]
pub struct GetSignatureStatusesConfig {
#[serde(
rename = "searchTransactionHistory",
default,
skip_serializing_if = "Option::is_none"
)]
pub search_transaction_history: Option<bool>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
#[non_exhaustive]
pub struct GetStakeMinimumDelegationConfig {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub commitment: Option<Commitment>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
#[non_exhaustive]
pub struct GetSupplyConfig {
#[serde(
rename = "excludeNonCirculatingAccountsList",
default,
skip_serializing_if = "Option::is_none"
)]
pub exclude_non_circulating_accounts_list: Option<bool>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub commitment: Option<Commitment>,
#[serde(
rename = "minContextSlot",
default,
skip_serializing_if = "Option::is_none"
)]
pub min_context_slot: Option<u64>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
#[non_exhaustive]
pub struct GetTokenAccountBalanceConfig {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub commitment: Option<Commitment>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
#[non_exhaustive]
pub struct GetTokenAccountsParams {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub owner: Option<Base58>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub mint: Option<Base58>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub page: Option<u64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub limit: Option<u64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub cursor: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub options: Option<GetTokenAccountsParamsOptions>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
#[non_exhaustive]
pub struct GetTokenAccountsParamsOptions {
#[serde(
rename = "showZeroBalance",
default,
skip_serializing_if = "Option::is_none"
)]
pub show_zero_balance: Option<bool>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
#[non_exhaustive]
pub struct GetTokenSupplyConfig {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub commitment: Option<Commitment>,
}
impl AccountInfoConfig {
pub fn new() -> Self {
Self {
commitment: None,
min_context_slot: None,
encoding: None,
data_slice: None,
}
}
}
impl BlockConfig {
pub fn new() -> Self {
Self {
commitment: None,
min_context_slot: None,
encoding: None,
max_supported_transaction_version: None,
transaction_details: None,
rewards: None,
}
}
}
impl BlockProductionConfigRange {
pub fn new(first_slot: u64) -> Self {
Self {
first_slot,
last_slot: None,
}
}
}
impl BlockProductionConfig {
pub fn new() -> Self {
Self {
commitment: None,
identity: None,
range: None,
}
}
}
impl CommitmentConfig {
pub fn new() -> Self {
Self {
commitment: None,
min_context_slot: None,
}
}
}
impl DasDisplayOptions {
pub fn new() -> Self {
Self {
show_fungible: None,
show_native_balance: None,
show_zero_balance: None,
show_collection_metadata: None,
show_unverified_collections: None,
show_grand_total: None,
show_inscription: None,
show_raw_data: None,
require_full_index: None,
show_system_metadata: None,
show_closed_accounts: None,
}
}
}
impl DasGroupingCollection {
pub fn new(collection: impl Into<String>) -> Self {
Self {
collection: collection.into(),
}
}
}
impl DasGroupingGroupKey {
pub fn new(group_key: impl Into<String>, group_value: impl Into<String>) -> Self {
Self {
group_key: group_key.into(),
group_value: group_value.into(),
}
}
}
impl DasSort {
pub fn new(sort_by: DasSortBy) -> Self {
Self {
sort_by,
sort_direction: None,
}
}
}
impl DataSlice {
pub fn new(offset: u64, length: u64) -> Self {
Self { offset, length }
}
}
impl LeaderScheduleConfig {
pub fn new() -> Self {
Self {
commitment: None,
identity: None,
}
}
}
impl PricesParams {
pub fn new() -> Self {
Self { mints: None }
}
}
impl PriorityFeeEstimateParamsOptions {
pub fn new() -> Self {
Self {
priority_level: None,
include_all_priority_fee_levels: None,
recommended: None,
lookback_slots: None,
transaction_encoding: None,
}
}
}
impl PriorityFeeEstimateParams {
pub fn new() -> Self {
Self {
account_keys: None,
transaction: None,
options: None,
}
}
}
impl ProgramAccountsConfig {
pub fn new() -> Self {
Self {
commitment: None,
min_context_slot: None,
encoding: None,
data_slice: None,
filters: None,
with_context: None,
}
}
}
impl ProgramAccountsFilterMemcmp {
pub fn new(offset: u64, bytes: impl Into<String>) -> Self {
Self {
offset,
bytes: bytes.into(),
encoding: None,
}
}
}
impl ProgramAccountsFilter {
pub fn new() -> Self {
Self {
memcmp: None,
data_size: None,
}
}
}
impl QnPriorityFeesParams {
pub fn new() -> Self {
Self {
last_n_blocks: None,
account: None,
api_version: None,
}
}
}
impl QuoteParams {
pub fn new(
src_mint: impl Into<String>,
dst_mint: impl Into<String>,
amount_in: QuoteParamsAmountIn,
slippage_bps: u64,
) -> Self {
Self {
src_mint: src_mint.into(),
dst_mint: dst_mint.into(),
amount_in,
slippage_bps,
dex: None,
dexes: None,
tx_version: None,
swap_tag: None,
}
}
}
impl SearchAssetsParams {
pub fn new() -> Self {
Self {
page: None,
limit: None,
cursor: None,
before: None,
after: None,
sort_by: None,
options: None,
display_options: None,
owner_address: None,
creator_address: None,
creator_verified: None,
authority_address: None,
grouping: None,
interface: None,
token_type: None,
frozen: None,
delegate: None,
burnt: None,
compressed: None,
negate: None,
condition_type: None,
}
}
}
impl SendTransactionConfig {
pub fn new() -> Self {
Self {
encoding: None,
skip_preflight: None,
preflight_commitment: None,
max_retries: None,
min_context_slot: None,
}
}
}
impl SignaturesForAddressConfig {
pub fn new() -> Self {
Self {
commitment: None,
min_context_slot: None,
limit: None,
before: None,
until: None,
}
}
}
impl SimulateTransactionConfigAccounts {
pub fn new(addresses: Vec<Base58>) -> Self {
Self {
addresses,
encoding: None,
}
}
}
impl SimulateTransactionConfig {
pub fn new() -> Self {
Self {
sig_verify: None,
commitment: None,
encoding: None,
replace_recent_blockhash: None,
min_context_slot: None,
inner_instructions: None,
accounts: None,
}
}
}
impl SlotRange {
pub fn new() -> Self {
Self {
gte: None,
gt: None,
lte: None,
lt: None,
eq: None,
}
}
}
impl SwapParams {
pub fn new(quote_id: impl Into<String>, user_pubkey: impl Into<String>) -> Self {
Self {
quote_id: quote_id.into(),
user_pubkey: user_pubkey.into(),
compute_unit_price_micro_lamports: None,
}
}
}
impl TokenAccountsFilterMint {
pub fn new(mint: impl Into<String>) -> Self {
Self { mint: mint.into() }
}
}
impl TokenAccountsFilterProgramId {
pub fn new(program_id: impl Into<String>) -> Self {
Self {
program_id: program_id.into(),
}
}
}
impl TransactionConfig {
pub fn new() -> Self {
Self {
commitment: None,
min_context_slot: None,
encoding: None,
max_supported_transaction_version: None,
}
}
}
impl TransactionsForAddressConfigFiltersTokenTransfer {
pub fn new() -> Self {
Self {
with: None,
mint: None,
direction: None,
amount: None,
}
}
}
impl TransactionsForAddressConfigFilters {
pub fn new() -> Self {
Self {
slot: None,
block_time: None,
status: None,
token_accounts: None,
token_transfer: None,
}
}
}
impl TransactionsForAddressConfig {
pub fn new() -> Self {
Self {
commitment: None,
min_context_slot: None,
encoding: None,
max_supported_transaction_version: None,
limit: None,
transaction_details: None,
sort_order: None,
pagination_token: None,
filters: None,
}
}
}
impl VoteAccountsConfig {
pub fn new() -> Self {
Self {
commitment: None,
vote_pubkey: None,
keep_unstaked_delinquents: None,
delinquent_slot_distance: None,
}
}
}
#[cfg(feature = "ws")]
impl BlockFilterMentionsAccountOrProgram {
pub fn new(mentions_account_or_program: impl Into<String>) -> Self {
Self {
mentions_account_or_program: mentions_account_or_program.into(),
}
}
}
#[cfg(feature = "ws")]
impl LogsFilterMentions {
pub fn new(mentions: Vec<Base58>) -> Self {
Self { mentions }
}
}
#[cfg(feature = "ws")]
impl ProgramSubscribeFilterDataSize {
pub fn new(data_size: u64) -> Self {
Self { data_size }
}
}
#[cfg(feature = "ws")]
impl ProgramSubscribeFilterMemcmpMemcmp {
pub fn new(offset: u64, bytes: impl Into<String>) -> Self {
Self {
offset,
bytes: bytes.into(),
encoding: None,
}
}
}
#[cfg(feature = "ws")]
impl ProgramSubscribeFilterMemcmp {
pub fn new(memcmp: ProgramSubscribeFilterMemcmpMemcmp) -> Self {
Self { memcmp }
}
}
impl GetAssetParams {
pub fn new(id: impl Into<String>) -> Self {
Self {
id: id.into(),
options: None,
display_options: None,
}
}
}
impl GetAssetBatchParams {
pub fn new(ids: Vec<Base58>) -> Self {
Self {
ids,
options: None,
display_options: None,
}
}
}
impl GetAssetsParams {
pub fn new(ids: Vec<Base58>) -> Self {
Self {
ids,
options: None,
display_options: None,
}
}
}
impl GetAssetsByAuthorityParams {
pub fn new(authority_address: impl Into<String>) -> Self {
Self {
authority_address: authority_address.into(),
page: None,
limit: None,
cursor: None,
before: None,
after: None,
sort_by: None,
options: None,
display_options: None,
}
}
}
impl GetAssetsByCreatorParams {
pub fn new(creator_address: impl Into<String>) -> Self {
Self {
creator_address: creator_address.into(),
only_verified: None,
page: None,
limit: None,
cursor: None,
before: None,
after: None,
sort_by: None,
options: None,
display_options: None,
}
}
}
impl GetAssetsByGroupParams {
pub fn new(group_key: impl Into<String>, group_value: impl Into<String>) -> Self {
Self {
group_key: group_key.into(),
group_value: group_value.into(),
page: None,
limit: None,
cursor: None,
before: None,
after: None,
sort_by: None,
options: None,
display_options: None,
}
}
}
impl GetAssetsByOwnerParams {
pub fn new(owner_address: impl Into<String>) -> Self {
Self {
owner_address: owner_address.into(),
page: None,
limit: None,
cursor: None,
before: None,
after: None,
sort_by: None,
options: None,
display_options: None,
}
}
}
impl GetBlocksConfig {
pub fn new() -> Self {
Self { commitment: None }
}
}
impl GetBlocksWithLimitConfig {
pub fn new() -> Self {
Self { commitment: None }
}
}
impl GetInflationGovernorConfig {
pub fn new() -> Self {
Self { commitment: None }
}
}
impl GetInflationRewardConfig {
pub fn new() -> Self {
Self {
commitment: None,
epoch: None,
min_context_slot: None,
}
}
}
impl GetMinimumBalanceForRentExemptionConfig {
pub fn new() -> Self {
Self { commitment: None }
}
}
impl GetNftEditionsParams {
pub fn new(mint: impl Into<String>) -> Self {
Self {
mint: mint.into(),
page: None,
limit: None,
}
}
}
impl GetSignatureStatusesConfig {
pub fn new() -> Self {
Self {
search_transaction_history: None,
}
}
}
impl GetStakeMinimumDelegationConfig {
pub fn new() -> Self {
Self { commitment: None }
}
}
impl GetSupplyConfig {
pub fn new() -> Self {
Self {
exclude_non_circulating_accounts_list: None,
commitment: None,
min_context_slot: None,
}
}
}
impl GetTokenAccountBalanceConfig {
pub fn new() -> Self {
Self { commitment: None }
}
}
impl GetTokenAccountsParamsOptions {
pub fn new() -> Self {
Self {
show_zero_balance: None,
}
}
}
impl GetTokenAccountsParams {
pub fn new() -> Self {
Self {
owner: None,
mint: None,
page: None,
limit: None,
cursor: None,
options: None,
}
}
}
impl GetTokenSupplyConfig {
pub fn new() -> Self {
Self { commitment: None }
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum Plane {
Rpc,
Das,
Quote,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum ParamStructure {
ByPosition,
ByName,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum Batch {
Any,
Das,
Never,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct MethodSpec {
pub name: &'static str,
pub plane: Plane,
pub params: ParamStructure,
pub batch: Batch,
pub permit: bool,
}
pub const METHODS: &[MethodSpec] = &[
MethodSpec {
name: "getAccountInfo",
plane: Plane::Rpc,
params: ParamStructure::ByPosition,
batch: Batch::Any,
permit: true,
},
MethodSpec {
name: "getAgGenesisCert",
plane: Plane::Rpc,
params: ParamStructure::ByPosition,
batch: Batch::Any,
permit: false,
},
MethodSpec {
name: "getAsset",
plane: Plane::Das,
params: ParamStructure::ByName,
batch: Batch::Das,
permit: false,
},
MethodSpec {
name: "getAssetBatch",
plane: Plane::Das,
params: ParamStructure::ByName,
batch: Batch::Das,
permit: false,
},
MethodSpec {
name: "getAssets",
plane: Plane::Das,
params: ParamStructure::ByName,
batch: Batch::Das,
permit: false,
},
MethodSpec {
name: "getAssetsByAuthority",
plane: Plane::Das,
params: ParamStructure::ByName,
batch: Batch::Das,
permit: false,
},
MethodSpec {
name: "getAssetsByCreator",
plane: Plane::Das,
params: ParamStructure::ByName,
batch: Batch::Das,
permit: false,
},
MethodSpec {
name: "getAssetsByGroup",
plane: Plane::Das,
params: ParamStructure::ByName,
batch: Batch::Das,
permit: false,
},
MethodSpec {
name: "getAssetsByOwner",
plane: Plane::Das,
params: ParamStructure::ByName,
batch: Batch::Das,
permit: false,
},
MethodSpec {
name: "getBalance",
plane: Plane::Rpc,
params: ParamStructure::ByPosition,
batch: Batch::Any,
permit: false,
},
MethodSpec {
name: "getBlock",
plane: Plane::Rpc,
params: ParamStructure::ByPosition,
batch: Batch::Any,
permit: false,
},
MethodSpec {
name: "getBlockCommitment",
plane: Plane::Rpc,
params: ParamStructure::ByPosition,
batch: Batch::Any,
permit: false,
},
MethodSpec {
name: "getBlockHeight",
plane: Plane::Rpc,
params: ParamStructure::ByPosition,
batch: Batch::Any,
permit: false,
},
MethodSpec {
name: "getBlockProduction",
plane: Plane::Rpc,
params: ParamStructure::ByPosition,
batch: Batch::Any,
permit: false,
},
MethodSpec {
name: "getBlocks",
plane: Plane::Rpc,
params: ParamStructure::ByPosition,
batch: Batch::Any,
permit: true,
},
MethodSpec {
name: "getBlocksWithLimit",
plane: Plane::Rpc,
params: ParamStructure::ByPosition,
batch: Batch::Any,
permit: true,
},
MethodSpec {
name: "getBlockTime",
plane: Plane::Rpc,
params: ParamStructure::ByPosition,
batch: Batch::Any,
permit: false,
},
MethodSpec {
name: "getClusterNodes",
plane: Plane::Rpc,
params: ParamStructure::ByPosition,
batch: Batch::Any,
permit: false,
},
MethodSpec {
name: "getEpochInfo",
plane: Plane::Rpc,
params: ParamStructure::ByPosition,
batch: Batch::Any,
permit: false,
},
MethodSpec {
name: "getEpochSchedule",
plane: Plane::Rpc,
params: ParamStructure::ByPosition,
batch: Batch::Any,
permit: false,
},
MethodSpec {
name: "getFeeForMessage",
plane: Plane::Rpc,
params: ParamStructure::ByPosition,
batch: Batch::Any,
permit: false,
},
MethodSpec {
name: "getFirstAvailableBlock",
plane: Plane::Rpc,
params: ParamStructure::ByPosition,
batch: Batch::Any,
permit: false,
},
MethodSpec {
name: "getGenesisHash",
plane: Plane::Rpc,
params: ParamStructure::ByPosition,
batch: Batch::Any,
permit: false,
},
MethodSpec {
name: "getHealth",
plane: Plane::Rpc,
params: ParamStructure::ByPosition,
batch: Batch::Any,
permit: false,
},
MethodSpec {
name: "getHighestSnapshotSlot",
plane: Plane::Rpc,
params: ParamStructure::ByPosition,
batch: Batch::Any,
permit: false,
},
MethodSpec {
name: "getIdentity",
plane: Plane::Rpc,
params: ParamStructure::ByPosition,
batch: Batch::Any,
permit: false,
},
MethodSpec {
name: "getInflationGovernor",
plane: Plane::Rpc,
params: ParamStructure::ByPosition,
batch: Batch::Any,
permit: false,
},
MethodSpec {
name: "getInflationRate",
plane: Plane::Rpc,
params: ParamStructure::ByPosition,
batch: Batch::Any,
permit: false,
},
MethodSpec {
name: "getInflationReward",
plane: Plane::Rpc,
params: ParamStructure::ByPosition,
batch: Batch::Any,
permit: true,
},
MethodSpec {
name: "getLargestAccounts",
plane: Plane::Rpc,
params: ParamStructure::ByPosition,
batch: Batch::Never,
permit: false,
},
MethodSpec {
name: "getLatestBlockhash",
plane: Plane::Rpc,
params: ParamStructure::ByPosition,
batch: Batch::Any,
permit: false,
},
MethodSpec {
name: "getLeaderSchedule",
plane: Plane::Rpc,
params: ParamStructure::ByPosition,
batch: Batch::Any,
permit: true,
},
MethodSpec {
name: "getMaxRetransmitSlot",
plane: Plane::Rpc,
params: ParamStructure::ByPosition,
batch: Batch::Any,
permit: false,
},
MethodSpec {
name: "getMaxShredInsertSlot",
plane: Plane::Rpc,
params: ParamStructure::ByPosition,
batch: Batch::Any,
permit: false,
},
MethodSpec {
name: "getMinimumBalanceForRentExemption",
plane: Plane::Rpc,
params: ParamStructure::ByPosition,
batch: Batch::Any,
permit: false,
},
MethodSpec {
name: "getMultipleAccounts",
plane: Plane::Rpc,
params: ParamStructure::ByPosition,
batch: Batch::Any,
permit: true,
},
MethodSpec {
name: "getNftEditions",
plane: Plane::Das,
params: ParamStructure::ByName,
batch: Batch::Das,
permit: false,
},
MethodSpec {
name: "getPriorityFeeEstimate",
plane: Plane::Rpc,
params: ParamStructure::ByName,
batch: Batch::Never,
permit: false,
},
MethodSpec {
name: "getProgramAccounts",
plane: Plane::Rpc,
params: ParamStructure::ByPosition,
batch: Batch::Never,
permit: false,
},
MethodSpec {
name: "getRecentPerformanceSamples",
plane: Plane::Rpc,
params: ParamStructure::ByPosition,
batch: Batch::Any,
permit: false,
},
MethodSpec {
name: "getRecentPrioritizationFees",
plane: Plane::Rpc,
params: ParamStructure::ByPosition,
batch: Batch::Any,
permit: false,
},
MethodSpec {
name: "getSignaturesForAddress",
plane: Plane::Rpc,
params: ParamStructure::ByPosition,
batch: Batch::Any,
permit: true,
},
MethodSpec {
name: "getSignatureStatuses",
plane: Plane::Rpc,
params: ParamStructure::ByPosition,
batch: Batch::Any,
permit: false,
},
MethodSpec {
name: "getSlot",
plane: Plane::Rpc,
params: ParamStructure::ByPosition,
batch: Batch::Any,
permit: false,
},
MethodSpec {
name: "getSlotLeader",
plane: Plane::Rpc,
params: ParamStructure::ByPosition,
batch: Batch::Any,
permit: false,
},
MethodSpec {
name: "getSlotLeaders",
plane: Plane::Rpc,
params: ParamStructure::ByPosition,
batch: Batch::Any,
permit: true,
},
MethodSpec {
name: "getStakeMinimumDelegation",
plane: Plane::Rpc,
params: ParamStructure::ByPosition,
batch: Batch::Any,
permit: false,
},
MethodSpec {
name: "getSupply",
plane: Plane::Rpc,
params: ParamStructure::ByPosition,
batch: Batch::Never,
permit: false,
},
MethodSpec {
name: "getTokenAccountBalance",
plane: Plane::Rpc,
params: ParamStructure::ByPosition,
batch: Batch::Any,
permit: true,
},
MethodSpec {
name: "getTokenAccounts",
plane: Plane::Das,
params: ParamStructure::ByName,
batch: Batch::Das,
permit: false,
},
MethodSpec {
name: "getTokenAccountsByDelegate",
plane: Plane::Rpc,
params: ParamStructure::ByPosition,
batch: Batch::Never,
permit: false,
},
MethodSpec {
name: "getTokenAccountsByOwner",
plane: Plane::Rpc,
params: ParamStructure::ByPosition,
batch: Batch::Never,
permit: false,
},
MethodSpec {
name: "getTokenSupply",
plane: Plane::Rpc,
params: ParamStructure::ByPosition,
batch: Batch::Any,
permit: true,
},
MethodSpec {
name: "getTransaction",
plane: Plane::Rpc,
params: ParamStructure::ByPosition,
batch: Batch::Any,
permit: true,
},
MethodSpec {
name: "getTransactionCount",
plane: Plane::Rpc,
params: ParamStructure::ByPosition,
batch: Batch::Any,
permit: false,
},
MethodSpec {
name: "getTransactionsForAddress",
plane: Plane::Rpc,
params: ParamStructure::ByPosition,
batch: Batch::Never,
permit: true,
},
MethodSpec {
name: "getVersion",
plane: Plane::Rpc,
params: ParamStructure::ByPosition,
batch: Batch::Any,
permit: false,
},
MethodSpec {
name: "getVoteAccounts",
plane: Plane::Rpc,
params: ParamStructure::ByPosition,
batch: Batch::Any,
permit: false,
},
MethodSpec {
name: "health",
plane: Plane::Quote,
params: ParamStructure::ByName,
batch: Batch::Never,
permit: false,
},
MethodSpec {
name: "isBlockhashValid",
plane: Plane::Rpc,
params: ParamStructure::ByPosition,
batch: Batch::Any,
permit: false,
},
MethodSpec {
name: "minimumLedgerSlot",
plane: Plane::Rpc,
params: ParamStructure::ByPosition,
batch: Batch::Any,
permit: false,
},
MethodSpec {
name: "prices",
plane: Plane::Quote,
params: ParamStructure::ByName,
batch: Batch::Never,
permit: false,
},
MethodSpec {
name: "qn_estimatePriorityFees",
plane: Plane::Rpc,
params: ParamStructure::ByName,
batch: Batch::Never,
permit: false,
},
MethodSpec {
name: "quote",
plane: Plane::Quote,
params: ParamStructure::ByName,
batch: Batch::Never,
permit: false,
},
MethodSpec {
name: "searchAssets",
plane: Plane::Das,
params: ParamStructure::ByName,
batch: Batch::Das,
permit: false,
},
MethodSpec {
name: "sendTransaction",
plane: Plane::Rpc,
params: ParamStructure::ByPosition,
batch: Batch::Any,
permit: false,
},
MethodSpec {
name: "simulateTransaction",
plane: Plane::Rpc,
params: ParamStructure::ByPosition,
batch: Batch::Any,
permit: false,
},
MethodSpec {
name: "swap",
plane: Plane::Quote,
params: ParamStructure::ByName,
batch: Batch::Never,
permit: false,
},
];
#[cfg(feature = "ws")]
pub const SUBSCRIPTIONS: &[&str] = &[
"accountSubscribe",
"blockSubscribe",
"logsSubscribe",
"programSubscribe",
"rootSubscribe",
"signatureSubscribe",
"slotSubscribe",
"slotsUpdatesSubscribe",
];
pub fn method_spec(name: &str) -> Option<&'static MethodSpec> {
METHODS.iter().find(|m| m.name == name)
}
impl Carbium {
pub async fn get_account_info(
&self,
pubkey: &str,
config: Option<&AccountInfoConfig>,
) -> Result<WithContextAccountInfoNull> {
self.request(
"getAccountInfo",
positional(vec![arg(&pubkey)?, arg(&config)?]),
)
.await
}
pub async fn get_ag_genesis_cert(&self) -> Result<Value> {
self.request("getAgGenesisCert", None).await
}
pub async fn get_asset(&self, params: &GetAssetParams) -> Result<DasAsset> {
self.request("getAsset", Some(arg(params)?)).await
}
pub async fn get_asset_batch(
&self,
params: &GetAssetBatchParams,
) -> Result<Vec<Option<DasAsset>>> {
self.request("getAssetBatch", Some(arg(params)?)).await
}
pub async fn get_assets(&self, params: &GetAssetsParams) -> Result<Vec<Option<DasAsset>>> {
self.request("getAssets", Some(arg(params)?)).await
}
pub async fn get_assets_by_authority(
&self,
params: &GetAssetsByAuthorityParams,
) -> Result<DasAssetList> {
self.request("getAssetsByAuthority", Some(arg(params)?))
.await
}
pub async fn get_assets_by_creator(
&self,
params: &GetAssetsByCreatorParams,
) -> Result<DasAssetList> {
self.request("getAssetsByCreator", Some(arg(params)?)).await
}
pub async fn get_assets_by_group(
&self,
params: &GetAssetsByGroupParams,
) -> Result<DasAssetList> {
self.request("getAssetsByGroup", Some(arg(params)?)).await
}
pub async fn get_assets_by_owner(
&self,
params: &GetAssetsByOwnerParams,
) -> Result<DasAssetList> {
self.request("getAssetsByOwner", Some(arg(params)?)).await
}
pub async fn get_balance(
&self,
pubkey: &str,
config: Option<&CommitmentConfig>,
) -> Result<WithContextNumber> {
self.request("getBalance", positional(vec![arg(&pubkey)?, arg(&config)?]))
.await
}
pub async fn get_block(
&self,
slot: u64,
config: Option<&BlockConfig>,
) -> Result<Option<Block>> {
self.request("getBlock", positional(vec![arg(&slot)?, arg(&config)?]))
.await
}
pub async fn get_block_commitment(&self, slot: u64) -> Result<BlockCommitment> {
self.request("getBlockCommitment", positional(vec![arg(&slot)?]))
.await
}
pub async fn get_block_height(&self, config: Option<&CommitmentConfig>) -> Result<Number> {
self.request("getBlockHeight", positional(vec![arg(&config)?]))
.await
}
pub async fn get_block_production(
&self,
config: Option<&BlockProductionConfig>,
) -> Result<WithContextBlockProduction> {
self.request("getBlockProduction", positional(vec![arg(&config)?]))
.await
}
pub async fn get_blocks(
&self,
start_slot: u64,
end_slot: Option<u64>,
config: Option<&GetBlocksConfig>,
) -> Result<Vec<Number>> {
self.request(
"getBlocks",
positional(vec![arg(&start_slot)?, arg(&end_slot)?, arg(&config)?]),
)
.await
}
pub async fn get_blocks_with_limit(
&self,
start_slot: u64,
limit: u64,
config: Option<&GetBlocksWithLimitConfig>,
) -> Result<Vec<Number>> {
self.request(
"getBlocksWithLimit",
positional(vec![arg(&start_slot)?, arg(&limit)?, arg(&config)?]),
)
.await
}
pub async fn get_block_time(&self, slot: u64) -> Result<Option<Number>> {
self.request("getBlockTime", positional(vec![arg(&slot)?]))
.await
}
pub async fn get_cluster_nodes(&self) -> Result<Vec<ClusterNode>> {
self.request("getClusterNodes", None).await
}
pub async fn get_epoch_info(&self, config: Option<&CommitmentConfig>) -> Result<EpochInfo> {
self.request("getEpochInfo", positional(vec![arg(&config)?]))
.await
}
pub async fn get_epoch_schedule(&self) -> Result<EpochSchedule> {
self.request("getEpochSchedule", None).await
}
pub async fn get_fee_for_message(
&self,
message: &str,
config: Option<&CommitmentConfig>,
) -> Result<WithContextNumberNull> {
self.request(
"getFeeForMessage",
positional(vec![arg(&message)?, arg(&config)?]),
)
.await
}
pub async fn get_first_available_block(&self) -> Result<Number> {
self.request("getFirstAvailableBlock", None).await
}
pub async fn get_genesis_hash(&self) -> Result<Base58> {
self.request("getGenesisHash", None).await
}
pub async fn get_health(&self) -> Result<String> {
self.request("getHealth", None).await
}
pub async fn get_highest_snapshot_slot(&self) -> Result<HighestSnapshotSlot> {
self.request("getHighestSnapshotSlot", None).await
}
pub async fn get_identity(&self) -> Result<GetIdentityResult> {
self.request("getIdentity", None).await
}
pub async fn get_inflation_governor(
&self,
config: Option<&GetInflationGovernorConfig>,
) -> Result<InflationGovernor> {
self.request("getInflationGovernor", positional(vec![arg(&config)?]))
.await
}
pub async fn get_inflation_rate(&self) -> Result<InflationRate> {
self.request("getInflationRate", None).await
}
pub async fn get_inflation_reward(
&self,
addresses: &[String],
config: Option<&GetInflationRewardConfig>,
) -> Result<Vec<Option<InflationReward>>> {
self.request(
"getInflationReward",
positional(vec![arg(&addresses)?, arg(&config)?]),
)
.await
}
pub async fn get_largest_accounts(
&self,
config: Option<&CommitmentConfig>,
) -> Result<WithContextLargestAccountArray> {
self.request("getLargestAccounts", positional(vec![arg(&config)?]))
.await
}
pub async fn get_latest_blockhash(
&self,
config: Option<&CommitmentConfig>,
) -> Result<WithContextLatestBlockhash> {
self.request("getLatestBlockhash", positional(vec![arg(&config)?]))
.await
}
pub async fn get_leader_schedule(
&self,
slot: Option<u64>,
config: Option<&LeaderScheduleConfig>,
) -> Result<LeaderSchedule> {
self.request(
"getLeaderSchedule",
positional(vec![arg(&slot)?, arg(&config)?]),
)
.await
}
pub async fn get_max_retransmit_slot(&self) -> Result<Number> {
self.request("getMaxRetransmitSlot", None).await
}
pub async fn get_max_shred_insert_slot(&self) -> Result<Number> {
self.request("getMaxShredInsertSlot", None).await
}
pub async fn get_minimum_balance_for_rent_exemption(
&self,
data_length: u64,
config: Option<&GetMinimumBalanceForRentExemptionConfig>,
) -> Result<Number> {
self.request(
"getMinimumBalanceForRentExemption",
positional(vec![arg(&data_length)?, arg(&config)?]),
)
.await
}
pub async fn get_multiple_accounts(
&self,
pubkeys: &[String],
config: Option<&AccountInfoConfig>,
) -> Result<WithContextAccountInfoNullArray> {
self.request(
"getMultipleAccounts",
positional(vec![arg(&pubkeys)?, arg(&config)?]),
)
.await
}
pub async fn get_nft_editions(&self, params: &GetNftEditionsParams) -> Result<DasEditionList> {
self.request("getNftEditions", Some(arg(params)?)).await
}
pub async fn get_priority_fee_estimate(
&self,
params: &PriorityFeeEstimateParams,
) -> Result<PriorityFeeEstimate> {
self.request("getPriorityFeeEstimate", Some(arg(params)?))
.await
}
pub async fn get_program_accounts(
&self,
program_id: &str,
config: Option<&ProgramAccountsConfig>,
) -> Result<GetProgramAccountsResult> {
self.request(
"getProgramAccounts",
positional(vec![arg(&program_id)?, arg(&config)?]),
)
.await
}
pub async fn get_recent_performance_samples(
&self,
limit: Option<u64>,
) -> Result<Vec<PerformanceSample>> {
self.request(
"getRecentPerformanceSamples",
positional(vec![arg(&limit)?]),
)
.await
}
pub async fn get_recent_prioritization_fees(
&self,
addresses: Option<&[String]>,
) -> Result<Vec<PrioritizationFee>> {
self.request(
"getRecentPrioritizationFees",
positional(vec![arg(&addresses)?]),
)
.await
}
pub async fn get_signatures_for_address(
&self,
address: &str,
config: Option<&SignaturesForAddressConfig>,
) -> Result<Vec<SignatureInfo>> {
self.request(
"getSignaturesForAddress",
positional(vec![arg(&address)?, arg(&config)?]),
)
.await
}
pub async fn get_signature_statuses(
&self,
signatures: &[String],
config: Option<&GetSignatureStatusesConfig>,
) -> Result<WithContextSignatureStatusNullArray> {
self.request(
"getSignatureStatuses",
positional(vec![arg(&signatures)?, arg(&config)?]),
)
.await
}
pub async fn get_slot(&self, config: Option<&CommitmentConfig>) -> Result<Number> {
self.request("getSlot", positional(vec![arg(&config)?]))
.await
}
pub async fn get_slot_leader(&self, config: Option<&CommitmentConfig>) -> Result<Base58> {
self.request("getSlotLeader", positional(vec![arg(&config)?]))
.await
}
pub async fn get_slot_leaders(&self, start_slot: u64, limit: u64) -> Result<Vec<Base58>> {
self.request(
"getSlotLeaders",
positional(vec![arg(&start_slot)?, arg(&limit)?]),
)
.await
}
pub async fn get_stake_minimum_delegation(
&self,
config: Option<&GetStakeMinimumDelegationConfig>,
) -> Result<WithContextNumber> {
self.request("getStakeMinimumDelegation", positional(vec![arg(&config)?]))
.await
}
pub async fn get_supply(&self, config: Option<&GetSupplyConfig>) -> Result<WithContextSupply> {
self.request("getSupply", positional(vec![arg(&config)?]))
.await
}
pub async fn get_token_account_balance(
&self,
token_account: &str,
config: Option<&GetTokenAccountBalanceConfig>,
) -> Result<WithContextTokenAmount> {
self.request(
"getTokenAccountBalance",
positional(vec![arg(&token_account)?, arg(&config)?]),
)
.await
}
pub async fn get_token_accounts(
&self,
params: &GetTokenAccountsParams,
) -> Result<DasTokenAccountList> {
self.request("getTokenAccounts", Some(arg(params)?)).await
}
pub async fn get_token_accounts_by_delegate(
&self,
delegate: &str,
filter: &TokenAccountsFilter,
config: Option<&AccountInfoConfig>,
) -> Result<WithContextKeyedAccountArray> {
self.request(
"getTokenAccountsByDelegate",
positional(vec![arg(&delegate)?, arg(&filter)?, arg(&config)?]),
)
.await
}
pub async fn get_token_accounts_by_owner(
&self,
owner: &str,
filter: &TokenAccountsFilter,
config: Option<&AccountInfoConfig>,
) -> Result<WithContextKeyedAccountArray> {
self.request(
"getTokenAccountsByOwner",
positional(vec![arg(&owner)?, arg(&filter)?, arg(&config)?]),
)
.await
}
pub async fn get_token_supply(
&self,
mint: &str,
config: Option<&GetTokenSupplyConfig>,
) -> Result<WithContextTokenAmount> {
self.request(
"getTokenSupply",
positional(vec![arg(&mint)?, arg(&config)?]),
)
.await
}
pub async fn get_transaction(
&self,
signature: &str,
config: Option<&TransactionConfig>,
) -> Result<Option<TransactionWithMeta>> {
self.request(
"getTransaction",
positional(vec![arg(&signature)?, arg(&config)?]),
)
.await
}
pub async fn get_transaction_count(&self, config: Option<&CommitmentConfig>) -> Result<Number> {
self.request("getTransactionCount", positional(vec![arg(&config)?]))
.await
}
pub async fn get_transactions_for_address(
&self,
address: &str,
config: Option<&TransactionsForAddressConfig>,
) -> Result<TransactionsForAddress> {
self.request(
"getTransactionsForAddress",
positional(vec![arg(&address)?, arg(&config)?]),
)
.await
}
pub async fn get_version(&self) -> Result<Version> {
self.request("getVersion", None).await
}
pub async fn get_vote_accounts(
&self,
config: Option<&VoteAccountsConfig>,
) -> Result<VoteAccounts> {
self.request("getVoteAccounts", positional(vec![arg(&config)?]))
.await
}
pub async fn health(&self) -> Result<QuoteHealth> {
self.request("health", None).await
}
pub async fn is_blockhash_valid(
&self,
blockhash: &str,
config: Option<&CommitmentConfig>,
) -> Result<WithContextBoolean> {
self.request(
"isBlockhashValid",
positional(vec![arg(&blockhash)?, arg(&config)?]),
)
.await
}
pub async fn minimum_ledger_slot(&self) -> Result<Number> {
self.request("minimumLedgerSlot", None).await
}
pub async fn prices(&self, params: &PricesParams) -> Result<Prices> {
self.request("prices", Some(arg(params)?)).await
}
pub async fn qn_estimate_priority_fees(
&self,
params: &QnPriorityFeesParams,
) -> Result<QnPriorityFees> {
self.request("qn_estimatePriorityFees", Some(arg(params)?))
.await
}
pub async fn quote(&self, params: &QuoteParams) -> Result<Quote> {
self.request("quote", Some(arg(params)?)).await
}
pub async fn search_assets(&self, params: &SearchAssetsParams) -> Result<DasAssetList> {
self.request("searchAssets", Some(arg(params)?)).await
}
pub async fn send_transaction(
&self,
signed_transaction: &str,
config: Option<&SendTransactionConfig>,
) -> Result<Base58> {
self.request(
"sendTransaction",
positional(vec![arg(&signed_transaction)?, arg(&config)?]),
)
.await
}
pub async fn simulate_transaction(
&self,
transaction: &str,
config: Option<&SimulateTransactionConfig>,
) -> Result<WithContextSimulateTransactionResult> {
self.request(
"simulateTransaction",
positional(vec![arg(&transaction)?, arg(&config)?]),
)
.await
}
pub async fn swap(&self, params: &SwapParams) -> Result<Swap> {
self.request("swap", Some(arg(params)?)).await
}
}
#[cfg(test)]
pub(crate) mod typed_calls {
use super::*;
use crate::transport::{example, example_named};
use std::future::Future;
use std::pin::Pin;
pub type TypedCall<'a> = Pin<Box<dyn Future<Output = Result<()>> + 'a>>;
pub type CallFn = for<'a> fn(&'a Carbium, Value) -> TypedCall<'a>;
pub(crate) const ALL: &[(&str, CallFn)] = &[
("getAccountInfo", get_account_info),
("getAgGenesisCert", get_ag_genesis_cert),
("getAsset", get_asset),
("getAssetBatch", get_asset_batch),
("getAssets", get_assets),
("getAssetsByAuthority", get_assets_by_authority),
("getAssetsByCreator", get_assets_by_creator),
("getAssetsByGroup", get_assets_by_group),
("getAssetsByOwner", get_assets_by_owner),
("getBalance", get_balance),
("getBlock", get_block),
("getBlockCommitment", get_block_commitment),
("getBlockHeight", get_block_height),
("getBlockProduction", get_block_production),
("getBlocks", get_blocks),
("getBlocksWithLimit", get_blocks_with_limit),
("getBlockTime", get_block_time),
("getClusterNodes", get_cluster_nodes),
("getEpochInfo", get_epoch_info),
("getEpochSchedule", get_epoch_schedule),
("getFeeForMessage", get_fee_for_message),
("getFirstAvailableBlock", get_first_available_block),
("getGenesisHash", get_genesis_hash),
("getHealth", get_health),
("getHighestSnapshotSlot", get_highest_snapshot_slot),
("getIdentity", get_identity),
("getInflationGovernor", get_inflation_governor),
("getInflationRate", get_inflation_rate),
("getInflationReward", get_inflation_reward),
("getLargestAccounts", get_largest_accounts),
("getLatestBlockhash", get_latest_blockhash),
("getLeaderSchedule", get_leader_schedule),
("getMaxRetransmitSlot", get_max_retransmit_slot),
("getMaxShredInsertSlot", get_max_shred_insert_slot),
(
"getMinimumBalanceForRentExemption",
get_minimum_balance_for_rent_exemption,
),
("getMultipleAccounts", get_multiple_accounts),
("getNftEditions", get_nft_editions),
("getPriorityFeeEstimate", get_priority_fee_estimate),
("getProgramAccounts", get_program_accounts),
(
"getRecentPerformanceSamples",
get_recent_performance_samples,
),
(
"getRecentPrioritizationFees",
get_recent_prioritization_fees,
),
("getSignaturesForAddress", get_signatures_for_address),
("getSignatureStatuses", get_signature_statuses),
("getSlot", get_slot),
("getSlotLeader", get_slot_leader),
("getSlotLeaders", get_slot_leaders),
("getStakeMinimumDelegation", get_stake_minimum_delegation),
("getSupply", get_supply),
("getTokenAccountBalance", get_token_account_balance),
("getTokenAccounts", get_token_accounts),
("getTokenAccountsByDelegate", get_token_accounts_by_delegate),
("getTokenAccountsByOwner", get_token_accounts_by_owner),
("getTokenSupply", get_token_supply),
("getTransaction", get_transaction),
("getTransactionCount", get_transaction_count),
("getTransactionsForAddress", get_transactions_for_address),
("getVersion", get_version),
("getVoteAccounts", get_vote_accounts),
("health", health),
("isBlockhashValid", is_blockhash_valid),
("minimumLedgerSlot", minimum_ledger_slot),
("prices", prices),
("qn_estimatePriorityFees", qn_estimate_priority_fees),
("quote", quote),
("searchAssets", search_assets),
("sendTransaction", send_transaction),
("simulateTransaction", simulate_transaction),
("swap", swap),
];
pub fn get_account_info<'a>(c: &'a Carbium, ex: Value) -> TypedCall<'a> {
Box::pin(async move {
let a0: String = example(&ex, 0)?;
let a1: Option<AccountInfoConfig> = example(&ex, 1)?;
c.get_account_info(&a0, a1.as_ref()).await.map(drop)
})
}
pub fn get_ag_genesis_cert<'a>(c: &'a Carbium, ex: Value) -> TypedCall<'a> {
Box::pin(async move {
let _ = ex;
c.get_ag_genesis_cert().await.map(drop)
})
}
pub fn get_asset<'a>(c: &'a Carbium, ex: Value) -> TypedCall<'a> {
Box::pin(async move {
let p: GetAssetParams = example_named(ex)?;
c.get_asset(&p).await.map(drop)
})
}
pub fn get_asset_batch<'a>(c: &'a Carbium, ex: Value) -> TypedCall<'a> {
Box::pin(async move {
let p: GetAssetBatchParams = example_named(ex)?;
c.get_asset_batch(&p).await.map(drop)
})
}
pub fn get_assets<'a>(c: &'a Carbium, ex: Value) -> TypedCall<'a> {
Box::pin(async move {
let p: GetAssetsParams = example_named(ex)?;
c.get_assets(&p).await.map(drop)
})
}
pub fn get_assets_by_authority<'a>(c: &'a Carbium, ex: Value) -> TypedCall<'a> {
Box::pin(async move {
let p: GetAssetsByAuthorityParams = example_named(ex)?;
c.get_assets_by_authority(&p).await.map(drop)
})
}
pub fn get_assets_by_creator<'a>(c: &'a Carbium, ex: Value) -> TypedCall<'a> {
Box::pin(async move {
let p: GetAssetsByCreatorParams = example_named(ex)?;
c.get_assets_by_creator(&p).await.map(drop)
})
}
pub fn get_assets_by_group<'a>(c: &'a Carbium, ex: Value) -> TypedCall<'a> {
Box::pin(async move {
let p: GetAssetsByGroupParams = example_named(ex)?;
c.get_assets_by_group(&p).await.map(drop)
})
}
pub fn get_assets_by_owner<'a>(c: &'a Carbium, ex: Value) -> TypedCall<'a> {
Box::pin(async move {
let p: GetAssetsByOwnerParams = example_named(ex)?;
c.get_assets_by_owner(&p).await.map(drop)
})
}
pub fn get_balance<'a>(c: &'a Carbium, ex: Value) -> TypedCall<'a> {
Box::pin(async move {
let a0: String = example(&ex, 0)?;
let a1: Option<CommitmentConfig> = example(&ex, 1)?;
c.get_balance(&a0, a1.as_ref()).await.map(drop)
})
}
pub fn get_block<'a>(c: &'a Carbium, ex: Value) -> TypedCall<'a> {
Box::pin(async move {
let a0: u64 = example(&ex, 0)?;
let a1: Option<BlockConfig> = example(&ex, 1)?;
c.get_block(a0, a1.as_ref()).await.map(drop)
})
}
pub fn get_block_commitment<'a>(c: &'a Carbium, ex: Value) -> TypedCall<'a> {
Box::pin(async move {
let a0: u64 = example(&ex, 0)?;
c.get_block_commitment(a0).await.map(drop)
})
}
pub fn get_block_height<'a>(c: &'a Carbium, ex: Value) -> TypedCall<'a> {
Box::pin(async move {
let a0: Option<CommitmentConfig> = example(&ex, 0)?;
c.get_block_height(a0.as_ref()).await.map(drop)
})
}
pub fn get_block_production<'a>(c: &'a Carbium, ex: Value) -> TypedCall<'a> {
Box::pin(async move {
let a0: Option<BlockProductionConfig> = example(&ex, 0)?;
c.get_block_production(a0.as_ref()).await.map(drop)
})
}
pub fn get_blocks<'a>(c: &'a Carbium, ex: Value) -> TypedCall<'a> {
Box::pin(async move {
let a0: u64 = example(&ex, 0)?;
let a1: Option<u64> = example(&ex, 1)?;
let a2: Option<GetBlocksConfig> = example(&ex, 2)?;
c.get_blocks(a0, a1, a2.as_ref()).await.map(drop)
})
}
pub fn get_blocks_with_limit<'a>(c: &'a Carbium, ex: Value) -> TypedCall<'a> {
Box::pin(async move {
let a0: u64 = example(&ex, 0)?;
let a1: u64 = example(&ex, 1)?;
let a2: Option<GetBlocksWithLimitConfig> = example(&ex, 2)?;
c.get_blocks_with_limit(a0, a1, a2.as_ref()).await.map(drop)
})
}
pub fn get_block_time<'a>(c: &'a Carbium, ex: Value) -> TypedCall<'a> {
Box::pin(async move {
let a0: u64 = example(&ex, 0)?;
c.get_block_time(a0).await.map(drop)
})
}
pub fn get_cluster_nodes<'a>(c: &'a Carbium, ex: Value) -> TypedCall<'a> {
Box::pin(async move {
let _ = ex;
c.get_cluster_nodes().await.map(drop)
})
}
pub fn get_epoch_info<'a>(c: &'a Carbium, ex: Value) -> TypedCall<'a> {
Box::pin(async move {
let a0: Option<CommitmentConfig> = example(&ex, 0)?;
c.get_epoch_info(a0.as_ref()).await.map(drop)
})
}
pub fn get_epoch_schedule<'a>(c: &'a Carbium, ex: Value) -> TypedCall<'a> {
Box::pin(async move {
let _ = ex;
c.get_epoch_schedule().await.map(drop)
})
}
pub fn get_fee_for_message<'a>(c: &'a Carbium, ex: Value) -> TypedCall<'a> {
Box::pin(async move {
let a0: String = example(&ex, 0)?;
let a1: Option<CommitmentConfig> = example(&ex, 1)?;
c.get_fee_for_message(&a0, a1.as_ref()).await.map(drop)
})
}
pub fn get_first_available_block<'a>(c: &'a Carbium, ex: Value) -> TypedCall<'a> {
Box::pin(async move {
let _ = ex;
c.get_first_available_block().await.map(drop)
})
}
pub fn get_genesis_hash<'a>(c: &'a Carbium, ex: Value) -> TypedCall<'a> {
Box::pin(async move {
let _ = ex;
c.get_genesis_hash().await.map(drop)
})
}
pub fn get_health<'a>(c: &'a Carbium, ex: Value) -> TypedCall<'a> {
Box::pin(async move {
let _ = ex;
c.get_health().await.map(drop)
})
}
pub fn get_highest_snapshot_slot<'a>(c: &'a Carbium, ex: Value) -> TypedCall<'a> {
Box::pin(async move {
let _ = ex;
c.get_highest_snapshot_slot().await.map(drop)
})
}
pub fn get_identity<'a>(c: &'a Carbium, ex: Value) -> TypedCall<'a> {
Box::pin(async move {
let _ = ex;
c.get_identity().await.map(drop)
})
}
pub fn get_inflation_governor<'a>(c: &'a Carbium, ex: Value) -> TypedCall<'a> {
Box::pin(async move {
let a0: Option<GetInflationGovernorConfig> = example(&ex, 0)?;
c.get_inflation_governor(a0.as_ref()).await.map(drop)
})
}
pub fn get_inflation_rate<'a>(c: &'a Carbium, ex: Value) -> TypedCall<'a> {
Box::pin(async move {
let _ = ex;
c.get_inflation_rate().await.map(drop)
})
}
pub fn get_inflation_reward<'a>(c: &'a Carbium, ex: Value) -> TypedCall<'a> {
Box::pin(async move {
let a0: Vec<String> = example(&ex, 0)?;
let a1: Option<GetInflationRewardConfig> = example(&ex, 1)?;
c.get_inflation_reward(&a0, a1.as_ref()).await.map(drop)
})
}
pub fn get_largest_accounts<'a>(c: &'a Carbium, ex: Value) -> TypedCall<'a> {
Box::pin(async move {
let a0: Option<CommitmentConfig> = example(&ex, 0)?;
c.get_largest_accounts(a0.as_ref()).await.map(drop)
})
}
pub fn get_latest_blockhash<'a>(c: &'a Carbium, ex: Value) -> TypedCall<'a> {
Box::pin(async move {
let a0: Option<CommitmentConfig> = example(&ex, 0)?;
c.get_latest_blockhash(a0.as_ref()).await.map(drop)
})
}
pub fn get_leader_schedule<'a>(c: &'a Carbium, ex: Value) -> TypedCall<'a> {
Box::pin(async move {
let a0: Option<u64> = example(&ex, 0)?;
let a1: Option<LeaderScheduleConfig> = example(&ex, 1)?;
c.get_leader_schedule(a0, a1.as_ref()).await.map(drop)
})
}
pub fn get_max_retransmit_slot<'a>(c: &'a Carbium, ex: Value) -> TypedCall<'a> {
Box::pin(async move {
let _ = ex;
c.get_max_retransmit_slot().await.map(drop)
})
}
pub fn get_max_shred_insert_slot<'a>(c: &'a Carbium, ex: Value) -> TypedCall<'a> {
Box::pin(async move {
let _ = ex;
c.get_max_shred_insert_slot().await.map(drop)
})
}
pub fn get_minimum_balance_for_rent_exemption<'a>(c: &'a Carbium, ex: Value) -> TypedCall<'a> {
Box::pin(async move {
let a0: u64 = example(&ex, 0)?;
let a1: Option<GetMinimumBalanceForRentExemptionConfig> = example(&ex, 1)?;
c.get_minimum_balance_for_rent_exemption(a0, a1.as_ref())
.await
.map(drop)
})
}
pub fn get_multiple_accounts<'a>(c: &'a Carbium, ex: Value) -> TypedCall<'a> {
Box::pin(async move {
let a0: Vec<String> = example(&ex, 0)?;
let a1: Option<AccountInfoConfig> = example(&ex, 1)?;
c.get_multiple_accounts(&a0, a1.as_ref()).await.map(drop)
})
}
pub fn get_nft_editions<'a>(c: &'a Carbium, ex: Value) -> TypedCall<'a> {
Box::pin(async move {
let p: GetNftEditionsParams = example_named(ex)?;
c.get_nft_editions(&p).await.map(drop)
})
}
pub fn get_priority_fee_estimate<'a>(c: &'a Carbium, ex: Value) -> TypedCall<'a> {
Box::pin(async move {
let p: PriorityFeeEstimateParams = example_named(ex)?;
c.get_priority_fee_estimate(&p).await.map(drop)
})
}
pub fn get_program_accounts<'a>(c: &'a Carbium, ex: Value) -> TypedCall<'a> {
Box::pin(async move {
let a0: String = example(&ex, 0)?;
let a1: Option<ProgramAccountsConfig> = example(&ex, 1)?;
c.get_program_accounts(&a0, a1.as_ref()).await.map(drop)
})
}
pub fn get_recent_performance_samples<'a>(c: &'a Carbium, ex: Value) -> TypedCall<'a> {
Box::pin(async move {
let a0: Option<u64> = example(&ex, 0)?;
c.get_recent_performance_samples(a0).await.map(drop)
})
}
pub fn get_recent_prioritization_fees<'a>(c: &'a Carbium, ex: Value) -> TypedCall<'a> {
Box::pin(async move {
let a0: Option<Vec<String>> = example(&ex, 0)?;
c.get_recent_prioritization_fees(a0.as_deref())
.await
.map(drop)
})
}
pub fn get_signatures_for_address<'a>(c: &'a Carbium, ex: Value) -> TypedCall<'a> {
Box::pin(async move {
let a0: String = example(&ex, 0)?;
let a1: Option<SignaturesForAddressConfig> = example(&ex, 1)?;
c.get_signatures_for_address(&a0, a1.as_ref())
.await
.map(drop)
})
}
pub fn get_signature_statuses<'a>(c: &'a Carbium, ex: Value) -> TypedCall<'a> {
Box::pin(async move {
let a0: Vec<String> = example(&ex, 0)?;
let a1: Option<GetSignatureStatusesConfig> = example(&ex, 1)?;
c.get_signature_statuses(&a0, a1.as_ref()).await.map(drop)
})
}
pub fn get_slot<'a>(c: &'a Carbium, ex: Value) -> TypedCall<'a> {
Box::pin(async move {
let a0: Option<CommitmentConfig> = example(&ex, 0)?;
c.get_slot(a0.as_ref()).await.map(drop)
})
}
pub fn get_slot_leader<'a>(c: &'a Carbium, ex: Value) -> TypedCall<'a> {
Box::pin(async move {
let a0: Option<CommitmentConfig> = example(&ex, 0)?;
c.get_slot_leader(a0.as_ref()).await.map(drop)
})
}
pub fn get_slot_leaders<'a>(c: &'a Carbium, ex: Value) -> TypedCall<'a> {
Box::pin(async move {
let a0: u64 = example(&ex, 0)?;
let a1: u64 = example(&ex, 1)?;
c.get_slot_leaders(a0, a1).await.map(drop)
})
}
pub fn get_stake_minimum_delegation<'a>(c: &'a Carbium, ex: Value) -> TypedCall<'a> {
Box::pin(async move {
let a0: Option<GetStakeMinimumDelegationConfig> = example(&ex, 0)?;
c.get_stake_minimum_delegation(a0.as_ref()).await.map(drop)
})
}
pub fn get_supply<'a>(c: &'a Carbium, ex: Value) -> TypedCall<'a> {
Box::pin(async move {
let a0: Option<GetSupplyConfig> = example(&ex, 0)?;
c.get_supply(a0.as_ref()).await.map(drop)
})
}
pub fn get_token_account_balance<'a>(c: &'a Carbium, ex: Value) -> TypedCall<'a> {
Box::pin(async move {
let a0: String = example(&ex, 0)?;
let a1: Option<GetTokenAccountBalanceConfig> = example(&ex, 1)?;
c.get_token_account_balance(&a0, a1.as_ref())
.await
.map(drop)
})
}
pub fn get_token_accounts<'a>(c: &'a Carbium, ex: Value) -> TypedCall<'a> {
Box::pin(async move {
let p: GetTokenAccountsParams = example_named(ex)?;
c.get_token_accounts(&p).await.map(drop)
})
}
pub fn get_token_accounts_by_delegate<'a>(c: &'a Carbium, ex: Value) -> TypedCall<'a> {
Box::pin(async move {
let a0: String = example(&ex, 0)?;
let a1: TokenAccountsFilter = example(&ex, 1)?;
let a2: Option<AccountInfoConfig> = example(&ex, 2)?;
c.get_token_accounts_by_delegate(&a0, &a1, a2.as_ref())
.await
.map(drop)
})
}
pub fn get_token_accounts_by_owner<'a>(c: &'a Carbium, ex: Value) -> TypedCall<'a> {
Box::pin(async move {
let a0: String = example(&ex, 0)?;
let a1: TokenAccountsFilter = example(&ex, 1)?;
let a2: Option<AccountInfoConfig> = example(&ex, 2)?;
c.get_token_accounts_by_owner(&a0, &a1, a2.as_ref())
.await
.map(drop)
})
}
pub fn get_token_supply<'a>(c: &'a Carbium, ex: Value) -> TypedCall<'a> {
Box::pin(async move {
let a0: String = example(&ex, 0)?;
let a1: Option<GetTokenSupplyConfig> = example(&ex, 1)?;
c.get_token_supply(&a0, a1.as_ref()).await.map(drop)
})
}
pub fn get_transaction<'a>(c: &'a Carbium, ex: Value) -> TypedCall<'a> {
Box::pin(async move {
let a0: String = example(&ex, 0)?;
let a1: Option<TransactionConfig> = example(&ex, 1)?;
c.get_transaction(&a0, a1.as_ref()).await.map(drop)
})
}
pub fn get_transaction_count<'a>(c: &'a Carbium, ex: Value) -> TypedCall<'a> {
Box::pin(async move {
let a0: Option<CommitmentConfig> = example(&ex, 0)?;
c.get_transaction_count(a0.as_ref()).await.map(drop)
})
}
pub fn get_transactions_for_address<'a>(c: &'a Carbium, ex: Value) -> TypedCall<'a> {
Box::pin(async move {
let a0: String = example(&ex, 0)?;
let a1: Option<TransactionsForAddressConfig> = example(&ex, 1)?;
c.get_transactions_for_address(&a0, a1.as_ref())
.await
.map(drop)
})
}
pub fn get_version<'a>(c: &'a Carbium, ex: Value) -> TypedCall<'a> {
Box::pin(async move {
let _ = ex;
c.get_version().await.map(drop)
})
}
pub fn get_vote_accounts<'a>(c: &'a Carbium, ex: Value) -> TypedCall<'a> {
Box::pin(async move {
let a0: Option<VoteAccountsConfig> = example(&ex, 0)?;
c.get_vote_accounts(a0.as_ref()).await.map(drop)
})
}
pub fn health<'a>(c: &'a Carbium, ex: Value) -> TypedCall<'a> {
Box::pin(async move {
let _ = ex;
c.health().await.map(drop)
})
}
pub fn is_blockhash_valid<'a>(c: &'a Carbium, ex: Value) -> TypedCall<'a> {
Box::pin(async move {
let a0: String = example(&ex, 0)?;
let a1: Option<CommitmentConfig> = example(&ex, 1)?;
c.is_blockhash_valid(&a0, a1.as_ref()).await.map(drop)
})
}
pub fn minimum_ledger_slot<'a>(c: &'a Carbium, ex: Value) -> TypedCall<'a> {
Box::pin(async move {
let _ = ex;
c.minimum_ledger_slot().await.map(drop)
})
}
pub fn prices<'a>(c: &'a Carbium, ex: Value) -> TypedCall<'a> {
Box::pin(async move {
let p: PricesParams = example_named(ex)?;
c.prices(&p).await.map(drop)
})
}
pub fn qn_estimate_priority_fees<'a>(c: &'a Carbium, ex: Value) -> TypedCall<'a> {
Box::pin(async move {
let p: QnPriorityFeesParams = example_named(ex)?;
c.qn_estimate_priority_fees(&p).await.map(drop)
})
}
pub fn quote<'a>(c: &'a Carbium, ex: Value) -> TypedCall<'a> {
Box::pin(async move {
let p: QuoteParams = example_named(ex)?;
c.quote(&p).await.map(drop)
})
}
pub fn search_assets<'a>(c: &'a Carbium, ex: Value) -> TypedCall<'a> {
Box::pin(async move {
let p: SearchAssetsParams = example_named(ex)?;
c.search_assets(&p).await.map(drop)
})
}
pub fn send_transaction<'a>(c: &'a Carbium, ex: Value) -> TypedCall<'a> {
Box::pin(async move {
let a0: String = example(&ex, 0)?;
let a1: Option<SendTransactionConfig> = example(&ex, 1)?;
c.send_transaction(&a0, a1.as_ref()).await.map(drop)
})
}
pub fn simulate_transaction<'a>(c: &'a Carbium, ex: Value) -> TypedCall<'a> {
Box::pin(async move {
let a0: String = example(&ex, 0)?;
let a1: Option<SimulateTransactionConfig> = example(&ex, 1)?;
c.simulate_transaction(&a0, a1.as_ref()).await.map(drop)
})
}
pub fn swap<'a>(c: &'a Carbium, ex: Value) -> TypedCall<'a> {
Box::pin(async move {
let p: SwapParams = example_named(ex)?;
c.swap(&p).await.map(drop)
})
}
}