@picon-finance/dlmm-sdk 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (386) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +48 -0
  3. package/dist/actions/accept_admin_authority.d.ts +13 -0
  4. package/dist/actions/accept_admin_authority.d.ts.map +1 -0
  5. package/dist/actions/accept_admin_authority.js +7 -0
  6. package/dist/actions/claim_fee.d.ts +21 -0
  7. package/dist/actions/claim_fee.d.ts.map +1 -0
  8. package/dist/actions/claim_fee.js +40 -0
  9. package/dist/actions/claim_multiple_fees.d.ts +19 -0
  10. package/dist/actions/claim_multiple_fees.d.ts.map +1 -0
  11. package/dist/actions/claim_multiple_fees.js +81 -0
  12. package/dist/actions/claim_protocol_fee.d.ts +18 -0
  13. package/dist/actions/claim_protocol_fee.d.ts.map +1 -0
  14. package/dist/actions/claim_protocol_fee.js +33 -0
  15. package/dist/actions/close_position.d.ts +14 -0
  16. package/dist/actions/close_position.d.ts.map +1 -0
  17. package/dist/actions/close_position.js +14 -0
  18. package/dist/actions/create_admin_config.d.ts +15 -0
  19. package/dist/actions/create_admin_config.d.ts.map +1 -0
  20. package/dist/actions/create_admin_config.js +30 -0
  21. package/dist/actions/create_bin_array.d.ts +16 -0
  22. package/dist/actions/create_bin_array.d.ts.map +1 -0
  23. package/dist/actions/create_bin_array.js +10 -0
  24. package/dist/actions/create_pool.d.ts +21 -0
  25. package/dist/actions/create_pool.d.ts.map +1 -0
  26. package/dist/actions/create_pool.js +22 -0
  27. package/dist/actions/delete_bin_array.d.ts +16 -0
  28. package/dist/actions/delete_bin_array.d.ts.map +1 -0
  29. package/dist/actions/delete_bin_array.js +13 -0
  30. package/dist/actions/deposit_by_weight.d.ts +27 -0
  31. package/dist/actions/deposit_by_weight.d.ts.map +1 -0
  32. package/dist/actions/deposit_by_weight.js +52 -0
  33. package/dist/actions/get_admin_config.d.ts +4 -0
  34. package/dist/actions/get_admin_config.d.ts.map +1 -0
  35. package/dist/actions/get_admin_config.js +7 -0
  36. package/dist/actions/get_bin_arrays_by_indices.d.ts +5 -0
  37. package/dist/actions/get_bin_arrays_by_indices.d.ts.map +1 -0
  38. package/dist/actions/get_bin_arrays_by_indices.js +6 -0
  39. package/dist/actions/get_pool.d.ts +4 -0
  40. package/dist/actions/get_pool.d.ts.map +1 -0
  41. package/dist/actions/get_pool.js +5 -0
  42. package/dist/actions/get_position.d.ts +4 -0
  43. package/dist/actions/get_position.d.ts.map +1 -0
  44. package/dist/actions/get_position.js +5 -0
  45. package/dist/actions/get_position_by_position_mint.d.ts +4 -0
  46. package/dist/actions/get_position_by_position_mint.d.ts.map +1 -0
  47. package/dist/actions/get_position_by_position_mint.js +6 -0
  48. package/dist/actions/get_positions_by_owner.d.ts +5 -0
  49. package/dist/actions/get_positions_by_owner.d.ts.map +1 -0
  50. package/dist/actions/get_positions_by_owner.js +33 -0
  51. package/dist/actions/get_positions_by_position_mints.d.ts +5 -0
  52. package/dist/actions/get_positions_by_position_mints.d.ts.map +1 -0
  53. package/dist/actions/get_positions_by_position_mints.js +9 -0
  54. package/dist/actions/helpers/build_swap_transaction_message.d.ts +22 -0
  55. package/dist/actions/helpers/build_swap_transaction_message.d.ts.map +1 -0
  56. package/dist/actions/helpers/build_swap_transaction_message.js +50 -0
  57. package/dist/actions/helpers/build_transaction_message.d.ts +20 -0
  58. package/dist/actions/helpers/build_transaction_message.d.ts.map +1 -0
  59. package/dist/actions/helpers/build_transaction_message.js +5 -0
  60. package/dist/actions/helpers/index.d.ts +8 -0
  61. package/dist/actions/helpers/index.d.ts.map +1 -0
  62. package/dist/actions/helpers/index.js +7 -0
  63. package/dist/actions/helpers/resolve_active_bin_and_mints.d.ts +12 -0
  64. package/dist/actions/helpers/resolve_active_bin_and_mints.d.ts.map +1 -0
  65. package/dist/actions/helpers/resolve_active_bin_and_mints.js +13 -0
  66. package/dist/actions/helpers/resolve_admin_config_address.d.ts +3 -0
  67. package/dist/actions/helpers/resolve_admin_config_address.d.ts.map +1 -0
  68. package/dist/actions/helpers/resolve_admin_config_address.js +9 -0
  69. package/dist/actions/helpers/resolve_mint_info.d.ts +10 -0
  70. package/dist/actions/helpers/resolve_mint_info.d.ts.map +1 -0
  71. package/dist/actions/helpers/resolve_mint_info.js +20 -0
  72. package/dist/actions/helpers/resolve_position_range.d.ts +12 -0
  73. package/dist/actions/helpers/resolve_position_range.d.ts.map +1 -0
  74. package/dist/actions/helpers/resolve_position_range.js +12 -0
  75. package/dist/actions/helpers/resolve_token_mints_and_programs.d.ts +15 -0
  76. package/dist/actions/helpers/resolve_token_mints_and_programs.d.ts.map +1 -0
  77. package/dist/actions/helpers/resolve_token_mints_and_programs.js +29 -0
  78. package/dist/actions/index.d.ts +31 -0
  79. package/dist/actions/index.d.ts.map +1 -0
  80. package/dist/actions/index.js +28 -0
  81. package/dist/actions/is_admin_config_active.d.ts +4 -0
  82. package/dist/actions/is_admin_config_active.d.ts.map +1 -0
  83. package/dist/actions/is_admin_config_active.js +7 -0
  84. package/dist/actions/on_event.d.ts +11 -0
  85. package/dist/actions/on_event.d.ts.map +1 -0
  86. package/dist/actions/on_event.js +50 -0
  87. package/dist/actions/open_position.d.ts +17 -0
  88. package/dist/actions/open_position.d.ts.map +1 -0
  89. package/dist/actions/open_position.js +31 -0
  90. package/dist/actions/quote.d.ts +13 -0
  91. package/dist/actions/quote.d.ts.map +1 -0
  92. package/dist/actions/quote.js +43 -0
  93. package/dist/actions/set_metadata_update_authority.d.ts +14 -0
  94. package/dist/actions/set_metadata_update_authority.d.ts.map +1 -0
  95. package/dist/actions/set_metadata_update_authority.js +7 -0
  96. package/dist/actions/set_pool_dynamic_fee_config.d.ts +16 -0
  97. package/dist/actions/set_pool_dynamic_fee_config.d.ts.map +1 -0
  98. package/dist/actions/set_pool_dynamic_fee_config.js +7 -0
  99. package/dist/actions/set_pool_protocol_share.d.ts +15 -0
  100. package/dist/actions/set_pool_protocol_share.d.ts.map +1 -0
  101. package/dist/actions/set_pool_protocol_share.js +7 -0
  102. package/dist/actions/swap.d.ts +22 -0
  103. package/dist/actions/swap.d.ts.map +1 -0
  104. package/dist/actions/swap.js +19 -0
  105. package/dist/actions/sync_pool.d.ts +15 -0
  106. package/dist/actions/sync_pool.d.ts.map +1 -0
  107. package/dist/actions/sync_pool.js +26 -0
  108. package/dist/actions/transfer_admin_authority.d.ts +14 -0
  109. package/dist/actions/transfer_admin_authority.d.ts.map +1 -0
  110. package/dist/actions/transfer_admin_authority.js +7 -0
  111. package/dist/actions/withdraw.d.ts +22 -0
  112. package/dist/actions/withdraw.d.ts.map +1 -0
  113. package/dist/actions/withdraw.js +41 -0
  114. package/dist/events.d.ts +93 -0
  115. package/dist/events.d.ts.map +1 -0
  116. package/dist/events.js +166 -0
  117. package/dist/generated/accounts/adminConfig.d.ts +35 -0
  118. package/dist/generated/accounts/adminConfig.d.ts.map +1 -0
  119. package/dist/generated/accounts/adminConfig.js +60 -0
  120. package/dist/generated/accounts/binArray.d.ts +40 -0
  121. package/dist/generated/accounts/binArray.d.ts.map +1 -0
  122. package/dist/generated/accounts/binArray.js +65 -0
  123. package/dist/generated/accounts/index.d.ts +12 -0
  124. package/dist/generated/accounts/index.d.ts.map +1 -0
  125. package/dist/generated/accounts/index.js +11 -0
  126. package/dist/generated/accounts/pool.d.ts +54 -0
  127. package/dist/generated/accounts/pool.d.ts.map +1 -0
  128. package/dist/generated/accounts/pool.js +79 -0
  129. package/dist/generated/accounts/position.d.ts +42 -0
  130. package/dist/generated/accounts/position.d.ts.map +1 -0
  131. package/dist/generated/accounts/position.js +67 -0
  132. package/dist/generated/errors/index.d.ts +9 -0
  133. package/dist/generated/errors/index.d.ts.map +1 -0
  134. package/dist/generated/errors/index.js +8 -0
  135. package/dist/generated/errors/piconDlmm.d.ts +58 -0
  136. package/dist/generated/errors/piconDlmm.d.ts.map +1 -0
  137. package/dist/generated/errors/piconDlmm.js +80 -0
  138. package/dist/generated/index.d.ts +14 -0
  139. package/dist/generated/index.d.ts.map +1 -0
  140. package/dist/generated/index.js +13 -0
  141. package/dist/generated/instructions/acceptAdminAuthority.d.ts +47 -0
  142. package/dist/generated/instructions/acceptAdminAuthority.d.ts.map +1 -0
  143. package/dist/generated/instructions/acceptAdminAuthority.js +99 -0
  144. package/dist/generated/instructions/claimFee.d.ts +83 -0
  145. package/dist/generated/instructions/claimFee.d.ts.map +1 -0
  146. package/dist/generated/instructions/claimFee.js +127 -0
  147. package/dist/generated/instructions/claimProtocolFee.d.ts +83 -0
  148. package/dist/generated/instructions/claimProtocolFee.d.ts.map +1 -0
  149. package/dist/generated/instructions/claimProtocolFee.js +147 -0
  150. package/dist/generated/instructions/closePosition.d.ts +59 -0
  151. package/dist/generated/instructions/closePosition.d.ts.map +1 -0
  152. package/dist/generated/instructions/closePosition.js +124 -0
  153. package/dist/generated/instructions/createAdminConfig.d.ts +68 -0
  154. package/dist/generated/instructions/createAdminConfig.d.ts.map +1 -0
  155. package/dist/generated/instructions/createAdminConfig.js +132 -0
  156. package/dist/generated/instructions/createBinArray.d.ts +64 -0
  157. package/dist/generated/instructions/createBinArray.d.ts.map +1 -0
  158. package/dist/generated/instructions/createBinArray.js +122 -0
  159. package/dist/generated/instructions/createPool.d.ts +100 -0
  160. package/dist/generated/instructions/createPool.d.ts.map +1 -0
  161. package/dist/generated/instructions/createPool.js +202 -0
  162. package/dist/generated/instructions/deleteBinArray.d.ts +68 -0
  163. package/dist/generated/instructions/deleteBinArray.d.ts.map +1 -0
  164. package/dist/generated/instructions/deleteBinArray.js +130 -0
  165. package/dist/generated/instructions/depositByWeight.d.ts +99 -0
  166. package/dist/generated/instructions/depositByWeight.d.ts.map +1 -0
  167. package/dist/generated/instructions/depositByWeight.js +136 -0
  168. package/dist/generated/instructions/index.d.ts +25 -0
  169. package/dist/generated/instructions/index.d.ts.map +1 -0
  170. package/dist/generated/instructions/index.js +24 -0
  171. package/dist/generated/instructions/openPosition.d.ts +88 -0
  172. package/dist/generated/instructions/openPosition.d.ts.map +1 -0
  173. package/dist/generated/instructions/openPosition.js +200 -0
  174. package/dist/generated/instructions/setMetadataUpdateAuthority.d.ts +52 -0
  175. package/dist/generated/instructions/setMetadataUpdateAuthority.d.ts.map +1 -0
  176. package/dist/generated/instructions/setMetadataUpdateAuthority.js +98 -0
  177. package/dist/generated/instructions/setPoolDynamicFeeConfig.d.ts +57 -0
  178. package/dist/generated/instructions/setPoolDynamicFeeConfig.d.ts.map +1 -0
  179. package/dist/generated/instructions/setPoolDynamicFeeConfig.js +107 -0
  180. package/dist/generated/instructions/setPoolProtocolShare.d.ts +56 -0
  181. package/dist/generated/instructions/setPoolProtocolShare.d.ts.map +1 -0
  182. package/dist/generated/instructions/setPoolProtocolShare.js +106 -0
  183. package/dist/generated/instructions/swap.d.ts +74 -0
  184. package/dist/generated/instructions/swap.d.ts.map +1 -0
  185. package/dist/generated/instructions/swap.js +108 -0
  186. package/dist/generated/instructions/syncPool.d.ts +44 -0
  187. package/dist/generated/instructions/syncPool.d.ts.map +1 -0
  188. package/dist/generated/instructions/syncPool.js +71 -0
  189. package/dist/generated/instructions/transferAdminAuthority.d.ts +52 -0
  190. package/dist/generated/instructions/transferAdminAuthority.d.ts.map +1 -0
  191. package/dist/generated/instructions/transferAdminAuthority.js +98 -0
  192. package/dist/generated/instructions/withdraw.d.ts +86 -0
  193. package/dist/generated/instructions/withdraw.d.ts.map +1 -0
  194. package/dist/generated/instructions/withdraw.js +129 -0
  195. package/dist/generated/pdas/adminConfig.d.ts +12 -0
  196. package/dist/generated/pdas/adminConfig.d.ts.map +1 -0
  197. package/dist/generated/pdas/adminConfig.js +19 -0
  198. package/dist/generated/pdas/binArray.d.ts +16 -0
  199. package/dist/generated/pdas/binArray.d.ts.map +1 -0
  200. package/dist/generated/pdas/binArray.js +19 -0
  201. package/dist/generated/pdas/index.d.ts +12 -0
  202. package/dist/generated/pdas/index.d.ts.map +1 -0
  203. package/dist/generated/pdas/index.js +11 -0
  204. package/dist/generated/pdas/pool.d.ts +18 -0
  205. package/dist/generated/pdas/pool.d.ts.map +1 -0
  206. package/dist/generated/pdas/pool.js +21 -0
  207. package/dist/generated/pdas/position.d.ts +15 -0
  208. package/dist/generated/pdas/position.d.ts.map +1 -0
  209. package/dist/generated/pdas/position.js +18 -0
  210. package/dist/generated/programs/index.d.ts +9 -0
  211. package/dist/generated/programs/index.d.ts.map +1 -0
  212. package/dist/generated/programs/index.js +8 -0
  213. package/dist/generated/programs/piconDlmm.d.ts +126 -0
  214. package/dist/generated/programs/piconDlmm.d.ts.map +1 -0
  215. package/dist/generated/programs/piconDlmm.js +285 -0
  216. package/dist/generated/types/bin.d.ts +28 -0
  217. package/dist/generated/types/bin.d.ts.map +1 -0
  218. package/dist/generated/types/bin.js +31 -0
  219. package/dist/generated/types/distributionMode.d.ts +19 -0
  220. package/dist/generated/types/distributionMode.d.ts.map +1 -0
  221. package/dist/generated/types/distributionMode.js +24 -0
  222. package/dist/generated/types/dynamicFeeConfig.d.ts +29 -0
  223. package/dist/generated/types/dynamicFeeConfig.d.ts.map +1 -0
  224. package/dist/generated/types/dynamicFeeConfig.js +29 -0
  225. package/dist/generated/types/dynamicFeeState.d.ts +27 -0
  226. package/dist/generated/types/dynamicFeeState.d.ts.map +1 -0
  227. package/dist/generated/types/dynamicFeeState.js +30 -0
  228. package/dist/generated/types/feeState.d.ts +26 -0
  229. package/dist/generated/types/feeState.d.ts.map +1 -0
  230. package/dist/generated/types/feeState.js +29 -0
  231. package/dist/generated/types/index.d.ts +13 -0
  232. package/dist/generated/types/index.d.ts.map +1 -0
  233. package/dist/generated/types/index.js +12 -0
  234. package/dist/index.d.ts +5 -0
  235. package/dist/index.d.ts.map +1 -0
  236. package/dist/index.js +4 -0
  237. package/dist/picon_dlmm.json +2378 -0
  238. package/dist/program_addresses.d.ts +4 -0
  239. package/dist/program_addresses.d.ts.map +1 -0
  240. package/dist/program_addresses.js +8 -0
  241. package/dist/quote/index.d.ts +4 -0
  242. package/dist/quote/index.d.ts.map +1 -0
  243. package/dist/quote/index.js +5 -0
  244. package/dist/quote/wasm-node/picon_dlmm_quote.d.ts +6 -0
  245. package/dist/quote/wasm-node/picon_dlmm_quote.d.ts.map +1 -0
  246. package/dist/quote/wasm-node/picon_dlmm_quote.js +398 -0
  247. package/dist/quote/wasm-node/picon_dlmm_quote_bg.wasm +0 -0
  248. package/dist/quote/wasm-node-loader.d.ts +4 -0
  249. package/dist/quote/wasm-node-loader.d.ts.map +1 -0
  250. package/dist/quote/wasm-node-loader.js +7 -0
  251. package/dist/quote/wasm-web/picon_dlmm_quote.d.ts +9 -0
  252. package/dist/quote/wasm-web/picon_dlmm_quote.d.ts.map +1 -0
  253. package/dist/quote/wasm-web/picon_dlmm_quote.js +486 -0
  254. package/dist/quote/wasm-web/picon_dlmm_quote_bg.wasm +0 -0
  255. package/dist/quote/wasm-web-loader.d.ts +4 -0
  256. package/dist/quote/wasm-web-loader.d.ts.map +1 -0
  257. package/dist/quote/wasm-web-loader.js +12 -0
  258. package/dist/utils/admin_config.d.ts +3 -0
  259. package/dist/utils/admin_config.d.ts.map +1 -0
  260. package/dist/utils/admin_config.js +4 -0
  261. package/dist/utils/ata.d.ts +49 -0
  262. package/dist/utils/ata.d.ts.map +1 -0
  263. package/dist/utils/ata.js +113 -0
  264. package/dist/utils/bin_array.d.ts +8 -0
  265. package/dist/utils/bin_array.d.ts.map +1 -0
  266. package/dist/utils/bin_array.js +29 -0
  267. package/dist/utils/bin_location.d.ts +11 -0
  268. package/dist/utils/bin_location.d.ts.map +1 -0
  269. package/dist/utils/bin_location.js +55 -0
  270. package/dist/utils/chunk.d.ts +2 -0
  271. package/dist/utils/chunk.d.ts.map +1 -0
  272. package/dist/utils/chunk.js +7 -0
  273. package/dist/utils/compute_budget.d.ts +11 -0
  274. package/dist/utils/compute_budget.d.ts.map +1 -0
  275. package/dist/utils/compute_budget.js +22 -0
  276. package/dist/utils/constants.d.ts +12 -0
  277. package/dist/utils/constants.d.ts.map +1 -0
  278. package/dist/utils/constants.js +20 -0
  279. package/dist/utils/transfer_fee.d.ts +4 -0
  280. package/dist/utils/transfer_fee.d.ts.map +1 -0
  281. package/dist/utils/transfer_fee.js +21 -0
  282. package/dist/utils/type_guards.d.ts +2 -0
  283. package/dist/utils/type_guards.d.ts.map +1 -0
  284. package/dist/utils/type_guards.js +3 -0
  285. package/package.json +59 -0
  286. package/src/actions/accept_admin_authority.ts +17 -0
  287. package/src/actions/claim_fee.ts +84 -0
  288. package/src/actions/claim_multiple_fees.ts +123 -0
  289. package/src/actions/claim_protocol_fee.ts +68 -0
  290. package/src/actions/close_position.ts +21 -0
  291. package/src/actions/create_admin_config.ts +50 -0
  292. package/src/actions/create_bin_array.ts +30 -0
  293. package/src/actions/create_pool.ts +49 -0
  294. package/src/actions/delete_bin_array.ts +33 -0
  295. package/src/actions/deposit_by_weight.ts +107 -0
  296. package/src/actions/get_admin_config.ts +13 -0
  297. package/src/actions/get_bin_arrays_by_indices.ts +15 -0
  298. package/src/actions/get_pool.ts +8 -0
  299. package/src/actions/get_position.ts +8 -0
  300. package/src/actions/get_position_by_position_mint.ts +14 -0
  301. package/src/actions/get_positions_by_owner.ts +48 -0
  302. package/src/actions/get_positions_by_position_mints.ts +21 -0
  303. package/src/actions/helpers/build_swap_transaction_message.ts +86 -0
  304. package/src/actions/helpers/build_transaction_message.ts +45 -0
  305. package/src/actions/helpers/index.ts +7 -0
  306. package/src/actions/helpers/resolve_active_bin_and_mints.ts +21 -0
  307. package/src/actions/helpers/resolve_admin_config_address.ts +11 -0
  308. package/src/actions/helpers/resolve_mint_info.ts +36 -0
  309. package/src/actions/helpers/resolve_position_range.ts +21 -0
  310. package/src/actions/helpers/resolve_token_mints_and_programs.ts +56 -0
  311. package/src/actions/index.ts +34 -0
  312. package/src/actions/is_admin_config_active.ts +14 -0
  313. package/src/actions/on_event.ts +78 -0
  314. package/src/actions/open_position.ts +66 -0
  315. package/src/actions/quote.ts +70 -0
  316. package/src/actions/set_metadata_update_authority.ts +17 -0
  317. package/src/actions/set_pool_dynamic_fee_config.ts +17 -0
  318. package/src/actions/set_pool_protocol_share.ts +17 -0
  319. package/src/actions/swap.ts +56 -0
  320. package/src/actions/sync_pool.ts +35 -0
  321. package/src/actions/transfer_admin_authority.ts +17 -0
  322. package/src/actions/withdraw.ts +87 -0
  323. package/src/events.ts +279 -0
  324. package/src/generated/accounts/adminConfig.ts +147 -0
  325. package/src/generated/accounts/binArray.ts +155 -0
  326. package/src/generated/accounts/index.ts +12 -0
  327. package/src/generated/accounts/pool.ts +192 -0
  328. package/src/generated/accounts/position.ts +164 -0
  329. package/src/generated/errors/index.ts +9 -0
  330. package/src/generated/errors/piconDlmm.ts +124 -0
  331. package/src/generated/index.ts +14 -0
  332. package/src/generated/instructions/acceptAdminAuthority.ts +262 -0
  333. package/src/generated/instructions/claimFee.ts +395 -0
  334. package/src/generated/instructions/claimProtocolFee.ts +462 -0
  335. package/src/generated/instructions/closePosition.ts +342 -0
  336. package/src/generated/instructions/createAdminConfig.ts +369 -0
  337. package/src/generated/instructions/createBinArray.ts +344 -0
  338. package/src/generated/instructions/createPool.ts +582 -0
  339. package/src/generated/instructions/deleteBinArray.ts +365 -0
  340. package/src/generated/instructions/depositByWeight.ts +435 -0
  341. package/src/generated/instructions/index.ts +25 -0
  342. package/src/generated/instructions/openPosition.ts +547 -0
  343. package/src/generated/instructions/setMetadataUpdateAuthority.ts +274 -0
  344. package/src/generated/instructions/setPoolDynamicFeeConfig.ts +304 -0
  345. package/src/generated/instructions/setPoolProtocolShare.ts +298 -0
  346. package/src/generated/instructions/swap.ts +336 -0
  347. package/src/generated/instructions/syncPool.ts +189 -0
  348. package/src/generated/instructions/transferAdminAuthority.ts +271 -0
  349. package/src/generated/instructions/withdraw.ts +402 -0
  350. package/src/generated/pdas/adminConfig.ts +32 -0
  351. package/src/generated/pdas/binArray.ts +40 -0
  352. package/src/generated/pdas/index.ts +12 -0
  353. package/src/generated/pdas/pool.ts +43 -0
  354. package/src/generated/pdas/position.ts +37 -0
  355. package/src/generated/programs/index.ts +9 -0
  356. package/src/generated/programs/piconDlmm.ts +803 -0
  357. package/src/generated/types/bin.ts +64 -0
  358. package/src/generated/types/distributionMode.ts +43 -0
  359. package/src/generated/types/dynamicFeeConfig.ts +69 -0
  360. package/src/generated/types/dynamicFeeState.ts +71 -0
  361. package/src/generated/types/feeState.ts +60 -0
  362. package/src/generated/types/index.ts +13 -0
  363. package/src/index.ts +4 -0
  364. package/src/picon_dlmm.json +2378 -0
  365. package/src/program_addresses.ts +10 -0
  366. package/src/quote/index.ts +14 -0
  367. package/src/quote/wasm-node/package.json +4 -0
  368. package/src/quote/wasm-node/picon_dlmm_quote.d.ts +64 -0
  369. package/src/quote/wasm-node/picon_dlmm_quote.js +407 -0
  370. package/src/quote/wasm-node/picon_dlmm_quote_bg.wasm +0 -0
  371. package/src/quote/wasm-node/picon_dlmm_quote_bg.wasm.d.ts +11 -0
  372. package/src/quote/wasm-node-loader.ts +11 -0
  373. package/src/quote/wasm-web/picon_dlmm_quote.d.ts +100 -0
  374. package/src/quote/wasm-web/picon_dlmm_quote.js +500 -0
  375. package/src/quote/wasm-web/picon_dlmm_quote_bg.wasm +0 -0
  376. package/src/quote/wasm-web/picon_dlmm_quote_bg.wasm.d.ts +11 -0
  377. package/src/quote/wasm-web-loader.ts +17 -0
  378. package/src/utils/admin_config.ts +6 -0
  379. package/src/utils/ata.ts +213 -0
  380. package/src/utils/bin_array.ts +45 -0
  381. package/src/utils/bin_location.ts +79 -0
  382. package/src/utils/chunk.ts +7 -0
  383. package/src/utils/compute_budget.ts +58 -0
  384. package/src/utils/constants.ts +24 -0
  385. package/src/utils/transfer_fee.ts +29 -0
  386. package/src/utils/type_guards.ts +3 -0
@@ -0,0 +1,486 @@
1
+ /* @ts-self-types="./picon_dlmm_quote.d.ts" */
2
+ /**
3
+ * @param {QuoteInput} input
4
+ * @returns {QuoteOutput}
5
+ */
6
+ export function quote(input) {
7
+ const ret = wasm.quote(input);
8
+ if (ret[2]) {
9
+ throw takeFromExternrefTable0(ret[1]);
10
+ }
11
+ return takeFromExternrefTable0(ret[0]);
12
+ }
13
+ function __wbg_get_imports() {
14
+ const import0 = {
15
+ __proto__: null,
16
+ __wbg_Error_92b29b0548f8b746: function (arg0, arg1) {
17
+ const ret = Error(getStringFromWasm0(arg0, arg1));
18
+ return ret;
19
+ },
20
+ __wbg_Number_9a4e0ecb0fa16705: function (arg0) {
21
+ const ret = Number(arg0);
22
+ return ret;
23
+ },
24
+ __wbg_String_8564e559799eccda: function (arg0, arg1) {
25
+ const ret = String(arg1);
26
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
27
+ const len1 = WASM_VECTOR_LEN;
28
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
29
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
30
+ },
31
+ __wbg___wbindgen_bigint_get_as_i64_d968e41184ae354f: function (arg0, arg1) {
32
+ const v = arg1;
33
+ const ret = typeof (v) === 'bigint' ? v : undefined;
34
+ getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
35
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
36
+ },
37
+ __wbg___wbindgen_boolean_get_fa956cfa2d1bd751: function (arg0) {
38
+ const v = arg0;
39
+ const ret = typeof (v) === 'boolean' ? v : undefined;
40
+ return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
41
+ },
42
+ __wbg___wbindgen_debug_string_c25d447a39f5578f: function (arg0, arg1) {
43
+ const ret = debugString(arg1);
44
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
45
+ const len1 = WASM_VECTOR_LEN;
46
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
47
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
48
+ },
49
+ __wbg___wbindgen_in_aca499c5de7ff5e5: function (arg0, arg1) {
50
+ const ret = arg0 in arg1;
51
+ return ret;
52
+ },
53
+ __wbg___wbindgen_is_bigint_2f76dc55065b4273: function (arg0) {
54
+ const ret = typeof (arg0) === 'bigint';
55
+ return ret;
56
+ },
57
+ __wbg___wbindgen_is_function_1ff95bcc5517c252: function (arg0) {
58
+ const ret = typeof (arg0) === 'function';
59
+ return ret;
60
+ },
61
+ __wbg___wbindgen_is_object_a27215656b807791: function (arg0) {
62
+ const val = arg0;
63
+ const ret = typeof (val) === 'object' && val !== null;
64
+ return ret;
65
+ },
66
+ __wbg___wbindgen_is_undefined_c05833b95a3cf397: function (arg0) {
67
+ const ret = arg0 === undefined;
68
+ return ret;
69
+ },
70
+ __wbg___wbindgen_jsval_eq_e659fcf7b0e32763: function (arg0, arg1) {
71
+ const ret = arg0 === arg1;
72
+ return ret;
73
+ },
74
+ __wbg___wbindgen_jsval_loose_eq_db4c3b15f63fc170: function (arg0, arg1) {
75
+ const ret = arg0 == arg1;
76
+ return ret;
77
+ },
78
+ __wbg___wbindgen_number_get_394265ed1e1b84ee: function (arg0, arg1) {
79
+ const obj = arg1;
80
+ const ret = typeof (obj) === 'number' ? obj : undefined;
81
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
82
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
83
+ },
84
+ __wbg___wbindgen_shr_ad10001a7b001d7f: function (arg0, arg1) {
85
+ const ret = arg0 >> arg1;
86
+ return ret;
87
+ },
88
+ __wbg___wbindgen_string_get_b0ca35b86a603356: function (arg0, arg1) {
89
+ const obj = arg1;
90
+ const ret = typeof (obj) === 'string' ? obj : undefined;
91
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
92
+ var len1 = WASM_VECTOR_LEN;
93
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
94
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
95
+ },
96
+ __wbg___wbindgen_throw_344f42d3211c4765: function (arg0, arg1) {
97
+ throw new Error(getStringFromWasm0(arg0, arg1));
98
+ },
99
+ __wbg_call_8a2dd23819f8a60a: function () {
100
+ return handleError(function (arg0, arg1) {
101
+ const ret = arg0.call(arg1);
102
+ return ret;
103
+ }, arguments);
104
+ },
105
+ __wbg_done_89b2b13e91a60321: function (arg0) {
106
+ const ret = arg0.done;
107
+ return ret;
108
+ },
109
+ __wbg_get_c7eb1f358a7654df: function () {
110
+ return handleError(function (arg0, arg1) {
111
+ const ret = Reflect.get(arg0, arg1);
112
+ return ret;
113
+ }, arguments);
114
+ },
115
+ __wbg_get_unchecked_6e0ad6d2a41b06f6: function (arg0, arg1) {
116
+ const ret = arg0[arg1 >>> 0];
117
+ return ret;
118
+ },
119
+ __wbg_get_with_ref_key_6412cf3094599694: function (arg0, arg1) {
120
+ const ret = arg0[arg1];
121
+ return ret;
122
+ },
123
+ __wbg_instanceof_ArrayBuffer_4480b9e0068a8adb: function (arg0) {
124
+ let result;
125
+ try {
126
+ result = arg0 instanceof ArrayBuffer;
127
+ }
128
+ catch (_) {
129
+ result = false;
130
+ }
131
+ const ret = result;
132
+ return ret;
133
+ },
134
+ __wbg_instanceof_Uint8Array_309b927aaf7a3fc7: function (arg0) {
135
+ let result;
136
+ try {
137
+ result = arg0 instanceof Uint8Array;
138
+ }
139
+ catch (_) {
140
+ result = false;
141
+ }
142
+ const ret = result;
143
+ return ret;
144
+ },
145
+ __wbg_isArray_0677c962b281d01a: function (arg0) {
146
+ const ret = Array.isArray(arg0);
147
+ return ret;
148
+ },
149
+ __wbg_isSafeInteger_04f36e4056f1b851: function (arg0) {
150
+ const ret = Number.isSafeInteger(arg0);
151
+ return ret;
152
+ },
153
+ __wbg_iterator_6f722e4a93058b71: function () {
154
+ const ret = Symbol.iterator;
155
+ return ret;
156
+ },
157
+ __wbg_length_1f0964f4a5e2c6d8: function (arg0) {
158
+ const ret = arg0.length;
159
+ return ret;
160
+ },
161
+ __wbg_length_370319915dc99107: function (arg0) {
162
+ const ret = arg0.length;
163
+ return ret;
164
+ },
165
+ __wbg_new_cd45aabdf6073e84: function (arg0) {
166
+ const ret = new Uint8Array(arg0);
167
+ return ret;
168
+ },
169
+ __wbg_new_da52cf8fe3429cb2: function () {
170
+ const ret = new Object();
171
+ return ret;
172
+ },
173
+ __wbg_next_6dbf2c0ac8cde20f: function (arg0) {
174
+ const ret = arg0.next;
175
+ return ret;
176
+ },
177
+ __wbg_next_71f2aa1cb3d1e37e: function () {
178
+ return handleError(function (arg0) {
179
+ const ret = arg0.next();
180
+ return ret;
181
+ }, arguments);
182
+ },
183
+ __wbg_prototypesetcall_4770620bbe4688a0: function (arg0, arg1, arg2) {
184
+ Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
185
+ },
186
+ __wbg_set_6be42768c690e380: function (arg0, arg1, arg2) {
187
+ arg0[arg1] = arg2;
188
+ },
189
+ __wbg_value_a5d5488a9589444a: function (arg0) {
190
+ const ret = arg0.value;
191
+ return ret;
192
+ },
193
+ __wbindgen_cast_0000000000000001: function (arg0) {
194
+ // Cast intrinsic for `F64 -> Externref`.
195
+ const ret = arg0;
196
+ return ret;
197
+ },
198
+ __wbindgen_cast_0000000000000002: function (arg0) {
199
+ // Cast intrinsic for `I64 -> Externref`.
200
+ const ret = arg0;
201
+ return ret;
202
+ },
203
+ __wbindgen_cast_0000000000000003: function (arg0, arg1) {
204
+ // Cast intrinsic for `Ref(String) -> Externref`.
205
+ const ret = getStringFromWasm0(arg0, arg1);
206
+ return ret;
207
+ },
208
+ __wbindgen_cast_0000000000000004: function (arg0, arg1) {
209
+ // Cast intrinsic for `U128 -> Externref`.
210
+ const ret = (BigInt.asUintN(64, arg0) | (BigInt.asUintN(64, arg1) << BigInt(64)));
211
+ return ret;
212
+ },
213
+ __wbindgen_cast_0000000000000005: function (arg0) {
214
+ // Cast intrinsic for `U64 -> Externref`.
215
+ const ret = BigInt.asUintN(64, arg0);
216
+ return ret;
217
+ },
218
+ __wbindgen_init_externref_table: function () {
219
+ const table = wasm.__wbindgen_externrefs;
220
+ const offset = table.grow(4);
221
+ table.set(0, undefined);
222
+ table.set(offset + 0, undefined);
223
+ table.set(offset + 1, null);
224
+ table.set(offset + 2, true);
225
+ table.set(offset + 3, false);
226
+ },
227
+ };
228
+ return {
229
+ __proto__: null,
230
+ "./picon_dlmm_quote_bg.js": import0,
231
+ };
232
+ }
233
+ function addToExternrefTable0(obj) {
234
+ const idx = wasm.__externref_table_alloc();
235
+ wasm.__wbindgen_externrefs.set(idx, obj);
236
+ return idx;
237
+ }
238
+ function debugString(val) {
239
+ // primitive types
240
+ const type = typeof val;
241
+ if (type == 'number' || type == 'boolean' || val == null) {
242
+ return `${val}`;
243
+ }
244
+ if (type == 'string') {
245
+ return `"${val}"`;
246
+ }
247
+ if (type == 'symbol') {
248
+ const description = val.description;
249
+ if (description == null) {
250
+ return 'Symbol';
251
+ }
252
+ else {
253
+ return `Symbol(${description})`;
254
+ }
255
+ }
256
+ if (type == 'function') {
257
+ const name = val.name;
258
+ if (typeof name == 'string' && name.length > 0) {
259
+ return `Function(${name})`;
260
+ }
261
+ else {
262
+ return 'Function';
263
+ }
264
+ }
265
+ // objects
266
+ if (Array.isArray(val)) {
267
+ const length = val.length;
268
+ let debug = '[';
269
+ if (length > 0) {
270
+ debug += debugString(val[0]);
271
+ }
272
+ for (let i = 1; i < length; i++) {
273
+ debug += ', ' + debugString(val[i]);
274
+ }
275
+ debug += ']';
276
+ return debug;
277
+ }
278
+ // Test for built-in
279
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
280
+ let className;
281
+ if (builtInMatches && builtInMatches.length > 1) {
282
+ className = builtInMatches[1];
283
+ }
284
+ else {
285
+ // Failed to match the standard '[object ClassName]'
286
+ return toString.call(val);
287
+ }
288
+ if (className == 'Object') {
289
+ // we're a user defined class or Object
290
+ // JSON.stringify avoids problems with cycles, and is generally much
291
+ // easier than looping through ownProperties of `val`.
292
+ try {
293
+ return 'Object(' + JSON.stringify(val) + ')';
294
+ }
295
+ catch (_) {
296
+ return 'Object';
297
+ }
298
+ }
299
+ // errors
300
+ if (val instanceof Error) {
301
+ return `${val.name}: ${val.message}\n${val.stack}`;
302
+ }
303
+ // TODO we could test for more things here, like `Set`s and `Map`s.
304
+ return className;
305
+ }
306
+ function getArrayU8FromWasm0(ptr, len) {
307
+ ptr = ptr >>> 0;
308
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
309
+ }
310
+ let cachedDataViewMemory0 = null;
311
+ function getDataViewMemory0() {
312
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
313
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
314
+ }
315
+ return cachedDataViewMemory0;
316
+ }
317
+ function getStringFromWasm0(ptr, len) {
318
+ return decodeText(ptr >>> 0, len);
319
+ }
320
+ let cachedUint8ArrayMemory0 = null;
321
+ function getUint8ArrayMemory0() {
322
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
323
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
324
+ }
325
+ return cachedUint8ArrayMemory0;
326
+ }
327
+ function handleError(f, args) {
328
+ try {
329
+ return f.apply(this, args);
330
+ }
331
+ catch (e) {
332
+ const idx = addToExternrefTable0(e);
333
+ wasm.__wbindgen_exn_store(idx);
334
+ }
335
+ }
336
+ function isLikeNone(x) {
337
+ return x === undefined || x === null;
338
+ }
339
+ function passStringToWasm0(arg, malloc, realloc) {
340
+ if (realloc === undefined) {
341
+ const buf = cachedTextEncoder.encode(arg);
342
+ const ptr = malloc(buf.length, 1) >>> 0;
343
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
344
+ WASM_VECTOR_LEN = buf.length;
345
+ return ptr;
346
+ }
347
+ let len = arg.length;
348
+ let ptr = malloc(len, 1) >>> 0;
349
+ const mem = getUint8ArrayMemory0();
350
+ let offset = 0;
351
+ for (; offset < len; offset++) {
352
+ const code = arg.charCodeAt(offset);
353
+ if (code > 0x7F)
354
+ break;
355
+ mem[ptr + offset] = code;
356
+ }
357
+ if (offset !== len) {
358
+ if (offset !== 0) {
359
+ arg = arg.slice(offset);
360
+ }
361
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
362
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
363
+ const ret = cachedTextEncoder.encodeInto(arg, view);
364
+ offset += ret.written;
365
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
366
+ }
367
+ WASM_VECTOR_LEN = offset;
368
+ return ptr;
369
+ }
370
+ function takeFromExternrefTable0(idx) {
371
+ const value = wasm.__wbindgen_externrefs.get(idx);
372
+ wasm.__externref_table_dealloc(idx);
373
+ return value;
374
+ }
375
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
376
+ cachedTextDecoder.decode();
377
+ const MAX_SAFARI_DECODE_BYTES = 2146435072;
378
+ let numBytesDecoded = 0;
379
+ function decodeText(ptr, len) {
380
+ numBytesDecoded += len;
381
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
382
+ cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
383
+ cachedTextDecoder.decode();
384
+ numBytesDecoded = len;
385
+ }
386
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
387
+ }
388
+ const cachedTextEncoder = new TextEncoder();
389
+ if (!('encodeInto' in cachedTextEncoder)) {
390
+ cachedTextEncoder.encodeInto = function (arg, view) {
391
+ const buf = cachedTextEncoder.encode(arg);
392
+ view.set(buf);
393
+ return {
394
+ read: arg.length,
395
+ written: buf.length
396
+ };
397
+ };
398
+ }
399
+ let WASM_VECTOR_LEN = 0;
400
+ let wasmModule, wasmInstance, wasm;
401
+ function __wbg_finalize_init(instance, module) {
402
+ wasmInstance = instance;
403
+ wasm = instance.exports;
404
+ wasmModule = module;
405
+ cachedDataViewMemory0 = null;
406
+ cachedUint8ArrayMemory0 = null;
407
+ wasm.__wbindgen_start();
408
+ return wasm;
409
+ }
410
+ async function __wbg_load(module, imports) {
411
+ if (typeof Response === 'function' && module instanceof Response) {
412
+ if (typeof WebAssembly.instantiateStreaming === 'function') {
413
+ try {
414
+ return await WebAssembly.instantiateStreaming(module, imports);
415
+ }
416
+ catch (e) {
417
+ const validResponse = module.ok && expectedResponseType(module.type);
418
+ if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
419
+ console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
420
+ }
421
+ else {
422
+ throw e;
423
+ }
424
+ }
425
+ }
426
+ const bytes = await module.arrayBuffer();
427
+ return await WebAssembly.instantiate(bytes, imports);
428
+ }
429
+ else {
430
+ const instance = await WebAssembly.instantiate(module, imports);
431
+ if (instance instanceof WebAssembly.Instance) {
432
+ return { instance, module };
433
+ }
434
+ else {
435
+ return instance;
436
+ }
437
+ }
438
+ function expectedResponseType(type) {
439
+ switch (type) {
440
+ case 'basic':
441
+ case 'cors':
442
+ case 'default': return true;
443
+ }
444
+ return false;
445
+ }
446
+ }
447
+ function initSync(module) {
448
+ if (wasm !== undefined)
449
+ return wasm;
450
+ if (module !== undefined) {
451
+ if (Object.getPrototypeOf(module) === Object.prototype) {
452
+ ({ module } = module);
453
+ }
454
+ else {
455
+ console.warn('using deprecated parameters for `initSync()`; pass a single object instead');
456
+ }
457
+ }
458
+ const imports = __wbg_get_imports();
459
+ if (!(module instanceof WebAssembly.Module)) {
460
+ module = new WebAssembly.Module(module);
461
+ }
462
+ const instance = new WebAssembly.Instance(module, imports);
463
+ return __wbg_finalize_init(instance, module);
464
+ }
465
+ async function __wbg_init(module_or_path) {
466
+ if (wasm !== undefined)
467
+ return wasm;
468
+ if (module_or_path !== undefined) {
469
+ if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
470
+ ({ module_or_path } = module_or_path);
471
+ }
472
+ else {
473
+ console.warn('using deprecated parameters for the initialization function; pass a single object instead');
474
+ }
475
+ }
476
+ if (module_or_path === undefined) {
477
+ module_or_path = new URL('picon_dlmm_quote_bg.wasm', import.meta.url);
478
+ }
479
+ const imports = __wbg_get_imports();
480
+ if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
481
+ module_or_path = fetch(module_or_path);
482
+ }
483
+ const { instance, module } = await __wbg_load(await module_or_path, imports);
484
+ return __wbg_finalize_init(instance, module);
485
+ }
486
+ export { initSync, __wbg_init as default };
@@ -0,0 +1,4 @@
1
+ export type * from "./wasm-web/picon_dlmm_quote.js";
2
+ export type ResolvedWasm = typeof import("./wasm-web/picon_dlmm_quote.js");
3
+ export declare function loadWasm(): Promise<ResolvedWasm>;
4
+ //# sourceMappingURL=wasm-web-loader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wasm-web-loader.d.ts","sourceRoot":"","sources":["../../src/quote/wasm-web-loader.ts"],"names":[],"mappings":"AAAA,mBAAmB,gCAAgC,CAAC;AACpD,MAAM,MAAM,YAAY,GAAG,cAAc,gCAAgC,CAAC,CAAC;AAM3E,wBAAsB,QAAQ,IAAI,OAAO,CAAC,YAAY,CAAC,CAGtD"}
@@ -0,0 +1,12 @@
1
+ let wasmPromise;
2
+ // The `web`-target build needs an explicit async init (fetch + instantiate); both the import
3
+ // and the init stay deferred until first call, not tied to when this loader gets imported.
4
+ export async function loadWasm() {
5
+ wasmPromise ??= importAndInit();
6
+ return await wasmPromise;
7
+ }
8
+ async function importAndInit() {
9
+ const wasm = await import("./wasm-web/picon_dlmm_quote.js");
10
+ await wasm.default();
11
+ return wasm;
12
+ }
@@ -0,0 +1,3 @@
1
+ import { type AdminConfig } from "../generated";
2
+ export declare function isAdminConfigActive(adminConfig: AdminConfig): boolean;
3
+ //# sourceMappingURL=admin_config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"admin_config.d.ts","sourceRoot":"","sources":["../../src/utils/admin_config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAErE"}
@@ -0,0 +1,4 @@
1
+ import { SYSTEM_PROGRAM_ADDRESS } from "@solana-program/system";
2
+ export function isAdminConfigActive(adminConfig) {
3
+ return adminConfig.authority !== SYSTEM_PROGRAM_ADDRESS;
4
+ }
@@ -0,0 +1,49 @@
1
+ import { type Address, type Instruction, type TransactionSigner } from "@solana/kit";
2
+ export declare const NATIVE_MINT_ADDRESS: Address<"So11111111111111111111111111111111111111112">;
3
+ export declare function findAssociatedTokenPdaByTokenProgram(params: {
4
+ owner: Address;
5
+ mint: Address;
6
+ tokenProgram: Address;
7
+ }): Promise<Address<string>>;
8
+ export declare function findPositionTokenAccount({ owner, positionMint, }: {
9
+ owner: Address;
10
+ positionMint: Address;
11
+ }): Promise<Address>;
12
+ export declare function findPoolTokenVaults({ pool, tokenMintX, tokenMintY, tokenProgramX, tokenProgramY, }: {
13
+ pool: Address;
14
+ tokenMintX: Address;
15
+ tokenMintY: Address;
16
+ tokenProgramX: Address;
17
+ tokenProgramY: Address;
18
+ }): Promise<{
19
+ tokenVaultX: Address;
20
+ tokenVaultY: Address;
21
+ }>;
22
+ interface ProcessAssociatedTokenAccountParams {
23
+ owner: TransactionSigner;
24
+ mint: Address;
25
+ amount?: bigint;
26
+ tokenProgram: Address;
27
+ }
28
+ interface ProcessAssociatedTokenAccountResult {
29
+ ata: Address;
30
+ preInstructions: Instruction[];
31
+ postInstructions: Instruction[];
32
+ }
33
+ export declare function processAssociatedTokenAccount(params: ProcessAssociatedTokenAccountParams): Promise<ProcessAssociatedTokenAccountResult>;
34
+ export declare function processAssociatedTokenAccountPair({ owner, tokenMintX, tokenMintY, tokenProgramX, tokenProgramY, amountX, amountY, }: {
35
+ owner: TransactionSigner;
36
+ tokenMintX: Address;
37
+ tokenMintY: Address;
38
+ tokenProgramX: Address;
39
+ tokenProgramY: Address;
40
+ amountX?: bigint;
41
+ amountY?: bigint;
42
+ }): Promise<{
43
+ ataX: Address;
44
+ ataY: Address;
45
+ preInstructions: Instruction[];
46
+ postInstructions: Instruction[];
47
+ }>;
48
+ export {};
49
+ //# sourceMappingURL=ata.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ata.d.ts","sourceRoot":"","sources":["../../src/utils/ata.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,OAAO,EACZ,KAAK,WAAW,EAChB,KAAK,iBAAiB,EACvB,MAAM,aAAa,CAAC;AAerB,eAAO,MAAM,mBAAmB,wDAAyD,CAAC;AAE1F,wBAAsB,oCAAoC,CAAC,MAAM,EAAE;IACjE,KAAK,EAAE,OAAO,CAAC;IACf,IAAI,EAAE,OAAO,CAAC;IACd,YAAY,EAAE,OAAO,CAAC;CACvB,4BAIA;AAID,wBAAgB,wBAAwB,CAAC,EACvC,KAAK,EACL,YAAY,GACb,EAAE;IACD,KAAK,EAAE,OAAO,CAAC;IACf,YAAY,EAAE,OAAO,CAAC;CACvB,GAAG,OAAO,CAAC,OAAO,CAAC,CAEnB;AAID,wBAAsB,mBAAmB,CAAC,EACxC,IAAI,EACJ,UAAU,EACV,UAAU,EACV,aAAa,EACb,aAAa,GACd,EAAE;IACD,IAAI,EAAE,OAAO,CAAC;IACd,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;IACpB,aAAa,EAAE,OAAO,CAAC;IACvB,aAAa,EAAE,OAAO,CAAC;CACxB,GAAG,OAAO,CAAC;IAAE,WAAW,EAAE,OAAO,CAAC;IAAC,WAAW,EAAE,OAAO,CAAA;CAAE,CAAC,CAM1D;AAED,UAAU,mCAAmC;IAC3C,KAAK,EAAE,iBAAiB,CAAC;IACzB,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,OAAO,CAAC;CACvB;AAED,UAAU,mCAAmC;IAC3C,GAAG,EAAE,OAAO,CAAC;IACb,eAAe,EAAE,WAAW,EAAE,CAAC;IAC/B,gBAAgB,EAAE,WAAW,EAAE,CAAC;CACjC;AAED,wBAAgB,6BAA6B,CAAC,MAAM,EAAE,mCAAmC,GAAG,OAAO,CAAC,mCAAmC,CAAC,CAMvI;AAKD,wBAAsB,iCAAiC,CAAC,EACtD,KAAK,EACL,UAAU,EACV,UAAU,EACV,aAAa,EACb,aAAa,EACb,OAAO,EACP,OAAO,GACR,EAAE;IACD,KAAK,EAAE,iBAAiB,CAAC;IACzB,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;IACpB,aAAa,EAAE,OAAO,CAAC;IACvB,aAAa,EAAE,OAAO,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,GAAG,OAAO,CAAC;IACV,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,EAAE,OAAO,CAAC;IACd,eAAe,EAAE,WAAW,EAAE,CAAC;IAC/B,gBAAgB,EAAE,WAAW,EAAE,CAAC;CACjC,CAAC,CAWD"}