NearApi.RPC.Contracts (near_api v0.1.6)
NEAR RPC - Contracts API
Link to this section Summary
Functions
Allows you to call a contract method as a view function.
Returns code changes made when deploying a contract. Change is returned is a base64 encoded WASM file. Warning: Experimental
Returns the state change details of a contract based on the key prefix (encoded to base64). Pass an empty string for this param if you would like to return all state changes. Warning: Experimental
Returns the contract code (Wasm binary) deployed to the account. Please note that the returned code will be encoded in base64.
Returns the state (key value pairs) of a contract based on the key prefix (base64 encoded).
Pass an empty string for prefix_base64
if you would like to return the entire state.
Please note that the returned state will be base64 encoded as well.
Link to this section Functions
call_function(account_id, method_name, args_base64, block_id \\ nil)
Allows you to call a contract method as a view function.
contract_code_changes(account_ids, block_id \\ nil)
Specs
contract_code_changes(account_ids :: String.t(), block_id :: String.t()) :: {:ok, body :: map()} | NearApi.RPC.Errors.t()
Returns code changes made when deploying a contract. Change is returned is a base64 encoded WASM file. Warning: Experimental
data_changes(account_ids, block_id \\ nil, key_prefix_base64 \\ nil)
Specs
data_changes( account_ids :: String.t(), block_id :: String.t(), key_prefix_base64 :: String.t() ) :: {:ok, body :: map()} | NearApi.RPC.Errors.t()
Returns the state change details of a contract based on the key prefix (encoded to base64). Pass an empty string for this param if you would like to return all state changes. Warning: Experimental
view_code(account_id, block_id \\ nil)
Specs
view_code(account_id :: String.t(), block_id :: String.t()) :: {:ok, body :: map()} | NearApi.RPC.Errors.t()
Returns the contract code (Wasm binary) deployed to the account. Please note that the returned code will be encoded in base64.
view_state(account_id, block_id \\ nil, prefix_base64 \\ nil)
Specs
view_state( account_id :: String.t(), block_id :: String.t(), prefix_base64 :: String.t() ) :: {:ok, body :: map()} | NearApi.RPC.Errors.t()
Returns the state (key value pairs) of a contract based on the key prefix (base64 encoded).
Pass an empty string for prefix_base64
if you would like to return the entire state.
Please note that the returned state will be base64 encoded as well.