Skip to content

Instantly share code, notes, and snippets.

@lfrocha12
Created September 11, 2024 02:25
Show Gist options
  • Save lfrocha12/cb562cdf8768c7f53d8c2dab02323432 to your computer and use it in GitHub Desktop.
Save lfrocha12/cb562cdf8768c7f53d8c2dab02323432 to your computer and use it in GitHub Desktop.
BitFlow SDK -- getSwapParams(swapExecutionData, senderAddress, 4 / 100) // 4% of slippageTolerance
{
"functionArgs": [
{ "type": 1, "value": "1000000" },
{ "type": 1, "value": "931209" },
{
"type": 6,
"address": {
"type": 0,
"version": 20,
"hash160": "4e91b0982dbe4ae49bb9394b1f339fb7144beee6"
},
"contractName": {
"type": 2,
"content": "xyk-pool-stx-aeusdc-v-1-1",
"lengthPrefixBytes": 1,
"maxLengthBytes": 128
}
},
{
"type": 6,
"address": {
"type": 0,
"version": 20,
"hash160": "4e91b0982dbe4ae49bb9394b1f339fb7144beee6"
},
"contractName": {
"type": 2,
"content": "token-stx-v-1-1",
"lengthPrefixBytes": 1,
"maxLengthBytes": 128
}
},
{
"type": 6,
"address": {
"type": 0,
"version": 22,
"hash160": "fc2fe628b1da502c1b5eb3d08727ee6022503b5a"
},
"contractName": {
"type": 2,
"content": "token-aeusdc",
"lengthPrefixBytes": 1,
"maxLengthBytes": 128
}
},
{ "type": 4 },
{ "type": 1, "value": "8" },
{
"type": 6,
"address": {
"type": 0,
"version": 22,
"hash160": "099fb88926d82f30b2f40eaf3ee423cb725bdb3b"
},
"contractName": {
"type": 2,
"content": "ststx-token",
"lengthPrefixBytes": 1,
"maxLengthBytes": 128
}
},
{
"type": 6,
"address": {
"type": 0,
"version": 22,
"hash160": "fc2fe628b1da502c1b5eb3d08727ee6022503b5a"
},
"contractName": {
"type": 2,
"content": "token-aeusdc",
"lengthPrefixBytes": 1,
"maxLengthBytes": 128
}
},
{
"type": 6,
"address": {
"type": 0,
"version": 22,
"hash160": "fc2fe628b1da502c1b5eb3d08727ee6022503b5a"
},
"contractName": {
"type": 2,
"content": "token-aeusdc",
"lengthPrefixBytes": 1,
"maxLengthBytes": 128
}
},
{
"type": 6,
"address": {
"type": 0,
"version": 22,
"hash160": "099fb88926d82f30b2f40eaf3ee423cb725bdb3b"
},
"contractName": {
"type": 2,
"content": "ststx-token",
"lengthPrefixBytes": 1,
"maxLengthBytes": 128
}
},
{
"type": 6,
"address": {
"type": 0,
"version": 22,
"hash160": "7c5f674a8fd08efa61dd9b11121e046dd2c89273"
},
"contractName": {
"type": 2,
"content": "univ2-share-fee-to",
"lengthPrefixBytes": 1,
"maxLengthBytes": 128
}
}
],
"postConditions": [
{
"type": 5,
"conditionType": 0,
"principal": {
"type": 1,
"prefix": 2,
"address": {
"type": 0,
"version": 22,
"hash160": "3ccb8006590b4e85b342ab5775e4f140325b7e6d"
}
},
"conditionCode": 1,
"amount": "1000000"
},
{
"type": 5,
"conditionType": 1,
"principal": {
"type": 1,
"prefix": 3,
"address": {
"type": 0,
"version": 20,
"hash160": "4e91b0982dbe4ae49bb9394b1f339fb7144beee6"
},
"contractName": {
"type": 2,
"content": "xyk-pool-stx-aeusdc-v-1-1",
"lengthPrefixBytes": 1,
"maxLengthBytes": 128
}
},
"conditionCode": 3,
"amount": "0",
"assetInfo": {
"type": 4,
"address": {
"type": 0,
"version": 22,
"hash160": "fc2fe628b1da502c1b5eb3d08727ee6022503b5a"
},
"contractName": {
"type": 2,
"content": "token-aeusdc",
"lengthPrefixBytes": 1,
"maxLengthBytes": 128
},
"assetName": {
"type": 2,
"content": "aeUSDC",
"lengthPrefixBytes": 1,
"maxLengthBytes": 128
}
}
},
{
"type": 5,
"conditionType": 1,
"principal": {
"type": 1,
"prefix": 2,
"address": {
"type": 0,
"version": 22,
"hash160": "3ccb8006590b4e85b342ab5775e4f140325b7e6d"
}
},
"conditionCode": 3,
"amount": "0",
"assetInfo": {
"type": 4,
"address": {
"type": 0,
"version": 22,
"hash160": "fc2fe628b1da502c1b5eb3d08727ee6022503b5a"
},
"contractName": {
"type": 2,
"content": "token-aeusdc",
"lengthPrefixBytes": 1,
"maxLengthBytes": 128
},
"assetName": {
"type": 2,
"content": "aeUSDC",
"lengthPrefixBytes": 1,
"maxLengthBytes": 128
}
}
},
{
"type": 5,
"conditionType": 1,
"principal": {
"type": 1,
"prefix": 3,
"address": {
"type": 0,
"version": 22,
"hash160": "7c5f674a8fd08efa61dd9b11121e046dd2c89273"
},
"contractName": {
"type": 2,
"content": "univ2-core",
"lengthPrefixBytes": 1,
"maxLengthBytes": 128
}
},
"conditionCode": 3,
"amount": "0",
"assetInfo": {
"type": 4,
"address": {
"type": 0,
"version": 22,
"hash160": "fc2fe628b1da502c1b5eb3d08727ee6022503b5a"
},
"contractName": {
"type": 2,
"content": "token-aeusdc",
"lengthPrefixBytes": 1,
"maxLengthBytes": 128
},
"assetName": {
"type": 2,
"content": "aeUSDC",
"lengthPrefixBytes": 1,
"maxLengthBytes": 128
}
}
},
{
"type": 5,
"conditionType": 1,
"principal": {
"type": 1,
"prefix": 3,
"address": {
"type": 0,
"version": 22,
"hash160": "7c5f674a8fd08efa61dd9b11121e046dd2c89273"
},
"contractName": {
"type": 2,
"content": "univ2-core",
"lengthPrefixBytes": 1,
"maxLengthBytes": 128
}
},
"conditionCode": 3,
"amount": "931209",
"assetInfo": {
"type": 4,
"address": {
"type": 0,
"version": 22,
"hash160": "099fb88926d82f30b2f40eaf3ee423cb725bdb3b"
},
"contractName": {
"type": 2,
"content": "ststx-token",
"lengthPrefixBytes": 1,
"maxLengthBytes": 128
},
"assetName": {
"type": 2,
"content": "ststx",
"lengthPrefixBytes": 1,
"maxLengthBytes": 128
}
}
},
{
"type": 5,
"conditionType": 1,
"principal": {
"type": 1,
"prefix": 3,
"address": {
"type": 0,
"version": 22,
"hash160": "7c5f674a8fd08efa61dd9b11121e046dd2c89273"
},
"contractName": {
"type": 2,
"content": "univ2-core",
"lengthPrefixBytes": 1,
"maxLengthBytes": 128
}
},
"conditionCode": 3,
"amount": "0",
"assetInfo": {
"type": 4,
"address": {
"type": 0,
"version": 22,
"hash160": "099fb88926d82f30b2f40eaf3ee423cb725bdb3b"
},
"contractName": {
"type": 2,
"content": "ststx-token",
"lengthPrefixBytes": 1,
"maxLengthBytes": 128
},
"assetName": {
"type": 2,
"content": "ststx",
"lengthPrefixBytes": 1,
"maxLengthBytes": 128
}
}
}
],
"contractAddress": "SPQC38PW542EQJ5M11CR25P7BS1CA6QT4TBXGB3M",
"contractName": "router-xyk-velar-v-1-1",
"functionName": "swap-helper-a"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment