@whetstone-research/doppler-sdk 0.0.24 → 1.0.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 (445) hide show
  1. package/README.md +69 -0
  2. package/dist/chunk-LIXSTCMM.js +974 -0
  3. package/dist/chunk-LIXSTCMM.js.map +1 -0
  4. package/dist/chunk-PZ5AY32C.js +9 -0
  5. package/dist/{chunk-4XN6DQBW.js.map → chunk-PZ5AY32C.js.map} +1 -1
  6. package/dist/chunk-T46KDO65.js +322 -0
  7. package/dist/chunk-T46KDO65.js.map +1 -0
  8. package/dist/evm/index.d.ts +8533 -0
  9. package/dist/evm/index.js +15230 -0
  10. package/dist/evm/index.js.map +1 -0
  11. package/dist/oracle-B2LV97ff.d.ts +826 -0
  12. package/dist/pda-LKHUH6JK.js +4 -0
  13. package/dist/pda-LKHUH6JK.js.map +1 -0
  14. package/dist/solana/index.d.ts +2534 -0
  15. package/dist/solana/index.js +2298 -0
  16. package/dist/solana/index.js.map +1 -0
  17. package/dist/solana/react/index.d.ts +1046 -0
  18. package/dist/solana/react/index.js +1436 -0
  19. package/dist/solana/react/index.js.map +1 -0
  20. package/package.json +36 -20
  21. package/dist/DopplerSDK.d.mts +0 -106
  22. package/dist/DopplerSDK.d.ts +0 -106
  23. package/dist/DopplerSDK.js +0 -53
  24. package/dist/DopplerSDK.js.map +0 -1
  25. package/dist/DopplerSDK.mjs +0 -44
  26. package/dist/DopplerSDK.mjs.map +0 -1
  27. package/dist/abis/bytecodes/derc20.d.mts +0 -3
  28. package/dist/abis/bytecodes/derc20.d.ts +0 -3
  29. package/dist/abis/bytecodes/derc20.js +0 -9
  30. package/dist/abis/bytecodes/derc20.js.map +0 -1
  31. package/dist/abis/bytecodes/derc20.mjs +0 -3
  32. package/dist/abis/bytecodes/derc20.mjs.map +0 -1
  33. package/dist/abis/bytecodes/derc2080.d.mts +0 -3
  34. package/dist/abis/bytecodes/derc2080.d.ts +0 -3
  35. package/dist/abis/bytecodes/derc2080.js +0 -9
  36. package/dist/abis/bytecodes/derc2080.js.map +0 -1
  37. package/dist/abis/bytecodes/derc2080.mjs +0 -3
  38. package/dist/abis/bytecodes/derc2080.mjs.map +0 -1
  39. package/dist/abis/bytecodes/doppler.d.mts +0 -3
  40. package/dist/abis/bytecodes/doppler.d.ts +0 -3
  41. package/dist/abis/bytecodes/doppler.js +0 -9
  42. package/dist/abis/bytecodes/doppler.js.map +0 -1
  43. package/dist/abis/bytecodes/doppler.mjs +0 -3
  44. package/dist/abis/bytecodes/doppler.mjs.map +0 -1
  45. package/dist/abis/bytecodes/dopplerDN404.d.mts +0 -3
  46. package/dist/abis/bytecodes/dopplerDN404.d.ts +0 -3
  47. package/dist/abis/bytecodes/dopplerDN404.js +0 -9
  48. package/dist/abis/bytecodes/dopplerDN404.js.map +0 -1
  49. package/dist/abis/bytecodes/dopplerDN404.mjs +0 -3
  50. package/dist/abis/bytecodes/dopplerDN404.mjs.map +0 -1
  51. package/dist/abis/bytecodes/stateView.d.mts +0 -3
  52. package/dist/abis/bytecodes/stateView.d.ts +0 -3
  53. package/dist/abis/bytecodes/stateView.js +0 -9
  54. package/dist/abis/bytecodes/stateView.js.map +0 -1
  55. package/dist/abis/bytecodes/stateView.mjs +0 -3
  56. package/dist/abis/bytecodes/stateView.mjs.map +0 -1
  57. package/dist/abis/bytecodes.d.mts +0 -5
  58. package/dist/abis/bytecodes.d.ts +0 -5
  59. package/dist/abis/bytecodes.js +0 -33
  60. package/dist/abis/bytecodes.js.map +0 -1
  61. package/dist/abis/bytecodes.mjs +0 -8
  62. package/dist/abis/bytecodes.mjs.map +0 -1
  63. package/dist/abis/index.d.mts +0 -3871
  64. package/dist/abis/index.d.ts +0 -3871
  65. package/dist/abis/index.js +0 -130
  66. package/dist/abis/index.js.map +0 -1
  67. package/dist/abis/index.mjs +0 -9
  68. package/dist/abis/index.mjs.map +0 -1
  69. package/dist/addresses.d.mts +0 -69
  70. package/dist/addresses.d.ts +0 -69
  71. package/dist/addresses.js +0 -29
  72. package/dist/addresses.js.map +0 -1
  73. package/dist/addresses.mjs +0 -4
  74. package/dist/addresses.mjs.map +0 -1
  75. package/dist/builders/DynamicAuctionBuilder.d.mts +0 -138
  76. package/dist/builders/DynamicAuctionBuilder.d.ts +0 -138
  77. package/dist/builders/DynamicAuctionBuilder.js +0 -35
  78. package/dist/builders/DynamicAuctionBuilder.js.map +0 -1
  79. package/dist/builders/DynamicAuctionBuilder.mjs +0 -26
  80. package/dist/builders/DynamicAuctionBuilder.mjs.map +0 -1
  81. package/dist/builders/MulticurveBuilder.d.mts +0 -196
  82. package/dist/builders/MulticurveBuilder.d.ts +0 -196
  83. package/dist/builders/MulticurveBuilder.js +0 -35
  84. package/dist/builders/MulticurveBuilder.js.map +0 -1
  85. package/dist/builders/MulticurveBuilder.mjs +0 -26
  86. package/dist/builders/MulticurveBuilder.mjs.map +0 -1
  87. package/dist/builders/StaticAuctionBuilder.d.mts +0 -131
  88. package/dist/builders/StaticAuctionBuilder.d.ts +0 -131
  89. package/dist/builders/StaticAuctionBuilder.js +0 -35
  90. package/dist/builders/StaticAuctionBuilder.js.map +0 -1
  91. package/dist/builders/StaticAuctionBuilder.mjs +0 -26
  92. package/dist/builders/StaticAuctionBuilder.mjs.map +0 -1
  93. package/dist/builders/index.d.mts +0 -8
  94. package/dist/builders/index.d.ts +0 -8
  95. package/dist/builders/index.js +0 -62
  96. package/dist/builders/index.js.map +0 -1
  97. package/dist/builders/index.mjs +0 -29
  98. package/dist/builders/index.mjs.map +0 -1
  99. package/dist/builders/shared.d.mts +0 -115
  100. package/dist/builders/shared.d.ts +0 -115
  101. package/dist/builders/shared.js +0 -46
  102. package/dist/builders/shared.js.map +0 -1
  103. package/dist/builders/shared.mjs +0 -25
  104. package/dist/builders/shared.mjs.map +0 -1
  105. package/dist/chunk-25GEBO3B.mjs +0 -219
  106. package/dist/chunk-25GEBO3B.mjs.map +0 -1
  107. package/dist/chunk-2A3B3NVB.js +0 -737
  108. package/dist/chunk-2A3B3NVB.js.map +0 -1
  109. package/dist/chunk-3NMGCQJ4.mjs +0 -6
  110. package/dist/chunk-3NMGCQJ4.mjs.map +0 -1
  111. package/dist/chunk-44CYUEPG.js +0 -377
  112. package/dist/chunk-44CYUEPG.js.map +0 -1
  113. package/dist/chunk-4VWQNNNW.js +0 -233
  114. package/dist/chunk-4VWQNNNW.js.map +0 -1
  115. package/dist/chunk-4XN6DQBW.js +0 -4
  116. package/dist/chunk-5GQJRNFL.mjs +0 -40
  117. package/dist/chunk-5GQJRNFL.mjs.map +0 -1
  118. package/dist/chunk-5JHXBDZD.js +0 -265
  119. package/dist/chunk-5JHXBDZD.js.map +0 -1
  120. package/dist/chunk-5TQOT6CW.js +0 -8
  121. package/dist/chunk-5TQOT6CW.js.map +0 -1
  122. package/dist/chunk-65CESA3J.js +0 -46
  123. package/dist/chunk-65CESA3J.js.map +0 -1
  124. package/dist/chunk-6BQY5EPB.js +0 -144
  125. package/dist/chunk-6BQY5EPB.js.map +0 -1
  126. package/dist/chunk-6H6X3VTZ.js +0 -18
  127. package/dist/chunk-6H6X3VTZ.js.map +0 -1
  128. package/dist/chunk-7A4DBBXA.js +0 -311
  129. package/dist/chunk-7A4DBBXA.js.map +0 -1
  130. package/dist/chunk-7M57PU6V.js +0 -28
  131. package/dist/chunk-7M57PU6V.js.map +0 -1
  132. package/dist/chunk-7ZUV6WPX.mjs +0 -3
  133. package/dist/chunk-7ZUV6WPX.mjs.map +0 -1
  134. package/dist/chunk-A2CJYRRQ.js +0 -330
  135. package/dist/chunk-A2CJYRRQ.js.map +0 -1
  136. package/dist/chunk-ABT6AT7C.mjs +0 -16
  137. package/dist/chunk-ABT6AT7C.mjs.map +0 -1
  138. package/dist/chunk-BK3S6SVR.js +0 -2707
  139. package/dist/chunk-BK3S6SVR.js.map +0 -1
  140. package/dist/chunk-BQZTELUX.js +0 -45
  141. package/dist/chunk-BQZTELUX.js.map +0 -1
  142. package/dist/chunk-CFAAYL5M.mjs +0 -26
  143. package/dist/chunk-CFAAYL5M.mjs.map +0 -1
  144. package/dist/chunk-CFXXUZJY.js +0 -275
  145. package/dist/chunk-CFXXUZJY.js.map +0 -1
  146. package/dist/chunk-CWTGQAOG.mjs +0 -72
  147. package/dist/chunk-CWTGQAOG.mjs.map +0 -1
  148. package/dist/chunk-DCWF3EMP.js +0 -171
  149. package/dist/chunk-DCWF3EMP.js.map +0 -1
  150. package/dist/chunk-DOUF6NON.mjs +0 -3
  151. package/dist/chunk-DOUF6NON.mjs.map +0 -1
  152. package/dist/chunk-DQJXCZU2.mjs +0 -318
  153. package/dist/chunk-DQJXCZU2.mjs.map +0 -1
  154. package/dist/chunk-DSYPZETD.js +0 -4
  155. package/dist/chunk-DSYPZETD.js.map +0 -1
  156. package/dist/chunk-F2BYG63D.mjs +0 -145
  157. package/dist/chunk-F2BYG63D.mjs.map +0 -1
  158. package/dist/chunk-FNUBKONK.js +0 -291
  159. package/dist/chunk-FNUBKONK.js.map +0 -1
  160. package/dist/chunk-FOESYJP3.mjs +0 -3
  161. package/dist/chunk-FOESYJP3.mjs.map +0 -1
  162. package/dist/chunk-FXTGIKQG.mjs +0 -3
  163. package/dist/chunk-FXTGIKQG.mjs.map +0 -1
  164. package/dist/chunk-GSBQIVME.mjs +0 -278
  165. package/dist/chunk-GSBQIVME.mjs.map +0 -1
  166. package/dist/chunk-H3B54PFV.mjs +0 -17
  167. package/dist/chunk-H3B54PFV.mjs.map +0 -1
  168. package/dist/chunk-HJFVRV47.js +0 -120
  169. package/dist/chunk-HJFVRV47.js.map +0 -1
  170. package/dist/chunk-IIM2CSDQ.js +0 -147
  171. package/dist/chunk-IIM2CSDQ.js.map +0 -1
  172. package/dist/chunk-IUTIHSLH.mjs +0 -295
  173. package/dist/chunk-IUTIHSLH.mjs.map +0 -1
  174. package/dist/chunk-IUZ3BBQP.mjs +0 -117
  175. package/dist/chunk-IUZ3BBQP.mjs.map +0 -1
  176. package/dist/chunk-IWJOPXYN.mjs +0 -96
  177. package/dist/chunk-IWJOPXYN.mjs.map +0 -1
  178. package/dist/chunk-IX4V4UGW.mjs +0 -141
  179. package/dist/chunk-IX4V4UGW.mjs.map +0 -1
  180. package/dist/chunk-J62YDWIK.js +0 -8
  181. package/dist/chunk-J62YDWIK.js.map +0 -1
  182. package/dist/chunk-JIKAD4YL.js +0 -4
  183. package/dist/chunk-JIKAD4YL.js.map +0 -1
  184. package/dist/chunk-JLUOFAE4.mjs +0 -2531
  185. package/dist/chunk-JLUOFAE4.mjs.map +0 -1
  186. package/dist/chunk-KAZQJ24E.mjs +0 -59
  187. package/dist/chunk-KAZQJ24E.mjs.map +0 -1
  188. package/dist/chunk-KHUE77HC.js +0 -81
  189. package/dist/chunk-KHUE77HC.js.map +0 -1
  190. package/dist/chunk-KOAC3BBP.mjs +0 -11
  191. package/dist/chunk-KOAC3BBP.mjs.map +0 -1
  192. package/dist/chunk-LW3CYA27.mjs +0 -2705
  193. package/dist/chunk-LW3CYA27.mjs.map +0 -1
  194. package/dist/chunk-MEA2C5YX.js +0 -143
  195. package/dist/chunk-MEA2C5YX.js.map +0 -1
  196. package/dist/chunk-MU56HCUI.js +0 -2556
  197. package/dist/chunk-MU56HCUI.js.map +0 -1
  198. package/dist/chunk-OCIY7QEJ.mjs +0 -169
  199. package/dist/chunk-OCIY7QEJ.mjs.map +0 -1
  200. package/dist/chunk-OHA5KJ2M.mjs +0 -6
  201. package/dist/chunk-OHA5KJ2M.mjs.map +0 -1
  202. package/dist/chunk-P25HBGP5.mjs +0 -3
  203. package/dist/chunk-P25HBGP5.mjs.map +0 -1
  204. package/dist/chunk-P563HTVU.js +0 -164
  205. package/dist/chunk-P563HTVU.js.map +0 -1
  206. package/dist/chunk-P7CHGWY7.js +0 -4
  207. package/dist/chunk-P7CHGWY7.js.map +0 -1
  208. package/dist/chunk-PGYTMRP3.js +0 -277
  209. package/dist/chunk-PGYTMRP3.js.map +0 -1
  210. package/dist/chunk-QAPQGDWK.js +0 -8
  211. package/dist/chunk-QAPQGDWK.js.map +0 -1
  212. package/dist/chunk-QHBKRUBY.mjs +0 -328
  213. package/dist/chunk-QHBKRUBY.mjs.map +0 -1
  214. package/dist/chunk-QOYI7WCH.js +0 -120
  215. package/dist/chunk-QOYI7WCH.js.map +0 -1
  216. package/dist/chunk-QRTABC4Z.js +0 -8
  217. package/dist/chunk-QRTABC4Z.js.map +0 -1
  218. package/dist/chunk-QSQGLWNY.mjs +0 -3
  219. package/dist/chunk-QSQGLWNY.mjs.map +0 -1
  220. package/dist/chunk-QUBD6HUZ.mjs +0 -735
  221. package/dist/chunk-QUBD6HUZ.mjs.map +0 -1
  222. package/dist/chunk-RDTIXP6S.mjs +0 -263
  223. package/dist/chunk-RDTIXP6S.mjs.map +0 -1
  224. package/dist/chunk-RLOZWHRR.js +0 -320
  225. package/dist/chunk-RLOZWHRR.js.map +0 -1
  226. package/dist/chunk-RV64M4Q6.mjs +0 -3
  227. package/dist/chunk-RV64M4Q6.mjs.map +0 -1
  228. package/dist/chunk-SWWLOD7Q.mjs +0 -6
  229. package/dist/chunk-SWWLOD7Q.mjs.map +0 -1
  230. package/dist/chunk-T3UA4MJL.js +0 -4
  231. package/dist/chunk-T3UA4MJL.js.map +0 -1
  232. package/dist/chunk-TEWAXP5C.mjs +0 -162
  233. package/dist/chunk-TEWAXP5C.mjs.map +0 -1
  234. package/dist/chunk-THEIRDGE.mjs +0 -273
  235. package/dist/chunk-THEIRDGE.mjs.map +0 -1
  236. package/dist/chunk-U3GOWK6J.mjs +0 -6
  237. package/dist/chunk-U3GOWK6J.mjs.map +0 -1
  238. package/dist/chunk-UPVKABAV.js +0 -19
  239. package/dist/chunk-UPVKABAV.js.map +0 -1
  240. package/dist/chunk-VEIVYUYF.js +0 -4
  241. package/dist/chunk-VEIVYUYF.js.map +0 -1
  242. package/dist/chunk-VKSD3KXF.mjs +0 -275
  243. package/dist/chunk-VKSD3KXF.mjs.map +0 -1
  244. package/dist/chunk-VYSOAGRU.mjs +0 -6
  245. package/dist/chunk-VYSOAGRU.mjs.map +0 -1
  246. package/dist/chunk-WDC53TM7.mjs +0 -305
  247. package/dist/chunk-WDC53TM7.mjs.map +0 -1
  248. package/dist/chunk-WKWP42TD.mjs +0 -39
  249. package/dist/chunk-WKWP42TD.mjs.map +0 -1
  250. package/dist/chunk-WNUB3UTT.js +0 -241
  251. package/dist/chunk-WNUB3UTT.js.map +0 -1
  252. package/dist/chunk-WNWK2QMU.mjs +0 -375
  253. package/dist/chunk-WNWK2QMU.mjs.map +0 -1
  254. package/dist/chunk-WQHTNL5L.js +0 -4
  255. package/dist/chunk-WQHTNL5L.js.map +0 -1
  256. package/dist/chunk-WZF5XNBC.js +0 -297
  257. package/dist/chunk-WZF5XNBC.js.map +0 -1
  258. package/dist/chunk-X3UMAHOJ.js +0 -4
  259. package/dist/chunk-X3UMAHOJ.js.map +0 -1
  260. package/dist/chunk-XMFOZYNI.js +0 -8
  261. package/dist/chunk-XMFOZYNI.js.map +0 -1
  262. package/dist/chunk-XNMXN5SZ.mjs +0 -3
  263. package/dist/chunk-XNMXN5SZ.mjs.map +0 -1
  264. package/dist/chunk-XSJTASPK.js +0 -13
  265. package/dist/chunk-XSJTASPK.js.map +0 -1
  266. package/dist/chunk-YBK6EBA5.mjs +0 -239
  267. package/dist/chunk-YBK6EBA5.mjs.map +0 -1
  268. package/dist/chunk-YYLD3AJ7.js +0 -61
  269. package/dist/chunk-YYLD3AJ7.js.map +0 -1
  270. package/dist/chunk-ZEDJUNC6.mjs +0 -115
  271. package/dist/chunk-ZEDJUNC6.mjs.map +0 -1
  272. package/dist/constants.d.mts +0 -91
  273. package/dist/constants.d.ts +0 -91
  274. package/dist/constants.js +0 -196
  275. package/dist/constants.js.map +0 -1
  276. package/dist/constants.mjs +0 -3
  277. package/dist/constants.mjs.map +0 -1
  278. package/dist/deployments.generated.d.mts +0 -275
  279. package/dist/deployments.generated.d.ts +0 -275
  280. package/dist/deployments.generated.js +0 -12
  281. package/dist/deployments.generated.js.map +0 -1
  282. package/dist/deployments.generated.mjs +0 -3
  283. package/dist/deployments.generated.mjs.map +0 -1
  284. package/dist/entities/DopplerFactory.d.mts +0 -272
  285. package/dist/entities/DopplerFactory.d.ts +0 -272
  286. package/dist/entities/DopplerFactory.js +0 -34
  287. package/dist/entities/DopplerFactory.js.map +0 -1
  288. package/dist/entities/DopplerFactory.mjs +0 -25
  289. package/dist/entities/DopplerFactory.mjs.map +0 -1
  290. package/dist/entities/auction/DynamicAuction.d.mts +0 -72
  291. package/dist/entities/auction/DynamicAuction.d.ts +0 -72
  292. package/dist/entities/auction/DynamicAuction.js +0 -21
  293. package/dist/entities/auction/DynamicAuction.js.map +0 -1
  294. package/dist/entities/auction/DynamicAuction.mjs +0 -12
  295. package/dist/entities/auction/DynamicAuction.mjs.map +0 -1
  296. package/dist/entities/auction/MulticurvePool.d.mts +0 -78
  297. package/dist/entities/auction/MulticurvePool.d.ts +0 -78
  298. package/dist/entities/auction/MulticurvePool.js +0 -24
  299. package/dist/entities/auction/MulticurvePool.js.map +0 -1
  300. package/dist/entities/auction/MulticurvePool.mjs +0 -15
  301. package/dist/entities/auction/MulticurvePool.mjs.map +0 -1
  302. package/dist/entities/auction/RehypeDopplerHook.d.mts +0 -57
  303. package/dist/entities/auction/RehypeDopplerHook.d.ts +0 -57
  304. package/dist/entities/auction/RehypeDopplerHook.js +0 -34
  305. package/dist/entities/auction/RehypeDopplerHook.js.map +0 -1
  306. package/dist/entities/auction/RehypeDopplerHook.mjs +0 -25
  307. package/dist/entities/auction/RehypeDopplerHook.mjs.map +0 -1
  308. package/dist/entities/auction/RehypeDopplerHookMigrator.d.mts +0 -48
  309. package/dist/entities/auction/RehypeDopplerHookMigrator.d.ts +0 -48
  310. package/dist/entities/auction/RehypeDopplerHookMigrator.js +0 -34
  311. package/dist/entities/auction/RehypeDopplerHookMigrator.js.map +0 -1
  312. package/dist/entities/auction/RehypeDopplerHookMigrator.mjs +0 -25
  313. package/dist/entities/auction/RehypeDopplerHookMigrator.mjs.map +0 -1
  314. package/dist/entities/auction/StaticAuction.d.mts +0 -44
  315. package/dist/entities/auction/StaticAuction.d.ts +0 -44
  316. package/dist/entities/auction/StaticAuction.js +0 -21
  317. package/dist/entities/auction/StaticAuction.js.map +0 -1
  318. package/dist/entities/auction/StaticAuction.mjs +0 -12
  319. package/dist/entities/auction/StaticAuction.mjs.map +0 -1
  320. package/dist/entities/auction/index.d.mts +0 -9
  321. package/dist/entities/auction/index.d.ts +0 -9
  322. package/dist/entities/auction/index.js +0 -55
  323. package/dist/entities/auction/index.js.map +0 -1
  324. package/dist/entities/auction/index.mjs +0 -30
  325. package/dist/entities/auction/index.mjs.map +0 -1
  326. package/dist/entities/quoter/Quoter.d.mts +0 -150
  327. package/dist/entities/quoter/Quoter.d.ts +0 -150
  328. package/dist/entities/quoter/Quoter.js +0 -21
  329. package/dist/entities/quoter/Quoter.js.map +0 -1
  330. package/dist/entities/quoter/Quoter.mjs +0 -12
  331. package/dist/entities/quoter/Quoter.mjs.map +0 -1
  332. package/dist/entities/quoter/index.d.mts +0 -5
  333. package/dist/entities/quoter/index.d.ts +0 -5
  334. package/dist/entities/quoter/index.js +0 -22
  335. package/dist/entities/quoter/index.js.map +0 -1
  336. package/dist/entities/quoter/index.mjs +0 -13
  337. package/dist/entities/quoter/index.mjs.map +0 -1
  338. package/dist/entities/token/derc20/Derc20.d.mts +0 -102
  339. package/dist/entities/token/derc20/Derc20.d.ts +0 -102
  340. package/dist/entities/token/derc20/Derc20.js +0 -19
  341. package/dist/entities/token/derc20/Derc20.js.map +0 -1
  342. package/dist/entities/token/derc20/Derc20.mjs +0 -10
  343. package/dist/entities/token/derc20/Derc20.mjs.map +0 -1
  344. package/dist/entities/token/derc20/index.d.mts +0 -5
  345. package/dist/entities/token/derc20/index.d.ts +0 -5
  346. package/dist/entities/token/derc20/index.js +0 -20
  347. package/dist/entities/token/derc20/index.js.map +0 -1
  348. package/dist/entities/token/derc20/index.mjs +0 -11
  349. package/dist/entities/token/derc20/index.mjs.map +0 -1
  350. package/dist/entities/token/eth/Eth.d.mts +0 -54
  351. package/dist/entities/token/eth/Eth.d.ts +0 -54
  352. package/dist/entities/token/eth/Eth.js +0 -12
  353. package/dist/entities/token/eth/Eth.js.map +0 -1
  354. package/dist/entities/token/eth/Eth.mjs +0 -3
  355. package/dist/entities/token/eth/Eth.mjs.map +0 -1
  356. package/dist/entities/token/eth/index.d.mts +0 -5
  357. package/dist/entities/token/eth/index.d.ts +0 -5
  358. package/dist/entities/token/eth/index.js +0 -13
  359. package/dist/entities/token/eth/index.js.map +0 -1
  360. package/dist/entities/token/eth/index.mjs +0 -4
  361. package/dist/entities/token/eth/index.mjs.map +0 -1
  362. package/dist/entities/token/index.d.mts +0 -6
  363. package/dist/entities/token/index.d.ts +0 -6
  364. package/dist/entities/token/index.js +0 -27
  365. package/dist/entities/token/index.js.map +0 -1
  366. package/dist/entities/token/index.mjs +0 -14
  367. package/dist/entities/token/index.mjs.map +0 -1
  368. package/dist/index.d.mts +0 -39
  369. package/dist/index.d.ts +0 -39
  370. package/dist/index.js +0 -587
  371. package/dist/index.js.map +0 -1
  372. package/dist/index.mjs +0 -49
  373. package/dist/index.mjs.map +0 -1
  374. package/dist/types.d.mts +0 -662
  375. package/dist/types.d.ts +0 -662
  376. package/dist/types.js +0 -34
  377. package/dist/types.js.map +0 -1
  378. package/dist/types.mjs +0 -5
  379. package/dist/types.mjs.map +0 -1
  380. package/dist/utils/airlock.d.mts +0 -11
  381. package/dist/utils/airlock.d.ts +0 -11
  382. package/dist/utils/airlock.js +0 -26
  383. package/dist/utils/airlock.js.map +0 -1
  384. package/dist/utils/airlock.mjs +0 -5
  385. package/dist/utils/airlock.mjs.map +0 -1
  386. package/dist/utils/balanceDelta.d.mts +0 -10
  387. package/dist/utils/balanceDelta.d.ts +0 -10
  388. package/dist/utils/balanceDelta.js +0 -12
  389. package/dist/utils/balanceDelta.js.map +0 -1
  390. package/dist/utils/balanceDelta.mjs +0 -3
  391. package/dist/utils/balanceDelta.mjs.map +0 -1
  392. package/dist/utils/computeOptimalGamma.d.mts +0 -7
  393. package/dist/utils/computeOptimalGamma.d.ts +0 -7
  394. package/dist/utils/computeOptimalGamma.js +0 -12
  395. package/dist/utils/computeOptimalGamma.js.map +0 -1
  396. package/dist/utils/computeOptimalGamma.mjs +0 -3
  397. package/dist/utils/computeOptimalGamma.mjs.map +0 -1
  398. package/dist/utils/dopplerHookMigrator.d.mts +0 -18
  399. package/dist/utils/dopplerHookMigrator.d.ts +0 -18
  400. package/dist/utils/dopplerHookMigrator.js +0 -20
  401. package/dist/utils/dopplerHookMigrator.js.map +0 -1
  402. package/dist/utils/dopplerHookMigrator.mjs +0 -7
  403. package/dist/utils/dopplerHookMigrator.mjs.map +0 -1
  404. package/dist/utils/index.d.mts +0 -14
  405. package/dist/utils/index.d.ts +0 -14
  406. package/dist/utils/index.js +0 -197
  407. package/dist/utils/index.js.map +0 -1
  408. package/dist/utils/index.mjs +0 -24
  409. package/dist/utils/index.mjs.map +0 -1
  410. package/dist/utils/isToken0Expected.d.mts +0 -13
  411. package/dist/utils/isToken0Expected.d.ts +0 -13
  412. package/dist/utils/isToken0Expected.js +0 -12
  413. package/dist/utils/isToken0Expected.js.map +0 -1
  414. package/dist/utils/isToken0Expected.mjs +0 -3
  415. package/dist/utils/isToken0Expected.mjs.map +0 -1
  416. package/dist/utils/marketCapHelpers.d.mts +0 -259
  417. package/dist/utils/marketCapHelpers.d.ts +0 -259
  418. package/dist/utils/marketCapHelpers.js +0 -58
  419. package/dist/utils/marketCapHelpers.js.map +0 -1
  420. package/dist/utils/marketCapHelpers.mjs +0 -5
  421. package/dist/utils/marketCapHelpers.mjs.map +0 -1
  422. package/dist/utils/poolKey.d.mts +0 -17
  423. package/dist/utils/poolKey.d.ts +0 -17
  424. package/dist/utils/poolKey.js +0 -12
  425. package/dist/utils/poolKey.js.map +0 -1
  426. package/dist/utils/poolKey.mjs +0 -3
  427. package/dist/utils/poolKey.mjs.map +0 -1
  428. package/dist/utils/priceHelpers.d.mts +0 -86
  429. package/dist/utils/priceHelpers.d.ts +0 -86
  430. package/dist/utils/priceHelpers.js +0 -41
  431. package/dist/utils/priceHelpers.js.map +0 -1
  432. package/dist/utils/priceHelpers.mjs +0 -4
  433. package/dist/utils/priceHelpers.mjs.map +0 -1
  434. package/dist/utils/tickMath.d.mts +0 -72
  435. package/dist/utils/tickMath.d.ts +0 -72
  436. package/dist/utils/tickMath.js +0 -60
  437. package/dist/utils/tickMath.js.map +0 -1
  438. package/dist/utils/tickMath.mjs +0 -3
  439. package/dist/utils/tickMath.mjs.map +0 -1
  440. package/dist/utils/tokenAddressMiner.d.mts +0 -37
  441. package/dist/utils/tokenAddressMiner.d.ts +0 -37
  442. package/dist/utils/tokenAddressMiner.js +0 -19
  443. package/dist/utils/tokenAddressMiner.js.map +0 -1
  444. package/dist/utils/tokenAddressMiner.mjs +0 -10
  445. package/dist/utils/tokenAddressMiner.mjs.map +0 -1
@@ -0,0 +1,2534 @@
1
+ import { Address, ReadonlyUint8Array, ProgramDerivedAddress, Instruction, TransactionSigner, Rpc, GetAccountInfoApi, FixedSizeDecoder, FixedSizeEncoder, FixedSizeCodec, Encoder, Decoder, Codec, OptionOrNullable, Option } from '@solana/kit';
2
+ import { A as AmmConfig, P as Pool, a as Position, O as OracleState, S as SwapDirection, b as SwapQuote, c as SwapQuoteExactOut, d as AddLiquidityQuote, R as RemoveLiquidityQuote, M as MarketCapValidationResult, e as MarketCapToCurveParamsInput, C as CurveParams, f as CurveParamsToMarketCapInput, I as InitializeConfigArgs$1, g as InitializePoolArgs, h as InitializeOracleArgs, i as SetFeesArgs, j as SetSentinelArgs, k as SetRouteArgs, T as TransferAdminArgs, l as SwapExactInArgs, m as CreatePositionArgs, n as AddLiquidityArgs, o as RemoveLiquidityArgs, p as CollectFeesArgs, q as CollectProtocolFeesArgs, r as OracleConsultArgs, Q as QuoteToNumeraireArgs, G as GetProgramAccountsRpc } from '../oracle-B2LV97ff.js';
3
+ export { v as AddLiquidityEvent, U as AdminTransferredEvent, x as CollectFeesEvent, y as CollectProtocolFeesEvent, J as FeesUpdatedEvent, ac as FetchOracleConfig, aa as FetchPositionsConfig, s as Observation, K as OracleInitializedEvent, L as OracleUpdatedEvent, ad as OracleWithAddress, V as PausedEvent, z as PoolInitializedEvent, D as PositionClosedEvent, B as PositionCreatedEvent, a9 as PositionValue, ab as PositionWithAddress, w as RemoveLiquidityEvent, N as RouteUpdatedEvent, F as SentinelErrorEvent, E as SentinelInvokedEvent, H as SentinelUpdatedEvent, X as SkimmedEvent, u as SwapEvent, t as TwapResult, W as UnpausedEvent, ak as comparePoolAndOraclePrices, a4 as consultTwap, a2 as fetchOracle, aj as fetchOraclesBatch, $ as fetchPoolPositions, Y as fetchPosition, a0 as fetchPositionByParams, a1 as fetchPositionsBatch, Z as fetchUserPositions, af as filterActivePositions, ah as getOracleAddressFromPool, ai as getOracleAge, a8 as getOracleBufferStats, a6 as getOracleDeviation, a3 as getOracleForPool, a5 as getOracleSpotPrices, ae as getPositionAddressFromParams, _ as getPositionValue, a7 as isOracleStale, ag as sortPositionsByShares } from '../oracle-B2LV97ff.js';
4
+
5
+ /**
6
+ * Program ID for the CPMM AMM
7
+ */
8
+ declare const PROGRAM_ID: Address;
9
+ /**
10
+ * Program ID for the Sentinel program (deployed to devnet)
11
+ */
12
+ declare const SENTINEL_PROGRAM_ID: Address;
13
+ /**
14
+ * SPL Token Program ID
15
+ */
16
+ declare const TOKEN_PROGRAM_ID: Address;
17
+ /**
18
+ * Metaplex Token Metadata Program ID
19
+ */
20
+ declare const TOKEN_METADATA_PROGRAM_ID: Address;
21
+ /**
22
+ * System Program ID
23
+ */
24
+ declare const SYSTEM_PROGRAM_ID: Address;
25
+ /**
26
+ * SPL Associated Token Account Program ID
27
+ */
28
+ declare const ASSOCIATED_TOKEN_PROGRAM_ID: Address;
29
+ /** Basis points denominator (10,000 = 100%) */
30
+ declare const BPS_DENOM = 10000n;
31
+ /** Q64.64 fixed-point representation of 1.0 (2^64) */
32
+ declare const Q64_ONE: bigint;
33
+ /** Current account version */
34
+ declare const ACCOUNT_VERSION = 1;
35
+ /** Maximum number of programs in sentinel allowlist */
36
+ declare const MAX_SENTINEL_ALLOWLIST$1 = 32;
37
+ /** Maximum number of oracle observations (TWAP buffer size) */
38
+ declare const MAX_ORACLE_OBSERVATIONS = 64;
39
+ /** Seed for AmmConfig PDA: ['config'] */
40
+ declare const SEED_CONFIG$1 = "config";
41
+ /** Seed prefix for Pool PDA: ['pool', token0_mint, token1_mint] */
42
+ declare const SEED_POOL = "pool";
43
+ /** Seed prefix for pool authority PDA: ['authority', pool] */
44
+ declare const SEED_AUTHORITY = "authority";
45
+ /** Seed prefix for Position PDA: ['position', pool, owner, position_id] */
46
+ declare const SEED_POSITION = "position";
47
+ /** Seed prefix for OracleState PDA: ['oracle', pool] */
48
+ declare const SEED_ORACLE = "oracle";
49
+ /** Seed prefix for protocol position PDA: ['protocol_position', pool] */
50
+ declare const SEED_PROTOCOL_POSITION = "protocol_position";
51
+ /** Sentinel hook: called before swap */
52
+ declare const SF_BEFORE_SWAP$1: number;
53
+ /** Sentinel hook: called after swap */
54
+ declare const SF_AFTER_SWAP$1: number;
55
+ /** Sentinel hook: called before add liquidity */
56
+ declare const SF_BEFORE_ADD_LIQ: number;
57
+ /** Sentinel hook: called after add liquidity */
58
+ declare const SF_AFTER_ADD_LIQ: number;
59
+ /** Sentinel hook: called before remove liquidity */
60
+ declare const SF_BEFORE_REMOVE_LIQ: number;
61
+ /** Sentinel hook: called after remove liquidity */
62
+ declare const SF_AFTER_REMOVE_LIQ: number;
63
+ /** Sentinel return value indicating "no change" to fee parameter */
64
+ declare const SENTINEL_NO_CHANGE$1 = 65535;
65
+ /** Account is read-only (not writable, not signer) */
66
+ declare const ACCOUNT_ROLE_READONLY = 0;
67
+ /** Account is writable (not signer) */
68
+ declare const ACCOUNT_ROLE_WRITABLE = 1;
69
+ /** Account is a signer (not writable) */
70
+ declare const ACCOUNT_ROLE_SIGNER = 2;
71
+ /** Account is both writable and a signer */
72
+ declare const ACCOUNT_ROLE_WRITABLE_SIGNER = 3;
73
+ /**
74
+ * Anchor instruction discriminator (first 8 bytes of SHA256("global:<instruction_name>"))
75
+ * These are computed at build time from the instruction names.
76
+ */
77
+ declare const INSTRUCTION_DISCRIMINATORS: {
78
+ readonly initializeConfig: Uint8Array<ArrayBuffer>;
79
+ readonly initializePool: Uint8Array<ArrayBuffer>;
80
+ readonly initializeOracle: Uint8Array<ArrayBuffer>;
81
+ readonly createPosition: Uint8Array<ArrayBuffer>;
82
+ readonly addLiquidity: Uint8Array<ArrayBuffer>;
83
+ readonly removeLiquidity: Uint8Array<ArrayBuffer>;
84
+ readonly swapExactIn: Uint8Array<ArrayBuffer>;
85
+ readonly collectFees: Uint8Array<ArrayBuffer>;
86
+ readonly collectProtocolFees: Uint8Array<ArrayBuffer>;
87
+ readonly closePosition: Uint8Array<ArrayBuffer>;
88
+ readonly oracleUpdate: Uint8Array<ArrayBuffer>;
89
+ readonly oracleConsult: Uint8Array<ArrayBuffer>;
90
+ readonly quoteToNumeraire: Uint8Array<ArrayBuffer>;
91
+ readonly setSentinel: Uint8Array<ArrayBuffer>;
92
+ readonly setFees: Uint8Array<ArrayBuffer>;
93
+ readonly setRoute: Uint8Array<ArrayBuffer>;
94
+ readonly transferAdmin: Uint8Array<ArrayBuffer>;
95
+ readonly pause: Uint8Array<ArrayBuffer>;
96
+ readonly unpause: Uint8Array<ArrayBuffer>;
97
+ readonly skim: Uint8Array<ArrayBuffer>;
98
+ };
99
+ /**
100
+ * Anchor account discriminator (first 8 bytes of SHA256("account:<AccountName>"))
101
+ */
102
+ declare const ACCOUNT_DISCRIMINATORS: {
103
+ readonly AmmConfig: Uint8Array<ArrayBuffer>;
104
+ readonly Pool: Uint8Array<ArrayBuffer>;
105
+ readonly Position: Uint8Array<ArrayBuffer>;
106
+ readonly OracleState: Uint8Array<ArrayBuffer>;
107
+ };
108
+
109
+ /**
110
+ * Borsh serialization/deserialization for CPMM accounts and instructions
111
+ *
112
+ * This module provides encoding/decoding utilities for program accounts
113
+ * and instruction data using Borsh-compatible binary formats.
114
+ */
115
+
116
+ /**
117
+ * Decode AmmConfig from raw account data (including discriminator)
118
+ */
119
+ declare function decodeAmmConfig(data: ReadonlyUint8Array): AmmConfig;
120
+ /**
121
+ * Decode Pool from raw account data (including discriminator)
122
+ */
123
+ declare function decodePool(data: ReadonlyUint8Array): Pool;
124
+ /**
125
+ * Decode Position from raw account data (including discriminator)
126
+ */
127
+ declare function decodePosition(data: ReadonlyUint8Array): Position;
128
+ /**
129
+ * Decode OracleState from raw account data (including discriminator)
130
+ */
131
+ declare function decodeOracleState(data: ReadonlyUint8Array): OracleState;
132
+
133
+ /**
134
+ * Sort two mints into canonical order (token0 < token1 by bytes)
135
+ * This is required for Pool PDA derivation and instruction ordering.
136
+ *
137
+ * @param mint0 - First mint address
138
+ * @param mint1 - Second mint address
139
+ * @returns Tuple of [token0, token1] in canonical order
140
+ * @throws Error if mints are equal
141
+ */
142
+ declare function sortMints(mint0: Address, mint1: Address): [Address, Address];
143
+ /**
144
+ * Check if mints are in canonical order
145
+ */
146
+ declare function areMintsOrdered(mint0: Address, mint1: Address): boolean;
147
+ /**
148
+ * Derive the AmmConfig PDA address
149
+ * Seeds: ['config']
150
+ */
151
+ declare function getConfigAddress$1(programId?: Address): Promise<ProgramDerivedAddress>;
152
+ /**
153
+ * Derive the Pool PDA address for a token pair
154
+ * Seeds: ['pool', token0_mint, token1_mint]
155
+ *
156
+ * Note: Mints will be automatically sorted if not in canonical order.
157
+ */
158
+ declare function getPoolAddress(mint0: Address, mint1: Address, programId?: Address): Promise<ProgramDerivedAddress>;
159
+ /**
160
+ * Derive the Pool authority PDA (vault owner)
161
+ * Seeds: ['authority', pool]
162
+ */
163
+ declare function getPoolAuthorityAddress(pool: Address, programId?: Address): Promise<ProgramDerivedAddress>;
164
+ /**
165
+ * Derive the Position PDA address
166
+ * Seeds: ['position', pool, owner, position_id_le_bytes]
167
+ */
168
+ declare function getPositionAddress(pool: Address, owner: Address, positionId: bigint, programId?: Address): Promise<ProgramDerivedAddress>;
169
+ /**
170
+ * Derive the OracleState PDA address
171
+ * Seeds: ['oracle', pool]
172
+ */
173
+ declare function getOracleAddress(pool: Address, programId?: Address): Promise<ProgramDerivedAddress>;
174
+ /**
175
+ * Derive the Protocol Position PDA address
176
+ * Seeds: ['protocol_position', pool]
177
+ */
178
+ declare function getProtocolPositionAddress(pool: Address, programId?: Address): Promise<ProgramDerivedAddress>;
179
+ /**
180
+ * Derive all PDAs needed for pool initialization
181
+ */
182
+ declare function getPoolInitAddresses(mint0: Address, mint1: Address, programId?: Address): Promise<{
183
+ token0: Address;
184
+ token1: Address;
185
+ pool: ProgramDerivedAddress;
186
+ authority: ProgramDerivedAddress;
187
+ config: ProgramDerivedAddress;
188
+ protocolPosition: ProgramDerivedAddress;
189
+ }>;
190
+ /**
191
+ * Derive all PDAs needed for swap operation
192
+ */
193
+ declare function getSwapAddresses(pool: Address, programId?: Address): Promise<{
194
+ config: ProgramDerivedAddress;
195
+ authority: ProgramDerivedAddress;
196
+ oracle: ProgramDerivedAddress;
197
+ }>;
198
+ /**
199
+ * Derive all PDAs needed for liquidity operations
200
+ */
201
+ declare function getLiquidityAddresses(pool: Address, owner: Address, positionId: bigint, programId?: Address): Promise<{
202
+ config: ProgramDerivedAddress;
203
+ authority: ProgramDerivedAddress;
204
+ position: ProgramDerivedAddress;
205
+ protocolPosition: ProgramDerivedAddress;
206
+ oracle: ProgramDerivedAddress;
207
+ }>;
208
+
209
+ /**
210
+ * Derive Metaplex Token Metadata PDA for a given mint.
211
+ *
212
+ * Seeds: ['metadata', token_metadata_program_id, mint]
213
+ */
214
+ declare function getMetadataAddress(mint: Address): Promise<ProgramDerivedAddress>;
215
+
216
+ /**
217
+ * Convert a Q64.64 fixed-point number to a decimal number
218
+ */
219
+ declare function q64ToNumber(q64: bigint): number;
220
+ /**
221
+ * Convert a decimal number to Q64.64 fixed-point
222
+ */
223
+ declare function numberToQ64(n: number): bigint;
224
+ /**
225
+ * Multiply two Q64.64 numbers, returning Q64.64 result
226
+ */
227
+ declare function q64Mul(a: bigint, b: bigint): bigint;
228
+ /**
229
+ * Divide two Q64.64 numbers, returning Q64.64 result
230
+ */
231
+ declare function q64Div(a: bigint, b: bigint): bigint;
232
+ /**
233
+ * Compute spot price (reserve1/reserve0) as Q64.64
234
+ * Price of token0 denominated in token1
235
+ */
236
+ declare function computePrice0Q64(reserve0: bigint, reserve1: bigint): bigint;
237
+ /**
238
+ * Compute spot price (reserve0/reserve1) as Q64.64
239
+ * Price of token1 denominated in token0
240
+ */
241
+ declare function computePrice1Q64(reserve0: bigint, reserve1: bigint): bigint;
242
+ /**
243
+ * Integer square root (floor)
244
+ */
245
+ declare function isqrt(n: bigint): bigint;
246
+ /**
247
+ * Ceiling division: ceil(a / b)
248
+ */
249
+ declare function ceilDiv(a: bigint, b: bigint): bigint;
250
+ /**
251
+ * Minimum of two bigints
252
+ */
253
+ declare function minBigInt(a: bigint, b: bigint): bigint;
254
+ /**
255
+ * Maximum of two bigints
256
+ */
257
+ declare function maxBigInt(a: bigint, b: bigint): bigint;
258
+ /**
259
+ * Convert a ratio of two bigints to a decimal number using Q64.64 precision
260
+ */
261
+ declare function ratioToNumber(numerator: bigint, denominator: bigint): number;
262
+ /**
263
+ * Calculate swap output and fees for exact input amount
264
+ *
265
+ * Fee calculation (from spec):
266
+ * - fee_total = floor(amount_in * fee_bps / 10_000)
267
+ * - fee_dist = floor(fee_total * split_bps / 10_000)
268
+ * - fee_comp = fee_total - fee_dist
269
+ * - amount_in_eff = amount_in - fee_total
270
+ *
271
+ * CPMM output:
272
+ * - amount_out = floor(amount_in_eff * reserve_out / (reserve_in + amount_in_eff))
273
+ */
274
+ declare function getSwapQuote(pool: Pool, amountIn: bigint, direction: SwapDirection): SwapQuote;
275
+ /**
276
+ * Calculate input amount needed for exact output (reverse quote)
277
+ */
278
+ declare function getSwapQuoteExactOut(pool: Pool, amountOut: bigint, direction: SwapDirection): SwapQuoteExactOut;
279
+ /**
280
+ * Calculate shares and actual amounts for adding liquidity
281
+ *
282
+ * From spec:
283
+ * - If initial: shares = floor_sqrt(amount0 * amount1)
284
+ * - Else: shares = min(amount0 * totalShares / reserve0, amount1 * totalShares / reserve1)
285
+ */
286
+ declare function getAddLiquidityQuote(pool: Pool, amount0Max: bigint, amount1Max: bigint): AddLiquidityQuote;
287
+ /**
288
+ * Calculate token amounts for removing liquidity
289
+ *
290
+ * From spec:
291
+ * - amount0 = shares * reserve0 / totalShares
292
+ * - amount1 = shares * reserve1 / totalShares
293
+ */
294
+ declare function getRemoveLiquidityQuote(pool: Pool, sharesIn: bigint): RemoveLiquidityQuote;
295
+ /**
296
+ * Calculate accrued fees for a position
297
+ *
298
+ * From spec:
299
+ * - delta = pool.fee_growth_global - position.fee_growth_last
300
+ * - owed_inc = floor(position.shares * delta / 2^64)
301
+ */
302
+ declare function calculateAccruedFees(shares: bigint, feeGrowthLastQ64: bigint, feeGrowthGlobalQ64: bigint): bigint;
303
+ /**
304
+ * Calculate pending fees for a position (both tokens)
305
+ */
306
+ declare function getPendingFees(pool: Pool, position: {
307
+ shares: bigint;
308
+ feeGrowthLast0Q64: bigint;
309
+ feeGrowthLast1Q64: bigint;
310
+ feeOwed0: bigint;
311
+ feeOwed1: bigint;
312
+ }): {
313
+ pending0: bigint;
314
+ pending1: bigint;
315
+ };
316
+ /**
317
+ * Calculate spot price of token0 in terms of token1
318
+ */
319
+ declare function getSpotPrice0(pool: Pool): number;
320
+ /**
321
+ * Calculate spot price of token1 in terms of token0
322
+ */
323
+ declare function getSpotPrice1(pool: Pool): number;
324
+ /**
325
+ * Calculate k (constant product invariant)
326
+ */
327
+ declare function getK(pool: Pool): bigint;
328
+ /**
329
+ * Calculate pool TVL in terms of one token
330
+ * @param pool Pool data
331
+ * @param side 0 = denominate in token0, 1 = denominate in token1
332
+ */
333
+ declare function getTvl(pool: Pool, side?: SwapDirection): bigint;
334
+ /**
335
+ * Calculate TWAP price from oracle observations
336
+ *
337
+ * TWAP = (cumulative_end - cumulative_start) / (timestamp_end - timestamp_start)
338
+ */
339
+ declare function calculateTwap(cumulativeStart: bigint, cumulativeEnd: bigint, timestampStart: number, timestampEnd: number): bigint;
340
+ /**
341
+ * Calculate TWAP as a decimal number
342
+ */
343
+ declare function calculateTwapNumber(cumulativeStart: bigint, cumulativeEnd: bigint, timestampStart: number, timestampEnd: number): number;
344
+
345
+ /**
346
+ * Market cap conversion utilities for Solana token launches.
347
+ *
348
+ * Converts between human-readable market cap values (USD) and the raw
349
+ * curve parameters used by the initializer program.
350
+ *
351
+ * For an XYK bonding curve the marginal spot price at any point is:
352
+ *
353
+ * spotPrice (quote/base, raw units) = (quoteReserve + curveVirtualQuote)
354
+ * / (baseReserve + curveVirtualBase)
355
+ *
356
+ * At launch open (quoteReserve = 0, baseReserve = baseForCurve):
357
+ *
358
+ * spotPrice = curveVirtualQuote / (baseForCurve + curveVirtualBase)
359
+ *
360
+ * Adjusted for decimals and numeraire price:
361
+ *
362
+ * spotPriceUSD = spotPrice * 10^(baseDecimals - quoteDecimals) * numerairePriceUSD
363
+ *
364
+ * Market cap (FDV) is then:
365
+ *
366
+ * marketCap = spotPriceUSD * (baseTotalSupply / 10^baseDecimals)
367
+ */
368
+
369
+ /**
370
+ * Convert a market cap (USD) and total supply to a per-token price (USD).
371
+ *
372
+ * @example
373
+ * // $1M market cap, 1B tokens with 6 decimals
374
+ * marketCapToTokenPrice(1_000_000, 1_000_000_000n * 10n**6n, 6)
375
+ * // => 0.001
376
+ */
377
+ declare function marketCapToTokenPrice(marketCapUSD: number, baseTotalSupply: bigint, baseDecimals: number): number;
378
+ /**
379
+ * Validate market cap parameters and return warnings for unusual values.
380
+ * Does not throw — callers can decide whether to surface warnings to users.
381
+ *
382
+ * @example
383
+ * const { valid, warnings } = validateMarketCapParameters(500, supply, 6);
384
+ * if (!valid) console.warn(warnings);
385
+ */
386
+ declare function validateMarketCapParameters(marketCapUSD: number, baseTotalSupply: bigint, baseDecimals: number): MarketCapValidationResult;
387
+ /**
388
+ * Convert a market cap range (USD) to XYK curve virtual reserve parameters.
389
+ *
390
+ * Returns `{ curveVirtualBase, curveVirtualQuote }` for both the start (open)
391
+ * and end (graduation) prices, ready to pass into `InitializeLaunchArgs`.
392
+ *
393
+ * `baseForCurve` is the number of base tokens allocated to the curve vault
394
+ * (baseTotalSupply - baseForDistribution - baseForLiquidity). It determines
395
+ * the correct initial spot price alongside the virtual reserves.
396
+ *
397
+ * `virtualBase` defaults to `baseForCurve`. A larger value gives finer price
398
+ * granularity at the cost of a proportionally larger `curveVirtualQuote`.
399
+ *
400
+ * @example
401
+ * const totalSupply = 1_000_000_000n * 10n ** 6n;
402
+ * const { start, end } = marketCapToCurveParams({
403
+ * startMarketCapUSD: 100_000,
404
+ * endMarketCapUSD: 5_000_000,
405
+ * baseTotalSupply: totalSupply,
406
+ * baseForCurve: totalSupply, // no distribution or liquidity allocation
407
+ * baseDecimals: 6,
408
+ * quoteDecimals: 9, // SOL
409
+ * numerairePriceUSD: 150,
410
+ * });
411
+ * // Use start.curveVirtualBase / start.curveVirtualQuote in InitializeLaunchArgs
412
+ */
413
+ declare function marketCapToCurveParams(input: MarketCapToCurveParamsInput): {
414
+ start: CurveParams;
415
+ end: CurveParams;
416
+ };
417
+ /**
418
+ * Convert a single market cap (USD) to XYK curve virtual reserve parameters.
419
+ * Use `marketCapToCurveParams` for a full start/end range.
420
+ */
421
+ declare function marketCapToSingleCurveParams(marketCapUSD: number, baseTotalSupply: bigint, baseForCurve: bigint, baseDecimals: number, quoteDecimals: number, numerairePriceUSD: number, virtualBase?: bigint): CurveParams;
422
+ /**
423
+ * Derive the current market cap (USD) from live XYK curve state.
424
+ *
425
+ * Pass the virtual reserves from the `Launch` account and the current token
426
+ * vault balances (`baseReserve`, `quoteReserve`) to get the live spot price.
427
+ *
428
+ * @example
429
+ * const launch = await fetchLaunch(connection, launchAddress);
430
+ * const [baseVaultBalance, quoteVaultBalance] = await Promise.all([
431
+ * getTokenAccountBalance(connection, launch.baseVault),
432
+ * getTokenAccountBalance(connection, launch.quoteVault),
433
+ * ]);
434
+ * // baseReserve is the curve-available portion, excluding reserved allocations
435
+ * const baseReserve = baseVaultBalance - launch.baseForDistribution - launch.baseForLiquidity;
436
+ * const mcap = curveParamsToMarketCap({
437
+ * curveVirtualBase: launch.curveVirtualBase,
438
+ * curveVirtualQuote: launch.curveVirtualQuote,
439
+ * baseReserve,
440
+ * quoteReserve: quoteVaultBalance,
441
+ * baseTotalSupply: launch.baseTotalSupply,
442
+ * baseDecimals: 6,
443
+ * quoteDecimals: 9,
444
+ * numerairePriceUSD: 150,
445
+ * });
446
+ */
447
+ declare function curveParamsToMarketCap(input: CurveParamsToMarketCapInput): number;
448
+
449
+ /**
450
+ * CPMM program error codes
451
+ *
452
+ * These correspond to the CpmmError enum in the on-chain program.
453
+ * Anchor errors start at 6000 (0x1770).
454
+ */
455
+ declare enum CpmmErrorCode {
456
+ /** Unauthorized - caller lacks required authority */
457
+ Unauthorized = 6000,
458
+ /** Pool is currently locked (reentrancy protection) */
459
+ PoolLocked = 6001,
460
+ /** Invalid fee value (exceeds max or invalid range) */
461
+ InvalidFee = 6002,
462
+ /** Invalid fee split value (exceeds max or invalid range) */
463
+ InvalidFeeSplit = 6003,
464
+ /** Invalid swap direction (must be 0 or 1) */
465
+ InvalidDirection = 6004,
466
+ /** Insufficient liquidity for operation */
467
+ InsufficientLiquidity = 6005,
468
+ /** Output amount less than minimum (slippage exceeded) */
469
+ SlippageExceeded = 6006,
470
+ /** Math operation overflowed */
471
+ MathOverflow = 6007,
472
+ /** Mints not in canonical order */
473
+ InvalidMintOrder = 6008,
474
+ /** Cannot create pool with identical tokens */
475
+ SameMintPair = 6009,
476
+ /** Vault account invalid or mismatch */
477
+ InvalidVault = 6010,
478
+ /** Position account invalid or mismatch */
479
+ InvalidPosition = 6011,
480
+ /** Cannot close position with non-zero shares or fees */
481
+ PositionNotEmpty = 6012,
482
+ /** Invalid route configuration */
483
+ InvalidRoute = 6013,
484
+ /** Not supported in v0.1 */
485
+ NotSupportedInV0_1 = 6014,
486
+ /** Oracle not initialized for this pool */
487
+ OracleNotInitialized = 6015,
488
+ /** Zero shares out */
489
+ ZeroSharesOut = 6016,
490
+ /** Sentinel program rejected the operation */
491
+ SentinelRejected = 6017,
492
+ /** Sentinel CPI call failed */
493
+ SentinelCpiFailed = 6018,
494
+ /** Sentinel program account not provided */
495
+ SentinelProgramNotProvided = 6019,
496
+ /** Sentinel program account is not executable */
497
+ SentinelProgramNotExecutable = 6020,
498
+ /** Sentinel return data missing or wrong program id */
499
+ SentinelReturnDataMissing = 6021,
500
+ /** Sentinel return data invalid length or could not deserialize */
501
+ SentinelReturnDataInvalid = 6022,
502
+ /** Sentinel program not in allowlist */
503
+ SentinelNotAllowlisted = 6023,
504
+ /** Pool has zero shares (no liquidity) */
505
+ TotalSharesZero = 6024,
506
+ /** Amount cannot be zero */
507
+ AmountZero = 6025,
508
+ /** Pool is paused by admin */
509
+ Paused = 6026,
510
+ /** Internal invariant violation */
511
+ InvariantViolation = 6027,
512
+ /** Invalid mint address */
513
+ InvalidMint = 6028,
514
+ /** Invalid input parameter */
515
+ InvalidInput = 6029,
516
+ /** Reentrancy detected */
517
+ Reentrancy = 6030
518
+ }
519
+ /**
520
+ * Human-readable error messages
521
+ */
522
+ declare const CPMM_ERROR_MESSAGES: Record<CpmmErrorCode, string>;
523
+ /**
524
+ * Custom error class for CPMM program errors
525
+ */
526
+ declare class CpmmError extends Error {
527
+ readonly code: CpmmErrorCode;
528
+ readonly logs?: string[] | undefined;
529
+ constructor(code: CpmmErrorCode, logs?: string[] | undefined);
530
+ /**
531
+ * Get the error code name
532
+ */
533
+ get codeName(): string;
534
+ }
535
+ /**
536
+ * Parse error code from transaction logs
537
+ */
538
+ declare function parseErrorFromLogs(logs: string[]): CpmmError | null;
539
+ /**
540
+ * Check if an error code is a CPMM error
541
+ */
542
+ declare function isCpmmError(code: number): code is CpmmErrorCode;
543
+ /**
544
+ * Get error message from code
545
+ */
546
+ declare function getErrorMessage(code: number): string;
547
+
548
+ /**
549
+ * Accounts required for initialize_config instruction
550
+ */
551
+ interface InitializeConfigAccounts$1 {
552
+ /** AmmConfig account to initialize (writable, PDA: ['config']) */
553
+ config: Address;
554
+ /** Payer for account creation (writable, signer) */
555
+ payer: Address;
556
+ /** System program */
557
+ systemProgram?: Address;
558
+ }
559
+ /**
560
+ * Create an initialize_config instruction
561
+ *
562
+ * Initializes the global AMM configuration singleton. This should only be called once
563
+ * per deployment to set up the admin, fees, and allowlist.
564
+ *
565
+ * @param accounts - Required accounts for initialization
566
+ * @param args - Instruction arguments (admin, numeraireMint, fees, allowlist)
567
+ * @param programId - Program ID (defaults to CPMM program)
568
+ * @returns Instruction to initialize the config
569
+ *
570
+ * @example
571
+ * ```ts
572
+ * const [configAddress] = await getConfigAddress();
573
+ * const ix = createInitializeConfigInstruction(
574
+ * {
575
+ * config: configAddress,
576
+ * payer: payerPublicKey,
577
+ * },
578
+ * {
579
+ * admin: adminPublicKey,
580
+ * numeraireMint: usdcMint,
581
+ * maxSwapFeeBps: 100,
582
+ * maxFeeSplitBps: 5000,
583
+ * maxRouteHops: 3,
584
+ * protocolFeeEnabled: true,
585
+ * protocolFeeBps: 500,
586
+ * sentinelAllowlist: [],
587
+ * }
588
+ * );
589
+ * ```
590
+ */
591
+ declare function createInitializeConfigInstruction$1(accounts: InitializeConfigAccounts$1, args: InitializeConfigArgs$1, programId?: Address): Instruction;
592
+
593
+ /**
594
+ * Accounts required for initialize_pool instruction
595
+ */
596
+ interface InitializePoolAccounts {
597
+ /** AmmConfig account (read-only) */
598
+ config: Address;
599
+ /** Pool account to initialize (writable, PDA: ['pool', token0_mint, token1_mint]) */
600
+ pool: Address;
601
+ /** Protocol position account (writable, PDA: ['protocol_position', pool]) */
602
+ protocolPosition: Address;
603
+ /** Pool authority PDA (read-only, PDA: ['authority', pool]) */
604
+ authority: Address;
605
+ /** Vault for token0 (writable signer - pass TransactionSigner to include signer in instruction) */
606
+ vault0: Address | TransactionSigner;
607
+ /** Vault for token1 (writable signer - pass TransactionSigner to include signer in instruction) */
608
+ vault1: Address | TransactionSigner;
609
+ /** Token0 mint (read-only, must be lexicographically smaller) */
610
+ token0Mint: Address;
611
+ /** Token1 mint (read-only, must be lexicographically larger) */
612
+ token1Mint: Address;
613
+ /** Payer for account creation (writable signer - pass TransactionSigner to include signer in instruction) */
614
+ payer: Address | TransactionSigner;
615
+ /** SPL Token program */
616
+ tokenProgram?: Address;
617
+ /** System program */
618
+ systemProgram?: Address;
619
+ /** Rent sysvar */
620
+ rent: Address;
621
+ }
622
+ /**
623
+ * Create an initialize_pool instruction
624
+ *
625
+ * Initializes a new trading pool for a token pair. The mints must be in canonical order
626
+ * (token0 < token1 by bytes). Use sortMints() to ensure proper ordering.
627
+ *
628
+ * @param accounts - Required accounts for pool initialization
629
+ * @param args - Instruction arguments (mintA, mintB, fees, liquidityMeasureSide, numeraire override)
630
+ * @param programId - Program ID (defaults to CPMM program)
631
+ * @returns Instruction to initialize the pool
632
+ *
633
+ * @example
634
+ * ```ts
635
+ * const addresses = await getPoolInitAddresses(mintA, mintB);
636
+ * const ix = createInitializePoolInstruction(
637
+ * {
638
+ * config: addresses.config[0],
639
+ * pool: addresses.pool[0],
640
+ * protocolPosition: addresses.protocolPosition[0],
641
+ * authority: addresses.authority[0],
642
+ * vault0: vault0Keypair.publicKey,
643
+ * vault1: vault1Keypair.publicKey,
644
+ * token0Mint: addresses.token0,
645
+ * token1Mint: addresses.token1,
646
+ * payer: payerPublicKey,
647
+ * rent: SYSVAR_RENT_PUBKEY,
648
+ * },
649
+ * {
650
+ * mintA: mintA,
651
+ * mintB: mintB,
652
+ * initialSwapFeeBps: 30,
653
+ * initialFeeSplitBps: 5000,
654
+ * liquidityMeasureSide: 0,
655
+ * numeraireMintOverride: null,
656
+ * }
657
+ * );
658
+ * ```
659
+ */
660
+ declare function createInitializePoolInstruction(accounts: InitializePoolAccounts, args: InitializePoolArgs, programId?: Address): Instruction;
661
+
662
+ /**
663
+ * Accounts required for initialize_oracle instruction
664
+ */
665
+ interface InitializeOracleAccounts {
666
+ /** AmmConfig account (read-only) */
667
+ config: Address;
668
+ /** Pool account (read-only) */
669
+ pool: Address;
670
+ /** Oracle PDA to initialize (writable, will be created) */
671
+ oracle: Address;
672
+ /** Admin authority (signer, must match config.admin) */
673
+ admin: Address;
674
+ /** Payer for account creation (signer, writable) */
675
+ payer: Address;
676
+ /** System program */
677
+ systemProgram?: Address;
678
+ }
679
+ /**
680
+ * Create an initialize_oracle instruction
681
+ *
682
+ * Initializes a TWAP oracle for a pool. The oracle tracks price movements
683
+ * and stores observations for time-weighted average price calculations.
684
+ *
685
+ * @param accounts - Required accounts for the instruction
686
+ * @param args - Instruction arguments (maxPriceChangeRatioQ64, observationIntervalSec, numObservations)
687
+ * @param programId - Program ID (defaults to CPMM program)
688
+ * @returns Instruction to initialize the oracle
689
+ *
690
+ * @example
691
+ * ```ts
692
+ * const ix = createInitializeOracleInstruction(
693
+ * {
694
+ * config: configAddress,
695
+ * pool: poolAddress,
696
+ * oracle: oracleAddress,
697
+ * admin: adminPublicKey,
698
+ * payer: payerPublicKey,
699
+ * },
700
+ * {
701
+ * maxPriceChangeRatioQ64: 1n << 64n, // 100% max change per slot
702
+ * observationIntervalSec: 60, // 1 minute between observations
703
+ * numObservations: 64, // Must be MAX_ORACLE_OBSERVATIONS
704
+ * }
705
+ * );
706
+ * ```
707
+ */
708
+ declare function createInitializeOracleInstruction(accounts: InitializeOracleAccounts, args: InitializeOracleArgs, programId?: Address): Instruction;
709
+
710
+ /**
711
+ * Accounts required for set_fees instruction
712
+ */
713
+ interface SetFeesAccounts {
714
+ /** AmmConfig account (read-only) */
715
+ config: Address;
716
+ /** Pool account (writable) */
717
+ pool: Address;
718
+ /** Admin authority (signer, must match config.admin) */
719
+ admin: Address;
720
+ }
721
+ /**
722
+ * Create a set_fees instruction
723
+ *
724
+ * Admin instruction to update the swap fee and fee split on a pool.
725
+ * Fees will be clamped to the config's max values.
726
+ *
727
+ * @param accounts - Required accounts for setting fees
728
+ * @param args - Instruction arguments (swapFeeBps, feeSplitBps)
729
+ * @param programId - Program ID (defaults to CPMM program)
730
+ * @returns Instruction to set fees
731
+ *
732
+ * @example
733
+ * ```ts
734
+ * const ix = createSetFeesInstruction(
735
+ * {
736
+ * config: configAddress,
737
+ * pool: poolAddress,
738
+ * admin: adminPublicKey,
739
+ * },
740
+ * {
741
+ * swapFeeBps: 30, // 0.30% swap fee
742
+ * feeSplitBps: 5000, // 50% of fees go to LPs (distributable)
743
+ * }
744
+ * );
745
+ * ```
746
+ */
747
+ declare function createSetFeesInstruction(accounts: SetFeesAccounts, args: SetFeesArgs, programId?: Address): Instruction;
748
+
749
+ /**
750
+ * Accounts required for set_sentinel instruction
751
+ */
752
+ interface SetSentinelAccounts {
753
+ /** AmmConfig account (read-only) */
754
+ config: Address;
755
+ /** Pool account (writable) */
756
+ pool: Address;
757
+ /** Admin authority (signer, must match config.admin) */
758
+ admin: Address;
759
+ }
760
+ /**
761
+ * Create a set_sentinel instruction
762
+ *
763
+ * Admin instruction to configure a sentinel (hook) program on a pool.
764
+ * The sentinel program must be in the config's allowlist (if the allowlist is non-empty).
765
+ * Use Pubkey::default() to disable the sentinel.
766
+ *
767
+ * @param accounts - Required accounts for setting sentinel
768
+ * @param args - Instruction arguments (sentinelProgram, sentinelFlags)
769
+ * @param programId - Program ID (defaults to CPMM program)
770
+ * @returns Instruction to set sentinel
771
+ *
772
+ * @example
773
+ * ```ts
774
+ * import { SF_BEFORE_SWAP, SF_AFTER_SWAP } from '@cpmm/sdk';
775
+ *
776
+ * const ix = createSetSentinelInstruction(
777
+ * {
778
+ * config: configAddress,
779
+ * pool: poolAddress,
780
+ * admin: adminPublicKey,
781
+ * },
782
+ * {
783
+ * sentinelProgram: sentinelProgramId,
784
+ * sentinelFlags: SF_BEFORE_SWAP | SF_AFTER_SWAP, // Enable both hooks
785
+ * }
786
+ * );
787
+ * ```
788
+ */
789
+ declare function createSetSentinelInstruction(accounts: SetSentinelAccounts, args: SetSentinelArgs, programId?: Address): Instruction;
790
+
791
+ /**
792
+ * Accounts required for set_route instruction
793
+ */
794
+ interface SetRouteAccounts {
795
+ /** AmmConfig account (read-only) */
796
+ config: Address;
797
+ /** Pool account (writable) */
798
+ pool: Address;
799
+ /** Next pool in routing chain (optional, required if setting a route) */
800
+ nextPool?: Address;
801
+ /** Admin authority (signer, must match config.admin) */
802
+ admin: Address;
803
+ }
804
+ /**
805
+ * Create a set_route instruction
806
+ *
807
+ * Admin instruction to configure routing for a pool. This allows multi-hop swaps
808
+ * through a chain of pools. The bridge mint must exist in both the current pool
809
+ * and the next pool.
810
+ *
811
+ * To clear routing, pass Pubkey::default() for both routeNextPool and routeBridgeMint.
812
+ *
813
+ * @param accounts - Required accounts for setting route
814
+ * @param args - Instruction arguments (routeNextPool, routeBridgeMint)
815
+ * @param programId - Program ID (defaults to CPMM program)
816
+ * @returns Instruction to set route
817
+ *
818
+ * @example
819
+ * ```ts
820
+ * // Set up routing: Pool A -> Pool B via USDC
821
+ * const ix = createSetRouteInstruction(
822
+ * {
823
+ * config: configAddress,
824
+ * pool: poolAAddress,
825
+ * nextPool: poolBAddress,
826
+ * admin: adminPublicKey,
827
+ * },
828
+ * {
829
+ * routeNextPool: poolBAddress,
830
+ * routeBridgeMint: usdcMint, // Must be in both pools
831
+ * }
832
+ * );
833
+ *
834
+ * // Clear routing
835
+ * const clearIx = createSetRouteInstruction(
836
+ * {
837
+ * config: configAddress,
838
+ * pool: poolAddress,
839
+ * admin: adminPublicKey,
840
+ * },
841
+ * {
842
+ * routeNextPool: address('11111111111111111111111111111111'),
843
+ * routeBridgeMint: address('11111111111111111111111111111111'),
844
+ * }
845
+ * );
846
+ * ```
847
+ */
848
+ declare function createSetRouteInstruction(accounts: SetRouteAccounts, args: SetRouteArgs, programId?: Address): Instruction;
849
+
850
+ /**
851
+ * Accounts required for pause instruction
852
+ */
853
+ interface PauseAccounts {
854
+ /** AmmConfig account (writable) */
855
+ config: Address;
856
+ /** Admin authority (signer, must match config.admin) */
857
+ admin: Address;
858
+ }
859
+ /**
860
+ * Create a pause instruction
861
+ *
862
+ * Admin instruction to pause all pool operations globally. When paused,
863
+ * swaps, liquidity additions, and liquidity removals will fail.
864
+ *
865
+ * @param accounts - Required accounts for pausing
866
+ * @param programId - Program ID (defaults to CPMM program)
867
+ * @returns Instruction to pause the AMM
868
+ *
869
+ * @example
870
+ * ```ts
871
+ * const ix = createPauseInstruction({
872
+ * config: configAddress,
873
+ * admin: adminPublicKey,
874
+ * });
875
+ * ```
876
+ */
877
+ declare function createPauseInstruction(accounts: PauseAccounts, programId?: Address): Instruction;
878
+
879
+ /**
880
+ * Accounts required for unpause instruction
881
+ */
882
+ interface UnpauseAccounts {
883
+ /** AmmConfig account (writable) */
884
+ config: Address;
885
+ /** Admin authority (signer, must match config.admin) */
886
+ admin: Address;
887
+ }
888
+ /**
889
+ * Create an unpause instruction
890
+ *
891
+ * Admin instruction to unpause all pool operations. This re-enables
892
+ * swaps, liquidity additions, and liquidity removals after a pause.
893
+ *
894
+ * @param accounts - Required accounts for unpausing
895
+ * @param programId - Program ID (defaults to CPMM program)
896
+ * @returns Instruction to unpause the AMM
897
+ *
898
+ * @example
899
+ * ```ts
900
+ * const ix = createUnpauseInstruction({
901
+ * config: configAddress,
902
+ * admin: adminPublicKey,
903
+ * });
904
+ * ```
905
+ */
906
+ declare function createUnpauseInstruction(accounts: UnpauseAccounts, programId?: Address): Instruction;
907
+
908
+ /**
909
+ * Accounts required for transfer_admin instruction
910
+ */
911
+ interface TransferAdminAccounts {
912
+ /** AmmConfig account (writable) */
913
+ config: Address;
914
+ /** Current admin authority (signer, must match config.admin) */
915
+ admin: Address;
916
+ }
917
+ /**
918
+ * Create a transfer_admin instruction
919
+ *
920
+ * Admin instruction to transfer administrative authority to a new address.
921
+ * The new admin will have full control over the AMM configuration and all pools.
922
+ *
923
+ * CAUTION: This action is irreversible. Ensure the new admin address is correct
924
+ * and that you have access to it before executing.
925
+ *
926
+ * @param accounts - Required accounts for transferring admin
927
+ * @param args - Instruction arguments (newAdmin)
928
+ * @param programId - Program ID (defaults to CPMM program)
929
+ * @returns Instruction to transfer admin
930
+ *
931
+ * @example
932
+ * ```ts
933
+ * const ix = createTransferAdminInstruction(
934
+ * {
935
+ * config: configAddress,
936
+ * admin: currentAdminPublicKey,
937
+ * },
938
+ * {
939
+ * newAdmin: newAdminPublicKey,
940
+ * }
941
+ * );
942
+ * ```
943
+ */
944
+ declare function createTransferAdminInstruction(accounts: TransferAdminAccounts, args: TransferAdminArgs, programId?: Address): Instruction;
945
+
946
+ /**
947
+ * Accounts required for skim instruction
948
+ */
949
+ interface SkimAccounts {
950
+ /** AmmConfig account (read-only) */
951
+ config: Address;
952
+ /** Pool account (read-only) */
953
+ pool: Address;
954
+ /** Admin authority (signer, must match config.admin) */
955
+ admin: Address;
956
+ /** Pool authority PDA (read-only, PDA: ['authority', pool]) */
957
+ authority: Address;
958
+ /** Token0 vault (writable) */
959
+ vault0: Address;
960
+ /** Token1 vault (writable) */
961
+ vault1: Address;
962
+ /** Token0 mint (read-only) */
963
+ token0Mint: Address;
964
+ /** Token1 mint (read-only) */
965
+ token1Mint: Address;
966
+ /** Admin's token0 ATA to receive excess (writable) */
967
+ adminAta0: Address;
968
+ /** Admin's token1 ATA to receive excess (writable) */
969
+ adminAta1: Address;
970
+ /** SPL Token program */
971
+ tokenProgram?: Address;
972
+ }
973
+ /**
974
+ * Create a skim instruction
975
+ *
976
+ * Admin instruction to withdraw excess tokens from pool vaults. This recovers any
977
+ * tokens that were accidentally sent directly to the vault accounts (outside of
978
+ * normal pool operations).
979
+ *
980
+ * Only withdraws tokens in excess of (reserve + unclaimed_fees). Normal pool
981
+ * reserves and LP fees are not affected.
982
+ *
983
+ * @param accounts - Required accounts for skimming
984
+ * @param programId - Program ID (defaults to CPMM program)
985
+ * @returns Instruction to skim excess tokens
986
+ *
987
+ * @example
988
+ * ```ts
989
+ * const ix = createSkimInstruction({
990
+ * config: configAddress,
991
+ * pool: poolAddress,
992
+ * admin: adminPublicKey,
993
+ * authority: authorityAddress,
994
+ * vault0: vault0Address,
995
+ * vault1: vault1Address,
996
+ * token0Mint: mint0,
997
+ * token1Mint: mint1,
998
+ * adminAta0: adminToken0Account,
999
+ * adminAta1: adminToken1Account,
1000
+ * });
1001
+ * ```
1002
+ */
1003
+ declare function createSkimInstruction(accounts: SkimAccounts, programId?: Address): Instruction;
1004
+
1005
+ /**
1006
+ * Accounts required for swap_exact_in instruction
1007
+ */
1008
+ interface SwapExactInAccounts {
1009
+ /** AmmConfig account (read-only) */
1010
+ config: Address;
1011
+ /** Pool account (writable) */
1012
+ pool: Address;
1013
+ /** Pool authority PDA (read-only) */
1014
+ authority: Address;
1015
+ /** Input token vault (writable) */
1016
+ vaultIn: Address;
1017
+ /** Output token vault (writable) */
1018
+ vaultOut: Address;
1019
+ /** Token0 mint (read-only, for transfer_checked) */
1020
+ token0Mint: Address;
1021
+ /** Token1 mint (read-only, for transfer_checked) */
1022
+ token1Mint: Address;
1023
+ /** User's input token account (writable) */
1024
+ userIn: Address;
1025
+ /** User's output token account (writable) */
1026
+ userOut: Address;
1027
+ /** User authority (signer) */
1028
+ user: Address;
1029
+ /** SPL Token program */
1030
+ tokenProgram?: Address;
1031
+ /** Oracle account (optional, required if updateOracle is true) */
1032
+ oracle?: Address;
1033
+ /** Optional remaining accounts (sentinel program/state, route/oracle data) */
1034
+ remainingAccounts?: Address[];
1035
+ }
1036
+ /**
1037
+ * Create a swap_exact_in instruction
1038
+ *
1039
+ * Swaps an exact input amount for a minimum output amount using the CPMM formula.
1040
+ *
1041
+ * @param accounts - Required accounts for the swap
1042
+ * @param args - Instruction arguments (amountIn, minAmountOut, direction, updateOracle)
1043
+ * @param programId - Program ID (defaults to CPMM program)
1044
+ * @returns Instruction to execute the swap
1045
+ *
1046
+ * @example
1047
+ * ```ts
1048
+ * const ix = createSwapExactInInstruction(
1049
+ * {
1050
+ * config: configAddress,
1051
+ * pool: poolAddress,
1052
+ * authority: authorityAddress,
1053
+ * vaultIn: vault0Address,
1054
+ * vaultOut: vault1Address,
1055
+ * token0Mint: mint0,
1056
+ * token1Mint: mint1,
1057
+ * userIn: userToken0Account,
1058
+ * userOut: userToken1Account,
1059
+ * user: userPublicKey,
1060
+ * },
1061
+ * {
1062
+ * amountIn: 1000000n,
1063
+ * minAmountOut: 990000n,
1064
+ * direction: 0, // token0 -> token1
1065
+ * updateOracle: false,
1066
+ * }
1067
+ * );
1068
+ * ```
1069
+ */
1070
+ declare function createSwapExactInInstruction(accounts: SwapExactInAccounts, args: SwapExactInArgs, programId?: Address): Instruction;
1071
+ /**
1072
+ * Helper to create swap instruction with simplified parameters
1073
+ */
1074
+ declare function createSwapInstruction(params: {
1075
+ config: Address;
1076
+ pool: Address;
1077
+ authority: Address;
1078
+ vault0: Address;
1079
+ vault1: Address;
1080
+ token0Mint: Address;
1081
+ token1Mint: Address;
1082
+ userToken0: Address;
1083
+ userToken1: Address;
1084
+ user: Address;
1085
+ amountIn: bigint;
1086
+ minAmountOut: bigint;
1087
+ direction: SwapDirection;
1088
+ oracle?: Address;
1089
+ remainingAccounts?: Address[];
1090
+ updateOracle?: boolean;
1091
+ programId?: Address;
1092
+ }): Instruction;
1093
+
1094
+ /**
1095
+ * Accounts required for create_position instruction
1096
+ */
1097
+ interface CreatePositionAccounts {
1098
+ /** Pool account (read-only) */
1099
+ pool: Address;
1100
+ /** Position PDA to be created (writable, derived from ['position', pool, owner, position_id]) */
1101
+ position: Address;
1102
+ /** Owner of the position (signer) */
1103
+ owner: Address;
1104
+ /** Payer for rent (signer, writable) */
1105
+ payer: Address;
1106
+ /** System program */
1107
+ systemProgram?: Address;
1108
+ }
1109
+ /**
1110
+ * Create a create_position instruction
1111
+ *
1112
+ * Creates a new liquidity position for a pool. The position is a PDA derived from
1113
+ * the pool, owner, and position ID. Users can have multiple positions per pool
1114
+ * by using different position IDs.
1115
+ *
1116
+ * @param accounts - Required accounts for creating the position
1117
+ * @param args - Instruction arguments (positionId)
1118
+ * @param programId - Program ID (defaults to CPMM program)
1119
+ * @returns Instruction to create a new position
1120
+ *
1121
+ * @example
1122
+ * ```ts
1123
+ * const ix = createCreatePositionInstruction(
1124
+ * {
1125
+ * pool: poolAddress,
1126
+ * position: positionPda,
1127
+ * owner: userPublicKey,
1128
+ * payer: userPublicKey,
1129
+ * },
1130
+ * {
1131
+ * positionId: 0n,
1132
+ * }
1133
+ * );
1134
+ * ```
1135
+ */
1136
+ declare function createCreatePositionInstruction(accounts: CreatePositionAccounts, args: CreatePositionArgs, programId?: Address): Instruction;
1137
+
1138
+ /**
1139
+ * Accounts required for close_position instruction
1140
+ */
1141
+ interface ClosePositionAccounts {
1142
+ /** Pool account (read-only) */
1143
+ pool: Address;
1144
+ /** Position account to close (writable) */
1145
+ position: Address;
1146
+ /** Position owner (signer) */
1147
+ owner: Address;
1148
+ /** Recipient for rent lamports (writable) */
1149
+ rentRecipient: Address;
1150
+ }
1151
+ /**
1152
+ * Create a close_position instruction
1153
+ *
1154
+ * Closes an empty position account, returning the rent lamports to the recipient.
1155
+ * The position must have zero shares and zero accrued fees to be closed.
1156
+ *
1157
+ * @param accounts - Required accounts for closing the position
1158
+ * @param programId - Program ID (defaults to CPMM program)
1159
+ * @returns Instruction to close a position
1160
+ *
1161
+ * @example
1162
+ * ```ts
1163
+ * const ix = createClosePositionInstruction({
1164
+ * pool: poolAddress,
1165
+ * position: positionAddress,
1166
+ * owner: userPublicKey,
1167
+ * rentRecipient: userPublicKey,
1168
+ * });
1169
+ * ```
1170
+ */
1171
+ declare function createClosePositionInstruction(accounts: ClosePositionAccounts, programId?: Address): Instruction;
1172
+
1173
+ /**
1174
+ * Extended AddLiquidity args that include updateOracle flag
1175
+ * (matches the on-chain program's actual args)
1176
+ */
1177
+ interface AddLiquidityArgsWithOracle extends AddLiquidityArgs {
1178
+ /** Whether to update the oracle (requires oracle account) */
1179
+ updateOracle: boolean;
1180
+ }
1181
+ /**
1182
+ * Accounts required for add_liquidity instruction
1183
+ */
1184
+ interface AddLiquidityAccounts {
1185
+ /** AmmConfig account (read-only) */
1186
+ config: Address;
1187
+ /** Pool account (writable) */
1188
+ pool: Address;
1189
+ /** User's position account (writable) */
1190
+ position: Address;
1191
+ /** Protocol position for protocol fees (writable) */
1192
+ protocolPosition: Address;
1193
+ /** Position owner (signer) */
1194
+ owner: Address;
1195
+ /** Pool authority PDA (read-only) */
1196
+ authority: Address;
1197
+ /** Pool vault for token0 (writable) */
1198
+ vault0: Address;
1199
+ /** Pool vault for token1 (writable) */
1200
+ vault1: Address;
1201
+ /** Token0 mint (read-only) */
1202
+ token0Mint: Address;
1203
+ /** Token1 mint (read-only) */
1204
+ token1Mint: Address;
1205
+ /** User's token0 account (writable) */
1206
+ user0: Address;
1207
+ /** User's token1 account (writable) */
1208
+ user1: Address;
1209
+ /** SPL Token program */
1210
+ tokenProgram?: Address;
1211
+ /** Oracle account (optional, required if updateOracle is true) */
1212
+ oracle?: Address;
1213
+ /** Optional remaining accounts (sentinel program/state, route/oracle data) */
1214
+ remainingAccounts?: Address[];
1215
+ }
1216
+ /**
1217
+ * Create an add_liquidity instruction
1218
+ *
1219
+ * Adds liquidity to a pool by depositing tokens and receiving LP shares.
1220
+ * For an empty pool (first deposit), the amount of shares is sqrt(amount0 * amount1).
1221
+ * For subsequent deposits, shares are proportional to the smaller ratio of deposit to reserves.
1222
+ *
1223
+ * @param accounts - Required accounts for adding liquidity
1224
+ * @param args - Instruction arguments (amount0Max, amount1Max, minSharesOut, updateOracle)
1225
+ * @param programId - Program ID (defaults to CPMM program)
1226
+ * @returns Instruction to add liquidity
1227
+ *
1228
+ * @example
1229
+ * ```ts
1230
+ * const ix = createAddLiquidityInstruction(
1231
+ * {
1232
+ * config: configAddress,
1233
+ * pool: poolAddress,
1234
+ * position: positionAddress,
1235
+ * protocolPosition: protocolPositionAddress,
1236
+ * owner: userPublicKey,
1237
+ * authority: authorityPda,
1238
+ * vault0: vault0Address,
1239
+ * vault1: vault1Address,
1240
+ * token0Mint: mint0,
1241
+ * token1Mint: mint1,
1242
+ * user0: userToken0Account,
1243
+ * user1: userToken1Account,
1244
+ * },
1245
+ * {
1246
+ * amount0Max: 1000000n,
1247
+ * amount1Max: 1000000n,
1248
+ * minSharesOut: 0n,
1249
+ * updateOracle: false,
1250
+ * }
1251
+ * );
1252
+ * ```
1253
+ */
1254
+ declare function createAddLiquidityInstruction(accounts: AddLiquidityAccounts, args: AddLiquidityArgsWithOracle, programId?: Address): Instruction;
1255
+
1256
+ /**
1257
+ * Accounts required for remove_liquidity instruction
1258
+ */
1259
+ interface RemoveLiquidityAccounts {
1260
+ /** AmmConfig account (read-only) */
1261
+ config: Address;
1262
+ /** Pool account (writable) */
1263
+ pool: Address;
1264
+ /** User's position account (writable) */
1265
+ position: Address;
1266
+ /** Protocol position for protocol fees (writable) */
1267
+ protocolPosition: Address;
1268
+ /** Position owner (signer) */
1269
+ owner: Address;
1270
+ /** Pool authority PDA (read-only) */
1271
+ authority: Address;
1272
+ /** Pool vault for token0 (writable) */
1273
+ vault0: Address;
1274
+ /** Pool vault for token1 (writable) */
1275
+ vault1: Address;
1276
+ /** Token0 mint (read-only) */
1277
+ token0Mint: Address;
1278
+ /** Token1 mint (read-only) */
1279
+ token1Mint: Address;
1280
+ /** User's token0 account (writable) */
1281
+ user0: Address;
1282
+ /** User's token1 account (writable) */
1283
+ user1: Address;
1284
+ /** SPL Token program */
1285
+ tokenProgram?: Address;
1286
+ /** Oracle account (optional, required if updateOracle is true) */
1287
+ oracle?: Address;
1288
+ /** Optional remaining accounts (sentinel program/state, route/oracle data) */
1289
+ remainingAccounts?: Address[];
1290
+ }
1291
+ /**
1292
+ * Create a remove_liquidity instruction
1293
+ *
1294
+ * Removes liquidity from a pool by burning LP shares and receiving tokens back.
1295
+ * The amount of tokens received is proportional to the share of the pool being withdrawn.
1296
+ * Also accrues any pending fees to the position before withdrawal.
1297
+ *
1298
+ * @param accounts - Required accounts for removing liquidity
1299
+ * @param args - Instruction arguments (sharesIn, minAmount0Out, minAmount1Out, updateOracle)
1300
+ * @param programId - Program ID (defaults to CPMM program)
1301
+ * @returns Instruction to remove liquidity
1302
+ *
1303
+ * @example
1304
+ * ```ts
1305
+ * const ix = createRemoveLiquidityInstruction(
1306
+ * {
1307
+ * config: configAddress,
1308
+ * pool: poolAddress,
1309
+ * position: positionAddress,
1310
+ * protocolPosition: protocolPositionAddress,
1311
+ * owner: userPublicKey,
1312
+ * authority: authorityPda,
1313
+ * vault0: vault0Address,
1314
+ * vault1: vault1Address,
1315
+ * token0Mint: mint0,
1316
+ * token1Mint: mint1,
1317
+ * user0: userToken0Account,
1318
+ * user1: userToken1Account,
1319
+ * },
1320
+ * {
1321
+ * sharesIn: 500000n,
1322
+ * minAmount0Out: 450000n,
1323
+ * minAmount1Out: 450000n,
1324
+ * updateOracle: false,
1325
+ * }
1326
+ * );
1327
+ * ```
1328
+ */
1329
+ declare function createRemoveLiquidityInstruction(accounts: RemoveLiquidityAccounts, args: RemoveLiquidityArgs, programId?: Address): Instruction;
1330
+
1331
+ /**
1332
+ * Accounts required for collect_fees instruction
1333
+ */
1334
+ interface CollectFeesAccounts {
1335
+ /** Pool account (writable) */
1336
+ pool: Address;
1337
+ /** User's position account (writable) */
1338
+ position: Address;
1339
+ /** Position owner (signer) */
1340
+ owner: Address;
1341
+ /** Pool authority PDA (read-only) */
1342
+ authority: Address;
1343
+ /** Pool vault for token0 (writable) */
1344
+ vault0: Address;
1345
+ /** Pool vault for token1 (writable) */
1346
+ vault1: Address;
1347
+ /** Token0 mint (read-only) */
1348
+ token0Mint: Address;
1349
+ /** Token1 mint (read-only) */
1350
+ token1Mint: Address;
1351
+ /** User's token0 account (writable) */
1352
+ user0: Address;
1353
+ /** User's token1 account (writable) */
1354
+ user1: Address;
1355
+ /** SPL Token program */
1356
+ tokenProgram?: Address;
1357
+ }
1358
+ /**
1359
+ * Create a collect_fees instruction
1360
+ *
1361
+ * Collects accrued LP fees from a position. Fees are first accrued from the global
1362
+ * fee growth, then transferred from the pool vaults to the user's token accounts.
1363
+ * You can specify max amounts to partially collect fees.
1364
+ *
1365
+ * @param accounts - Required accounts for collecting fees
1366
+ * @param args - Instruction arguments (max0, max1)
1367
+ * @param programId - Program ID (defaults to CPMM program)
1368
+ * @returns Instruction to collect fees
1369
+ *
1370
+ * @example
1371
+ * ```ts
1372
+ * // Collect all accrued fees
1373
+ * const ix = createCollectFeesInstruction(
1374
+ * {
1375
+ * pool: poolAddress,
1376
+ * position: positionAddress,
1377
+ * owner: userPublicKey,
1378
+ * authority: authorityPda,
1379
+ * vault0: vault0Address,
1380
+ * vault1: vault1Address,
1381
+ * token0Mint: mint0,
1382
+ * token1Mint: mint1,
1383
+ * user0: userToken0Account,
1384
+ * user1: userToken1Account,
1385
+ * },
1386
+ * {
1387
+ * max0: BigInt('18446744073709551615'), // u64::MAX to collect all
1388
+ * max1: BigInt('18446744073709551615'),
1389
+ * }
1390
+ * );
1391
+ * ```
1392
+ */
1393
+ declare function createCollectFeesInstruction(accounts: CollectFeesAccounts, args: CollectFeesArgs, programId?: Address): Instruction;
1394
+ /**
1395
+ * Convenience constant for collecting all fees (u64::MAX)
1396
+ */
1397
+ declare const MAX_FEE_AMOUNT: bigint;
1398
+
1399
+ /**
1400
+ * Accounts required for collect_protocol_fees instruction
1401
+ */
1402
+ interface CollectProtocolFeesAccounts {
1403
+ /** AmmConfig account (read-only) */
1404
+ config: Address;
1405
+ /** Pool account (writable) */
1406
+ pool: Address;
1407
+ /** Protocol position account (writable) */
1408
+ protocolPosition: Address;
1409
+ /** Admin authority (signer) */
1410
+ admin: Address;
1411
+ /** Pool authority PDA (read-only) */
1412
+ authority: Address;
1413
+ /** Pool vault for token0 (writable) */
1414
+ vault0: Address;
1415
+ /** Pool vault for token1 (writable) */
1416
+ vault1: Address;
1417
+ /** Token0 mint (read-only) */
1418
+ token0Mint: Address;
1419
+ /** Token1 mint (read-only) */
1420
+ token1Mint: Address;
1421
+ /** Recipient token0 account (writable) */
1422
+ recipient0: Address;
1423
+ /** Recipient token1 account (writable) */
1424
+ recipient1: Address;
1425
+ /** SPL Token program */
1426
+ tokenProgram?: Address;
1427
+ }
1428
+ /**
1429
+ * Create a collect_protocol_fees instruction
1430
+ *
1431
+ * Collects accrued protocol fees from the protocol position and transfers them
1432
+ * to the configured recipients.
1433
+ *
1434
+ * @param accounts - Required accounts for collecting protocol fees
1435
+ * @param args - Instruction arguments (max0, max1)
1436
+ * @param programId - Program ID (defaults to CPMM program)
1437
+ * @returns Instruction to collect protocol fees
1438
+ *
1439
+ * @example
1440
+ * ```ts
1441
+ * const ix = createCollectProtocolFeesInstruction(
1442
+ * {
1443
+ * config: configAddress,
1444
+ * pool: poolAddress,
1445
+ * protocolPosition: protocolPositionAddress,
1446
+ * admin: adminPublicKey,
1447
+ * authority: authorityPda,
1448
+ * vault0: vault0Address,
1449
+ * vault1: vault1Address,
1450
+ * token0Mint: mint0,
1451
+ * token1Mint: mint1,
1452
+ * recipient0: adminToken0Account,
1453
+ * recipient1: adminToken1Account,
1454
+ * },
1455
+ * {
1456
+ * max0: BigInt('18446744073709551615'),
1457
+ * max1: BigInt('18446744073709551615'),
1458
+ * }
1459
+ * );
1460
+ * ```
1461
+ */
1462
+ declare function createCollectProtocolFeesInstruction(accounts: CollectProtocolFeesAccounts, args: CollectProtocolFeesArgs, programId?: Address): Instruction;
1463
+
1464
+ /**
1465
+ * Accounts required for oracle_update instruction
1466
+ */
1467
+ interface OracleUpdateAccounts {
1468
+ /** Pool account (read-only) */
1469
+ pool: Address;
1470
+ /** Oracle PDA to update (writable) */
1471
+ oracle: Address;
1472
+ }
1473
+ /**
1474
+ * Create an oracle_update instruction
1475
+ *
1476
+ * Updates the oracle with the current pool prices. This samples the current
1477
+ * spot price, clamps it according to maxPriceChangeRatioQ64, and records
1478
+ * a new observation if the observation interval has elapsed.
1479
+ *
1480
+ * This instruction is permissionless - anyone can call it to update the oracle.
1481
+ *
1482
+ * @param accounts - Required accounts for the instruction
1483
+ * @param programId - Program ID (defaults to CPMM program)
1484
+ * @returns Instruction to update the oracle
1485
+ *
1486
+ * @example
1487
+ * ```ts
1488
+ * const ix = createOracleUpdateInstruction({
1489
+ * pool: poolAddress,
1490
+ * oracle: oracleAddress,
1491
+ * });
1492
+ * ```
1493
+ */
1494
+ declare function createOracleUpdateInstruction(accounts: OracleUpdateAccounts, programId?: Address): Instruction;
1495
+
1496
+ /**
1497
+ * Accounts required for oracle_consult instruction
1498
+ */
1499
+ interface OracleConsultAccounts {
1500
+ /** Pool account (read-only) */
1501
+ pool: Address;
1502
+ /** Oracle PDA to query (read-only) */
1503
+ oracle: Address;
1504
+ }
1505
+ /**
1506
+ * Result returned from oracle_consult via return data
1507
+ */
1508
+ interface OracleConsultResult {
1509
+ /** TWAP price of token0 in token1 (Q64.64 fixed-point) */
1510
+ price0Q64: bigint;
1511
+ /** TWAP price of token1 in token0 (Q64.64 fixed-point) */
1512
+ price1Q64: bigint;
1513
+ }
1514
+ /**
1515
+ * Decode oracle_consult return data
1516
+ */
1517
+ declare function decodeOracleConsultResult(data: ReadonlyUint8Array): OracleConsultResult;
1518
+ /**
1519
+ * Create an oracle_consult instruction
1520
+ *
1521
+ * Queries the TWAP price from the oracle over the specified time window.
1522
+ * The result is returned via Solana's return data mechanism.
1523
+ *
1524
+ * Note: To read the result, you must invoke this instruction via CPI or
1525
+ * simulate the transaction and parse the return data.
1526
+ *
1527
+ * @param accounts - Required accounts for the instruction
1528
+ * @param args - Instruction arguments (windowSeconds)
1529
+ * @param programId - Program ID (defaults to CPMM program)
1530
+ * @returns Instruction to consult the oracle
1531
+ *
1532
+ * @example
1533
+ * ```ts
1534
+ * const ix = createOracleConsultInstruction(
1535
+ * {
1536
+ * pool: poolAddress,
1537
+ * oracle: oracleAddress,
1538
+ * },
1539
+ * {
1540
+ * windowSeconds: 300, // 5-minute TWAP
1541
+ * }
1542
+ * );
1543
+ * ```
1544
+ */
1545
+ declare function createOracleConsultInstruction(accounts: OracleConsultAccounts, args: OracleConsultArgs, programId?: Address): Instruction;
1546
+
1547
+ /**
1548
+ * Accounts required for quote_to_numeraire instruction
1549
+ */
1550
+ interface QuoteToNumeraireAccounts {
1551
+ /** AmmConfig account (read-only) */
1552
+ config: Address;
1553
+ /** Starting pool for the route (read-only) */
1554
+ startPool: Address;
1555
+ /**
1556
+ * Remaining accounts for routing:
1557
+ * - [pool1?, pool2?, ...]
1558
+ *
1559
+ * Each hop requires the next pool in the route chain.
1560
+ */
1561
+ remainingAccounts?: Address[];
1562
+ }
1563
+ /**
1564
+ * Result returned from quote_to_numeraire via return data
1565
+ */
1566
+ interface QuoteToNumeraireResult {
1567
+ /** Amount converted to numeraire (u128) */
1568
+ amountInNumeraire: bigint;
1569
+ /** Final mint reached (should be numeraire) */
1570
+ endMint: Address;
1571
+ /** Number of hops used in the route */
1572
+ hopsUsed: number;
1573
+ }
1574
+ /**
1575
+ * Decode quote_to_numeraire return data
1576
+ */
1577
+ declare function decodeQuoteToNumeraireResult(data: ReadonlyUint8Array): QuoteToNumeraireResult;
1578
+ /**
1579
+ * Create a quote_to_numeraire instruction
1580
+ *
1581
+ * Converts an amount of one token to its value in the pool's numeraire
1582
+ * via the routing chain using spot pricing. (TWAP is not supported in v0.1.)
1583
+ *
1584
+ * The result is returned via Solana's return data mechanism.
1585
+ *
1586
+ * @param accounts - Required accounts for the instruction
1587
+ * @param args - Instruction arguments (amount, side, maxHops, useTwap, windowSeconds)
1588
+ * @param programId - Program ID (defaults to CPMM program)
1589
+ * @returns Instruction to quote amount in numeraire
1590
+ *
1591
+ * @example
1592
+ * ```ts
1593
+ * // Quote using spot prices (no TWAP)
1594
+ * const ix = createQuoteToNumeraireInstruction(
1595
+ * {
1596
+ * config: configAddress,
1597
+ * startPool: poolAddress,
1598
+ * },
1599
+ * {
1600
+ * amount: 1000000n,
1601
+ * side: 0, // token0
1602
+ * maxHops: 3,
1603
+ * useTwap: false,
1604
+ * windowSeconds: 0,
1605
+ * }
1606
+ * );
1607
+ * ```
1608
+ */
1609
+ declare function createQuoteToNumeraireInstruction(accounts: QuoteToNumeraireAccounts, args: QuoteToNumeraireArgs, programId?: Address): Instruction;
1610
+
1611
+ /**
1612
+ * Pool fetching and utility functions for the CPMM SDK
1613
+ */
1614
+
1615
+ /**
1616
+ * Configuration for fetching pools
1617
+ */
1618
+ interface FetchPoolsConfig {
1619
+ /** Program ID (defaults to CPMM program) */
1620
+ programId?: Address;
1621
+ /** Commitment level */
1622
+ commitment?: 'processed' | 'confirmed' | 'finalized';
1623
+ }
1624
+ /**
1625
+ * Pool with its address
1626
+ */
1627
+ interface PoolWithAddress {
1628
+ address: Address;
1629
+ account: Pool;
1630
+ }
1631
+ /**
1632
+ * Fetch and decode a single pool account
1633
+ *
1634
+ * @param rpc - Solana RPC client
1635
+ * @param address - Pool account address
1636
+ * @param config - Optional configuration
1637
+ * @returns Decoded pool data or null if not found
1638
+ *
1639
+ * @example
1640
+ * ```ts
1641
+ * const pool = await fetchPool(rpc, poolAddress);
1642
+ * if (pool) {
1643
+ * console.log(`Pool reserves: ${pool.reserve0} / ${pool.reserve1}`);
1644
+ * }
1645
+ * ```
1646
+ */
1647
+ declare function fetchPool(rpc: Rpc<GetAccountInfoApi>, address: Address, config?: FetchPoolsConfig): Promise<Pool | null>;
1648
+ /**
1649
+ * Fetch all pool accounts for the CPMM program
1650
+ *
1651
+ * Uses getProgramAccounts with a discriminator filter for efficiency.
1652
+ *
1653
+ * @param rpc - Solana RPC client
1654
+ * @param config - Optional configuration
1655
+ * @returns Array of pools with their addresses
1656
+ *
1657
+ * @example
1658
+ * ```ts
1659
+ * const pools = await fetchAllPools(rpc);
1660
+ * console.log(`Found ${pools.length} pools`);
1661
+ * for (const { address, account } of pools) {
1662
+ * console.log(`Pool ${address}: ${account.token0Mint} / ${account.token1Mint}`);
1663
+ * }
1664
+ * ```
1665
+ */
1666
+ declare function fetchAllPools(rpc: GetProgramAccountsRpc, config?: FetchPoolsConfig): Promise<PoolWithAddress[]>;
1667
+ /**
1668
+ * Find a pool by its token pair mints
1669
+ *
1670
+ * Derives the pool PDA from the mints (automatically sorted) and fetches it.
1671
+ *
1672
+ * @param rpc - Solana RPC client
1673
+ * @param mint0 - First token mint
1674
+ * @param mint1 - Second token mint
1675
+ * @param config - Optional configuration
1676
+ * @returns Pool data with address, or null if not found
1677
+ *
1678
+ * @example
1679
+ * ```ts
1680
+ * const result = await getPoolByMints(rpc, usdcMint, wsolMint);
1681
+ * if (result) {
1682
+ * console.log(`Found pool at ${result.address}`);
1683
+ * console.log(`Swap fee: ${result.account.swapFeeBps} bps`);
1684
+ * }
1685
+ * ```
1686
+ */
1687
+ declare function getPoolByMints(rpc: Rpc<GetAccountInfoApi>, mint0: Address, mint1: Address, config?: FetchPoolsConfig): Promise<PoolWithAddress | null>;
1688
+ /**
1689
+ * Get multiple pools by their addresses in a single batch request
1690
+ *
1691
+ * @param rpc - Solana RPC client
1692
+ * @param addresses - Array of pool addresses to fetch
1693
+ * @param config - Optional configuration
1694
+ * @returns Map of address to pool (missing pools are not included)
1695
+ *
1696
+ * @example
1697
+ * ```ts
1698
+ * const poolMap = await fetchPoolsBatch(rpc, [pool1, pool2, pool3]);
1699
+ * for (const [addr, pool] of poolMap) {
1700
+ * console.log(`Pool ${addr}: TVL = ${pool.reserve0 + pool.reserve1}`);
1701
+ * }
1702
+ * ```
1703
+ */
1704
+ declare function fetchPoolsBatch(rpc: Rpc<GetAccountInfoApi>, addresses: Address[], config?: FetchPoolsConfig): Promise<Map<Address, Pool>>;
1705
+ /**
1706
+ * Check if a pool exists for a token pair
1707
+ *
1708
+ * @param rpc - Solana RPC client
1709
+ * @param mint0 - First token mint
1710
+ * @param mint1 - Second token mint
1711
+ * @param config - Optional configuration
1712
+ * @returns true if pool exists, false otherwise
1713
+ */
1714
+ declare function poolExists(rpc: Rpc<GetAccountInfoApi>, mint0: Address, mint1: Address, config?: FetchPoolsConfig): Promise<boolean>;
1715
+ /**
1716
+ * Get the pool address for a token pair without fetching
1717
+ *
1718
+ * @param mint0 - First token mint
1719
+ * @param mint1 - Second token mint
1720
+ * @param programId - Program ID (defaults to CPMM program)
1721
+ * @returns Pool address and sorted mints
1722
+ */
1723
+ declare function getPoolAddressFromMints(mint0: Address, mint1: Address, programId?: Address): Promise<{
1724
+ poolAddress: Address;
1725
+ token0: Address;
1726
+ token1: Address;
1727
+ }>;
1728
+ /**
1729
+ * Filter pools by a specific token mint
1730
+ *
1731
+ * @param pools - Array of pools to filter
1732
+ * @param mint - Token mint to filter by
1733
+ * @returns Pools that contain the specified mint
1734
+ */
1735
+ declare function filterPoolsByMint(pools: PoolWithAddress[], mint: Address): PoolWithAddress[];
1736
+ /**
1737
+ * Sort pools by total reserves (proxy for TVL)
1738
+ *
1739
+ * @param pools - Array of pools to sort
1740
+ * @param descending - Sort descending (highest first) if true
1741
+ * @returns Sorted array (does not mutate input)
1742
+ */
1743
+ declare function sortPoolsByReserves(pools: PoolWithAddress[], descending?: boolean): PoolWithAddress[];
1744
+
1745
+ /**
1746
+ * Config fetching and utilities for the CPMM SDK
1747
+ */
1748
+
1749
+ /**
1750
+ * Fetch and decode the AmmConfig account
1751
+ *
1752
+ * @param rpc - Solana RPC client
1753
+ * @param programId - Program ID (defaults to CPMM program)
1754
+ * @param commitment - Optional commitment level
1755
+ * @returns Decoded config data or null if not found
1756
+ */
1757
+ declare function fetchConfig(rpc: Rpc<GetAccountInfoApi>, programId?: Address, commitment?: 'processed' | 'confirmed' | 'finalized'): Promise<AmmConfig | null>;
1758
+ /**
1759
+ * Fetch config with its PDA address
1760
+ */
1761
+ declare function fetchConfigWithAddress(rpc: Rpc<GetAccountInfoApi>, programId?: Address, commitment?: 'processed' | 'confirmed' | 'finalized'): Promise<{
1762
+ address: Address;
1763
+ account: AmmConfig;
1764
+ } | null>;
1765
+
1766
+ /**
1767
+ * Program ID for the Initializer program.
1768
+ *
1769
+ * Source of truth: programs/initializer/src/lib.rs
1770
+ */
1771
+ declare const INITIALIZER_PROGRAM_ID: Address;
1772
+ declare const BPF_LOADER_UPGRADEABLE_PROGRAM_ID: Address;
1773
+ declare const SEED_CONFIG = "config_v3";
1774
+ declare const SEED_LAUNCH = "launch_v3";
1775
+ declare const SEED_LAUNCH_AUTHORITY = "launch_authority_v3";
1776
+ /**
1777
+ * Commitment hash for an empty remaining-accounts list — SHA256 of [0,0,0,0].
1778
+ * Pass this for sentinelRemainingAccountsHash and migratorRemainingAccountsHash
1779
+ * when no extra accounts are needed.
1780
+ */
1781
+ declare const EMPTY_REMAINING_ACCOUNTS_HASH: Uint8Array<ArrayBuffer>;
1782
+ /**
1783
+ * Devnet ALT containing static accounts shared by every initializeLaunch tx.
1784
+ * Indices: 0=TOKEN_PROGRAM, 1=SYSTEM_PROGRAM, 2=SYSVAR_RENT,
1785
+ * 3=INITIALIZER_PROGRAM, 4=TOKEN_METADATA_PROGRAM,
1786
+ * 5=CPMM_MIGRATOR_PROGRAM, 6=WSOL_MINT, 7=config PDA
1787
+ */
1788
+ declare const DOPPLER_DEVNET_ALT: Address;
1789
+ declare const MAX_MIGRATOR_ALLOWLIST = 32;
1790
+ declare const MAX_SENTINEL_ALLOWLIST = 32;
1791
+ declare const MAX_CALLDATA = 256;
1792
+ declare const PHASE_TRADING = 0;
1793
+ declare const PHASE_MIGRATED = 1;
1794
+ declare const PHASE_ABORTED = 2;
1795
+ declare const DIRECTION_BUY = 0;
1796
+ declare const DIRECTION_SELL = 1;
1797
+ declare const CURVE_KIND_XYK = 0;
1798
+ declare const CURVE_PARAMS_FORMAT_XYK_V0 = 0;
1799
+ declare const SF_BEFORE_SWAP: number;
1800
+ declare const SF_AFTER_SWAP: number;
1801
+ declare const SENTINEL_NO_CHANGE = 65535;
1802
+ declare const INITIALIZER_INSTRUCTION_DISCRIMINATORS: {
1803
+ readonly initializeConfig: Uint8Array<ArrayBuffer>;
1804
+ readonly setMigratorAllowlist: Uint8Array<ArrayBuffer>;
1805
+ readonly setSentinelAllowlist: Uint8Array<ArrayBuffer>;
1806
+ readonly initializeLaunch: Uint8Array<ArrayBuffer>;
1807
+ readonly curveSwapExactIn: Uint8Array<ArrayBuffer>;
1808
+ readonly migrateLaunch: Uint8Array<ArrayBuffer>;
1809
+ readonly abortLaunch: Uint8Array<ArrayBuffer>;
1810
+ readonly previewSwapExactIn: Uint8Array<ArrayBuffer>;
1811
+ readonly previewMigration: Uint8Array<ArrayBuffer>;
1812
+ };
1813
+ declare const INITIALIZER_ACCOUNT_DISCRIMINATORS: {
1814
+ readonly InitConfig: Uint8Array<ArrayBuffer>;
1815
+ readonly Launch: Uint8Array<ArrayBuffer>;
1816
+ };
1817
+
1818
+ /**
1819
+ * This code was AUTOGENERATED using the Codama library.
1820
+ * Please DO NOT EDIT THIS FILE, instead use visitors
1821
+ * to add features, then rerun Codama to update it.
1822
+ *
1823
+ * @see https://github.com/codama-idl/codama
1824
+ */
1825
+
1826
+ type InitConfig = {
1827
+ discriminator: ReadonlyUint8Array;
1828
+ admin: Address;
1829
+ migratorAllowlistLen: number;
1830
+ migratorAllowlist: Array<Address>;
1831
+ sentinelAllowlistLen: number;
1832
+ sentinelAllowlist: Array<Address>;
1833
+ bump: number;
1834
+ version: number;
1835
+ reserved: ReadonlyUint8Array;
1836
+ };
1837
+ type InitConfigArgs = {
1838
+ admin: Address;
1839
+ migratorAllowlistLen: number;
1840
+ migratorAllowlist: Array<Address>;
1841
+ sentinelAllowlistLen: number;
1842
+ sentinelAllowlist: Array<Address>;
1843
+ bump: number;
1844
+ version: number;
1845
+ reserved: ReadonlyUint8Array;
1846
+ };
1847
+ /** Gets the encoder for {@link InitConfigArgs} account data. */
1848
+ declare function getInitConfigEncoder(): FixedSizeEncoder<InitConfigArgs>;
1849
+ /** Gets the decoder for {@link InitConfig} account data. */
1850
+ declare function getInitConfigDecoder(): FixedSizeDecoder<InitConfig>;
1851
+ /** Gets the codec for {@link InitConfig} account data. */
1852
+ declare function getInitConfigCodec(): FixedSizeCodec<InitConfigArgs, InitConfig>;
1853
+
1854
+ /**
1855
+ * This code was AUTOGENERATED using the Codama library.
1856
+ * Please DO NOT EDIT THIS FILE, instead use visitors
1857
+ * to add features, then rerun Codama to update it.
1858
+ *
1859
+ * @see https://github.com/codama-idl/codama
1860
+ */
1861
+
1862
+ type CalldataBuf = {
1863
+ len: number;
1864
+ bytes: ReadonlyUint8Array;
1865
+ };
1866
+ type CalldataBufArgs = CalldataBuf;
1867
+
1868
+ /**
1869
+ * This code was AUTOGENERATED using the Codama library.
1870
+ * Please DO NOT EDIT THIS FILE, instead use visitors
1871
+ * to add features, then rerun Codama to update it.
1872
+ *
1873
+ * @see https://github.com/codama-idl/codama
1874
+ */
1875
+
1876
+ type InitializeConfigArgs = {
1877
+ migratorAllowlist: Array<Address>;
1878
+ sentinelAllowlist: Array<Address>;
1879
+ };
1880
+ type InitializeConfigArgsArgs = InitializeConfigArgs;
1881
+ declare function getInitializeConfigArgsEncoder(): Encoder<InitializeConfigArgsArgs>;
1882
+ declare function getInitializeConfigArgsDecoder(): Decoder<InitializeConfigArgs>;
1883
+ declare function getInitializeConfigArgsCodec(): Codec<InitializeConfigArgsArgs, InitializeConfigArgs>;
1884
+
1885
+ /**
1886
+ * This code was AUTOGENERATED using the Codama library.
1887
+ * Please DO NOT EDIT THIS FILE, instead use visitors
1888
+ * to add features, then rerun Codama to update it.
1889
+ *
1890
+ * @see https://github.com/codama-idl/codama
1891
+ */
1892
+
1893
+ type InitializeLaunchArgs = {
1894
+ namespace: Address;
1895
+ launchId: ReadonlyUint8Array;
1896
+ baseDecimals: number;
1897
+ baseTotalSupply: bigint;
1898
+ baseForDistribution: bigint;
1899
+ baseForLiquidity: bigint;
1900
+ curveVirtualBase: bigint;
1901
+ curveVirtualQuote: bigint;
1902
+ curveFeeBps: number;
1903
+ curveKind: number;
1904
+ curveParams: ReadonlyUint8Array;
1905
+ allowBuy: number;
1906
+ allowSell: number;
1907
+ sentinelProgram: Address;
1908
+ sentinelFlags: number;
1909
+ sentinelCalldata: ReadonlyUint8Array;
1910
+ migratorProgram: Address;
1911
+ migratorInitCalldata: ReadonlyUint8Array;
1912
+ migratorMigrateCalldata: ReadonlyUint8Array;
1913
+ /**
1914
+ * Commitment hash for swap/preview sentinel remaining accounts.
1915
+ * Computed as hash(u32_len || pubkey_0 || ... || pubkey_n).
1916
+ */
1917
+ sentinelRemainingAccountsHash: ReadonlyUint8Array;
1918
+ /**
1919
+ * Commitment hash for migrate remaining accounts.
1920
+ * Computed as hash(u32_len || pubkey_0 || ... || pubkey_n).
1921
+ */
1922
+ migratorRemainingAccountsHash: ReadonlyUint8Array;
1923
+ /** Token name for on-chain metadata. If empty, metadata creation is skipped. */
1924
+ metadataName: string;
1925
+ /** Token symbol for on-chain metadata. */
1926
+ metadataSymbol: string;
1927
+ /** Metadata JSON URI for on-chain metadata. */
1928
+ metadataUri: string;
1929
+ };
1930
+ type InitializeLaunchArgsArgs = {
1931
+ namespace: Address;
1932
+ launchId: ReadonlyUint8Array;
1933
+ baseDecimals: number;
1934
+ baseTotalSupply: number | bigint;
1935
+ baseForDistribution: number | bigint;
1936
+ baseForLiquidity: number | bigint;
1937
+ curveVirtualBase: number | bigint;
1938
+ curveVirtualQuote: number | bigint;
1939
+ curveFeeBps: number;
1940
+ curveKind: number;
1941
+ curveParams: ReadonlyUint8Array;
1942
+ allowBuy: number;
1943
+ allowSell: number;
1944
+ sentinelProgram: Address;
1945
+ sentinelFlags: number;
1946
+ sentinelCalldata: ReadonlyUint8Array;
1947
+ migratorProgram: Address;
1948
+ migratorInitCalldata: ReadonlyUint8Array;
1949
+ migratorMigrateCalldata: ReadonlyUint8Array;
1950
+ /**
1951
+ * Commitment hash for swap/preview sentinel remaining accounts.
1952
+ * Computed as hash(u32_len || pubkey_0 || ... || pubkey_n).
1953
+ */
1954
+ sentinelRemainingAccountsHash: ReadonlyUint8Array;
1955
+ /**
1956
+ * Commitment hash for migrate remaining accounts.
1957
+ * Computed as hash(u32_len || pubkey_0 || ... || pubkey_n).
1958
+ */
1959
+ migratorRemainingAccountsHash: ReadonlyUint8Array;
1960
+ /** Token name for on-chain metadata. If empty, metadata creation is skipped. */
1961
+ metadataName: string;
1962
+ /** Token symbol for on-chain metadata. */
1963
+ metadataSymbol: string;
1964
+ /** Metadata JSON URI for on-chain metadata. */
1965
+ metadataUri: string;
1966
+ };
1967
+ declare function getInitializeLaunchArgsEncoder(): Encoder<InitializeLaunchArgsArgs>;
1968
+ declare function getInitializeLaunchArgsDecoder(): Decoder<InitializeLaunchArgs>;
1969
+ declare function getInitializeLaunchArgsCodec(): Codec<InitializeLaunchArgsArgs, InitializeLaunchArgs>;
1970
+
1971
+ /**
1972
+ * This code was AUTOGENERATED using the Codama library.
1973
+ * Please DO NOT EDIT THIS FILE, instead use visitors
1974
+ * to add features, then rerun Codama to update it.
1975
+ *
1976
+ * @see https://github.com/codama-idl/codama
1977
+ */
1978
+
1979
+ type Launch = {
1980
+ discriminator: ReadonlyUint8Array;
1981
+ authority: Address;
1982
+ namespace: Address;
1983
+ launchId: ReadonlyUint8Array;
1984
+ phase: number;
1985
+ bump: number;
1986
+ launchAuthorityBump: number;
1987
+ pad0: ReadonlyUint8Array;
1988
+ baseMint: Address;
1989
+ quoteMint: Address;
1990
+ baseVault: Address;
1991
+ quoteVault: Address;
1992
+ baseTotalSupply: bigint;
1993
+ baseForDistribution: bigint;
1994
+ baseForLiquidity: bigint;
1995
+ baseForCurve: bigint;
1996
+ curveVirtualBase: bigint;
1997
+ curveVirtualQuote: bigint;
1998
+ curveFeeBps: number;
1999
+ pad1: ReadonlyUint8Array;
2000
+ allowBuy: number;
2001
+ allowSell: number;
2002
+ pad2: ReadonlyUint8Array;
2003
+ sentinelProgram: Address;
2004
+ sentinelFlags: number;
2005
+ pad3: ReadonlyUint8Array;
2006
+ sentinelCalldata: CalldataBuf;
2007
+ migratorProgram: Address;
2008
+ migratorInitCalldata: CalldataBuf;
2009
+ migratorMigrateCalldata: CalldataBuf;
2010
+ curveKind: number;
2011
+ swapLock: number;
2012
+ pad4: ReadonlyUint8Array;
2013
+ curveParams: CalldataBuf;
2014
+ quoteDeposited: bigint;
2015
+ reserved: ReadonlyUint8Array;
2016
+ };
2017
+ type LaunchArgs = {
2018
+ authority: Address;
2019
+ namespace: Address;
2020
+ launchId: ReadonlyUint8Array;
2021
+ phase: number;
2022
+ bump: number;
2023
+ launchAuthorityBump: number;
2024
+ pad0: ReadonlyUint8Array;
2025
+ baseMint: Address;
2026
+ quoteMint: Address;
2027
+ baseVault: Address;
2028
+ quoteVault: Address;
2029
+ baseTotalSupply: number | bigint;
2030
+ baseForDistribution: number | bigint;
2031
+ baseForLiquidity: number | bigint;
2032
+ baseForCurve: number | bigint;
2033
+ curveVirtualBase: number | bigint;
2034
+ curveVirtualQuote: number | bigint;
2035
+ curveFeeBps: number;
2036
+ pad1: ReadonlyUint8Array;
2037
+ allowBuy: number;
2038
+ allowSell: number;
2039
+ pad2: ReadonlyUint8Array;
2040
+ sentinelProgram: Address;
2041
+ sentinelFlags: number;
2042
+ pad3: ReadonlyUint8Array;
2043
+ sentinelCalldata: CalldataBufArgs;
2044
+ migratorProgram: Address;
2045
+ migratorInitCalldata: CalldataBufArgs;
2046
+ migratorMigrateCalldata: CalldataBufArgs;
2047
+ curveKind: number;
2048
+ swapLock: number;
2049
+ pad4: ReadonlyUint8Array;
2050
+ curveParams: CalldataBufArgs;
2051
+ quoteDeposited: number | bigint;
2052
+ reserved: ReadonlyUint8Array;
2053
+ };
2054
+ /** Gets the encoder for {@link LaunchArgs} account data. */
2055
+ declare function getLaunchEncoder(): FixedSizeEncoder<LaunchArgs>;
2056
+ /** Gets the decoder for {@link Launch} account data. */
2057
+ declare function getLaunchDecoder(): FixedSizeDecoder<Launch>;
2058
+ /** Gets the codec for {@link Launch} account data. */
2059
+ declare function getLaunchCodec(): FixedSizeCodec<LaunchArgs, Launch>;
2060
+
2061
+ declare function encodeU64LE(value: bigint): Uint8Array;
2062
+ /**
2063
+ * Derive the InitConfig PDA address.
2064
+ * Seeds: ['config_v3']
2065
+ */
2066
+ declare function getConfigAddress(programId?: Address): Promise<ProgramDerivedAddress>;
2067
+ /**
2068
+ * Derive the ProgramData PDA for an upgradeable program.
2069
+ * Seeds: [initializer_program_id] with program = BPFLoaderUpgradeable.
2070
+ */
2071
+ declare function getProgramDataAddress(programId?: Address): Promise<ProgramDerivedAddress>;
2072
+ /**
2073
+ * Derive the Launch PDA address.
2074
+ * Seeds: ['launch_v3', namespace, launch_id_bytes_32]
2075
+ */
2076
+ declare function getLaunchAddress(namespace: Address, launchId: Uint8Array, programId?: Address): Promise<ProgramDerivedAddress>;
2077
+ /**
2078
+ * Derive the Launch authority PDA address.
2079
+ * Seeds: ['launch_authority_v3', launch]
2080
+ */
2081
+ declare function getLaunchAuthorityAddress(launch: Address, programId?: Address): Promise<ProgramDerivedAddress>;
2082
+ /**
2083
+ * Convenience helper for the common pattern: embed a u64 into a 32-byte launch_id.
2084
+ */
2085
+ declare function launchIdFromU64(launchId: bigint): Uint8Array;
2086
+
2087
+ type AddressOrSigner$6 = Address | TransactionSigner;
2088
+ interface InitializeConfigAccounts {
2089
+ admin: AddressOrSigner$6;
2090
+ config: Address;
2091
+ programData: Address;
2092
+ systemProgram?: Address;
2093
+ }
2094
+ declare function createInitializeConfigInstruction(accounts: InitializeConfigAccounts, args: InitializeConfigArgsArgs, programId?: Address): Instruction;
2095
+
2096
+ type AddressOrSigner$5 = Address | TransactionSigner;
2097
+ interface SetMigratorAllowlistAccounts {
2098
+ admin: AddressOrSigner$5;
2099
+ config: Address;
2100
+ }
2101
+ declare function createSetMigratorAllowlistInstruction(accounts: SetMigratorAllowlistAccounts, allowlist: Address[], programId?: Address): Instruction;
2102
+
2103
+ type AddressOrSigner$4 = Address | TransactionSigner;
2104
+ interface SetSentinelAllowlistAccounts {
2105
+ admin: AddressOrSigner$4;
2106
+ config: Address;
2107
+ }
2108
+ declare function createSetSentinelAllowlistInstruction(accounts: SetSentinelAllowlistAccounts, allowlist: Address[], programId?: Address): Instruction;
2109
+
2110
+ type AddressOrSigner$3 = Address | TransactionSigner;
2111
+ /**
2112
+ * Derive the Metaplex token metadata PDA for a given mint.
2113
+ * Seeds: ["metadata", TOKEN_METADATA_PROGRAM_ID, mint]
2114
+ *
2115
+ * Pass the result as `metadataAccount` in InitializeLaunchAccounts
2116
+ * whenever `metadataName` is non-empty.
2117
+ */
2118
+ declare function getTokenMetadataAddress(mint: Address): Promise<Address>;
2119
+ interface InitializeLaunchAccounts {
2120
+ config: Address;
2121
+ launch: Address;
2122
+ launchAuthority: Address;
2123
+ baseMint: AddressOrSigner$3;
2124
+ quoteMint: Address;
2125
+ baseVault: AddressOrSigner$3;
2126
+ quoteVault: AddressOrSigner$3;
2127
+ payer: AddressOrSigner$3;
2128
+ authority?: AddressOrSigner$3;
2129
+ migratorProgram?: Address;
2130
+ tokenProgram?: Address;
2131
+ systemProgram?: Address;
2132
+ rent: Address;
2133
+ /** Required when args.metadataName is non-empty. Derive with getTokenMetadataAddress(baseMint). */
2134
+ metadataAccount?: Address;
2135
+ /**
2136
+ * Optional Address Lookup Table to reference for static accounts.
2137
+ * When provided, constant non-signer accounts (tokenProgram, systemProgram,
2138
+ * rent, migratorProgram, quoteMint when WSOL, metadataProgram, config) are
2139
+ * encoded as ALT lookup metas instead of 32-byte static keys, reducing
2140
+ * transaction size by ~200+ bytes and enabling V4 metadata within the
2141
+ * 1232-byte Solana transaction limit.
2142
+ *
2143
+ * Use DOPPLER_DEVNET_ALT for devnet.
2144
+ */
2145
+ addressLookupTable?: Address;
2146
+ }
2147
+ declare function createInitializeLaunchInstruction(accounts: InitializeLaunchAccounts, args: InitializeLaunchArgsArgs, programId?: Address): Instruction;
2148
+
2149
+ type AddressOrSigner$2 = Address | TransactionSigner;
2150
+ interface CurveSwapExactInAccounts {
2151
+ config: Address;
2152
+ launch: Address;
2153
+ launchAuthority: Address;
2154
+ baseVault: Address;
2155
+ quoteVault: Address;
2156
+ userBaseAccount: Address;
2157
+ userQuoteAccount: Address;
2158
+ baseMint: Address;
2159
+ quoteMint: Address;
2160
+ user: AddressOrSigner$2;
2161
+ /** Pass the actual sentinel program address, or omit to use System Program as a no-op placeholder. */
2162
+ sentinelProgram?: Address;
2163
+ tokenProgram?: Address;
2164
+ }
2165
+ declare function createCurveSwapExactInInstruction(accounts: CurveSwapExactInAccounts, args: {
2166
+ amountIn: bigint;
2167
+ minAmountOut: bigint;
2168
+ direction: number;
2169
+ }, programId?: Address): Instruction;
2170
+
2171
+ type AddressOrSigner$1 = Address | TransactionSigner;
2172
+ interface MigrateLaunchAccounts {
2173
+ config: Address;
2174
+ launch: Address;
2175
+ launchAuthority: Address;
2176
+ baseMint: Address;
2177
+ quoteMint: Address;
2178
+ baseVault: Address;
2179
+ quoteVault: Address;
2180
+ migratorProgram: Address;
2181
+ payer: AddressOrSigner$1;
2182
+ tokenProgram?: Address;
2183
+ systemProgram?: Address;
2184
+ rent: Address;
2185
+ }
2186
+ declare function createMigrateLaunchInstruction(accounts: MigrateLaunchAccounts, programId?: Address): Instruction;
2187
+
2188
+ type AddressOrSigner = Address | TransactionSigner;
2189
+ interface AbortLaunchAccounts {
2190
+ config: Address;
2191
+ launch: Address;
2192
+ launchAuthority: Address;
2193
+ baseVault: Address;
2194
+ quoteVault: Address;
2195
+ authority: AddressOrSigner;
2196
+ authorityBaseAccount: Address;
2197
+ baseMint: Address;
2198
+ tokenProgram?: Address;
2199
+ }
2200
+ declare function createAbortLaunchInstruction(accounts: AbortLaunchAccounts, programId?: Address): Instruction;
2201
+
2202
+ interface PreviewSwapExactInResult {
2203
+ amountOut: bigint;
2204
+ feePaid: bigint;
2205
+ }
2206
+ interface PreviewSwapExactInAccounts {
2207
+ launch: Address;
2208
+ baseVault: Address;
2209
+ quoteVault: Address;
2210
+ sentinelProgram?: Address;
2211
+ }
2212
+ declare function createPreviewSwapExactInInstruction(accounts: PreviewSwapExactInAccounts, args: {
2213
+ amountIn: bigint;
2214
+ direction: number;
2215
+ }, programId?: Address): Instruction;
2216
+ declare function decodePreviewSwapExactInResult(data: Uint8Array): PreviewSwapExactInResult;
2217
+
2218
+ interface PreviewMigrationResult {
2219
+ baseVaultAmount: bigint;
2220
+ quoteVaultAmount: bigint;
2221
+ baseMintSupply: bigint;
2222
+ }
2223
+ interface PreviewMigrationAccounts {
2224
+ launch: Address;
2225
+ baseMint: Address;
2226
+ baseVault: Address;
2227
+ quoteVault: Address;
2228
+ }
2229
+ declare function createPreviewMigrationInstruction(accounts: PreviewMigrationAccounts, programId?: Address): Instruction;
2230
+ declare function decodePreviewMigrationResult(data: Uint8Array): PreviewMigrationResult;
2231
+
2232
+ /**
2233
+ * Launch fetching functions for the Initializer SDK
2234
+ */
2235
+
2236
+ interface FetchLaunchesConfig {
2237
+ programId?: Address;
2238
+ commitment?: 'processed' | 'confirmed' | 'finalized';
2239
+ }
2240
+ interface LaunchWithAddress {
2241
+ address: Address;
2242
+ account: Launch;
2243
+ }
2244
+ declare function fetchLaunch(rpc: Rpc<GetAccountInfoApi>, address: Address, config?: FetchLaunchesConfig): Promise<Launch | null>;
2245
+ declare function fetchAllLaunches(rpc: GetProgramAccountsRpc, config?: FetchLaunchesConfig): Promise<LaunchWithAddress[]>;
2246
+ /**
2247
+ * Fetch launches filtered by Launch.authority (offset 8).
2248
+ * Note: Permissionless launches have authority == Pubkey::default().
2249
+ */
2250
+ declare function fetchLaunchesByAuthority(rpc: GetProgramAccountsRpc, authority: Address, config?: FetchLaunchesConfig): Promise<LaunchWithAddress[]>;
2251
+ declare function launchExists(rpc: Rpc<GetAccountInfoApi>, namespace: Address, launchId: Uint8Array, config?: FetchLaunchesConfig): Promise<boolean>;
2252
+
2253
+ type index$1_AbortLaunchAccounts = AbortLaunchAccounts;
2254
+ declare const index$1_BPF_LOADER_UPGRADEABLE_PROGRAM_ID: typeof BPF_LOADER_UPGRADEABLE_PROGRAM_ID;
2255
+ declare const index$1_CURVE_KIND_XYK: typeof CURVE_KIND_XYK;
2256
+ declare const index$1_CURVE_PARAMS_FORMAT_XYK_V0: typeof CURVE_PARAMS_FORMAT_XYK_V0;
2257
+ type index$1_CalldataBuf = CalldataBuf;
2258
+ type index$1_CurveSwapExactInAccounts = CurveSwapExactInAccounts;
2259
+ declare const index$1_DIRECTION_BUY: typeof DIRECTION_BUY;
2260
+ declare const index$1_DIRECTION_SELL: typeof DIRECTION_SELL;
2261
+ declare const index$1_DOPPLER_DEVNET_ALT: typeof DOPPLER_DEVNET_ALT;
2262
+ declare const index$1_EMPTY_REMAINING_ACCOUNTS_HASH: typeof EMPTY_REMAINING_ACCOUNTS_HASH;
2263
+ type index$1_FetchLaunchesConfig = FetchLaunchesConfig;
2264
+ declare const index$1_INITIALIZER_ACCOUNT_DISCRIMINATORS: typeof INITIALIZER_ACCOUNT_DISCRIMINATORS;
2265
+ declare const index$1_INITIALIZER_INSTRUCTION_DISCRIMINATORS: typeof INITIALIZER_INSTRUCTION_DISCRIMINATORS;
2266
+ declare const index$1_INITIALIZER_PROGRAM_ID: typeof INITIALIZER_PROGRAM_ID;
2267
+ type index$1_InitConfig = InitConfig;
2268
+ type index$1_InitConfigArgs = InitConfigArgs;
2269
+ type index$1_InitializeConfigAccounts = InitializeConfigAccounts;
2270
+ type index$1_InitializeConfigArgs = InitializeConfigArgs;
2271
+ type index$1_InitializeConfigArgsArgs = InitializeConfigArgsArgs;
2272
+ type index$1_InitializeLaunchAccounts = InitializeLaunchAccounts;
2273
+ type index$1_InitializeLaunchArgs = InitializeLaunchArgs;
2274
+ type index$1_InitializeLaunchArgsArgs = InitializeLaunchArgsArgs;
2275
+ type index$1_Launch = Launch;
2276
+ type index$1_LaunchArgs = LaunchArgs;
2277
+ type index$1_LaunchWithAddress = LaunchWithAddress;
2278
+ declare const index$1_MAX_CALLDATA: typeof MAX_CALLDATA;
2279
+ declare const index$1_MAX_MIGRATOR_ALLOWLIST: typeof MAX_MIGRATOR_ALLOWLIST;
2280
+ declare const index$1_MAX_SENTINEL_ALLOWLIST: typeof MAX_SENTINEL_ALLOWLIST;
2281
+ type index$1_MigrateLaunchAccounts = MigrateLaunchAccounts;
2282
+ declare const index$1_PHASE_ABORTED: typeof PHASE_ABORTED;
2283
+ declare const index$1_PHASE_MIGRATED: typeof PHASE_MIGRATED;
2284
+ declare const index$1_PHASE_TRADING: typeof PHASE_TRADING;
2285
+ type index$1_PreviewMigrationAccounts = PreviewMigrationAccounts;
2286
+ type index$1_PreviewMigrationResult = PreviewMigrationResult;
2287
+ type index$1_PreviewSwapExactInAccounts = PreviewSwapExactInAccounts;
2288
+ type index$1_PreviewSwapExactInResult = PreviewSwapExactInResult;
2289
+ declare const index$1_SEED_CONFIG: typeof SEED_CONFIG;
2290
+ declare const index$1_SEED_LAUNCH: typeof SEED_LAUNCH;
2291
+ declare const index$1_SEED_LAUNCH_AUTHORITY: typeof SEED_LAUNCH_AUTHORITY;
2292
+ declare const index$1_SENTINEL_NO_CHANGE: typeof SENTINEL_NO_CHANGE;
2293
+ declare const index$1_SF_AFTER_SWAP: typeof SF_AFTER_SWAP;
2294
+ declare const index$1_SF_BEFORE_SWAP: typeof SF_BEFORE_SWAP;
2295
+ type index$1_SetMigratorAllowlistAccounts = SetMigratorAllowlistAccounts;
2296
+ type index$1_SetSentinelAllowlistAccounts = SetSentinelAllowlistAccounts;
2297
+ declare const index$1_createAbortLaunchInstruction: typeof createAbortLaunchInstruction;
2298
+ declare const index$1_createCurveSwapExactInInstruction: typeof createCurveSwapExactInInstruction;
2299
+ declare const index$1_createInitializeConfigInstruction: typeof createInitializeConfigInstruction;
2300
+ declare const index$1_createInitializeLaunchInstruction: typeof createInitializeLaunchInstruction;
2301
+ declare const index$1_createMigrateLaunchInstruction: typeof createMigrateLaunchInstruction;
2302
+ declare const index$1_createPreviewMigrationInstruction: typeof createPreviewMigrationInstruction;
2303
+ declare const index$1_createPreviewSwapExactInInstruction: typeof createPreviewSwapExactInInstruction;
2304
+ declare const index$1_createSetMigratorAllowlistInstruction: typeof createSetMigratorAllowlistInstruction;
2305
+ declare const index$1_createSetSentinelAllowlistInstruction: typeof createSetSentinelAllowlistInstruction;
2306
+ declare const index$1_decodePreviewMigrationResult: typeof decodePreviewMigrationResult;
2307
+ declare const index$1_decodePreviewSwapExactInResult: typeof decodePreviewSwapExactInResult;
2308
+ declare const index$1_encodeU64LE: typeof encodeU64LE;
2309
+ declare const index$1_fetchAllLaunches: typeof fetchAllLaunches;
2310
+ declare const index$1_fetchLaunch: typeof fetchLaunch;
2311
+ declare const index$1_fetchLaunchesByAuthority: typeof fetchLaunchesByAuthority;
2312
+ declare const index$1_getConfigAddress: typeof getConfigAddress;
2313
+ declare const index$1_getInitConfigCodec: typeof getInitConfigCodec;
2314
+ declare const index$1_getInitConfigDecoder: typeof getInitConfigDecoder;
2315
+ declare const index$1_getInitConfigEncoder: typeof getInitConfigEncoder;
2316
+ declare const index$1_getInitializeConfigArgsCodec: typeof getInitializeConfigArgsCodec;
2317
+ declare const index$1_getInitializeConfigArgsDecoder: typeof getInitializeConfigArgsDecoder;
2318
+ declare const index$1_getInitializeConfigArgsEncoder: typeof getInitializeConfigArgsEncoder;
2319
+ declare const index$1_getInitializeLaunchArgsCodec: typeof getInitializeLaunchArgsCodec;
2320
+ declare const index$1_getInitializeLaunchArgsDecoder: typeof getInitializeLaunchArgsDecoder;
2321
+ declare const index$1_getInitializeLaunchArgsEncoder: typeof getInitializeLaunchArgsEncoder;
2322
+ declare const index$1_getLaunchAddress: typeof getLaunchAddress;
2323
+ declare const index$1_getLaunchAuthorityAddress: typeof getLaunchAuthorityAddress;
2324
+ declare const index$1_getLaunchCodec: typeof getLaunchCodec;
2325
+ declare const index$1_getLaunchDecoder: typeof getLaunchDecoder;
2326
+ declare const index$1_getLaunchEncoder: typeof getLaunchEncoder;
2327
+ declare const index$1_getProgramDataAddress: typeof getProgramDataAddress;
2328
+ declare const index$1_getTokenMetadataAddress: typeof getTokenMetadataAddress;
2329
+ declare const index$1_launchExists: typeof launchExists;
2330
+ declare const index$1_launchIdFromU64: typeof launchIdFromU64;
2331
+ declare namespace index$1 {
2332
+ export { type index$1_AbortLaunchAccounts as AbortLaunchAccounts, index$1_BPF_LOADER_UPGRADEABLE_PROGRAM_ID as BPF_LOADER_UPGRADEABLE_PROGRAM_ID, index$1_CURVE_KIND_XYK as CURVE_KIND_XYK, index$1_CURVE_PARAMS_FORMAT_XYK_V0 as CURVE_PARAMS_FORMAT_XYK_V0, type index$1_CalldataBuf as CalldataBuf, type index$1_CurveSwapExactInAccounts as CurveSwapExactInAccounts, index$1_DIRECTION_BUY as DIRECTION_BUY, index$1_DIRECTION_SELL as DIRECTION_SELL, index$1_DOPPLER_DEVNET_ALT as DOPPLER_DEVNET_ALT, index$1_EMPTY_REMAINING_ACCOUNTS_HASH as EMPTY_REMAINING_ACCOUNTS_HASH, type index$1_FetchLaunchesConfig as FetchLaunchesConfig, index$1_INITIALIZER_ACCOUNT_DISCRIMINATORS as INITIALIZER_ACCOUNT_DISCRIMINATORS, index$1_INITIALIZER_INSTRUCTION_DISCRIMINATORS as INITIALIZER_INSTRUCTION_DISCRIMINATORS, index$1_INITIALIZER_PROGRAM_ID as INITIALIZER_PROGRAM_ID, type index$1_InitConfig as InitConfig, type index$1_InitConfigArgs as InitConfigArgs, type index$1_InitializeConfigAccounts as InitializeConfigAccounts, type index$1_InitializeConfigArgs as InitializeConfigArgs, type index$1_InitializeConfigArgsArgs as InitializeConfigArgsArgs, type index$1_InitializeLaunchAccounts as InitializeLaunchAccounts, type index$1_InitializeLaunchArgs as InitializeLaunchArgs, type index$1_InitializeLaunchArgsArgs as InitializeLaunchArgsArgs, type index$1_Launch as Launch, type index$1_LaunchArgs as LaunchArgs, type index$1_LaunchWithAddress as LaunchWithAddress, index$1_MAX_CALLDATA as MAX_CALLDATA, index$1_MAX_MIGRATOR_ALLOWLIST as MAX_MIGRATOR_ALLOWLIST, index$1_MAX_SENTINEL_ALLOWLIST as MAX_SENTINEL_ALLOWLIST, type index$1_MigrateLaunchAccounts as MigrateLaunchAccounts, index$1_PHASE_ABORTED as PHASE_ABORTED, index$1_PHASE_MIGRATED as PHASE_MIGRATED, index$1_PHASE_TRADING as PHASE_TRADING, type index$1_PreviewMigrationAccounts as PreviewMigrationAccounts, type index$1_PreviewMigrationResult as PreviewMigrationResult, type index$1_PreviewSwapExactInAccounts as PreviewSwapExactInAccounts, type index$1_PreviewSwapExactInResult as PreviewSwapExactInResult, index$1_SEED_CONFIG as SEED_CONFIG, index$1_SEED_LAUNCH as SEED_LAUNCH, index$1_SEED_LAUNCH_AUTHORITY as SEED_LAUNCH_AUTHORITY, index$1_SENTINEL_NO_CHANGE as SENTINEL_NO_CHANGE, index$1_SF_AFTER_SWAP as SF_AFTER_SWAP, index$1_SF_BEFORE_SWAP as SF_BEFORE_SWAP, type index$1_SetMigratorAllowlistAccounts as SetMigratorAllowlistAccounts, type index$1_SetSentinelAllowlistAccounts as SetSentinelAllowlistAccounts, index$1_createAbortLaunchInstruction as createAbortLaunchInstruction, index$1_createCurveSwapExactInInstruction as createCurveSwapExactInInstruction, index$1_createInitializeConfigInstruction as createInitializeConfigInstruction, index$1_createInitializeLaunchInstruction as createInitializeLaunchInstruction, index$1_createMigrateLaunchInstruction as createMigrateLaunchInstruction, index$1_createPreviewMigrationInstruction as createPreviewMigrationInstruction, index$1_createPreviewSwapExactInInstruction as createPreviewSwapExactInInstruction, index$1_createSetMigratorAllowlistInstruction as createSetMigratorAllowlistInstruction, index$1_createSetSentinelAllowlistInstruction as createSetSentinelAllowlistInstruction, index$1_decodePreviewMigrationResult as decodePreviewMigrationResult, index$1_decodePreviewSwapExactInResult as decodePreviewSwapExactInResult, index$1_encodeU64LE as encodeU64LE, index$1_fetchAllLaunches as fetchAllLaunches, index$1_fetchLaunch as fetchLaunch, index$1_fetchLaunchesByAuthority as fetchLaunchesByAuthority, index$1_getConfigAddress as getConfigAddress, index$1_getInitConfigCodec as getInitConfigCodec, index$1_getInitConfigDecoder as getInitConfigDecoder, index$1_getInitConfigEncoder as getInitConfigEncoder, index$1_getInitializeConfigArgsCodec as getInitializeConfigArgsCodec, index$1_getInitializeConfigArgsDecoder as getInitializeConfigArgsDecoder, index$1_getInitializeConfigArgsEncoder as getInitializeConfigArgsEncoder, index$1_getInitializeLaunchArgsCodec as getInitializeLaunchArgsCodec, index$1_getInitializeLaunchArgsDecoder as getInitializeLaunchArgsDecoder, index$1_getInitializeLaunchArgsEncoder as getInitializeLaunchArgsEncoder, index$1_getLaunchAddress as getLaunchAddress, index$1_getLaunchAuthorityAddress as getLaunchAuthorityAddress, index$1_getLaunchCodec as getLaunchCodec, index$1_getLaunchDecoder as getLaunchDecoder, index$1_getLaunchEncoder as getLaunchEncoder, index$1_getProgramDataAddress as getProgramDataAddress, index$1_getTokenMetadataAddress as getTokenMetadataAddress, index$1_launchExists as launchExists, index$1_launchIdFromU64 as launchIdFromU64 };
2333
+ }
2334
+
2335
+ /**
2336
+ * This code was AUTOGENERATED using the Codama library.
2337
+ * Please DO NOT EDIT THIS FILE, instead use visitors
2338
+ * to add features, then rerun Codama to update it.
2339
+ *
2340
+ * @see https://github.com/codama-idl/codama
2341
+ */
2342
+
2343
+ /**
2344
+ * Arguments for migrate instruction.
2345
+ * These are deserialized from the migrator_migrate_calldata passed by initializer.
2346
+ */
2347
+ type MigrateArgs = {
2348
+ /** Base tokens reserved for distribution to recipients */
2349
+ baseForDistribution: bigint;
2350
+ /** Base tokens reserved for CPMM liquidity */
2351
+ baseForLiquidity: bigint;
2352
+ };
2353
+ type MigrateArgsArgs = {
2354
+ /** Base tokens reserved for distribution to recipients */
2355
+ baseForDistribution: number | bigint;
2356
+ /** Base tokens reserved for CPMM liquidity */
2357
+ baseForLiquidity: number | bigint;
2358
+ };
2359
+ declare function getMigrateArgsEncoder(): FixedSizeEncoder<MigrateArgsArgs>;
2360
+ declare function getMigrateArgsDecoder(): FixedSizeDecoder<MigrateArgs>;
2361
+ declare function getMigrateArgsCodec(): FixedSizeCodec<MigrateArgsArgs, MigrateArgs>;
2362
+
2363
+ /**
2364
+ * This code was AUTOGENERATED using the Codama library.
2365
+ * Please DO NOT EDIT THIS FILE, instead use visitors
2366
+ * to add features, then rerun Codama to update it.
2367
+ *
2368
+ * @see https://github.com/codama-idl/codama
2369
+ */
2370
+
2371
+ type Recipient = {
2372
+ wallet: Address;
2373
+ amount: bigint;
2374
+ };
2375
+ type RecipientArgs = {
2376
+ wallet: Address;
2377
+ amount: number | bigint;
2378
+ };
2379
+ declare function getRecipientEncoder(): FixedSizeEncoder<RecipientArgs>;
2380
+ declare function getRecipientDecoder(): FixedSizeDecoder<Recipient>;
2381
+ declare function getRecipientCodec(): FixedSizeCodec<RecipientArgs, Recipient>;
2382
+
2383
+ /**
2384
+ * This code was AUTOGENERATED using the Codama library.
2385
+ * Please DO NOT EDIT THIS FILE, instead use visitors
2386
+ * to add features, then rerun Codama to update it.
2387
+ *
2388
+ * @see https://github.com/codama-idl/codama
2389
+ */
2390
+
2391
+ /**
2392
+ * Arguments for register_launch instruction.
2393
+ * These are deserialized from the migrator_init_calldata passed by initializer.
2394
+ */
2395
+ type RegisterLaunchArgs = {
2396
+ cpmmConfig: Address;
2397
+ initialSwapFeeBps: number;
2398
+ initialFeeSplitBps: number;
2399
+ recipients: Array<Recipient>;
2400
+ minRaiseQuote: bigint;
2401
+ minMigrationPriceQ64Opt: Option<bigint>;
2402
+ };
2403
+ type RegisterLaunchArgsArgs = {
2404
+ cpmmConfig: Address;
2405
+ initialSwapFeeBps: number;
2406
+ initialFeeSplitBps: number;
2407
+ recipients: Array<RecipientArgs>;
2408
+ minRaiseQuote: number | bigint;
2409
+ minMigrationPriceQ64Opt: OptionOrNullable<number | bigint>;
2410
+ };
2411
+ declare function getRegisterLaunchArgsEncoder(): Encoder<RegisterLaunchArgsArgs>;
2412
+ declare function getRegisterLaunchArgsDecoder(): Decoder<RegisterLaunchArgs>;
2413
+ declare function getRegisterLaunchArgsCodec(): Codec<RegisterLaunchArgsArgs, RegisterLaunchArgs>;
2414
+
2415
+ /**
2416
+ * This code was AUTOGENERATED using the Codama library.
2417
+ * Please DO NOT EDIT THIS FILE, instead use visitors
2418
+ * to add features, then rerun Codama to update it.
2419
+ *
2420
+ * @see https://github.com/codama-idl/codama
2421
+ */
2422
+
2423
+ type CpmmMigratorState = {
2424
+ discriminator: ReadonlyUint8Array;
2425
+ /** The launch this state is associated with */
2426
+ launch: Address;
2427
+ /** Admin who registered this launch (receives unsold curve base tokens) */
2428
+ admin: Address;
2429
+ /** CPMM config to use for pool initialization */
2430
+ cpmmConfig: Address;
2431
+ /** Initial swap fee for the CPMM pool (basis points) */
2432
+ initialSwapFeeBps: number;
2433
+ /** Initial fee split for the CPMM pool (basis points) */
2434
+ initialFeeSplitBps: number;
2435
+ /** Padding for alignment */
2436
+ pad0: ReadonlyUint8Array;
2437
+ /** Recipients for base token distribution at migration */
2438
+ recipients: Array<Recipient>;
2439
+ /** Minimum quote tokens required to migrate */
2440
+ minRaiseQuote: bigint;
2441
+ /** Optional minimum price floor (Q64 fixed point) */
2442
+ minMigrationPriceQ64Opt: Option<bigint>;
2443
+ /** Whether this launch has been migrated */
2444
+ isMigrated: boolean;
2445
+ /** Bump seed for this PDA */
2446
+ bump: number;
2447
+ /** Reserved for future use */
2448
+ reserved: ReadonlyUint8Array;
2449
+ };
2450
+ type CpmmMigratorStateArgs = {
2451
+ /** The launch this state is associated with */
2452
+ launch: Address;
2453
+ /** Admin who registered this launch (receives unsold curve base tokens) */
2454
+ admin: Address;
2455
+ /** CPMM config to use for pool initialization */
2456
+ cpmmConfig: Address;
2457
+ /** Initial swap fee for the CPMM pool (basis points) */
2458
+ initialSwapFeeBps: number;
2459
+ /** Initial fee split for the CPMM pool (basis points) */
2460
+ initialFeeSplitBps: number;
2461
+ /** Padding for alignment */
2462
+ pad0: ReadonlyUint8Array;
2463
+ /** Recipients for base token distribution at migration */
2464
+ recipients: Array<RecipientArgs>;
2465
+ /** Minimum quote tokens required to migrate */
2466
+ minRaiseQuote: number | bigint;
2467
+ /** Optional minimum price floor (Q64 fixed point) */
2468
+ minMigrationPriceQ64Opt: OptionOrNullable<number | bigint>;
2469
+ /** Whether this launch has been migrated */
2470
+ isMigrated: boolean;
2471
+ /** Bump seed for this PDA */
2472
+ bump: number;
2473
+ /** Reserved for future use */
2474
+ reserved: ReadonlyUint8Array;
2475
+ };
2476
+ /** Gets the encoder for {@link CpmmMigratorStateArgs} account data. */
2477
+ declare function getCpmmMigratorStateEncoder(): Encoder<CpmmMigratorStateArgs>;
2478
+ /** Gets the decoder for {@link CpmmMigratorState} account data. */
2479
+ declare function getCpmmMigratorStateDecoder(): Decoder<CpmmMigratorState>;
2480
+ /** Gets the codec for {@link CpmmMigratorState} account data. */
2481
+ declare function getCpmmMigratorStateCodec(): Codec<CpmmMigratorStateArgs, CpmmMigratorState>;
2482
+
2483
+ declare const CPMM_MIGRATOR_PROGRAM_ID: Address;
2484
+ declare const SEED_STATE = "state";
2485
+ declare const MAX_RECIPIENTS = 2;
2486
+ declare const CPMM_MIGRATOR_INSTRUCTION_DISCRIMINATORS: {
2487
+ readonly registerLaunch: Uint8Array<ArrayBuffer>;
2488
+ readonly migrate: Uint8Array<ArrayBuffer>;
2489
+ };
2490
+ declare const CPMM_MIGRATOR_ACCOUNT_DISCRIMINATORS: {
2491
+ readonly CpmmMigratorState: Uint8Array<ArrayBuffer>;
2492
+ };
2493
+
2494
+ declare function getCpmmMigratorStateAddress(launch: Address, programId?: Address): Promise<ProgramDerivedAddress>;
2495
+
2496
+ declare function fetchCpmmMigratorState(rpc: Rpc<GetAccountInfoApi>, address: Address): Promise<CpmmMigratorState | null>;
2497
+
2498
+ declare function encodeRegisterLaunchCalldata(args: RegisterLaunchArgsArgs): Uint8Array;
2499
+ declare function encodeMigrateCalldata(args: MigrateArgsArgs): Uint8Array;
2500
+
2501
+ declare const index_CPMM_MIGRATOR_ACCOUNT_DISCRIMINATORS: typeof CPMM_MIGRATOR_ACCOUNT_DISCRIMINATORS;
2502
+ declare const index_CPMM_MIGRATOR_INSTRUCTION_DISCRIMINATORS: typeof CPMM_MIGRATOR_INSTRUCTION_DISCRIMINATORS;
2503
+ declare const index_CPMM_MIGRATOR_PROGRAM_ID: typeof CPMM_MIGRATOR_PROGRAM_ID;
2504
+ type index_CpmmMigratorState = CpmmMigratorState;
2505
+ type index_CpmmMigratorStateArgs = CpmmMigratorStateArgs;
2506
+ declare const index_MAX_RECIPIENTS: typeof MAX_RECIPIENTS;
2507
+ type index_MigrateArgs = MigrateArgs;
2508
+ type index_MigrateArgsArgs = MigrateArgsArgs;
2509
+ type index_Recipient = Recipient;
2510
+ type index_RecipientArgs = RecipientArgs;
2511
+ type index_RegisterLaunchArgs = RegisterLaunchArgs;
2512
+ type index_RegisterLaunchArgsArgs = RegisterLaunchArgsArgs;
2513
+ declare const index_SEED_STATE: typeof SEED_STATE;
2514
+ declare const index_encodeMigrateCalldata: typeof encodeMigrateCalldata;
2515
+ declare const index_encodeRegisterLaunchCalldata: typeof encodeRegisterLaunchCalldata;
2516
+ declare const index_fetchCpmmMigratorState: typeof fetchCpmmMigratorState;
2517
+ declare const index_getCpmmMigratorStateAddress: typeof getCpmmMigratorStateAddress;
2518
+ declare const index_getCpmmMigratorStateCodec: typeof getCpmmMigratorStateCodec;
2519
+ declare const index_getCpmmMigratorStateDecoder: typeof getCpmmMigratorStateDecoder;
2520
+ declare const index_getCpmmMigratorStateEncoder: typeof getCpmmMigratorStateEncoder;
2521
+ declare const index_getMigrateArgsCodec: typeof getMigrateArgsCodec;
2522
+ declare const index_getMigrateArgsDecoder: typeof getMigrateArgsDecoder;
2523
+ declare const index_getMigrateArgsEncoder: typeof getMigrateArgsEncoder;
2524
+ declare const index_getRecipientCodec: typeof getRecipientCodec;
2525
+ declare const index_getRecipientDecoder: typeof getRecipientDecoder;
2526
+ declare const index_getRecipientEncoder: typeof getRecipientEncoder;
2527
+ declare const index_getRegisterLaunchArgsCodec: typeof getRegisterLaunchArgsCodec;
2528
+ declare const index_getRegisterLaunchArgsDecoder: typeof getRegisterLaunchArgsDecoder;
2529
+ declare const index_getRegisterLaunchArgsEncoder: typeof getRegisterLaunchArgsEncoder;
2530
+ declare namespace index {
2531
+ export { index_CPMM_MIGRATOR_ACCOUNT_DISCRIMINATORS as CPMM_MIGRATOR_ACCOUNT_DISCRIMINATORS, index_CPMM_MIGRATOR_INSTRUCTION_DISCRIMINATORS as CPMM_MIGRATOR_INSTRUCTION_DISCRIMINATORS, index_CPMM_MIGRATOR_PROGRAM_ID as CPMM_MIGRATOR_PROGRAM_ID, type index_CpmmMigratorState as CpmmMigratorState, type index_CpmmMigratorStateArgs as CpmmMigratorStateArgs, index_MAX_RECIPIENTS as MAX_RECIPIENTS, type index_MigrateArgs as MigrateArgs, type index_MigrateArgsArgs as MigrateArgsArgs, type index_Recipient as Recipient, type index_RecipientArgs as RecipientArgs, type index_RegisterLaunchArgs as RegisterLaunchArgs, type index_RegisterLaunchArgsArgs as RegisterLaunchArgsArgs, index_SEED_STATE as SEED_STATE, index_encodeMigrateCalldata as encodeMigrateCalldata, index_encodeRegisterLaunchCalldata as encodeRegisterLaunchCalldata, index_fetchCpmmMigratorState as fetchCpmmMigratorState, index_getCpmmMigratorStateAddress as getCpmmMigratorStateAddress, index_getCpmmMigratorStateCodec as getCpmmMigratorStateCodec, index_getCpmmMigratorStateDecoder as getCpmmMigratorStateDecoder, index_getCpmmMigratorStateEncoder as getCpmmMigratorStateEncoder, index_getMigrateArgsCodec as getMigrateArgsCodec, index_getMigrateArgsDecoder as getMigrateArgsDecoder, index_getMigrateArgsEncoder as getMigrateArgsEncoder, index_getRecipientCodec as getRecipientCodec, index_getRecipientDecoder as getRecipientDecoder, index_getRecipientEncoder as getRecipientEncoder, index_getRegisterLaunchArgsCodec as getRegisterLaunchArgsCodec, index_getRegisterLaunchArgsDecoder as getRegisterLaunchArgsDecoder, index_getRegisterLaunchArgsEncoder as getRegisterLaunchArgsEncoder };
2532
+ }
2533
+
2534
+ export { ACCOUNT_DISCRIMINATORS, ACCOUNT_ROLE_READONLY, ACCOUNT_ROLE_SIGNER, ACCOUNT_ROLE_WRITABLE, ACCOUNT_ROLE_WRITABLE_SIGNER, ACCOUNT_VERSION, ASSOCIATED_TOKEN_PROGRAM_ID, type AddLiquidityAccounts, AddLiquidityArgs, type AddLiquidityArgsWithOracle, AddLiquidityQuote, AmmConfig, BPS_DENOM, CPMM_ERROR_MESSAGES, type ClosePositionAccounts, type CollectFeesAccounts, CollectFeesArgs, type CollectProtocolFeesAccounts, CollectProtocolFeesArgs, CpmmError, CpmmErrorCode, type CreatePositionAccounts, CreatePositionArgs, CurveParams, CurveParamsToMarketCapInput, type FetchPoolsConfig, INSTRUCTION_DISCRIMINATORS, type InitializeConfigAccounts$1 as InitializeConfigAccounts, InitializeConfigArgs$1 as InitializeConfigArgs, type InitializeOracleAccounts, InitializeOracleArgs, type InitializePoolAccounts, InitializePoolArgs, MAX_FEE_AMOUNT, MAX_ORACLE_OBSERVATIONS, MAX_SENTINEL_ALLOWLIST$1 as MAX_SENTINEL_ALLOWLIST, MarketCapToCurveParamsInput, MarketCapValidationResult, type OracleConsultAccounts, OracleConsultArgs, type OracleConsultResult, OracleState, type OracleUpdateAccounts, PROGRAM_ID, type PauseAccounts, Pool, type PoolWithAddress, Position, Q64_ONE, type QuoteToNumeraireAccounts, QuoteToNumeraireArgs, type QuoteToNumeraireResult, type RemoveLiquidityAccounts, RemoveLiquidityArgs, RemoveLiquidityQuote, SEED_AUTHORITY, SEED_CONFIG$1 as SEED_CONFIG, SEED_ORACLE, SEED_POOL, SEED_POSITION, SEED_PROTOCOL_POSITION, SENTINEL_NO_CHANGE$1 as SENTINEL_NO_CHANGE, SENTINEL_PROGRAM_ID, SF_AFTER_ADD_LIQ, SF_AFTER_REMOVE_LIQ, SF_AFTER_SWAP$1 as SF_AFTER_SWAP, SF_BEFORE_ADD_LIQ, SF_BEFORE_REMOVE_LIQ, SF_BEFORE_SWAP$1 as SF_BEFORE_SWAP, SYSTEM_PROGRAM_ID, type SetFeesAccounts, SetFeesArgs, type SetRouteAccounts, SetRouteArgs, type SetSentinelAccounts, SetSentinelArgs, type SkimAccounts, SwapDirection, type SwapExactInAccounts, SwapExactInArgs, SwapQuote, SwapQuoteExactOut, TOKEN_METADATA_PROGRAM_ID, TOKEN_PROGRAM_ID, type TransferAdminAccounts, TransferAdminArgs, type UnpauseAccounts, areMintsOrdered, calculateAccruedFees, calculateTwap, calculateTwapNumber, ceilDiv, computePrice0Q64, computePrice1Q64, index as cpmmMigrator, createAddLiquidityInstruction, createClosePositionInstruction, createCollectFeesInstruction, createCollectProtocolFeesInstruction, createCreatePositionInstruction, createInitializeConfigInstruction$1 as createInitializeConfigInstruction, createInitializeOracleInstruction, createInitializePoolInstruction, createOracleConsultInstruction, createOracleUpdateInstruction, createPauseInstruction, createQuoteToNumeraireInstruction, createRemoveLiquidityInstruction, createSetFeesInstruction, createSetRouteInstruction, createSetSentinelInstruction, createSkimInstruction, createSwapExactInInstruction, createSwapInstruction, createTransferAdminInstruction, createUnpauseInstruction, curveParamsToMarketCap, decodeAmmConfig, decodeOracleConsultResult, decodeOracleState, decodePool, decodePosition, decodeQuoteToNumeraireResult, fetchAllPools, fetchConfig, fetchConfigWithAddress, fetchPool, fetchPoolsBatch, filterPoolsByMint, getAddLiquidityQuote, getConfigAddress$1 as getConfigAddress, getErrorMessage, getK, getLiquidityAddresses, getMetadataAddress, getOracleAddress, getPendingFees, getPoolAddress, getPoolAddressFromMints, getPoolAuthorityAddress, getPoolByMints, getPoolInitAddresses, getPositionAddress, getProtocolPositionAddress, getRemoveLiquidityQuote, getSpotPrice0, getSpotPrice1, getSwapAddresses, getSwapQuote, getSwapQuoteExactOut, getTvl, index$1 as initializer, isCpmmError, isqrt, marketCapToCurveParams, marketCapToSingleCurveParams, marketCapToTokenPrice, maxBigInt, minBigInt, numberToQ64, parseErrorFromLogs, poolExists, q64Div, q64Mul, q64ToNumber, ratioToNumber, sortMints, sortPoolsByReserves, validateMarketCapParameters };