Trait RawTransactionApiServer

Source
pub trait RawTransactionApiServer:
    Sized
    + Send
    + Sync
    + 'static {
    // Required methods
    fn get_raw_transaction<'life0, 'async_trait>(
        &'life0 self,
        txid: Txid,
        verbose: Option<bool>,
        blockhash: Option<BlockHash>,
    ) -> Pin<Box<dyn Future<Output = Result<Value, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn send_raw_transaction<'life0, 'async_trait>(
        &'life0 self,
        hexstring: String,
        maxfeerate: Option<f64>,
    ) -> Pin<Box<dyn Future<Output = Result<SendTransactionResult, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn decode_raw_transaction(
        &self,
        hexstring: String,
        iswitness: Option<bool>,
    ) -> Result<Value, Error>;

    // Provided method
    fn into_rpc(self) -> RpcModule<Self> { ... }
}
Expand description

Server trait implementation for the RawTransactionApi RPC API.

Required Methods§

Source

fn get_raw_transaction<'life0, 'async_trait>( &'life0 self, txid: Txid, verbose: Option<bool>, blockhash: Option<BlockHash>, ) -> Pin<Box<dyn Future<Output = Result<Value, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Return the raw transaction data.

By default, this call only returns a transaction if it is in the mempool. If -txindex is enabled, it also returns the transaction if it is found in a block.

If verbose is false (default), returns hex-encoded serialized transaction. If verbose is true, returns a JSON object with transaction info.

Source

fn send_raw_transaction<'life0, 'async_trait>( &'life0 self, hexstring: String, maxfeerate: Option<f64>, ) -> Pin<Box<dyn Future<Output = Result<SendTransactionResult, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Submit a raw transaction (serialized, hex-encoded) to local node and network.

Returns the transaction hash in hex.

Source

fn decode_raw_transaction( &self, hexstring: String, iswitness: Option<bool>, ) -> Result<Value, Error>

Return a JSON object representing the serialized, hex-encoded transaction.

Provided Methods§

Source

fn into_rpc(self) -> RpcModule<Self>

Collects all the methods and subscriptions defined in the trait and adds them into a single RpcModule.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<Block, Client, TransactionAdapter> RawTransactionApiServer for RawTransaction<Block, Client, TransactionAdapter>
where Block: BlockT + 'static, Client: HeaderBackend<Block> + BlockBackend<Block> + AuxStore + 'static, TransactionAdapter: BitcoinTransactionAdapter<Block> + Send + Sync + 'static,