Swap
Exchange an asset to another.
Arguments
Send one paired asset
output
requiredto
data
optional Define the receiver address.to_aa
data
optionalDefine the address of an AA to send it to after swap (used to do multiple swap in a single request).
amount_out_in
data
optionalDefine an amount minimum to receive from the swap, if the amount to receive is lower than the amount set the unit will be bounced.
deadline
data
optionalDefine a timestamp, the request will be bounced if deadline expired.
Example
{
trigger: {
outputs: {
base: 10000,
'WhsD5Y/1NeKROgQojGwfe9EBC7NH4KnAk4CorCrVRhs=': 200000
}
}
}
Returns
{
responseVars: {
type: 'swap',
asset0_amount: 42000
}
}
Last updated
Was this helpful?