@7kprotocol/sdk-ts 3.5.4 → 3.6.1-beta.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 (379) hide show
  1. package/README.md +1 -11
  2. package/lib/cjs/config/fetchClient.js +1 -9
  3. package/lib/cjs/constants/_7k.js +13 -10
  4. package/lib/cjs/constants/apiEndpoints.js +1 -1
  5. package/lib/cjs/features/metaAg/common.js +103 -0
  6. package/lib/cjs/features/metaAg/error.js +31 -0
  7. package/lib/cjs/features/metaAg/index.js +96 -117
  8. package/lib/cjs/features/metaAg/providers/bluefin7k.js +57 -0
  9. package/lib/cjs/features/metaAg/providers/cetus.js +7 -7
  10. package/lib/cjs/features/metaAg/providers/flowx.js +6 -6
  11. package/lib/cjs/features/metaAg/providers/okx.js +182 -0
  12. package/lib/cjs/features/prices/index.js +51 -20
  13. package/lib/cjs/index.js +1 -35
  14. package/lib/cjs/types/config/fetchClient.d.ts.map +1 -1
  15. package/lib/cjs/types/constants/_7k.d.ts +0 -3
  16. package/lib/cjs/types/constants/_7k.d.ts.map +1 -1
  17. package/lib/cjs/types/features/metaAg/common.d.ts +24 -0
  18. package/lib/cjs/types/features/metaAg/common.d.ts.map +1 -0
  19. package/lib/cjs/types/features/metaAg/error.d.ts +54 -0
  20. package/lib/cjs/types/features/metaAg/error.d.ts.map +1 -0
  21. package/lib/cjs/types/features/metaAg/index.d.ts +11 -2
  22. package/lib/cjs/types/features/metaAg/index.d.ts.map +1 -1
  23. package/lib/cjs/types/features/metaAg/providers/bluefin7k.d.ts +11 -0
  24. package/lib/cjs/types/features/metaAg/providers/bluefin7k.d.ts.map +1 -0
  25. package/lib/cjs/types/features/metaAg/providers/cetus.d.ts +4 -5
  26. package/lib/cjs/types/features/metaAg/providers/cetus.d.ts.map +1 -1
  27. package/lib/cjs/types/features/metaAg/providers/flowx.d.ts +3 -3
  28. package/lib/cjs/types/features/metaAg/providers/flowx.d.ts.map +1 -1
  29. package/lib/cjs/types/features/metaAg/providers/okx.d.ts +21 -0
  30. package/lib/cjs/types/features/metaAg/providers/okx.d.ts.map +1 -0
  31. package/lib/cjs/types/features/prices/index.d.ts +16 -2
  32. package/lib/cjs/types/features/prices/index.d.ts.map +1 -1
  33. package/lib/cjs/types/index.d.ts +1 -30
  34. package/lib/cjs/types/index.d.ts.map +1 -1
  35. package/lib/cjs/types/metaAg.js +8 -4
  36. package/lib/cjs/types/okx.js +6 -0
  37. package/lib/cjs/types/types/metaAg.d.ts +50 -12
  38. package/lib/cjs/types/types/metaAg.d.ts.map +1 -1
  39. package/lib/cjs/types/types/okx.d.ts +206 -0
  40. package/lib/cjs/types/types/okx.d.ts.map +1 -0
  41. package/lib/cjs/types/utils/sui.d.ts +1 -31
  42. package/lib/cjs/types/utils/sui.d.ts.map +1 -1
  43. package/lib/cjs/types/utils/swap.d.ts +15 -0
  44. package/lib/cjs/types/utils/swap.d.ts.map +1 -0
  45. package/lib/cjs/utils/sui.js +19 -146
  46. package/lib/cjs/utils/swap.js +37 -0
  47. package/lib/esm/config/fetchClient.js +1 -9
  48. package/lib/esm/constants/_7k.js +12 -9
  49. package/lib/esm/constants/apiEndpoints.js +1 -1
  50. package/lib/esm/features/metaAg/common.js +96 -0
  51. package/lib/esm/features/metaAg/error.js +29 -0
  52. package/lib/esm/features/metaAg/index.js +96 -117
  53. package/lib/esm/features/metaAg/providers/{bluefin.js → bluefin7k.js} +12 -23
  54. package/lib/esm/features/metaAg/providers/cetus.js +7 -7
  55. package/lib/esm/features/metaAg/providers/flowx.js +6 -6
  56. package/lib/esm/features/metaAg/providers/okx.js +147 -0
  57. package/lib/esm/features/prices/index.js +52 -21
  58. package/lib/esm/index.mjs +3 -31
  59. package/lib/esm/types/config/fetchClient.d.ts.map +1 -1
  60. package/lib/esm/types/constants/_7k.d.ts +0 -3
  61. package/lib/esm/types/constants/_7k.d.ts.map +1 -1
  62. package/lib/esm/types/features/metaAg/common.d.ts +24 -0
  63. package/lib/esm/types/features/metaAg/common.d.ts.map +1 -0
  64. package/lib/esm/types/features/metaAg/error.d.ts +54 -0
  65. package/lib/esm/types/features/metaAg/error.d.ts.map +1 -0
  66. package/lib/esm/types/features/metaAg/index.d.ts +11 -2
  67. package/lib/esm/types/features/metaAg/index.d.ts.map +1 -1
  68. package/lib/esm/types/features/metaAg/providers/bluefin7k.d.ts +11 -0
  69. package/lib/esm/types/features/metaAg/providers/bluefin7k.d.ts.map +1 -0
  70. package/lib/esm/types/features/metaAg/providers/cetus.d.ts +4 -5
  71. package/lib/esm/types/features/metaAg/providers/cetus.d.ts.map +1 -1
  72. package/lib/esm/types/features/metaAg/providers/flowx.d.ts +3 -3
  73. package/lib/esm/types/features/metaAg/providers/flowx.d.ts.map +1 -1
  74. package/lib/esm/types/features/metaAg/providers/okx.d.ts +21 -0
  75. package/lib/esm/types/features/metaAg/providers/okx.d.ts.map +1 -0
  76. package/lib/esm/types/features/prices/index.d.ts +16 -2
  77. package/lib/esm/types/features/prices/index.d.ts.map +1 -1
  78. package/lib/esm/types/index.d.ts +1 -30
  79. package/lib/esm/types/index.d.ts.map +1 -1
  80. package/lib/esm/types/metaAg.js +5 -2
  81. package/lib/esm/types/okx.js +5 -0
  82. package/lib/esm/types/types/metaAg.d.ts +50 -12
  83. package/lib/esm/types/types/metaAg.d.ts.map +1 -1
  84. package/lib/esm/types/types/okx.d.ts +206 -0
  85. package/lib/esm/types/types/okx.d.ts.map +1 -0
  86. package/lib/esm/types/utils/sui.d.ts +1 -31
  87. package/lib/esm/types/utils/sui.d.ts.map +1 -1
  88. package/lib/esm/types/utils/swap.d.ts +15 -0
  89. package/lib/esm/types/utils/swap.d.ts.map +1 -0
  90. package/lib/esm/utils/sui.js +19 -147
  91. package/lib/esm/utils/swap.js +33 -0
  92. package/package.json +3 -1
  93. package/lib/cjs/config/index.js +0 -58
  94. package/lib/cjs/features/metaAg/providers/bluefin.js +0 -68
  95. package/lib/cjs/features/swap/buildTx.js +0 -195
  96. package/lib/cjs/features/swap/buildTxV2.js +0 -225
  97. package/lib/cjs/features/swap/config.js +0 -153
  98. package/lib/cjs/features/swap/estimateGasFee.js +0 -44
  99. package/lib/cjs/features/swap/executeTx.js +0 -52
  100. package/lib/cjs/features/swap/getQuote.js +0 -94
  101. package/lib/cjs/features/swap/getSwapHistory.js +0 -21
  102. package/lib/cjs/features/swap/index.js +0 -22
  103. package/lib/cjs/libs/groupSwapRoutes.js +0 -60
  104. package/lib/cjs/libs/protocols/aftermath/index.js +0 -35
  105. package/lib/cjs/libs/protocols/base.js +0 -41
  106. package/lib/cjs/libs/protocols/bluefin/index.js +0 -38
  107. package/lib/cjs/libs/protocols/bluefinx/client.js +0 -41
  108. package/lib/cjs/libs/protocols/bluefinx/index.js +0 -48
  109. package/lib/cjs/libs/protocols/bluefinx/types.js +0 -10
  110. package/lib/cjs/libs/protocols/bluemove/index.js +0 -24
  111. package/lib/cjs/libs/protocols/cetus/index.js +0 -44
  112. package/lib/cjs/libs/protocols/cetus_dlmm.js +0 -48
  113. package/lib/cjs/libs/protocols/constants.js +0 -5
  114. package/lib/cjs/libs/protocols/deepbookV3/sponsored.js +0 -30
  115. package/lib/cjs/libs/protocols/ferra_clmm.js +0 -44
  116. package/lib/cjs/libs/protocols/ferra_dlmm.js +0 -30
  117. package/lib/cjs/libs/protocols/flowx/index.js +0 -18
  118. package/lib/cjs/libs/protocols/flowxV3/index.js +0 -36
  119. package/lib/cjs/libs/protocols/fullsail/index.js +0 -39
  120. package/lib/cjs/libs/protocols/haedal_pmm/index.js +0 -31
  121. package/lib/cjs/libs/protocols/index.js +0 -55
  122. package/lib/cjs/libs/protocols/kriya/index.js +0 -30
  123. package/lib/cjs/libs/protocols/kriyaV3/index.js +0 -65
  124. package/lib/cjs/libs/protocols/magma/index.js +0 -40
  125. package/lib/cjs/libs/protocols/momentum/index.js +0 -49
  126. package/lib/cjs/libs/protocols/obric/index.js +0 -28
  127. package/lib/cjs/libs/protocols/sevenk/index.js +0 -55
  128. package/lib/cjs/libs/protocols/springsui/index.js +0 -24
  129. package/lib/cjs/libs/protocols/steamm/index.js +0 -160
  130. package/lib/cjs/libs/protocols/stsui/index.js +0 -24
  131. package/lib/cjs/libs/protocols/suiswap/index.js +0 -34
  132. package/lib/cjs/libs/protocols/turbos/index.js +0 -36
  133. package/lib/cjs/libs/protocols/utils.js +0 -7
  134. package/lib/cjs/libs/swapWithRoute.js +0 -22
  135. package/lib/cjs/types/aggregator.js +0 -19
  136. package/lib/cjs/types/config/index.d.ts +0 -26
  137. package/lib/cjs/types/config/index.d.ts.map +0 -1
  138. package/lib/cjs/types/features/metaAg/providers/bluefin.d.ts +0 -11
  139. package/lib/cjs/types/features/metaAg/providers/bluefin.d.ts.map +0 -1
  140. package/lib/cjs/types/features/swap/buildTx.d.ts +0 -17
  141. package/lib/cjs/types/features/swap/buildTx.d.ts.map +0 -1
  142. package/lib/cjs/types/features/swap/buildTxV2.d.ts +0 -20
  143. package/lib/cjs/types/features/swap/buildTxV2.d.ts.map +0 -1
  144. package/lib/cjs/types/features/swap/config.d.ts +0 -4
  145. package/lib/cjs/types/features/swap/config.d.ts.map +0 -1
  146. package/lib/cjs/types/features/swap/estimateGasFee.d.ts +0 -3
  147. package/lib/cjs/types/features/swap/estimateGasFee.d.ts.map +0 -1
  148. package/lib/cjs/types/features/swap/executeTx.d.ts +0 -24
  149. package/lib/cjs/types/features/swap/executeTx.d.ts.map +0 -1
  150. package/lib/cjs/types/features/swap/getQuote.d.ts +0 -29
  151. package/lib/cjs/types/features/swap/getQuote.d.ts.map +0 -1
  152. package/lib/cjs/types/features/swap/getSwapHistory.d.ts +0 -22
  153. package/lib/cjs/types/features/swap/getSwapHistory.d.ts.map +0 -1
  154. package/lib/cjs/types/features/swap/index.d.ts +0 -7
  155. package/lib/cjs/types/features/swap/index.d.ts.map +0 -1
  156. package/lib/cjs/types/libs/groupSwapRoutes.d.ts +0 -3
  157. package/lib/cjs/types/libs/groupSwapRoutes.d.ts.map +0 -1
  158. package/lib/cjs/types/libs/protocols/aftermath/index.d.ts +0 -9
  159. package/lib/cjs/types/libs/protocols/aftermath/index.d.ts.map +0 -1
  160. package/lib/cjs/types/libs/protocols/base.d.ts +0 -24
  161. package/lib/cjs/types/libs/protocols/base.d.ts.map +0 -1
  162. package/lib/cjs/types/libs/protocols/bluefin/index.d.ts +0 -9
  163. package/lib/cjs/types/libs/protocols/bluefin/index.d.ts.map +0 -1
  164. package/lib/cjs/types/libs/protocols/bluefinx/client.d.ts +0 -13
  165. package/lib/cjs/types/libs/protocols/bluefinx/client.d.ts.map +0 -1
  166. package/lib/cjs/types/libs/protocols/bluefinx/index.d.ts +0 -17
  167. package/lib/cjs/types/libs/protocols/bluefinx/index.d.ts.map +0 -1
  168. package/lib/cjs/types/libs/protocols/bluefinx/types.d.ts +0 -34
  169. package/lib/cjs/types/libs/protocols/bluefinx/types.d.ts.map +0 -1
  170. package/lib/cjs/types/libs/protocols/bluemove/index.d.ts +0 -9
  171. package/lib/cjs/types/libs/protocols/bluemove/index.d.ts.map +0 -1
  172. package/lib/cjs/types/libs/protocols/cetus/index.d.ts +0 -9
  173. package/lib/cjs/types/libs/protocols/cetus/index.d.ts.map +0 -1
  174. package/lib/cjs/types/libs/protocols/cetus_dlmm.d.ts +0 -9
  175. package/lib/cjs/types/libs/protocols/cetus_dlmm.d.ts.map +0 -1
  176. package/lib/cjs/types/libs/protocols/constants.d.ts +0 -3
  177. package/lib/cjs/types/libs/protocols/constants.d.ts.map +0 -1
  178. package/lib/cjs/types/libs/protocols/deepbookV3/sponsored.d.ts +0 -7
  179. package/lib/cjs/types/libs/protocols/deepbookV3/sponsored.d.ts.map +0 -1
  180. package/lib/cjs/types/libs/protocols/ferra_clmm.d.ts +0 -9
  181. package/lib/cjs/types/libs/protocols/ferra_clmm.d.ts.map +0 -1
  182. package/lib/cjs/types/libs/protocols/ferra_dlmm.d.ts +0 -9
  183. package/lib/cjs/types/libs/protocols/ferra_dlmm.d.ts.map +0 -1
  184. package/lib/cjs/types/libs/protocols/flowx/index.d.ts +0 -9
  185. package/lib/cjs/types/libs/protocols/flowx/index.d.ts.map +0 -1
  186. package/lib/cjs/types/libs/protocols/flowxV3/index.d.ts +0 -9
  187. package/lib/cjs/types/libs/protocols/flowxV3/index.d.ts.map +0 -1
  188. package/lib/cjs/types/libs/protocols/fullsail/index.d.ts +0 -9
  189. package/lib/cjs/types/libs/protocols/fullsail/index.d.ts.map +0 -1
  190. package/lib/cjs/types/libs/protocols/haedal_pmm/index.d.ts +0 -14
  191. package/lib/cjs/types/libs/protocols/haedal_pmm/index.d.ts.map +0 -1
  192. package/lib/cjs/types/libs/protocols/index.d.ts +0 -53
  193. package/lib/cjs/types/libs/protocols/index.d.ts.map +0 -1
  194. package/lib/cjs/types/libs/protocols/kriya/index.d.ts +0 -9
  195. package/lib/cjs/types/libs/protocols/kriya/index.d.ts.map +0 -1
  196. package/lib/cjs/types/libs/protocols/kriyaV3/index.d.ts +0 -9
  197. package/lib/cjs/types/libs/protocols/kriyaV3/index.d.ts.map +0 -1
  198. package/lib/cjs/types/libs/protocols/magma/index.d.ts +0 -9
  199. package/lib/cjs/types/libs/protocols/magma/index.d.ts.map +0 -1
  200. package/lib/cjs/types/libs/protocols/momentum/index.d.ts +0 -9
  201. package/lib/cjs/types/libs/protocols/momentum/index.d.ts.map +0 -1
  202. package/lib/cjs/types/libs/protocols/obric/index.d.ts +0 -14
  203. package/lib/cjs/types/libs/protocols/obric/index.d.ts.map +0 -1
  204. package/lib/cjs/types/libs/protocols/sevenk/index.d.ts +0 -18
  205. package/lib/cjs/types/libs/protocols/sevenk/index.d.ts.map +0 -1
  206. package/lib/cjs/types/libs/protocols/springsui/index.d.ts +0 -9
  207. package/lib/cjs/types/libs/protocols/springsui/index.d.ts.map +0 -1
  208. package/lib/cjs/types/libs/protocols/steamm/index.d.ts +0 -28
  209. package/lib/cjs/types/libs/protocols/steamm/index.d.ts.map +0 -1
  210. package/lib/cjs/types/libs/protocols/stsui/index.d.ts +0 -9
  211. package/lib/cjs/types/libs/protocols/stsui/index.d.ts.map +0 -1
  212. package/lib/cjs/types/libs/protocols/suiswap/index.d.ts +0 -9
  213. package/lib/cjs/types/libs/protocols/suiswap/index.d.ts.map +0 -1
  214. package/lib/cjs/types/libs/protocols/turbos/index.d.ts +0 -9
  215. package/lib/cjs/types/libs/protocols/turbos/index.d.ts.map +0 -1
  216. package/lib/cjs/types/libs/protocols/utils.d.ts +0 -2
  217. package/lib/cjs/types/libs/protocols/utils.d.ts.map +0 -1
  218. package/lib/cjs/types/libs/swapWithRoute.d.ts +0 -12
  219. package/lib/cjs/types/libs/swapWithRoute.d.ts.map +0 -1
  220. package/lib/cjs/types/sui.js +0 -2
  221. package/lib/cjs/types/tx.js +0 -2
  222. package/lib/cjs/types/types/aggregator.d.ts +0 -173
  223. package/lib/cjs/types/types/aggregator.d.ts.map +0 -1
  224. package/lib/cjs/types/types/sui.d.ts +0 -4
  225. package/lib/cjs/types/types/sui.d.ts.map +0 -1
  226. package/lib/cjs/types/types/tx.d.ts +0 -67
  227. package/lib/cjs/types/types/tx.d.ts.map +0 -1
  228. package/lib/cjs/types/types/utilities.d.ts +0 -5
  229. package/lib/cjs/types/types/utilities.d.ts.map +0 -1
  230. package/lib/cjs/types/utilities.js +0 -2
  231. package/lib/cjs/types/utils/condition.d.ts +0 -2
  232. package/lib/cjs/types/utils/condition.d.ts.map +0 -1
  233. package/lib/cjs/types/utils/number.d.ts +0 -2
  234. package/lib/cjs/types/utils/number.d.ts.map +0 -1
  235. package/lib/cjs/utils/condition.js +0 -8
  236. package/lib/cjs/utils/number.js +0 -9
  237. package/lib/esm/config/index.js +0 -55
  238. package/lib/esm/features/swap/buildTx.js +0 -185
  239. package/lib/esm/features/swap/buildTxV2.js +0 -219
  240. package/lib/esm/features/swap/config.js +0 -149
  241. package/lib/esm/features/swap/estimateGasFee.js +0 -41
  242. package/lib/esm/features/swap/executeTx.js +0 -48
  243. package/lib/esm/features/swap/getQuote.js +0 -90
  244. package/lib/esm/features/swap/getSwapHistory.js +0 -18
  245. package/lib/esm/features/swap/index.js +0 -6
  246. package/lib/esm/libs/groupSwapRoutes.js +0 -57
  247. package/lib/esm/libs/protocols/aftermath/index.js +0 -31
  248. package/lib/esm/libs/protocols/base.js +0 -42
  249. package/lib/esm/libs/protocols/bluefin/index.js +0 -34
  250. package/lib/esm/libs/protocols/bluefinx/client.js +0 -36
  251. package/lib/esm/libs/protocols/bluefinx/index.js +0 -44
  252. package/lib/esm/libs/protocols/bluefinx/types.js +0 -8
  253. package/lib/esm/libs/protocols/bluemove/index.js +0 -20
  254. package/lib/esm/libs/protocols/cetus/index.js +0 -40
  255. package/lib/esm/libs/protocols/cetus_dlmm.js +0 -44
  256. package/lib/esm/libs/protocols/constants.js +0 -2
  257. package/lib/esm/libs/protocols/deepbookV3/sponsored.js +0 -26
  258. package/lib/esm/libs/protocols/ferra_clmm.js +0 -40
  259. package/lib/esm/libs/protocols/ferra_dlmm.js +0 -26
  260. package/lib/esm/libs/protocols/flowx/index.js +0 -14
  261. package/lib/esm/libs/protocols/flowxV3/index.js +0 -32
  262. package/lib/esm/libs/protocols/fullsail/index.js +0 -35
  263. package/lib/esm/libs/protocols/haedal_pmm/index.js +0 -27
  264. package/lib/esm/libs/protocols/index.js +0 -52
  265. package/lib/esm/libs/protocols/kriya/index.js +0 -26
  266. package/lib/esm/libs/protocols/kriyaV3/index.js +0 -61
  267. package/lib/esm/libs/protocols/magma/index.js +0 -36
  268. package/lib/esm/libs/protocols/momentum/index.js +0 -45
  269. package/lib/esm/libs/protocols/obric/index.js +0 -24
  270. package/lib/esm/libs/protocols/sevenk/index.js +0 -51
  271. package/lib/esm/libs/protocols/springsui/index.js +0 -20
  272. package/lib/esm/libs/protocols/steamm/index.js +0 -156
  273. package/lib/esm/libs/protocols/stsui/index.js +0 -20
  274. package/lib/esm/libs/protocols/suiswap/index.js +0 -30
  275. package/lib/esm/libs/protocols/turbos/index.js +0 -32
  276. package/lib/esm/libs/protocols/utils.js +0 -4
  277. package/lib/esm/libs/swapWithRoute.js +0 -19
  278. package/lib/esm/types/aggregator.js +0 -14
  279. package/lib/esm/types/config/index.d.ts +0 -26
  280. package/lib/esm/types/config/index.d.ts.map +0 -1
  281. package/lib/esm/types/features/metaAg/providers/bluefin.d.ts +0 -11
  282. package/lib/esm/types/features/metaAg/providers/bluefin.d.ts.map +0 -1
  283. package/lib/esm/types/features/swap/buildTx.d.ts +0 -17
  284. package/lib/esm/types/features/swap/buildTx.d.ts.map +0 -1
  285. package/lib/esm/types/features/swap/buildTxV2.d.ts +0 -20
  286. package/lib/esm/types/features/swap/buildTxV2.d.ts.map +0 -1
  287. package/lib/esm/types/features/swap/config.d.ts +0 -4
  288. package/lib/esm/types/features/swap/config.d.ts.map +0 -1
  289. package/lib/esm/types/features/swap/estimateGasFee.d.ts +0 -3
  290. package/lib/esm/types/features/swap/estimateGasFee.d.ts.map +0 -1
  291. package/lib/esm/types/features/swap/executeTx.d.ts +0 -24
  292. package/lib/esm/types/features/swap/executeTx.d.ts.map +0 -1
  293. package/lib/esm/types/features/swap/getQuote.d.ts +0 -29
  294. package/lib/esm/types/features/swap/getQuote.d.ts.map +0 -1
  295. package/lib/esm/types/features/swap/getSwapHistory.d.ts +0 -22
  296. package/lib/esm/types/features/swap/getSwapHistory.d.ts.map +0 -1
  297. package/lib/esm/types/features/swap/index.d.ts +0 -7
  298. package/lib/esm/types/features/swap/index.d.ts.map +0 -1
  299. package/lib/esm/types/libs/groupSwapRoutes.d.ts +0 -3
  300. package/lib/esm/types/libs/groupSwapRoutes.d.ts.map +0 -1
  301. package/lib/esm/types/libs/protocols/aftermath/index.d.ts +0 -9
  302. package/lib/esm/types/libs/protocols/aftermath/index.d.ts.map +0 -1
  303. package/lib/esm/types/libs/protocols/base.d.ts +0 -24
  304. package/lib/esm/types/libs/protocols/base.d.ts.map +0 -1
  305. package/lib/esm/types/libs/protocols/bluefin/index.d.ts +0 -9
  306. package/lib/esm/types/libs/protocols/bluefin/index.d.ts.map +0 -1
  307. package/lib/esm/types/libs/protocols/bluefinx/client.d.ts +0 -13
  308. package/lib/esm/types/libs/protocols/bluefinx/client.d.ts.map +0 -1
  309. package/lib/esm/types/libs/protocols/bluefinx/index.d.ts +0 -17
  310. package/lib/esm/types/libs/protocols/bluefinx/index.d.ts.map +0 -1
  311. package/lib/esm/types/libs/protocols/bluefinx/types.d.ts +0 -34
  312. package/lib/esm/types/libs/protocols/bluefinx/types.d.ts.map +0 -1
  313. package/lib/esm/types/libs/protocols/bluemove/index.d.ts +0 -9
  314. package/lib/esm/types/libs/protocols/bluemove/index.d.ts.map +0 -1
  315. package/lib/esm/types/libs/protocols/cetus/index.d.ts +0 -9
  316. package/lib/esm/types/libs/protocols/cetus/index.d.ts.map +0 -1
  317. package/lib/esm/types/libs/protocols/cetus_dlmm.d.ts +0 -9
  318. package/lib/esm/types/libs/protocols/cetus_dlmm.d.ts.map +0 -1
  319. package/lib/esm/types/libs/protocols/constants.d.ts +0 -3
  320. package/lib/esm/types/libs/protocols/constants.d.ts.map +0 -1
  321. package/lib/esm/types/libs/protocols/deepbookV3/sponsored.d.ts +0 -7
  322. package/lib/esm/types/libs/protocols/deepbookV3/sponsored.d.ts.map +0 -1
  323. package/lib/esm/types/libs/protocols/ferra_clmm.d.ts +0 -9
  324. package/lib/esm/types/libs/protocols/ferra_clmm.d.ts.map +0 -1
  325. package/lib/esm/types/libs/protocols/ferra_dlmm.d.ts +0 -9
  326. package/lib/esm/types/libs/protocols/ferra_dlmm.d.ts.map +0 -1
  327. package/lib/esm/types/libs/protocols/flowx/index.d.ts +0 -9
  328. package/lib/esm/types/libs/protocols/flowx/index.d.ts.map +0 -1
  329. package/lib/esm/types/libs/protocols/flowxV3/index.d.ts +0 -9
  330. package/lib/esm/types/libs/protocols/flowxV3/index.d.ts.map +0 -1
  331. package/lib/esm/types/libs/protocols/fullsail/index.d.ts +0 -9
  332. package/lib/esm/types/libs/protocols/fullsail/index.d.ts.map +0 -1
  333. package/lib/esm/types/libs/protocols/haedal_pmm/index.d.ts +0 -14
  334. package/lib/esm/types/libs/protocols/haedal_pmm/index.d.ts.map +0 -1
  335. package/lib/esm/types/libs/protocols/index.d.ts +0 -53
  336. package/lib/esm/types/libs/protocols/index.d.ts.map +0 -1
  337. package/lib/esm/types/libs/protocols/kriya/index.d.ts +0 -9
  338. package/lib/esm/types/libs/protocols/kriya/index.d.ts.map +0 -1
  339. package/lib/esm/types/libs/protocols/kriyaV3/index.d.ts +0 -9
  340. package/lib/esm/types/libs/protocols/kriyaV3/index.d.ts.map +0 -1
  341. package/lib/esm/types/libs/protocols/magma/index.d.ts +0 -9
  342. package/lib/esm/types/libs/protocols/magma/index.d.ts.map +0 -1
  343. package/lib/esm/types/libs/protocols/momentum/index.d.ts +0 -9
  344. package/lib/esm/types/libs/protocols/momentum/index.d.ts.map +0 -1
  345. package/lib/esm/types/libs/protocols/obric/index.d.ts +0 -14
  346. package/lib/esm/types/libs/protocols/obric/index.d.ts.map +0 -1
  347. package/lib/esm/types/libs/protocols/sevenk/index.d.ts +0 -18
  348. package/lib/esm/types/libs/protocols/sevenk/index.d.ts.map +0 -1
  349. package/lib/esm/types/libs/protocols/springsui/index.d.ts +0 -9
  350. package/lib/esm/types/libs/protocols/springsui/index.d.ts.map +0 -1
  351. package/lib/esm/types/libs/protocols/steamm/index.d.ts +0 -28
  352. package/lib/esm/types/libs/protocols/steamm/index.d.ts.map +0 -1
  353. package/lib/esm/types/libs/protocols/stsui/index.d.ts +0 -9
  354. package/lib/esm/types/libs/protocols/stsui/index.d.ts.map +0 -1
  355. package/lib/esm/types/libs/protocols/suiswap/index.d.ts +0 -9
  356. package/lib/esm/types/libs/protocols/suiswap/index.d.ts.map +0 -1
  357. package/lib/esm/types/libs/protocols/turbos/index.d.ts +0 -9
  358. package/lib/esm/types/libs/protocols/turbos/index.d.ts.map +0 -1
  359. package/lib/esm/types/libs/protocols/utils.d.ts +0 -2
  360. package/lib/esm/types/libs/protocols/utils.d.ts.map +0 -1
  361. package/lib/esm/types/libs/swapWithRoute.d.ts +0 -12
  362. package/lib/esm/types/libs/swapWithRoute.d.ts.map +0 -1
  363. package/lib/esm/types/sui.js +0 -1
  364. package/lib/esm/types/tx.js +0 -1
  365. package/lib/esm/types/types/aggregator.d.ts +0 -173
  366. package/lib/esm/types/types/aggregator.d.ts.map +0 -1
  367. package/lib/esm/types/types/sui.d.ts +0 -4
  368. package/lib/esm/types/types/sui.d.ts.map +0 -1
  369. package/lib/esm/types/types/tx.d.ts +0 -67
  370. package/lib/esm/types/types/tx.d.ts.map +0 -1
  371. package/lib/esm/types/types/utilities.d.ts +0 -5
  372. package/lib/esm/types/types/utilities.d.ts.map +0 -1
  373. package/lib/esm/types/utilities.js +0 -1
  374. package/lib/esm/types/utils/condition.d.ts +0 -2
  375. package/lib/esm/types/utils/condition.d.ts.map +0 -1
  376. package/lib/esm/types/utils/number.d.ts +0 -2
  377. package/lib/esm/types/utils/number.d.ts.map +0 -1
  378. package/lib/esm/utils/condition.js +0 -5
  379. package/lib/esm/utils/number.js +0 -6
@@ -5,7 +5,7 @@ const sdk_1 = require("@flowx-finance/sdk");
5
5
  const uuid_1 = require("uuid");
6
6
  const _7k_1 = require("../../../constants/_7k");
7
7
  const metaAg_1 = require("../../../types/metaAg");
8
- const condition_1 = require("../../../utils/condition");
8
+ const error_1 = require("../error");
9
9
  class FlowxProvider {
10
10
  constructor(options, client) {
11
11
  this.options = options;
@@ -16,8 +16,8 @@ class FlowxProvider {
16
16
  async quote(quoteOptions) {
17
17
  const quote = await this.quoter.getRoutes({
18
18
  amountIn: quoteOptions.amountIn,
19
- tokenIn: quoteOptions.coinInType,
20
- tokenOut: quoteOptions.coinOutType,
19
+ tokenIn: quoteOptions.coinTypeIn,
20
+ tokenOut: quoteOptions.coinTypeOut,
21
21
  includeSources: this.options.sources,
22
22
  excludePools: this.options.excludePools,
23
23
  excludeSources: this.options.excludeSources,
@@ -31,12 +31,12 @@ class FlowxProvider {
31
31
  amountIn: quote.amountIn?.toString() ?? "0",
32
32
  rawAmountOut: quote.amountOut?.toString() ?? "0",
33
33
  amountOut: quote.amountOut?.toString() ?? "0",
34
- coinTypeIn: quoteOptions.coinInType,
35
- coinTypeOut: quoteOptions.coinOutType,
34
+ coinTypeIn: quoteOptions.coinTypeIn,
35
+ coinTypeOut: quoteOptions.coinTypeOut,
36
36
  };
37
37
  }
38
38
  async swap(options) {
39
- (0, condition_1.assert)(options.quote.provider === metaAg_1.EProvider.FLOWX, "Invalid quote");
39
+ error_1.MetaAgError.assert(options.quote.provider === metaAg_1.EProvider.FLOWX, "Invalid quote", error_1.MetaAgErrorCode.INVALID_QUOTE, { quote: options.quote, expectedProvider: metaAg_1.EProvider.FLOWX });
40
40
  const builder = new sdk_1.TradeBuilder("mainnet", options.quote.quote.routes);
41
41
  builder.sender(options.signer);
42
42
  builder.slippage(10000 * 100);
@@ -0,0 +1,182 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.simulateOKXSwap = exports.OkxProvider = void 0;
37
+ const transactions_1 = require("@mysten/sui/transactions");
38
+ const utils_1 = require("@mysten/sui/utils");
39
+ const uuid_1 = require("uuid");
40
+ const tokens_1 = require("../../../constants/tokens");
41
+ const metaAg_1 = require("../../../types/metaAg");
42
+ const sui_1 = require("../../../utils/sui");
43
+ const common_1 = require("../common");
44
+ const error_1 = require("../error");
45
+ const API = "https://web3.okx.com";
46
+ const SWAP_PATH = "/api/v6/dex/aggregator/swap";
47
+ const CHAIN_ID = "784";
48
+ const NORMALIZED_SUI_TYPE = (0, utils_1.normalizeStructTag)(tokens_1.SUI_TYPE);
49
+ class OkxProvider {
50
+ constructor(options, metaOptions, client) {
51
+ this.options = options;
52
+ this.metaOptions = metaOptions;
53
+ this.client = client;
54
+ this.kind = metaAg_1.EProvider.OKX;
55
+ }
56
+ async quote({ amountIn, coinTypeIn, coinTypeOut, signer, }) {
57
+ if (!signer || (0, sui_1.isSystemAddress)(signer))
58
+ return null;
59
+ const request = {
60
+ chainIndex: CHAIN_ID,
61
+ amount: amountIn,
62
+ fromTokenAddress: coinTypeIn === NORMALIZED_SUI_TYPE ? tokens_1.SUI_TYPE : coinTypeIn,
63
+ toTokenAddress: coinTypeOut === NORMALIZED_SUI_TYPE ? tokens_1.SUI_TYPE : coinTypeOut,
64
+ slippagePercent: (this.metaOptions.slippageBps / 100).toString(),
65
+ userWalletAddress: signer,
66
+ };
67
+ const queryString = "?" + new URLSearchParams(request).toString();
68
+ const url = `${this.options.api ?? API}${SWAP_PATH}${queryString}`;
69
+ const response = await fetch(url, {
70
+ headers: await getHeaders(this.options, "GET", SWAP_PATH, queryString),
71
+ });
72
+ const quote = (await response.json());
73
+ error_1.MetaAgError.assert(quote.code === "0" && quote.data.length > 0, "No quote found", error_1.MetaAgErrorCode.QUOTE_NOT_FOUND, { provider: this.kind });
74
+ return {
75
+ id: (0, uuid_1.v4)(),
76
+ provider: this.kind,
77
+ coinTypeIn,
78
+ coinTypeOut,
79
+ amountIn,
80
+ amountOut: quote.data[0].routerResult.toTokenAmount,
81
+ rawAmountOut: quote.data[0].routerResult.toTokenAmount,
82
+ quote: quote.data[0],
83
+ };
84
+ }
85
+ async fastSwap(options) {
86
+ const { quote, signer, signTransaction } = options;
87
+ error_1.MetaAgError.assert(quote.provider === metaAg_1.EProvider.OKX, "Invalid quote", error_1.MetaAgErrorCode.INVALID_QUOTE, { quote, expectedProvider: metaAg_1.EProvider.OKX });
88
+ const { tx, coin } = buildTx({ quote, signer });
89
+ tx.add((0, common_1.metaSettle)(quote, coin, this.metaOptions.slippageBps, this.metaOptions.tipBps, this.metaOptions.partner, this.metaOptions.partnerCommissionBps));
90
+ tx.transferObjects([coin], signer);
91
+ const txBytes = await tx.build({ client: this.client });
92
+ const { bytes, signature } = await signTransaction((0, utils_1.toBase64)(txBytes));
93
+ const res = await this.client.executeTransactionBlock({
94
+ signature,
95
+ transactionBlock: bytes,
96
+ });
97
+ return res.digest;
98
+ }
99
+ }
100
+ exports.OkxProvider = OkxProvider;
101
+ async function generateHmacSha256(message, secretKey) {
102
+ const encoder = new TextEncoder();
103
+ const encodeBase64 = (bytes) => {
104
+ if (typeof Buffer !== "undefined") {
105
+ return Buffer.from(bytes).toString("base64");
106
+ }
107
+ let binary = "";
108
+ for (let i = 0; i < bytes.byteLength; i++) {
109
+ binary += String.fromCharCode(bytes[i]);
110
+ }
111
+ if (typeof btoa !== "undefined") {
112
+ return btoa(binary);
113
+ }
114
+ throw new error_1.MetaAgError("Base64 encoder not available in this environment");
115
+ };
116
+ if (typeof globalThis !== "undefined" && globalThis.crypto?.subtle) {
117
+ const key = await globalThis.crypto.subtle.importKey("raw", encoder.encode(secretKey), { name: "HMAC", hash: "SHA-256" }, false, ["sign"]);
118
+ const signature = await globalThis.crypto.subtle.sign("HMAC", key, encoder.encode(message));
119
+ return encodeBase64(new Uint8Array(signature));
120
+ }
121
+ const { createHmac } = await Promise.resolve().then(() => __importStar(require("node:crypto")));
122
+ return createHmac("sha256", secretKey).update(message).digest("base64");
123
+ }
124
+ async function getHeaders(options, method, requestPath, queryString = "") {
125
+ const { apiKey, secretKey, apiPassphrase, projectId } = options;
126
+ if (!apiKey || !secretKey || !apiPassphrase || !projectId) {
127
+ throw new error_1.MetaAgError("Missing required environment variables");
128
+ }
129
+ const timestamp = new Date().toISOString();
130
+ const stringToSign = timestamp + method + requestPath + queryString;
131
+ return {
132
+ "Content-Type": "application/json",
133
+ "OK-ACCESS-KEY": apiKey,
134
+ "OK-ACCESS-SIGN": await generateHmacSha256(stringToSign, secretKey),
135
+ "OK-ACCESS-TIMESTAMP": timestamp,
136
+ "OK-ACCESS-PASSPHRASE": apiPassphrase,
137
+ "OK-ACCESS-PROJECT": projectId,
138
+ };
139
+ }
140
+ const replaceFinalizeCommand = (tx, packageId) => {
141
+ const builder = transactions_1.TransactionDataBuilder.restore(tx.getData());
142
+ const i = builder.commands.findIndex((cmd) => cmd.$kind === "MoveCall" &&
143
+ (0, utils_1.normalizeSuiAddress)(cmd.MoveCall.package) ===
144
+ (0, utils_1.normalizeSuiAddress)(packageId) &&
145
+ cmd.MoveCall.module === "router" &&
146
+ cmd.MoveCall.function === "finalize");
147
+ const cmd = builder.commands[i];
148
+ error_1.MetaAgError.assert(cmd.MoveCall, "OKX: Finalize command not found", error_1.MetaAgErrorCode.OKX_FINALIZE_COMMAND_NOT_FOUND, { packageId });
149
+ builder.replaceCommand(i, transactions_1.Commands.MoveCall({
150
+ package: packageId,
151
+ module: "router",
152
+ function: "finalize_without_transfer",
153
+ typeArguments: cmd.MoveCall.typeArguments,
154
+ arguments: [
155
+ cmd.MoveCall.arguments[0],
156
+ cmd.MoveCall.arguments[5],
157
+ cmd.MoveCall.arguments[6],
158
+ ],
159
+ }));
160
+ const tx2 = transactions_1.Transaction.from(builder.build());
161
+ return { tx: tx2, coin: { NestedResult: [i, 0] } };
162
+ };
163
+ const buildTx = (options) => {
164
+ const { quote, signer } = options;
165
+ error_1.MetaAgError.assert(quote.provider === metaAg_1.EProvider.OKX, "Invalid quote", error_1.MetaAgErrorCode.INVALID_QUOTE, { quote, expectedProvider: metaAg_1.EProvider.OKX });
166
+ const tx = transactions_1.Transaction.from(quote.quote.tx.data);
167
+ tx.setSenderIfNotSet(signer);
168
+ const { tx: tx2, coin } = replaceFinalizeCommand(tx, quote.quote.tx.to);
169
+ return { tx: tx2, coin };
170
+ };
171
+ const simulateOKXSwap = async (quote, inspector, simulation, metaOptions) => {
172
+ const { tx, coin } = buildTx({ quote, signer: quote.quote.tx.from });
173
+ tx.add((0, common_1.metaSettle)(quote, coin, 10000, metaOptions.tipBps, metaOptions.partner, metaOptions.partnerCommissionBps));
174
+ tx.transferObjects([coin], quote.quote.tx.from);
175
+ const res = await (0, common_1.simulateSwapTx)(tx, inspector, simulation);
176
+ return {
177
+ id: quote.id,
178
+ provider: quote.provider,
179
+ ...res,
180
+ };
181
+ };
182
+ exports.simulateOKXSwap = simulateOKXSwap;
@@ -7,16 +7,6 @@ const fetchClient_1 = require("../../config/fetchClient");
7
7
  const apiEndpoints_1 = require("../../constants/apiEndpoints");
8
8
  const tokens_1 = require("../../constants/tokens");
9
9
  const token_1 = require("../../utils/token");
10
- async function getTokenPrice(id, vsCoin = tokens_1.NATIVE_USDC_TOKEN_TYPE) {
11
- try {
12
- const response = await (0, fetchClient_1.fetchClient)(`${apiEndpoints_1.API_ENDPOINTS.PRICES}/price?ids=${(0, token_1.normalizeTokenType)(id)}&vsCoin=${vsCoin}`);
13
- const pricesRes = (await response.json());
14
- return Number(pricesRes?.[id]?.price || 0);
15
- }
16
- catch (_) {
17
- return 0;
18
- }
19
- }
20
10
  const chunkArray = (array, chunkSize) => {
21
11
  const chunks = [];
22
12
  for (let i = 0; i < array.length; i += chunkSize) {
@@ -26,30 +16,66 @@ const chunkArray = (array, chunkSize) => {
26
16
  };
27
17
  const MAX_TOTAL_IDS = 500;
28
18
  const MAX_IDS_PER_REQUEST = 100;
29
- async function getTokenPrices(ids, vsCoin = tokens_1.NATIVE_USDC_TOKEN_TYPE) {
19
+ /**
20
+ * Get the current Unix timestamp as a string
21
+ */
22
+ function getCurrentTimestamp() {
23
+ return Math.floor(Date.now() / 1000).toString();
24
+ }
25
+ /**
26
+ * Get price for a single token
27
+ * @param id - Token ID (coin type)
28
+ * @returns Token price, or 0 if not found or on error
29
+ */
30
+ async function getTokenPrice(id) {
31
+ try {
32
+ const normalizedId = (0, token_1.normalizeTokenType)(id);
33
+ const prices = await getTokenPrices([normalizedId]);
34
+ return prices[normalizedId] || 0;
35
+ }
36
+ catch (_) {
37
+ return 0;
38
+ }
39
+ }
40
+ /**
41
+ * Get prices for multiple tokens
42
+ * @param ids - Array of token IDs (coin types)
43
+ * @returns Record mapping token IDs to their prices
44
+ */
45
+ async function getTokenPrices(ids) {
30
46
  try {
47
+ if (ids.length === 0) {
48
+ return {};
49
+ }
31
50
  const limitedIds = ids.slice(0, MAX_TOTAL_IDS).map(token_1.normalizeTokenType);
32
51
  const idChunks = chunkArray(limitedIds, MAX_IDS_PER_REQUEST);
52
+ const timestamp = getCurrentTimestamp();
33
53
  const responses = await Promise.all(idChunks.map(async (chunk) => {
34
- const response = await (0, fetchClient_1.fetchClient)(`${apiEndpoints_1.API_ENDPOINTS.PRICES}/price`, {
54
+ const requestBody = {
55
+ timestamp,
56
+ token_ids: chunk,
57
+ };
58
+ const response = await (0, fetchClient_1.fetchClient)(`${apiEndpoints_1.API_ENDPOINTS.PRICES}/prices/batch`, {
35
59
  method: "POST",
36
60
  headers: {
37
61
  "Content-Type": "application/json",
38
62
  },
39
- body: JSON.stringify({
40
- ids: chunk,
41
- vsCoin,
42
- }),
63
+ body: JSON.stringify(requestBody),
43
64
  });
65
+ if (!response.ok) {
66
+ throw new Error(`Price API returned status ${response.status}`);
67
+ }
44
68
  const pricesRes = (await response.json());
45
69
  return pricesRes;
46
70
  }));
47
- const combinedPrices = responses.reduce((acc, pricesRes) => {
48
- Object.keys(pricesRes).forEach((id) => {
49
- acc[id] = Number(pricesRes[id]?.price || 0);
71
+ // Combine all responses into a single record
72
+ const combinedPrices = responses.reduce((acc, priceResponses) => {
73
+ priceResponses.forEach((priceResponse) => {
74
+ acc[priceResponse.token_id] = priceResponse.price;
50
75
  });
51
76
  return acc;
52
77
  }, {});
78
+ // Ensure all requested IDs are in the result (set to 0 if not found)
53
79
  const finalPrices = limitedIds.reduce((acc, id) => {
54
80
  acc[id] = combinedPrices[id] || 0;
55
81
  return acc;
@@ -57,12 +83,17 @@ async function getTokenPrices(ids, vsCoin = tokens_1.NATIVE_USDC_TOKEN_TYPE) {
57
83
  return finalPrices;
58
84
  }
59
85
  catch (_) {
86
+ // On error, return 0 for all requested IDs
60
87
  return ids.slice(0, MAX_TOTAL_IDS).reduce((acc, id) => {
61
- acc[id] = 0;
88
+ acc[(0, token_1.normalizeTokenType)(id)] = 0;
62
89
  return acc;
63
90
  }, {});
64
91
  }
65
92
  }
93
+ /**
94
+ * Get the current SUI token price
95
+ * @returns SUI price, or 0 if not found or on error
96
+ */
66
97
  async function getSuiPrice() {
67
98
  return await getTokenPrice(tokens_1.SUI_FULL_TYPE);
68
99
  }
package/lib/cjs/index.js CHANGED
@@ -14,28 +14,14 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.setSuiClient = exports.placeLimitOrder = exports.placeDcaOrder = exports.multiSwap = exports.MetaAg = exports.getTokenPrices = exports.getTokenPrice = exports.getSwapHistory = exports.getSuiPrice = exports.getSuiClient = exports.getQuote = exports.getOpenLimitOrders = exports.getOpenDcaOrders = exports.getDcaOrderExecutions = exports.getClosedLimitOrders = exports.getClosedDcaOrders = exports.executeTx = exports.executeBluefinTx = exports.estimateGasFee = exports.DEFAULT_SOURCES = exports.Config = exports.claimExpiredLimitOrder = exports.cancelLimitOrder = exports.cancelDcaOrder = exports.buildTxV2 = exports.buildTx = void 0;
18
- __exportStar(require("./types/aggregator"), exports);
17
+ exports.placeLimitOrder = exports.placeDcaOrder = exports.getTokenPrices = exports.getTokenPrice = exports.getSuiPrice = exports.getOpenLimitOrders = exports.getOpenDcaOrders = exports.getDcaOrderExecutions = exports.getClosedLimitOrders = exports.getClosedDcaOrders = exports.claimExpiredLimitOrder = exports.cancelLimitOrder = exports.cancelDcaOrder = exports.MetaAg = void 0;
19
18
  __exportStar(require("./types/metaAg"), exports);
20
- const config_1 = require("./config");
21
- Object.defineProperty(exports, "Config", { enumerable: true, get: function () { return config_1.Config; } });
22
19
  const metaAg_1 = require("./features/metaAg");
23
20
  Object.defineProperty(exports, "MetaAg", { enumerable: true, get: function () { return metaAg_1.MetaAg; } });
24
21
  const prices_1 = require("./features/prices");
25
22
  Object.defineProperty(exports, "getSuiPrice", { enumerable: true, get: function () { return prices_1.getSuiPrice; } });
26
23
  Object.defineProperty(exports, "getTokenPrice", { enumerable: true, get: function () { return prices_1.getTokenPrice; } });
27
24
  Object.defineProperty(exports, "getTokenPrices", { enumerable: true, get: function () { return prices_1.getTokenPrices; } });
28
- const client_1 = require("./libs/protocols/bluefinx/client");
29
- Object.defineProperty(exports, "executeBluefinTx", { enumerable: true, get: function () { return client_1.executeBluefinTx; } });
30
- const swap_1 = require("./features/swap");
31
- Object.defineProperty(exports, "buildTx", { enumerable: true, get: function () { return swap_1.buildTx; } });
32
- Object.defineProperty(exports, "buildTxV2", { enumerable: true, get: function () { return swap_1.buildTxV2; } });
33
- Object.defineProperty(exports, "DEFAULT_SOURCES", { enumerable: true, get: function () { return swap_1.DEFAULT_SOURCES; } });
34
- Object.defineProperty(exports, "estimateGasFee", { enumerable: true, get: function () { return swap_1.estimateGasFee; } });
35
- Object.defineProperty(exports, "executeTx", { enumerable: true, get: function () { return swap_1.executeTx; } });
36
- Object.defineProperty(exports, "getQuote", { enumerable: true, get: function () { return swap_1.getQuote; } });
37
- Object.defineProperty(exports, "getSwapHistory", { enumerable: true, get: function () { return swap_1.getSwapHistory; } });
38
- Object.defineProperty(exports, "multiSwap", { enumerable: true, get: function () { return swap_1.multiSwap; } });
39
25
  const limitDca_1 = require("./features/limitDca");
40
26
  Object.defineProperty(exports, "cancelDcaOrder", { enumerable: true, get: function () { return limitDca_1.cancelDcaOrder; } });
41
27
  Object.defineProperty(exports, "cancelLimitOrder", { enumerable: true, get: function () { return limitDca_1.cancelLimitOrder; } });
@@ -47,31 +33,11 @@ Object.defineProperty(exports, "getOpenDcaOrders", { enumerable: true, get: func
47
33
  Object.defineProperty(exports, "getOpenLimitOrders", { enumerable: true, get: function () { return limitDca_1.getOpenLimitOrders; } });
48
34
  Object.defineProperty(exports, "placeDcaOrder", { enumerable: true, get: function () { return limitDca_1.placeDcaOrder; } });
49
35
  Object.defineProperty(exports, "placeLimitOrder", { enumerable: true, get: function () { return limitDca_1.placeLimitOrder; } });
50
- // avoid breaking changes
51
- const getSuiClient = config_1.Config.getSuiClient;
52
- exports.getSuiClient = getSuiClient;
53
- const setSuiClient = config_1.Config.setSuiClient;
54
- exports.setSuiClient = setSuiClient;
55
36
  exports.default = {
56
- // config
57
- Config: config_1.Config,
58
- // sui client
59
- getSuiClient,
60
- setSuiClient,
61
37
  // prices
62
38
  getTokenPrice: prices_1.getTokenPrice,
63
39
  getTokenPrices: prices_1.getTokenPrices,
64
40
  getSuiPrice: prices_1.getSuiPrice,
65
- // swap
66
- getQuote: swap_1.getQuote,
67
- estimateGasFee: swap_1.estimateGasFee,
68
- buildTx: swap_1.buildTx,
69
- buildTxV2: swap_1.buildTxV2,
70
- multiSwap: swap_1.multiSwap,
71
- getSwapHistory: swap_1.getSwapHistory,
72
- executeTx: swap_1.executeTx,
73
- executeBluefinTx: client_1.executeBluefinTx,
74
- DEFAULT_SOURCES: swap_1.DEFAULT_SOURCES,
75
41
  // limit order
76
42
  placeLimitOrder: limitDca_1.placeLimitOrder,
77
43
  getOpenLimitOrders: limitDca_1.getOpenLimitOrders,
@@ -1 +1 @@
1
- {"version":3,"file":"fetchClient.d.ts","sourceRoot":"","sources":["../../../../src/config/fetchClient.ts"],"names":[],"mappings":"AAEA,wBAAsB,WAAW,CAC/B,KAAK,EAAE,MAAM,EACb,IAAI,CAAC,EAAE,WAAW,GACjB,OAAO,CAAC,QAAQ,CAAC,CAkBnB"}
1
+ {"version":3,"file":"fetchClient.d.ts","sourceRoot":"","sources":["../../../../src/config/fetchClient.ts"],"names":[],"mappings":"AAAA,wBAAsB,WAAW,CAC/B,KAAK,EAAE,MAAM,EACb,IAAI,CAAC,EAAE,WAAW,GACjB,OAAO,CAAC,QAAQ,CAAC,CAUnB"}
@@ -1,6 +1,3 @@
1
- export declare const _7K_PACKAGE_ID = "0x62412b7268c35f3808336aee57a52836501f40b8ba5d936f8ad275e672befd04";
2
- export declare const _7K_CONFIG = "0x47442a93f7727d188ba7cb71031170d1786af70013cb7ad5115f3fe877ff0c54";
3
- export declare const _7K_VAULT = "0x442ad50389ed5cda6f7a6f5a7ae6361a4c05ef1d9fb2e54fbba5a268d690bfe6";
4
1
  export declare const _7K_META_PUBLISHED_AT = "0x17c0b1f7a6ad73f51268f16b8c06c049eecc2f28a270cdd29c06e3d2dea23302";
5
2
  export declare const _7K_META_PACKAGE_ID = "0x17c0b1f7a6ad73f51268f16b8c06c049eecc2f28a270cdd29c06e3d2dea23302";
6
3
  export declare const _7K_META_VAULT = "0x9a8abd32fe5721307ce3b697cf982ee84e9ffbd58d667a4a199f1683c1a3d23c";
@@ -1 +1 @@
1
- {"version":3,"file":"_7k.d.ts","sourceRoot":"","sources":["../../../../src/constants/_7k.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,uEAC2C,CAAC;AAKvE,eAAO,MAAM,UAAU,uEAC+C,CAAC;AAGvE,eAAO,MAAM,SAAS,uEACgD,CAAC;AAEvE,eAAO,MAAM,qBAAqB,uEACoC,CAAC;AACvE,eAAO,MAAM,mBAAmB,uEACsC,CAAC;AACvE,eAAO,MAAM,cAAc,uEAC2C,CAAC;AACvE,eAAO,MAAM,eAAe,uEAC0C,CAAC;AACvE,eAAO,MAAM,mBAAmB,uEACsC,CAAC"}
1
+ {"version":3,"file":"_7k.d.ts","sourceRoot":"","sources":["../../../../src/constants/_7k.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,qBAAqB,uEACoC,CAAC;AACvE,eAAO,MAAM,mBAAmB,uEACsC,CAAC;AACvE,eAAO,MAAM,cAAc,uEAC2C,CAAC;AACvE,eAAO,MAAM,eAAe,uEAC0C,CAAC;AACvE,eAAO,MAAM,mBAAmB,uEACsC,CAAC"}
@@ -0,0 +1,24 @@
1
+ import { Transaction, TransactionObjectArgument } from "@mysten/sui/transactions";
2
+ import { AggregatorProvider, MetaAgOptions, MetaQuote, MetaSimulationOptions } from "../../types/metaAg";
3
+ import { SuiClientUtils } from "../../utils/SuiClientUtils";
4
+ export declare const simulateSwapTx: (tx: Transaction, inspector: SuiClientUtils, simulation: MetaSimulationOptions) => Promise<{
5
+ simulatedAmountOut: string;
6
+ gasUsed: import("@mysten/sui/client").GasCostSummary;
7
+ }>;
8
+ export declare const simulateAggregator: (provider: AggregatorProvider, quote: MetaQuote, simulation: MetaSimulationOptions, inspector: SuiClientUtils, options: Required<MetaAgOptions>) => Promise<{
9
+ simulatedAmountOut: string;
10
+ gasUsed: import("@mysten/sui/client").GasCostSummary;
11
+ id: string;
12
+ provider: import("../../types/metaAg").EProvider.BLUEFIN7K | import("../../types/metaAg").EProvider.CETUS | import("../../types/metaAg").EProvider.FLOWX;
13
+ }>;
14
+ /**
15
+ * this settlement does not charge commission fee for partner, since all integrated aggregators already charge commission fee for partner
16
+ * @param quote Meta Aggregator Quote
17
+ * @param coinOut Coin Out Object
18
+ * @param slippageBps Slippage Bps
19
+ * @param tipBps Tip Bps default = 0
20
+ * @param partner address of partner for analytic default is zero address
21
+ */
22
+ export declare const metaSettle: (quote: MetaQuote, coinOut: TransactionObjectArgument, slippageBps?: number, tipBps?: number, partner?: string, commissionBps?: number) => (tx: Transaction) => void;
23
+ export declare const timeout: <T = any>(fn: () => Promise<T>, timeout: number, msg?: string) => Promise<T>;
24
+ //# sourceMappingURL=common.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../../src/features/metaAg/common.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,WAAW,EACX,yBAAyB,EAC1B,MAAM,0BAA0B,CAAC;AAOlC,OAAO,EACL,kBAAkB,EAClB,aAAa,EACb,SAAS,EACT,qBAAqB,EACtB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAI5D,eAAO,MAAM,cAAc,GACzB,IAAI,WAAW,EACf,WAAW,cAAc,EACzB,YAAY,qBAAqB;wBAmBE,MAAM;;EAG1C,CAAC;AACF,eAAO,MAAM,kBAAkB,GAC7B,UAAU,kBAAkB,EAC5B,OAAO,SAAS,EAChB,YAAY,qBAAqB,EACjC,WAAW,cAAc,EACzB,SAAS,QAAQ,CAAC,aAAa,CAAC;wBATG,MAAM;;;;EAuC1C,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,UAAU,GACrB,OAAO,SAAS,EAChB,SAAS,yBAAyB,EAClC,oBAAiB,EACjB,eAAU,EACV,UAAU,MAAM,EAChB,sBAAiB,MAET,IAAI,WAAW,SAqCxB,CAAC;AASF,eAAO,MAAM,OAAO,GAAU,CAAC,GAAG,GAAG,EACnC,IAAI,MAAM,OAAO,CAAC,CAAC,CAAC,EACpB,SAAS,MAAM,EACf,MAAM,MAAM,eAoBb,CAAC"}
@@ -0,0 +1,54 @@
1
+ import { DevInspectResults } from "@mysten/sui/client";
2
+ import { EProvider, MetaQuote, MetaQuoteOptions } from "../../types/metaAg";
3
+ export declare enum MetaAgErrorCode {
4
+ UNKNOWN = 1000,
5
+ TIMEOUT = 1001,
6
+ PROVIDER_NOT_FOUND = 1002,
7
+ PROVIDER_NOT_SUPPORTED = 1003,
8
+ INVALID_QUOTE = 1004,
9
+ QUOTE_NOT_FOUND = 1005,
10
+ INVALID_SIGNER_ADDRESS = 1006,
11
+ PROVIDER_NOT_SUPPORT_SWAP = 1007,
12
+ SIMULATION_FAILED = 1008,
13
+ OKX_FINALIZE_COMMAND_NOT_FOUND = 1100
14
+ }
15
+ export type MetaAgErrorDetailsMap = {
16
+ [MetaAgErrorCode.UNKNOWN]: any;
17
+ [MetaAgErrorCode.TIMEOUT]: {
18
+ timeout: number;
19
+ };
20
+ [MetaAgErrorCode.PROVIDER_NOT_FOUND]: {
21
+ provider: EProvider;
22
+ };
23
+ [MetaAgErrorCode.PROVIDER_NOT_SUPPORTED]: {
24
+ provider: EProvider;
25
+ };
26
+ [MetaAgErrorCode.INVALID_QUOTE]: {
27
+ quote: MetaQuote;
28
+ expectedProvider: EProvider;
29
+ };
30
+ [MetaAgErrorCode.QUOTE_NOT_FOUND]: {
31
+ provider: EProvider;
32
+ quoteOptions?: MetaQuoteOptions;
33
+ };
34
+ [MetaAgErrorCode.INVALID_SIGNER_ADDRESS]: {
35
+ signer: string;
36
+ };
37
+ [MetaAgErrorCode.PROVIDER_NOT_SUPPORT_SWAP]: {
38
+ provider: EProvider;
39
+ };
40
+ [MetaAgErrorCode.SIMULATION_FAILED]: {
41
+ error: DevInspectResults["error"];
42
+ };
43
+ [MetaAgErrorCode.OKX_FINALIZE_COMMAND_NOT_FOUND]: {
44
+ packageId: string;
45
+ };
46
+ };
47
+ export type MetaAgErrorDetails<T extends MetaAgErrorCode> = T extends keyof MetaAgErrorDetailsMap ? MetaAgErrorDetailsMap[T] : never;
48
+ export declare class MetaAgError<T extends MetaAgErrorCode> extends Error {
49
+ code: T;
50
+ details?: MetaAgErrorDetails<T>;
51
+ constructor(message: string, code?: T, details?: MetaAgErrorDetails<T>);
52
+ static assert<T extends MetaAgErrorCode>(condition: any, message?: string | null, code?: T, details?: MetaAgErrorDetails<T>): asserts condition;
53
+ }
54
+ //# sourceMappingURL=error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../../../../src/features/metaAg/error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE5E,oBAAY,eAAe;IACzB,OAAO,OAAO;IACd,OAAO,OAAO;IACd,kBAAkB,OAAO;IACzB,sBAAsB,OAAO;IAC7B,aAAa,OAAO;IACpB,eAAe,OAAO;IACtB,sBAAsB,OAAO;IAC7B,yBAAyB,OAAO;IAChC,iBAAiB,OAAO;IAExB,8BAA8B,OAAO;CACtC;AAED,MAAM,MAAM,qBAAqB,GAAG;IAClC,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,GAAG,CAAC;IAC/B,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAC/C,CAAC,eAAe,CAAC,kBAAkB,CAAC,EAAE;QAAE,QAAQ,EAAE,SAAS,CAAA;KAAE,CAAC;IAC9D,CAAC,eAAe,CAAC,sBAAsB,CAAC,EAAE;QAAE,QAAQ,EAAE,SAAS,CAAA;KAAE,CAAC;IAClE,CAAC,eAAe,CAAC,aAAa,CAAC,EAAE;QAC/B,KAAK,EAAE,SAAS,CAAC;QACjB,gBAAgB,EAAE,SAAS,CAAC;KAC7B,CAAC;IACF,CAAC,eAAe,CAAC,eAAe,CAAC,EAAE;QACjC,QAAQ,EAAE,SAAS,CAAC;QACpB,YAAY,CAAC,EAAE,gBAAgB,CAAC;KACjC,CAAC;IACF,CAAC,eAAe,CAAC,sBAAsB,CAAC,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAC7D,CAAC,eAAe,CAAC,yBAAyB,CAAC,EAAE;QAAE,QAAQ,EAAE,SAAS,CAAA;KAAE,CAAC;IACrE,CAAC,eAAe,CAAC,iBAAiB,CAAC,EAAE;QAAE,KAAK,EAAE,iBAAiB,CAAC,OAAO,CAAC,CAAA;KAAE,CAAC;IAE3E,CAAC,eAAe,CAAC,8BAA8B,CAAC,EAAE;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC;CACzE,CAAC;AAEF,MAAM,MAAM,kBAAkB,CAAC,CAAC,SAAS,eAAe,IACtD,CAAC,SAAS,MAAM,qBAAqB,GAAG,qBAAqB,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;AAE3E,qBAAa,WAAW,CAAC,CAAC,SAAS,eAAe,CAAE,SAAQ,KAAK;IAC/D,IAAI,EAAE,CAAC,CAAC;IACR,OAAO,CAAC,EAAE,kBAAkB,CAAC,CAAC,CAAC,CAAC;gBACpB,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,EAAE,kBAAkB,CAAC,CAAC,CAAC;IAOtE,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,eAAe,EACrC,SAAS,EAAE,GAAG,EACd,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,EACvB,IAAI,CAAC,EAAE,CAAC,EACR,OAAO,CAAC,EAAE,kBAAkB,CAAC,CAAC,CAAC,GAC9B,OAAO,CAAC,SAAS;CAKrB"}
@@ -1,6 +1,6 @@
1
- import { SuiClient } from "@mysten/sui/client";
1
+ import { GetTransactionBlockParams, SuiClient, SuiTransactionBlockResponse } from "@mysten/sui/client";
2
2
  import { TransactionObjectArgument } from "@mysten/sui/transactions";
3
- import { MetaAgOptions, MetaQuote, MetaQuoteOptions, MetaSimulationOptions, MetaSwapOptions } from "../../types/metaAg";
3
+ import { MetaAgOptions, MetaFastSwapOptions, MetaQuote, MetaQuoteOptions, MetaSimulationOptions, MetaSwapOptions } from "../../types/metaAg";
4
4
  export declare class MetaAg {
5
5
  client: SuiClient;
6
6
  private providers;
@@ -10,6 +10,7 @@ export declare class MetaAg {
10
10
  private _getProvider;
11
11
  private _simulate;
12
12
  private _quote;
13
+ private _fastSwap;
13
14
  /**
14
15
  * Get quotes from all providers
15
16
  * @param options - quote options
@@ -19,11 +20,19 @@ export declare class MetaAg {
19
20
  quote(options: MetaQuoteOptions, simulation?: MetaSimulationOptions): Promise<MetaQuote[]>;
20
21
  /**
21
22
  * Build transaction from quote
23
+ * @info Use this function to build composable transaction (ie: add more commands after the swap, consume the coin out object)
24
+ * @warning Providers that build transaction on the fly (typically RFQ, Swap-API providers ie: Okx, ...) are not supported, please use `fastSwap` instead
22
25
  * @param options - build tx options
23
26
  * @param slippageBps - slippage bps if not specified, fallback to global slippage bps, if none of them specified, default to 100
24
27
  * @returns coin out object, you must consume it by transferObjects, or other sub sequence commands
25
28
  */
26
29
  swap(options: MetaSwapOptions, slippageBps?: number): Promise<TransactionObjectArgument>;
30
+ /**
31
+ * Build, Sign, and Execute transaction in one step
32
+ * @param options - fast swap options
33
+ * @returns - txDigest of the transaction
34
+ */
35
+ fastSwap(options: MetaFastSwapOptions, getTransactionBlockParams?: Omit<GetTransactionBlockParams, "digest">): Promise<SuiTransactionBlockResponse>;
27
36
  /**
28
37
  * Update meta aggregator options
29
38
  * @param options - update options payload
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/metaAg/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,SAAS,EAAY,MAAM,oBAAoB,CAAC;AACzE,OAAO,EAGL,yBAAyB,EAC1B,MAAM,0BAA0B,CAAC;AASlC,OAAO,EAML,aAAa,EACb,SAAS,EACT,gBAAgB,EAChB,qBAAqB,EACrB,eAAe,EAChB,MAAM,oBAAoB,CAAC;AAa5B,qBAAa,MAAM;IACjB,MAAM,EAAE,SAAS,CAAC;IAClB,OAAO,CAAC,SAAS,CAA8C;IAC/D,OAAO,CAAC,SAAS,CAAiB;IAClC,OAAO,CAAC,OAAO,CAA0B;gBAC7B,OAAO,CAAC,EAAE,aAAa;YAkBrB,YAAY;YAuCZ,SAAS;YAqDT,MAAM;IAoCpB;;;;;OAKG;IACG,KAAK,CACT,OAAO,EAAE,gBAAgB,EACzB,UAAU,CAAC,EAAE,qBAAqB,GACjC,OAAO,CAAC,SAAS,EAAE,CAAC;IAuBvB;;;;;OAKG;IACG,IAAI,CACR,OAAO,EAAE,eAAe,EACxB,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,yBAAyB,CAAC;IAkBrC;;;OAGG;IACH,mBAAmB,CAAC,OAAO,EAAE,aAAa;CA4B3C"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/metaAg/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,yBAAyB,EACzB,SAAS,EACT,2BAA2B,EAC5B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAGL,yBAAyB,EAC1B,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EAOL,aAAa,EACb,mBAAmB,EACnB,SAAS,EACT,gBAAgB,EAChB,qBAAqB,EACrB,eAAe,EAGhB,MAAM,oBAAoB,CAAC;AAgB5B,qBAAa,MAAM;IACjB,MAAM,EAAE,SAAS,CAAC;IAClB,OAAO,CAAC,SAAS,CAAiD;IAClE,OAAO,CAAC,SAAS,CAAiB;IAClC,OAAO,CAAC,OAAO,CAA0B;gBAC7B,OAAO,CAAC,EAAE,aAAa;YAkBrB,YAAY;YA0DZ,SAAS;YAoCT,MAAM;YAqBN,SAAS;IA2BvB;;;;;OAKG;IACG,KAAK,CACT,OAAO,EAAE,gBAAgB,EACzB,UAAU,CAAC,EAAE,qBAAqB,GACjC,OAAO,CAAC,SAAS,EAAE,CAAC;IAsCvB;;;;;;;OAOG;IACG,IAAI,CACR,OAAO,EAAE,eAAe,EACxB,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,yBAAyB,CAAC;IAmCrC;;;;OAIG;IACG,QAAQ,CACZ,OAAO,EAAE,mBAAmB,EAC5B,yBAAyB,CAAC,EAAE,IAAI,CAAC,yBAAyB,EAAE,QAAQ,CAAC,GACpE,OAAO,CAAC,2BAA2B,CAAC;IAwBvC;;;OAGG;IACH,mBAAmB,CAAC,OAAO,EAAE,aAAa;CA4B3C"}
@@ -0,0 +1,11 @@
1
+ import { SuiClient } from "@mysten/sui/client";
2
+ import { AggregatorProvider, Bluefin7kProviderOptions, EProvider, MetaAgOptions, MetaQuote, MetaQuoteOptions, MetaSwapOptions, QuoteProvider } from "../../../types/metaAg";
3
+ export declare class Bluefin7kProvider implements QuoteProvider, AggregatorProvider {
4
+ private readonly options;
5
+ private readonly metaOptions;
6
+ readonly kind = EProvider.BLUEFIN7K;
7
+ constructor(options: Bluefin7kProviderOptions, metaOptions: Required<MetaAgOptions>, client: SuiClient);
8
+ quote(quoteOptions: MetaQuoteOptions): Promise<MetaQuote>;
9
+ swap({ quote, signer, tx, coinIn }: MetaSwapOptions): Promise<import("@mysten/sui/dist/cjs/transactions").TransactionObjectArgument>;
10
+ }
11
+ //# sourceMappingURL=bluefin7k.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bluefin7k.d.ts","sourceRoot":"","sources":["../../../../../../src/features/metaAg/providers/bluefin7k.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAG/C,OAAO,EACL,kBAAkB,EAClB,wBAAwB,EACxB,SAAS,EACT,aAAa,EACb,SAAS,EACT,gBAAgB,EAChB,eAAe,EACf,aAAa,EACd,MAAM,uBAAuB,CAAC;AAG/B,qBAAa,iBAAkB,YAAW,aAAa,EAAE,kBAAkB;IAGvE,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,WAAW;IAH9B,QAAQ,CAAC,IAAI,uBAAuB;gBAEjB,OAAO,EAAE,wBAAwB,EACjC,WAAW,EAAE,QAAQ,CAAC,aAAa,CAAC,EACrD,MAAM,EAAE,SAAS;IAMb,KAAK,CAAC,YAAY,EAAE,gBAAgB,GAAG,OAAO,CAAC,SAAS,CAAC;IA2BzD,IAAI,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,eAAe;CAsB1D"}
@@ -1,12 +1,11 @@
1
1
  import { SuiClient } from "@mysten/sui/client";
2
- import { TransactionObjectArgument } from "@mysten/sui/transactions";
3
- import { AgProvider, CetusProviderOptions, EProvider, MetaAgOptions, MetaQuote, MetaQuoteOptions, MetaSwapOptions } from "../../../types/metaAg";
4
- export declare class CetusProvider implements AgProvider {
2
+ import { AggregatorProvider, CetusProviderOptions, EProvider, MetaAgOptions, MetaQuote, MetaQuoteOptions, MetaSwapOptions, QuoteProvider } from "../../../types/metaAg";
3
+ export declare class CetusProvider implements QuoteProvider, AggregatorProvider {
5
4
  private readonly options;
6
- kind: EProvider;
5
+ readonly kind = EProvider.CETUS;
7
6
  private readonly cetusClient;
8
7
  constructor(options: CetusProviderOptions, metaOptions: MetaAgOptions, client: SuiClient);
9
8
  quote(quoteOptions: MetaQuoteOptions): Promise<MetaQuote>;
10
- swap(options: MetaSwapOptions): Promise<TransactionObjectArgument>;
9
+ swap(options: MetaSwapOptions): Promise<import("@mysten/sui/dist/cjs/transactions").TransactionObjectArgument>;
11
10
  }
12
11
  //# sourceMappingURL=cetus.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"cetus.d.ts","sourceRoot":"","sources":["../../../../../../src/features/metaAg/providers/cetus.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAGrE,OAAO,EACL,UAAU,EACV,oBAAoB,EACpB,SAAS,EACT,aAAa,EACb,SAAS,EACT,gBAAgB,EAChB,eAAe,EAChB,MAAM,uBAAuB,CAAC;AAG/B,qBAAa,aAAc,YAAW,UAAU;IAI5C,OAAO,CAAC,QAAQ,CAAC,OAAO;IAH1B,IAAI,YAAmB;IACvB,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAmB;gBAE5B,OAAO,EAAE,oBAAoB,EAC9C,WAAW,EAAE,aAAa,EAC1B,MAAM,EAAE,SAAS;IAab,KAAK,CAAC,YAAY,EAAE,gBAAgB,GAAG,OAAO,CAAC,SAAS,CAAC;IA0BzD,IAAI,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,yBAAyB,CAAC;CAUzE"}
1
+ {"version":3,"file":"cetus.d.ts","sourceRoot":"","sources":["../../../../../../src/features/metaAg/providers/cetus.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAG/C,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,SAAS,EACT,aAAa,EACb,SAAS,EACT,gBAAgB,EAChB,eAAe,EACf,aAAa,EACd,MAAM,uBAAuB,CAAC;AAG/B,qBAAa,aAAc,YAAW,aAAa,EAAE,kBAAkB;IAInE,OAAO,CAAC,QAAQ,CAAC,OAAO;IAH1B,QAAQ,CAAC,IAAI,mBAAmB;IAChC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAmB;gBAE5B,OAAO,EAAE,oBAAoB,EAC9C,WAAW,EAAE,aAAa,EAC1B,MAAM,EAAE,SAAS;IAab,KAAK,CAAC,YAAY,EAAE,gBAAgB,GAAG,OAAO,CAAC,SAAS,CAAC;IA+BzD,IAAI,CAAC,OAAO,EAAE,eAAe;CAepC"}
@@ -1,10 +1,10 @@
1
1
  import { SuiClient } from "@mysten/sui/client";
2
2
  import { TransactionObjectArgument } from "@mysten/sui/transactions";
3
- import { AgProvider, EProvider, FlowxProviderOptions, MetaQuote, MetaQuoteOptions, MetaSwapOptions } from "../../../types/metaAg";
4
- export declare class FlowxProvider implements AgProvider {
3
+ import { AggregatorProvider, EProvider, FlowxProviderOptions, MetaQuote, MetaQuoteOptions, MetaSwapOptions, QuoteProvider } from "../../../types/metaAg";
4
+ export declare class FlowxProvider implements QuoteProvider, AggregatorProvider {
5
5
  private readonly options;
6
6
  private readonly client;
7
- kind: EProvider;
7
+ readonly kind = EProvider.FLOWX;
8
8
  private quoter;
9
9
  constructor(options: FlowxProviderOptions, client: SuiClient);
10
10
  quote(quoteOptions: MetaQuoteOptions): Promise<MetaQuote>;
@@ -1 +1 @@
1
- {"version":3,"file":"flowx.d.ts","sourceRoot":"","sources":["../../../../../../src/features/metaAg/providers/flowx.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAGrE,OAAO,EACL,UAAU,EACV,SAAS,EACT,oBAAoB,EACpB,SAAS,EACT,gBAAgB,EAChB,eAAe,EAChB,MAAM,uBAAuB,CAAC;AAG/B,qBAAa,aAAc,YAAW,UAAU;IAI5C,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,MAAM;IAJzB,IAAI,YAAmB;IACvB,OAAO,CAAC,MAAM,CAAmB;gBAEd,OAAO,EAAE,oBAAoB,EAC7B,MAAM,EAAE,SAAS;IAK9B,KAAK,CAAC,YAAY,EAAE,gBAAgB,GAAG,OAAO,CAAC,SAAS,CAAC;IAuBzD,IAAI,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,yBAAyB,CAAC;CAqBzE"}
1
+ {"version":3,"file":"flowx.d.ts","sourceRoot":"","sources":["../../../../../../src/features/metaAg/providers/flowx.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAGrE,OAAO,EACL,kBAAkB,EAClB,SAAS,EACT,oBAAoB,EACpB,SAAS,EACT,gBAAgB,EAChB,eAAe,EACf,aAAa,EACd,MAAM,uBAAuB,CAAC;AAG/B,qBAAa,aAAc,YAAW,aAAa,EAAE,kBAAkB;IAInE,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,MAAM;IAJzB,QAAQ,CAAC,IAAI,mBAAmB;IAChC,OAAO,CAAC,MAAM,CAAmB;gBAEd,OAAO,EAAE,oBAAoB,EAC7B,MAAM,EAAE,SAAS;IAK9B,KAAK,CAAC,YAAY,EAAE,gBAAgB,GAAG,OAAO,CAAC,SAAS,CAAC;IAuBzD,IAAI,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,yBAAyB,CAAC;CA0BzE"}
@@ -0,0 +1,21 @@
1
+ import { SuiClient } from "@mysten/sui/client";
2
+ import { EProvider, MetaAgOptions, MetaFastSwapOptions, MetaQuote, MetaQuoteOptions, MetaSimulationOptions, OkxProviderOptions, QuoteProvider, SwapAPIProvider } from "../../../types/metaAg";
3
+ import { SuiClientUtils } from "../../../utils/SuiClientUtils";
4
+ export declare class OkxProvider implements QuoteProvider, SwapAPIProvider {
5
+ private readonly options;
6
+ private readonly metaOptions;
7
+ private readonly client;
8
+ readonly kind = EProvider.OKX;
9
+ constructor(options: OkxProviderOptions, metaOptions: Required<MetaAgOptions>, client: SuiClient);
10
+ quote({ amountIn, coinTypeIn, coinTypeOut, signer, }: MetaQuoteOptions): Promise<MetaQuote | null>;
11
+ fastSwap(options: MetaFastSwapOptions): Promise<string>;
12
+ }
13
+ export declare const simulateOKXSwap: <T extends MetaQuote & {
14
+ provider: EProvider.OKX;
15
+ }>(quote: T, inspector: SuiClientUtils, simulation: MetaSimulationOptions, metaOptions: Required<MetaAgOptions>) => Promise<{
16
+ simulatedAmountOut: string;
17
+ gasUsed: import("@mysten/sui/client").GasCostSummary;
18
+ id: string;
19
+ provider: EProvider.OKX;
20
+ }>;
21
+ //# sourceMappingURL=okx.d.ts.map