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