pub trait ContractsApi<Block: BlockT, AccountId, Balance, BlockNumber, Hash, EventRecord>: Core<Block>
where AccountId: Codec, Balance: Codec, BlockNumber: Codec, Hash: Codec, EventRecord: Codec,
{ // Provided methods fn call( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, origin: AccountId, dest: AccountId, value: Balance, gas_limit: Option<Weight>, storage_deposit_limit: Option<Balance>, input_data: Vec<u8> ) -> Result<ContractExecResult<Balance, EventRecord>, ApiError> { ... } fn instantiate( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, origin: AccountId, value: Balance, gas_limit: Option<Weight>, storage_deposit_limit: Option<Balance>, code: Code<Hash>, data: Vec<u8>, salt: Vec<u8> ) -> Result<ContractInstantiateResult<AccountId, Balance, EventRecord>, ApiError> { ... } fn upload_code( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, origin: AccountId, code: Vec<u8>, storage_deposit_limit: Option<Balance>, determinism: Determinism ) -> Result<CodeUploadResult<Hash, Balance>, ApiError> { ... } fn get_storage( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, address: AccountId, key: Vec<u8> ) -> Result<GetStorageResult, ApiError> { ... } }
Expand description

The API used to dry-run contract interactions.

Provided Methods§

source

fn call( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, origin: AccountId, dest: AccountId, value: Balance, gas_limit: Option<Weight>, storage_deposit_limit: Option<Balance>, input_data: Vec<u8> ) -> Result<ContractExecResult<Balance, EventRecord>, ApiError>

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

See crate::Pallet::bare_call.

source

fn instantiate( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, origin: AccountId, value: Balance, gas_limit: Option<Weight>, storage_deposit_limit: Option<Balance>, code: Code<Hash>, data: Vec<u8>, salt: Vec<u8> ) -> Result<ContractInstantiateResult<AccountId, Balance, EventRecord>, ApiError>

Instantiate a new contract.

See [crate::Pallet::bare_instantiate].

source

fn upload_code( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, origin: AccountId, code: Vec<u8>, storage_deposit_limit: Option<Balance>, determinism: Determinism ) -> Result<CodeUploadResult<Hash, Balance>, ApiError>

Upload new code without instantiating a contract from it.

See crate::Pallet::bare_upload_code.

source

fn get_storage( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, address: AccountId, key: Vec<u8> ) -> Result<GetStorageResult, ApiError>

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 then Err is returned.

Trait Implementations§

source§

impl<Block: BlockT, AccountId, Balance, BlockNumber, Hash, EventRecord> RuntimeApiInfo for dyn ContractsApi<Block, AccountId, Balance, BlockNumber, Hash, EventRecord>

source§

const ID: [u8; 8] = _

The identifier of the runtime api.
source§

const VERSION: u32 = 2u32

The version of the runtime api.

Implementors§