Trait pallet_contracts_rpc::ContractsRuntimeApi [−][src]
pub trait ContractsRuntimeApi<Block, AccountId, Balance, BlockNumber, Hash>: Core<Block> where
Hash: Codec,
Block: Block,
AccountId: Codec,
BlockNumber: Codec,
Balance: Codec, { fn call(
&self,
__runtime_api_at_param__: &BlockId<Block>,
origin: AccountId,
dest: AccountId,
value: Balance,
gas_limit: u64,
input_data: Vec<u8, Global>
) -> Result<ContractResult<Result<ExecReturnValue, DispatchError>>, ApiError> { ... } 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, Global>
) -> Result<ContractResult<Result<ExecReturnValue, DispatchError>>, ApiError> { ... } fn instantiate(
&self,
__runtime_api_at_param__: &BlockId<Block>,
origin: AccountId,
endowment: Balance,
gas_limit: u64,
code: Code<Hash>,
data: Vec<u8, Global>,
salt: Vec<u8, Global>
) -> Result<ContractResult<Result<InstantiateReturnValue<AccountId, BlockNumber>, DispatchError>>, ApiError> { ... } fn instantiate_with_context(
&self,
__runtime_api_at_param__: &BlockId<Block>,
context: ExecutionContext,
origin: AccountId,
endowment: Balance,
gas_limit: u64,
code: Code<Hash>,
data: Vec<u8, Global>,
salt: Vec<u8, Global>
) -> Result<ContractResult<Result<InstantiateReturnValue<AccountId, BlockNumber>, DispatchError>>, ApiError> { ... } fn get_storage(
&self,
__runtime_api_at_param__: &BlockId<Block>,
address: AccountId,
key: [u8; 32]
) -> Result<Result<Option<Vec<u8, Global>>, ContractAccessError>, ApiError> { ... } fn get_storage_with_context(
&self,
__runtime_api_at_param__: &BlockId<Block>,
context: ExecutionContext,
address: AccountId,
key: [u8; 32]
) -> Result<Result<Option<Vec<u8, Global>>, ContractAccessError>, ApiError> { ... } fn rent_projection(
&self,
__runtime_api_at_param__: &BlockId<Block>,
address: AccountId
) -> Result<Result<RentProjection<BlockNumber>, ContractAccessError>, ApiError> { ... } fn rent_projection_with_context(
&self,
__runtime_api_at_param__: &BlockId<Block>,
context: ExecutionContext,
address: AccountId
) -> Result<Result<RentProjection<BlockNumber>, ContractAccessError>, ApiError> { ... } }
Expand description
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, Global>
) -> Result<ContractResult<Result<ExecReturnValue, DispatchError>>, ApiError>
fn call(
&self,
__runtime_api_at_param__: &BlockId<Block>,
origin: AccountId,
dest: AccountId,
value: Balance,
gas_limit: u64,
input_data: Vec<u8, Global>
) -> Result<ContractResult<Result<ExecReturnValue, DispatchError>>, ApiError>
Perform a call from a specified account to a given contract.
See pallet_contracts::Pallet::call
.
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, Global>
) -> Result<ContractResult<Result<ExecReturnValue, DispatchError>>, ApiError>
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, Global>
) -> Result<ContractResult<Result<ExecReturnValue, DispatchError>>, ApiError>
Perform a call from a specified account to a given contract.
See pallet_contracts::Pallet::call
.
fn instantiate(
&self,
__runtime_api_at_param__: &BlockId<Block>,
origin: AccountId,
endowment: Balance,
gas_limit: u64,
code: Code<Hash>,
data: Vec<u8, Global>,
salt: Vec<u8, Global>
) -> Result<ContractResult<Result<InstantiateReturnValue<AccountId, BlockNumber>, DispatchError>>, ApiError>
fn instantiate(
&self,
__runtime_api_at_param__: &BlockId<Block>,
origin: AccountId,
endowment: Balance,
gas_limit: u64,
code: Code<Hash>,
data: Vec<u8, Global>,
salt: Vec<u8, Global>
) -> Result<ContractResult<Result<InstantiateReturnValue<AccountId, BlockNumber>, DispatchError>>, ApiError>
Instantiate a new contract.
See pallet_contracts::Pallet::instantiate
.
fn instantiate_with_context(
&self,
__runtime_api_at_param__: &BlockId<Block>,
context: ExecutionContext,
origin: AccountId,
endowment: Balance,
gas_limit: u64,
code: Code<Hash>,
data: Vec<u8, Global>,
salt: Vec<u8, Global>
) -> Result<ContractResult<Result<InstantiateReturnValue<AccountId, BlockNumber>, DispatchError>>, ApiError>
fn instantiate_with_context(
&self,
__runtime_api_at_param__: &BlockId<Block>,
context: ExecutionContext,
origin: AccountId,
endowment: Balance,
gas_limit: u64,
code: Code<Hash>,
data: Vec<u8, Global>,
salt: Vec<u8, Global>
) -> Result<ContractResult<Result<InstantiateReturnValue<AccountId, BlockNumber>, DispatchError>>, ApiError>
Instantiate a new contract.
See pallet_contracts::Pallet::instantiate
.
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, Global>>, ContractAccessError>, ApiError>
fn get_storage_with_context(
&self,
__runtime_api_at_param__: &BlockId<Block>,
context: ExecutionContext,
address: AccountId,
key: [u8; 32]
) -> Result<Result<Option<Vec<u8, Global>>, ContractAccessError>, 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 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>, ApiError>
fn rent_projection(
&self,
__runtime_api_at_param__: &BlockId<Block>,
address: AccountId
) -> Result<Result<RentProjection<BlockNumber>, ContractAccessError>, ApiError>
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>, ApiError>
fn rent_projection_with_context(
&self,
__runtime_api_at_param__: &BlockId<Block>,
context: ExecutionContext,
address: AccountId
) -> Result<Result<RentProjection<BlockNumber>, ContractAccessError>, ApiError>
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.