Struct casper_rust_wasm_sdk::SDK
source · pub struct SDK { /* private fields */ }
Implementations§
source§impl SDK
impl SDK
sourcepub async fn deploy(
&self,
deploy_params: DeployStrParams,
session_params: SessionStrParams,
payment_params: PaymentStrParams,
verbosity: Option<Verbosity>,
rpc_address: Option<String>,
) -> Result<SuccessResponse<_PutDeployResult>, SdkError>
pub async fn deploy( &self, deploy_params: DeployStrParams, session_params: SessionStrParams, payment_params: PaymentStrParams, verbosity: Option<Verbosity>, rpc_address: Option<String>, ) -> Result<SuccessResponse<_PutDeployResult>, SdkError>
Perform a deploy operation.
§Arguments
deploy_params
- Deploy parameters.session_params
- Session parameters.payment_params
- Payment parameters.verbosity
- An optional verbosity level.rpc_address
- An optional rpc address.
§Returns
A result containing a SuccessResponse<_PutDeployResult>
or an SdkError.
source§impl SDK
impl SDK
sourcepub async fn speculative_deploy(
&self,
deploy_params: DeployStrParams,
session_params: SessionStrParams,
payment_params: PaymentStrParams,
verbosity: Option<Verbosity>,
rpc_address: Option<String>,
) -> Result<SuccessResponse<_SpeculativeExecResult>, SdkError>
👎Deprecated: prefer speculative_transaction
pub async fn speculative_deploy( &self, deploy_params: DeployStrParams, session_params: SessionStrParams, payment_params: PaymentStrParams, verbosity: Option<Verbosity>, rpc_address: Option<String>, ) -> Result<SuccessResponse<_SpeculativeExecResult>, SdkError>
This function allows executing a deploy speculatively.
§Arguments
deploy_params
- Deployment parameters for the deploy.session_params
- Session parameters for the deploy.payment_params
- Payment parameters for the deploy.verbosity
- Optional verbosity level.rpc_address
- Optional rpc address.
§Returns
A Result
containing either a SuccessResponse<_SpeculativeExecResult>
or a SdkError
in case of an error.
source§impl SDK
impl SDK
sourcepub async fn speculative_transfer(
&self,
amount: &str,
target_account: &str,
transfer_id: Option<String>,
deploy_params: DeployStrParams,
payment_params: PaymentStrParams,
verbosity: Option<Verbosity>,
rpc_address: Option<String>,
) -> Result<SuccessResponse<_SpeculativeExecResult>, SdkError>
👎Deprecated: prefer speculative_transfer_transaction
pub async fn speculative_transfer( &self, amount: &str, target_account: &str, transfer_id: Option<String>, deploy_params: DeployStrParams, payment_params: PaymentStrParams, verbosity: Option<Verbosity>, rpc_address: Option<String>, ) -> Result<SuccessResponse<_SpeculativeExecResult>, SdkError>
Perform a speculative transfer.
§Arguments
amount
- The amount to transfer.target_account
- The target account.transfer_id
- An optional transfer ID (defaults to a random number).deploy_params
- The deployment parameters.payment_params
- The payment parameters.verbosity
- The verbosity level for logging (optional).rpc_address
- The address of the node to connect to (optional).
§Returns
A Result
containing the result a SuccessResponse<_SpeculativeExecResult>
or a SdkError
in case of an error.
source§impl SDK
impl SDK
sourcepub async fn transfer(
&self,
amount: &str,
target_account: &str,
transfer_id: Option<String>,
deploy_params: DeployStrParams,
payment_params: PaymentStrParams,
verbosity: Option<Verbosity>,
rpc_address: Option<String>,
) -> Result<SuccessResponse<_PutDeployResult>, SdkError>
👎Deprecated: prefer transfer_transaction
pub async fn transfer( &self, amount: &str, target_account: &str, transfer_id: Option<String>, deploy_params: DeployStrParams, payment_params: PaymentStrParams, verbosity: Option<Verbosity>, rpc_address: Option<String>, ) -> Result<SuccessResponse<_PutDeployResult>, SdkError>
Perform a transfer of funds.
§Arguments
amount
- The amount to transfer.target_account
- The target account.transfer_id
- An optional transfer ID (defaults to a random number).deploy_params
- The deployment parameters.payment_params
- The payment parameters.verbosity
- The verbosity level for logging (optional).rpc_address
- The address of the node to connect to (optional).
§Returns
A Result
containing the result a SuccessResponse<_PutDeployResult>
of the transfer or a SdkError
in case of an error.
source§impl SDK
impl SDK
sourcepub async fn get_account(
&self,
account_identifier: Option<AccountIdentifier>,
account_identifier_as_string: Option<String>,
maybe_block_identifier: Option<BlockIdentifierInput>,
verbosity: Option<Verbosity>,
rpc_address: Option<String>,
) -> Result<SuccessResponse<_GetAccountResult>, SdkError>
👎Deprecated: prefer ‘get_entity’
pub async fn get_account( &self, account_identifier: Option<AccountIdentifier>, account_identifier_as_string: Option<String>, maybe_block_identifier: Option<BlockIdentifierInput>, verbosity: Option<Verbosity>, rpc_address: Option<String>, ) -> Result<SuccessResponse<_GetAccountResult>, SdkError>
Retrieves account information based on the provided options.
§Arguments
account_identifier
- An optionalAccountIdentifier
for specifying the account identifier.account_identifier_as_string
- An optional string representing the account identifier.maybe_block_identifier
- An optionalBlockIdentifierInput
for specifying a block identifier.verbosity
- An optionalVerbosity
level for controlling the output verbosity.rpc_address
- An optional string specifying the rpc address to use for the request.
§Returns
A Result
containing either a SuccessResponse<_GetAccountResult>
or a SdkError
in case of an error.
§Errors
Returns a SdkError
if there is an error during the retrieval process.
source§impl SDK
impl SDK
sourcepub async fn get_auction_info(
&self,
maybe_block_identifier: Option<BlockIdentifierInput>,
verbosity: Option<Verbosity>,
rpc_address: Option<String>,
) -> Result<SuccessResponse<_GetAuctionInfoResult>, SdkError>
pub async fn get_auction_info( &self, maybe_block_identifier: Option<BlockIdentifierInput>, verbosity: Option<Verbosity>, rpc_address: Option<String>, ) -> Result<SuccessResponse<_GetAuctionInfoResult>, SdkError>
Retrieves auction information based on the provided options.
§Arguments
maybe_block_identifier
- An optionalBlockIdentifierInput
for specifying a block identifier.verbosity
- An optionalVerbosity
level for controlling the output verbosity.rpc_address
- An optional string specifying the rpc address to use for the request.
§Returns
A Result
containing either a _GetAuctionInfoResult
or a SdkError
in case of an error.
§Errors
Returns a SdkError
if there is an error during the retrieval process.
source§impl SDK
impl SDK
sourcepub async fn get_balance(
&self,
state_root_hash: impl ToDigest,
purse_uref: GetBalanceInput,
verbosity: Option<Verbosity>,
rpc_address: Option<String>,
) -> Result<SuccessResponse<_GetBalanceResult>, SdkError>
pub async fn get_balance( &self, state_root_hash: impl ToDigest, purse_uref: GetBalanceInput, verbosity: Option<Verbosity>, rpc_address: Option<String>, ) -> Result<SuccessResponse<_GetBalanceResult>, SdkError>
Retrieves balance information based on the provided options.
§Arguments
state_root_hash
- The state root hash to query for balance information.purse_uref
- The purse uref specifying the purse for which to retrieve the balance.verbosity
- An optionalVerbosity
level for controlling the output verbosity.rpc_address
- An optional string specifying the rpc address to use for the request.
§Returns
A Result
containing either a GetBalanceResult
or a SdkError
in case of an error.
§Errors
Returns a SdkError
if there is an error during the retrieval process.
source§impl SDK
impl SDK
sourcepub async fn get_block(
&self,
maybe_block_identifier: Option<BlockIdentifierInput>,
verbosity: Option<Verbosity>,
rpc_address: Option<String>,
) -> Result<SuccessResponse<_GetBlockResult>, SdkError>
pub async fn get_block( &self, maybe_block_identifier: Option<BlockIdentifierInput>, verbosity: Option<Verbosity>, rpc_address: Option<String>, ) -> Result<SuccessResponse<_GetBlockResult>, SdkError>
Retrieves block information using the provided options.
§Arguments
maybe_block_identifier
- An optionalBlockIdentifierInput
specifying the block identifier.verbosity
- An optionalVerbosity
level for the retrieval.rpc_address
- An optional rpc address to target for retrieval.
§Returns
A Result
containing either a _GetBlockResult
or a SdkError
in case of an error.
§Errors
Returns a SdkError
if there is an error during the retrieval process.
source§impl SDK
impl SDK
sourcepub async fn get_block_transfers(
&self,
maybe_block_identifier: Option<BlockIdentifierInput>,
verbosity: Option<Verbosity>,
rpc_address: Option<String>,
) -> Result<SuccessResponse<_GetBlockTransfersResult>, SdkError>
pub async fn get_block_transfers( &self, maybe_block_identifier: Option<BlockIdentifierInput>, verbosity: Option<Verbosity>, rpc_address: Option<String>, ) -> Result<SuccessResponse<_GetBlockTransfersResult>, SdkError>
Retrieves block transfers information based on the provided options.
§Arguments
maybe_block_identifier
- An optionalBlockIdentifierInput
specifying the block identifier.verbosity
- An optionalVerbosity
level for controlling the output verbosity.rpc_address
- An optional string specifying the rpc address to use for the request.
§Returns
A Result
containing either a _GetBlockTransfersResult
or a SdkError
in case of an error.
§Errors
Returns a SdkError
if there is an error during the retrieval process.
source§impl SDK
impl SDK
Implementations for the SDK
struct.
sourcepub async fn get_chainspec(
&self,
verbosity: Option<Verbosity>,
rpc_address: Option<String>,
) -> Result<SuccessResponse<_GetChainspecResult>, Error>
pub async fn get_chainspec( &self, verbosity: Option<Verbosity>, rpc_address: Option<String>, ) -> Result<SuccessResponse<_GetChainspecResult>, Error>
source§impl SDK
impl SDK
sourcepub async fn get_deploy(
&self,
deploy_hash: DeployHash,
finalized_approvals: Option<bool>,
verbosity: Option<Verbosity>,
rpc_address: Option<String>,
) -> Result<SuccessResponse<_GetDeployResult>, Error>
👎Deprecated: prefer ‘get_transaction’
pub async fn get_deploy( &self, deploy_hash: DeployHash, finalized_approvals: Option<bool>, verbosity: Option<Verbosity>, rpc_address: Option<String>, ) -> Result<SuccessResponse<_GetDeployResult>, Error>
Retrieves deploy information based on the provided options.
§Arguments
deploy_hash
- The deploy hash.finalized_approvals
- An optional boolean indicating finalized approvals.verbosity
- An optional verbosity level.rpc_address
- An optional rpc address.
§Returns
A Result
containing either a _GetDeployResult
or an error.
source§impl SDK
impl SDK
sourcepub async fn get_dictionary_item(
&self,
state_root_hash: impl ToDigest,
dictionary_item_input: DictionaryItemInput,
verbosity: Option<Verbosity>,
rpc_address: Option<String>,
) -> Result<SuccessResponse<_GetDictionaryItemResult>, SdkError>
pub async fn get_dictionary_item( &self, state_root_hash: impl ToDigest, dictionary_item_input: DictionaryItemInput, verbosity: Option<Verbosity>, rpc_address: Option<String>, ) -> Result<SuccessResponse<_GetDictionaryItemResult>, SdkError>
Retrieves dictionary item information based on the provided options.
§Arguments
state_root_hash
- AToDigest
implementation for specifying the state root hash.dictionary_item
- ADictionaryItemInput
enum specifying the dictionary item to retrieve.verbosity
- An optionalVerbosity
level for controlling the output verbosity.rpc_address
- An optional string specifying the rpc address to use for the request.
§Returns
A Result
containing either a _GetDictionaryItemResult
or a SdkError
in case of an error.
§Errors
Returns a SdkError
if there is an error during the retrieval process.
source§impl SDK
impl SDK
sourcepub async fn get_entity(
&self,
entity_identifier: Option<EntityIdentifier>,
entity_identifier_as_string: Option<String>,
maybe_block_identifier: Option<BlockIdentifierInput>,
verbosity: Option<Verbosity>,
rpc_address: Option<String>,
) -> Result<SuccessResponse<_GetAddressableEntityResult>, SdkError>
pub async fn get_entity( &self, entity_identifier: Option<EntityIdentifier>, entity_identifier_as_string: Option<String>, maybe_block_identifier: Option<BlockIdentifierInput>, verbosity: Option<Verbosity>, rpc_address: Option<String>, ) -> Result<SuccessResponse<_GetAddressableEntityResult>, SdkError>
Retrieves account information based on the provided options.
§Arguments
entity_identifier
- An optionalEntityIdentifier
for specifying the entity identifier.entity_identifier_as_string
- An optional string representing the entity identifier.maybe_block_identifier
- An optionalBlockIdentifierInput
for specifying a block identifier.verbosity
- An optionalVerbosity
level for controlling the output verbosity.rpc_address
- An optional string specifying the rpc address to use for the request.
§Returns
A Result
containing either a SuccessResponse<_GetAddressableEntityResult>
or a SdkError
in case of an error.
§Errors
Returns a SdkError
if there is an error during the retrieval process.
source§impl SDK
impl SDK
pub async fn get_era_info( &self, maybe_block_identifier: Option<BlockIdentifierInput>, verbosity: Option<Verbosity>, rpc_address: Option<String>, ) -> Result<SuccessResponse<_GetEraInfoResult>, SdkError>
source§impl SDK
impl SDK
sourcepub async fn get_era_summary(
&self,
maybe_block_identifier: Option<BlockIdentifierInput>,
verbosity: Option<Verbosity>,
rpc_address: Option<String>,
) -> Result<SuccessResponse<_GetEraSummaryResult>, SdkError>
pub async fn get_era_summary( &self, maybe_block_identifier: Option<BlockIdentifierInput>, verbosity: Option<Verbosity>, rpc_address: Option<String>, ) -> Result<SuccessResponse<_GetEraSummaryResult>, SdkError>
Retrieves era summary information based on the provided options.
§Arguments
maybe_block_identifier
- An optionalBlockIdentifierInput
for specifying a block identifier.verbosity
- An optionalVerbosity
level for controlling the output verbosity.rpc_address
- An optional string specifying the rpc address to use for the request.
§Returns
A Result
containing either a _GetEraSummaryResult
or a SdkError
in case of an error.
§Errors
Returns a SdkError
if there is an error during the retrieval process.
source§impl SDK
impl SDK
sourcepub async fn get_node_status(
&self,
verbosity: Option<Verbosity>,
rpc_address: Option<String>,
) -> Result<SuccessResponse<_GetNodeStatusResult>, Error>
pub async fn get_node_status( &self, verbosity: Option<Verbosity>, rpc_address: Option<String>, ) -> Result<SuccessResponse<_GetNodeStatusResult>, Error>
Retrieves node status information based on the provided options.
§Arguments
verbosity
- An optionalVerbosity
level for controlling the output verbosity.rpc_address
- An optional string specifying the rpc address to use for the request.
§Returns
A Result
containing either a _GetNodeStatusResult
or an Error
in case of an error.
§Errors
Returns an Error
if there is an error during the retrieval process.
source§impl SDK
impl SDK
sourcepub async fn get_peers(
&self,
verbosity: Option<Verbosity>,
rpc_address: Option<String>,
) -> Result<SuccessResponse<_GetPeersResult>, Error>
pub async fn get_peers( &self, verbosity: Option<Verbosity>, rpc_address: Option<String>, ) -> Result<SuccessResponse<_GetPeersResult>, Error>
source§impl SDK
impl SDK
sourcepub async fn get_state_root_hash(
&self,
maybe_block_identifier: Option<BlockIdentifierInput>,
verbosity: Option<Verbosity>,
rpc_address: Option<String>,
) -> Result<SuccessResponse<_GetStateRootHashResult>, SdkError>
pub async fn get_state_root_hash( &self, maybe_block_identifier: Option<BlockIdentifierInput>, verbosity: Option<Verbosity>, rpc_address: Option<String>, ) -> Result<SuccessResponse<_GetStateRootHashResult>, SdkError>
Retrieves state root hash information based on the provided options.
§Arguments
maybe_block_identifier
- An optionalBlockIdentifierInput
for specifying a block identifier.verbosity
- An optionalVerbosity
level for controlling the output verbosity.rpc_address
- An optional string specifying the rpc address to use for the request.
§Returns
A Result
containing either a _GetStateRootHashResult
or a SdkError
in case of an error.
§Errors
Returns a SdkError
if there is an error during the retrieval process.
source§impl SDK
impl SDK
sourcepub async fn get_transaction(
&self,
transaction_hash: TransactionHash,
finalized_approvals: Option<bool>,
verbosity: Option<Verbosity>,
rpc_address: Option<String>,
) -> Result<SuccessResponse<_GetTransactionResult>, Error>
pub async fn get_transaction( &self, transaction_hash: TransactionHash, finalized_approvals: Option<bool>, verbosity: Option<Verbosity>, rpc_address: Option<String>, ) -> Result<SuccessResponse<_GetTransactionResult>, Error>
Retrieves transaction information based on the provided options.
§Arguments
transaction_hash
- The transaction hash.finalized_approvals
- An optional boolean indicating finalized approvals.verbosity
- An optional verbosity level.rpc_address
- An optional rpc address.
§Returns
A Result
containing either a _GetTransactionResult
or an error.
source§impl SDK
impl SDK
sourcepub async fn get_validator_changes(
&self,
verbosity: Option<Verbosity>,
rpc_address: Option<String>,
) -> Result<SuccessResponse<_GetValidatorChangesResult>, Error>
pub async fn get_validator_changes( &self, verbosity: Option<Verbosity>, rpc_address: Option<String>, ) -> Result<SuccessResponse<_GetValidatorChangesResult>, Error>
Retrieves validator changes based on the provided options.
§Arguments
verbosity
- An optionalVerbosity
level for controlling the output verbosity.rpc_address
- An optional string specifying the rpc address to use for the request.
§Returns
A Result
containing either a _GetValidatorChangesResult
or an Error
in case of an error.
§Errors
Returns an Error
if there is an error during the retrieval process.
source§impl SDK
impl SDK
sourcepub async fn list_rpcs(
&self,
verbosity: Option<Verbosity>,
rpc_address: Option<String>,
) -> Result<SuccessResponse<_ListRpcsResult>, Error>
pub async fn list_rpcs( &self, verbosity: Option<Verbosity>, rpc_address: Option<String>, ) -> Result<SuccessResponse<_ListRpcsResult>, Error>
Lists available RPCs based on the provided options.
§Arguments
verbosity
- An optionalVerbosity
level for controlling the output verbosity.rpc_address
- An optional string specifying the rpc address to use for the request.
§Returns
A Result
containing either a _ListRpcsResult
or an Error
in case of an error.
§Errors
Returns an Error
if there is an error during the listing process.
source§impl SDK
impl SDK
sourcepub async fn put_deploy(
&self,
deploy: Deploy,
verbosity: Option<Verbosity>,
rpc_address: Option<String>,
) -> Result<SuccessResponse<_PutDeployResult>, Error>
pub async fn put_deploy( &self, deploy: Deploy, verbosity: Option<Verbosity>, rpc_address: Option<String>, ) -> Result<SuccessResponse<_PutDeployResult>, Error>
Puts a deploy based on the provided options.
§Arguments
deploy
- TheDeploy
object to be sent.verbosity
- An optionalVerbosity
level for controlling the output verbosity.rpc_address
- An optional string specifying the rpc address to use for the request.
§Returns
A Result
containing either a _PutDeployResult
or an Error
in case of an error.
§Errors
Returns an Error
if there is an error during the deploy process.
source§impl SDK
impl SDK
sourcepub async fn put_transaction(
&self,
transaction: Transaction,
verbosity: Option<Verbosity>,
rpc_address: Option<String>,
) -> Result<SuccessResponse<_PutTransactionResult>, Error>
pub async fn put_transaction( &self, transaction: Transaction, verbosity: Option<Verbosity>, rpc_address: Option<String>, ) -> Result<SuccessResponse<_PutTransactionResult>, Error>
Puts a transaction based on the provided options.
§Arguments
transaction
- TheTransaction
object to be sent.verbosity
- An optionalVerbosity
level for controlling the output verbosity.rpc_address
- An optional string specifying the rpc address to use for the request.
§Returns
A Result
containing either a _PutTransactionResult
or an Error
in case of an error.
§Errors
Returns an Error
if there is an error during the transaction process.
source§impl SDK
impl SDK
sourcepub async fn query_balance(
&self,
maybe_global_state_identifier: Option<GlobalStateIdentifier>,
purse_identifier_as_string: Option<String>,
purse_identifier: Option<PurseIdentifier>,
state_root_hash: Option<String>,
maybe_block_id: Option<String>,
verbosity: Option<Verbosity>,
rpc_address: Option<String>,
) -> Result<SuccessResponse<_QueryBalanceResult>, SdkError>
pub async fn query_balance( &self, maybe_global_state_identifier: Option<GlobalStateIdentifier>, purse_identifier_as_string: Option<String>, purse_identifier: Option<PurseIdentifier>, state_root_hash: Option<String>, maybe_block_id: Option<String>, verbosity: Option<Verbosity>, rpc_address: Option<String>, ) -> Result<SuccessResponse<_QueryBalanceResult>, SdkError>
Retrieves balance information based on the provided options.
§Arguments
maybe_global_state_identifier
- An optionalGlobalStateIdentifier
for specifying global state.purse_identifier_as_string
- An optional string representing a purse identifier.purse_identifier
- An optionalPurseIdentifier
.state_root_hash
- An optional string representing a state root hash.maybe_block_id
- An optional string representing a block identifier.verbosity
- An optionalVerbosity
level for controlling the output verbosity.rpc_address
- An optional string specifying the rpc address to use for the request.
§Returns
A Result
containing either a SuccessResponse<_QueryBalanceResult>
or a SdkError
in case of an error.
§Errors
Returns a SdkError
if there is an error during the retrieval process.
source§impl SDK
impl SDK
sourcepub async fn query_balance_details(
&self,
maybe_global_state_identifier: Option<GlobalStateIdentifier>,
purse_identifier_as_string: Option<String>,
purse_identifier: Option<PurseIdentifier>,
state_root_hash: Option<String>,
maybe_block_id: Option<String>,
verbosity: Option<Verbosity>,
rpc_address: Option<String>,
) -> Result<SuccessResponse<_QueryBalanceDetailsResult>, SdkError>
pub async fn query_balance_details( &self, maybe_global_state_identifier: Option<GlobalStateIdentifier>, purse_identifier_as_string: Option<String>, purse_identifier: Option<PurseIdentifier>, state_root_hash: Option<String>, maybe_block_id: Option<String>, verbosity: Option<Verbosity>, rpc_address: Option<String>, ) -> Result<SuccessResponse<_QueryBalanceDetailsResult>, SdkError>
Retrieves balance information details based on the provided options.
§Arguments
maybe_global_state_identifier
- An optionalGlobalStateIdentifier
for specifying global state.purse_identifier_as_string
- An optional string representing a purse identifier.purse_identifier
- An optionalPurseIdentifier
.state_root_hash
- An optional string representing a state root hash.maybe_block_id
- An optional string representing a block identifier.verbosity
- An optionalVerbosity
level for controlling the output verbosity.rpc_address
- An optional string specifying the rpc address to use for the request.
§Returns
A Result
containing either a SuccessResponse<_QueryBalanceDetailsResult>
or a SdkError
in case of an error.
§Errors
Returns a SdkError
if there is an error during the retrieval process.
source§impl SDK
impl SDK
sourcepub fn query_global_state_js_alias_params(
&self,
options: Option<QueryGlobalStateOptions>,
) -> Result<QueryGlobalStateParams, SdkError>
pub fn query_global_state_js_alias_params( &self, options: Option<QueryGlobalStateOptions>, ) -> Result<QueryGlobalStateParams, SdkError>
sourcepub async fn query_global_state(
&self,
query_params: QueryGlobalStateParams,
) -> Result<SuccessResponse<_QueryGlobalStateResult>, SdkError>
pub async fn query_global_state( &self, query_params: QueryGlobalStateParams, ) -> Result<SuccessResponse<_QueryGlobalStateResult>, SdkError>
source§impl SDK
impl SDK
sourcepub async fn speculative_exec(
&self,
transaction: Transaction,
verbosity: Option<Verbosity>,
rpc_address: Option<String>,
) -> Result<SuccessResponse<_SpeculativeExecTxnResult>, SdkError>
pub async fn speculative_exec( &self, transaction: Transaction, verbosity: Option<Verbosity>, rpc_address: Option<String>, ) -> Result<SuccessResponse<_SpeculativeExecTxnResult>, SdkError>
source§impl SDK
impl SDK
sourcepub async fn speculative_exec_deploy(
&self,
deploy: Deploy,
verbosity: Option<Verbosity>,
rpc_address: Option<String>,
) -> Result<SuccessResponse<_SpeculativeExecResult>, SdkError>
👎Deprecated: prefer speculative_exec_transaction
pub async fn speculative_exec_deploy( &self, deploy: Deploy, verbosity: Option<Verbosity>, rpc_address: Option<String>, ) -> Result<SuccessResponse<_SpeculativeExecResult>, SdkError>
source§impl SDK
impl SDK
sourcepub async fn speculative_transaction(
&self,
builder_params: TransactionBuilderParams,
transaction_params: TransactionStrParams,
verbosity: Option<Verbosity>,
rpc_address: Option<String>,
) -> Result<SuccessResponse<_SpeculativeExecTxnResult>, SdkError>
pub async fn speculative_transaction( &self, builder_params: TransactionBuilderParams, transaction_params: TransactionStrParams, verbosity: Option<Verbosity>, rpc_address: Option<String>, ) -> Result<SuccessResponse<_SpeculativeExecTxnResult>, SdkError>
This function allows executing a transaction speculatively.
§Arguments
builder_params
- Transaction Builder parameters.transaction_params
- Transactionment parameters for the transaction.verbosity
- Optional verbosity level.rpc_address
- Optional rpc address.
§Returns
A Result
containing either a SuccessResponse<_SpeculativeExecTxnResult>
or a SdkError
in case of an error.
source§impl SDK
impl SDK
sourcepub async fn speculative_transfer_transaction(
&self,
maybe_source: Option<URef>,
target_account: &str,
amount: &str,
transaction_params: TransactionStrParams,
maybe_id: Option<String>,
verbosity: Option<Verbosity>,
rpc_address: Option<String>,
) -> Result<SuccessResponse<_SpeculativeExecTxnResult>, SdkError>
pub async fn speculative_transfer_transaction( &self, maybe_source: Option<URef>, target_account: &str, amount: &str, transaction_params: TransactionStrParams, maybe_id: Option<String>, verbosity: Option<Verbosity>, rpc_address: Option<String>, ) -> Result<SuccessResponse<_SpeculativeExecTxnResult>, SdkError>
Perform a speculative transfer transaction.
§Arguments
maybe_source
- Optional transfer source uref.amount
- The amount to transfer.target_account
- The target account.transaction_params
- The transactionment parameters.maybe_id
- An optional transfer ID (defaults to a random number).verbosity
- The verbosity level for logging (optional).rpc_address
- The address of the node to connect to (optional).
§Returns
A Result
containing the result a SuccessResponse<_SpeculativeExecTxnResult>
or a SdkError
in case of an error.
source§impl SDK
impl SDK
sourcepub async fn transaction(
&self,
builder_params: TransactionBuilderParams,
transaction_params: TransactionStrParams,
verbosity: Option<Verbosity>,
rpc_address: Option<String>,
) -> Result<SuccessResponse<_PutTransactionResult>, SdkError>
pub async fn transaction( &self, builder_params: TransactionBuilderParams, transaction_params: TransactionStrParams, verbosity: Option<Verbosity>, rpc_address: Option<String>, ) -> Result<SuccessResponse<_PutTransactionResult>, SdkError>
Perform a transaction operation.
§Arguments
builder_params
- Transaction Builder parameters.transaction_params
- Transaction parameters.verbosity
- An optional verbosity level.rpc_address
- An optional rpc address.
§Returns
A result containing a SuccessResponse<_PutTransactionResult>
or an SdkError.
source§impl SDK
impl SDK
sourcepub async fn transfer_transaction(
&self,
maybe_source: Option<URef>,
target_account: &str,
amount: &str,
transaction_params: TransactionStrParams,
maybe_id: Option<String>,
verbosity: Option<Verbosity>,
rpc_address: Option<String>,
) -> Result<SuccessResponse<_PutTransactionResult>, SdkError>
pub async fn transfer_transaction( &self, maybe_source: Option<URef>, target_account: &str, amount: &str, transaction_params: TransactionStrParams, maybe_id: Option<String>, verbosity: Option<Verbosity>, rpc_address: Option<String>, ) -> Result<SuccessResponse<_PutTransactionResult>, SdkError>
Perform a transfer transaction of funds.
§Arguments
maybe_source
- Optional transfer source uref.target_account
- The target account.amount
- The amount to transfer.transaction_params
- The transaction parameters.maybe_id
- An optional transfer ID (defaults to a random number).verbosity
- The verbosity level for logging (optional).rpc_address
- The address of the node to connect to (optional).
§Returns
A Result
containing the result a SuccessResponse<_PutTransactionResult>
of the transfer or a SdkError
in case of an error.
source§impl SDK
impl SDK
sourcepub fn make_deploy(
&self,
deploy_params: DeployStrParams,
session_params: SessionStrParams,
payment_params: PaymentStrParams,
) -> Result<Deploy, SdkError>
👎Deprecated: prefer ‘make_transaction’
pub fn make_deploy( &self, deploy_params: DeployStrParams, session_params: SessionStrParams, payment_params: PaymentStrParams, ) -> Result<Deploy, SdkError>
source§impl SDK
impl SDK
sourcepub fn make_transfer(
&self,
amount: &str,
target_account: &str,
transfer_id: Option<String>,
deploy_params: DeployStrParams,
payment_params: PaymentStrParams,
) -> Result<Deploy, SdkError>
👎Deprecated: prefer ‘make_transfer_transaction’
pub fn make_transfer( &self, amount: &str, target_account: &str, transfer_id: Option<String>, deploy_params: DeployStrParams, payment_params: PaymentStrParams, ) -> Result<Deploy, SdkError>
Creates a transfer deploy with the provided parameters.
§Arguments
amount
- The transfer amount.target_account
- The target account.transfer_id
- Optional transfer identifier.deploy_params
- The deploy parameters.payment_params
- The payment parameters.
§Returns
A Result
containing the created Deploy
or a SdkError
in case of an error.
source§impl SDK
impl SDK
sourcepub fn make_transaction(
&self,
builder_params: TransactionBuilderParams,
transaction_params: TransactionStrParams,
) -> Result<Transaction, SdkError>
pub fn make_transaction( &self, builder_params: TransactionBuilderParams, transaction_params: TransactionStrParams, ) -> Result<Transaction, SdkError>
source§impl SDK
impl SDK
sourcepub fn make_transfer_transaction(
&self,
maybe_source: Option<URef>,
target: &str,
amount: &str,
transaction_params: TransactionStrParams,
maybe_id: Option<String>,
) -> Result<Transaction, SdkError>
pub fn make_transfer_transaction( &self, maybe_source: Option<URef>, target: &str, amount: &str, transaction_params: TransactionStrParams, maybe_id: Option<String>, ) -> Result<Transaction, SdkError>
Creates a transfer transaction with the provided parameters.
§Arguments
maybe_source
- Optional transfer source uref.amount
- The transfer amount.target
- The target account.transaction_params
- The transaction parameters.maybe_id
- Optional transfer identifier.
§Returns
A Result
containing the created Transaction
or a SdkError
in case of an error.
source§impl SDK
impl SDK
sourcepub fn sign_transaction(
&self,
transaction: Transaction,
secret_key: &str,
) -> Transaction
pub fn sign_transaction( &self, transaction: Transaction, secret_key: &str, ) -> Transaction
source§impl SDK
impl SDK
sourcepub fn watch_deploy(
&self,
events_url: &str,
timeout_duration: Option<u64>,
) -> Watcher
👎Deprecated: prefer ‘watch_transaction’
pub fn watch_deploy( &self, events_url: &str, timeout_duration: Option<u64>, ) -> Watcher
sourcepub fn watch_transaction(
&self,
events_url: &str,
timeout_duration: Option<u64>,
) -> Watcher
pub fn watch_transaction( &self, events_url: &str, timeout_duration: Option<u64>, ) -> Watcher
sourcepub async fn wait_deploy(
&self,
events_url: &str,
deploy_hash: &str,
timeout_duration: Option<u64>,
) -> Result<EventParseResult, String>
👎Deprecated: prefer ‘wait_transaction’ with transaction
pub async fn wait_deploy( &self, events_url: &str, deploy_hash: &str, timeout_duration: Option<u64>, ) -> Result<EventParseResult, String>
Waits for a deploy event to be processed asynchronously. Legacy alias
§Arguments
events_url
- The URL to monitor for transaction events.deploy_hash
- The deploy hash to wait for.timeout_duration
- An optional timeout duration in milliseconds.
§Returns
A Result
containing either the processed EventParseResult
or an error message.
sourcepub async fn wait_transaction(
&self,
events_url: &str,
target_hash: &str,
timeout_duration: Option<u64>,
) -> Result<EventParseResult, String>
pub async fn wait_transaction( &self, events_url: &str, target_hash: &str, timeout_duration: Option<u64>, ) -> Result<EventParseResult, String>
Alias for wait_deploy Waits for a deploy event to be processed asynchronously.
§Arguments
events_url
- The URL to monitor for transaction events.target_hash
- The transaction hash to wait for.timeout_duration
- An optional timeout duration in milliseconds.
§Returns
A Result
containing either the processed EventParseResult
or an error message
source§impl SDK
impl SDK
A set of functions for working with smart contract entry points. Alias of sdk.transaction
sourcepub async fn call_entrypoint(
&self,
builder_params: TransactionBuilderParams,
transaction_params: TransactionStrParams,
rpc_address: Option<String>,
) -> Result<SuccessResponse<_PutTransactionResult>, SdkError>
pub async fn call_entrypoint( &self, builder_params: TransactionBuilderParams, transaction_params: TransactionStrParams, rpc_address: Option<String>, ) -> Result<SuccessResponse<_PutTransactionResult>, SdkError>
Calls a smart contract entry point with the specified parameters and returns the result.
§Arguments
builder_params
- Transaction Builder parameters.transaction_params
- Transaction parameters.rpc_address
- An optional rpc address to send the request to.
§Returns
A Result
containing either a _PutTransactionResult
or a SdkError
in case of an error.
§Errors
Returns a SdkError
if there is an error during the call.
source§impl SDK
impl SDK
A set of functions for working with smart contract entry points. Alias of sdk.deploy
sourcepub async fn call_entrypoint_deploy(
&self,
deploy_params: DeployStrParams,
session_params: SessionStrParams,
payment_params: PaymentStrParams,
rpc_address: Option<String>,
) -> Result<SuccessResponse<_PutDeployResult>, SdkError>
👎Deprecated: prefer ‘call_entrypoint’ with transaction
pub async fn call_entrypoint_deploy( &self, deploy_params: DeployStrParams, session_params: SessionStrParams, payment_params: PaymentStrParams, rpc_address: Option<String>, ) -> Result<SuccessResponse<_PutDeployResult>, SdkError>
Calls a smart contract entry point with the specified parameters and returns the result.
§Arguments
deploy_params
- The deploy parameters.session_params
- The session parameters.payment_params
- The payment parameters.rpc_address
- An optional rpc address to send the request to.
§Returns
A Result
containing either a _PutDeployResult
or a SdkError
in case of an error.
§Errors
Returns a SdkError
if there is an error during the call.
source§impl SDK
impl SDK
A set of functions for installing smart contracts on the blockchain. Alias of sdk.transaction
sourcepub async fn install(
&self,
transaction_params: TransactionStrParams,
transaction_bytes: Bytes,
rpc_address: Option<String>,
) -> Result<SuccessResponse<_PutTransactionResult>, SdkError>
pub async fn install( &self, transaction_params: TransactionStrParams, transaction_bytes: Bytes, rpc_address: Option<String>, ) -> Result<SuccessResponse<_PutTransactionResult>, SdkError>
Installs a smart contract with the specified parameters and returns the result.
§Arguments
transaction_params
- Transaction parameters.transaction_bytes
- Transaction Bytes to installrpc_address
- An optional rpc address to send the request to.
§Returns
A Result
containing either a _PutTransactionResult
or a SdkError
in case of an error.
§Errors
Returns a SdkError
if there is an error during the installation.
source§impl SDK
impl SDK
A set of functions for installing smart contracts on the blockchain. Alias of sdk.deploy
sourcepub async fn install_deploy(
&self,
deploy_params: DeployStrParams,
session_params: SessionStrParams,
payment_amount: &str,
rpc_address: Option<String>,
) -> Result<SuccessResponse<_PutDeployResult>, SdkError>
👎Deprecated: prefer ‘install’ with transaction
pub async fn install_deploy( &self, deploy_params: DeployStrParams, session_params: SessionStrParams, payment_amount: &str, rpc_address: Option<String>, ) -> Result<SuccessResponse<_PutDeployResult>, SdkError>
Installs a smart contract with the specified parameters and returns the result.
§Arguments
deploy_params
- The deploy parameters.session_params
- The session parameters.payment_amount
- The payment amount as a string.rpc_address
- An optional rpc address to send the request to.
§Returns
A Result
containing either a _PutDeployResult
or a SdkError
in case of an error.
§Errors
Returns a SdkError
if there is an error during the installation.
source§impl SDK
impl SDK
Alias of sdk.get_dictionary_item
sourcepub async fn query_contract_dict(
&self,
state_root_hash: impl ToDigest,
dictionary_item: DictionaryItemInput,
verbosity: Option<Verbosity>,
rpc_address: Option<String>,
) -> Result<SuccessResponse<_GetDictionaryItemResult>, SdkError>
pub async fn query_contract_dict( &self, state_root_hash: impl ToDigest, dictionary_item: DictionaryItemInput, verbosity: Option<Verbosity>, rpc_address: Option<String>, ) -> Result<SuccessResponse<_GetDictionaryItemResult>, SdkError>
Query a contract dictionary item.
§Arguments
state_root_hash
- State root hash.dictionary_item
- Dictionary item input.verbosity
- Optional verbosity level.rpc_address
- Optional rpc address.
§Returns
A Result
containing either a SuccessResponse<_GetDictionaryItemResult>
or a SdkError
in case of an error.
source§impl SDK
impl SDK
Alias of sdk.query_global_state
sourcepub async fn query_contract_key(
&self,
entity_identifier: Option<EntityIdentifier>,
entity_identifier_as_string: Option<String>,
path: PathIdentifierInput,
maybe_block_identifier: Option<BlockIdentifierInput>,
verbosity: Option<Verbosity>,
rpc_address: Option<String>,
) -> Result<SuccessResponse<_QueryGlobalStateResult>, SdkError>
pub async fn query_contract_key( &self, entity_identifier: Option<EntityIdentifier>, entity_identifier_as_string: Option<String>, path: PathIdentifierInput, maybe_block_identifier: Option<BlockIdentifierInput>, verbosity: Option<Verbosity>, rpc_address: Option<String>, ) -> Result<SuccessResponse<_QueryGlobalStateResult>, SdkError>
source§impl SDK
impl SDK
pub fn new(rpc_address: Option<String>, verbosity: Option<Verbosity>) -> Self
pub fn get_rpc_address(&self, rpc_address: Option<String>) -> String
pub fn set_rpc_address( &mut self, rpc_address: Option<String>, ) -> Result<(), String>
pub fn get_verbosity(&self, verbosity: Option<Verbosity>) -> Verbosity
pub fn set_verbosity( &mut self, verbosity: Option<Verbosity>, ) -> Result<(), String>
Trait Implementations§
source§impl FromWasmAbi for SDK
impl FromWasmAbi for SDK
source§impl IntoWasmAbi for SDK
impl IntoWasmAbi for SDK
source§impl LongRefFromWasmAbi for SDK
impl LongRefFromWasmAbi for SDK
source§impl OptionFromWasmAbi for SDK
impl OptionFromWasmAbi for SDK
source§impl OptionIntoWasmAbi for SDK
impl OptionIntoWasmAbi for SDK
source§impl RefFromWasmAbi for SDK
impl RefFromWasmAbi for SDK
source§impl RefMutFromWasmAbi for SDK
impl RefMutFromWasmAbi for SDK
source§impl TryFromJsValue for SDK
impl TryFromJsValue for SDK
source§impl VectorFromWasmAbi for SDK
impl VectorFromWasmAbi for SDK
source§impl VectorIntoWasmAbi for SDK
impl VectorIntoWasmAbi for SDK
Auto Trait Implementations§
impl Freeze for SDK
impl RefUnwindSafe for SDK
impl Send for SDK
impl Sync for SDK
impl Unpin for SDK
impl UnwindSafe for SDK
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
IntoWasmAbi::Abi
source§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
IntoWasmAbi::into_abi
, except that it may throw and never
return in the case of Err
.