Class CryptoTransferTransactionBody.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder<CryptoTransferTransactionBody,CryptoTransferTransactionBody.Builder>
com.google.protobuf.GeneratedMessageLite.Builder<CryptoTransferTransactionBody,CryptoTransferTransactionBody.Builder>
com.hedera.hashgraph.sdk.proto.CryptoTransferTransactionBody.Builder
All Implemented Interfaces:
com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, CryptoTransferTransactionBodyOrBuilder, Cloneable
Enclosing class:
CryptoTransferTransactionBody

public static final class CryptoTransferTransactionBody.Builder extends com.google.protobuf.GeneratedMessageLite.Builder<CryptoTransferTransactionBody,CryptoTransferTransactionBody.Builder> implements CryptoTransferTransactionBodyOrBuilder
 *
 Transfer HBAR and/or other tokens among two or more accounts and/or smart
 contracts.

 Transfers of HBAR or fungible/common tokens in this transaction are
 structured as a "double-entry" transfer list which debits one or more
 accounts, and separately credits one or more accounts. Each such transfer
 list may specify up to 10 individual credits or debits.<br/>
 Transfers of non-fungible/unique tokens in this transaction are
 structured as a "single-entry" transfer list, which both debits one account
 and credits another account in a single entry.

 At least one transfer MUST be present, this MAY be an HBAR transfer in
 `transfers`, or MAY be a token transfer in `tokenTransfers`.<br/>
 Either `transfers` or `tokenTransfers` MAY be unset, provided the other
 is set and not empty.<br/>
 If any one account with a debit in any transfer list holds insufficient
 balance to complete the transfer, the entire transaction SHALL fail, and
 all transfers SHALL NOT be completed.<br/>
 If any one account that is _sending_ an individual non-fungible/unique (NFT)
 token does not currently hold that unique NFT, the entire transaction SHALL
 FAIL, and all transfers SHALL NOT be completed.
 The transaction fee SHALL be charged for a transaction that fails due to
 insufficient balance or not holding the NFT to be transferred.<br/>
 Each account with any debit amounts in any transfer list MUST sign this
 transaction.<br/>
 Each account with any credit amounts in any transfer list that also has the
 `receiverSigRequired` flag set MUST sign this transaction.

 ### Block Stream Effects
 All debits and credits completed by this transaction SHALL be included in
 the transaction result transfer list.<br/>
 Multiple fungible/common debits from one account, or credits to one account,
 MAY be consolidated to a single debit or credit entry in the
 transaction result.<br/>
 Multiple non-fungible/unique transfers SHALL NOT be consolidated in the
 transaction result.
 
Protobuf type proto.CryptoTransferTransactionBody
  • Method Details

    • hasTransfers

      public boolean hasTransfers()
       *
       A list of HBAR transfers.
       <p>
       Each transfer in this list MUST be denominated in tinybar.
       
      .proto.TransferList transfers = 1;
      Specified by:
      hasTransfers in interface CryptoTransferTransactionBodyOrBuilder
      Returns:
      Whether the transfers field is set.
    • getTransfers

      public TransferList getTransfers()
       *
       A list of HBAR transfers.
       <p>
       Each transfer in this list MUST be denominated in tinybar.
       
      .proto.TransferList transfers = 1;
      Specified by:
      getTransfers in interface CryptoTransferTransactionBodyOrBuilder
      Returns:
      The transfers.
    • setTransfers

       *
       A list of HBAR transfers.
       <p>
       Each transfer in this list MUST be denominated in tinybar.
       
      .proto.TransferList transfers = 1;
    • setTransfers

      public CryptoTransferTransactionBody.Builder setTransfers(TransferList.Builder builderForValue)
       *
       A list of HBAR transfers.
       <p>
       Each transfer in this list MUST be denominated in tinybar.
       
      .proto.TransferList transfers = 1;
    • mergeTransfers

      public CryptoTransferTransactionBody.Builder mergeTransfers(TransferList value)
       *
       A list of HBAR transfers.
       <p>
       Each transfer in this list MUST be denominated in tinybar.
       
      .proto.TransferList transfers = 1;
    • clearTransfers

      public CryptoTransferTransactionBody.Builder clearTransfers()
       *
       A list of HBAR transfers.
       <p>
       Each transfer in this list MUST be denominated in tinybar.
       
      .proto.TransferList transfers = 1;
    • getTokenTransfersList

      public List<TokenTransferList> getTokenTransfersList()
       *
       One or more lists of token transfers.
       <p>
       This list MUST NOT contain more than 10 entries.<br/>
       If custom fees must be charged, the fee SHALL be assessed against the
       effective "payer" for this transaction.<br/>
       If the effective "payer" for this transaction lacks sufficient balance
       to pay custom fees assessed, the entire transaction SHALL fail with a
       response code `INSUFFICIENT_PAYER_BALANCE_FOR_CUSTOM_FEE`.
       
      repeated .proto.TokenTransferList tokenTransfers = 2;
      Specified by:
      getTokenTransfersList in interface CryptoTransferTransactionBodyOrBuilder
    • getTokenTransfersCount

      public int getTokenTransfersCount()
       *
       One or more lists of token transfers.
       <p>
       This list MUST NOT contain more than 10 entries.<br/>
       If custom fees must be charged, the fee SHALL be assessed against the
       effective "payer" for this transaction.<br/>
       If the effective "payer" for this transaction lacks sufficient balance
       to pay custom fees assessed, the entire transaction SHALL fail with a
       response code `INSUFFICIENT_PAYER_BALANCE_FOR_CUSTOM_FEE`.
       
      repeated .proto.TokenTransferList tokenTransfers = 2;
      Specified by:
      getTokenTransfersCount in interface CryptoTransferTransactionBodyOrBuilder
    • getTokenTransfers

      public TokenTransferList getTokenTransfers(int index)
       *
       One or more lists of token transfers.
       <p>
       This list MUST NOT contain more than 10 entries.<br/>
       If custom fees must be charged, the fee SHALL be assessed against the
       effective "payer" for this transaction.<br/>
       If the effective "payer" for this transaction lacks sufficient balance
       to pay custom fees assessed, the entire transaction SHALL fail with a
       response code `INSUFFICIENT_PAYER_BALANCE_FOR_CUSTOM_FEE`.
       
      repeated .proto.TokenTransferList tokenTransfers = 2;
      Specified by:
      getTokenTransfers in interface CryptoTransferTransactionBodyOrBuilder
    • setTokenTransfers

      public CryptoTransferTransactionBody.Builder setTokenTransfers(int index, TokenTransferList value)
       *
       One or more lists of token transfers.
       <p>
       This list MUST NOT contain more than 10 entries.<br/>
       If custom fees must be charged, the fee SHALL be assessed against the
       effective "payer" for this transaction.<br/>
       If the effective "payer" for this transaction lacks sufficient balance
       to pay custom fees assessed, the entire transaction SHALL fail with a
       response code `INSUFFICIENT_PAYER_BALANCE_FOR_CUSTOM_FEE`.
       
      repeated .proto.TokenTransferList tokenTransfers = 2;
    • setTokenTransfers

      public CryptoTransferTransactionBody.Builder setTokenTransfers(int index, TokenTransferList.Builder builderForValue)
       *
       One or more lists of token transfers.
       <p>
       This list MUST NOT contain more than 10 entries.<br/>
       If custom fees must be charged, the fee SHALL be assessed against the
       effective "payer" for this transaction.<br/>
       If the effective "payer" for this transaction lacks sufficient balance
       to pay custom fees assessed, the entire transaction SHALL fail with a
       response code `INSUFFICIENT_PAYER_BALANCE_FOR_CUSTOM_FEE`.
       
      repeated .proto.TokenTransferList tokenTransfers = 2;
    • addTokenTransfers

      public CryptoTransferTransactionBody.Builder addTokenTransfers(TokenTransferList value)
       *
       One or more lists of token transfers.
       <p>
       This list MUST NOT contain more than 10 entries.<br/>
       If custom fees must be charged, the fee SHALL be assessed against the
       effective "payer" for this transaction.<br/>
       If the effective "payer" for this transaction lacks sufficient balance
       to pay custom fees assessed, the entire transaction SHALL fail with a
       response code `INSUFFICIENT_PAYER_BALANCE_FOR_CUSTOM_FEE`.
       
      repeated .proto.TokenTransferList tokenTransfers = 2;
    • addTokenTransfers

      public CryptoTransferTransactionBody.Builder addTokenTransfers(int index, TokenTransferList value)
       *
       One or more lists of token transfers.
       <p>
       This list MUST NOT contain more than 10 entries.<br/>
       If custom fees must be charged, the fee SHALL be assessed against the
       effective "payer" for this transaction.<br/>
       If the effective "payer" for this transaction lacks sufficient balance
       to pay custom fees assessed, the entire transaction SHALL fail with a
       response code `INSUFFICIENT_PAYER_BALANCE_FOR_CUSTOM_FEE`.
       
      repeated .proto.TokenTransferList tokenTransfers = 2;
    • addTokenTransfers

      public CryptoTransferTransactionBody.Builder addTokenTransfers(TokenTransferList.Builder builderForValue)
       *
       One or more lists of token transfers.
       <p>
       This list MUST NOT contain more than 10 entries.<br/>
       If custom fees must be charged, the fee SHALL be assessed against the
       effective "payer" for this transaction.<br/>
       If the effective "payer" for this transaction lacks sufficient balance
       to pay custom fees assessed, the entire transaction SHALL fail with a
       response code `INSUFFICIENT_PAYER_BALANCE_FOR_CUSTOM_FEE`.
       
      repeated .proto.TokenTransferList tokenTransfers = 2;
    • addTokenTransfers

      public CryptoTransferTransactionBody.Builder addTokenTransfers(int index, TokenTransferList.Builder builderForValue)
       *
       One or more lists of token transfers.
       <p>
       This list MUST NOT contain more than 10 entries.<br/>
       If custom fees must be charged, the fee SHALL be assessed against the
       effective "payer" for this transaction.<br/>
       If the effective "payer" for this transaction lacks sufficient balance
       to pay custom fees assessed, the entire transaction SHALL fail with a
       response code `INSUFFICIENT_PAYER_BALANCE_FOR_CUSTOM_FEE`.
       
      repeated .proto.TokenTransferList tokenTransfers = 2;
    • addAllTokenTransfers

      public CryptoTransferTransactionBody.Builder addAllTokenTransfers(Iterable<? extends TokenTransferList> values)
       *
       One or more lists of token transfers.
       <p>
       This list MUST NOT contain more than 10 entries.<br/>
       If custom fees must be charged, the fee SHALL be assessed against the
       effective "payer" for this transaction.<br/>
       If the effective "payer" for this transaction lacks sufficient balance
       to pay custom fees assessed, the entire transaction SHALL fail with a
       response code `INSUFFICIENT_PAYER_BALANCE_FOR_CUSTOM_FEE`.
       
      repeated .proto.TokenTransferList tokenTransfers = 2;
    • clearTokenTransfers

      public CryptoTransferTransactionBody.Builder clearTokenTransfers()
       *
       One or more lists of token transfers.
       <p>
       This list MUST NOT contain more than 10 entries.<br/>
       If custom fees must be charged, the fee SHALL be assessed against the
       effective "payer" for this transaction.<br/>
       If the effective "payer" for this transaction lacks sufficient balance
       to pay custom fees assessed, the entire transaction SHALL fail with a
       response code `INSUFFICIENT_PAYER_BALANCE_FOR_CUSTOM_FEE`.
       
      repeated .proto.TokenTransferList tokenTransfers = 2;
    • removeTokenTransfers

      public CryptoTransferTransactionBody.Builder removeTokenTransfers(int index)
       *
       One or more lists of token transfers.
       <p>
       This list MUST NOT contain more than 10 entries.<br/>
       If custom fees must be charged, the fee SHALL be assessed against the
       effective "payer" for this transaction.<br/>
       If the effective "payer" for this transaction lacks sufficient balance
       to pay custom fees assessed, the entire transaction SHALL fail with a
       response code `INSUFFICIENT_PAYER_BALANCE_FOR_CUSTOM_FEE`.
       
      repeated .proto.TokenTransferList tokenTransfers = 2;