Skip to content

Instantly share code, notes, and snippets.

@vlzhr
Created October 6, 2021 21:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vlzhr/839cf17931dfc6cdbba5b4317166dfbe to your computer and use it in GitHub Desktop.
Save vlzhr/839cf17931dfc6cdbba5b4317166dfbe to your computer and use it in GitHub Desktop.
// 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