Function casper_client::get_balance
source · [−]pub async fn get_balance(
maybe_rpc_id: &str,
node_address: &str,
verbosity_level: u64,
state_root_hash: &str,
purse: &str
) -> Result<JsonRpc, Error>
Expand description
Retrieves a purse’s balance from the network.
maybe_rpc_id
is the JSON-RPC identifier, applied to the request and returned in the response. If it can be parsed as ani64
it will be used as a JSON integer. If empty, a randomi64
will be assigned. Otherwise the provided string will be used verbatim.node_address
is the hostname or IP and port of the node on which the HTTP service is running, e.g."http://127.0.0.1:7777"
.- When
verbosity_level
is1
, the JSON-RPC request will be printed tostdout
with long string fields (e.g. hex-formatted raw Wasm bytes) shortened to a string indicating the char count of the field. Whenverbosity_level
is greater than1
, the request will be printed tostdout
with no abbreviation of long fields. Whenverbosity_level
is0
, the request will not be printed tostdout
. state_root_hash
must be a hex-encoded, 32-byte hash digest.purse
is a URef, formatted as e.g.
uref-0102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f20-007