Package zephyr.wallet.model
Class ZephyrTxConfig
java.lang.Object
zephyr.wallet.model.ZephyrTxConfig
Configures a transaction to send, sweep, or create a payment URI.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddDestination(String address, BigInteger amount) addDestination(ZephyrDestination destination) copy()booleanGet the address of a single-destination configuration.Get the amount of a single-destination configuration.Get the asset that the destinations receive.getFee()getNote()getRelay()Get the asset that the transaction spends.Get the minimum height for the transaction to unlock.inthashCode()setAccountIndex(Integer accountIndex) setAddress(String address) Set the address of a single-destination configuration.Set the amount of a single-destination configuration.setAmount(BigInteger amount) Set the amount of a single-destination configuration.setBelowAmount(BigInteger belowAmount) setCanSplit(Boolean canSplit) setDestinationCurrency(String destinationCurrency) Set the asset that the destinations receive.setDestinations(List<ZephyrDestination> destinations) setDestinations(ZephyrDestination... destinations) setFee(BigInteger fee) setKeyImage(String keyImage) setPaymentId(String paymentId) setPriority(ZephyrTxPriority priority) setRecipientName(String recipientName) setSourceCurrency(String sourceCurrency) Set the asset that the transaction spends.setSubaddressIndex(int subaddressIndex) setSubaddressIndices(Integer... subaddressIndices) setSubaddressIndices(List<Integer> subaddressIndices) setSweepEachSubaddress(Boolean sweepEachSubaddress) setUnlockHeight(Long unlockHeight) Set the minimum height for the transaction to unlock.toString()
-
Constructor Details
-
ZephyrTxConfig
public ZephyrTxConfig()
-
-
Method Details
-
copy
-
setAddress
Set the address of a single-destination configuration.- Parameters:
address- - the address to set for the single destination- Returns:
- ZephyrTxConfig this configuration for chaining
-
getAddress
Get the address of a single-destination configuration.- Returns:
- String the address of the single destination
-
setAmount
Set the amount of a single-destination configuration.- Parameters:
amount- - the amount to set for the single destination- Returns:
- ZephyrTxConfig this configuration for chaining
-
setAmount
Set the amount of a single-destination configuration.- Parameters:
amount- - the amount to set for the single destination in atomic units as a string- Returns:
- ZephyrTxConfig this configuration for chaining
-
getAmount
Get the amount of a single-destination configuration.- Returns:
- BigInteger the amount of the single destination
-
addDestination
-
addDestination
-
getDestinations
-
setDestinations
-
setDestinations
-
getPaymentId
-
setPaymentId
-
getPriority
-
setPriority
-
getFee
-
setFee
-
getAccountIndex
-
setAccountIndex
-
getSubaddressIndices
-
setSubaddressIndex
-
setSubaddressIndices
-
setSubaddressIndices
-
getUnlockHeight
Get the minimum height for the transaction to unlock. The transaction will unlock on the maximum of the returned unlock height and the confirmation height + 10.- Returns:
- the minimum height for the transaction to unlock
-
setUnlockHeight
Set the minimum height for the transaction to unlock. The transaction will unlock on the maximum of the given unlock height and the confirmation height + 10.- Parameters:
unlockHeight- the minimum height for the transaction to unlock- Returns:
- this configuration for chaining
-
getCanSplit
-
setCanSplit
-
getRelay
-
setRelay
-
getNote
-
setNote
-
getRecipientName
-
setRecipientName
-
getBelowAmount
-
setBelowAmount
-
getSweepEachSubaddress
-
setSweepEachSubaddress
-
getKeyImage
-
setKeyImage
-
getSourceCurrency
Get the asset that the transaction spends.- Returns:
- String the source currency (see
ZephyrAssets)
-
setSourceCurrency
Set the asset that the transaction spends. Required for every send, together with the destination currency: a plain transfer sets both to the same asset, a conversion (mint or redeem) sets the pair of its transaction type, for example ZPH to ZSD to mint the stable asset. The pair holds for the whole transaction and all its destinations. No check is made here; the core and the chain decide which pairs are valid.- Parameters:
sourceCurrency- is the asset that the transaction spends (seeZephyrAssets)- Returns:
- ZephyrTxConfig this configuration for chaining
-
getDestinationCurrency
Get the asset that the destinations receive.- Returns:
- String the destination currency (see
ZephyrAssets)
-
setDestinationCurrency
Set the asset that the destinations receive. Required for every send, together with the source currency: a plain transfer sets both to the same asset, a conversion (mint or redeem) sets the pair of its transaction type, for example ZPH to ZSD to mint the stable asset. The pair holds for the whole transaction and all its destinations; the asset type of a destination does not override it. No check is made here; the core and the chain decide which pairs are valid.- Parameters:
destinationCurrency- is the asset that the destinations receive (seeZephyrAssets)- Returns:
- ZephyrTxConfig this configuration for chaining
-
toString
-
hashCode
public int hashCode() -
equals
-