use ;
use ;
use ;
// pub type RpcResult<T> = client_error::Result<Response<T>>;
// #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
// #[serde(rename_all = "camelCase")]
// pub struct RpcResponseContext {
// pub slot: Slot,
// #[serde(skip_serializing_if = "Option::is_none")]
// pub api_version: Option<RpcApiVersion>,
// }
// #[derive(Debug, Clone, PartialEq, Eq)]
// pub struct RpcApiVersion(semver::Version);
// impl std::ops::Deref for RpcApiVersion {
// type Target = semver::Version;
// fn deref(&self) -> &Self::Target {
// &self.0
// }
// }
// impl Default for RpcApiVersion {
// fn default() -> Self {
// Self(solana_version::Version::default().as_semver_version())
// }
// }
// impl Serialize for RpcApiVersion {
// fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
// where
// S: Serializer,
// {
// serializer.serialize_str(&self.to_string())
// }
// }
// impl<'de> Deserialize<'de> for RpcApiVersion {
// fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
// where
// D: Deserializer<'de>,
// {
// let s: String = Deserialize::deserialize(deserializer)?;
// Ok(RpcApiVersion(
// semver::Version::from_str(&s).map_err(serde::de::Error::custom)?,
// ))
// }
// }
// impl RpcResponseContext {
// pub fn new(slot: Slot) -> Self {
// Self {
// slot,
// api_version: Some(RpcApiVersion::default()),
// }
// }
// }
// #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
// pub struct Response<T> {
// pub context: RpcResponseContext,
// pub value: T,
// }
// #[derive(Debug, PartialEq, Serialize, Deserialize)]
// #[serde(rename_all = "camelCase")]
// pub struct RpcBlockCommitment<T> {
// pub commitment: Option<T>,
// pub total_stake: u64,
// }
// #[derive(Serialize, Deserialize, Clone, Debug)]
// #[serde(rename_all = "camelCase")]
// pub struct RpcBlockhashFeeCalculator {
// pub blockhash: String,
// pub fee_calculator: FeeCalculator,
// }
// #[derive(Serialize, Deserialize, Clone, Debug)]
// #[serde(rename_all = "camelCase")]
// pub struct RpcFees {
// pub blockhash: String,
// pub fee_calculator: FeeCalculator,
// pub last_valid_slot: Slot,
// pub last_valid_block_height: u64,
// }
// #[derive(Serialize, Deserialize, Clone, Debug)]
// #[serde(rename_all = "camelCase")]
// pub struct DeprecatedRpcFees {
// pub blockhash: String,
// pub fee_calculator: FeeCalculator,
// pub last_valid_slot: Slot,
// }
// #[derive(Serialize, Deserialize, Clone, Debug)]
// #[serde(rename_all = "camelCase")]
// pub struct Fees {
// pub blockhash: Hash,
// pub fee_calculator: FeeCalculator,
// pub last_valid_block_height: u64,
// }
// #[derive(Serialize, Deserialize, Clone, Debug)]
// #[serde(rename_all = "camelCase")]
// pub struct RpcFeeCalculator {
// pub fee_calculator: FeeCalculator,
// }
// #[derive(Serialize, Deserialize, Clone, Debug)]
// #[serde(rename_all = "camelCase")]
// pub struct RpcFeeRateGovernor {
// pub fee_rate_governor: FeeRateGovernor,
// }
// #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq)]
// #[serde(rename_all = "camelCase")]
// pub struct RpcKeyedAccount {
// pub pubkey: String,
// pub account: UiAccount,
// }
// #[derive(Serialize, Deserialize, Clone, Copy, Debug, PartialEq, Eq)]
// pub struct SlotInfo {
// pub slot: Slot,
// pub parent: Slot,
// pub root: Slot,
// }
// #[derive(Serialize, Deserialize, Clone, Copy, Debug, PartialEq, Eq)]
// #[serde(rename_all = "camelCase")]
// pub struct SlotTransactionStats {
// pub num_transaction_entries: u64,
// pub num_successful_transactions: u64,
// pub num_failed_transactions: u64,
// pub max_transactions_per_entry: u64,
// }
// #[derive(Serialize, Deserialize, Debug)]
// #[serde(rename_all = "camelCase", tag = "type")]
// pub enum SlotUpdate {
// FirstShredReceived {
// slot: Slot,
// timestamp: u64,
// },
// Completed {
// slot: Slot,
// timestamp: u64,
// },
// CreatedBank {
// slot: Slot,
// parent: Slot,
// timestamp: u64,
// },
// Frozen {
// slot: Slot,
// timestamp: u64,
// stats: SlotTransactionStats,
// },
// Dead {
// slot: Slot,
// timestamp: u64,
// err: String,
// },
// OptimisticConfirmation {
// slot: Slot,
// timestamp: u64,
// },
// Root {
// slot: Slot,
// timestamp: u64,
// },
// }
// impl SlotUpdate {
// pub fn slot(&self) -> Slot {
// match self {
// Self::FirstShredReceived { slot, .. } => *slot,
// Self::Completed { slot, .. } => *slot,
// Self::CreatedBank { slot, .. } => *slot,
// Self::Frozen { slot, .. } => *slot,
// Self::Dead { slot, .. } => *slot,
// Self::OptimisticConfirmation { slot, .. } => *slot,
// Self::Root { slot, .. } => *slot,
// }
// }
// }
// #[derive(Serialize, Deserialize, Clone, Debug)]
// #[serde(rename_all = "camelCase", untagged)]
// pub enum RpcSignatureResult {
// ProcessedSignature(ProcessedSignatureResult),
// ReceivedSignature(ReceivedSignatureResult),
// }
// #[derive(Serialize, Deserialize, Clone, Debug)]
// #[serde(rename_all = "camelCase")]
// pub struct RpcLogsResponse {
// pub signature: String, // Signature as base58 string
// pub err: Option<TransactionError>,
// pub logs: Vec<String>,
// }
// #[derive(Serialize, Deserialize, Clone, Debug)]
// #[serde(rename_all = "camelCase")]
// pub struct ProcessedSignatureResult {
// pub err: Option<TransactionError>,
// }
// #[derive(Serialize, Deserialize, Clone, Debug)]
// #[serde(rename_all = "camelCase")]
// pub enum ReceivedSignatureResult {
// ReceivedSignature,
// }
// #[derive(Serialize, Deserialize, Clone, Debug)]
// #[serde(rename_all = "camelCase")]
// pub struct RpcContactInfo {
// /// Pubkey of the node as a base-58 string
// pub pubkey: String,
// /// Gossip port
// pub gossip: Option<SocketAddr>,
// /// Tpu port
// pub tpu: Option<SocketAddr>,
// /// JSON RPC port
// pub rpc: Option<SocketAddr>,
// /// Software version
// pub version: Option<String>,
// /// First 4 bytes of the FeatureSet identifier
// pub feature_set: Option<u32>,
// /// Shred version
// pub shred_version: Option<u16>,
// }
/// Map of leader base58 identity pubkeys to the slot indices relative to the first epoch slot
pub type RpcLeaderSchedule = ;
// #[derive(Serialize, Deserialize, Clone, Debug)]
// #[serde(rename_all = "kebab-case")]
// pub struct RpcIdentity {
// /// The current node identity pubkey
// pub identity: String,
// }
// #[derive(Serialize, Deserialize, Clone, Debug)]
// #[serde(rename_all = "camelCase")]
// pub struct RpcVote {
// /// Vote account address, as base-58 encoded string
// pub vote_pubkey: String,
// pub slots: Vec<Slot>,
// pub hash: String,
// pub timestamp: Option<UnixTimestamp>,
// pub signature: String,
// }
// #[derive(Serialize, Deserialize, Clone, Debug)]
// #[serde(rename_all = "camelCase")]
// pub struct RpcSignatureConfirmation {
// pub confirmations: usize,
// pub status: Result<()>,
// }
// #[derive(Serialize, Deserialize, Clone, Debug)]
// #[serde(rename_all = "camelCase")]
// pub struct RpcSimulateTransactionResult {
// pub err: Option<TransactionError>,
// pub logs: Option<Vec<String>>,
// pub accounts: Option<Vec<Option<UiAccount>>>,
// pub units_consumed: Option<u64>,
// pub return_data: Option<RpcTransactionReturnData>,
// }
// #[derive(Serialize, Deserialize, Clone, Debug)]
// #[serde(rename_all = "camelCase")]
// pub struct RpcTransactionReturnData {
// pub program_id: String,
// pub data: (String, ReturnDataEncoding),
// }
// impl From<TransactionReturnData> for RpcTransactionReturnData {
// fn from(return_data: TransactionReturnData) -> Self {
// Self {
// program_id: return_data.program_id.to_string(),
// data: (base64::encode(return_data.data), ReturnDataEncoding::Base64),
// }
// }
// }
// #[derive(Serialize, Deserialize, Clone, Copy, Debug, Eq, Hash, PartialEq)]
// #[serde(rename_all = "camelCase")]
// pub enum ReturnDataEncoding {
// Base64,
// }
// #[derive(Serialize, Deserialize, Clone, Debug)]
// #[serde(rename_all = "camelCase")]
// pub struct RpcStorageTurn {
// pub blockhash: String,
// pub slot: Slot,
// }
// #[derive(Clone, Deserialize, Serialize, Debug, Error, Eq, PartialEq)]
// pub enum RpcBlockUpdateError {
// #[error("block store error")]
// BlockStoreError,
// #[error("unsupported transaction version ({0})")]
// UnsupportedTransactionVersion(u8),
// }
// #[derive(Serialize, Deserialize, Debug)]
// #[serde(rename_all = "camelCase")]
// pub struct RpcBlockUpdate {
// pub slot: Slot,
// pub block: Option<UiConfirmedBlock>,
// pub err: Option<RpcBlockUpdateError>,
// }
// impl From<ConfirmedTransactionStatusWithSignature> for RpcConfirmedTransactionStatusWithSignature {
// fn from(value: ConfirmedTransactionStatusWithSignature) -> Self {
// let ConfirmedTransactionStatusWithSignature {
// signature,
// slot,
// err,
// memo,
// block_time,
// } = value;
// Self {
// signature: signature.to_string(),
// slot,
// err,
// memo,
// block_time,
// confirmation_status: None,
// }
// }
// }
// #[derive(Serialize, Deserialize, Clone, Copy, Debug, PartialEq, Eq)]
// pub struct RpcSnapshotSlotInfo {
// pub full: Slot,
// pub incremental: Option<Slot>,
// }