Class AssetTransferTransactionBuilder<T extends AssetTransferTransactionBuilder<T>>
- java.lang.Object
-
- com.algorand.algosdk.builder.transaction.TransactionParametersBuilder<T>
-
- com.algorand.algosdk.builder.transaction.TransactionBuilder<T>
-
- com.algorand.algosdk.builder.transaction.AssetTransferTransactionBuilder<T>
-
public class AssetTransferTransactionBuilder<T extends AssetTransferTransactionBuilder<T>> extends TransactionBuilder<T>
Build an asset transfer transaction for sending some asset from an asset holder to another user. The asset receiver must have marked itself as willing to accept the asset. Required parameters: sender assetReceiver assetAmount assetIndex genesisHash Optional parameters: assetCloseTo Optional global parameters: fee/flatFee note genesisID group lease
-
-
Field Summary
Fields Modifier and Type Field Description protected BigInteger
assetAmount
protected Address
assetCloseTo
protected BigInteger
assetIndex
protected Address
assetReceiver
-
Fields inherited from class com.algorand.algosdk.builder.transaction.TransactionBuilder
group, type
-
Fields inherited from class com.algorand.algosdk.builder.transaction.TransactionParametersBuilder
fee, firstValid, flatFee, genesisHash, genesisID, lastValid, lease, note, rekeyTo, sender
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AssetTransferTransactionBuilder()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
applyTo(Transaction txn)
T
assetAmount(Integer assetAmount)
Set the assetAmount.T
assetAmount(Long assetAmount)
Set the assetAmount.T
assetAmount(BigInteger assetAmount)
Set the assetAmount.T
assetCloseTo(byte[] assetCloseTo)
Set the assetCloseTo account in the raw 32 byte format.T
assetCloseTo(Address assetCloseTo)
Set the assetCloseTo account.T
assetCloseTo(String assetCloseTo)
Set the assetCloseTo account in the human-readable address format.T
assetIndex(Integer assetIndex)
Set the assetIndex.T
assetIndex(Long assetIndex)
Set the assetIndex.T
assetIndex(BigInteger assetIndex)
Set the assetIndex.T
assetReceiver(byte[] assetReceiver)
Set the assetReceiver account in the raw 32 byte format.T
assetReceiver(Address assetReceiver)
Set the assetReceiver account.T
assetReceiver(String assetReceiver)
Set the assetReceiver account in the human-readable address format.static AssetTransferTransactionBuilder<?>
Builder()
Initialize aAssetTransferTransactionBuilder
.-
Methods inherited from class com.algorand.algosdk.builder.transaction.TransactionBuilder
build, group, group, groupB64, groupUTF8
-
Methods inherited from class com.algorand.algosdk.builder.transaction.TransactionParametersBuilder
fee, fee, fee, firstValid, firstValid, firstValid, flatFee, flatFee, flatFee, genesisHash, genesisHash, genesisHashB64, genesisHashUTF8, genesisID, lastValid, lastValid, lastValid, lease, lease, leaseB64, leaseUTF8, lookupParams, note, noteB64, noteUTF8, rekey, rekey, rekey, sender, sender, sender, suggestedParams
-
-
-
-
Field Detail
-
assetReceiver
protected Address assetReceiver
-
assetCloseTo
protected Address assetCloseTo
-
assetAmount
protected BigInteger assetAmount
-
assetIndex
protected BigInteger assetIndex
-
-
Method Detail
-
Builder
public static AssetTransferTransactionBuilder<?> Builder()
Initialize aAssetTransferTransactionBuilder
.
-
applyTo
protected void applyTo(Transaction txn)
- Specified by:
applyTo
in classTransactionBuilder<T extends AssetTransferTransactionBuilder<T>>
-
assetReceiver
public T assetReceiver(Address assetReceiver)
Set the assetReceiver account. This is the account who will receive the funds.- Parameters:
assetReceiver
- The assetReceiver account.- Returns:
- this builder.
-
assetReceiver
public T assetReceiver(String assetReceiver)
Set the assetReceiver account in the human-readable address format. This is the account who will receive the funds.- Parameters:
assetReceiver
- The assetReceiver account.- Returns:
- this builder.
-
assetReceiver
public T assetReceiver(byte[] assetReceiver)
Set the assetReceiver account in the raw 32 byte format. This is the account who will receive the funds.- Parameters:
assetReceiver
- The assetReceiver account.- Returns:
- this builder.
-
assetCloseTo
public T assetCloseTo(Address assetCloseTo)
Set the assetCloseTo account. If set this account will recieve any remaining balance after the assetAmount has been removed from the balance.- Parameters:
assetCloseTo
- The assetCloseTo account.- Returns:
- this builder.
-
assetCloseTo
public T assetCloseTo(String assetCloseTo)
Set the assetCloseTo account in the human-readable address format. If set this account will recieve any remaining balance after the assetAmount has been removed from the balance.- Parameters:
assetCloseTo
- The assetCloseTo account.- Returns:
- this builder.
-
assetCloseTo
public T assetCloseTo(byte[] assetCloseTo)
Set the assetCloseTo account in the raw 32 byte format. If set this account will recieve any remaining balance after the assetAmount has been removed from the balance.- Parameters:
assetCloseTo
- The assetCloseTo account.- Returns:
- this builder.
-
assetIndex
public T assetIndex(BigInteger assetIndex)
Set the assetIndex.- Parameters:
assetIndex
- The assetIndex.- Returns:
- This builder.
-
assetIndex
public T assetIndex(Integer assetIndex)
Set the assetIndex.- Parameters:
assetIndex
- The assetIndex.- Returns:
- This builder.
-
assetIndex
public T assetIndex(Long assetIndex)
Set the assetIndex.- Parameters:
assetIndex
- The assetIndex.- Returns:
- This builder.
-
assetAmount
public T assetAmount(BigInteger assetAmount)
Set the assetAmount. The number of assets to transfer from sender to assetReceiver.- Parameters:
assetAmount
- The assetAmount.- Returns:
- This builder.
-
assetAmount
public T assetAmount(Integer assetAmount)
Set the assetAmount. The number of assets to transfer from sender to assetReceiver.- Parameters:
assetAmount
- The assetAmount.- Returns:
- This builder.
-
-