Transfer cryptocurrency

A transaction that transfers hbars and tokens between Hedera accounts. You can enter multiple transfers in a single transaction. The net value of hbars between the sending accounts and receiving accounts must equal zero. For a CryptoTransferTransactionBody:

Transaction Fees

  • Please see the transaction and query fees table for base transaction fee

  • Please use the Hedera fee estimator to estimate your transaction fee cost

Spender Account Allowances

An account can have another account spend tokens on its behalf. If the delegated spender account is transacting tokens from the owner account that authorized the allowance, the owner account needs to be specified in the transfer transaction by calling one of the following:

  • addApprovedHbarTransfer()

  • addApprovedTokenTransfer()

  • addApprovedNftTransfer()

  • addApprovedTokenTransferWithDecimals()

The debiting account is the owner account when using this feature.

Transaction Signing Requirements

  • The accounts the tokens are being debited from are required to sign the transaction

    • If an authorized spender account is spending on behalf of the account that owns the tokens then the spending account is required to sign

  • The transaction fee paying account is required to sign the transaction

Constructor
Description

new TransferTransaction()

Initializes the TransferTransaction object

Methods

Method
Type
Description

addHbarTransfer(<accountId, value>)

AccountId, Hbar/long

The account the transfer is being debited from. The sending account must sign the transaction. The sender and recipient values must net zero.

addTokenTransfer(<tokenId, accountId,value>)

TokenId, AccountId, long

The ID of the token, the account ID to transfer the tokens from, value of the token to transfer. The sender and recipient values must net zero.

Last updated