|
@@ -12,8 +12,8 @@ use solana_client::client_error::ClientError as SolanaClientError;
|
|
|
use solana_client::pubsub_client::{PubsubClient, PubsubClientError, PubsubClientSubscription};
|
|
|
use solana_client::rpc_client::RpcClient;
|
|
|
use solana_client::rpc_config::{
|
|
|
- RpcAccountInfoConfig, RpcProgramAccountsConfig, RpcTransactionLogsConfig,
|
|
|
- RpcTransactionLogsFilter,
|
|
|
+ RpcAccountInfoConfig, RpcProgramAccountsConfig, RpcSendTransactionConfig,
|
|
|
+ RpcTransactionLogsConfig, RpcTransactionLogsFilter,
|
|
|
};
|
|
|
use solana_client::rpc_filter::{Memcmp, MemcmpEncodedBytes, RpcFilterType};
|
|
|
use solana_client::rpc_response::{Response as RpcResponse, RpcLogsResponse};
|
|
@@ -556,6 +556,36 @@ impl<'a> RequestBuilder<'a> {
|
|
|
.send_and_confirm_transaction(&tx)
|
|
|
.map_err(Into::into)
|
|
|
}
|
|
|
+
|
|
|
+ pub fn send_with_spinner_and_config(
|
|
|
+ self,
|
|
|
+ config: RpcSendTransactionConfig,
|
|
|
+ ) -> Result<Signature, ClientError> {
|
|
|
+ let instructions = self.instructions()?;
|
|
|
+
|
|
|
+ let mut signers = self.signers;
|
|
|
+ signers.push(&*self.payer);
|
|
|
+
|
|
|
+ let rpc_client = RpcClient::new_with_commitment(self.cluster, self.options);
|
|
|
+
|
|
|
+ let tx = {
|
|
|
+ let latest_hash = rpc_client.get_latest_blockhash()?;
|
|
|
+ Transaction::new_signed_with_payer(
|
|
|
+ &instructions,
|
|
|
+ Some(&self.payer.pubkey()),
|
|
|
+ &signers,
|
|
|
+ latest_hash,
|
|
|
+ )
|
|
|
+ };
|
|
|
+
|
|
|
+ rpc_client
|
|
|
+ .send_and_confirm_transaction_with_spinner_and_config(
|
|
|
+ &tx,
|
|
|
+ rpc_client.commitment(),
|
|
|
+ config,
|
|
|
+ )
|
|
|
+ .map_err(Into::into)
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
#[cfg(test)]
|