Transfer NEAR

Transfer NEAR native tokens to another account

Overview

This node enables the transfer of NEAR native tokens from one account to another on the NEAR blockchain. It is useful for automating payments, distributing funds, or managing token transfers programmatically within workflows. For example, it can be used to send a specified amount of NEAR tokens from a sender's account to a recipient's account on either the mainnet or testnet.

Properties

Name Meaning
Network ID The NEAR network to use; options include "mainnet" and "testnet".
Private Key The private key of the sender's account in ed25519 format, used to authorize the transfer.
Sender Account ID The NEAR account ID that will send the tokens (e.g., "example.near").
Recipient Account ID The NEAR account ID that will receive the tokens (e.g., "example.near").
Amount in yoctoNEAR The amount to send, expressed in yoctoNEAR (1 NEAR = 10^24 yoctoNEAR).

Output

The node outputs a JSON object containing a result field with the transaction outcome returned by the NEAR blockchain. This typically includes details such as transaction hash, status, and any relevant metadata about the transfer.

Example output structure:

{
  "result": {
    // Transaction details from NEAR API
  }
}

No binary data is produced by this node.

Dependencies

  • Requires access to the NEAR blockchain via RPC endpoints.
  • Uses an in-memory key store to hold the sender's private key temporarily.
  • Needs a valid private key credential for signing transactions.
  • No additional environment variables are explicitly required beyond the provided inputs.

Troubleshooting

  • Invalid Private Key: If the private key is malformed or incorrect, the transaction will fail. Ensure the private key is correctly formatted as an ed25519 string.
  • Insufficient Funds: Transfers may fail if the sender's account does not have enough balance to cover the amount plus transaction fees.
  • Incorrect Account IDs: Using invalid or non-existent NEAR account IDs for sender or recipient will cause errors.
  • Network Mismatch: Make sure the network ID matches the intended NEAR network (mainnet or testnet) and that the accounts exist on that network.
  • Error Handling: If the node is set to continue on failure, errors will be included in the output alongside the input data for easier debugging.

Links and References

Discussion