diff --git a/Cargo.lock b/Cargo.lock index 50042ccc311f2e..5e79950af54b42 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8306,12 +8306,29 @@ dependencies = [ "serde", "serde_derive", "serde_json", + "solana-account", "solana-account-decoder", "solana-account-decoder-client-types", + "solana-clock", + "solana-commitment-config", + "solana-epoch-info", + "solana-epoch-schedule", + "solana-feature-gate-interface", + "solana-hash", + "solana-instruction", + "solana-keypair", + "solana-message", + "solana-program", + "solana-pubkey", "solana-rpc-client-api", - "solana-sdk", + "solana-signature", + "solana-signer", + "solana-system-transaction", + "solana-transaction", + "solana-transaction-error", "solana-transaction-status-client-types", "solana-version", + "static_assertions", "tokio", ] diff --git a/programs/sbf/Cargo.lock b/programs/sbf/Cargo.lock index e33cf437905ca9..55107d5a55cf9c 100644 --- a/programs/sbf/Cargo.lock +++ b/programs/sbf/Cargo.lock @@ -6573,9 +6573,21 @@ dependencies = [ "serde", "serde_derive", "serde_json", + "solana-account", "solana-account-decoder-client-types", + "solana-clock", + "solana-commitment-config", + "solana-epoch-info", + "solana-epoch-schedule", + "solana-feature-gate-interface", + "solana-hash", + "solana-instruction", + "solana-message", + "solana-pubkey", "solana-rpc-client-api", - "solana-sdk", + "solana-signature", + "solana-transaction", + "solana-transaction-error", "solana-transaction-status-client-types", "solana-version", "tokio", diff --git a/rpc-client-nonce-utils/Cargo.toml b/rpc-client-nonce-utils/Cargo.toml index 0c861a54bdd92b..e3ebdfea412735 100644 --- a/rpc-client-nonce-utils/Cargo.toml +++ b/rpc-client-nonce-utils/Cargo.toml @@ -11,12 +11,12 @@ edition = { workspace = true } [dependencies] clap = { version = "2.33.0", optional = true } -solana-account = { workspace = true } +solana-account = { workspace = true, features = ["bincode"] } solana-clap-utils = { workspace = true, optional = true } solana-commitment-config = { workspace = true } solana-hash = { workspace = true } solana-message = { workspace = true } -solana-nonce = { workspace = true } +solana-nonce = { workspace = true, features = ["serde"] } solana-pubkey = { workspace = true } solana-rpc-client = { workspace = true } solana-sdk-ids = { workspace = true } diff --git a/rpc-client/Cargo.toml b/rpc-client/Cargo.toml index bb5adfef1d36c2..e26ca3b539eaa9 100644 --- a/rpc-client/Cargo.toml +++ b/rpc-client/Cargo.toml @@ -22,9 +22,21 @@ semver = { workspace = true } serde = { workspace = true } serde_derive = { workspace = true } serde_json = { workspace = true } +solana-account = { workspace = true } solana-account-decoder-client-types = { workspace = true, features = ["zstd"] } +solana-clock = { workspace = true } +solana-commitment-config = { workspace = true } +solana-epoch-info = { workspace = true, features = ["serde"] } +solana-epoch-schedule = { workspace = true, features = ["serde"] } +solana-feature-gate-interface = { workspace = true, features = ["serde"] } +solana-hash = { workspace = true } +solana-instruction = { workspace = true } +solana-message = { workspace = true } +solana-pubkey = { workspace = true } solana-rpc-client-api = { workspace = true } -solana-sdk = { workspace = true } +solana-signature = { workspace = true } +solana-transaction = { workspace = true, features = ["bincode"] } +solana-transaction-error = { workspace = true } solana-transaction-status-client-types = { workspace = true } solana-version = { workspace = true } tokio = { workspace = true, features = ["full"] } @@ -36,6 +48,11 @@ futures = { workspace = true } jsonrpc-core = { workspace = true } jsonrpc-http-server = { workspace = true } solana-account-decoder = { workspace = true } +solana-keypair = { workspace = true } +solana-program = { workspace = true, default-features = false } +solana-signer = { workspace = true } +solana-system-transaction = { workspace = true } +static_assertions = { workspace = true } [features] default = ["spinner"] diff --git a/rpc-client/src/mock_sender.rs b/rpc-client/src/mock_sender.rs index 92e384ecc89a94..c81a6afe042bc8 100644 --- a/rpc-client/src/mock_sender.rs +++ b/rpc-client/src/mock_sender.rs @@ -6,6 +6,12 @@ use { base64::{prelude::BASE64_STANDARD, Engine}, serde_json::{json, Number, Value}, solana_account_decoder_client_types::{UiAccount, UiAccountData, UiAccountEncoding}, + solana_clock::{Slot, UnixTimestamp}, + solana_epoch_info::EpochInfo, + solana_epoch_schedule::EpochSchedule, + solana_instruction::error::InstructionError, + solana_message::MessageHeader, + solana_pubkey::Pubkey, solana_rpc_client_api::{ client_error::Result, config::RpcBlockProductionConfig, @@ -19,16 +25,9 @@ use { RpcVoteAccountStatus, }, }, - solana_sdk::{ - clock::{Slot, UnixTimestamp}, - epoch_info::EpochInfo, - instruction::InstructionError, - message::MessageHeader, - pubkey::Pubkey, - signature::Signature, - sysvar::epoch_schedule::EpochSchedule, - transaction::{self, Transaction, TransactionError, TransactionVersion}, - }, + solana_signature::Signature, + solana_transaction::{versioned::TransactionVersion, Transaction}, + solana_transaction_error::{TransactionError, TransactionResult}, solana_transaction_status_client_types::{ option_serializer::OptionSerializer, EncodedConfirmedBlock, EncodedConfirmedTransactionWithStatusMeta, EncodedTransaction, @@ -124,7 +123,7 @@ impl RpcSender for MockSender { transaction_count: Some(123), })?, "getSignatureStatuses" => { - let status: transaction::Result<()> = if self.url == "account_in_use" { + let status: TransactionResult<()> = if self.url == "account_in_use" { Err(TransactionError::AccountInUse) } else if self.url == "instruction_error" { Err(TransactionError::InstructionError( @@ -455,7 +454,7 @@ pub(crate) fn mock_encoded_account(pubkey: &Pubkey) -> UiAccount { #[cfg(test)] mod tests { - use {super::*, solana_account_decoder::encode_ui_account, solana_sdk::account::Account}; + use {super::*, solana_account::Account, solana_account_decoder::encode_ui_account}; #[test] fn test_mock_encoded_account() { diff --git a/rpc-client/src/nonblocking/rpc_client.rs b/rpc-client/src/nonblocking/rpc_client.rs index 33bf1c119bd2f5..7d509fc80f7bb3 100644 --- a/rpc-client/src/nonblocking/rpc_client.rs +++ b/rpc-client/src/nonblocking/rpc_client.rs @@ -8,7 +8,7 @@ pub use crate::mock_sender::Mocks; #[cfg(feature = "spinner")] -use {crate::spinner, solana_sdk::clock::MAX_HASH_AGE_IN_SECONDS, std::cmp::min}; +use {crate::spinner, solana_clock::MAX_HASH_AGE_IN_SECONDS, std::cmp::min}; use { crate::{ http_sender::HttpSender, @@ -23,10 +23,17 @@ use { bincode::serialize, log::*, serde_json::{json, Value}, + solana_account::Account, solana_account_decoder_client_types::{ token::{TokenAccountType, UiTokenAccount, UiTokenAmount}, UiAccount, UiAccountData, UiAccountEncoding, }, + solana_clock::{Epoch, Slot, UnixTimestamp, DEFAULT_MS_PER_SLOT}, + solana_commitment_config::CommitmentConfig, + solana_epoch_info::EpochInfo, + solana_epoch_schedule::EpochSchedule, + solana_hash::Hash, + solana_pubkey::Pubkey, solana_rpc_client_api::{ client_error::{ Error as ClientError, ErrorKind as ClientErrorKind, Result as ClientResult, @@ -35,18 +42,8 @@ use { request::{RpcError, RpcRequest, RpcResponseErrorData, TokenAccountsFilter}, response::*, }, - solana_sdk::{ - account::Account, - clock::{Epoch, Slot, UnixTimestamp, DEFAULT_MS_PER_SLOT}, - commitment_config::CommitmentConfig, - epoch_info::EpochInfo, - epoch_schedule::EpochSchedule, - hash::Hash, - pubkey::Pubkey, - signature::Signature, - transaction, - vote::state::MAX_LOCKOUT_HISTORY, - }, + solana_signature::Signature, + solana_transaction_error::TransactionResult, solana_transaction_status_client_types::{ EncodedConfirmedBlock, EncodedConfirmedTransactionWithStatusMeta, TransactionStatus, UiConfirmedBlock, UiTransactionEncoding, @@ -58,6 +55,13 @@ use { }, tokio::time::sleep, }; +// inlined to avoid a solana_program dep +const MAX_LOCKOUT_HISTORY: usize = 31; +#[cfg(test)] +static_assertions::const_assert_eq!( + MAX_LOCKOUT_HISTORY, + solana_program::vote::state::MAX_LOCKOUT_HISTORY +); /// A client of a remote Solana node. /// @@ -115,14 +119,15 @@ use { /// field, so it is common for the value to be accessed with `?.value`, as in /// /// ``` -/// # use solana_sdk::system_transaction; +/// # use solana_hash::Hash; +/// # use solana_system_transaction as system_transaction; /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; -/// # use solana_sdk::signature::{Keypair, Signer}; -/// # use solana_sdk::hash::Hash; +/// # use solana_keypair::Keypair; +/// # use solana_signer::Signer; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// # let key = Keypair::new(); -/// # let to = solana_sdk::pubkey::new_rand(); +/// # let to = solana_pubkey::new_rand(); /// # let lamports = 50; /// # let latest_blockhash = Hash::default(); /// # let tx = system_transaction::transfer(&key, &to, lamports, latest_blockhash); @@ -193,7 +198,7 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_sdk::commitment_config::CommitmentConfig; + /// # use solana_commitment_config::CommitmentConfig; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; /// let url = "http://localhost:8899".to_string(); /// let commitment_config = CommitmentConfig::processed(); @@ -244,7 +249,7 @@ impl RpcClient { /// ``` /// # use std::time::Duration; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; - /// # use solana_sdk::commitment_config::CommitmentConfig; + /// # use solana_commitment_config::CommitmentConfig; /// let url = "http://localhost::8899".to_string(); /// let timeout = Duration::from_secs(1); /// let commitment_config = CommitmentConfig::processed(); @@ -285,7 +290,7 @@ impl RpcClient { /// ``` /// # use std::time::Duration; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; - /// # use solana_sdk::commitment_config::CommitmentConfig; + /// # use solana_commitment_config::CommitmentConfig; /// let url = "http://localhost::8899".to_string(); /// let timeout = Duration::from_secs(1); /// let commitment_config = CommitmentConfig::processed(); @@ -465,7 +470,7 @@ impl RpcClient { /// ``` /// # use std::net::{Ipv4Addr, SocketAddr}; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; - /// # use solana_sdk::commitment_config::CommitmentConfig; + /// # use solana_commitment_config::CommitmentConfig; /// let addr = SocketAddr::from((Ipv4Addr::LOCALHOST, 8899)); /// let commitment_config = CommitmentConfig::processed(); /// let client = RpcClient::new_socket_with_commitment( @@ -571,12 +576,10 @@ impl RpcClient { /// ``` /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; - /// # use solana_sdk::{ - /// # signature::Signer, - /// # signature::Signature, - /// # signer::keypair::Keypair, - /// # system_transaction, - /// # }; + /// # use solana_keypair::Keypair; + /// # use solana_system_transaction as system_transaction; + /// # use solana_signature::Signature; + /// # use solana_signer::Signer; /// # futures::executor::block_on(async { /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// # let alice = Keypair::new(); @@ -742,13 +745,11 @@ impl RpcClient { /// ``` /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; - /// # use solana_sdk::{ - /// # signature::Signer, - /// # signature::Signature, - /// # signer::keypair::Keypair, - /// # hash::Hash, - /// # system_transaction, - /// # }; + /// # use solana_hash::Hash; + /// # use solana_keypair::Keypair; + /// # use solana_system_transaction as system_transaction; + /// # use solana_signature::Signature; + /// # use solana_signer::Signer; /// # futures::executor::block_on(async { /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// // Transfer lamports from Alice to Bob @@ -830,13 +831,11 @@ impl RpcClient { /// # config::RpcSendTransactionConfig, /// # }; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; - /// # use solana_sdk::{ - /// # signature::Signer, - /// # signature::Signature, - /// # signer::keypair::Keypair, - /// # hash::Hash, - /// # system_transaction, - /// # }; + /// # use solana_hash::Hash; + /// # use solana_keypair::Keypair; + /// # use solana_system_transaction as system_transaction; + /// # use solana_signature::Signature; + /// # use solana_signer::Signer; /// # futures::executor::block_on(async { /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// // Transfer lamports from Alice to Bob @@ -950,12 +949,10 @@ impl RpcClient { /// ``` /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; - /// # use solana_sdk::{ - /// # signature::Signer, - /// # signature::Signature, - /// # signer::keypair::Keypair, - /// # system_transaction, - /// # }; + /// # use solana_keypair::Keypair; + /// # use solana_system_transaction as system_transaction; + /// # use solana_signature::Signature; + /// # use solana_signer::Signer; /// # futures::executor::block_on(async { /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// // Transfer lamports from Alice to Bob and wait for confirmation @@ -1009,13 +1006,11 @@ impl RpcClient { /// ``` /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; - /// # use solana_sdk::{ - /// # commitment_config::CommitmentConfig, - /// # signature::Signer, - /// # signature::Signature, - /// # signer::keypair::Keypair, - /// # system_transaction, - /// # }; + /// # use solana_commitment_config::CommitmentConfig; + /// # use solana_keypair::Keypair; + /// # use solana_signature::Signature; + /// # use solana_signer::Signer; + /// # use solana_system_transaction as system_transaction; /// # use std::time::Duration; /// # futures::executor::block_on(async { /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); @@ -1184,13 +1179,11 @@ impl RpcClient { /// # response::RpcSimulateTransactionResult, /// # }; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; - /// # use solana_sdk::{ - /// # signature::Signer, - /// # signature::Signature, - /// # signer::keypair::Keypair, - /// # hash::Hash, - /// # system_transaction, - /// # }; + /// # use solana_hash::Hash; + /// # use solana_keypair::Keypair; + /// # use solana_system_transaction as system_transaction; + /// # use solana_signature::Signature; + /// # use solana_signer::Signer; /// # futures::executor::block_on(async { /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// // Transfer lamports from Alice to Bob @@ -1259,18 +1252,16 @@ impl RpcClient { /// # Examples /// /// ``` + /// # use solana_hash::Hash; + /// # use solana_keypair::Keypair; /// # use solana_rpc_client_api::{ /// # client_error::Error, /// # config::RpcSimulateTransactionConfig, /// # response::RpcSimulateTransactionResult, /// # }; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; - /// # use solana_sdk::{ - /// # signature::Signer, - /// # signer::keypair::Keypair, - /// # hash::Hash, - /// # system_transaction, - /// # }; + /// # use solana_signer::Signer; + /// # use solana_system_transaction as system_transaction; /// # futures::executor::block_on(async { /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// // Transfer lamports from Alice to Bob @@ -1355,11 +1346,11 @@ impl RpcClient { /// and the transaction failed, this method returns `Ok(Some(Err(_)))`, /// where the interior error is type [`TransactionError`]. /// - /// [`TransactionError`]: solana_sdk::transaction::TransactionError + /// [`TransactionError`]: solana_transaction_error::TransactionError /// /// This function only searches a node's recent history, including all /// recent slots, plus up to - /// [`MAX_RECENT_BLOCKHASHES`][solana_sdk::clock::MAX_RECENT_BLOCKHASHES] + /// [`MAX_RECENT_BLOCKHASHES`][solana_clock::MAX_RECENT_BLOCKHASHES] /// rooted slots. To search the full transaction history use the /// [`get_signature_status_with_commitment_and_history`][RpcClient::get_signature_status_with_commitment_and_history] /// method. @@ -1375,13 +1366,11 @@ impl RpcClient { /// ``` /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; - /// # use solana_sdk::{ - /// # signature::Signer, - /// # signature::Signature, - /// # signer::keypair::Keypair, - /// # hash::Hash, - /// # system_transaction, - /// # }; + /// # use solana_hash::Hash; + /// # use solana_keypair::Keypair; + /// # use solana_system_transaction as system_transaction; + /// # use solana_signature::Signature; + /// # use solana_signer::Signer; /// # futures::executor::block_on(async { /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// # let alice = Keypair::new(); @@ -1398,7 +1387,7 @@ impl RpcClient { pub async fn get_signature_status( &self, signature: &Signature, - ) -> ClientResult>> { + ) -> ClientResult>> { self.get_signature_status_with_commitment(signature, self.commitment()) .await } @@ -1422,7 +1411,7 @@ impl RpcClient { /// /// This function only searches a node's recent history, including all /// recent slots, plus up to - /// [`MAX_RECENT_BLOCKHASHES`][solana_sdk::clock::MAX_RECENT_BLOCKHASHES] + /// [`MAX_RECENT_BLOCKHASHES`][solana_clock::MAX_RECENT_BLOCKHASHES] /// rooted slots. To search the full transaction history use the /// [`get_signature_statuses_with_history`][RpcClient::get_signature_statuses_with_history] /// method. @@ -1444,13 +1433,11 @@ impl RpcClient { /// ``` /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; - /// # use solana_sdk::{ - /// # signature::Signer, - /// # signature::Signature, - /// # signer::keypair::Keypair, - /// # hash::Hash, - /// # system_transaction, - /// # }; + /// # use solana_hash::Hash; + /// # use solana_keypair::Keypair; + /// # use solana_system_transaction as system_transaction; + /// # use solana_signature::Signature; + /// # use solana_signer::Signer; /// # use std::time::Duration; /// # futures::executor::block_on(async { /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); @@ -1524,13 +1511,11 @@ impl RpcClient { /// ``` /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; - /// # use solana_sdk::{ - /// # signature::Signer, - /// # signature::Signature, - /// # signer::keypair::Keypair, - /// # hash::Hash, - /// # system_transaction, - /// # }; + /// # use solana_hash::Hash; + /// # use solana_keypair::Keypair; + /// # use solana_system_transaction as system_transaction; + /// # use solana_signature::Signature; + /// # use solana_signer::Signer; /// # futures::executor::block_on(async { /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// # let alice = Keypair::new(); @@ -1575,11 +1560,11 @@ impl RpcClient { /// and the transaction failed, this method returns `Ok(Some(Err(_)))`, /// where the interior error is type [`TransactionError`]. /// - /// [`TransactionError`]: solana_sdk::transaction::TransactionError + /// [`TransactionError`]: solana_transaction_error::TransactionError /// /// This function only searches a node's recent history, including all /// recent slots, plus up to - /// [`MAX_RECENT_BLOCKHASHES`][solana_sdk::clock::MAX_RECENT_BLOCKHASHES] + /// [`MAX_RECENT_BLOCKHASHES`][solana_clock::MAX_RECENT_BLOCKHASHES] /// rooted slots. To search the full transaction history use the /// [`get_signature_status_with_commitment_and_history`][RpcClient::get_signature_status_with_commitment_and_history] /// method. @@ -1595,13 +1580,11 @@ impl RpcClient { /// ``` /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; - /// # use solana_sdk::{ - /// # commitment_config::CommitmentConfig, - /// # signature::Signer, - /// # signature::Signature, - /// # signer::keypair::Keypair, - /// # system_transaction, - /// # }; + /// # use solana_commitment_config::CommitmentConfig; + /// # use solana_keypair::Keypair; + /// # use solana_signature::Signature; + /// # use solana_signer::Signer; + /// # use solana_system_transaction as system_transaction; /// # futures::executor::block_on(async { /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// # let alice = Keypair::new(); @@ -1623,7 +1606,7 @@ impl RpcClient { &self, signature: &Signature, commitment_config: CommitmentConfig, - ) -> ClientResult>> { + ) -> ClientResult>> { let result: Response>> = self .send( RpcRequest::GetSignatureStatuses, @@ -1651,7 +1634,7 @@ impl RpcClient { /// and the transaction failed, this method returns `Ok(Some(Err(_)))`, /// where the interior error is type [`TransactionError`]. /// - /// [`TransactionError`]: solana_sdk::transaction::TransactionError + /// [`TransactionError`]: solana_transaction_error::TransactionError /// /// This method optionally searches a node's full ledger history and (if /// implemented) long-term storage. @@ -1667,13 +1650,11 @@ impl RpcClient { /// ``` /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; - /// # use solana_sdk::{ - /// # commitment_config::CommitmentConfig, - /// # signature::Signer, - /// # signature::Signature, - /// # signer::keypair::Keypair, - /// # system_transaction, - /// # }; + /// # use solana_commitment_config::CommitmentConfig; + /// # use solana_keypair::Keypair; + /// # use solana_signature::Signature; + /// # use solana_signer::Signer; + /// # use solana_system_transaction as system_transaction; /// # futures::executor::block_on(async { /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// # let alice = Keypair::new(); @@ -1698,7 +1679,7 @@ impl RpcClient { signature: &Signature, commitment_config: CommitmentConfig, search_transaction_history: bool, - ) -> ClientResult>> { + ) -> ClientResult>> { let result: Response>> = self .send( RpcRequest::GetSignatureStatuses, @@ -1754,7 +1735,7 @@ impl RpcClient { /// ``` /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; - /// # use solana_sdk::commitment_config::CommitmentConfig; + /// # use solana_commitment_config::CommitmentConfig; /// # futures::executor::block_on(async { /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// let commitment_config = CommitmentConfig::processed(); @@ -1813,7 +1794,7 @@ impl RpcClient { /// ``` /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; - /// # use solana_sdk::commitment_config::CommitmentConfig; + /// # use solana_commitment_config::CommitmentConfig; /// # futures::executor::block_on(async { /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// let commitment_config = CommitmentConfig::processed(); @@ -1845,7 +1826,7 @@ impl RpcClient { /// ``` /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; - /// # use solana_sdk::slot_history::Slot; + /// # use solana_clock::Slot; /// # futures::executor::block_on(async { /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// let start_slot = 1; @@ -1916,11 +1897,9 @@ impl RpcClient { /// # config::RpcBlockProductionConfigRange, /// # }; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; - /// # use solana_sdk::{ - /// # signature::Signer, - /// # signer::keypair::Keypair, - /// # commitment_config::CommitmentConfig, - /// # }; + /// # use solana_commitment_config::CommitmentConfig; + /// # use solana_keypair::Keypair; + /// # use solana_signer::Signer; /// # futures::executor::block_on(async { /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// # let start_slot = 1; @@ -1992,7 +1971,7 @@ impl RpcClient { /// ``` /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; - /// # use solana_sdk::commitment_config::CommitmentConfig; + /// # use solana_commitment_config::CommitmentConfig; /// # futures::executor::block_on(async { /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// let commitment_config = CommitmentConfig::processed(); @@ -2029,7 +2008,7 @@ impl RpcClient { /// # config::RpcLargestAccountsFilter, /// # }; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; - /// # use solana_sdk::commitment_config::CommitmentConfig; + /// # use solana_commitment_config::CommitmentConfig; /// # futures::executor::block_on(async { /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// let commitment_config = CommitmentConfig::processed(); @@ -2101,7 +2080,7 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_sdk::commitment_config::CommitmentConfig; + /// # use solana_commitment_config::CommitmentConfig; /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; /// # futures::executor::block_on(async { @@ -2144,11 +2123,9 @@ impl RpcClient { /// # config::RpcGetVoteAccountsConfig, /// # }; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; - /// # use solana_sdk::{ - /// # signer::keypair::Keypair, - /// # signature::Signer, - /// # commitment_config::CommitmentConfig, - /// # }; + /// # use solana_commitment_config::CommitmentConfig; + /// # use solana_keypair::Keypair; + /// # use solana_signer::Signer; /// # futures::executor::block_on(async { /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// # let vote_keypair = Keypair::new(); @@ -2471,7 +2448,7 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_sdk::commitment_config::CommitmentConfig; + /// # use solana_commitment_config::CommitmentConfig; /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; /// # futures::executor::block_on(async { @@ -2568,7 +2545,7 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_sdk::commitment_config::CommitmentConfig; + /// # use solana_commitment_config::CommitmentConfig; /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; /// # futures::executor::block_on(async { @@ -2620,11 +2597,9 @@ impl RpcClient { /// ``` /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; - /// # use solana_sdk::{ - /// # signature::Signer, - /// # signer::keypair::Keypair, - /// # system_transaction, - /// # }; + /// # use solana_keypair::Keypair; + /// # use solana_system_transaction as system_transaction; + /// # use solana_signer::Signer; /// # futures::executor::block_on(async { /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// # let alice = Keypair::new(); @@ -2671,12 +2646,10 @@ impl RpcClient { /// # nonblocking::rpc_client::RpcClient, /// # rpc_client::GetConfirmedSignaturesForAddress2Config, /// # }; - /// # use solana_sdk::{ - /// # signature::Signer, - /// # signer::keypair::Keypair, - /// # system_transaction, - /// # commitment_config::CommitmentConfig, - /// # }; + /// # use solana_commitment_config::CommitmentConfig; + /// # use solana_keypair::Keypair; + /// # use solana_system_transaction as system_transaction; + /// # use solana_signer::Signer; /// # futures::executor::block_on(async { /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// # let alice = Keypair::new(); @@ -2740,12 +2713,10 @@ impl RpcClient { /// ``` /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; - /// # use solana_sdk::{ - /// # signature::Signer, - /// # signature::Signature, - /// # signer::keypair::Keypair, - /// # system_transaction, - /// # }; + /// # use solana_keypair::Keypair; + /// # use solana_system_transaction as system_transaction; + /// # use solana_signature::Signature; + /// # use solana_signer::Signer; /// # use solana_transaction_status_client_types::UiTransactionEncoding; /// # futures::executor::block_on(async { /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); @@ -2799,13 +2770,11 @@ impl RpcClient { /// # config::RpcTransactionConfig, /// # }; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; - /// # use solana_sdk::{ - /// # signature::Signer, - /// # signature::Signature, - /// # signer::keypair::Keypair, - /// # system_transaction, - /// # commitment_config::CommitmentConfig, - /// # }; + /// # use solana_commitment_config::CommitmentConfig; + /// # use solana_keypair::Keypair; + /// # use solana_system_transaction as system_transaction; + /// # use solana_signature::Signature; + /// # use solana_signer::Signer; /// # use solana_transaction_status_client_types::UiTransactionEncoding; /// # futures::executor::block_on(async { /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); @@ -2920,7 +2889,7 @@ impl RpcClient { /// ``` /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; - /// # use solana_sdk::commitment_config::CommitmentConfig; + /// # use solana_commitment_config::CommitmentConfig; /// # futures::executor::block_on(async { /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// let commitment_config = CommitmentConfig::confirmed(); @@ -2956,7 +2925,7 @@ impl RpcClient { /// ``` /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; - /// # use solana_sdk::commitment_config::CommitmentConfig; + /// # use solana_commitment_config::CommitmentConfig; /// # futures::executor::block_on(async { /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// # let slot = rpc_client.get_slot().await?; @@ -2988,7 +2957,7 @@ impl RpcClient { /// ``` /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; - /// # use solana_sdk::commitment_config::CommitmentConfig; + /// # use solana_commitment_config::CommitmentConfig; /// # futures::executor::block_on(async { /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// # let slot = rpc_client.get_slot().await?; @@ -3032,7 +3001,7 @@ impl RpcClient { /// # config::RpcLeaderScheduleConfig, /// # }; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; - /// # use solana_sdk::commitment_config::CommitmentConfig; + /// # use solana_commitment_config::CommitmentConfig; /// # futures::executor::block_on(async { /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// # let slot = rpc_client.get_slot().await?; @@ -3134,7 +3103,8 @@ impl RpcClient { /// ``` /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; - /// # use solana_sdk::signature::{Keypair, Signer}; + /// # use solana_keypair::Keypair; + /// # use solana_signer::Signer; /// # futures::executor::block_on(async { /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// # let alice = Keypair::new(); @@ -3262,7 +3232,8 @@ impl RpcClient { /// ``` /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; - /// # use solana_sdk::signature::{Keypair, Signer}; + /// # use solana_keypair::Keypair; + /// # use solana_signer::Signer; /// # futures::executor::block_on(async { /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// # let epoch_info = rpc_client.get_epoch_info().await?; @@ -3314,7 +3285,8 @@ impl RpcClient { /// ``` /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; - /// # use solana_sdk::signature::{Keypair, Signer}; + /// # use solana_keypair::Keypair; + /// # use solana_signer::Signer; /// # futures::executor::block_on(async { /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// let expected_version = semver::Version::new(1, 7, 0); @@ -3386,11 +3358,9 @@ impl RpcClient { /// ``` /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::{self, RpcClient}; - /// # use solana_sdk::{ - /// # signature::Signer, - /// # signer::keypair::Keypair, - /// # pubkey::Pubkey, - /// # }; + /// # use solana_keypair::Keypair; + /// # use solana_pubkey::Pubkey; + /// # use solana_signer::Signer; /// # use std::str::FromStr; /// # futures::executor::block_on(async { /// # let mocks = rpc_client::create_rpc_client_mocks(); @@ -3427,12 +3397,10 @@ impl RpcClient { /// ``` /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::{self, RpcClient}; - /// # use solana_sdk::{ - /// # signature::Signer, - /// # signer::keypair::Keypair, - /// # pubkey::Pubkey, - /// # commitment_config::CommitmentConfig, - /// # }; + /// # use solana_commitment_config::CommitmentConfig; + /// # use solana_keypair::Keypair; + /// # use solana_signer::Signer; + /// # use solana_pubkey::Pubkey; /// # use std::str::FromStr; /// # futures::executor::block_on(async { /// # let mocks = rpc_client::create_rpc_client_mocks(); @@ -3485,12 +3453,10 @@ impl RpcClient { /// # client_error::Error, /// # }; /// # use solana_rpc_client::nonblocking::rpc_client::{self, RpcClient}; - /// # use solana_sdk::{ - /// # signature::Signer, - /// # signer::keypair::Keypair, - /// # pubkey::Pubkey, - /// # commitment_config::CommitmentConfig, - /// # }; + /// # use solana_commitment_config::CommitmentConfig; + /// # use solana_keypair::Keypair; + /// # use solana_signer::Signer; + /// # use solana_pubkey::Pubkey; /// # use solana_account_decoder_client_types::UiAccountEncoding; /// # use std::str::FromStr; /// # futures::executor::block_on(async { @@ -3617,10 +3583,8 @@ impl RpcClient { /// ``` /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; - /// # use solana_sdk::{ - /// # signature::Signer, - /// # signer::keypair::Keypair, - /// # }; + /// # use solana_keypair::Keypair; + /// # use solana_signer::Signer; /// # futures::executor::block_on(async { /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// # let alice = Keypair::new(); @@ -3654,11 +3618,9 @@ impl RpcClient { /// ``` /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; - /// # use solana_sdk::{ - /// # signature::Signer, - /// # signer::keypair::Keypair, - /// # commitment_config::CommitmentConfig, - /// # }; + /// # use solana_commitment_config::CommitmentConfig; + /// # use solana_keypair::Keypair; + /// # use solana_signer::Signer; /// # futures::executor::block_on(async { /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// # let alice = Keypair::new(); @@ -3706,11 +3668,9 @@ impl RpcClient { /// # client_error::Error, /// # }; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; - /// # use solana_sdk::{ - /// # signature::Signer, - /// # signer::keypair::Keypair, - /// # commitment_config::CommitmentConfig, - /// # }; + /// # use solana_commitment_config::CommitmentConfig; + /// # use solana_keypair::Keypair; + /// # use solana_signer::Signer; /// # use solana_account_decoder_client_types::UiAccountEncoding; /// # futures::executor::block_on(async { /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); @@ -3777,11 +3737,9 @@ impl RpcClient { /// ``` /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::{self, RpcClient}; - /// # use solana_sdk::{ - /// # signature::Signer, - /// # signer::keypair::Keypair, - /// # pubkey::Pubkey, - /// # }; + /// # use solana_keypair::Keypair; + /// # use solana_pubkey::Pubkey; + /// # use solana_signer::Signer; /// # use std::str::FromStr; /// # futures::executor::block_on(async { /// # let mocks = rpc_client::create_rpc_client_mocks(); @@ -3855,10 +3813,8 @@ impl RpcClient { /// ``` /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; - /// # use solana_sdk::{ - /// # signature::Signer, - /// # signer::keypair::Keypair, - /// # }; + /// # use solana_keypair::Keypair; + /// # use solana_signer::Signer; /// # futures::executor::block_on(async { /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// # let alice = Keypair::new(); @@ -3887,11 +3843,9 @@ impl RpcClient { /// ``` /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; - /// # use solana_sdk::{ - /// # signature::Signer, - /// # signer::keypair::Keypair, - /// # commitment_config::CommitmentConfig, - /// # }; + /// # use solana_commitment_config::CommitmentConfig; + /// # use solana_keypair::Keypair; + /// # use solana_signer::Signer; /// # futures::executor::block_on(async { /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// # let alice = Keypair::new(); @@ -3934,10 +3888,8 @@ impl RpcClient { /// ``` /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; - /// # use solana_sdk::{ - /// # signature::Signer, - /// # signer::keypair::Keypair, - /// # }; + /// # use solana_keypair::Keypair; + /// # use solana_signer::Signer; /// # futures::executor::block_on(async { /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// # let alice = Keypair::new(); @@ -3980,11 +3932,9 @@ impl RpcClient { /// # filter::{MemcmpEncodedBytes, RpcFilterType, Memcmp}, /// # }; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; - /// # use solana_sdk::{ - /// # signature::Signer, - /// # signer::keypair::Keypair, - /// # commitment_config::CommitmentConfig, - /// # }; + /// # use solana_commitment_config::CommitmentConfig; + /// # use solana_keypair::Keypair; + /// # use solana_signer::Signer; /// # use solana_account_decoder_client_types::{UiDataSliceConfig, UiAccountEncoding}; /// # futures::executor::block_on(async { /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); @@ -4081,7 +4031,7 @@ impl RpcClient { /// ``` /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; - /// # use solana_sdk::commitment_config::CommitmentConfig; + /// # use solana_commitment_config::CommitmentConfig; /// # futures::executor::block_on(async { /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// let stake_minimum_delegation = rpc_client.get_stake_minimum_delegation_with_commitment(CommitmentConfig::confirmed()).await?; diff --git a/rpc-client/src/rpc_client.rs b/rpc-client/src/rpc_client.rs index b32517abfd6b4b..fad544ed4c44d3 100644 --- a/rpc-client/src/rpc_client.rs +++ b/rpc-client/src/rpc_client.rs @@ -19,26 +19,25 @@ use { }, serde::Serialize, serde_json::Value, + solana_account::{Account, ReadableAccount}, solana_account_decoder_client_types::token::{UiTokenAccount, UiTokenAmount}, + solana_clock::{Epoch, Slot, UnixTimestamp}, + solana_commitment_config::CommitmentConfig, + solana_epoch_info::EpochInfo, + solana_epoch_schedule::EpochSchedule, + solana_feature_gate_interface::Feature, + solana_hash::Hash, + solana_message::{v0, Message as LegacyMessage}, + solana_pubkey::Pubkey, solana_rpc_client_api::{ client_error::{Error as ClientError, ErrorKind, Result as ClientResult}, config::{RpcAccountInfoConfig, *}, request::{RpcRequest, TokenAccountsFilter}, response::*, }, - solana_sdk::{ - account::{Account, ReadableAccount}, - clock::{Epoch, Slot, UnixTimestamp}, - commitment_config::CommitmentConfig, - epoch_info::EpochInfo, - epoch_schedule::EpochSchedule, - feature::Feature, - hash::Hash, - message::{v0, Message as LegacyMessage}, - pubkey::Pubkey, - signature::Signature, - transaction::{self, uses_durable_nonce, Transaction, VersionedTransaction}, - }, + solana_signature::Signature, + solana_transaction::{uses_durable_nonce, versioned::VersionedTransaction, Transaction}, + solana_transaction_error::TransactionResult, solana_transaction_status_client_types::{ EncodedConfirmedBlock, EncodedConfirmedTransactionWithStatusMeta, TransactionStatus, UiConfirmedBlock, UiTransactionEncoding, @@ -141,8 +140,8 @@ pub struct GetConfirmedSignaturesForAddress2Config { /// [`Processed`] commitment level. These exceptions are noted in the method /// documentation. /// -/// [`Finalized`]: solana_sdk::commitment_config::CommitmentLevel::Finalized -/// [`Processed`]: solana_sdk::commitment_config::CommitmentLevel::Processed +/// [`Finalized`]: solana_commitment_config::CommitmentLevel::Finalized +/// [`Processed`]: solana_commitment_config::CommitmentLevel::Processed /// [jsonprot]: https://solana.com/docs/rpc /// [JSON-RPC]: https://www.jsonrpc.org/specification /// [slots]: https://solana.com/docs/terminology#slot @@ -161,14 +160,15 @@ pub struct GetConfirmedSignaturesForAddress2Config { /// field, so it is common for the value to be accessed with `?.value`, as in /// /// ``` -/// # use solana_sdk::system_transaction; +/// # use solana_hash::Hash; +/// # use solana_keypair::Keypair; /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; -/// # use solana_sdk::signature::{Keypair, Signer}; -/// # use solana_sdk::hash::Hash; +/// # use solana_system_transaction as system_transaction; +/// # use solana_signer::Signer; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// # let key = Keypair::new(); -/// # let to = solana_sdk::pubkey::new_rand(); +/// # let to = solana_pubkey::new_rand(); /// # let lamports = 50; /// # let latest_blockhash = Hash::default(); /// # let tx = system_transaction::transfer(&key, &to, lamports, latest_blockhash); @@ -233,7 +233,7 @@ impl RpcClient { /// level][cl] of [`Finalized`]. /// /// [cl]: https://solana.com/docs/rpc#configuring-state-commitment - /// [`Finalized`]: solana_sdk::commitment_config::CommitmentLevel::Finalized + /// [`Finalized`]: solana_commitment_config::CommitmentLevel::Finalized /// /// # Examples /// @@ -256,12 +256,12 @@ impl RpcClient { /// The client has a default timeout of 30 seconds, and a user-specified /// [`CommitmentLevel`] via [`CommitmentConfig`]. /// - /// [`CommitmentLevel`]: solana_sdk::commitment_config::CommitmentLevel + /// [`CommitmentLevel`]: solana_commitment_config::CommitmentLevel /// /// # Examples /// /// ``` - /// # use solana_sdk::commitment_config::CommitmentConfig; + /// # use solana_commitment_config::CommitmentConfig; /// # use solana_rpc_client::rpc_client::RpcClient; /// let url = "http://localhost:8899".to_string(); /// let commitment_config = CommitmentConfig::processed(); @@ -283,7 +283,7 @@ impl RpcClient { /// [`Finalized`]. /// /// [cl]: https://solana.com/docs/rpc#configuring-state-commitment - /// [`Finalized`]: solana_sdk::commitment_config::CommitmentLevel::Finalized + /// [`Finalized`]: solana_commitment_config::CommitmentLevel::Finalized /// /// # Examples /// @@ -313,7 +313,7 @@ impl RpcClient { /// ``` /// # use std::time::Duration; /// # use solana_rpc_client::rpc_client::RpcClient; - /// # use solana_sdk::commitment_config::CommitmentConfig; + /// # use solana_commitment_config::CommitmentConfig; /// let url = "http://localhost::8899".to_string(); /// let timeout = Duration::from_secs(1); /// let commitment_config = CommitmentConfig::processed(); @@ -354,7 +354,7 @@ impl RpcClient { /// ``` /// # use std::time::Duration; /// # use solana_rpc_client::rpc_client::RpcClient; - /// # use solana_sdk::commitment_config::CommitmentConfig; + /// # use solana_commitment_config::CommitmentConfig; /// let url = "http://localhost::8899".to_string(); /// let timeout = Duration::from_secs(1); /// let commitment_config = CommitmentConfig::processed(); @@ -509,7 +509,7 @@ impl RpcClient { /// level][cl] of [`Finalized`]. /// /// [cl]: https://solana.com/docs/rpc#configuring-state-commitment - /// [`Finalized`]: solana_sdk::commitment_config::CommitmentLevel::Finalized + /// [`Finalized`]: solana_commitment_config::CommitmentLevel::Finalized /// /// # Examples /// @@ -530,14 +530,14 @@ impl RpcClient { /// The client has a default timeout of 30 seconds, and a user-specified /// [`CommitmentLevel`] via [`CommitmentConfig`]. /// - /// [`CommitmentLevel`]: solana_sdk::commitment_config::CommitmentLevel + /// [`CommitmentLevel`]: solana_commitment_config::CommitmentLevel /// /// # Examples /// /// ``` /// # use std::net::{Ipv4Addr, SocketAddr}; /// # use solana_rpc_client::rpc_client::RpcClient; - /// # use solana_sdk::commitment_config::CommitmentConfig; + /// # use solana_commitment_config::CommitmentConfig; /// let addr = SocketAddr::from((Ipv4Addr::LOCALHOST, 8899)); /// let commitment_config = CommitmentConfig::processed(); /// let client = RpcClient::new_socket_with_commitment( @@ -557,7 +557,7 @@ impl RpcClient { /// The client has a default [commitment level][cl] of [`Finalized`]. /// /// [cl]: https://solana.com/docs/rpc#configuring-state-commitment - /// [`Finalized`]: solana_sdk::commitment_config::CommitmentLevel::Finalized + /// [`Finalized`]: solana_commitment_config::CommitmentLevel::Finalized /// /// # Examples /// @@ -589,7 +589,7 @@ impl RpcClient { /// specified, the default commitment level is /// [`Finalized`]. /// - /// [`Finalized`]: solana_sdk::commitment_config::CommitmentLevel::Finalized + /// [`Finalized`]: solana_commitment_config::CommitmentLevel::Finalized /// /// The default commitment level is overridden when calling methods that /// explicitly provide a [`CommitmentConfig`], like @@ -640,14 +640,12 @@ impl RpcClient { /// # Examples /// /// ``` + /// # use solana_keypair::Keypair; /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; - /// # use solana_sdk::{ - /// # signature::Signer, - /// # signature::Signature, - /// # signer::keypair::Keypair, - /// # system_transaction, - /// # }; + /// # use solana_signature::Signature; + /// # use solana_signer::Signer; + /// # use solana_system_transaction as system_transaction; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// # let alice = Keypair::new(); /// # let bob = Keypair::new(); @@ -751,15 +749,13 @@ impl RpcClient { /// # Examples /// /// ``` + /// # use solana_hash::Hash; + /// # use solana_keypair::Keypair; /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; - /// # use solana_sdk::{ - /// # signature::Signer, - /// # signature::Signature, - /// # signer::keypair::Keypair, - /// # hash::Hash, - /// # system_transaction, - /// # }; + /// # use solana_signature::Signature; + /// # use solana_signer::Signer; + /// # use solana_system_transaction as system_transaction; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// // Transfer lamports from Alice to Bob /// # let alice = Keypair::new(); @@ -827,18 +823,16 @@ impl RpcClient { /// # Examples /// /// ``` + /// # use solana_hash::Hash; + /// # use solana_keypair::Keypair; /// # use solana_rpc_client_api::{ /// # client_error::Error, /// # config::RpcSendTransactionConfig, /// # }; /// # use solana_rpc_client::rpc_client::RpcClient; - /// # use solana_sdk::{ - /// # signature::Signer, - /// # signature::Signature, - /// # signer::keypair::Keypair, - /// # hash::Hash, - /// # system_transaction, - /// # }; + /// # use solana_system_transaction as system_transaction; + /// # use solana_signature::Signature; + /// # use solana_signer::Signer; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// // Transfer lamports from Alice to Bob /// # let alice = Keypair::new(); @@ -896,14 +890,12 @@ impl RpcClient { /// # Examples /// /// ``` + /// # use solana_keypair::Keypair; /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; - /// # use solana_sdk::{ - /// # signature::Signer, - /// # signature::Signature, - /// # signer::keypair::Keypair, - /// # system_transaction, - /// # }; + /// # use solana_system_transaction as system_transaction; + /// # use solana_signature::Signature; + /// # use solana_signer::Signer; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// // Transfer lamports from Alice to Bob and wait for confirmation /// # let alice = Keypair::new(); @@ -949,15 +941,13 @@ impl RpcClient { /// # Examples /// /// ``` + /// # use solana_commitment_config::CommitmentConfig; /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; - /// # use solana_sdk::{ - /// # commitment_config::CommitmentConfig, - /// # signature::Signer, - /// # signature::Signature, - /// # signer::keypair::Keypair, - /// # system_transaction, - /// # }; + /// # use solana_keypair::Keypair; + /// # use solana_system_transaction as system_transaction; + /// # use solana_signature::Signature; + /// # use solana_signer::Signer; /// # use std::time::Duration; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// // Transfer lamports from Alice to Bob and wait for confirmation @@ -1033,18 +1023,16 @@ impl RpcClient { /// # Examples /// /// ``` + /// # use solana_keypair::Keypair; /// # use solana_rpc_client_api::{ /// # client_error::Error, /// # response::RpcSimulateTransactionResult, /// # }; /// # use solana_rpc_client::rpc_client::RpcClient; - /// # use solana_sdk::{ - /// # signature::Signer, - /// # signature::Signature, - /// # signer::keypair::Keypair, - /// # hash::Hash, - /// # system_transaction, - /// # }; + /// # use solana_hash::Hash; + /// # use solana_system_transaction as system_transaction; + /// # use solana_signature::Signature; + /// # use solana_signer::Signer; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// // Transfer lamports from Alice to Bob /// # let alice = Keypair::new(); @@ -1103,18 +1091,16 @@ impl RpcClient { /// # Examples /// /// ``` + /// # use solana_hash::Hash; + /// # use solana_keypair::Keypair; /// # use solana_rpc_client_api::{ /// # client_error::Error, /// # config::RpcSimulateTransactionConfig, /// # response::RpcSimulateTransactionResult, /// # }; /// # use solana_rpc_client::rpc_client::RpcClient; - /// # use solana_sdk::{ - /// # signature::Signer, - /// # signer::keypair::Keypair, - /// # hash::Hash, - /// # system_transaction, - /// # }; + /// # use solana_system_transaction as system_transaction; + /// # use solana_signer::Signer; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// // Transfer lamports from Alice to Bob /// # let alice = Keypair::new(); @@ -1182,11 +1168,11 @@ impl RpcClient { /// and the transaction failed, this method returns `Ok(Some(Err(_)))`, /// where the interior error is type [`TransactionError`]. /// - /// [`TransactionError`]: solana_sdk::transaction::TransactionError + /// [`TransactionError`]: solana_transaction_error::TransactionError /// /// This function only searches a node's recent history, including all /// recent slots, plus up to - /// [`MAX_RECENT_BLOCKHASHES`][solana_sdk::clock::MAX_RECENT_BLOCKHASHES] + /// [`MAX_RECENT_BLOCKHASHES`][solana_clock::MAX_RECENT_BLOCKHASHES] /// rooted slots. To search the full transaction history use the /// [`get_signature_status_with_commitment_and_history`][RpcClient::get_signature_status_with_commitment_and_history] /// method. @@ -1200,15 +1186,13 @@ impl RpcClient { /// # Examples /// /// ``` + /// # use solana_keypair::Keypair; /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; - /// # use solana_sdk::{ - /// # signature::Signer, - /// # signature::Signature, - /// # signer::keypair::Keypair, - /// # hash::Hash, - /// # system_transaction, - /// # }; + /// # use solana_hash::Hash; + /// # use solana_system_transaction as system_transaction; + /// # use solana_signature::Signature; + /// # use solana_signer::Signer; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// # let alice = Keypair::new(); /// # let bob = Keypair::new(); @@ -1222,7 +1206,7 @@ impl RpcClient { pub fn get_signature_status( &self, signature: &Signature, - ) -> ClientResult>> { + ) -> ClientResult>> { self.invoke((self.rpc_client.as_ref()).get_signature_status(signature)) } @@ -1245,7 +1229,7 @@ impl RpcClient { /// /// This function only searches a node's recent history, including all /// recent slots, plus up to - /// [`MAX_RECENT_BLOCKHASHES`][solana_sdk::clock::MAX_RECENT_BLOCKHASHES] + /// [`MAX_RECENT_BLOCKHASHES`][solana_clock::MAX_RECENT_BLOCKHASHES] /// rooted slots. To search the full transaction history use the /// [`get_signature_statuses_with_history`][RpcClient::get_signature_statuses_with_history] /// method. @@ -1265,15 +1249,13 @@ impl RpcClient { /// # Examples /// /// ``` + /// # use solana_keypair::Keypair; /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; - /// # use solana_sdk::{ - /// # signature::Signer, - /// # signature::Signature, - /// # signer::keypair::Keypair, - /// # hash::Hash, - /// # system_transaction, - /// # }; + /// # use solana_hash::Hash; + /// # use solana_system_transaction as system_transaction; + /// # use solana_signature::Signature; + /// # use solana_signer::Signer; /// # use std::time::Duration; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// # let alice = Keypair::new(); @@ -1342,13 +1324,11 @@ impl RpcClient { /// ``` /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; - /// # use solana_sdk::{ - /// # signature::Signer, - /// # signature::Signature, - /// # signer::keypair::Keypair, - /// # hash::Hash, - /// # system_transaction, - /// # }; + /// # use solana_hash::Hash; + /// # use solana_keypair::Keypair; + /// # use solana_system_transaction as system_transaction; + /// # use solana_signature::Signature; + /// # use solana_signer::Signer; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// # let alice = Keypair::new(); /// # fn get_old_transaction_signature() -> Signature { Signature::default() } @@ -1383,11 +1363,11 @@ impl RpcClient { /// and the transaction failed, this method returns `Ok(Some(Err(_)))`, /// where the interior error is type [`TransactionError`]. /// - /// [`TransactionError`]: solana_sdk::transaction::TransactionError + /// [`TransactionError`]: solana_transaction_error::TransactionError /// /// This function only searches a node's recent history, including all /// recent slots, plus up to - /// [`MAX_RECENT_BLOCKHASHES`][solana_sdk::clock::MAX_RECENT_BLOCKHASHES] + /// [`MAX_RECENT_BLOCKHASHES`][solana_clock::MAX_RECENT_BLOCKHASHES] /// rooted slots. To search the full transaction history use the /// [`get_signature_status_with_commitment_and_history`][RpcClient::get_signature_status_with_commitment_and_history] /// method. @@ -1403,13 +1383,11 @@ impl RpcClient { /// ``` /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; - /// # use solana_sdk::{ - /// # commitment_config::CommitmentConfig, - /// # signature::Signer, - /// # signature::Signature, - /// # signer::keypair::Keypair, - /// # system_transaction, - /// # }; + /// # use solana_commitment_config::CommitmentConfig; + /// # use solana_keypair::Keypair; + /// # use solana_signature::Signature; + /// # use solana_signer::Signer; + /// # use solana_system_transaction as system_transaction; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// # let alice = Keypair::new(); /// # let bob = Keypair::new(); @@ -1428,7 +1406,7 @@ impl RpcClient { &self, signature: &Signature, commitment_config: CommitmentConfig, - ) -> ClientResult>> { + ) -> ClientResult>> { self.invoke( (self.rpc_client.as_ref()) .get_signature_status_with_commitment(signature, commitment_config), @@ -1450,7 +1428,7 @@ impl RpcClient { /// and the transaction failed, this method returns `Ok(Some(Err(_)))`, /// where the interior error is type [`TransactionError`]. /// - /// [`TransactionError`]: solana_sdk::transaction::TransactionError + /// [`TransactionError`]: solana_transaction_error::TransactionError /// /// This method optionally searches a node's full ledger history and (if /// implemented) long-term storage. @@ -1466,13 +1444,11 @@ impl RpcClient { /// ``` /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; - /// # use solana_sdk::{ - /// # commitment_config::CommitmentConfig, - /// # signature::Signer, - /// # signature::Signature, - /// # signer::keypair::Keypair, - /// # system_transaction, - /// # }; + /// # use solana_commitment_config::CommitmentConfig; + /// # use solana_keypair::Keypair; + /// # use solana_signature::Signature; + /// # use solana_signer::Signer; + /// # use solana_system_transaction as system_transaction; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// # let alice = Keypair::new(); /// # let bob = Keypair::new(); @@ -1494,7 +1470,7 @@ impl RpcClient { signature: &Signature, commitment_config: CommitmentConfig, search_transaction_history: bool, - ) -> ClientResult>> { + ) -> ClientResult>> { self.invoke( (self.rpc_client.as_ref()).get_signature_status_with_commitment_and_history( signature, @@ -1542,7 +1518,7 @@ impl RpcClient { /// ``` /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; - /// # use solana_sdk::commitment_config::CommitmentConfig; + /// # use solana_commitment_config::CommitmentConfig; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// let commitment_config = CommitmentConfig::processed(); /// let slot = rpc_client.get_slot_with_commitment(commitment_config)?; @@ -1593,7 +1569,7 @@ impl RpcClient { /// ``` /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; - /// # use solana_sdk::commitment_config::CommitmentConfig; + /// # use solana_commitment_config::CommitmentConfig; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// let commitment_config = CommitmentConfig::processed(); /// let block_height = rpc_client.get_block_height_with_commitment( @@ -1621,7 +1597,7 @@ impl RpcClient { /// ``` /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; - /// # use solana_sdk::slot_history::Slot; + /// # use solana_clock::Slot; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// let start_slot = 1; /// let limit = 3; @@ -1669,11 +1645,9 @@ impl RpcClient { /// # config::{RpcBlockProductionConfig, RpcBlockProductionConfigRange}, /// # }; /// # use solana_rpc_client::rpc_client::RpcClient; - /// # use solana_sdk::{ - /// # signature::Signer, - /// # signer::keypair::Keypair, - /// # commitment_config::CommitmentConfig, - /// # }; + /// # use solana_commitment_config::CommitmentConfig; + /// # use solana_keypair::Keypair; + /// # use solana_signer::Signer; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// # let start_slot = 1; /// # let limit = 3; @@ -1738,7 +1712,7 @@ impl RpcClient { /// ``` /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; - /// # use solana_sdk::commitment_config::CommitmentConfig; + /// # use solana_commitment_config::CommitmentConfig; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// let commitment_config = CommitmentConfig::processed(); /// let supply = rpc_client.supply_with_commitment( @@ -1770,7 +1744,7 @@ impl RpcClient { /// # config::{RpcLargestAccountsConfig, RpcLargestAccountsFilter}, /// # }; /// # use solana_rpc_client::rpc_client::RpcClient; - /// # use solana_sdk::commitment_config::CommitmentConfig; + /// # use solana_commitment_config::CommitmentConfig; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// let commitment_config = CommitmentConfig::processed(); /// let config = RpcLargestAccountsConfig { @@ -1831,7 +1805,7 @@ impl RpcClient { /// ``` /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; - /// # use solana_sdk::commitment_config::CommitmentConfig; + /// # use solana_commitment_config::CommitmentConfig; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// let commitment_config = CommitmentConfig::processed(); /// let accounts = rpc_client.get_vote_accounts_with_commitment( @@ -1865,11 +1839,9 @@ impl RpcClient { /// # config::RpcGetVoteAccountsConfig, /// # }; /// # use solana_rpc_client::rpc_client::RpcClient; - /// # use solana_sdk::{ - /// # signer::keypair::Keypair, - /// # signature::Signer, - /// # commitment_config::CommitmentConfig, - /// # }; + /// # use solana_commitment_config::CommitmentConfig; + /// # use solana_keypair::Keypair; + /// # use solana_signer::Signer; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// # let vote_keypair = Keypair::new(); /// let vote_pubkey = vote_keypair.pubkey(); @@ -2055,7 +2027,7 @@ impl RpcClient { /// /// This method uses the [`Finalized`] [commitment level][cl]. /// - /// [`Finalized`]: solana_sdk::commitment_config::CommitmentLevel::Finalized + /// [`Finalized`]: solana_commitment_config::CommitmentLevel::Finalized /// [`get_blocks_with_limit`]: RpcClient::get_blocks_with_limit. /// [cl]: https://solana.com/docs/rpc#configuring-state-commitment /// @@ -2109,7 +2081,7 @@ impl RpcClient { /// This method returns an error if the given commitment level is below /// [`Confirmed`]. /// - /// [`Confirmed`]: solana_sdk::commitment_config::CommitmentLevel::Confirmed + /// [`Confirmed`]: solana_commitment_config::CommitmentLevel::Confirmed /// /// # RPC Reference /// @@ -2122,7 +2094,7 @@ impl RpcClient { /// ``` /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; - /// # use solana_sdk::commitment_config::CommitmentConfig; + /// # use solana_commitment_config::CommitmentConfig; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// // Get up to the first 10 blocks /// let start_slot = 0; @@ -2193,7 +2165,7 @@ impl RpcClient { /// [`Confirmed`]. /// /// [cl]: https://solana.com/docs/rpc#configuring-state-commitment - /// [`Confirmed`]: solana_sdk::commitment_config::CommitmentLevel::Confirmed + /// [`Confirmed`]: solana_commitment_config::CommitmentLevel::Confirmed /// /// # RPC Reference /// @@ -2207,7 +2179,7 @@ impl RpcClient { /// ``` /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; - /// # use solana_sdk::commitment_config::CommitmentConfig; + /// # use solana_commitment_config::CommitmentConfig; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// // Get the first 10 blocks /// let start_slot = 0; @@ -2256,11 +2228,9 @@ impl RpcClient { /// ``` /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; - /// # use solana_sdk::{ - /// # signature::Signer, - /// # signer::keypair::Keypair, - /// # system_transaction, - /// # }; + /// # use solana_keypair::Keypair; + /// # use solana_system_transaction as system_transaction; + /// # use solana_signer::Signer; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// # let alice = Keypair::new(); /// let signatures = rpc_client.get_signatures_for_address( @@ -2283,7 +2253,7 @@ impl RpcClient { /// [`Confirmed`]. /// /// [cl]: https://solana.com/docs/rpc#configuring-state-commitment - /// [`Confirmed`]: solana_sdk::commitment_config::CommitmentLevel::Confirmed + /// [`Confirmed`]: solana_commitment_config::CommitmentLevel::Confirmed /// /// # RPC Reference /// @@ -2297,12 +2267,10 @@ impl RpcClient { /// ``` /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::{GetConfirmedSignaturesForAddress2Config, RpcClient}; - /// # use solana_sdk::{ - /// # signature::Signer, - /// # signer::keypair::Keypair, - /// # system_transaction, - /// # commitment_config::CommitmentConfig, - /// # }; + /// # use solana_commitment_config::CommitmentConfig; + /// # use solana_keypair::Keypair; + /// # use solana_system_transaction as system_transaction; + /// # use solana_signer::Signer; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// # let alice = Keypair::new(); /// # let bob = Keypair::new(); @@ -2336,7 +2304,7 @@ impl RpcClient { /// /// This method uses the [`Finalized`] [commitment level][cl]. /// - /// [`Finalized`]: solana_sdk::commitment_config::CommitmentLevel::Finalized + /// [`Finalized`]: solana_commitment_config::CommitmentLevel::Finalized /// [cl]: https://solana.com/docs/rpc#configuring-state-commitment /// /// # RPC Reference @@ -2350,12 +2318,10 @@ impl RpcClient { /// ``` /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; - /// # use solana_sdk::{ - /// # signature::Signer, - /// # signature::Signature, - /// # signer::keypair::Keypair, - /// # system_transaction, - /// # }; + /// # use solana_keypair::Keypair; + /// # use solana_system_transaction as system_transaction; + /// # use solana_signature::Signature; + /// # use solana_signer::Signer; /// # use solana_transaction_status_client_types::UiTransactionEncoding; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// # let alice = Keypair::new(); @@ -2386,7 +2352,7 @@ impl RpcClient { /// [`Confirmed`]. /// /// [cl]: https://solana.com/docs/rpc#configuring-state-commitment - /// [`Confirmed`]: solana_sdk::commitment_config::CommitmentLevel::Confirmed + /// [`Confirmed`]: solana_commitment_config::CommitmentLevel::Confirmed /// /// # RPC Reference /// @@ -2402,13 +2368,11 @@ impl RpcClient { /// # config::RpcTransactionConfig, /// # }; /// # use solana_rpc_client::rpc_client::RpcClient; - /// # use solana_sdk::{ - /// # signature::Signer, - /// # signature::Signature, - /// # signer::keypair::Keypair, - /// # system_transaction, - /// # commitment_config::CommitmentConfig, - /// # }; + /// # use solana_commitment_config::CommitmentConfig; + /// # use solana_keypair::Keypair; + /// # use solana_system_transaction as system_transaction; + /// # use solana_signature::Signature; + /// # use solana_signer::Signer; /// # use solana_transaction_status_client_types::UiTransactionEncoding; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// # let alice = Keypair::new(); @@ -2497,7 +2461,7 @@ impl RpcClient { /// ``` /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; - /// # use solana_sdk::commitment_config::CommitmentConfig; + /// # use solana_commitment_config::CommitmentConfig; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// let commitment_config = CommitmentConfig::confirmed(); /// let epoch_info = rpc_client.get_epoch_info_with_commitment( @@ -2529,7 +2493,7 @@ impl RpcClient { /// ``` /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; - /// # use solana_sdk::commitment_config::CommitmentConfig; + /// # use solana_commitment_config::CommitmentConfig; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// # let slot = rpc_client.get_slot()?; /// let leader_schedule = rpc_client.get_leader_schedule( @@ -2557,7 +2521,7 @@ impl RpcClient { /// ``` /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; - /// # use solana_sdk::commitment_config::CommitmentConfig; + /// # use solana_commitment_config::CommitmentConfig; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// # let slot = rpc_client.get_slot()?; /// let commitment_config = CommitmentConfig::processed(); @@ -2593,7 +2557,7 @@ impl RpcClient { /// # config::RpcLeaderScheduleConfig, /// # }; /// # use solana_rpc_client::rpc_client::RpcClient; - /// # use solana_sdk::commitment_config::CommitmentConfig; + /// # use solana_commitment_config::CommitmentConfig; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// # let slot = rpc_client.get_slot()?; /// # let validator_pubkey_str = "7AYmEYBBetok8h5L3Eo3vi3bDWnjNnaFbSXfSNYV5ewB".to_string(); @@ -2684,7 +2648,8 @@ impl RpcClient { /// ``` /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; - /// # use solana_sdk::signature::{Keypair, Signer}; + /// # use solana_keypair::Keypair; + /// # use solana_signer::Signer; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// # let alice = Keypair::new(); /// # let bob = Keypair::new(); @@ -2726,7 +2691,7 @@ impl RpcClient { /// /// This method uses the [`Finalized`] [commitment level][cl]. /// - /// [`Finalized`]: solana_sdk::commitment_config::CommitmentLevel::Finalized + /// [`Finalized`]: solana_commitment_config::CommitmentLevel::Finalized /// [cl]: https://solana.com/docs/rpc#configuring-state-commitment /// /// # RPC Reference @@ -2787,7 +2752,8 @@ impl RpcClient { /// ``` /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; - /// # use solana_sdk::signature::{Keypair, Signer}; + /// # use solana_keypair::Keypair; + /// # use solana_signer::Signer; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// # let epoch_info = rpc_client.get_epoch_info()?; /// # let epoch = epoch_info.epoch; @@ -2821,7 +2787,8 @@ impl RpcClient { /// ``` /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; - /// # use solana_sdk::signature::{Keypair, Signer}; + /// # use solana_keypair::Keypair; + /// # use solana_signer::Signer; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// let expected_version = semver::Version::new(1, 7, 0); /// let version = rpc_client.get_version()?; @@ -2888,11 +2855,9 @@ impl RpcClient { /// ``` /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::{self, RpcClient}; - /// # use solana_sdk::{ - /// # signature::Signer, - /// # signer::keypair::Keypair, - /// # pubkey::Pubkey, - /// # }; + /// # use solana_keypair::Keypair; + /// # use solana_pubkey::Pubkey; + /// # use solana_signer::Signer; /// # use std::str::FromStr; /// # let mocks = rpc_client::create_rpc_client_mocks(); /// # let rpc_client = RpcClient::new_mock_with_mocks("succeeds".to_string(), mocks); @@ -2923,12 +2888,10 @@ impl RpcClient { /// ``` /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::{self, RpcClient}; - /// # use solana_sdk::{ - /// # signature::Signer, - /// # signer::keypair::Keypair, - /// # pubkey::Pubkey, - /// # commitment_config::CommitmentConfig, - /// # }; + /// # use solana_commitment_config::CommitmentConfig; + /// # use solana_keypair::Keypair; + /// # use solana_signer::Signer; + /// # use solana_pubkey::Pubkey; /// # use std::str::FromStr; /// # let mocks = rpc_client::create_rpc_client_mocks(); /// # let rpc_client = RpcClient::new_mock_with_mocks("succeeds".to_string(), mocks); @@ -2973,12 +2936,10 @@ impl RpcClient { /// # client_error::Error, /// # }; /// # use solana_rpc_client::rpc_client::{self, RpcClient}; - /// # use solana_sdk::{ - /// # signature::Signer, - /// # signer::keypair::Keypair, - /// # pubkey::Pubkey, - /// # commitment_config::CommitmentConfig, - /// # }; + /// # use solana_commitment_config::CommitmentConfig; + /// # use solana_keypair::Keypair; + /// # use solana_signer::Signer; + /// # use solana_pubkey::Pubkey; /// # use solana_account_decoder_client_types::UiAccountEncoding; /// # use std::str::FromStr; /// # let mocks = rpc_client::create_rpc_client_mocks(); @@ -3064,10 +3025,8 @@ impl RpcClient { /// ``` /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; - /// # use solana_sdk::{ - /// # signature::Signer, - /// # signer::keypair::Keypair, - /// # }; + /// # use solana_keypair::Keypair; + /// # use solana_signer::Signer; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// # let alice = Keypair::new(); /// # let bob = Keypair::new(); @@ -3092,11 +3051,9 @@ impl RpcClient { /// ``` /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; - /// # use solana_sdk::{ - /// # signature::Signer, - /// # signer::keypair::Keypair, - /// # commitment_config::CommitmentConfig, - /// # }; + /// # use solana_commitment_config::CommitmentConfig; + /// # use solana_keypair::Keypair; + /// # use solana_signer::Signer; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// # let alice = Keypair::new(); /// # let bob = Keypair::new(); @@ -3135,11 +3092,9 @@ impl RpcClient { /// # client_error::Error, /// # }; /// # use solana_rpc_client::rpc_client::RpcClient; - /// # use solana_sdk::{ - /// # signature::Signer, - /// # signer::keypair::Keypair, - /// # commitment_config::CommitmentConfig, - /// # }; + /// # use solana_commitment_config::CommitmentConfig; + /// # use solana_keypair::Keypair; + /// # use solana_signer::Signer; /// # use solana_account_decoder_client_types::UiAccountEncoding; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// # let alice = Keypair::new(); @@ -3184,11 +3139,9 @@ impl RpcClient { /// ``` /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::{self, RpcClient}; - /// # use solana_sdk::{ - /// # signature::Signer, - /// # signer::keypair::Keypair, - /// # pubkey::Pubkey, - /// # }; + /// # use solana_keypair::Keypair; + /// # use solana_pubkey::Pubkey; + /// # use solana_signer::Signer; /// # use std::str::FromStr; /// # let mocks = rpc_client::create_rpc_client_mocks(); /// # let rpc_client = RpcClient::new_mock_with_mocks("succeeds".to_string(), mocks); @@ -3240,10 +3193,8 @@ impl RpcClient { /// ``` /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; - /// # use solana_sdk::{ - /// # signature::Signer, - /// # signer::keypair::Keypair, - /// # }; + /// # use solana_keypair::Keypair; + /// # use solana_signer::Signer; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// # let alice = Keypair::new(); /// let balance = rpc_client.get_balance(&alice.pubkey())?; @@ -3266,11 +3217,9 @@ impl RpcClient { /// ``` /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; - /// # use solana_sdk::{ - /// # signature::Signer, - /// # signer::keypair::Keypair, - /// # commitment_config::CommitmentConfig, - /// # }; + /// # use solana_commitment_config::CommitmentConfig; + /// # use solana_keypair::Keypair; + /// # use solana_signer::Signer; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// # let alice = Keypair::new(); /// let commitment_config = CommitmentConfig::processed(); @@ -3308,10 +3257,8 @@ impl RpcClient { /// ``` /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; - /// # use solana_sdk::{ - /// # signature::Signer, - /// # signer::keypair::Keypair, - /// # }; + /// # use solana_keypair::Keypair; + /// # use solana_signer::Signer; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// # let alice = Keypair::new(); /// let accounts = rpc_client.get_program_accounts(&alice.pubkey())?; @@ -3338,11 +3285,9 @@ impl RpcClient { /// # filter::{MemcmpEncodedBytes, RpcFilterType, Memcmp}, /// # }; /// # use solana_rpc_client::rpc_client::RpcClient; - /// # use solana_sdk::{ - /// # signature::Signer, - /// # signer::keypair::Keypair, - /// # commitment_config::CommitmentConfig, - /// # }; + /// # use solana_commitment_config::CommitmentConfig; + /// # use solana_keypair::Keypair; + /// # use solana_signer::Signer; /// # use solana_account_decoder_client_types::{UiDataSliceConfig, UiAccountEncoding}; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// # let alice = Keypair::new(); @@ -3419,7 +3364,7 @@ impl RpcClient { /// ``` /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; - /// # use solana_sdk::commitment_config::CommitmentConfig; + /// # use solana_commitment_config::CommitmentConfig; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// let stake_minimum_delegation = /// rpc_client.get_stake_minimum_delegation_with_commitment(CommitmentConfig::confirmed())?; @@ -3764,13 +3709,12 @@ mod tests { serde_json::{json, Number}, solana_account_decoder::encode_ui_account, solana_account_decoder_client_types::UiAccountEncoding, + solana_instruction::error::InstructionError, + solana_keypair::Keypair, solana_rpc_client_api::client_error::ErrorKind, - solana_sdk::{ - instruction::InstructionError, - signature::{Keypair, Signer}, - system_transaction, - transaction::TransactionError, - }, + solana_signer::Signer, + solana_system_transaction as system_transaction, + solana_transaction_error::TransactionError, std::{io, thread}, }; @@ -3848,7 +3792,7 @@ mod tests { let rpc_client = RpcClient::new_mock("succeeds".to_string()); let key = Keypair::new(); - let to = solana_sdk::pubkey::new_rand(); + let to = solana_pubkey::new_rand(); let blockhash = Hash::default(); let tx = system_transaction::transfer(&key, &to, 50, blockhash); @@ -3902,7 +3846,7 @@ mod tests { let rpc_client = RpcClient::new_mock("succeeds".to_string()); let key = Keypair::new(); - let to = solana_sdk::pubkey::new_rand(); + let to = solana_pubkey::new_rand(); let blockhash = Hash::default(); let tx = system_transaction::transfer(&key, &to, 50, blockhash); let result = rpc_client.send_and_confirm_transaction(&tx); diff --git a/svm/examples/Cargo.lock b/svm/examples/Cargo.lock index dee8abdb6d62d7..b8bb8ac5b5222a 100644 --- a/svm/examples/Cargo.lock +++ b/svm/examples/Cargo.lock @@ -6393,9 +6393,21 @@ dependencies = [ "serde", "serde_derive", "serde_json", + "solana-account", "solana-account-decoder-client-types", + "solana-clock", + "solana-commitment-config", + "solana-epoch-info", + "solana-epoch-schedule", + "solana-feature-gate-interface", + "solana-hash", + "solana-instruction", + "solana-message", + "solana-pubkey", "solana-rpc-client-api", - "solana-sdk", + "solana-signature", + "solana-transaction", + "solana-transaction-error", "solana-transaction-status-client-types", "solana-version", "tokio",