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.
Modules§
- deploy
- Deploy module.
- json_
args_ help - Functions for use in help commands.
- simple_
args_ help - Functions for use in help commands.
Structs§
- Deploy
StrParams - Container for
Deployconstruction options. - 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.
Enums§
- CliError
- Error that can be returned by the
cliAPI. - Dictionary
Item StrParams - Various ways of uniquely identifying a dictionary item.
- Json
Args Error Details - Details of an error associated with parsing a JSON arg into a
NamedArg.
Functions§
- 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
Deployfrom the network. - get_
dictionary_ item - Retrieves a
StoredValuefrom a dictionary at a given state root hash. - 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_
node_ status - Retrieves the status of the specified node.
- get_
peers - Retrieves the IDs and addresses of the specified node’s peers.
- get_
state_ root_ hash - Retrieves a state root hash at a given
Block. - get_
validator_ changes - Retrieves the status changes of the active validators on the network.
- 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_
deploy - Creates a
Deployand outputs it to a file or stdout. - make_
transfer - Creates a transfer
Deployand outputs it to a file or stdout. - put_
deploy - Creates a
Deployand sends it to the network for execution. - query_
balance - Retrieves a purse’s balance from global state.
- query_
global_ state - Retrieves a
StoredValuefrom global state. - send_
deploy_ file - Reads a previously-saved
Deployfrom a file and sends it to the network for execution. - sign_
deploy_ file - Reads a previously-saved
Deployfrom a file, cryptographically signs it, and outputs it to a file or stdout. - speculative_
put_ deploy - Creates a
Deployand sends it to the specified node for speculative execution. - speculative_
send_ deploy_ file - Reads a previously-saved
Deployfrom a file and sends it to the specified node for speculative execution. For details of the parameters, see the module docs. - speculative_
transfer - Creates a
Deployto transfer funds between purses, and sends it to the specified node for speculative execution. - transfer
- Transfers funds between purses.