[][src]Trait pallet_contracts_rpc::ContractsRuntimeApi

pub trait ContractsRuntimeApi<Block, AccountId, Balance, BlockNumber>: Core<Block> where
    AccountId: Codec,
    Balance: Codec,
    Block: Block,
    BlockNumber: Codec
{ fn call(
        &self,
        __runtime_api_at_param__: &BlockId<Block>,
        origin: AccountId,
        dest: AccountId,
        value: Balance,
        gas_limit: u64,
        input_data: Vec<u8>
    ) -> Result<ContractExecResult, Self::Error> { ... }
fn call_with_context(
        &self,
        __runtime_api_at_param__: &BlockId<Block>,
        context: ExecutionContext,
        origin: AccountId,
        dest: AccountId,
        value: Balance,
        gas_limit: u64,
        input_data: Vec<u8>
    ) -> Result<ContractExecResult, Self::Error> { ... }
fn get_storage(
        &self,
        __runtime_api_at_param__: &BlockId<Block>,
        address: AccountId,
        key: [u8; 32]
    ) -> Result<Result<Option<Vec<u8>>, ContractAccessError>, Self::Error> { ... }
fn get_storage_with_context(
        &self,
        __runtime_api_at_param__: &BlockId<Block>,
        context: ExecutionContext,
        address: AccountId,
        key: [u8; 32]
    ) -> Result<Result<Option<Vec<u8>>, ContractAccessError>, Self::Error> { ... }
fn rent_projection(
        &self,
        __runtime_api_at_param__: &BlockId<Block>,
        address: AccountId
    ) -> Result<Result<RentProjection<BlockNumber>, ContractAccessError>, Self::Error> { ... }
fn rent_projection_with_context(
        &self,
        __runtime_api_at_param__: &BlockId<Block>,
        context: ExecutionContext,
        address: AccountId
    ) -> Result<Result<RentProjection<BlockNumber>, ContractAccessError>, Self::Error> { ... } }

The API to interact with contracts without using executive.

Provided methods

fn call(
    &self,
    __runtime_api_at_param__: &BlockId<Block>,
    origin: AccountId,
    dest: AccountId,
    value: Balance,
    gas_limit: u64,
    input_data: Vec<u8>
) -> Result<ContractExecResult, Self::Error>

Perform a call from a specified account to a given contract.

See the contracts' call dispatchable function for more details.

fn call_with_context(
    &self,
    __runtime_api_at_param__: &BlockId<Block>,
    context: ExecutionContext,
    origin: AccountId,
    dest: AccountId,
    value: Balance,
    gas_limit: u64,
    input_data: Vec<u8>
) -> Result<ContractExecResult, Self::Error>

Perform a call from a specified account to a given contract.

See the contracts' call dispatchable function for more details.

fn get_storage(
    &self,
    __runtime_api_at_param__: &BlockId<Block>,
    address: AccountId,
    key: [u8; 32]
) -> Result<Result<Option<Vec<u8>>, ContractAccessError>, Self::Error>

Query a given storage key in a given contract.

Returns Ok(Some(Vec<u8>)) if the storage value exists under the given key in the specified account and Ok(None) if it doesn't. If the account specified by the address doesn't exist, or doesn't have a contract or if the contract is a tombstone, then Err is returned.

fn get_storage_with_context(
    &self,
    __runtime_api_at_param__: &BlockId<Block>,
    context: ExecutionContext,
    address: AccountId,
    key: [u8; 32]
) -> Result<Result<Option<Vec<u8>>, ContractAccessError>, Self::Error>

Query a given storage key in a given contract.

Returns Ok(Some(Vec<u8>)) if the storage value exists under the given key in the specified account and Ok(None) if it doesn't. If the account specified by the address doesn't exist, or doesn't have a contract or if the contract is a tombstone, then Err is returned.

fn rent_projection(
    &self,
    __runtime_api_at_param__: &BlockId<Block>,
    address: AccountId
) -> Result<Result<RentProjection<BlockNumber>, ContractAccessError>, Self::Error>

Returns the projected time a given contract will be able to sustain paying its rent.

The returned projection is relevant for the current block, i.e. it is as if the contract was accessed at the current block.

Returns Err if the contract is in a tombstone state or doesn't exist.

fn rent_projection_with_context(
    &self,
    __runtime_api_at_param__: &BlockId<Block>,
    context: ExecutionContext,
    address: AccountId
) -> Result<Result<RentProjection<BlockNumber>, ContractAccessError>, Self::Error>

Returns the projected time a given contract will be able to sustain paying its rent.

The returned projection is relevant for the current block, i.e. it is as if the contract was accessed at the current block.

Returns Err if the contract is in a tombstone state or doesn't exist.

Loading content...

Trait Implementations

impl<Block, AccountId, Balance, BlockNumber, __Sr_Api_Error__> RuntimeApiInfo for dyn ContractsApi<Block, AccountId, Balance, BlockNumber, Error = __Sr_Api_Error__> + 'static where
    Block: Block
[src]

Implementors

Loading content...