Trait StellarProviderTrait

Source
pub trait StellarProviderTrait: Send + Sync {
Show 14 methods // Required methods fn get_configs(&self) -> Vec<RpcConfig>; fn get_account<'life0, 'life1, 'async_trait>( &'life0 self, account_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<AccountEntry, ProviderError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn simulate_transaction_envelope<'life0, 'life1, 'async_trait>( &'life0 self, tx_envelope: &'life1 TransactionEnvelope, ) -> Pin<Box<dyn Future<Output = Result<SimulateTransactionResponse, ProviderError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn send_transaction_polling<'life0, 'life1, 'async_trait>( &'life0 self, tx_envelope: &'life1 TransactionEnvelope, ) -> Pin<Box<dyn Future<Output = Result<SorobanTransactionResponse, ProviderError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn get_network<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<GetNetworkResponse, ProviderError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_latest_ledger<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<GetLatestLedgerResponse, ProviderError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn send_transaction<'life0, 'life1, 'async_trait>( &'life0 self, tx_envelope: &'life1 TransactionEnvelope, ) -> Pin<Box<dyn Future<Output = Result<Hash, ProviderError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn send_transaction_with_status<'life0, 'life1, 'async_trait>( &'life0 self, tx_envelope: &'life1 TransactionEnvelope, ) -> Pin<Box<dyn Future<Output = Result<SendTransactionResponse, ProviderError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn get_transaction<'life0, 'life1, 'async_trait>( &'life0 self, tx_id: &'life1 Hash, ) -> Pin<Box<dyn Future<Output = Result<GetTransactionResponse, ProviderError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn get_transactions<'life0, 'async_trait>( &'life0 self, request: GetTransactionsRequest, ) -> Pin<Box<dyn Future<Output = Result<GetTransactionsResponse, ProviderError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_ledger_entries<'life0, 'life1, 'async_trait>( &'life0 self, keys: &'life1 [LedgerKey], ) -> Pin<Box<dyn Future<Output = Result<GetLedgerEntriesResponse, ProviderError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn get_events<'life0, 'async_trait>( &'life0 self, request: GetEventsRequest, ) -> Pin<Box<dyn Future<Output = Result<GetEventsResponse, ProviderError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn raw_request_dyn<'life0, 'life1, 'async_trait>( &'life0 self, method: &'life1 str, params: Value, id: Option<JsonRpcId>, ) -> Pin<Box<dyn Future<Output = Result<Value, ProviderError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn call_contract<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, contract_address: &'life1 str, function_name: &'life2 ScSymbol, args: Vec<ScVal>, ) -> Pin<Box<dyn Future<Output = Result<ScVal, ProviderError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait;
}

Required Methods§

Source

fn get_configs(&self) -> Vec<RpcConfig>

Source

fn get_account<'life0, 'life1, 'async_trait>( &'life0 self, account_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<AccountEntry, ProviderError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn simulate_transaction_envelope<'life0, 'life1, 'async_trait>( &'life0 self, tx_envelope: &'life1 TransactionEnvelope, ) -> Pin<Box<dyn Future<Output = Result<SimulateTransactionResponse, ProviderError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn send_transaction_polling<'life0, 'life1, 'async_trait>( &'life0 self, tx_envelope: &'life1 TransactionEnvelope, ) -> Pin<Box<dyn Future<Output = Result<SorobanTransactionResponse, ProviderError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn get_network<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<GetNetworkResponse, ProviderError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn get_latest_ledger<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<GetLatestLedgerResponse, ProviderError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn send_transaction<'life0, 'life1, 'async_trait>( &'life0 self, tx_envelope: &'life1 TransactionEnvelope, ) -> Pin<Box<dyn Future<Output = Result<Hash, ProviderError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn send_transaction_with_status<'life0, 'life1, 'async_trait>( &'life0 self, tx_envelope: &'life1 TransactionEnvelope, ) -> Pin<Box<dyn Future<Output = Result<SendTransactionResponse, ProviderError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Sends a transaction and returns the full response including the status field.

§Why this method exists

The stellar-rpc-client crate’s send_transaction method only returns Result<Hash, Error> and discards the status field for non-ERROR responses. This means TRY_AGAIN_LATER is silently treated as success, which is problematic for relayers that need to track transaction states precisely.

This method calls the sendTransaction RPC directly to get the full SendTransactionResponse including the status field:

  • “PENDING”: Transaction accepted for processing
  • “DUPLICATE”: Transaction already submitted
  • “TRY_AGAIN_LATER”: Transaction NOT queued (e.g., another tx from same account in mempool, fee too low and resubmitted too soon, or resource limits exceeded)
  • “ERROR”: Transaction validation failed
Source

fn get_transaction<'life0, 'life1, 'async_trait>( &'life0 self, tx_id: &'life1 Hash, ) -> Pin<Box<dyn Future<Output = Result<GetTransactionResponse, ProviderError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn get_transactions<'life0, 'async_trait>( &'life0 self, request: GetTransactionsRequest, ) -> Pin<Box<dyn Future<Output = Result<GetTransactionsResponse, ProviderError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn get_ledger_entries<'life0, 'life1, 'async_trait>( &'life0 self, keys: &'life1 [LedgerKey], ) -> Pin<Box<dyn Future<Output = Result<GetLedgerEntriesResponse, ProviderError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn get_events<'life0, 'async_trait>( &'life0 self, request: GetEventsRequest, ) -> Pin<Box<dyn Future<Output = Result<GetEventsResponse, ProviderError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn raw_request_dyn<'life0, 'life1, 'async_trait>( &'life0 self, method: &'life1 str, params: Value, id: Option<JsonRpcId>, ) -> Pin<Box<dyn Future<Output = Result<Value, ProviderError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn call_contract<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, contract_address: &'life1 str, function_name: &'life2 ScSymbol, args: Vec<ScVal>, ) -> Pin<Box<dyn Future<Output = Result<ScVal, ProviderError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Calls a contract function (read-only, via simulation).

This method invokes a Soroban contract function without submitting a transaction. It uses simulation to execute the function and return the result.

§Arguments
  • contract_address - The contract address in StrKey format
  • function_name - The function name as an ScSymbol
  • args - Function arguments as ScVal vector
§Returns

The function result as an ScVal, or an error if the call fails

Implementors§