Expand description
An API suitable for use by a CLI binary.
It provides functions and types largely based around strings and integers, as would be expected to be input by a CLI user. The functions then parse these inputs into the expected Rust types and pass them through to the equivalent API functions defined in the root of the library.
§Common Parameters
Many of the functions have similar parameters. Descriptions for these common ones follow:
maybe_rpc_id- The JSON-RPC identifier, applied to the request and returned in the response. If it can be parsed as ani64it will be used as a JSON integer. If empty, a randomi64will be assigned. Otherwise the provided string will be used verbatim.node_address- The hostname or IP and port of the server, e.g.http://127.0.0.1:7777.verbosity_level- When1, the JSON-RPC request will be printed tostdoutwith long string fields (e.g. hex-formatted raw Wasm bytes) shortened to a string indicating the char count of the field. Whenverbosity_levelis greater than1, the request will be printed tostdoutwith no abbreviation of long fields. Whenverbosity_levelis0, the request will not be printed tostdout.maybe_block_id- Must be a hex-encoded, 32-byte hash digest or au64representing theBlockheight or empty. If empty, the latestBlockknown on the server will be used.
Re-exports§
pub use deploy::make_deploy;pub use deploy::make_transfer;pub use deploy::put_deploy;pub use deploy::put_deploy_with_min_bid_override;pub use deploy::send_deploy_file;pub use deploy::sign_deploy_file;pub use deploy::speculative_put_deploy;pub use deploy::speculative_send_deploy_file;pub use deploy::speculative_transfer;pub use deploy::transfer;
Modules§
- deploy
- Functions facilitating sending of
Deploys to the network - json_
args_ help - Functions for use in help commands.
- parse
- This module contains structs and helpers which are used by multiple subcommands related to creating deploys.
- simple_
args_ help - Functions for use in help commands.
Structs§
- Deploy
Builder - A builder for constructing a
Deploy. - Deploy
StrParams - Container for
Deployconstruction options. - JsonArg
- Represents a JSON argument with a name, type, and value.
- Json
Args Error - Error associated with parsing a JSON arg into a
NamedArg. - Payment
StrParams - Container for payment-related arguments used while constructing a
Deploy. - Session
StrParams - Container for session-related arguments used while constructing a
Deploy. - Transaction
StrParams - Container for
Transactionconstruction options. - Transaction
V1Builder - A builder for constructing
TransactionV1instances with various configuration options.
Enums§
- CliError
- Error that can be returned by the
cliAPI. - Deploy
Builder Error - Errors returned while building a
Deployusing aDeployBuilder. - Dictionary
Item StrParams - Various ways of uniquely identifying a dictionary item.
- From
DecStr Err - Conversion from decimal string error
- Json
Args Error Details - Details of an error associated with parsing a JSON arg into a
NamedArg. - Transaction
Builder Params - An enum representing the parameters needed to construct a transaction builder for the commands concerning the creation of a transaction
- Transaction
V1Builder Error - Errors returned while building a
TransactionV1using aTransactionV1Builder.
Functions§
- arg_
json_ session_ parse - Parse session arguments into runtime args.
- arg_
simple_ session_ parse - Parse session arguments into runtime args.
- get_
account - Retrieves an
Accountat a givenBlock. - get_
auction_ info - Retrieves the bids and validators at a given
Block. - get_
balance - Retrieves a purse’s balance at a given state root hash.
- get_
block - Retrieves a
Blockfrom the network. - get_
block_ transfers - Retrieves all
Transferitems for aBlockfrom the network. - get_
chainspec - Retrieves the Chainspec of the network.
- get_
deploy - Retrieves a
casper_types::Deployfrom the network. - get_
dictionary_ item - Retrieves a
StoredValuefrom a dictionary at a given state root hash. - get_
entity - Retrieves an
crate::rpcs::v2_0_0::get_entity::EntityOrAccountat a givenBlock. - get_
era_ info Deprecated - Retrieves era information from the network at a given switch
Block. - get_
era_ summary - Retrieves era information from the network at a given
Block. - get_
maybe_ secret_ key - Retrieves a
SecretKeybased on the provided secret key string and configuration options. - get_
node_ status - Retrieves the status of the specified node.
- get_
peers - Retrieves the IDs and addresses of the specified node’s peers.
- get_
reward - Retrieves an
GetRewardResultat a given era. - get_
state_ root_ hash - Retrieves a state root hash at a given
Block. - get_
system_ hash_ registry - Retrieve the system hash registry
- get_
transaction - Retrieves a
casper_types::Transactionfrom the network. - get_
validator_ changes - Retrieves the status changes of the active validators on the network.
- insert_
arg - Insert a value built from a single arg into
runtime_args. - json_
pretty_ print - JSON-encode and pretty-print the given value to stdout at the given verbosity level.
- list_
rpcs - Retrieves the interface description (the schema including examples in OpenRPC format) of the JSON-RPC server’s API.
- make_
transaction - Creates a
Transactionand outputs it to a file or stdout if thestd-fs-iofeature is enabled. - put_
transaction - Creates a
Transactionand sends it to the network for execution. - query_
balance - Retrieves a purse’s balance from global state.
- query_
balance_ details - Retrieves a purse’s balance and hold information from global state.
- query_
global_ state - Retrieves a
StoredValuefrom global state. - send_
transaction_ file - Reads a previously-saved [
TransactionV1] from a file and sends it to the network for execution. - sign_
transaction_ file - Reads a previously-saved [
TransactionV1] from a file, cryptographically signs it, and outputs it to a file or stdout. - speculative_
send_ transaction_ file - Reads a previously-saved [
TransactionV1] from a file and sends it to the network for execution. - verify_
contract - Verifies the smart contract code against the one installed by deploy or transaction with given hash.