NearApi.Contracts (near_api v0.1.2)

NEAR RPC - Contracts API

Link to this section Summary

Functions

Returns code changes made when deploying a contract. Change is returned is a base64 encoded WASM file. Warning: Experimental

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

Link to this function

call_function(account_id, method_name, args_base64, block_id \\ nil)

Returns code changes made when deploying a contract. Change is returned is a base64 encoded WASM file. Warning: Experimental

Link to this 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.Errors.t()

Returns code changes made when deploying a contract. Change is returned is a base64 encoded WASM file. Warning: Experimental

Link to this function

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.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

Link to this function

view_code(account_id, block_id \\ nil)

Specs

view_code(account_id :: String.t(), block_id :: String.t()) ::
  {:ok, body :: map()} | NearApi.Errors.t()

Returns the contract code (Wasm binary) deployed to the account. Please note that the returned code will be encoded in base64.

Link to this function

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.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.