Skip to main content

RpcServer

Trait RpcServer 

Source
pub trait RpcServer:
    Sized
    + Send
    + Sync
    + 'static {
    // Required methods
    fn api_versions(&self) -> JsonRpcResult<TapRpcApiVersionsInfo>;
    fn eip712_domain_info(&self) -> JsonRpcResult<Eip712Domain>;
    fn eip712_domain_info_v2(&self) -> JsonRpcResult<Eip712Domain>;
    fn aggregate_receipts(
        &self,
        api_version: String,
        receipts: Vec<Eip712SignedMessage<Receipt>>,
        previous_rav: Option<Eip712SignedMessage<ReceiptAggregateVoucher>>,
    ) -> JsonRpcResult<Eip712SignedMessage<ReceiptAggregateVoucher>>;
    fn aggregate_receipts_v2(
        &self,
        api_version: String,
        receipts: Vec<Eip712SignedMessage<Receipt>>,
        previous_rav: Option<Eip712SignedMessage<ReceiptAggregateVoucher>>,
    ) -> JsonRpcResult<Eip712SignedMessage<ReceiptAggregateVoucher>>;

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

Server trait implementation for the Rpc RPC API.

Required Methods§

Source

fn api_versions(&self) -> JsonRpcResult<TapRpcApiVersionsInfo>

Returns the versions of the TAP JSON-RPC API implemented by this server.

Source

fn eip712_domain_info(&self) -> JsonRpcResult<Eip712Domain>

Returns the EIP-712 domain separator information used by this server. The client is able to verify the signatures of the receipts and receipt aggregate vouchers.

Source

fn eip712_domain_info_v2(&self) -> JsonRpcResult<Eip712Domain>

Returns the v2 EIP-712 domain separator information used by this server. The client is able to verify the signatures of the receipts and receipt aggregate vouchers.

Source

fn aggregate_receipts( &self, api_version: String, receipts: Vec<Eip712SignedMessage<Receipt>>, previous_rav: Option<Eip712SignedMessage<ReceiptAggregateVoucher>>, ) -> JsonRpcResult<Eip712SignedMessage<ReceiptAggregateVoucher>>

Aggregates the given receipts into a receipt aggregate voucher. Returns an error if the user expected API version is not supported.

Source

fn aggregate_receipts_v2( &self, api_version: String, receipts: Vec<Eip712SignedMessage<Receipt>>, previous_rav: Option<Eip712SignedMessage<ReceiptAggregateVoucher>>, ) -> JsonRpcResult<Eip712SignedMessage<ReceiptAggregateVoucher>>

Aggregates the given v2 receipts into a v2 receipt aggregate voucher. Uses the Horizon protocol for collection-based aggregation.

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".

Implementors§