pub trait EthBridgeApiServer<BlockHash, Hash, Approval, AccountId, AssetKind, AssetId, EthAddress, OffchainRequest, RequestStatus, OutgoingRequestEncoded, DispatchError, NetworkId, BalancePrecision>: Sized + Send + Sync + 'static {
    // Required methods
    fn get_requests(
        &self,
        request_hashes: Vec<Hash>,
        network_id: Option<NetworkId>,
        redirect_finished_load_requests: Option<bool>,
        at: Option<BlockHash>
    ) -> RpcResult<Result<Vec<(OffchainRequest, RequestStatus)>, DispatchError>>;
    fn get_approved_requests(
        &self,
        request_hashes: Vec<Hash>,
        network_id: Option<NetworkId>,
        at: Option<BlockHash>
    ) -> RpcResult<Result<Vec<(OutgoingRequestEncoded, Vec<Approval>)>, DispatchError>>;
    fn get_approvals(
        &self,
        request_hashes: Vec<Hash>,
        network_id: Option<NetworkId>,
        at: Option<BlockHash>
    ) -> RpcResult<Result<Vec<Vec<Approval>>, DispatchError>>;
    fn get_account_requests(
        &self,
        account_id: AccountId,
        status_filter: Option<RequestStatus>,
        at: Option<BlockHash>
    ) -> RpcResult<Result<Vec<(NetworkId, Hash)>, DispatchError>>;
    fn get_registered_assets(
        &self,
        network_id: Option<NetworkId>,
        at: Option<BlockHash>
    ) -> RpcResult<Result<Vec<(AssetKind, (AssetId, BalancePrecision), Option<(EthAddress, BalancePrecision)>)>, DispatchError>>;

    // Provided method
    fn into_rpc(self) -> RpcModule<Self>
       where BlockHash: Send + Sync + 'static + DeserializeOwned,
             Hash: Send + Sync + 'static + DeserializeOwned + Serialize,
             Approval: Send + Sync + 'static + Serialize,
             AccountId: Send + Sync + 'static + DeserializeOwned,
             AssetKind: Send + Sync + 'static + Serialize,
             AssetId: Send + Sync + 'static + Serialize,
             EthAddress: Send + Sync + 'static + Serialize,
             OffchainRequest: Send + Sync + 'static + Serialize,
             RequestStatus: Send + Sync + 'static + DeserializeOwned + Serialize,
             OutgoingRequestEncoded: Send + Sync + 'static + Serialize,
             DispatchError: Send + Sync + 'static + Serialize,
             NetworkId: Send + Sync + 'static + DeserializeOwned + Serialize,
             BalancePrecision: Send + Sync + 'static + Serialize { ... }
}
Expand description

Server trait implementation for the EthBridgeApi RPC API.

Required Methods§

source

fn get_requests( &self, request_hashes: Vec<Hash>, network_id: Option<NetworkId>, redirect_finished_load_requests: Option<bool>, at: Option<BlockHash> ) -> RpcResult<Result<Vec<(OffchainRequest, RequestStatus)>, DispatchError>>

source

fn get_approved_requests( &self, request_hashes: Vec<Hash>, network_id: Option<NetworkId>, at: Option<BlockHash> ) -> RpcResult<Result<Vec<(OutgoingRequestEncoded, Vec<Approval>)>, DispatchError>>

source

fn get_approvals( &self, request_hashes: Vec<Hash>, network_id: Option<NetworkId>, at: Option<BlockHash> ) -> RpcResult<Result<Vec<Vec<Approval>>, DispatchError>>

source

fn get_account_requests( &self, account_id: AccountId, status_filter: Option<RequestStatus>, at: Option<BlockHash> ) -> RpcResult<Result<Vec<(NetworkId, Hash)>, DispatchError>>

source

fn get_registered_assets( &self, network_id: Option<NetworkId>, at: Option<BlockHash> ) -> RpcResult<Result<Vec<(AssetKind, (AssetId, BalancePrecision), Option<(EthAddress, BalancePrecision)>)>, DispatchError>>

Provided Methods§

source

fn into_rpc(self) -> RpcModule<Self>where BlockHash: Send + Sync + 'static + DeserializeOwned, Hash: Send + Sync + 'static + DeserializeOwned + Serialize, Approval: Send + Sync + 'static + Serialize, AccountId: Send + Sync + 'static + DeserializeOwned, AssetKind: Send + Sync + 'static + Serialize, AssetId: Send + Sync + 'static + Serialize, EthAddress: Send + Sync + 'static + Serialize, OffchainRequest: Send + Sync + 'static + Serialize, RequestStatus: Send + Sync + 'static + DeserializeOwned + Serialize, OutgoingRequestEncoded: Send + Sync + 'static + Serialize, DispatchError: Send + Sync + 'static + Serialize, NetworkId: Send + Sync + 'static + DeserializeOwned + Serialize, BalancePrecision: Send + Sync + 'static + Serialize,

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

Implementors§

source§

impl<C, Block, Hash, Approval, AccountId, AssetKind, AssetId, EthAddress, OffchainRequest, RequestStatus, OutgoingRequestEncoded, NetworkId, BalancePrecision> EthBridgeApiServer<<Block as Block>::Hash, Hash, Approval, AccountId, AssetKind, AssetId, EthAddress, OffchainRequest, RequestStatus, OutgoingRequestEncoded, DispatchError, NetworkId, BalancePrecision> for EthBridgeRpc<C, Block>where Block: BlockT, C: Send + Sync + 'static + ProvideRuntimeApi<Block> + HeaderBackend<Block>, C::Api: EthBridgeRuntimeApi<Block, Hash, Approval, AccountId, AssetKind, AssetId, EthAddress, OffchainRequest, RequestStatus, OutgoingRequestEncoded, NetworkId, BalancePrecision>, Approval: Codec, Hash: Codec, AccountId: Codec, AssetKind: Codec, AssetId: Codec, EthAddress: Codec, OffchainRequest: Codec, RequestStatus: Codec, OutgoingRequestEncoded: Codec, NetworkId: Codec, BalancePrecision: Codec,