@shapeshiftoss/swapper 20.1.1 → 20.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (213) hide show
  1. package/dist/cjs/.tsbuildinfo +1 -1
  2. package/dist/cjs/swappers/BebopSwapper/utils/fetchFromBebop.d.ts +1 -2
  3. package/dist/cjs/swappers/BebopSwapper/utils/fetchFromBebop.js +4 -7
  4. package/dist/cjs/swappers/BebopSwapper/utils/getBebopSolanaTradeContext.js +0 -1
  5. package/dist/cjs/swappers/BobGatewaySwapper/BobGatewaySwapper.js +10 -1
  6. package/dist/cjs/swappers/BobGatewaySwapper/endpoints.js +2 -33
  7. package/dist/cjs/swappers/BobGatewaySwapper/swapperApi/getTradeQuote.js +5 -8
  8. package/dist/cjs/swappers/BobGatewaySwapper/swapperApi/getTradeRate.js +1 -2
  9. package/dist/cjs/swappers/BobGatewaySwapper/types.d.ts +3 -3
  10. package/dist/cjs/swappers/BobGatewaySwapper/utils/constants.d.ts +3 -2
  11. package/dist/cjs/swappers/BobGatewaySwapper/utils/constants.js +8 -5
  12. package/dist/cjs/swappers/BobGatewaySwapper/utils/getBobGatewayStepData.d.ts +2 -2
  13. package/dist/cjs/swappers/BobGatewaySwapper/utils/getBobGatewayStepData.js +30 -34
  14. package/dist/cjs/swappers/BobGatewaySwapper/utils/getBobGatewayStepData.test.d.ts +1 -0
  15. package/dist/cjs/swappers/BobGatewaySwapper/utils/getBobGatewayStepData.test.js +117 -0
  16. package/dist/cjs/swappers/BobGatewaySwapper/utils/getBobGatewayTradeContext.js +1 -2
  17. package/dist/cjs/swappers/BobGatewaySwapper/utils/helpers.d.ts +8 -11
  18. package/dist/cjs/swappers/BobGatewaySwapper/utils/helpers.js +36 -31
  19. package/dist/cjs/swappers/ButterSwap/ButterSwap.js +0 -3
  20. package/dist/cjs/swappers/ButterSwap/endpoints.js +0 -3
  21. package/dist/cjs/swappers/ButterSwap/swapperApi/getTradeQuote.js +2 -3
  22. package/dist/cjs/swappers/ButterSwap/swapperApi/getTradeRate.test.js +0 -51
  23. package/dist/cjs/swappers/ButterSwap/types.d.ts +3 -14
  24. package/dist/cjs/swappers/ButterSwap/utils/constants.d.ts +2 -0
  25. package/dist/cjs/swappers/ButterSwap/utils/constants.js +4 -1
  26. package/dist/cjs/swappers/ButterSwap/utils/getButterSwapStepData.d.ts +2 -3
  27. package/dist/cjs/swappers/ButterSwap/utils/getButterSwapStepData.js +42 -65
  28. package/dist/cjs/swappers/ButterSwap/utils/getButterSwapStepData.test.js +115 -73
  29. package/dist/cjs/swappers/ButterSwap/utils/helpers.js +1 -4
  30. package/dist/cjs/swappers/ButterSwap/xhr.js +3 -3
  31. package/dist/cjs/swappers/ChainflipSwapper/endpoints.js +3 -19
  32. package/dist/cjs/swappers/ChainflipSwapper/utils/getChainflipStepData.d.ts +1 -1
  33. package/dist/cjs/swappers/ChainflipSwapper/utils/getChainflipStepData.js +31 -12
  34. package/dist/cjs/swappers/NearIntentsSwapper/constants.d.ts +1 -0
  35. package/dist/cjs/swappers/NearIntentsSwapper/constants.js +3 -1
  36. package/dist/cjs/swappers/NearIntentsSwapper/utils/getNearIntentsStepData.js +10 -5
  37. package/dist/cjs/swappers/NearIntentsSwapper/utils/helpers.js +1 -1
  38. package/dist/cjs/swappers/RelaySwapper/constant.d.ts +1 -1
  39. package/dist/cjs/swappers/RelaySwapper/constant.js +3 -2
  40. package/dist/cjs/swappers/RelaySwapper/getTradeQuote/getTradeQuote.js +1 -2
  41. package/dist/cjs/swappers/RelaySwapper/utils/getRelayAssetAddress.js +2 -1
  42. package/dist/cjs/swappers/RelaySwapper/utils/getRelayStepData.d.ts +2 -3
  43. package/dist/cjs/swappers/RelaySwapper/utils/getRelayStepData.js +46 -13
  44. package/dist/cjs/swappers/RelaySwapper/utils/getRelayStepData.test.d.ts +1 -0
  45. package/dist/cjs/swappers/RelaySwapper/utils/getRelayStepData.test.js +139 -0
  46. package/dist/cjs/swappers/RelaySwapper/utils/helpers.js +1 -2
  47. package/dist/cjs/swappers/RelaySwapper/utils/relayTokenToAssetId.js +1 -1
  48. package/dist/cjs/swappers/RelaySwapper/utils/types.d.ts +1 -4
  49. package/dist/cjs/swappers/SunioSwapper/endpoints.js +3 -63
  50. package/dist/cjs/swappers/SunioSwapper/getSunioTradeQuote/getSunioTradeQuote.js +3 -4
  51. package/dist/cjs/swappers/SunioSwapper/getSunioTradeRate/getSunioTradeRate.js +7 -1
  52. package/dist/cjs/swappers/SunioSwapper/types.d.ts +0 -3
  53. package/dist/cjs/swappers/SunioSwapper/utils/buildSwapContractCall.d.ts +11 -6
  54. package/dist/cjs/swappers/SunioSwapper/utils/buildSwapContractCall.js +33 -30
  55. package/dist/cjs/swappers/SunioSwapper/utils/constants.d.ts +3 -3
  56. package/dist/cjs/swappers/SunioSwapper/utils/constants.js +5 -9
  57. package/dist/cjs/swappers/SunioSwapper/utils/getSunioStepData.d.ts +8 -3
  58. package/dist/cjs/swappers/SunioSwapper/utils/getSunioStepData.js +54 -20
  59. package/dist/cjs/swappers/SunioSwapper/utils/getSunioStepData.test.d.ts +1 -0
  60. package/dist/cjs/swappers/SunioSwapper/utils/getSunioStepData.test.js +177 -0
  61. package/dist/cjs/swappers/SunioSwapper/utils/getSunioTradeContext.js +3 -2
  62. package/dist/cjs/swappers/SunioSwapper/utils/helpers.js +2 -1
  63. package/dist/cjs/swappers/ThorchainSwapper/endpoints.js +3 -4
  64. package/dist/cjs/swappers/ThorchainSwapper/utils/addL1ToLongtailPartsToMemo/addL1ToLongtailPartsToMemo.js +6 -1
  65. package/dist/cjs/swappers/ThorchainSwapper/utils/addL1ToLongtailPartsToMemo/addL1ToLongtailPartsToMemo.test.js +15 -0
  66. package/dist/cjs/swappers/ThorchainSwapper/utils/assertValidLongtailTrade.js +7 -0
  67. package/dist/cjs/swappers/ThorchainSwapper/utils/getL1ToLongtailQuote.js +0 -2
  68. package/dist/cjs/swappers/ThorchainSwapper/utils/getL1ToLongtailRate.js +0 -2
  69. package/dist/cjs/swappers/ThorchainSwapper/utils/getUniqueAddressSubstring/getUniqueAddressSubstring.d.ts +1 -1
  70. package/dist/cjs/swappers/ThorchainSwapper/utils/getUniqueAddressSubstring/getUniqueAddressSubstring.js +17 -20
  71. package/dist/cjs/swappers/ThorchainSwapper/utils/getUniqueAddressSubstring/getUniqueAddressSubstring.test.js +31 -0
  72. package/dist/cjs/types.d.ts +9 -8
  73. package/dist/cjs/utils/helpers.js +3 -0
  74. package/dist/cjs/utils/helpers.test.js +3 -0
  75. package/dist/cjs/utils/thorchain/getThorStepData.js +32 -49
  76. package/dist/cjs/utils/thorchain/getThorStepData.tron.test.d.ts +1 -0
  77. package/dist/cjs/utils/thorchain/getThorStepData.tron.test.js +93 -0
  78. package/dist/cjs/utils/thorchain/index.d.ts +0 -1
  79. package/dist/cjs/utils/thorchain/index.js +1 -14
  80. package/dist/cjs/utils/tron/constants.d.ts +1 -0
  81. package/dist/cjs/utils/tron/constants.js +5 -0
  82. package/dist/cjs/utils/tron/getTronNetworkFeeCryptoBaseUnit.d.ts +27 -0
  83. package/dist/cjs/utils/tron/getTronNetworkFeeCryptoBaseUnit.js +64 -0
  84. package/dist/cjs/utils/tron/getTronNetworkFeeCryptoBaseUnit.test.d.ts +1 -0
  85. package/dist/cjs/utils/tron/getTronNetworkFeeCryptoBaseUnit.test.js +157 -0
  86. package/dist/cjs/utils/tron/getUnsignedTronTransaction.d.ts +2 -1
  87. package/dist/cjs/utils/tron/getUnsignedTronTransaction.js +14 -48
  88. package/dist/cjs/utils/tron/getUnsignedTronTransaction.test.d.ts +1 -0
  89. package/dist/cjs/utils/tron/getUnsignedTronTransaction.test.js +76 -0
  90. package/dist/cjs/utils/tron/index.d.ts +2 -0
  91. package/dist/cjs/utils/tron/index.js +2 -0
  92. package/dist/esm/.tsbuildinfo +1 -1
  93. package/dist/esm/swappers/BebopSwapper/utils/fetchFromBebop.d.ts +1 -2
  94. package/dist/esm/swappers/BebopSwapper/utils/fetchFromBebop.js +4 -7
  95. package/dist/esm/swappers/BebopSwapper/utils/getBebopSolanaTradeContext.js +0 -1
  96. package/dist/esm/swappers/BobGatewaySwapper/BobGatewaySwapper.js +11 -2
  97. package/dist/esm/swappers/BobGatewaySwapper/endpoints.js +5 -36
  98. package/dist/esm/swappers/BobGatewaySwapper/swapperApi/getTradeQuote.js +5 -8
  99. package/dist/esm/swappers/BobGatewaySwapper/swapperApi/getTradeRate.js +1 -2
  100. package/dist/esm/swappers/BobGatewaySwapper/types.d.ts +3 -3
  101. package/dist/esm/swappers/BobGatewaySwapper/utils/constants.d.ts +3 -2
  102. package/dist/esm/swappers/BobGatewaySwapper/utils/constants.js +8 -7
  103. package/dist/esm/swappers/BobGatewaySwapper/utils/getBobGatewayStepData.d.ts +2 -2
  104. package/dist/esm/swappers/BobGatewaySwapper/utils/getBobGatewayStepData.js +21 -25
  105. package/dist/esm/swappers/BobGatewaySwapper/utils/getBobGatewayStepData.test.d.ts +1 -0
  106. package/dist/esm/swappers/BobGatewaySwapper/utils/getBobGatewayStepData.test.js +115 -0
  107. package/dist/esm/swappers/BobGatewaySwapper/utils/getBobGatewayTradeContext.js +1 -2
  108. package/dist/esm/swappers/BobGatewaySwapper/utils/helpers.d.ts +8 -11
  109. package/dist/esm/swappers/BobGatewaySwapper/utils/helpers.js +13 -30
  110. package/dist/esm/swappers/ButterSwap/ButterSwap.js +0 -3
  111. package/dist/esm/swappers/ButterSwap/endpoints.js +0 -3
  112. package/dist/esm/swappers/ButterSwap/swapperApi/getTradeQuote.js +2 -3
  113. package/dist/esm/swappers/ButterSwap/swapperApi/getTradeRate.test.js +1 -49
  114. package/dist/esm/swappers/ButterSwap/types.d.ts +3 -14
  115. package/dist/esm/swappers/ButterSwap/utils/constants.d.ts +2 -0
  116. package/dist/esm/swappers/ButterSwap/utils/constants.js +3 -0
  117. package/dist/esm/swappers/ButterSwap/utils/getButterSwapStepData.d.ts +2 -3
  118. package/dist/esm/swappers/ButterSwap/utils/getButterSwapStepData.js +42 -65
  119. package/dist/esm/swappers/ButterSwap/utils/getButterSwapStepData.test.js +116 -74
  120. package/dist/esm/swappers/ButterSwap/utils/helpers.js +2 -5
  121. package/dist/esm/swappers/ButterSwap/xhr.js +3 -3
  122. package/dist/esm/swappers/ChainflipSwapper/endpoints.js +3 -19
  123. package/dist/esm/swappers/ChainflipSwapper/utils/getChainflipStepData.d.ts +1 -1
  124. package/dist/esm/swappers/ChainflipSwapper/utils/getChainflipStepData.js +32 -13
  125. package/dist/esm/swappers/NearIntentsSwapper/constants.d.ts +1 -0
  126. package/dist/esm/swappers/NearIntentsSwapper/constants.js +2 -0
  127. package/dist/esm/swappers/NearIntentsSwapper/utils/getNearIntentsStepData.js +10 -5
  128. package/dist/esm/swappers/NearIntentsSwapper/utils/helpers.js +2 -2
  129. package/dist/esm/swappers/RelaySwapper/constant.d.ts +1 -1
  130. package/dist/esm/swappers/RelaySwapper/constant.js +2 -1
  131. package/dist/esm/swappers/RelaySwapper/getTradeQuote/getTradeQuote.js +1 -2
  132. package/dist/esm/swappers/RelaySwapper/utils/getRelayAssetAddress.js +3 -2
  133. package/dist/esm/swappers/RelaySwapper/utils/getRelayStepData.d.ts +2 -3
  134. package/dist/esm/swappers/RelaySwapper/utils/getRelayStepData.js +46 -13
  135. package/dist/esm/swappers/RelaySwapper/utils/getRelayStepData.test.d.ts +1 -0
  136. package/dist/esm/swappers/RelaySwapper/utils/getRelayStepData.test.js +137 -0
  137. package/dist/esm/swappers/RelaySwapper/utils/helpers.js +1 -2
  138. package/dist/esm/swappers/RelaySwapper/utils/relayTokenToAssetId.js +3 -3
  139. package/dist/esm/swappers/RelaySwapper/utils/types.d.ts +1 -4
  140. package/dist/esm/swappers/SunioSwapper/endpoints.js +5 -65
  141. package/dist/esm/swappers/SunioSwapper/getSunioTradeQuote/getSunioTradeQuote.js +3 -4
  142. package/dist/esm/swappers/SunioSwapper/getSunioTradeRate/getSunioTradeRate.js +7 -1
  143. package/dist/esm/swappers/SunioSwapper/types.d.ts +0 -3
  144. package/dist/esm/swappers/SunioSwapper/utils/buildSwapContractCall.d.ts +11 -6
  145. package/dist/esm/swappers/SunioSwapper/utils/buildSwapContractCall.js +31 -28
  146. package/dist/esm/swappers/SunioSwapper/utils/constants.d.ts +3 -3
  147. package/dist/esm/swappers/SunioSwapper/utils/constants.js +4 -8
  148. package/dist/esm/swappers/SunioSwapper/utils/getSunioStepData.d.ts +8 -3
  149. package/dist/esm/swappers/SunioSwapper/utils/getSunioStepData.js +52 -18
  150. package/dist/esm/swappers/SunioSwapper/utils/getSunioStepData.test.d.ts +1 -0
  151. package/dist/esm/swappers/SunioSwapper/utils/getSunioStepData.test.js +175 -0
  152. package/dist/esm/swappers/SunioSwapper/utils/getSunioTradeContext.js +2 -1
  153. package/dist/esm/swappers/SunioSwapper/utils/helpers.js +3 -2
  154. package/dist/esm/swappers/ThorchainSwapper/endpoints.js +4 -5
  155. package/dist/esm/swappers/ThorchainSwapper/utils/addL1ToLongtailPartsToMemo/addL1ToLongtailPartsToMemo.js +6 -1
  156. package/dist/esm/swappers/ThorchainSwapper/utils/addL1ToLongtailPartsToMemo/addL1ToLongtailPartsToMemo.test.js +15 -0
  157. package/dist/esm/swappers/ThorchainSwapper/utils/assertValidLongtailTrade.js +7 -0
  158. package/dist/esm/swappers/ThorchainSwapper/utils/getL1ToLongtailQuote.js +0 -2
  159. package/dist/esm/swappers/ThorchainSwapper/utils/getL1ToLongtailRate.js +0 -2
  160. package/dist/esm/swappers/ThorchainSwapper/utils/getUniqueAddressSubstring/getUniqueAddressSubstring.d.ts +1 -1
  161. package/dist/esm/swappers/ThorchainSwapper/utils/getUniqueAddressSubstring/getUniqueAddressSubstring.js +17 -20
  162. package/dist/esm/swappers/ThorchainSwapper/utils/getUniqueAddressSubstring/getUniqueAddressSubstring.test.js +29 -1
  163. package/dist/esm/types.d.ts +9 -8
  164. package/dist/esm/utils/helpers.js +4 -1
  165. package/dist/esm/utils/helpers.test.js +3 -0
  166. package/dist/esm/utils/thorchain/getThorStepData.js +32 -49
  167. package/dist/esm/utils/thorchain/getThorStepData.tron.test.d.ts +1 -0
  168. package/dist/esm/utils/thorchain/getThorStepData.tron.test.js +91 -0
  169. package/dist/esm/utils/thorchain/index.d.ts +0 -1
  170. package/dist/esm/utils/thorchain/index.js +0 -1
  171. package/dist/esm/utils/tron/constants.d.ts +1 -0
  172. package/dist/esm/utils/tron/constants.js +2 -0
  173. package/dist/esm/utils/tron/getTronNetworkFeeCryptoBaseUnit.d.ts +27 -0
  174. package/dist/esm/utils/tron/getTronNetworkFeeCryptoBaseUnit.js +59 -0
  175. package/dist/esm/utils/tron/getTronNetworkFeeCryptoBaseUnit.test.d.ts +1 -0
  176. package/dist/esm/utils/tron/getTronNetworkFeeCryptoBaseUnit.test.js +155 -0
  177. package/dist/esm/utils/tron/getUnsignedTronTransaction.d.ts +2 -1
  178. package/dist/esm/utils/tron/getUnsignedTronTransaction.js +14 -48
  179. package/dist/esm/utils/tron/getUnsignedTronTransaction.test.d.ts +1 -0
  180. package/dist/esm/utils/tron/getUnsignedTronTransaction.test.js +74 -0
  181. package/dist/esm/utils/tron/index.d.ts +2 -0
  182. package/dist/esm/utils/tron/index.js +2 -0
  183. package/package.json +9 -9
  184. package/dist/cjs/swappers/ButterSwap/test-data/eth-btc.json +0 -461
  185. package/dist/cjs/swappers/SunioSwapper/utils/buildSwapRouteParameters.d.ts +0 -14
  186. package/dist/cjs/swappers/SunioSwapper/utils/buildSwapRouteParameters.js +0 -32
  187. package/dist/cjs/swappers/SunioSwapper/utils/estimateSunioNetworkFee.d.ts +0 -12
  188. package/dist/cjs/swappers/SunioSwapper/utils/estimateSunioNetworkFee.js +0 -78
  189. package/dist/cjs/swappers/SunioSwapper/utils/getSunioTransactionFees.d.ts +0 -2
  190. package/dist/cjs/swappers/SunioSwapper/utils/getSunioTransactionFees.js +0 -36
  191. package/dist/cjs/utils/thorchain/tron/getTronTransactionFees.d.ts +0 -2
  192. package/dist/cjs/utils/thorchain/tron/getTronTransactionFees.js +0 -68
  193. package/dist/cjs/utils/thorchain/tron/getUnsignedTronTransaction.d.ts +0 -3
  194. package/dist/cjs/utils/thorchain/tron/getUnsignedTronTransaction.js +0 -35
  195. package/dist/cjs/utils/thorchain/tron/index.d.ts +0 -2
  196. package/dist/cjs/utils/thorchain/tron/index.js +0 -18
  197. package/dist/esm/swappers/ButterSwap/test-data/eth-btc.json +0 -461
  198. package/dist/esm/swappers/SunioSwapper/utils/buildSwapRouteParameters.d.ts +0 -14
  199. package/dist/esm/swappers/SunioSwapper/utils/buildSwapRouteParameters.js +0 -28
  200. package/dist/esm/swappers/SunioSwapper/utils/estimateSunioNetworkFee.d.ts +0 -12
  201. package/dist/esm/swappers/SunioSwapper/utils/estimateSunioNetworkFee.js +0 -74
  202. package/dist/esm/swappers/SunioSwapper/utils/getSunioTransactionFees.d.ts +0 -2
  203. package/dist/esm/swappers/SunioSwapper/utils/getSunioTransactionFees.js +0 -32
  204. package/dist/esm/utils/thorchain/tron/getTronTransactionFees.d.ts +0 -2
  205. package/dist/esm/utils/thorchain/tron/getTronTransactionFees.js +0 -64
  206. package/dist/esm/utils/thorchain/tron/getUnsignedTronTransaction.d.ts +0 -3
  207. package/dist/esm/utils/thorchain/tron/getUnsignedTronTransaction.js +0 -31
  208. package/dist/esm/utils/thorchain/tron/index.d.ts +0 -2
  209. package/dist/esm/utils/thorchain/tron/index.js +0 -2
  210. /package/dist/cjs/swappers/SunioSwapper/utils/{fetchFromSunio.d.ts → fetchSunioQuote.d.ts} +0 -0
  211. /package/dist/cjs/swappers/SunioSwapper/utils/{fetchFromSunio.js → fetchSunioQuote.js} +0 -0
  212. /package/dist/esm/swappers/SunioSwapper/utils/{fetchFromSunio.d.ts → fetchSunioQuote.d.ts} +0 -0
  213. /package/dist/esm/swappers/SunioSwapper/utils/{fetchFromSunio.js → fetchSunioQuote.js} +0 -0
@@ -1,461 +0,0 @@
1
- {
2
- "errno": 0,
3
- "message": "success",
4
- "data": [
5
- {
6
- "diff": "0",
7
- "bridgeFee": {
8
- "amount": "0.000107378906528402",
9
- "symbol": "BTC",
10
- "address": "0xb877E3562a660C7861117c2f1361A26ABaF19bEB",
11
- "chainId": 22776,
12
- "in": {
13
- "amount": "0.0",
14
- "token": {
15
- "address": "0x05aB928d446d8ce6761e368c8e7bE03C3168A9ec",
16
- "decimals": 18,
17
- "symbol": "ETH",
18
- "icon": "https://s3.amazonaws.com/map-static-file/mapSwap/ethereum/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2/logo.png"
19
- }
20
- },
21
- "out": {
22
- "amount": "0.000107378906528402",
23
- "token": {
24
- "address": "0xb877E3562a660C7861117c2f1361A26ABaF19bEB",
25
- "decimals": 18,
26
- "symbol": "BTC",
27
- "icon": "https://map-static-file.s3.amazonaws.com/mapSwap/merlin/0x0000000000000000000000000000000000000000.jpg"
28
- }
29
- },
30
- "affiliate": {
31
- "amount": "0.0",
32
- "token": {
33
- "address": "0x05aB928d446d8ce6761e368c8e7bE03C3168A9ec",
34
- "decimals": 18,
35
- "symbol": "ETH",
36
- "icon": "https://s3.amazonaws.com/map-static-file/mapSwap/ethereum/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2/logo.png"
37
- },
38
- "list": [],
39
- "data": "0x00"
40
- }
41
- },
42
- "tradeType": 0,
43
- "gasFee": {
44
- "amount": "0.00016530333452",
45
- "symbol": "ETH",
46
- "inUSD": "0.40999865125232837"
47
- },
48
- "swapFee": {
49
- "nativeFee": "0.0",
50
- "tokenFee": "0.0"
51
- },
52
- "feeConfig": {
53
- "feeType": 1,
54
- "referrer": "0x51C700e5bE790C91F14D42F85ca90aed9f2D142e",
55
- "rateOrNativeFee": 0
56
- },
57
- "gasEstimated": "170000",
58
- "gasEstimatedTarget": "420000",
59
- "timeEstimated": 120,
60
- "hash": "0xebdd2bea8ffe00bbbc9f0f7d8a92ee9112cf5d2630fb14946c3f21726c3464f6",
61
- "entrance": "butter+",
62
- "timestamp": 1750912498065,
63
- "hasLiquidity": true,
64
- "srcChain": {
65
- "chainId": "1",
66
- "tokenIn": {
67
- "address": "0x0000000000000000000000000000000000000000",
68
- "name": "ETH",
69
- "decimals": 18,
70
- "symbol": "ETH",
71
- "icon": "https://s3.amazonaws.com/map-static-file/mapSwap/ethereum/0x0000000000000000000000000000000000000000/logo.png"
72
- },
73
- "tokenOut": {
74
- "address": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
75
- "name": "Wrapped Ether",
76
- "decimals": 18,
77
- "symbol": "WETH",
78
- "icon": "https://s3.amazonaws.com/map-static-file/mapSwap/ethereum/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2/logo.png"
79
- },
80
- "totalAmountIn": "1.0",
81
- "totalAmountOut": "1.0",
82
- "route": [
83
- {
84
- "amountIn": "1.0",
85
- "amountOut": "1.0",
86
- "dexName": "",
87
- "path": []
88
- }
89
- ],
90
- "totalAmountOutUSD": "2480.28058504",
91
- "bridge": "Butter"
92
- },
93
- "bridgeChain": {
94
- "chainId": "22776",
95
- "tokenIn": {
96
- "address": "0x05aB928d446d8ce6761e368c8e7bE03C3168A9ec",
97
- "decimals": 18,
98
- "symbol": "ETH",
99
- "icon": "https://s3.amazonaws.com/map-static-file/mapSwap/ethereum/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2/logo.png"
100
- },
101
- "tokenOut": {
102
- "address": "0xb877E3562a660C7861117c2f1361A26ABaF19bEB",
103
- "decimals": 18,
104
- "symbol": "BTC",
105
- "icon": "https://map-static-file.s3.amazonaws.com/mapSwap/merlin/0x0000000000000000000000000000000000000000.jpg"
106
- },
107
- "totalAmountIn": "1.0",
108
- "totalAmountOut": "0.022844183704832789",
109
- "route": [
110
- {
111
- "amountIn": "1.0",
112
- "amountOut": "0.022844183704832789",
113
- "dexName": "FlashSwap",
114
- "path": []
115
- }
116
- ],
117
- "bridge": "Butter"
118
- },
119
- "dstChain": {
120
- "chainId": "1360095883558913",
121
- "tokenIn": {
122
- "address": "0x425443",
123
- "name": "WBTC",
124
- "decimals": 8,
125
- "symbol": "WBTC",
126
- "icon": "https://map-static-file.s3.amazonaws.com/mapSwap/merlin/0x0000000000000000000000000000000000000000.jpg"
127
- },
128
- "tokenOut": {
129
- "address": "0x0000000000000000000000000000000000000000",
130
- "name": "BTC",
131
- "decimals": 8,
132
- "symbol": "BTC",
133
- "icon": "https://map-static-file.s3.amazonaws.com/mapSwap/merlin/0x0000000000000000000000000000000000000000.jpg"
134
- },
135
- "totalAmountIn": "0.02284418",
136
- "totalAmountOut": "0.02284418",
137
- "route": [
138
- {
139
- "amountIn": "0.02284418",
140
- "amountOut": "0.02284418",
141
- "dexName": "",
142
- "path": []
143
- }
144
- ],
145
- "totalAmountOutUSD": "2465.5271044752394",
146
- "bridge": "Butter"
147
- },
148
- "totalAmountInUSD": "2480.28058504",
149
- "totalAmountOutUSD": "2465.5271044752394",
150
- "contract": "0xEE030ec6F4307411607E55aCD08e628Ae6655B86",
151
- "minAmountOut": {
152
- "amount": "0.02250152",
153
- "symbol": "BTC"
154
- }
155
- },
156
- {
157
- "diff": "0.00236384059309635977",
158
- "bridgeFee": {
159
- "amount": "0.000107377548232246",
160
- "symbol": "BTC",
161
- "address": "0xb877E3562a660C7861117c2f1361A26ABaF19bEB",
162
- "chainId": 22776,
163
- "in": {
164
- "amount": "0.0",
165
- "token": {
166
- "address": "0x9f722b2cb30093f766221Fd0d37964949ed66918",
167
- "decimals": 18,
168
- "symbol": "USDC",
169
- "icon": "https://s3.amazonaws.com/map-static-file/mapSwap/ethereum/0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48/logo.png"
170
- }
171
- },
172
- "out": {
173
- "amount": "0.000107377548232246",
174
- "token": {
175
- "address": "0xb877E3562a660C7861117c2f1361A26ABaF19bEB",
176
- "decimals": 18,
177
- "symbol": "BTC",
178
- "icon": "https://map-static-file.s3.amazonaws.com/mapSwap/merlin/0x0000000000000000000000000000000000000000.jpg"
179
- }
180
- },
181
- "affiliate": {
182
- "amount": "0.0",
183
- "token": {
184
- "address": "0x9f722b2cb30093f766221Fd0d37964949ed66918",
185
- "decimals": 18,
186
- "symbol": "USDC",
187
- "icon": "https://s3.amazonaws.com/map-static-file/mapSwap/ethereum/0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48/logo.png"
188
- },
189
- "list": [],
190
- "data": "0x00"
191
- }
192
- },
193
- "tradeType": 0,
194
- "gasFee": {
195
- "amount": "0.000797153938526468",
196
- "symbol": "ETH",
197
- "inUSD": "1.9771654370153682"
198
- },
199
- "swapFee": {
200
- "nativeFee": "0.0",
201
- "tokenFee": "0.0"
202
- },
203
- "feeConfig": {
204
- "feeType": 1,
205
- "referrer": "0x51C700e5bE790C91F14D42F85ca90aed9f2D142e",
206
- "rateOrNativeFee": 0
207
- },
208
- "gasEstimated": "819803",
209
- "gasEstimatedTarget": "420000",
210
- "timeEstimated": 120,
211
- "hash": "0x89959c9c0d91bceeeddcf3edb2c8164a8ea7bd3eb464214a58a49d061996d028",
212
- "entrance": "butter+",
213
- "timestamp": 1750912498065,
214
- "hasLiquidity": true,
215
- "srcChain": {
216
- "chainId": "1",
217
- "tokenIn": {
218
- "address": "0x0000000000000000000000000000000000000000",
219
- "name": "ETH",
220
- "decimals": 18,
221
- "symbol": "ETH",
222
- "icon": "https://s3.amazonaws.com/map-static-file/mapSwap/ethereum/0x0000000000000000000000000000000000000000/logo.png"
223
- },
224
- "tokenOut": {
225
- "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
226
- "name": "USD Coin",
227
- "decimals": 6,
228
- "symbol": "USDC",
229
- "icon": "https://s3.amazonaws.com/map-static-file/mapSwap/ethereum/0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48/logo.png"
230
- },
231
- "totalAmountIn": "1.0",
232
- "totalAmountOut": "2479.119727",
233
- "route": [
234
- {
235
- "amountIn": "1.0",
236
- "amountOut": "2479.119727",
237
- "dexName": "OpenOcean",
238
- "path": [],
239
- "extra": "0x90411a3200000000000000000000000055877bd7f2ee37bde55ca4b271a3631f3a7ef121000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001c0000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4800000000000000000000000055877bd7f2ee37bde55ca4b271a3631f3a7ef121000000000000000000000000aa301070448385cfaac5913a67b16c4392944a8f0000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000008c60f25c0000000000000000000000000000000000000000000000000000000093c45d6f0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200aee9ba7040d778922a763ce8a50948d61aff5000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001e000000000000000000000000000000000000000000000000000000000000003a000000000000000000000000000000000000000000000000000000000000004600000000000000000000000000000000000000000000000000000000000000620000000000000000000000000000000000000000000000000000000000000088000000000000000000000000000000000000000000000000000000000000009c00000000000000000000000000000000000000000000000000000000000000e200000000000000000000000000000000000000000000000000000000000000f40000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006f05b59d3b2000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000004d0e30db00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000104e5b07cdb000000000000000000000000e0554a476a092703abdb3ef35c80e0d76d32939f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006f05b59d3b2000000000000000000000000000055877bd7f2ee37bde55ca4b271a3631f3a7ef12100000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000002ec02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000064a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4800000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006f05b59d3b2000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000004d0e30db00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000104e5b07cdb000000000000000000000000c7bbec68d12a0d1830360f8ec58fa599ba1b0e9b000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000006ccd46763f1000000000000000000000000000055877bd7f2ee37bde55ca4b271a3631f3a7ef12100000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000002ec02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000064dac17f958d2ee523a2206206994597c13d831ec700000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000001a49f865422000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc200000000000000000000000000000001000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000004400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000064d1660f99000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000ce9874c42dce7fffbe5e48b026ff1182733266cb0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000084aa37e8aa000000000000000000000000ce9874c42dce7fffbe5e48b026ff1182733266cb000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000055877bd7f2ee37bde55ca4b271a3631f3a7ef12100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000003a451a74316000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000001000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000034000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000064eb5625d9000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000006146be494fee4c73540cb1c5f87536abf14525000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000006146be494fee4c73540cb1c5f87536abf14525000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000084c31b8d7a00000000000000000000000055877bd7f2ee37bde55ca4b271a3631f3a7ef12100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000fffd8963efd1fc6a506488495d951d5263988d250000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000044000000000000000000000000000000000000000000000000000000000000004400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000648a6a1e85000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000922164bbbd36acf9e854acbbf32facc949fcaeef0000000000000000000000000000000000000000000000000000000093c45d6f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000001a49f865422000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4800000000000000000000000000000001000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000004400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000064d1660f99000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000aa301070448385cfaac5913a67b16c4392944a8f00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
240
- }
241
- ],
242
- "totalAmountOutUSD": "2479.009901996094",
243
- "bridge": "Butter"
244
- },
245
- "bridgeChain": {
246
- "chainId": "22776",
247
- "tokenIn": {
248
- "address": "0x9f722b2cb30093f766221Fd0d37964949ed66918",
249
- "decimals": 18,
250
- "symbol": "USDC",
251
- "icon": "https://s3.amazonaws.com/map-static-file/mapSwap/ethereum/0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48/logo.png"
252
- },
253
- "tokenOut": {
254
- "address": "0xb877E3562a660C7861117c2f1361A26ABaF19bEB",
255
- "decimals": 18,
256
- "symbol": "BTC",
257
- "icon": "https://map-static-file.s3.amazonaws.com/mapSwap/merlin/0x0000000000000000000000000000000000000000.jpg"
258
- },
259
- "totalAmountIn": "2479.119727",
260
- "totalAmountOut": "0.022843641744666255",
261
- "route": [
262
- {
263
- "amountIn": "2479.119727",
264
- "amountOut": "0.022843641744666255",
265
- "dexName": "FlashSwap",
266
- "path": []
267
- }
268
- ],
269
- "bridge": "Butter"
270
- },
271
- "dstChain": {
272
- "chainId": "1360095883558913",
273
- "tokenIn": {
274
- "address": "0x425443",
275
- "name": "WBTC",
276
- "decimals": 8,
277
- "symbol": "WBTC",
278
- "icon": "https://map-static-file.s3.amazonaws.com/mapSwap/merlin/0x0000000000000000000000000000000000000000.jpg"
279
- },
280
- "tokenOut": {
281
- "address": "0x0000000000000000000000000000000000000000",
282
- "name": "BTC",
283
- "decimals": 8,
284
- "symbol": "BTC",
285
- "icon": "https://map-static-file.s3.amazonaws.com/mapSwap/merlin/0x0000000000000000000000000000000000000000.jpg"
286
- },
287
- "totalAmountIn": "0.02284364",
288
- "totalAmountOut": "0.02284364",
289
- "route": [
290
- {
291
- "amountIn": "0.02284364",
292
- "amountOut": "0.02284364",
293
- "dexName": "",
294
- "path": []
295
- }
296
- ],
297
- "totalAmountOutUSD": "2465.4688233447096",
298
- "bridge": "Butter"
299
- },
300
- "totalAmountInUSD": "2480.28058504",
301
- "totalAmountOutUSD": "2465.4688233447096",
302
- "contract": "0xEE030ec6F4307411607E55aCD08e628Ae6655B86",
303
- "minAmountOut": {
304
- "amount": "0.02250099",
305
- "symbol": "BTC"
306
- }
307
- },
308
- {
309
- "diff": "0.01514608972613593484",
310
- "bridgeFee": {
311
- "amount": "0.000107370229408362",
312
- "symbol": "BTC",
313
- "address": "0xb877E3562a660C7861117c2f1361A26ABaF19bEB",
314
- "chainId": 22776,
315
- "in": {
316
- "amount": "0.0",
317
- "token": {
318
- "address": "0x33DAba9618a75a7AFf103e53AfE530FbAcF4A3DD",
319
- "decimals": 18,
320
- "symbol": "USDT",
321
- "icon": "https://files.mapprotocol.io/bridge/usdt.png"
322
- }
323
- },
324
- "out": {
325
- "amount": "0.000107370229408362",
326
- "token": {
327
- "address": "0xb877E3562a660C7861117c2f1361A26ABaF19bEB",
328
- "decimals": 18,
329
- "symbol": "BTC",
330
- "icon": "https://map-static-file.s3.amazonaws.com/mapSwap/merlin/0x0000000000000000000000000000000000000000.jpg"
331
- }
332
- },
333
- "affiliate": {
334
- "amount": "0.0",
335
- "token": {
336
- "address": "0x33DAba9618a75a7AFf103e53AfE530FbAcF4A3DD",
337
- "decimals": 18,
338
- "symbol": "USDT",
339
- "icon": "https://files.mapprotocol.io/bridge/usdt.png"
340
- },
341
- "list": [],
342
- "data": "0x00"
343
- }
344
- },
345
- "tradeType": 0,
346
- "gasFee": {
347
- "amount": "0.00038404340285498",
348
- "symbol": "ETH",
349
- "inUSD": "0.9525353959139022"
350
- },
351
- "swapFee": {
352
- "nativeFee": "0.0",
353
- "tokenFee": "0.0"
354
- },
355
- "feeConfig": {
356
- "feeType": 1,
357
- "referrer": "0x51C700e5bE790C91F14D42F85ca90aed9f2D142e",
358
- "rateOrNativeFee": 0
359
- },
360
- "gasEstimated": "394955",
361
- "gasEstimatedTarget": "420000",
362
- "timeEstimated": 120,
363
- "hash": "0x43123b7bca6ac488bd74c7d056ac3fcddf41fdd1ddc12271b39e85ad889f91b6",
364
- "entrance": "butter+",
365
- "timestamp": 1750912498067,
366
- "hasLiquidity": true,
367
- "srcChain": {
368
- "chainId": "1",
369
- "tokenIn": {
370
- "address": "0x0000000000000000000000000000000000000000",
371
- "name": "ETH",
372
- "decimals": 18,
373
- "symbol": "ETH",
374
- "icon": "https://s3.amazonaws.com/map-static-file/mapSwap/ethereum/0x0000000000000000000000000000000000000000/logo.png"
375
- },
376
- "tokenOut": {
377
- "address": "0xdAC17F958D2ee523a2206206994597C13D831ec7",
378
- "name": "Tether USD",
379
- "decimals": 6,
380
- "symbol": "USDT",
381
- "icon": "https://files.mapprotocol.io/bridge/usdt.png"
382
- },
383
- "totalAmountIn": "1.0",
384
- "totalAmountOut": "2477.604823",
385
- "route": [
386
- {
387
- "amountIn": "1.0",
388
- "amountOut": "2477.604823",
389
- "dexName": "OpenOcean",
390
- "path": [],
391
- "extra": "0x90411a3200000000000000000000000055877bd7f2ee37bde55ca4b271a3631f3a7ef121000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001c0000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000055877bd7f2ee37bde55ca4b271a3631f3a7ef121000000000000000000000000aa301070448385cfaac5913a67b16c4392944a8f0000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000008c4afca50000000000000000000000000000000000000000000000000000000093ad3fd70000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200aee9ba7040d778922a763ce8a50948d61aff50000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000000420000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000004d0e30db00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000104e5b07cdb000000000000000000000000c7bbec68d12a0d1830360f8ec58fa599ba1b0e9b00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000055877bd7f2ee37bde55ca4b271a3631f3a7ef12100000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000002ec02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000064dac17f958d2ee523a2206206994597c13d831ec700000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000648a6a1e85000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000922164bbbd36acf9e854acbbf32facc949fcaeef0000000000000000000000000000000000000000000000000000000093ad3fd700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000001a49f865422000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000001000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000004400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000064d1660f99000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000aa301070448385cfaac5913a67b16c4392944a8f00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
392
- }
393
- ],
394
- "totalAmountOutUSD": "2478.925361594611",
395
- "bridge": "Butter"
396
- },
397
- "bridgeChain": {
398
- "chainId": "22776",
399
- "tokenIn": {
400
- "address": "0x33DAba9618a75a7AFf103e53AfE530FbAcF4A3DD",
401
- "decimals": 18,
402
- "symbol": "USDT",
403
- "icon": "https://files.mapprotocol.io/bridge/usdt.png"
404
- },
405
- "tokenOut": {
406
- "address": "0xb877E3562a660C7861117c2f1361A26ABaF19bEB",
407
- "decimals": 18,
408
- "symbol": "BTC",
409
- "icon": "https://map-static-file.s3.amazonaws.com/mapSwap/merlin/0x0000000000000000000000000000000000000000.jpg"
410
- },
411
- "totalAmountIn": "2477.604823",
412
- "totalAmountOut": "0.022840721533936562",
413
- "route": [
414
- {
415
- "amountIn": "2477.604823",
416
- "amountOut": "0.022840721533936562",
417
- "dexName": "FlashSwap",
418
- "path": []
419
- }
420
- ],
421
- "bridge": "Butter"
422
- },
423
- "dstChain": {
424
- "chainId": "1360095883558913",
425
- "tokenIn": {
426
- "address": "0x425443",
427
- "name": "WBTC",
428
- "decimals": 8,
429
- "symbol": "WBTC",
430
- "icon": "https://map-static-file.s3.amazonaws.com/mapSwap/merlin/0x0000000000000000000000000000000000000000.jpg"
431
- },
432
- "tokenOut": {
433
- "address": "0x0000000000000000000000000000000000000000",
434
- "name": "BTC",
435
- "decimals": 8,
436
- "symbol": "BTC",
437
- "icon": "https://map-static-file.s3.amazonaws.com/mapSwap/merlin/0x0000000000000000000000000000000000000000.jpg"
438
- },
439
- "totalAmountIn": "0.02284072",
440
- "totalAmountOut": "0.02284072",
441
- "route": [
442
- {
443
- "amountIn": "0.02284072",
444
- "amountOut": "0.02284072",
445
- "dexName": "",
446
- "path": []
447
- }
448
- ],
449
- "totalAmountOutUSD": "2465.153673527773",
450
- "bridge": "Butter"
451
- },
452
- "totalAmountInUSD": "2480.28058504",
453
- "totalAmountOutUSD": "2465.153673527773",
454
- "contract": "0xEE030ec6F4307411607E55aCD08e628Ae6655B86",
455
- "minAmountOut": {
456
- "amount": "0.02249811",
457
- "symbol": "BTC"
458
- }
459
- }
460
- ]
461
- }
@@ -1,14 +0,0 @@
1
- import type { SunioRoute } from '../types.js';
2
- export type SwapRouteParameters = {
3
- path: string[];
4
- poolVersion: string[];
5
- versionLen: number[];
6
- fees: number[];
7
- swapData: {
8
- amountIn: string;
9
- amountOutMin: string;
10
- recipient: string;
11
- deadline: number;
12
- };
13
- };
14
- export declare const buildSwapRouteParameters: (route: SunioRoute, sellAmountCryptoBaseUnit: string, minBuyAmountCryptoBaseUnit: string, recipient: string, slippageTolerancePercentageDecimal: string) => SwapRouteParameters;
@@ -1,28 +0,0 @@
1
- import { bn } from '@shapeshiftoss/utils';
2
- export const buildSwapRouteParameters = (route, sellAmountCryptoBaseUnit, minBuyAmountCryptoBaseUnit, recipient, slippageTolerancePercentageDecimal) => {
3
- const path = route.tokens;
4
- const poolVersion = route.poolVersions;
5
- // The SmartExchangeRouter expects sum(versionLen) === path.length: the first
6
- // pool segment consumes 2 tokens (input + output) and each subsequent pool
7
- // reuses the previous output, consuming 1 new token. This relies on the Sun.io
8
- // API returning poolVersions per-hop (poolVersions.length === tokens.length - 1),
9
- // which it does — the router also accepts this un-collapsed form for same-version hops.
10
- const versionLen = poolVersion.map((_, index) => (index === 0 ? 2 : 1));
11
- const fees = route.poolFees.map(fee => Number(fee));
12
- const amountOutWithSlippage = bn(minBuyAmountCryptoBaseUnit)
13
- .times(bn(1).minus(slippageTolerancePercentageDecimal))
14
- .toFixed(0);
15
- const swapData = {
16
- amountIn: sellAmountCryptoBaseUnit,
17
- amountOutMin: amountOutWithSlippage,
18
- recipient,
19
- deadline: Math.floor(Date.now() / 1000) + 60 * 20,
20
- };
21
- return {
22
- path,
23
- poolVersion,
24
- versionLen,
25
- fees,
26
- swapData,
27
- };
28
- };
@@ -1,12 +0,0 @@
1
- import type { SunioRoute } from '../types.js';
2
- type EstimateSunioNetworkFeeArgs = {
3
- rpcUrl: string;
4
- apiKey: string;
5
- route: SunioRoute;
6
- sellAmountCryptoBaseUnit: string;
7
- isSellingNativeTrx: boolean;
8
- address: string | undefined;
9
- slippageTolerancePercentageDecimal: string | undefined;
10
- };
11
- export declare const estimateSunioNetworkFeeCryptoBaseUnit: ({ rpcUrl, apiKey, route, sellAmountCryptoBaseUnit, isSellingNativeTrx, address, slippageTolerancePercentageDecimal, }: EstimateSunioNetworkFeeArgs) => Promise<string>;
12
- export {};
@@ -1,74 +0,0 @@
1
- import { bn } from '@shapeshiftoss/utils';
2
- import { TronWeb } from 'tronweb';
3
- import { buildSwapExactInputParameters, SUNIO_SWAP_EXACT_INPUT_SELECTOR, } from './buildSwapContractCall.js';
4
- import { buildSwapRouteParameters } from './buildSwapRouteParameters.js';
5
- import { DEFAULT_SLIPPAGE_PERCENTAGE, SUNIO_FALLBACK_SWAP_ENERGY_NATIVE, SUNIO_FALLBACK_SWAP_ENERGY_TRC20, SUNIO_SMART_ROUTER_CONTRACT, SUNIO_TRON_NATIVE_ADDRESS, } from './constants.js';
6
- // Estimates the network fee (in TRX base units) for a Sun.io swap. The router sponsors only ~1%
7
- // of energy (origin_energy_usage); the user pays the rest, so we simulate the real swapExactInput
8
- // call when we have an address to estimate from. The simulation reverts before approval for TRC20
9
- // sells (and when the account lacks the sell balance), so we fall back to a conservative per-sell-
10
- // type constant. Used both at quote time and re-run at confirm time, where a now-granted allowance
11
- // lets the simulation produce the true cost.
12
- export const estimateSunioNetworkFeeCryptoBaseUnit = async ({ rpcUrl, apiKey, route, sellAmountCryptoBaseUnit, isSellingNativeTrx, address, slippageTolerancePercentageDecimal, }) => {
13
- const tronGridHeaders = apiKey ? { 'TRON-PRO-API-KEY': apiKey } : {};
14
- const tronWeb = new TronWeb({ fullHost: rpcUrl, headers: tronGridHeaders });
15
- // Live network prices, defaulting if the node is unavailable so we still produce a fee
16
- const { bandwidthPrice, energyPrice } = await (async () => {
17
- try {
18
- const params = await tronWeb.trx.getChainParameters();
19
- return {
20
- bandwidthPrice: params.find(p => p.key === 'getTransactionFee')?.value ?? 1000,
21
- energyPrice: params.find(p => p.key === 'getEnergyFee')?.value ?? 100,
22
- };
23
- }
24
- catch {
25
- return { bandwidthPrice: 1000, energyPrice: 100 };
26
- }
27
- })();
28
- // Account activation (1 TRX) is only charged when the recipient receives native TRX, mirroring
29
- // the chain adapter. A TRC20 buy doesn't incur the flat activation fee (its account-creation
30
- // cost is folded into energy). Only checkable with an address.
31
- const isBuyingNativeTrx = route.tokens[route.tokens.length - 1] === SUNIO_TRON_NATIVE_ADDRESS;
32
- const accountActivationFee = await (async () => {
33
- if (!address || !isBuyingNativeTrx)
34
- return 0;
35
- try {
36
- const recipientInfoResponse = await fetch(`${rpcUrl}/wallet/getaccount`, {
37
- method: 'POST',
38
- headers: { 'Content-Type': 'application/json', ...tronGridHeaders },
39
- body: JSON.stringify({ address, visible: true }),
40
- });
41
- const recipientInfo = await recipientInfoResponse.json();
42
- const recipientExists = recipientInfo && Object.keys(recipientInfo).length > 1;
43
- return recipientExists ? 0 : 1_000_000; // 1 TRX
44
- }
45
- catch {
46
- return 0;
47
- }
48
- })();
49
- const energyUsed = await (async () => {
50
- // TRC20 sells cost far more energy than native sells (the extra transferFrom token pull)
51
- const fallbackEnergy = isSellingNativeTrx
52
- ? SUNIO_FALLBACK_SWAP_ENERGY_NATIVE
53
- : SUNIO_FALLBACK_SWAP_ENERGY_TRC20;
54
- if (!address)
55
- return fallbackEnergy;
56
- try {
57
- const routeParams = buildSwapRouteParameters(route, sellAmountCryptoBaseUnit, '0', address, slippageTolerancePercentageDecimal ?? DEFAULT_SLIPPAGE_PERCENTAGE);
58
- const callValue = isSellingNativeTrx ? Number(sellAmountCryptoBaseUnit) : 0;
59
- const result = await tronWeb.transactionBuilder.triggerConstantContract(SUNIO_SMART_ROUTER_CONTRACT, SUNIO_SWAP_EXACT_INPUT_SELECTOR, { callValue }, buildSwapExactInputParameters(routeParams), address);
60
- // A reverted simulation (e.g. TRC20 sell pre-approval) can still return a small energy_used;
61
- // only trust it when the call actually succeeded, otherwise use the conservative fallback.
62
- if (result?.result?.result !== true || result.energy_used == null)
63
- return fallbackEnergy;
64
- return result.energy_used;
65
- }
66
- catch {
67
- return fallbackEnergy;
68
- }
69
- })();
70
- // 1.2x safety margin for energy price/usage variance between estimate and execution
71
- const energyFee = Math.ceil(energyUsed * energyPrice * 1.2);
72
- const bandwidthFee = 1100 * bandwidthPrice;
73
- return bn(energyFee).plus(bandwidthFee).plus(accountActivationFee).toFixed(0);
74
- };
@@ -1,2 +0,0 @@
1
- import type { GetUnsignedTronTransactionArgs } from '../../../types.js';
2
- export declare const getSunioTransactionFees: ({ tradeQuote, stepIndex, from, slippageTolerancePercentageDecimal, assertGetTronChainAdapter, config, }: GetUnsignedTronTransactionArgs) => Promise<string>;
@@ -1,32 +0,0 @@
1
- import { tronAssetId, tronChainId } from '@shapeshiftoss/caip';
2
- import { getExecutableTradeStep, isExecutableTradeQuote } from '../../../utils/index.js';
3
- import { estimateSunioNetworkFeeCryptoBaseUnit } from './estimateSunioNetworkFee.js';
4
- export const getSunioTransactionFees = async ({ tradeQuote, stepIndex, from, slippageTolerancePercentageDecimal, assertGetTronChainAdapter, config, }) => {
5
- if (!isExecutableTradeQuote(tradeQuote))
6
- throw new Error('Unable to execute a trade rate quote');
7
- const step = getExecutableTradeStep(tradeQuote, stepIndex);
8
- const storedNetworkFeeCryptoBaseUnit = step.feeData.networkFeeCryptoBaseUnit;
9
- const route = step.sunioTransactionData?.route;
10
- if (!route) {
11
- if (!storedNetworkFeeCryptoBaseUnit)
12
- throw new Error('Missing network fee in quote');
13
- return storedNetworkFeeCryptoBaseUnit;
14
- }
15
- try {
16
- const adapter = assertGetTronChainAdapter(tronChainId);
17
- return await estimateSunioNetworkFeeCryptoBaseUnit({
18
- rpcUrl: adapter.httpProvider.getRpcUrl(),
19
- apiKey: config.VITE_TRON_GRID_API_KEY,
20
- route,
21
- sellAmountCryptoBaseUnit: step.sellAmountIncludingProtocolFeesCryptoBaseUnit,
22
- isSellingNativeTrx: step.sellAsset.assetId === tronAssetId,
23
- address: from,
24
- slippageTolerancePercentageDecimal,
25
- });
26
- }
27
- catch {
28
- if (!storedNetworkFeeCryptoBaseUnit)
29
- throw new Error('Missing network fee in quote');
30
- return storedNetworkFeeCryptoBaseUnit;
31
- }
32
- };