public static class AmountTransfer.Companion
@JvmStatic @JvmOverloads @NotNull public <T,P> AmountTransfer<T,P> fromDecimal(@NotNull java.math.BigDecimal displayQuantityDelta, @NotNull T token, @NotNull P source, @NotNull P destination, @NotNull java.math.RoundingMode rounding)
Construct an AmountTransfer object from an indicative/displayable BigDecimal source, applying rounding as specified.
The token size is determined from the token type and is the same as for class Amount
of the same token.
displayQuantityDelta
- is the signed amount to transfer between source and destination in displayable units.Positive values mean transfers from source to destination. Negative values mean transfers from destination to source.token
- defines the asset being represented in the transfer. The token should implement interface TokenizableAssetInfo
if customconversion logic is required.source
- The payer of the transfer if displayQuantityDelta is positive, the payee if displayQuantityDelta is negativedestination
- The payee of the transfer if displayQuantityDelta is positive, the payer if displayQuantityDelta is negativerounding
- The mode of rounding to apply after scaling to integer token units.class Amount
@JvmStatic @JvmOverloads @NotNull public <T,P> AmountTransfer<T,P> fromDecimal(@NotNull java.math.BigDecimal displayQuantityDelta, @NotNull T token, @NotNull P source, @NotNull P destination)
Construct an AmountTransfer object from an indicative/displayable BigDecimal source, applying rounding as specified.
The token size is determined from the token type and is the same as for class Amount
of the same token.
displayQuantityDelta
- is the signed amount to transfer between source and destination in displayable units.Positive values mean transfers from source to destination. Negative values mean transfers from destination to source.token
- defines the asset being represented in the transfer. The token should implement interface TokenizableAssetInfo
if customconversion logic is required.source
- The payer of the transfer if displayQuantityDelta is positive, the payee if displayQuantityDelta is negativedestination
- The payee of the transfer if displayQuantityDelta is positive, the payer if displayQuantityDelta is negativeclass Amount
@JvmStatic @NotNull public <T,P> AmountTransfer<T,P> zero(@NotNull T token, @NotNull P source, @NotNull P destination)
Helper to make a zero size AmountTransfer.