[−][src]Trait pallet_contracts_rpc::ContractsApi
Contracts RPC methods.
Required methods
fn call(
&self,
call_request: CallRequest<AccountId, Balance>,
at: Option<BlockHash>
) -> Result<RpcContractExecResult>
&self,
call_request: CallRequest<AccountId, Balance>,
at: Option<BlockHash>
) -> Result<RpcContractExecResult>
Executes a call to a contract.
This call is performed locally without submitting any transactions. Thus executing this won't change any state. Nonetheless, the calling state-changing contracts is still possible.
This method is useful for calling getter-like methods on contracts.
fn get_storage(
&self,
address: AccountId,
key: H256,
at: Option<BlockHash>
) -> Result<Option<Bytes>>
&self,
address: AccountId,
key: H256,
at: Option<BlockHash>
) -> Result<Option<Bytes>>
Returns the value under a specified storage key
in a contract given by address
param,
or None
if it is not set.
fn rent_projection(
&self,
address: AccountId,
at: Option<BlockHash>
) -> Result<Option<BlockNumber>>
&self,
address: AccountId,
at: Option<BlockHash>
) -> Result<Option<BlockNumber>>
Returns the projected time a given contract will be able to sustain paying its rent.
The returned projection is relevant for the given block, i.e. it is as if the contract was accessed at the beginning of that block.
Returns None
if the contract is exempted from rent.
Provided methods
fn to_delegate<M: Metadata>(self) -> IoDelegate<Self, M> where
BlockHash: Send + Sync + 'static + DeserializeOwned,
BlockNumber: Send + Sync + 'static + Serialize,
AccountId: Send + Sync + 'static + DeserializeOwned,
Balance: Send + Sync + 'static + DeserializeOwned,
BlockHash: Send + Sync + 'static + DeserializeOwned,
BlockNumber: Send + Sync + 'static + Serialize,
AccountId: Send + Sync + 'static + DeserializeOwned,
Balance: Send + Sync + 'static + DeserializeOwned,
Create an IoDelegate
, wiring rpc calls to the trait methods.
Implementors
impl<C, Block, AccountId, Balance> ContractsApi<<Block as Block>::Hash, <<Block as Block>::Header as Header>::Number, AccountId, Balance> for Contracts<C, Block> where
Block: BlockT,
C: Send + Sync + 'static + ProvideRuntimeApi<Block> + HeaderBackend<Block>,
C::Api: ContractsRuntimeApi<Block, AccountId, Balance, <<Block as BlockT>::Header as HeaderT>::Number>,
AccountId: Codec,
Balance: Codec,
[src]
Block: BlockT,
C: Send + Sync + 'static + ProvideRuntimeApi<Block> + HeaderBackend<Block>,
C::Api: ContractsRuntimeApi<Block, AccountId, Balance, <<Block as BlockT>::Header as HeaderT>::Number>,
AccountId: Codec,
Balance: Codec,
fn call(
&self,
call_request: CallRequest<AccountId, Balance>,
at: Option<<Block as BlockT>::Hash>
) -> Result<RpcContractExecResult>
[src]
&self,
call_request: CallRequest<AccountId, Balance>,
at: Option<<Block as BlockT>::Hash>
) -> Result<RpcContractExecResult>
fn get_storage(
&self,
address: AccountId,
key: H256,
at: Option<<Block as BlockT>::Hash>
) -> Result<Option<Bytes>>
[src]
&self,
address: AccountId,
key: H256,
at: Option<<Block as BlockT>::Hash>
) -> Result<Option<Bytes>>
fn rent_projection(
&self,
address: AccountId,
at: Option<<Block as BlockT>::Hash>
) -> Result<Option<<<Block as BlockT>::Header as HeaderT>::Number>>
[src]
&self,
address: AccountId,
at: Option<<Block as BlockT>::Hash>
) -> Result<Option<<<Block as BlockT>::Header as HeaderT>::Number>>