@shogun-sdk/intents-sdk 1.3.0 → 1.4.1

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 (670) hide show
  1. package/README.md +15 -22
  2. package/dist/index.cjs +9008 -0
  3. package/dist/index.cjs.map +1 -0
  4. package/dist/index.d.cts +1654 -0
  5. package/dist/index.d.ts +1654 -0
  6. package/dist/index.js +9257 -0
  7. package/dist/index.js.map +1 -0
  8. package/package.json +28 -15
  9. package/src/auth/siwe.ts +8 -3
  10. package/src/chains.ts +24 -0
  11. package/src/constants.ts +67 -13
  12. package/src/core/evm/chain-provider.ts +4 -1
  13. package/src/core/evm/connectors/monad.ts +27 -0
  14. package/src/core/evm/cross-chain-limit-order.ts +14 -14
  15. package/src/core/evm/intent-helpers.ts +153 -19
  16. package/src/core/evm/intent-provider.ts +5 -4
  17. package/src/core/evm/permit2.ts +36 -0
  18. package/src/core/evm/single-chain-dca-order.ts +18 -18
  19. package/src/core/evm/single-chain-limit-order.ts +15 -15
  20. package/src/core/evm/types.ts +4 -4
  21. package/src/core/evm/validator.ts +1 -1
  22. package/src/core/orders/api/fetch.ts +33 -16
  23. package/src/core/orders/api/index.ts +41 -8
  24. package/src/core/orders/common.ts +2 -0
  25. package/src/core/orders/cross-chain.ts +15 -8
  26. package/src/core/orders/single-chain.ts +30 -13
  27. package/src/core/sdk.ts +11 -0
  28. package/src/core/solana/cancel-order.ts +4 -2
  29. package/src/core/solana/client.ts +1 -1
  30. package/src/core/solana/dca/cancel-order.ts +2 -1
  31. package/src/core/solana/dca/single-chain-dca-order.ts +19 -22
  32. package/src/core/solana/dca/single-chain-limit-order.ts +20 -22
  33. package/src/core/solana/generated/cross-chain/accounts/dcaOrder.ts +2 -2
  34. package/src/core/solana/generated/cross-chain/accounts/guard.ts +22 -10
  35. package/src/core/solana/generated/cross-chain/errors/sourceChainGuard.ts +37 -33
  36. package/src/core/solana/generated/cross-chain/instructions/cancelDcaOrder.ts +36 -22
  37. package/src/core/solana/generated/cross-chain/instructions/cancelOrder.ts +32 -18
  38. package/src/core/solana/generated/cross-chain/instructions/claimTokensForDcaInterval.ts +396 -0
  39. package/src/core/solana/generated/cross-chain/instructions/index.ts +5 -0
  40. package/src/core/solana/generated/cross-chain/instructions/preStartDcaOrderExecution.ts +504 -0
  41. package/src/core/solana/generated/cross-chain/instructions/setCancelAuthorities.ts +326 -0
  42. package/src/core/solana/generated/cross-chain/instructions/startDcaOrderExecution.ts +440 -0
  43. package/src/core/solana/generated/cross-chain/instructions/startDcaOrderExecutionAfterSwap.ts +322 -0
  44. package/src/core/solana/generated/cross-chain/programs/sourceChainGuard.ts +80 -0
  45. package/src/core/solana/generated/cross-chain/types/cancelAuthoritiesUpdated.ts +40 -0
  46. package/src/core/solana/generated/cross-chain/types/index.ts +1 -0
  47. package/src/core/solana/generated/single-chain/accounts/guard.ts +22 -10
  48. package/src/core/solana/generated/single-chain/errors/singleChainGuard.ts +24 -20
  49. package/src/core/solana/generated/single-chain/instructions/cancelDcaOrder.ts +28 -14
  50. package/src/core/solana/generated/single-chain/instructions/cancelLimitOrder.ts +28 -14
  51. package/src/core/solana/generated/single-chain/instructions/fulfillDcaOrderInterval.ts +30 -4
  52. package/src/core/solana/generated/single-chain/instructions/fulfillLimitOrder.ts +30 -4
  53. package/src/core/solana/generated/single-chain/instructions/index.ts +1 -0
  54. package/src/core/solana/generated/single-chain/instructions/setCancelAuthorities.ts +326 -0
  55. package/src/core/solana/generated/single-chain/programs/singleChainGuard.ts +17 -1
  56. package/src/core/solana/generated/single-chain/types/cancelAuthoritiesUpdated.ts +40 -0
  57. package/src/core/solana/generated/single-chain/types/index.ts +1 -0
  58. package/src/core/solana/intent-helpers.ts +31 -23
  59. package/src/core/solana/sdk.ts +1 -1
  60. package/src/core/solana/utils.ts +10 -1
  61. package/src/core/sui/cross-chain-limit-order.ts +1 -4
  62. package/src/core/sui/intent-helpers.ts +28 -31
  63. package/src/core/sui/order-transaction.ts +1 -1
  64. package/src/core/sui/single-chain-dca-order.ts +19 -32
  65. package/src/core/sui/single-chain-limit-order.ts +19 -34
  66. package/src/index.ts +8 -2
  67. package/src/types/api.ts +22 -2
  68. package/src/types/intent.ts +40 -4
  69. package/src/types/token-list.ts +2 -2
  70. package/src/utils/base-validator.ts +0 -4
  71. package/src/utils/defillama.ts +2 -0
  72. package/src/utils/generate-execution-details-hash.ts +11 -32
  73. package/src/utils/quote/address.ts +4 -0
  74. package/src/utils/quote/aggregator.ts +266 -106
  75. package/src/utils/quote/liquidswap.ts +42 -13
  76. package/src/utils/quote/paraswap.ts +2 -0
  77. package/src/utils/quote/pricing/constants.ts +33 -0
  78. package/src/utils/quote/pricing/decimals.ts +11 -0
  79. package/src/utils/quote/pricing/estimate-amount-out.ts +36 -0
  80. package/src/utils/quote/pricing/expenses.ts +62 -0
  81. package/src/utils/quote/pricing/gas.ts +28 -0
  82. package/src/utils/quote/pumpfun/estimations.ts +206 -0
  83. package/src/utils/quote/pumpfun/estimations_amm.ts +165 -0
  84. package/src/utils/quote/pumpfun/index.ts +266 -0
  85. package/src/utils/quote/pumpfun/models.ts +163 -0
  86. package/src/utils/quote/pumpfun/utils.ts +343 -0
  87. package/src/utils/quote/raydium.ts +350 -9
  88. package/src/utils/quote/relay.ts +99 -0
  89. package/src/utils/quote/stablecoins-tokens.ts +35 -8
  90. package/src/utils/quote/utils.ts +8 -0
  91. package/dist/esm/auth/siwe.js +0 -26
  92. package/dist/esm/auth/siwe.js.map +0 -1
  93. package/dist/esm/chains.js +0 -62
  94. package/dist/esm/chains.js.map +0 -1
  95. package/dist/esm/config.js +0 -2
  96. package/dist/esm/config.js.map +0 -1
  97. package/dist/esm/constants.js +0 -107
  98. package/dist/esm/constants.js.map +0 -1
  99. package/dist/esm/core/evm/abi/erc20.js +0 -313
  100. package/dist/esm/core/evm/abi/erc20.js.map +0 -1
  101. package/dist/esm/core/evm/abi/permit2.js +0 -395
  102. package/dist/esm/core/evm/abi/permit2.js.map +0 -1
  103. package/dist/esm/core/evm/abi/single-chain-guard-limit.js +0 -768
  104. package/dist/esm/core/evm/abi/single-chain-guard-limit.js.map +0 -1
  105. package/dist/esm/core/evm/abi/source-chain-guard.js +0 -1121
  106. package/dist/esm/core/evm/abi/source-chain-guard.js.map +0 -1
  107. package/dist/esm/core/evm/cancel-order.js +0 -130
  108. package/dist/esm/core/evm/cancel-order.js.map +0 -1
  109. package/dist/esm/core/evm/chain-provider.js +0 -118
  110. package/dist/esm/core/evm/chain-provider.js.map +0 -1
  111. package/dist/esm/core/evm/connectors/hyperevm.js +0 -23
  112. package/dist/esm/core/evm/connectors/hyperevm.js.map +0 -1
  113. package/dist/esm/core/evm/cross-chain-limit-order.js +0 -43
  114. package/dist/esm/core/evm/cross-chain-limit-order.js.map +0 -1
  115. package/dist/esm/core/evm/intent-helpers.js +0 -135
  116. package/dist/esm/core/evm/intent-helpers.js.map +0 -1
  117. package/dist/esm/core/evm/intent-provider.js +0 -162
  118. package/dist/esm/core/evm/intent-provider.js.map +0 -1
  119. package/dist/esm/core/evm/order-signature.js +0 -41
  120. package/dist/esm/core/evm/order-signature.js.map +0 -1
  121. package/dist/esm/core/evm/permit2.js +0 -82
  122. package/dist/esm/core/evm/permit2.js.map +0 -1
  123. package/dist/esm/core/evm/sdk.js +0 -175
  124. package/dist/esm/core/evm/sdk.js.map +0 -1
  125. package/dist/esm/core/evm/single-chain-dca-order.js +0 -49
  126. package/dist/esm/core/evm/single-chain-dca-order.js.map +0 -1
  127. package/dist/esm/core/evm/single-chain-limit-order.js +0 -45
  128. package/dist/esm/core/evm/single-chain-limit-order.js.map +0 -1
  129. package/dist/esm/core/evm/types.js +0 -8
  130. package/dist/esm/core/evm/types.js.map +0 -1
  131. package/dist/esm/core/evm/validator.js +0 -111
  132. package/dist/esm/core/evm/validator.js.map +0 -1
  133. package/dist/esm/core/orders/api/fetch.js +0 -17
  134. package/dist/esm/core/orders/api/fetch.js.map +0 -1
  135. package/dist/esm/core/orders/api/index.js +0 -31
  136. package/dist/esm/core/orders/api/index.js.map +0 -1
  137. package/dist/esm/core/orders/common.js +0 -8
  138. package/dist/esm/core/orders/common.js.map +0 -1
  139. package/dist/esm/core/orders/cross-chain.js +0 -311
  140. package/dist/esm/core/orders/cross-chain.js.map +0 -1
  141. package/dist/esm/core/orders/dca-single-chain.js +0 -172
  142. package/dist/esm/core/orders/dca-single-chain.js.map +0 -1
  143. package/dist/esm/core/orders/single-chain.js +0 -197
  144. package/dist/esm/core/orders/single-chain.js.map +0 -1
  145. package/dist/esm/core/sdk.js +0 -86
  146. package/dist/esm/core/sdk.js.map +0 -1
  147. package/dist/esm/core/solana/cancel-order.js +0 -176
  148. package/dist/esm/core/solana/cancel-order.js.map +0 -1
  149. package/dist/esm/core/solana/client.js +0 -19
  150. package/dist/esm/core/solana/client.js.map +0 -1
  151. package/dist/esm/core/solana/dca/cancel-order.js +0 -61
  152. package/dist/esm/core/solana/dca/cancel-order.js.map +0 -1
  153. package/dist/esm/core/solana/dca/create-order.js +0 -82
  154. package/dist/esm/core/solana/dca/create-order.js.map +0 -1
  155. package/dist/esm/core/solana/dca/single-chain-dca-order.js +0 -23
  156. package/dist/esm/core/solana/dca/single-chain-dca-order.js.map +0 -1
  157. package/dist/esm/core/solana/dca/single-chain-limit-order.js +0 -29
  158. package/dist/esm/core/solana/dca/single-chain-limit-order.js.map +0 -1
  159. package/dist/esm/core/solana/generated/cross-chain/accounts/adminSingleton.js +0 -60
  160. package/dist/esm/core/solana/generated/cross-chain/accounts/adminSingleton.js.map +0 -1
  161. package/dist/esm/core/solana/generated/cross-chain/accounts/dcaOrder.js +0 -90
  162. package/dist/esm/core/solana/generated/cross-chain/accounts/dcaOrder.js.map +0 -1
  163. package/dist/esm/core/solana/generated/cross-chain/accounts/guard.js +0 -64
  164. package/dist/esm/core/solana/generated/cross-chain/accounts/guard.js.map +0 -1
  165. package/dist/esm/core/solana/generated/cross-chain/accounts/index.js +0 -12
  166. package/dist/esm/core/solana/generated/cross-chain/accounts/index.js.map +0 -1
  167. package/dist/esm/core/solana/generated/cross-chain/accounts/order.js +0 -78
  168. package/dist/esm/core/solana/generated/cross-chain/accounts/order.js.map +0 -1
  169. package/dist/esm/core/solana/generated/cross-chain/errors/index.js +0 -9
  170. package/dist/esm/core/solana/generated/cross-chain/errors/index.js.map +0 -1
  171. package/dist/esm/core/solana/generated/cross-chain/errors/sourceChainGuard.js +0 -140
  172. package/dist/esm/core/solana/generated/cross-chain/errors/sourceChainGuard.js.map +0 -1
  173. package/dist/esm/core/solana/generated/cross-chain/index.js +0 -13
  174. package/dist/esm/core/solana/generated/cross-chain/index.js.map +0 -1
  175. package/dist/esm/core/solana/generated/cross-chain/instructions/acceptAdmin.js +0 -88
  176. package/dist/esm/core/solana/generated/cross-chain/instructions/acceptAdmin.js.map +0 -1
  177. package/dist/esm/core/solana/generated/cross-chain/instructions/cancelDcaOrder.js +0 -118
  178. package/dist/esm/core/solana/generated/cross-chain/instructions/cancelDcaOrder.js.map +0 -1
  179. package/dist/esm/core/solana/generated/cross-chain/instructions/cancelOrder.js +0 -107
  180. package/dist/esm/core/solana/generated/cross-chain/instructions/cancelOrder.js.map +0 -1
  181. package/dist/esm/core/solana/generated/cross-chain/instructions/claimTokens.js +0 -127
  182. package/dist/esm/core/solana/generated/cross-chain/instructions/claimTokens.js.map +0 -1
  183. package/dist/esm/core/solana/generated/cross-chain/instructions/collectProtocolFees.js +0 -133
  184. package/dist/esm/core/solana/generated/cross-chain/instructions/collectProtocolFees.js.map +0 -1
  185. package/dist/esm/core/solana/generated/cross-chain/instructions/createDcaOrder.js +0 -170
  186. package/dist/esm/core/solana/generated/cross-chain/instructions/createDcaOrder.js.map +0 -1
  187. package/dist/esm/core/solana/generated/cross-chain/instructions/createGuard.js +0 -188
  188. package/dist/esm/core/solana/generated/cross-chain/instructions/createGuard.js.map +0 -1
  189. package/dist/esm/core/solana/generated/cross-chain/instructions/createOrder.js +0 -166
  190. package/dist/esm/core/solana/generated/cross-chain/instructions/createOrder.js.map +0 -1
  191. package/dist/esm/core/solana/generated/cross-chain/instructions/index.js +0 -22
  192. package/dist/esm/core/solana/generated/cross-chain/instructions/index.js.map +0 -1
  193. package/dist/esm/core/solana/generated/cross-chain/instructions/initialize.js +0 -126
  194. package/dist/esm/core/solana/generated/cross-chain/instructions/initialize.js.map +0 -1
  195. package/dist/esm/core/solana/generated/cross-chain/instructions/preStartOrderExecution.js +0 -110
  196. package/dist/esm/core/solana/generated/cross-chain/instructions/preStartOrderExecution.js.map +0 -1
  197. package/dist/esm/core/solana/generated/cross-chain/instructions/setAdmin.js +0 -98
  198. package/dist/esm/core/solana/generated/cross-chain/instructions/setAdmin.js.map +0 -1
  199. package/dist/esm/core/solana/generated/cross-chain/instructions/setAuctioneerPubKey.js +0 -111
  200. package/dist/esm/core/solana/generated/cross-chain/instructions/setAuctioneerPubKey.js.map +0 -1
  201. package/dist/esm/core/solana/generated/cross-chain/instructions/startOrderExecution.js +0 -98
  202. package/dist/esm/core/solana/generated/cross-chain/instructions/startOrderExecution.js.map +0 -1
  203. package/dist/esm/core/solana/generated/cross-chain/instructions/startOrderExecutionAfterSwap.js +0 -106
  204. package/dist/esm/core/solana/generated/cross-chain/instructions/startOrderExecutionAfterSwap.js.map +0 -1
  205. package/dist/esm/core/solana/generated/cross-chain/programs/index.js +0 -9
  206. package/dist/esm/core/solana/generated/cross-chain/programs/index.js.map +0 -1
  207. package/dist/esm/core/solana/generated/cross-chain/programs/sourceChainGuard.js +0 -98
  208. package/dist/esm/core/solana/generated/cross-chain/programs/sourceChainGuard.js.map +0 -1
  209. package/dist/esm/core/solana/generated/cross-chain/shared/index.js +0 -79
  210. package/dist/esm/core/solana/generated/cross-chain/shared/index.js.map +0 -1
  211. package/dist/esm/core/solana/generated/cross-chain/types/adminUpdateStarted.js +0 -18
  212. package/dist/esm/core/solana/generated/cross-chain/types/adminUpdateStarted.js.map +0 -1
  213. package/dist/esm/core/solana/generated/cross-chain/types/adminUpdated.js +0 -18
  214. package/dist/esm/core/solana/generated/cross-chain/types/adminUpdated.js.map +0 -1
  215. package/dist/esm/core/solana/generated/cross-chain/types/auctioneerPubkeyUpdated.js +0 -24
  216. package/dist/esm/core/solana/generated/cross-chain/types/auctioneerPubkeyUpdated.js.map +0 -1
  217. package/dist/esm/core/solana/generated/cross-chain/types/dcaExecutionStarted.js +0 -32
  218. package/dist/esm/core/solana/generated/cross-chain/types/dcaExecutionStarted.js.map +0 -1
  219. package/dist/esm/core/solana/generated/cross-chain/types/dcaOrderCreated.js +0 -42
  220. package/dist/esm/core/solana/generated/cross-chain/types/dcaOrderCreated.js.map +0 -1
  221. package/dist/esm/core/solana/generated/cross-chain/types/dcaOrderIntervalFulfilled.js +0 -26
  222. package/dist/esm/core/solana/generated/cross-chain/types/dcaOrderIntervalFulfilled.js.map +0 -1
  223. package/dist/esm/core/solana/generated/cross-chain/types/dcaTokenInSwapped.js +0 -28
  224. package/dist/esm/core/solana/generated/cross-chain/types/dcaTokenInSwapped.js.map +0 -1
  225. package/dist/esm/core/solana/generated/cross-chain/types/executionStarted.js +0 -30
  226. package/dist/esm/core/solana/generated/cross-chain/types/executionStarted.js.map +0 -1
  227. package/dist/esm/core/solana/generated/cross-chain/types/failedDcaIntervalExecution.js +0 -26
  228. package/dist/esm/core/solana/generated/cross-chain/types/failedDcaIntervalExecution.js.map +0 -1
  229. package/dist/esm/core/solana/generated/cross-chain/types/guardCreated.js +0 -28
  230. package/dist/esm/core/solana/generated/cross-chain/types/guardCreated.js.map +0 -1
  231. package/dist/esm/core/solana/generated/cross-chain/types/index.js +0 -22
  232. package/dist/esm/core/solana/generated/cross-chain/types/index.js.map +0 -1
  233. package/dist/esm/core/solana/generated/cross-chain/types/orderCancelled.js +0 -18
  234. package/dist/esm/core/solana/generated/cross-chain/types/orderCancelled.js.map +0 -1
  235. package/dist/esm/core/solana/generated/cross-chain/types/orderCreated.js +0 -36
  236. package/dist/esm/core/solana/generated/cross-chain/types/orderCreated.js.map +0 -1
  237. package/dist/esm/core/solana/generated/cross-chain/types/orderFulfilled.js +0 -18
  238. package/dist/esm/core/solana/generated/cross-chain/types/orderFulfilled.js.map +0 -1
  239. package/dist/esm/core/solana/generated/cross-chain/types/tokenInSwapped.js +0 -26
  240. package/dist/esm/core/solana/generated/cross-chain/types/tokenInSwapped.js.map +0 -1
  241. package/dist/esm/core/solana/generated/single-chain/accounts/adminSingleton.js +0 -60
  242. package/dist/esm/core/solana/generated/single-chain/accounts/adminSingleton.js.map +0 -1
  243. package/dist/esm/core/solana/generated/single-chain/accounts/dcaOrder.js +0 -75
  244. package/dist/esm/core/solana/generated/single-chain/accounts/dcaOrder.js.map +0 -1
  245. package/dist/esm/core/solana/generated/single-chain/accounts/guard.js +0 -62
  246. package/dist/esm/core/solana/generated/single-chain/accounts/guard.js.map +0 -1
  247. package/dist/esm/core/solana/generated/single-chain/accounts/index.js +0 -12
  248. package/dist/esm/core/solana/generated/single-chain/accounts/index.js.map +0 -1
  249. package/dist/esm/core/solana/generated/single-chain/accounts/limitOrder.js +0 -65
  250. package/dist/esm/core/solana/generated/single-chain/accounts/limitOrder.js.map +0 -1
  251. package/dist/esm/core/solana/generated/single-chain/errors/index.js +0 -9
  252. package/dist/esm/core/solana/generated/single-chain/errors/index.js.map +0 -1
  253. package/dist/esm/core/solana/generated/single-chain/errors/singleChainGuard.js +0 -101
  254. package/dist/esm/core/solana/generated/single-chain/errors/singleChainGuard.js.map +0 -1
  255. package/dist/esm/core/solana/generated/single-chain/index.js +0 -13
  256. package/dist/esm/core/solana/generated/single-chain/index.js.map +0 -1
  257. package/dist/esm/core/solana/generated/single-chain/instructions/acceptAdmin.js +0 -88
  258. package/dist/esm/core/solana/generated/single-chain/instructions/acceptAdmin.js.map +0 -1
  259. package/dist/esm/core/solana/generated/single-chain/instructions/cancelDcaOrder.js +0 -84
  260. package/dist/esm/core/solana/generated/single-chain/instructions/cancelDcaOrder.js.map +0 -1
  261. package/dist/esm/core/solana/generated/single-chain/instructions/cancelLimitOrder.js +0 -84
  262. package/dist/esm/core/solana/generated/single-chain/instructions/cancelLimitOrder.js.map +0 -1
  263. package/dist/esm/core/solana/generated/single-chain/instructions/collectProtocolFees.js +0 -121
  264. package/dist/esm/core/solana/generated/single-chain/instructions/collectProtocolFees.js.map +0 -1
  265. package/dist/esm/core/solana/generated/single-chain/instructions/createDcaOrder.js +0 -172
  266. package/dist/esm/core/solana/generated/single-chain/instructions/createDcaOrder.js.map +0 -1
  267. package/dist/esm/core/solana/generated/single-chain/instructions/createGuard.js +0 -163
  268. package/dist/esm/core/solana/generated/single-chain/instructions/createGuard.js.map +0 -1
  269. package/dist/esm/core/solana/generated/single-chain/instructions/createLimitOrder.js +0 -168
  270. package/dist/esm/core/solana/generated/single-chain/instructions/createLimitOrder.js.map +0 -1
  271. package/dist/esm/core/solana/generated/single-chain/instructions/fulfillDcaOrderInterval.js +0 -146
  272. package/dist/esm/core/solana/generated/single-chain/instructions/fulfillDcaOrderInterval.js.map +0 -1
  273. package/dist/esm/core/solana/generated/single-chain/instructions/fulfillLimitOrder.js +0 -146
  274. package/dist/esm/core/solana/generated/single-chain/instructions/fulfillLimitOrder.js.map +0 -1
  275. package/dist/esm/core/solana/generated/single-chain/instructions/index.js +0 -20
  276. package/dist/esm/core/solana/generated/single-chain/instructions/index.js.map +0 -1
  277. package/dist/esm/core/solana/generated/single-chain/instructions/initialize.js +0 -126
  278. package/dist/esm/core/solana/generated/single-chain/instructions/initialize.js.map +0 -1
  279. package/dist/esm/core/solana/generated/single-chain/instructions/setAdmin.js +0 -98
  280. package/dist/esm/core/solana/generated/single-chain/instructions/setAdmin.js.map +0 -1
  281. package/dist/esm/core/solana/generated/single-chain/instructions/setAuctioneerPubKey.js +0 -111
  282. package/dist/esm/core/solana/generated/single-chain/instructions/setAuctioneerPubKey.js.map +0 -1
  283. package/dist/esm/core/solana/generated/single-chain/programs/index.js +0 -9
  284. package/dist/esm/core/solana/generated/single-chain/programs/index.js.map +0 -1
  285. package/dist/esm/core/solana/generated/single-chain/programs/singleChainGuard.js +0 -90
  286. package/dist/esm/core/solana/generated/single-chain/programs/singleChainGuard.js.map +0 -1
  287. package/dist/esm/core/solana/generated/single-chain/shared/index.js +0 -79
  288. package/dist/esm/core/solana/generated/single-chain/shared/index.js.map +0 -1
  289. package/dist/esm/core/solana/generated/single-chain/types/adminUpdateStarted.js +0 -18
  290. package/dist/esm/core/solana/generated/single-chain/types/adminUpdateStarted.js.map +0 -1
  291. package/dist/esm/core/solana/generated/single-chain/types/adminUpdated.js +0 -18
  292. package/dist/esm/core/solana/generated/single-chain/types/adminUpdated.js.map +0 -1
  293. package/dist/esm/core/solana/generated/single-chain/types/auctioneerPubkeyUpdated.js +0 -24
  294. package/dist/esm/core/solana/generated/single-chain/types/auctioneerPubkeyUpdated.js.map +0 -1
  295. package/dist/esm/core/solana/generated/single-chain/types/dcaOrderCreated.js +0 -42
  296. package/dist/esm/core/solana/generated/single-chain/types/dcaOrderCreated.js.map +0 -1
  297. package/dist/esm/core/solana/generated/single-chain/types/dcaOrderFulfilled.js +0 -18
  298. package/dist/esm/core/solana/generated/single-chain/types/dcaOrderFulfilled.js.map +0 -1
  299. package/dist/esm/core/solana/generated/single-chain/types/dcaOrderIntervalFulfilled.js +0 -30
  300. package/dist/esm/core/solana/generated/single-chain/types/dcaOrderIntervalFulfilled.js.map +0 -1
  301. package/dist/esm/core/solana/generated/single-chain/types/guardCreated.js +0 -26
  302. package/dist/esm/core/solana/generated/single-chain/types/guardCreated.js.map +0 -1
  303. package/dist/esm/core/solana/generated/single-chain/types/index.js +0 -18
  304. package/dist/esm/core/solana/generated/single-chain/types/index.js.map +0 -1
  305. package/dist/esm/core/solana/generated/single-chain/types/limitOrderCreated.js +0 -36
  306. package/dist/esm/core/solana/generated/single-chain/types/limitOrderCreated.js.map +0 -1
  307. package/dist/esm/core/solana/generated/single-chain/types/limitOrderFulfilled.js +0 -24
  308. package/dist/esm/core/solana/generated/single-chain/types/limitOrderFulfilled.js.map +0 -1
  309. package/dist/esm/core/solana/generated/single-chain/types/orderCancelled.js +0 -18
  310. package/dist/esm/core/solana/generated/single-chain/types/orderCancelled.js.map +0 -1
  311. package/dist/esm/core/solana/inspect.js +0 -43
  312. package/dist/esm/core/solana/inspect.js.map +0 -1
  313. package/dist/esm/core/solana/intent-helpers.js +0 -180
  314. package/dist/esm/core/solana/intent-helpers.js.map +0 -1
  315. package/dist/esm/core/solana/order-instructions.js +0 -163
  316. package/dist/esm/core/solana/order-instructions.js.map +0 -1
  317. package/dist/esm/core/solana/sdk.js +0 -220
  318. package/dist/esm/core/solana/sdk.js.map +0 -1
  319. package/dist/esm/core/solana/utils.js +0 -19
  320. package/dist/esm/core/solana/utils.js.map +0 -1
  321. package/dist/esm/core/solana/validator.js +0 -28
  322. package/dist/esm/core/solana/validator.js.map +0 -1
  323. package/dist/esm/core/sui/cancel.js +0 -36
  324. package/dist/esm/core/sui/cancel.js.map +0 -1
  325. package/dist/esm/core/sui/client.js +0 -3
  326. package/dist/esm/core/sui/client.js.map +0 -1
  327. package/dist/esm/core/sui/cross-chain-limit-order.js +0 -9
  328. package/dist/esm/core/sui/cross-chain-limit-order.js.map +0 -1
  329. package/dist/esm/core/sui/intent-helpers.js +0 -140
  330. package/dist/esm/core/sui/intent-helpers.js.map +0 -1
  331. package/dist/esm/core/sui/order-transaction.js +0 -58
  332. package/dist/esm/core/sui/order-transaction.js.map +0 -1
  333. package/dist/esm/core/sui/sdk.js +0 -119
  334. package/dist/esm/core/sui/sdk.js.map +0 -1
  335. package/dist/esm/core/sui/single-chain-dca-order.js +0 -99
  336. package/dist/esm/core/sui/single-chain-dca-order.js.map +0 -1
  337. package/dist/esm/core/sui/single-chain-limit-order.js +0 -103
  338. package/dist/esm/core/sui/single-chain-limit-order.js.map +0 -1
  339. package/dist/esm/core/sui/validator.js +0 -31
  340. package/dist/esm/core/sui/validator.js.map +0 -1
  341. package/dist/esm/errors/index.js +0 -68
  342. package/dist/esm/errors/index.js.map +0 -1
  343. package/dist/esm/index.js +0 -41
  344. package/dist/esm/index.js.map +0 -1
  345. package/dist/esm/types/api.js +0 -7
  346. package/dist/esm/types/api.js.map +0 -1
  347. package/dist/esm/types/intent.js +0 -2
  348. package/dist/esm/types/intent.js.map +0 -1
  349. package/dist/esm/types/token-list.js +0 -2
  350. package/dist/esm/types/token-list.js.map +0 -1
  351. package/dist/esm/utils/base-validator.js +0 -91
  352. package/dist/esm/utils/base-validator.js.map +0 -1
  353. package/dist/esm/utils/defillama.js +0 -104
  354. package/dist/esm/utils/defillama.js.map +0 -1
  355. package/dist/esm/utils/generate-execution-details-hash.js +0 -15
  356. package/dist/esm/utils/generate-execution-details-hash.js.map +0 -1
  357. package/dist/esm/utils/logger.js +0 -109
  358. package/dist/esm/utils/logger.js.map +0 -1
  359. package/dist/esm/utils/order-validator.js +0 -112
  360. package/dist/esm/utils/order-validator.js.map +0 -1
  361. package/dist/esm/utils/parsers.js +0 -28
  362. package/dist/esm/utils/parsers.js.map +0 -1
  363. package/dist/esm/utils/quote/aftermath.js +0 -15
  364. package/dist/esm/utils/quote/aftermath.js.map +0 -1
  365. package/dist/esm/utils/quote/aggregator.js +0 -329
  366. package/dist/esm/utils/quote/aggregator.js.map +0 -1
  367. package/dist/esm/utils/quote/jupiter.js +0 -31
  368. package/dist/esm/utils/quote/jupiter.js.map +0 -1
  369. package/dist/esm/utils/quote/liquidswap.js +0 -22
  370. package/dist/esm/utils/quote/liquidswap.js.map +0 -1
  371. package/dist/esm/utils/quote/paraswap.js +0 -67
  372. package/dist/esm/utils/quote/paraswap.js.map +0 -1
  373. package/dist/esm/utils/quote/raydium.js +0 -82
  374. package/dist/esm/utils/quote/raydium.js.map +0 -1
  375. package/dist/esm/utils/quote/stablecoins-tokens.js +0 -13
  376. package/dist/esm/utils/quote/stablecoins-tokens.js.map +0 -1
  377. package/dist/esm/utils/tokens/index.js +0 -37
  378. package/dist/esm/utils/tokens/index.js.map +0 -1
  379. package/dist/esm/utils/type-utils.js +0 -2
  380. package/dist/esm/utils/type-utils.js.map +0 -1
  381. package/dist/types/auth/siwe.d.ts +0 -13
  382. package/dist/types/auth/siwe.d.ts.map +0 -1
  383. package/dist/types/chains.d.ts +0 -62
  384. package/dist/types/chains.d.ts.map +0 -1
  385. package/dist/types/config.d.ts +0 -21
  386. package/dist/types/config.d.ts.map +0 -1
  387. package/dist/types/constants.d.ts +0 -44
  388. package/dist/types/constants.d.ts.map +0 -1
  389. package/dist/types/core/evm/abi/erc20.d.ts +0 -240
  390. package/dist/types/core/evm/abi/erc20.d.ts.map +0 -1
  391. package/dist/types/core/evm/abi/permit2.d.ts +0 -304
  392. package/dist/types/core/evm/abi/permit2.d.ts.map +0 -1
  393. package/dist/types/core/evm/abi/single-chain-guard-limit.d.ts +0 -596
  394. package/dist/types/core/evm/abi/single-chain-guard-limit.d.ts.map +0 -1
  395. package/dist/types/core/evm/abi/source-chain-guard.d.ts +0 -877
  396. package/dist/types/core/evm/abi/source-chain-guard.d.ts.map +0 -1
  397. package/dist/types/core/evm/cancel-order.d.ts +0 -28
  398. package/dist/types/core/evm/cancel-order.d.ts.map +0 -1
  399. package/dist/types/core/evm/chain-provider.d.ts +0 -62338
  400. package/dist/types/core/evm/chain-provider.d.ts.map +0 -1
  401. package/dist/types/core/evm/connectors/hyperevm.d.ts +0 -38
  402. package/dist/types/core/evm/connectors/hyperevm.d.ts.map +0 -1
  403. package/dist/types/core/evm/cross-chain-limit-order.d.ts +0 -22
  404. package/dist/types/core/evm/cross-chain-limit-order.d.ts.map +0 -1
  405. package/dist/types/core/evm/intent-helpers.d.ts +0 -105
  406. package/dist/types/core/evm/intent-helpers.d.ts.map +0 -1
  407. package/dist/types/core/evm/intent-provider.d.ts +0 -19
  408. package/dist/types/core/evm/intent-provider.d.ts.map +0 -1
  409. package/dist/types/core/evm/order-signature.d.ts +0 -22
  410. package/dist/types/core/evm/order-signature.d.ts.map +0 -1
  411. package/dist/types/core/evm/permit2.d.ts +0 -261
  412. package/dist/types/core/evm/permit2.d.ts.map +0 -1
  413. package/dist/types/core/evm/sdk.d.ts +0 -63
  414. package/dist/types/core/evm/sdk.d.ts.map +0 -1
  415. package/dist/types/core/evm/single-chain-dca-order.d.ts +0 -26
  416. package/dist/types/core/evm/single-chain-dca-order.d.ts.map +0 -1
  417. package/dist/types/core/evm/single-chain-limit-order.d.ts +0 -23
  418. package/dist/types/core/evm/single-chain-limit-order.d.ts.map +0 -1
  419. package/dist/types/core/evm/types.d.ts +0 -8
  420. package/dist/types/core/evm/types.d.ts.map +0 -1
  421. package/dist/types/core/evm/validator.d.ts +0 -23
  422. package/dist/types/core/evm/validator.d.ts.map +0 -1
  423. package/dist/types/core/orders/api/fetch.d.ts +0 -3
  424. package/dist/types/core/orders/api/fetch.d.ts.map +0 -1
  425. package/dist/types/core/orders/api/index.d.ts +0 -8
  426. package/dist/types/core/orders/api/index.d.ts.map +0 -1
  427. package/dist/types/core/orders/common.d.ts +0 -12
  428. package/dist/types/core/orders/common.d.ts.map +0 -1
  429. package/dist/types/core/orders/cross-chain.d.ts +0 -123
  430. package/dist/types/core/orders/cross-chain.d.ts.map +0 -1
  431. package/dist/types/core/orders/dca-single-chain.d.ts +0 -47
  432. package/dist/types/core/orders/dca-single-chain.d.ts.map +0 -1
  433. package/dist/types/core/orders/single-chain.d.ts +0 -47
  434. package/dist/types/core/orders/single-chain.d.ts.map +0 -1
  435. package/dist/types/core/sdk.d.ts +0 -30
  436. package/dist/types/core/sdk.d.ts.map +0 -1
  437. package/dist/types/core/solana/cancel-order.d.ts +0 -18
  438. package/dist/types/core/solana/cancel-order.d.ts.map +0 -1
  439. package/dist/types/core/solana/client.d.ts +0 -11
  440. package/dist/types/core/solana/client.d.ts.map +0 -1
  441. package/dist/types/core/solana/dca/cancel-order.d.ts +0 -5
  442. package/dist/types/core/solana/dca/cancel-order.d.ts.map +0 -1
  443. package/dist/types/core/solana/dca/create-order.d.ts +0 -8
  444. package/dist/types/core/solana/dca/create-order.d.ts.map +0 -1
  445. package/dist/types/core/solana/dca/single-chain-dca-order.d.ts +0 -14
  446. package/dist/types/core/solana/dca/single-chain-dca-order.d.ts.map +0 -1
  447. package/dist/types/core/solana/dca/single-chain-limit-order.d.ts +0 -19
  448. package/dist/types/core/solana/dca/single-chain-limit-order.d.ts.map +0 -1
  449. package/dist/types/core/solana/generated/cross-chain/accounts/adminSingleton.d.ts +0 -40
  450. package/dist/types/core/solana/generated/cross-chain/accounts/adminSingleton.d.ts.map +0 -1
  451. package/dist/types/core/solana/generated/cross-chain/accounts/dcaOrder.d.ts +0 -110
  452. package/dist/types/core/solana/generated/cross-chain/accounts/dcaOrder.d.ts.map +0 -1
  453. package/dist/types/core/solana/generated/cross-chain/accounts/guard.d.ts +0 -52
  454. package/dist/types/core/solana/generated/cross-chain/accounts/guard.d.ts.map +0 -1
  455. package/dist/types/core/solana/generated/cross-chain/accounts/index.d.ts +0 -12
  456. package/dist/types/core/solana/generated/cross-chain/accounts/index.d.ts.map +0 -1
  457. package/dist/types/core/solana/generated/cross-chain/accounts/order.d.ts +0 -92
  458. package/dist/types/core/solana/generated/cross-chain/accounts/order.d.ts.map +0 -1
  459. package/dist/types/core/solana/generated/cross-chain/errors/index.d.ts +0 -9
  460. package/dist/types/core/solana/generated/cross-chain/errors/index.d.ts.map +0 -1
  461. package/dist/types/core/solana/generated/cross-chain/errors/sourceChainGuard.d.ts +0 -97
  462. package/dist/types/core/solana/generated/cross-chain/errors/sourceChainGuard.d.ts.map +0 -1
  463. package/dist/types/core/solana/generated/cross-chain/index.d.ts +0 -13
  464. package/dist/types/core/solana/generated/cross-chain/index.d.ts.map +0 -1
  465. package/dist/types/core/solana/generated/cross-chain/instructions/acceptAdmin.d.ts +0 -56
  466. package/dist/types/core/solana/generated/cross-chain/instructions/acceptAdmin.d.ts.map +0 -1
  467. package/dist/types/core/solana/generated/cross-chain/instructions/cancelDcaOrder.d.ts +0 -124
  468. package/dist/types/core/solana/generated/cross-chain/instructions/cancelDcaOrder.d.ts.map +0 -1
  469. package/dist/types/core/solana/generated/cross-chain/instructions/cancelOrder.d.ts +0 -108
  470. package/dist/types/core/solana/generated/cross-chain/instructions/cancelOrder.d.ts.map +0 -1
  471. package/dist/types/core/solana/generated/cross-chain/instructions/claimTokens.d.ts +0 -131
  472. package/dist/types/core/solana/generated/cross-chain/instructions/claimTokens.d.ts.map +0 -1
  473. package/dist/types/core/solana/generated/cross-chain/instructions/collectProtocolFees.d.ts +0 -91
  474. package/dist/types/core/solana/generated/cross-chain/instructions/collectProtocolFees.d.ts.map +0 -1
  475. package/dist/types/core/solana/generated/cross-chain/instructions/createDcaOrder.d.ts +0 -130
  476. package/dist/types/core/solana/generated/cross-chain/instructions/createDcaOrder.d.ts.map +0 -1
  477. package/dist/types/core/solana/generated/cross-chain/instructions/createGuard.d.ts +0 -137
  478. package/dist/types/core/solana/generated/cross-chain/instructions/createGuard.d.ts.map +0 -1
  479. package/dist/types/core/solana/generated/cross-chain/instructions/createOrder.d.ts +0 -122
  480. package/dist/types/core/solana/generated/cross-chain/instructions/createOrder.d.ts.map +0 -1
  481. package/dist/types/core/solana/generated/cross-chain/instructions/index.d.ts +0 -22
  482. package/dist/types/core/solana/generated/cross-chain/instructions/index.d.ts.map +0 -1
  483. package/dist/types/core/solana/generated/cross-chain/instructions/initialize.d.ts +0 -86
  484. package/dist/types/core/solana/generated/cross-chain/instructions/initialize.d.ts.map +0 -1
  485. package/dist/types/core/solana/generated/cross-chain/instructions/preStartOrderExecution.d.ts +0 -105
  486. package/dist/types/core/solana/generated/cross-chain/instructions/preStartOrderExecution.d.ts.map +0 -1
  487. package/dist/types/core/solana/generated/cross-chain/instructions/setAdmin.d.ts +0 -61
  488. package/dist/types/core/solana/generated/cross-chain/instructions/setAdmin.d.ts.map +0 -1
  489. package/dist/types/core/solana/generated/cross-chain/instructions/setAuctioneerPubKey.d.ts +0 -68
  490. package/dist/types/core/solana/generated/cross-chain/instructions/setAuctioneerPubKey.d.ts.map +0 -1
  491. package/dist/types/core/solana/generated/cross-chain/instructions/startOrderExecution.d.ts +0 -85
  492. package/dist/types/core/solana/generated/cross-chain/instructions/startOrderExecution.d.ts.map +0 -1
  493. package/dist/types/core/solana/generated/cross-chain/instructions/startOrderExecutionAfterSwap.d.ts +0 -95
  494. package/dist/types/core/solana/generated/cross-chain/instructions/startOrderExecutionAfterSwap.d.ts.map +0 -1
  495. package/dist/types/core/solana/generated/cross-chain/programs/index.d.ts +0 -9
  496. package/dist/types/core/solana/generated/cross-chain/programs/index.d.ts.map +0 -1
  497. package/dist/types/core/solana/generated/cross-chain/programs/sourceChainGuard.d.ts +0 -69
  498. package/dist/types/core/solana/generated/cross-chain/programs/sourceChainGuard.d.ts.map +0 -1
  499. package/dist/types/core/solana/generated/cross-chain/shared/index.d.ts +0 -52
  500. package/dist/types/core/solana/generated/cross-chain/shared/index.d.ts.map +0 -1
  501. package/dist/types/core/solana/generated/cross-chain/types/adminUpdateStarted.d.ts +0 -16
  502. package/dist/types/core/solana/generated/cross-chain/types/adminUpdateStarted.d.ts.map +0 -1
  503. package/dist/types/core/solana/generated/cross-chain/types/adminUpdated.d.ts +0 -16
  504. package/dist/types/core/solana/generated/cross-chain/types/adminUpdated.d.ts.map +0 -1
  505. package/dist/types/core/solana/generated/cross-chain/types/auctioneerPubkeyUpdated.d.ts +0 -17
  506. package/dist/types/core/solana/generated/cross-chain/types/auctioneerPubkeyUpdated.d.ts.map +0 -1
  507. package/dist/types/core/solana/generated/cross-chain/types/dcaExecutionStarted.d.ts +0 -28
  508. package/dist/types/core/solana/generated/cross-chain/types/dcaExecutionStarted.d.ts.map +0 -1
  509. package/dist/types/core/solana/generated/cross-chain/types/dcaOrderCreated.d.ts +0 -38
  510. package/dist/types/core/solana/generated/cross-chain/types/dcaOrderCreated.d.ts.map +0 -1
  511. package/dist/types/core/solana/generated/cross-chain/types/dcaOrderIntervalFulfilled.d.ts +0 -18
  512. package/dist/types/core/solana/generated/cross-chain/types/dcaOrderIntervalFulfilled.d.ts.map +0 -1
  513. package/dist/types/core/solana/generated/cross-chain/types/dcaTokenInSwapped.d.ts +0 -24
  514. package/dist/types/core/solana/generated/cross-chain/types/dcaTokenInSwapped.d.ts.map +0 -1
  515. package/dist/types/core/solana/generated/cross-chain/types/executionStarted.d.ts +0 -26
  516. package/dist/types/core/solana/generated/cross-chain/types/executionStarted.d.ts.map +0 -1
  517. package/dist/types/core/solana/generated/cross-chain/types/failedDcaIntervalExecution.d.ts +0 -18
  518. package/dist/types/core/solana/generated/cross-chain/types/failedDcaIntervalExecution.d.ts.map +0 -1
  519. package/dist/types/core/solana/generated/cross-chain/types/guardCreated.d.ts +0 -19
  520. package/dist/types/core/solana/generated/cross-chain/types/guardCreated.d.ts.map +0 -1
  521. package/dist/types/core/solana/generated/cross-chain/types/index.d.ts +0 -22
  522. package/dist/types/core/solana/generated/cross-chain/types/index.d.ts.map +0 -1
  523. package/dist/types/core/solana/generated/cross-chain/types/orderCancelled.d.ts +0 -16
  524. package/dist/types/core/solana/generated/cross-chain/types/orderCancelled.d.ts.map +0 -1
  525. package/dist/types/core/solana/generated/cross-chain/types/orderCreated.d.ts +0 -32
  526. package/dist/types/core/solana/generated/cross-chain/types/orderCreated.d.ts.map +0 -1
  527. package/dist/types/core/solana/generated/cross-chain/types/orderFulfilled.d.ts +0 -16
  528. package/dist/types/core/solana/generated/cross-chain/types/orderFulfilled.d.ts.map +0 -1
  529. package/dist/types/core/solana/generated/cross-chain/types/tokenInSwapped.d.ts +0 -22
  530. package/dist/types/core/solana/generated/cross-chain/types/tokenInSwapped.d.ts.map +0 -1
  531. package/dist/types/core/solana/generated/single-chain/accounts/adminSingleton.d.ts +0 -40
  532. package/dist/types/core/solana/generated/single-chain/accounts/adminSingleton.d.ts.map +0 -1
  533. package/dist/types/core/solana/generated/single-chain/accounts/dcaOrder.d.ts +0 -99
  534. package/dist/types/core/solana/generated/single-chain/accounts/dcaOrder.d.ts.map +0 -1
  535. package/dist/types/core/solana/generated/single-chain/accounts/guard.d.ts +0 -48
  536. package/dist/types/core/solana/generated/single-chain/accounts/guard.d.ts.map +0 -1
  537. package/dist/types/core/solana/generated/single-chain/accounts/index.d.ts +0 -12
  538. package/dist/types/core/solana/generated/single-chain/accounts/index.d.ts.map +0 -1
  539. package/dist/types/core/solana/generated/single-chain/accounts/limitOrder.d.ts +0 -79
  540. package/dist/types/core/solana/generated/single-chain/accounts/limitOrder.d.ts.map +0 -1
  541. package/dist/types/core/solana/generated/single-chain/errors/index.d.ts +0 -9
  542. package/dist/types/core/solana/generated/single-chain/errors/index.d.ts.map +0 -1
  543. package/dist/types/core/solana/generated/single-chain/errors/singleChainGuard.d.ts +0 -71
  544. package/dist/types/core/solana/generated/single-chain/errors/singleChainGuard.d.ts.map +0 -1
  545. package/dist/types/core/solana/generated/single-chain/index.d.ts +0 -13
  546. package/dist/types/core/solana/generated/single-chain/index.d.ts.map +0 -1
  547. package/dist/types/core/solana/generated/single-chain/instructions/acceptAdmin.d.ts +0 -56
  548. package/dist/types/core/solana/generated/single-chain/instructions/acceptAdmin.d.ts.map +0 -1
  549. package/dist/types/core/solana/generated/single-chain/instructions/cancelDcaOrder.d.ts +0 -72
  550. package/dist/types/core/solana/generated/single-chain/instructions/cancelDcaOrder.d.ts.map +0 -1
  551. package/dist/types/core/solana/generated/single-chain/instructions/cancelLimitOrder.d.ts +0 -72
  552. package/dist/types/core/solana/generated/single-chain/instructions/cancelLimitOrder.d.ts.map +0 -1
  553. package/dist/types/core/solana/generated/single-chain/instructions/collectProtocolFees.d.ts +0 -91
  554. package/dist/types/core/solana/generated/single-chain/instructions/collectProtocolFees.d.ts.map +0 -1
  555. package/dist/types/core/solana/generated/single-chain/instructions/createDcaOrder.d.ts +0 -134
  556. package/dist/types/core/solana/generated/single-chain/instructions/createDcaOrder.d.ts.map +0 -1
  557. package/dist/types/core/solana/generated/single-chain/instructions/createGuard.d.ts +0 -107
  558. package/dist/types/core/solana/generated/single-chain/instructions/createGuard.d.ts.map +0 -1
  559. package/dist/types/core/solana/generated/single-chain/instructions/createLimitOrder.d.ts +0 -126
  560. package/dist/types/core/solana/generated/single-chain/instructions/createLimitOrder.d.ts.map +0 -1
  561. package/dist/types/core/solana/generated/single-chain/instructions/fulfillDcaOrderInterval.d.ts +0 -179
  562. package/dist/types/core/solana/generated/single-chain/instructions/fulfillDcaOrderInterval.d.ts.map +0 -1
  563. package/dist/types/core/solana/generated/single-chain/instructions/fulfillLimitOrder.d.ts +0 -179
  564. package/dist/types/core/solana/generated/single-chain/instructions/fulfillLimitOrder.d.ts.map +0 -1
  565. package/dist/types/core/solana/generated/single-chain/instructions/index.d.ts +0 -20
  566. package/dist/types/core/solana/generated/single-chain/instructions/index.d.ts.map +0 -1
  567. package/dist/types/core/solana/generated/single-chain/instructions/initialize.d.ts +0 -86
  568. package/dist/types/core/solana/generated/single-chain/instructions/initialize.d.ts.map +0 -1
  569. package/dist/types/core/solana/generated/single-chain/instructions/setAdmin.d.ts +0 -61
  570. package/dist/types/core/solana/generated/single-chain/instructions/setAdmin.d.ts.map +0 -1
  571. package/dist/types/core/solana/generated/single-chain/instructions/setAuctioneerPubKey.d.ts +0 -68
  572. package/dist/types/core/solana/generated/single-chain/instructions/setAuctioneerPubKey.d.ts.map +0 -1
  573. package/dist/types/core/solana/generated/single-chain/programs/index.d.ts +0 -9
  574. package/dist/types/core/solana/generated/single-chain/programs/index.d.ts.map +0 -1
  575. package/dist/types/core/solana/generated/single-chain/programs/singleChainGuard.d.ts +0 -63
  576. package/dist/types/core/solana/generated/single-chain/programs/singleChainGuard.d.ts.map +0 -1
  577. package/dist/types/core/solana/generated/single-chain/shared/index.d.ts +0 -52
  578. package/dist/types/core/solana/generated/single-chain/shared/index.d.ts.map +0 -1
  579. package/dist/types/core/solana/generated/single-chain/types/adminUpdateStarted.d.ts +0 -16
  580. package/dist/types/core/solana/generated/single-chain/types/adminUpdateStarted.d.ts.map +0 -1
  581. package/dist/types/core/solana/generated/single-chain/types/adminUpdated.d.ts +0 -16
  582. package/dist/types/core/solana/generated/single-chain/types/adminUpdated.d.ts.map +0 -1
  583. package/dist/types/core/solana/generated/single-chain/types/auctioneerPubkeyUpdated.d.ts +0 -17
  584. package/dist/types/core/solana/generated/single-chain/types/auctioneerPubkeyUpdated.d.ts.map +0 -1
  585. package/dist/types/core/solana/generated/single-chain/types/dcaOrderCreated.d.ts +0 -38
  586. package/dist/types/core/solana/generated/single-chain/types/dcaOrderCreated.d.ts.map +0 -1
  587. package/dist/types/core/solana/generated/single-chain/types/dcaOrderFulfilled.d.ts +0 -16
  588. package/dist/types/core/solana/generated/single-chain/types/dcaOrderFulfilled.d.ts.map +0 -1
  589. package/dist/types/core/solana/generated/single-chain/types/dcaOrderIntervalFulfilled.d.ts +0 -26
  590. package/dist/types/core/solana/generated/single-chain/types/dcaOrderIntervalFulfilled.d.ts.map +0 -1
  591. package/dist/types/core/solana/generated/single-chain/types/guardCreated.d.ts +0 -18
  592. package/dist/types/core/solana/generated/single-chain/types/guardCreated.d.ts.map +0 -1
  593. package/dist/types/core/solana/generated/single-chain/types/index.d.ts +0 -18
  594. package/dist/types/core/solana/generated/single-chain/types/index.d.ts.map +0 -1
  595. package/dist/types/core/solana/generated/single-chain/types/limitOrderCreated.d.ts +0 -32
  596. package/dist/types/core/solana/generated/single-chain/types/limitOrderCreated.d.ts.map +0 -1
  597. package/dist/types/core/solana/generated/single-chain/types/limitOrderFulfilled.d.ts +0 -20
  598. package/dist/types/core/solana/generated/single-chain/types/limitOrderFulfilled.d.ts.map +0 -1
  599. package/dist/types/core/solana/generated/single-chain/types/orderCancelled.d.ts +0 -16
  600. package/dist/types/core/solana/generated/single-chain/types/orderCancelled.d.ts.map +0 -1
  601. package/dist/types/core/solana/inspect.d.ts +0 -14
  602. package/dist/types/core/solana/inspect.d.ts.map +0 -1
  603. package/dist/types/core/solana/intent-helpers.d.ts +0 -120
  604. package/dist/types/core/solana/intent-helpers.d.ts.map +0 -1
  605. package/dist/types/core/solana/order-instructions.d.ts +0 -16
  606. package/dist/types/core/solana/order-instructions.d.ts.map +0 -1
  607. package/dist/types/core/solana/sdk.d.ts +0 -73
  608. package/dist/types/core/solana/sdk.d.ts.map +0 -1
  609. package/dist/types/core/solana/utils.d.ts +0 -7
  610. package/dist/types/core/solana/utils.d.ts.map +0 -1
  611. package/dist/types/core/solana/validator.d.ts +0 -11
  612. package/dist/types/core/solana/validator.d.ts.map +0 -1
  613. package/dist/types/core/sui/cancel.d.ts +0 -3
  614. package/dist/types/core/sui/cancel.d.ts.map +0 -1
  615. package/dist/types/core/sui/client.d.ts +0 -3
  616. package/dist/types/core/sui/client.d.ts.map +0 -1
  617. package/dist/types/core/sui/cross-chain-limit-order.d.ts +0 -5
  618. package/dist/types/core/sui/cross-chain-limit-order.d.ts.map +0 -1
  619. package/dist/types/core/sui/intent-helpers.d.ts +0 -90
  620. package/dist/types/core/sui/intent-helpers.d.ts.map +0 -1
  621. package/dist/types/core/sui/order-transaction.d.ts +0 -11
  622. package/dist/types/core/sui/order-transaction.d.ts.map +0 -1
  623. package/dist/types/core/sui/sdk.d.ts +0 -57
  624. package/dist/types/core/sui/sdk.d.ts.map +0 -1
  625. package/dist/types/core/sui/single-chain-dca-order.d.ts +0 -22
  626. package/dist/types/core/sui/single-chain-dca-order.d.ts.map +0 -1
  627. package/dist/types/core/sui/single-chain-limit-order.d.ts +0 -26
  628. package/dist/types/core/sui/single-chain-limit-order.d.ts.map +0 -1
  629. package/dist/types/core/sui/validator.d.ts +0 -11
  630. package/dist/types/core/sui/validator.d.ts.map +0 -1
  631. package/dist/types/errors/index.d.ts +0 -20
  632. package/dist/types/errors/index.d.ts.map +0 -1
  633. package/dist/types/index.d.ts +0 -43
  634. package/dist/types/index.d.ts.map +0 -1
  635. package/dist/types/types/api.d.ts +0 -65
  636. package/dist/types/types/api.d.ts.map +0 -1
  637. package/dist/types/types/intent.d.ts +0 -136
  638. package/dist/types/types/intent.d.ts.map +0 -1
  639. package/dist/types/types/token-list.d.ts +0 -30
  640. package/dist/types/types/token-list.d.ts.map +0 -1
  641. package/dist/types/utils/base-validator.d.ts +0 -46
  642. package/dist/types/utils/base-validator.d.ts.map +0 -1
  643. package/dist/types/utils/defillama.d.ts +0 -61
  644. package/dist/types/utils/defillama.d.ts.map +0 -1
  645. package/dist/types/utils/generate-execution-details-hash.d.ts +0 -11
  646. package/dist/types/utils/generate-execution-details-hash.d.ts.map +0 -1
  647. package/dist/types/utils/logger.d.ts +0 -35
  648. package/dist/types/utils/logger.d.ts.map +0 -1
  649. package/dist/types/utils/order-validator.d.ts +0 -64
  650. package/dist/types/utils/order-validator.d.ts.map +0 -1
  651. package/dist/types/utils/parsers.d.ts +0 -6
  652. package/dist/types/utils/parsers.d.ts.map +0 -1
  653. package/dist/types/utils/quote/aftermath.d.ts +0 -9
  654. package/dist/types/utils/quote/aftermath.d.ts.map +0 -1
  655. package/dist/types/utils/quote/aggregator.d.ts +0 -80
  656. package/dist/types/utils/quote/aggregator.d.ts.map +0 -1
  657. package/dist/types/utils/quote/jupiter.d.ts +0 -16
  658. package/dist/types/utils/quote/jupiter.d.ts.map +0 -1
  659. package/dist/types/utils/quote/liquidswap.d.ts +0 -16
  660. package/dist/types/utils/quote/liquidswap.d.ts.map +0 -1
  661. package/dist/types/utils/quote/paraswap.d.ts +0 -23
  662. package/dist/types/utils/quote/paraswap.d.ts.map +0 -1
  663. package/dist/types/utils/quote/raydium.d.ts +0 -79
  664. package/dist/types/utils/quote/raydium.d.ts.map +0 -1
  665. package/dist/types/utils/quote/stablecoins-tokens.d.ts +0 -11
  666. package/dist/types/utils/quote/stablecoins-tokens.d.ts.map +0 -1
  667. package/dist/types/utils/tokens/index.d.ts +0 -20
  668. package/dist/types/utils/tokens/index.d.ts.map +0 -1
  669. package/dist/types/utils/type-utils.d.ts +0 -2
  670. package/dist/types/utils/type-utils.d.ts.map +0 -1
@@ -2,16 +2,18 @@ import { ChainID, isEvmChain, type SupportedEvmChain } from '../../chains.js';
2
2
  import { JupiterQuoteProvider } from './jupiter.js';
3
3
  import { type QuoteResponse as JupiterQuoteResponse } from '@jup-ag/api';
4
4
  import { ParaswapQuoteProvider, type SwapEstimateResult } from './paraswap.js';
5
- import { CROSS_CHAIN_TOKENS } from './stablecoins-tokens.js';
5
+ import { CROSS_CHAIN_STABLES } from './stablecoins-tokens.js';
6
6
  import { AftermathQuoteProvider } from './aftermath.js';
7
7
  import type { RouterCompleteTradeRoute } from 'aftermath-ts-sdk';
8
- import { calculateAmounts } from '../defillama.js';
9
8
  import { LiquidSwapQuoteProvider, type LiquidSwapQuoteResponse } from './liquidswap.js';
10
- import { RaydiumQuoteProvider, type RaydiumQuoteResponse } from './raydium.js';
11
-
12
- const compareAddresses = (firstAddress?: string, secondAddress?: string): boolean => {
13
- return !!firstAddress && !!secondAddress && firstAddress.toLowerCase() === secondAddress.toLowerCase();
14
- };
9
+ import { RaydiumQuoteProvider, type RaydiumPumpQuoteParams, type RaydiumQuoteResponse } from './raydium.js';
10
+ import { PumpFunQuoteProvider } from './pumpfun/index.js';
11
+ import { RelayQuoteProvider } from './relay.js';
12
+ import { convertDecimals } from './pricing/decimals.js';
13
+ import { estimateAmountOut, IntentNotViableError } from './pricing/estimate-amount-out.js';
14
+ import { estimateExpensesInTokenOut } from './pricing/expenses.js';
15
+ import { DEFAULT_COMMISSION_BPS, CROSS_CHAIN_COMMISSION_DENOMINATOR, EVM_CROSS_CHAIN_GAS_LIMIT } from './pricing/constants.js';
16
+ import { compareAddresses } from './address.js';
15
17
 
16
18
  type SingleChainQuoteParams = {
17
19
  chainId: ChainID;
@@ -22,11 +24,12 @@ type SingleChainQuoteParams = {
22
24
  provider?: RouteProvider; // Optional provider override
23
25
  };
24
26
 
25
- export type RouteProvider = 'paraswap' | 'jupiter' | 'aftermath' | 'liquidswap' | 'raydium';
27
+ export type RouteProvider = 'paraswap' | 'jupiter' | 'aftermath' | 'liquidswap' | 'raydium' | 'pumpfun' | 'relay';
26
28
 
27
29
  export type Quote = {
28
30
  amountIn: bigint;
29
31
  amountOut: bigint;
32
+ amountOutMin?: bigint; // Optional, for quotes that provide a minimum guaranteed output
30
33
  amountOutUsd: number;
31
34
  amountInUsd: number;
32
35
  slippage: number;
@@ -35,6 +38,13 @@ export type Quote = {
35
38
  rawQuote: any;
36
39
  };
37
40
 
41
+ export type SimpleQuote = {
42
+ amountIn: bigint;
43
+ amountOut: bigint;
44
+ amountOutMin?: bigint;
45
+ slippage: number;
46
+ };
47
+
38
48
  export type IntentsQuoteParams = {
39
49
  sourceChainId: ChainID;
40
50
  destChainId: ChainID;
@@ -43,7 +53,7 @@ export type IntentsQuoteParams = {
43
53
  tokenOut: string;
44
54
  };
45
55
 
46
- export type QuoteResponse = {
56
+ export type QuoteResponseInternal = {
47
57
  amountInUsd: number;
48
58
  estimatedAmountInAsMinStablecoinAmount: bigint;
49
59
 
@@ -54,44 +64,44 @@ export type QuoteResponse = {
54
64
  estimatedAmountOutUsdReduced: number;
55
65
  };
56
66
 
57
- export class QuoteProvider {
58
- private static readonly DEFAULT_BRIDGE_TOKEN = 'USDC';
59
- private static readonly DEFAULT_BRIDGE_TOKEN_DECIMALS = 6;
60
-
61
- public static async getQuoteFromDefillama(params: IntentsQuoteParams): Promise<QuoteResponse> {
62
- const defillamaQuote = await calculateAmounts({
63
- amountIn: params.amount,
64
- tokenIn: params.tokenIn,
65
- tokenOut: params.tokenOut,
66
- destChainId: params.destChainId,
67
- srcChainId: params.sourceChainId,
68
- });
69
-
70
- return {
71
- amountInUsd: 0,
72
- estimatedAmountOutUsd: 0,
73
- estimatedAmountOutUsdReduced: 0,
74
-
75
- estimatedAmountInAsMinStablecoinAmount: defillamaQuote.minStablecoinsAmount,
76
- estimatedAmountOut: defillamaQuote.amountOut,
77
- estimatedAmountOutReduced: defillamaQuote.amountOut,
78
- };
79
- }
67
+ // Public response with metadata and derived fields
68
+ export type QuoteResponse = QuoteResponseInternal & {
69
+ /** Metadata for source token */
70
+ tokenIn: {
71
+ address: string;
72
+ chainId: ChainID;
73
+ };
74
+
75
+ /** Metadata for destination token */
76
+ tokenOut: {
77
+ address: string;
78
+ chainId: ChainID;
79
+ };
80
+ };
80
81
 
81
- public static async getQuoteWithDefillamaFallback(params: IntentsQuoteParams): Promise<QuoteResponse> {
82
+ export class QuoteProvider {
83
+ public static async getQuote(params: IntentsQuoteParams): Promise<QuoteResponse> {
82
84
  try {
83
85
  const quote = await this.getQuoteFromRouters(params);
84
- return quote;
86
+ // Adapt QuoteResponseInternal to QuoteResponse by adding tokenIn and tokenOut metadata fields
87
+ return {
88
+ ...quote,
89
+ tokenIn: {
90
+ address: params.tokenIn,
91
+ chainId: params.sourceChainId,
92
+ },
93
+ tokenOut: {
94
+ address: params.tokenOut,
95
+ chainId: params.destChainId,
96
+ },
97
+ };
85
98
  } catch (e) {
86
- const quote = await this.getQuoteFromDefillama(params);
87
- return quote;
99
+ if (e instanceof IntentNotViableError) throw e;
100
+ console.error('Error getting quote from routers:', e);
101
+ throw new Error('Failed to get quote from routers');
88
102
  }
89
103
  }
90
104
 
91
- public static async getQuote(params: IntentsQuoteParams): Promise<QuoteResponse> {
92
- return this.getQuoteWithDefillamaFallback(params);
93
- }
94
-
95
105
  /**
96
106
  * Get a quote for Solana with explicit provider selection
97
107
  * @param params - Quote parameters including provider preference
@@ -102,7 +112,7 @@ export class QuoteProvider {
102
112
  tokenIn: string;
103
113
  tokenOut: string;
104
114
  slippageBps?: number;
105
- provider?: 'jupiter' | 'raydium';
115
+ provider?: 'jupiter' | 'raydium' | 'pumpfun';
106
116
  }): Promise<Quote> {
107
117
  const singleChainParams: SingleChainQuoteParams = {
108
118
  chainId: ChainID.Solana,
@@ -116,39 +126,57 @@ export class QuoteProvider {
116
126
  return this.getSingleChainQuote(singleChainParams);
117
127
  }
118
128
 
119
- private static async getQuoteFromRouters(params: IntentsQuoteParams): Promise<QuoteResponse> {
120
- const bridgeTokenSymbol = QuoteProvider.DEFAULT_BRIDGE_TOKEN;
121
-
122
- const sourceBridgeToken = CROSS_CHAIN_TOKENS[bridgeTokenSymbol]?.[params.sourceChainId] || '';
123
- const destBridgeToken = CROSS_CHAIN_TOKENS[bridgeTokenSymbol]?.[params.destChainId] || '';
129
+ private static async getQuoteFromRouters(params: IntentsQuoteParams): Promise<QuoteResponseInternal> {
130
+ const sourceStable = getStableForChain(params.sourceChainId);
131
+ const destStable = getStableForChain(params.destChainId);
124
132
 
133
+ // Step 1: Get quote from tokenIn → bridge stable on source chain ---
125
134
  const sourceSingleChainQuoteParams: SingleChainQuoteParams = {
126
135
  chainId: params.sourceChainId,
127
136
  amount: params.amount,
128
137
  tokenIn: params.tokenIn,
129
- tokenOut: sourceBridgeToken,
138
+ tokenOut: sourceStable.address,
130
139
  };
131
140
 
132
- const sourceQuote = await this.getSingleChainQuote(sourceSingleChainQuoteParams);
141
+ const [sourceQuote, expenses] = await Promise.all([
142
+ this.getSingleChainQuote(sourceSingleChainQuoteParams),
143
+ estimateExpensesInTokenOut({
144
+ chainId: params.destChainId,
145
+ tokenOut: params.tokenOut,
146
+ gasLimit: EVM_CROSS_CHAIN_GAS_LIMIT,
147
+ getQuote: (p) => this.getSingleChainQuote(p),
148
+ }),
149
+ ]);
150
+
151
+ // Step 2: Normalize stable amount between source and destination ---
152
+ // Adjust for decimal difference between stables (e.g. 6 → 18)
153
+ const normalizedBridgeAmount = convertDecimals(
154
+ sourceQuote.amountOut,
155
+ sourceStable.decimals,
156
+ destStable.decimals,
157
+ );
133
158
 
159
+ // Step 3: Get quote from dest bridge stable → target token ---
134
160
  const destSingleChainQuoteParams: SingleChainQuoteParams = {
135
161
  chainId: params.destChainId,
136
- amount: sourceQuote.amountOut,
137
- tokenIn: destBridgeToken,
162
+ amount: normalizedBridgeAmount,
163
+ tokenIn: destStable.address,
138
164
  tokenOut: params.tokenOut,
139
165
  };
140
166
 
141
167
  const destQuote = await this.getSingleChainQuote(destSingleChainQuoteParams);
142
168
 
143
- // Use weighted reduction instead of fixed percentage
144
- const weightedReductionFactor = this.calculateWeightedReductionFactorForUsd(destQuote.amountOutUsd);
145
-
146
- const estimatedAmountOutReduced = BigInt(Math.floor(Number(destQuote.amountOut) * weightedReductionFactor));
147
- const estimatedAmountOutUsdReduced = destQuote.amountOutUsd * weightedReductionFactor;
148
-
149
- const reducedAmountInUsd = this.calculateWeightedReductionFactorForUsd(sourceQuote.amountInUsd);
169
+ // Step 4: Compute stable min-amount with correct decimals ---
150
170
  const estimatedAmountInAsMinStablecoinAmount = BigInt(
151
- Math.floor(reducedAmountInUsd * 10 ** this.DEFAULT_BRIDGE_TOKEN_DECIMALS),
171
+ Math.floor(sourceQuote.amountInUsd * 10 ** sourceStable.decimals),
172
+ );
173
+
174
+ const swapOutput = destQuote.amountOutMin ?? destQuote.amountOut;
175
+ const estimatedAmountOutReduced = estimateAmountOut(
176
+ swapOutput,
177
+ DEFAULT_COMMISSION_BPS,
178
+ expenses,
179
+ CROSS_CHAIN_COMMISSION_DENOMINATOR,
152
180
  );
153
181
 
154
182
  return {
@@ -157,16 +185,23 @@ export class QuoteProvider {
157
185
  amountInUsd: sourceQuote.amountInUsd,
158
186
  estimatedAmountInAsMinStablecoinAmount,
159
187
  estimatedAmountOutReduced,
160
- estimatedAmountOutUsdReduced,
188
+ estimatedAmountOutUsdReduced: destQuote.amountOutUsd,
161
189
  };
162
190
  }
163
191
 
164
192
  public static async getSingleChainQuote(params: SingleChainQuoteParams): Promise<Quote> {
193
+ // Handle same-token case (self-swap)
165
194
  if (compareAddresses(params.tokenIn, params.tokenOut)) {
166
195
  let amountUsd = 0;
167
196
 
168
- if (compareAddresses(params.tokenIn, CROSS_CHAIN_TOKENS.USDC![params.chainId])) {
169
- amountUsd = Number(params.amount) / 10 ** this.DEFAULT_BRIDGE_TOKEN_DECIMALS;
197
+ // Pick correct stable for this chain
198
+ const stable = getStableForChain(params.chainId);
199
+ const stableAddress = stable.address;
200
+ const stableDecimals = stable.decimals;
201
+
202
+ // If it's the chain's stable token, derive USD value correctly
203
+ if (compareAddresses(params.tokenIn, stableAddress)) {
204
+ amountUsd = Number(params.amount) / 10 ** stableDecimals;
170
205
  }
171
206
 
172
207
  return {
@@ -181,44 +216,53 @@ export class QuoteProvider {
181
216
  };
182
217
  }
183
218
 
219
+ // Hyperliquid
184
220
  if (params.chainId === ChainID.Hyperliquid) {
185
221
  const liquidSwapQuote = await QuoteProvider.getLiquidSwapQuote(params);
186
222
  return QuoteProvider.transformLiquidSwapQuote(liquidSwapQuote);
187
223
  }
188
224
 
225
+ // Solana (Jupiter / Raydium / Pumpfun)
189
226
  if (params.chainId === ChainID.Solana) {
190
- // Check if provider is explicitly specified
191
227
  if (params.provider === 'jupiter') {
192
228
  const jupiterQuote = await QuoteProvider.getJupiterQuote(params);
193
229
  return QuoteProvider.transformJupiterQuote(jupiterQuote);
194
230
  } else if (params.provider === 'raydium') {
195
231
  const raydiumQuote = await QuoteProvider.getRaydiumQuote(params);
196
- return QuoteProvider.transformRaydiumQuote(raydiumQuote);
232
+ return raydiumQuote;
233
+ } else if (params.provider === 'pumpfun') {
234
+ const pumpfunQuote = await QuoteProvider.getPumpFunQuote(params);
235
+ return pumpfunQuote;
197
236
  } else {
198
- // Default: Try Jupiter first, fallback to Raydium if it fails
199
237
  try {
200
238
  const jupiterQuote = await QuoteProvider.getJupiterQuote(params);
201
- if(!jupiterQuote.quote) {
202
- throw new Error('Jupiter quote failed');
203
- }
204
-
205
- const transformedQuote = QuoteProvider.transformJupiterQuote(jupiterQuote);
206
- return transformedQuote;
239
+ if (!jupiterQuote.quote) throw new Error('Jupiter quote failed');
240
+ return QuoteProvider.transformJupiterQuote(jupiterQuote);
207
241
  } catch (error) {
208
242
  console.warn('Jupiter quote failed, falling back to Raydium:', error);
209
- const raydiumQuote = await QuoteProvider.getRaydiumQuote(params);
210
- const transformedQuote = QuoteProvider.transformRaydiumQuote(raydiumQuote);
211
- return transformedQuote;
243
+ try {
244
+ const raydiumQuote = await QuoteProvider.getRaydiumQuote(params);
245
+ return raydiumQuote;
246
+ } catch {
247
+ const pumpfunQuote = await QuoteProvider.getPumpFunQuote(params);
248
+ return pumpfunQuote;
249
+ }
212
250
  }
213
251
  }
214
252
  }
215
253
 
254
+ // Sui (Aftermath)
216
255
  if (params.chainId === ChainID.Sui) {
217
256
  const quote = await QuoteProvider.getAftermathQuote(params);
218
257
  return QuoteProvider.transformAftermathQuote({ quote, request: params });
219
258
  }
220
259
 
260
+ // EVM chains (Paraswap)
221
261
  if (isEvmChain(params.chainId)) {
262
+ if (params.chainId === ChainID.MONAD) {
263
+ const relayQuote = await QuoteProvider.getRelayQuote(params);
264
+ return QuoteProvider.transformRelayQuote(relayQuote);
265
+ }
222
266
  const paraswapQuote = await QuoteProvider.getParaswapQuote(params);
223
267
  return QuoteProvider.transformParaswapQuote(paraswapQuote);
224
268
  }
@@ -228,8 +272,8 @@ export class QuoteProvider {
228
272
 
229
273
  static transformLiquidSwapQuote(liquidSwapQuote: LiquidSwapQuoteResponse): Quote {
230
274
  return {
231
- amountIn: BigInt(liquidSwapQuote.amountIn),
232
- amountOut: BigInt(liquidSwapQuote.amountOut),
275
+ amountIn: liquidSwapQuote.execution.details.amountIn,
276
+ amountOut: liquidSwapQuote.execution.details.amountOut,
233
277
  amountOutUsd: 0,
234
278
  amountInUsd: 0,
235
279
  slippage: 0,
@@ -263,7 +307,7 @@ export class QuoteProvider {
263
307
  return liquidSwapQuoter.getQuote({
264
308
  tokenIn: params.tokenIn,
265
309
  tokenOut: params.tokenOut,
266
- amountIn: params.amount.toString(),
310
+ amountIn: params.amount,
267
311
  });
268
312
  }
269
313
 
@@ -275,7 +319,7 @@ export class QuoteProvider {
275
319
  tokenIn: params.tokenIn,
276
320
  tokenOut: params.tokenOut,
277
321
  swapMode: 'ExactIn',
278
- slippageBps: params.slippageBps,
322
+ slippageBps: params.slippageBps ? params.slippageBps : 20, // Default 0.2% slippage
279
323
  });
280
324
  }
281
325
 
@@ -289,7 +333,15 @@ export class QuoteProvider {
289
333
  side: 'SELL',
290
334
  });
291
335
  }
336
+ protected static async getRelayQuote(params: SingleChainQuoteParams) {
337
+ const relayQuoter = new RelayQuoteProvider(params.chainId as SupportedEvmChain);
292
338
 
339
+ return relayQuoter.getSwapEstimation({
340
+ amount: BigInt(params.amount),
341
+ srcToken: params.tokenIn,
342
+ destToken: params.tokenOut,
343
+ });
344
+ }
293
345
  protected static async getAftermathQuote(params: SingleChainQuoteParams) {
294
346
  const aftermathQuoter = new AftermathQuoteProvider();
295
347
 
@@ -300,15 +352,34 @@ export class QuoteProvider {
300
352
  });
301
353
  }
302
354
 
303
- protected static async getRaydiumQuote(params: SingleChainQuoteParams) {
355
+ //TODO: For Raydium and Pump we are applying slippage twice if there are 2 swaps (e.g., USDC -> SOL -> Token), should we just apply half and half on each swap?
356
+
357
+ protected static async getRaydiumQuote(params: SingleChainQuoteParams): Promise<Quote> {
304
358
  const raydiumQuoter = new RaydiumQuoteProvider();
359
+ let request: RaydiumPumpQuoteParams = {
360
+ inputMint: params.tokenIn,
361
+ outputMint: params.tokenOut,
362
+ amount: params.amount.toString(),
363
+ slippageBps: params.slippageBps || 20, // Default 0.2% slippage
364
+ };
365
+ try {
366
+ return this.transformRaydiumQuote(await raydiumQuoter.getQuote(request));
367
+ } catch (e) {
368
+ console.log('Raydium AMM quote cannot find a route, trying with prebonded raydium');
369
+ return simpleQuoteToQuote(await raydiumQuoter.getQuotePrebonded(request), 'raydium');
370
+ }
371
+ }
372
+
373
+ protected static async getPumpFunQuote(params: SingleChainQuoteParams): Promise<Quote> {
374
+ const pumpfunQuoter = new PumpFunQuoteProvider();
305
375
 
306
- return raydiumQuoter.getQuote({
376
+ let request: RaydiumPumpQuoteParams = {
307
377
  inputMint: params.tokenIn,
308
378
  outputMint: params.tokenOut,
309
379
  amount: params.amount.toString(),
310
- slippageBps: params.slippageBps || 50, // Default 0.5% slippage
311
- });
380
+ slippageBps: params.slippageBps || 20, // Default 0.2% slippage
381
+ };
382
+ return simpleQuoteToQuote(await pumpfunQuoter.getQuote(request), 'pumpfun');
312
383
  }
313
384
 
314
385
  private static transformAftermathQuote({
@@ -318,14 +389,18 @@ export class QuoteProvider {
318
389
  quote: RouterCompleteTradeRoute;
319
390
  request: SingleChainQuoteParams;
320
391
  }): Quote {
321
- let amountUsd = 0;
392
+ const chainId = request.chainId;
393
+ const stable = getStableForChain(chainId);
394
+ const stableAddress = stable.address;
395
+ const stableDecimals = stable.decimals;
322
396
 
323
- if (compareAddresses(request.tokenIn, CROSS_CHAIN_TOKENS.USDC![request.chainId])) {
324
- amountUsd = Number(quote.coinIn.amount) / 10 ** this.DEFAULT_BRIDGE_TOKEN_DECIMALS;
325
- }
397
+ let amountUsd = 0;
326
398
 
327
- if (compareAddresses(request.tokenOut, CROSS_CHAIN_TOKENS.USDC![request.chainId])) {
328
- amountUsd = Number(quote.coinOut.amount) / 10 ** this.DEFAULT_BRIDGE_TOKEN_DECIMALS;
399
+ // Determine if input or output token is the stablecoin
400
+ if (compareAddresses(request.tokenIn, stableAddress)) {
401
+ amountUsd = Number(quote.coinIn.amount) / 10 ** stableDecimals;
402
+ } else if (compareAddresses(request.tokenOut, stableAddress)) {
403
+ amountUsd = Number(quote.coinOut.amount) / 10 ** stableDecimals;
329
404
  }
330
405
 
331
406
  return {
@@ -352,25 +427,72 @@ export class QuoteProvider {
352
427
  rawQuote: paraswapQuote,
353
428
  };
354
429
  }
430
+ private static transformRelayQuote(data: any): Quote {
431
+ const relayQuote = data.quote;
432
+ // If details missing → fallback zero quote
433
+ if (!relayQuote || !relayQuote.details) {
434
+ return {
435
+ amountIn: 0n,
436
+ amountOut: 0n,
437
+ amountOutUsd: 0,
438
+ amountInUsd: 0,
439
+ slippage: 0,
440
+ priceImpact: 0,
441
+ provider: 'relay',
442
+ rawQuote: relayQuote,
443
+ };
444
+ }
445
+
446
+ const details = relayQuote.details;
447
+
448
+ const amountIn = details?.currencyIn?.amount ? BigInt(details.currencyIn.amount) : 0n;
449
+
450
+ const amountOut = details?.currencyOut?.amount ? BigInt(details.currencyOut.amount) : 0n;
451
+
452
+ const amountInUsd = details?.currencyIn?.amountUsd ? Number(details.currencyIn.amountUsd) : 0;
453
+
454
+ const amountOutUsd = details?.currencyOut?.amountUsd ? Number(details.currencyOut.amountUsd) : 0;
455
+
456
+ const slippage = details?.slippageTolerance?.origin?.percent ? Number(details.slippageTolerance.origin.percent) : 0;
355
457
 
356
- private static transformJupiterQuote({ quote }: { quote: JupiterQuoteResponse }): Quote {
458
+ const priceImpact = details?.totalImpact?.percent ? Number(details.totalImpact.percent) : 0;
459
+
460
+ return {
461
+ amountIn,
462
+ amountOut,
463
+ amountInUsd,
464
+ amountOutUsd,
465
+ slippage,
466
+ priceImpact,
467
+ provider: 'relay',
468
+ rawQuote: relayQuote,
469
+ };
470
+ }
471
+
472
+ public static transformJupiterQuote({ quote }: { quote: JupiterQuoteResponse }): Quote {
357
473
  const amountIn = Number(quote.inAmount);
358
474
  const amountOut = Number(quote.outAmount);
359
-
475
+ const amountOutMin = Number(quote.otherAmountThreshold);
476
+
477
+ const chainId = ChainID.Solana; // Jupiter runs only on Solana
478
+ const stable = getStableForChain(chainId);
479
+ const stableAddress = stable.address;
480
+ const stableDecimals = stable.decimals;
481
+
360
482
  let amountUsd = 0;
361
483
  const priceImpact = quote.priceImpactPct ? Number(quote.priceImpactPct) * 100 : 0;
362
484
 
363
- if (compareAddresses(quote.outputMint, CROSS_CHAIN_TOKENS.USDC![ChainID.Solana])) {
364
- amountUsd = amountOut / 10 ** this.DEFAULT_BRIDGE_TOKEN_DECIMALS;
365
- }
366
-
367
- if (compareAddresses(quote.inputMint, CROSS_CHAIN_TOKENS.USDC![ChainID.Solana])) {
368
- amountUsd = amountIn / 10 ** this.DEFAULT_BRIDGE_TOKEN_DECIMALS;
485
+ // Use stable decimals dynamically for USD conversions
486
+ if (compareAddresses(quote.outputMint, stableAddress)) {
487
+ amountUsd = amountOut / 10 ** stableDecimals;
488
+ } else if (compareAddresses(quote.inputMint, stableAddress)) {
489
+ amountUsd = amountIn / 10 ** stableDecimals;
369
490
  }
370
491
 
371
492
  return {
372
493
  amountIn: BigInt(amountIn),
373
494
  amountOut: BigInt(amountOut),
495
+ amountOutMin: BigInt(amountOutMin),
374
496
  amountOutUsd: amountUsd,
375
497
  amountInUsd: amountUsd,
376
498
  slippage: quote.slippageBps ? quote.slippageBps / 100 : 0,
@@ -381,22 +503,27 @@ export class QuoteProvider {
381
503
  }
382
504
 
383
505
  private static transformRaydiumQuote(raydiumQuote: RaydiumQuoteResponse): Quote {
384
- const amountIn = Number(raydiumQuote.data.inAmount);
385
- const amountOut = Number(raydiumQuote.data.outAmount);
506
+ const amountIn = BigInt(raydiumQuote.data.inAmount);
507
+ const amountOut = BigInt(raydiumQuote.data.outAmount);
508
+
509
+ const chainId = ChainID.Solana; // Raydium runs on Solana
510
+ const stable = getStableForChain(chainId);
511
+ const stableAddress = stable.address;
512
+ const stableDecimals = stable.decimals;
513
+
386
514
  let amountUsd = 0;
387
515
  const priceImpact = Number(raydiumQuote.data.priceImpactPct) * 100;
388
516
 
389
- if (compareAddresses(raydiumQuote.data.outputMint, CROSS_CHAIN_TOKENS.USDC![ChainID.Solana])) {
390
- amountUsd = amountOut / 10 ** this.DEFAULT_BRIDGE_TOKEN_DECIMALS;
391
- }
392
-
393
- if (compareAddresses(raydiumQuote.data.inputMint, CROSS_CHAIN_TOKENS.USDC![ChainID.Solana])) {
394
- amountUsd = amountIn / 10 ** this.DEFAULT_BRIDGE_TOKEN_DECIMALS;
517
+ // Determine if the input or output is the stablecoin (USDC/USDT)
518
+ if (compareAddresses(raydiumQuote.data.outputMint, stableAddress)) {
519
+ amountUsd = Number(amountOut) / 10 ** stableDecimals;
520
+ } else if (compareAddresses(raydiumQuote.data.inputMint, stableAddress)) {
521
+ amountUsd = Number(amountIn) / 10 ** stableDecimals;
395
522
  }
396
523
 
397
524
  return {
398
- amountIn: BigInt(amountIn),
399
- amountOut: BigInt(amountOut),
525
+ amountIn,
526
+ amountOut,
400
527
  amountOutUsd: amountUsd,
401
528
  amountInUsd: amountUsd,
402
529
  slippage: raydiumQuote.data.slippageBps / 100,
@@ -407,15 +534,48 @@ export class QuoteProvider {
407
534
  }
408
535
  }
409
536
 
537
+ function getStableForChain(chainId: ChainID) {
538
+ // Prefer USDC if available, else USDT
539
+ if (CROSS_CHAIN_STABLES.USDC?.[chainId]) {
540
+ return { symbol: 'USDC', ...CROSS_CHAIN_STABLES.USDC[chainId] };
541
+ }
542
+ if (CROSS_CHAIN_STABLES.USDT?.[chainId]) {
543
+ return { symbol: 'USDT', ...CROSS_CHAIN_STABLES.USDT[chainId] };
544
+ }
545
+ throw new Error(`No stablecoin found for chain ${chainId}`);
546
+ }
410
547
  function getProviderNameByChainId(chainId: ChainID): RouteProvider {
411
548
  switch (chainId) {
412
549
  case ChainID.Sui:
413
550
  return 'aftermath';
414
551
  case ChainID.Solana:
415
- return 'jupiter'; // Primary provider, with Raydium as fallback
552
+ return 'jupiter'; // Primary provider, with Raydium and Pumpfun as fallbacks
416
553
  case ChainID.Hyperliquid:
417
554
  return 'liquidswap';
418
555
  default:
419
556
  return 'paraswap';
420
557
  }
421
558
  }
559
+
560
+ export function quoteToSimpleQuote(quote: Quote): SimpleQuote {
561
+ return {
562
+ amountIn: quote.amountIn,
563
+ amountOut: quote.amountOut,
564
+ amountOutMin: quote.amountOutMin,
565
+ slippage: quote.slippage,
566
+ };
567
+ }
568
+
569
+ export function simpleQuoteToQuote(simpleQuote: SimpleQuote, provider: RouteProvider): Quote {
570
+ return {
571
+ amountIn: simpleQuote.amountIn,
572
+ amountOut: simpleQuote.amountOut,
573
+ amountOutMin: simpleQuote.amountOutMin,
574
+ slippage: simpleQuote.slippage,
575
+ amountInUsd: 0,
576
+ amountOutUsd: 0,
577
+ priceImpact: 0,
578
+ provider,
579
+ rawQuote: simpleQuote,
580
+ };
581
+ }
@@ -1,10 +1,12 @@
1
+ import { formatUnits } from 'viem';
1
2
  import { ChainID } from '../../chains.js';
2
3
  import { isNativeEvmToken, WRAPPED_ETH_ADDRESSES } from '../../constants.js';
4
+ import { CROSS_CHAIN_STABLES } from './stablecoins-tokens.js';
3
5
 
4
6
  type LiquidSwapQuoteParams = {
5
7
  tokenIn: string;
6
8
  tokenOut: string;
7
- amountIn: string;
9
+ amountIn: bigint;
8
10
  };
9
11
 
10
12
  export type LiquidSwapQuoteResponse = {
@@ -12,31 +14,58 @@ export type LiquidSwapQuoteResponse = {
12
14
  amountIn: string;
13
15
  amountOut: string;
14
16
  averagePriceImpact: string;
17
+ execution: any;
15
18
  };
16
19
 
17
20
  const LIQUID_SWAP_API_URL = 'https://api.liqd.ag';
18
21
 
19
22
  export class LiquidSwapQuoteProvider {
20
- public async getQuote(liquidSwapParams: LiquidSwapQuoteParams): Promise<LiquidSwapQuoteResponse> {
21
- const params = { ...liquidSwapParams };
23
+ public async getQuote(params: LiquidSwapQuoteParams): Promise<LiquidSwapQuoteResponse> {
24
+ const chainId = ChainID.Hyperliquid;
25
+ let tokenIn = params.tokenIn;
26
+ let tokenOut = params.tokenOut;
22
27
 
23
- if (isNativeEvmToken(params.tokenOut)) {
24
- params.tokenOut = WRAPPED_ETH_ADDRESSES[ChainID.Hyperliquid];
28
+ // 1️ Wrap native tokens if needed
29
+ if (isNativeEvmToken(tokenIn)) {
30
+ tokenIn = WRAPPED_ETH_ADDRESSES[chainId];
25
31
  }
26
-
27
- if (isNativeEvmToken(params.tokenIn)) {
28
- params.tokenIn = WRAPPED_ETH_ADDRESSES[ChainID.Hyperliquid];
32
+ if (isNativeEvmToken(tokenOut)) {
33
+ tokenOut = WRAPPED_ETH_ADDRESSES[chainId];
29
34
  }
30
35
 
31
- const url = `${LIQUID_SWAP_API_URL}/v2/route?tokenIn=${params.tokenIn}&tokenOut=${params.tokenOut}&amountIn=${params.amountIn}`;
36
+ // 2️Detect decimals
37
+ const tokenInDecimals = this.getTokenDecimals(tokenIn, chainId);
38
+
39
+ // 3️ Convert amountIn (wei → human)
40
+ const formattedAmountIn = formatUnits(BigInt(params.amountIn), tokenInDecimals);
41
+
42
+ // 4️ Build request URL — amountIn should still be in base units for API
43
+ const url = `${LIQUID_SWAP_API_URL}/v2/route?tokenIn=${tokenIn}&tokenOut=${tokenOut}&amountIn=${formattedAmountIn}`;
44
+
32
45
  const response = await fetch(url);
46
+ if (!response.ok) throw new Error('Failed to fetch quote from LiquidSwap API');
47
+
48
+ const data = await response.json();
33
49
 
34
- if (!response.ok) {
35
- throw new Error('Failed to fetch quote from LiquidSwap API');
50
+ return data;
51
+ }
52
+
53
+ private getTokenDecimals(addressOrSymbol: string, chainId: ChainID): number {
54
+ const lower = addressOrSymbol.toLowerCase();
55
+
56
+ // Match by address
57
+ for (const symbol in CROSS_CHAIN_STABLES) {
58
+ const stable = CROSS_CHAIN_STABLES[symbol]?.[chainId];
59
+ if (stable && stable.address.toLowerCase() === lower) {
60
+ return stable.decimals;
61
+ }
36
62
  }
37
63
 
38
- const data: LiquidSwapQuoteResponse = await response.json();
64
+ // Match by symbol
65
+ const stableBySymbol = CROSS_CHAIN_STABLES[addressOrSymbol.toUpperCase()]?.[chainId];
66
+ if (stableBySymbol?.decimals) return stableBySymbol.decimals;
39
67
 
40
- return data;
68
+ // Default fallback
69
+ return 18;
41
70
  }
42
71
  }
@@ -10,6 +10,8 @@ const rpcProvidersUrl: Record<SupportedEvmChain, string> = {
10
10
  [ChainID.Optimism]: 'https://optimism-rpc.publicnode.com',
11
11
  [ChainID.Base]: 'https://base-rpc.publicnode.com',
12
12
  [ChainID.Hyperliquid]: 'https://rpc.hyperliquid.xyz/evm',
13
+ [ChainID.BSC]: 'https://bsc-dataseed.ninicoin.io',
14
+ [ChainID.MONAD]: 'https://rpc4.monad.xyz',
13
15
  };
14
16
 
15
17
  export type ParaswapQuoteRequestParams = {