Swap
Exchange an asset to another.
Arguments
Send one paired asset
outputrequiredto
dataoptional Define the receiver address.to_aa
dataoptionalDefine the address of an AA to send it to after swap (used to do multiple swap in a single request)
amount_out_in
dataoptionalDefine 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
dataoptionalDefine 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?