Send Transactions in Near

Transactions are a formal action on a blockchain. They can be initiated in Sender with a call to NEAR's RPC node. They can be a simple sending of $NEAR, may result in sending fungible tokens, creating a new account, or changing state on the blockchain in any number of ways. They are always initiated by a signature from an NEAR account, usually with a function call key or full access key.

Sign and Send a Single Transaction

With Sender, you could sign and send a single transaction with one or multiple actions.

// Call wNEAR contract method 
// Register the 'xxx.testnet' account to wNEAR on testnet (wrap.testnet)
const tx = {
  receiverId: 'wrap.testnet',
  actions: [
    { 
      methodName: 'storage_deposit',
      args: {
        account_id: 'alice.testnet',
        registration_only: true,
      },
      gas: parseNearAmount('0.003'),
      deposit: parseNearAmount('0.00125'),
    },
  ],
}
const res = await window.near.signAndSendTransaction(tx);

Sign and Send Multiple Transactions

Sender also supports sign and send multiple transactions when needed.

Last updated