AMOUNT/amounts/native
Native Amounts
From Parameter
AMOUNT
/amounts/native/paramsconst hookWallet = testContext.hook1
const param1 = new iHookParamEntry(
new iHookParamName('AMT'),
new iHookParamValue(floatToLEXfl('1'), true)
)
const builtTx: Invoke = {
TransactionType: 'Invoke',
Account: hookWallet.classicAddress,
HookParameters: [param1.toXrpl()],
}
From Txn
AMOUNT
/amounts/native/txnconst aliceWallet = testContext.alice
const hookWallet = testContext.hook1
const builtTx: Payment = {
TransactionType: 'Payment',
Account: aliceWallet.classicAddress,
Destination: hookWallet.classicAddress,
Amount: xrpToDrops(1)
}
AMOUNT/amounts/token
Token Amounts
From Parameter
AMOUNT
/amounts/token/paramsconst hookWallet = testContext.hook1
const issuerWallet = testContext.gw
const assetModel = new AssetModel(10, 'USD', issuerWallet.classicAddress)
const param1 = new iHookParamEntry(
new iHookParamName('AMT'),
new iHookParamValue(assetModel.encode(), true)
)
const builtTx: Invoke = {
TransactionType: 'Invoke',
Account: hookWallet.classicAddress,
HookParameters: [param1.toXrpl()],
}
From Txn
AMOUNT
/amounts/token/txnconst hookWallet = testContext.hook1
const amount: IssuedCurrencyAmount = {
value: '1',
currency: testContext.ic.currency,
issuer: testContext.ic.issuer,
}
const builtTx: Payment = {
TransactionType: 'Payment',
Account: aliceWallet.classicAddress,
Destination: hookWallet.classicAddress,
Amount: amount
}