NearApi.Transaction (near_api v0.1.7)

Create NEAR transactions here

Link to this section Summary

Functions

Encodes objects according to the schema into the bytestring

Creates a NearApi.Transaction struct, not serialized Parameters: from_account - an account strut NearApi.Account where account_id and key_pair receiver_id - NEAR account ID who we are sending tokens, e.g. helloworld.near actions - a list of transaction actions, e.g. NearApi.Actions.FunctionCall or NearApi.Actions.Transfer

Link to this section Types

Specs

t() :: %NearApi.Transaction{
  actions: [NearApi.Action.t()],
  block_hash: binary(),
  nonce: integer(),
  public_key: NearApi.PublicKey.t(),
  receiver_id: String.t(),
  signer_id: String.t()
}

Link to this section Functions

Link to this function

borsh_encode(obj)

Specs

borsh_encode(obj :: keyword()) :: bitstring()

Encodes objects according to the schema into the bytestring

Link to this function

create_transaction(from_account, receiver_id, actions)

Specs

create_transaction(
  from_account :: NearApi.Account.t(),
  receiver_id :: String.t(),
  actions :: list()
) :: {:ok, t()} | {:error, :error_retrieving_access_key}

Creates a NearApi.Transaction struct, not serialized Parameters: from_account - an account strut NearApi.Account where account_id and key_pair receiver_id - NEAR account ID who we are sending tokens, e.g. helloworld.near actions - a list of transaction actions, e.g. NearApi.Actions.FunctionCall or NearApi.Actions.Transfer

Link to this function

payload(tx, key_pair)

Link to this function

sign_and_serialise(tx, key_pair)