diff --git a/Cargo.lock b/Cargo.lock index f185cd4fe08b66..d3467e6beb7ea0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8224,10 +8224,24 @@ 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-hash", + "solana-instruction", + "solana-keypair", + "solana-program", + "solana-pubkey", "solana-rpc-client-api", "solana-sdk", + "solana-signature", + "solana-signer", + "solana-transaction", + "solana-transaction-error", "solana-transaction-status-client-types", "solana-version", "tokio", diff --git a/programs/sbf/Cargo.lock b/programs/sbf/Cargo.lock index 0dcb2e4219437d..7b6a02494f2dde 100644 --- a/programs/sbf/Cargo.lock +++ b/programs/sbf/Cargo.lock @@ -6511,9 +6511,20 @@ 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-hash", + "solana-instruction", + "solana-program", + "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/Cargo.toml b/rpc-client/Cargo.toml index bb5adfef1d36c2..4ac8634e073a9c 100644 --- a/rpc-client/Cargo.toml +++ b/rpc-client/Cargo.toml @@ -22,9 +22,20 @@ 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 } +solana-epoch-schedule = { workspace = true } +solana-hash = { workspace = true } +solana-instruction = { workspace = true } +solana-program = { workspace = true, default-features = false } +solana-pubkey = { workspace = true } solana-rpc-client-api = { workspace = true } -solana-sdk = { workspace = true } +solana-signature = { workspace = true } +solana-transaction = { workspace = true } +solana-transaction-error = { workspace = true } solana-transaction-status-client-types = { workspace = true } solana-version = { workspace = true } tokio = { workspace = true, features = ["full"] } @@ -36,6 +47,9 @@ futures = { workspace = true } jsonrpc-core = { workspace = true } jsonrpc-http-server = { workspace = true } solana-account-decoder = { workspace = true } +solana-keypair = { workspace = true } +solana-sdk = { path = "../sdk" } +solana-signer = { workspace = true } [features] default = ["spinner"] diff --git a/rpc-client/src/mock_sender.rs b/rpc-client/src/mock_sender.rs index 92e384ecc89a94..a08c9ff932d2b3 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_program::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..73b698347a0f14 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,18 @@ 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_program::vote::state::MAX_LOCKOUT_HISTORY, + solana_pubkey::Pubkey, solana_rpc_client_api::{ client_error::{ Error as ClientError, ErrorKind as ClientErrorKind, Result as ClientResult, @@ -35,18 +43,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, @@ -115,14 +113,15 @@ use { /// field, so it is common for the value to be accessed with `?.value`, as in /// /// ``` +/// # use solana_hash::Hash; /// # use solana_sdk::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 +192,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 +243,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 +284,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 +464,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 +570,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_sdk::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 +739,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_sdk::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 +825,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_sdk::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 +943,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_sdk::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 +1000,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_sdk::system_transaction; /// # use std::time::Duration; /// # futures::executor::block_on(async { /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); @@ -1184,13 +1173,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_sdk::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 +1246,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_sdk::system_transaction; /// # futures::executor::block_on(async { /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// // Transfer lamports from Alice to Bob @@ -1355,11 +1340,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 +1360,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_sdk::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 +1381,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 +1405,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 +1427,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_sdk::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 +1505,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_sdk::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 +1554,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 +1574,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_sdk::system_transaction; /// # futures::executor::block_on(async { /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// # let alice = Keypair::new(); @@ -1623,7 +1600,7 @@ impl RpcClient { &self, signature: &Signature, commitment_config: CommitmentConfig, - ) -> ClientResult>> { + ) -> ClientResult>> { let result: Response>> = self .send( RpcRequest::GetSignatureStatuses, @@ -1651,7 +1628,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 +1644,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_sdk::system_transaction; /// # futures::executor::block_on(async { /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// # let alice = Keypair::new(); @@ -1698,7 +1673,7 @@ impl RpcClient { signature: &Signature, commitment_config: CommitmentConfig, search_transaction_history: bool, - ) -> ClientResult>> { + ) -> ClientResult>> { let result: Response>> = self .send( RpcRequest::GetSignatureStatuses, @@ -1754,7 +1729,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 +1788,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 +1820,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 +1891,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 +1965,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 +2002,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 +2074,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 +2117,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 +2442,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 +2539,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 +2591,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_sdk::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 +2640,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_sdk::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 +2707,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_sdk::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 +2764,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_sdk::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 +2883,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 +2919,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 +2951,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 +2995,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 +3097,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 +3226,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 +3279,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 +3352,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 +3391,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 +3447,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 +3577,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 +3612,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 +3662,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 +3731,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 +3807,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 +3837,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 +3882,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 +3926,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 +4025,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..ebd012965bd0b9 100644 --- a/rpc-client/src/rpc_client.rs +++ b/rpc-client/src/rpc_client.rs @@ -19,26 +19,27 @@ 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_hash::Hash, + solana_program::{ + feature::Feature, + 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 +142,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 +162,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_sdk::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 +235,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 +258,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 +285,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 +315,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 +356,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 +511,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 +532,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 +559,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 +591,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 +642,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_sdk::system_transaction; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// # let alice = Keypair::new(); /// # let bob = Keypair::new(); @@ -751,15 +751,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_sdk::system_transaction; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// // Transfer lamports from Alice to Bob /// # let alice = Keypair::new(); @@ -827,18 +825,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_sdk::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 +892,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_sdk::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 +943,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_sdk::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 +1025,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_sdk::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 +1093,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_sdk::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 +1170,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 +1188,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_sdk::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 +1208,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 +1231,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 +1251,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_sdk::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 +1326,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_sdk::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 +1365,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 +1385,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_sdk::system_transaction; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// # let alice = Keypair::new(); /// # let bob = Keypair::new(); @@ -1428,7 +1408,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 +1430,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 +1446,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_sdk::system_transaction; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// # let alice = Keypair::new(); /// # let bob = Keypair::new(); @@ -1494,7 +1472,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 +1520,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 +1571,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 +1599,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 +1647,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 +1714,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 +1746,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 +1807,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 +1841,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 +2029,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 +2083,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 +2096,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 +2167,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 +2181,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 +2230,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_sdk::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 +2255,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 +2269,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_sdk::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 +2306,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 +2320,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_sdk::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 +2354,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 +2370,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_sdk::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 +2463,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 +2495,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 +2523,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 +2559,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 +2650,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 +2693,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 +2754,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 +2789,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 +2857,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 +2890,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 +2938,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 +3027,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 +3053,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 +3094,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 +3141,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 +3195,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 +3219,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 +3259,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 +3287,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 +3366,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 +3711,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_sdk::system_transaction, + solana_signer::Signer, + solana_transaction_error::TransactionError, std::{io, thread}, }; @@ -3848,7 +3794,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 +3848,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 184c842767c43d..61b0ff3531daef 100644 --- a/svm/examples/Cargo.lock +++ b/svm/examples/Cargo.lock @@ -6331,9 +6331,20 @@ 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-hash", + "solana-instruction", + "solana-program", + "solana-pubkey", "solana-rpc-client-api", - "solana-sdk", + "solana-signature", + "solana-transaction", + "solana-transaction-error", "solana-transaction-status-client-types", "solana-version", "tokio",