Created
October 6, 2021 21:56
-
-
Save vlzhr/839cf17931dfc6cdbba5b4317166dfbe to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// to invoke puzzle swap you will need to broadcast this transaction | |
// TODO: replace poolAddress (for example "3PPRHHF9JKvDLkAc3aHD3Kd5tRZp1CoqAJa") | |
// TODO: replace assetInId and assetOutId (for example "4kwKSf4Bx2Wq8YxKnVZBhcEHyXzEtJ2pw7ixfJgirwf2" and "54UszKAj3MtYmkdRCqSXAcaQLaVALBy7CCrVkfmfzhxR") | |
// TODO: set minToReceive if you want to avoid slippage risk | |
.invoke({ | |
dApp: "poolAddress", | |
fee: 500000, | |
payment: { | |
assetId: "assetInId", | |
amount: 100 | |
}, | |
call: { | |
function: 'swap', | |
args: [ | |
{ "type": "string", "value": "assetOutId" }, | |
{ "type": "integer", "value": minToReceive } | |
], | |
}, | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment