Class PaymentTransactionBuilder<T extends PaymentTransactionBuilder<T>>
- java.lang.Object
-
- com.algorand.algosdk.builder.transaction.TransactionParametersBuilder<T>
-
- com.algorand.algosdk.builder.transaction.TransactionBuilder<T>
-
- com.algorand.algosdk.builder.transaction.PaymentTransactionBuilder<T>
-
public class PaymentTransactionBuilder<T extends PaymentTransactionBuilder<T>> extends TransactionBuilder<T>
Build a payment transaction. Required parameters: sender receiver amount genesisHash Optional parameters: closeRemainderTo Optional global parameters: fee/flatFee note genesisID group lease
-
-
Field Summary
Fields Modifier and Type Field Description protected BigInteger
amount
protected Address
closeRemainderTo
protected Address
receiver
-
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
PaymentTransactionBuilder()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description T
amount(Integer amount)
Set the number of microalgos to transfer from sender to receiver.T
amount(Long amount)
Set the number of microalgos to transfer from sender to receiver.T
amount(BigInteger amount)
Set the number of microalgos to transfer from sender to receiver.protected void
applyTo(Transaction txn)
static PaymentTransactionBuilder<?>
Builder()
Initialize aPaymentTransactionBuilder
.T
closeRemainderTo(byte[] closeRemainderTo)
Set the closeRemainderTo account in the raw 32 byte format.T
closeRemainderTo(Address closeRemainderTo)
Set the closeRemainderTo account.T
closeRemainderTo(String closeRemainderTo)
Set the closeRemainderTo account in the human-readable address format.T
receiver(byte[] receiver)
Set the receiver of the payment in the raw 32 byte format.T
receiver(Address receiver)
Set the receiver of the payment.T
receiver(String receiver)
Set the receiver of the payment in the human-readable address format.-
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
-
amount
protected BigInteger amount
-
receiver
protected Address receiver
-
closeRemainderTo
protected Address closeRemainderTo
-
-
Method Detail
-
Builder
public static PaymentTransactionBuilder<?> Builder()
Initialize aPaymentTransactionBuilder
.
-
applyTo
protected void applyTo(Transaction txn)
- Specified by:
applyTo
in classTransactionBuilder<T extends PaymentTransactionBuilder<T>>
-
amount
public T amount(BigInteger amount)
Set the number of microalgos to transfer from sender to receiver.- Parameters:
amount
- The number of microalgos to transfer.- Returns:
- This builder.
-
amount
public T amount(Integer amount)
Set the number of microalgos to transfer from sender to receiver.- Parameters:
amount
- The number of microalgos to transfer.- Returns:
- This builder.
-
amount
public T amount(Long amount)
Set the number of microalgos to transfer from sender to receiver.- Parameters:
amount
- The number of microalgos to transfer.- Returns:
- This builder.
-
receiver
public T receiver(Address receiver)
Set the receiver of the payment.- Parameters:
receiver
- The receiver.- Returns:
- This builder.
-
receiver
public T receiver(String receiver)
Set the receiver of the payment in the human-readable address format.- Parameters:
receiver
- The receiver.- Returns:
- This builder.
-
receiver
public T receiver(byte[] receiver)
Set the receiver of the payment in the raw 32 byte format.- Parameters:
receiver
- The receiver.- Returns:
- This builder.
-
closeRemainderTo
public T closeRemainderTo(Address closeRemainderTo)
Set the closeRemainderTo account. This account will receive any remaining balance in the sender account after the amount has been removed.- Parameters:
closeRemainderTo
- The closeRemainderTo account.- Returns:
- This builder.
-
closeRemainderTo
public T closeRemainderTo(String closeRemainderTo)
Set the closeRemainderTo account in the human-readable address format. This account will receive any remaining balance in the sender account after the amount has been removed.- Parameters:
closeRemainderTo
- The closeRemainderTo account.- Returns:
- This builder.
-
closeRemainderTo
public T closeRemainderTo(byte[] closeRemainderTo)
Set the closeRemainderTo account in the raw 32 byte format. This account will receive any remaining balance in the sender account after the amount has been removed.- Parameters:
closeRemainderTo
- The closeRemainderTo account.- Returns:
- This builder.
-
-