@liquid-af/sdk 0.1.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 (225) hide show
  1. package/README.md +776 -0
  2. package/dist/accounts/index.d.ts +5 -0
  3. package/dist/accounts/index.d.ts.map +1 -0
  4. package/dist/accounts/index.js +5 -0
  5. package/dist/accounts/index.js.map +1 -0
  6. package/dist/accounts/liquid-fees.d.ts +63 -0
  7. package/dist/accounts/liquid-fees.d.ts.map +1 -0
  8. package/dist/accounts/liquid-fees.js +27 -0
  9. package/dist/accounts/liquid-fees.js.map +1 -0
  10. package/dist/accounts/liquid-state.d.ts +112 -0
  11. package/dist/accounts/liquid-state.d.ts.map +1 -0
  12. package/dist/accounts/liquid-state.js +92 -0
  13. package/dist/accounts/liquid-state.js.map +1 -0
  14. package/dist/accounts/liquid-swap.d.ts +97 -0
  15. package/dist/accounts/liquid-swap.d.ts.map +1 -0
  16. package/dist/accounts/liquid-swap.js +54 -0
  17. package/dist/accounts/liquid-swap.js.map +1 -0
  18. package/dist/accounts/liquid.d.ts +175 -0
  19. package/dist/accounts/liquid.d.ts.map +1 -0
  20. package/dist/accounts/liquid.js +66 -0
  21. package/dist/accounts/liquid.js.map +1 -0
  22. package/dist/client.d.ts +621 -0
  23. package/dist/client.d.ts.map +1 -0
  24. package/dist/client.js +511 -0
  25. package/dist/client.js.map +1 -0
  26. package/dist/config.d.ts +56 -0
  27. package/dist/config.d.ts.map +1 -0
  28. package/dist/config.js +44 -0
  29. package/dist/config.js.map +1 -0
  30. package/dist/errors.d.ts +39 -0
  31. package/dist/errors.d.ts.map +1 -0
  32. package/dist/errors.js +63 -0
  33. package/dist/errors.js.map +1 -0
  34. package/dist/events/index.d.ts +4 -0
  35. package/dist/events/index.d.ts.map +1 -0
  36. package/dist/events/index.js +2 -0
  37. package/dist/events/index.js.map +1 -0
  38. package/dist/events/parser.d.ts +40 -0
  39. package/dist/events/parser.d.ts.map +1 -0
  40. package/dist/events/parser.js +67 -0
  41. package/dist/events/parser.js.map +1 -0
  42. package/dist/events/types.d.ts +286 -0
  43. package/dist/events/types.d.ts.map +1 -0
  44. package/dist/events/types.js +2 -0
  45. package/dist/events/types.js.map +1 -0
  46. package/dist/helpers/index.d.ts +4 -0
  47. package/dist/helpers/index.d.ts.map +1 -0
  48. package/dist/helpers/index.js +3 -0
  49. package/dist/helpers/index.js.map +1 -0
  50. package/dist/helpers/preview.d.ts +259 -0
  51. package/dist/helpers/preview.d.ts.map +1 -0
  52. package/dist/helpers/preview.js +458 -0
  53. package/dist/helpers/preview.js.map +1 -0
  54. package/dist/helpers/user.d.ts +11 -0
  55. package/dist/helpers/user.d.ts.map +1 -0
  56. package/dist/helpers/user.js +20 -0
  57. package/dist/helpers/user.js.map +1 -0
  58. package/dist/idl/index.d.ts +53 -0
  59. package/dist/idl/index.d.ts.map +1 -0
  60. package/dist/idl/index.js +64 -0
  61. package/dist/idl/index.js.map +1 -0
  62. package/dist/idl/liquid.d.ts +10523 -0
  63. package/dist/idl/liquid.d.ts.map +1 -0
  64. package/dist/idl/liquid.js +2 -0
  65. package/dist/idl/liquid.js.map +1 -0
  66. package/dist/idl/liquid.json +10516 -0
  67. package/dist/idl/liquid_fees.d.ts +1520 -0
  68. package/dist/idl/liquid_fees.d.ts.map +1 -0
  69. package/dist/idl/liquid_fees.js +2 -0
  70. package/dist/idl/liquid_fees.js.map +1 -0
  71. package/dist/idl/liquid_fees.json +1513 -0
  72. package/dist/idl/liquid_state.d.ts +2936 -0
  73. package/dist/idl/liquid_state.d.ts.map +1 -0
  74. package/dist/idl/liquid_state.js +2 -0
  75. package/dist/idl/liquid_state.js.map +1 -0
  76. package/dist/idl/liquid_state.json +2929 -0
  77. package/dist/idl/liquid_swap.d.ts +5849 -0
  78. package/dist/idl/liquid_swap.d.ts.map +1 -0
  79. package/dist/idl/liquid_swap.js +2 -0
  80. package/dist/idl/liquid_swap.js.map +1 -0
  81. package/dist/idl/liquid_swap.json +5842 -0
  82. package/dist/index.d.ts +19 -0
  83. package/dist/index.d.ts.map +1 -0
  84. package/dist/index.js +15 -0
  85. package/dist/index.js.map +1 -0
  86. package/dist/instructions/index.d.ts +9 -0
  87. package/dist/instructions/index.d.ts.map +1 -0
  88. package/dist/instructions/index.js +9 -0
  89. package/dist/instructions/index.js.map +1 -0
  90. package/dist/instructions/liquid-fees.d.ts +111 -0
  91. package/dist/instructions/liquid-fees.d.ts.map +1 -0
  92. package/dist/instructions/liquid-fees.js +169 -0
  93. package/dist/instructions/liquid-fees.js.map +1 -0
  94. package/dist/instructions/liquid-state.d.ts +173 -0
  95. package/dist/instructions/liquid-state.d.ts.map +1 -0
  96. package/dist/instructions/liquid-state.js +194 -0
  97. package/dist/instructions/liquid-state.js.map +1 -0
  98. package/dist/instructions/liquid-swap.d.ts +122 -0
  99. package/dist/instructions/liquid-swap.d.ts.map +1 -0
  100. package/dist/instructions/liquid-swap.js +167 -0
  101. package/dist/instructions/liquid-swap.js.map +1 -0
  102. package/dist/instructions/liquid.d.ts +297 -0
  103. package/dist/instructions/liquid.d.ts.map +1 -0
  104. package/dist/instructions/liquid.js +483 -0
  105. package/dist/instructions/liquid.js.map +1 -0
  106. package/dist/instructions/program-cache.d.ts +35 -0
  107. package/dist/instructions/program-cache.d.ts.map +1 -0
  108. package/dist/instructions/program-cache.js +68 -0
  109. package/dist/instructions/program-cache.js.map +1 -0
  110. package/dist/math/amm.d.ts +42 -0
  111. package/dist/math/amm.d.ts.map +1 -0
  112. package/dist/math/amm.js +109 -0
  113. package/dist/math/amm.js.map +1 -0
  114. package/dist/math/bonding-curve.d.ts +34 -0
  115. package/dist/math/bonding-curve.d.ts.map +1 -0
  116. package/dist/math/bonding-curve.js +80 -0
  117. package/dist/math/bonding-curve.js.map +1 -0
  118. package/dist/math/constants.d.ts +14 -0
  119. package/dist/math/constants.d.ts.map +1 -0
  120. package/dist/math/constants.js +14 -0
  121. package/dist/math/constants.js.map +1 -0
  122. package/dist/math/fees.d.ts +88 -0
  123. package/dist/math/fees.d.ts.map +1 -0
  124. package/dist/math/fees.js +135 -0
  125. package/dist/math/fees.js.map +1 -0
  126. package/dist/math/index.d.ts +8 -0
  127. package/dist/math/index.d.ts.map +1 -0
  128. package/dist/math/index.js +6 -0
  129. package/dist/math/index.js.map +1 -0
  130. package/dist/math/tiered-fees.d.ts +80 -0
  131. package/dist/math/tiered-fees.d.ts.map +1 -0
  132. package/dist/math/tiered-fees.js +129 -0
  133. package/dist/math/tiered-fees.js.map +1 -0
  134. package/dist/oracle.d.ts +53 -0
  135. package/dist/oracle.d.ts.map +1 -0
  136. package/dist/oracle.js +70 -0
  137. package/dist/oracle.js.map +1 -0
  138. package/dist/pda/index.d.ts +89 -0
  139. package/dist/pda/index.d.ts.map +1 -0
  140. package/dist/pda/index.js +127 -0
  141. package/dist/pda/index.js.map +1 -0
  142. package/dist/pda/liquid-fees.d.ts +27 -0
  143. package/dist/pda/liquid-fees.d.ts.map +1 -0
  144. package/dist/pda/liquid-fees.js +36 -0
  145. package/dist/pda/liquid-fees.js.map +1 -0
  146. package/dist/pda/liquid-state.d.ts +56 -0
  147. package/dist/pda/liquid-state.d.ts.map +1 -0
  148. package/dist/pda/liquid-state.js +79 -0
  149. package/dist/pda/liquid-state.js.map +1 -0
  150. package/dist/pda/liquid-swap.d.ts +76 -0
  151. package/dist/pda/liquid-swap.d.ts.map +1 -0
  152. package/dist/pda/liquid-swap.js +103 -0
  153. package/dist/pda/liquid-swap.js.map +1 -0
  154. package/dist/pda/liquid.d.ts +67 -0
  155. package/dist/pda/liquid.d.ts.map +1 -0
  156. package/dist/pda/liquid.js +91 -0
  157. package/dist/pda/liquid.js.map +1 -0
  158. package/dist/provider.d.ts +26 -0
  159. package/dist/provider.d.ts.map +1 -0
  160. package/dist/provider.js +47 -0
  161. package/dist/provider.js.map +1 -0
  162. package/dist/transaction/builder.d.ts +30 -0
  163. package/dist/transaction/builder.d.ts.map +1 -0
  164. package/dist/transaction/builder.js +48 -0
  165. package/dist/transaction/builder.js.map +1 -0
  166. package/dist/transaction/index.d.ts +3 -0
  167. package/dist/transaction/index.d.ts.map +1 -0
  168. package/dist/transaction/index.js +3 -0
  169. package/dist/transaction/index.js.map +1 -0
  170. package/dist/transaction/send.d.ts +25 -0
  171. package/dist/transaction/send.d.ts.map +1 -0
  172. package/dist/transaction/send.js +52 -0
  173. package/dist/transaction/send.js.map +1 -0
  174. package/dist/types.d.ts +311 -0
  175. package/dist/types.d.ts.map +1 -0
  176. package/dist/types.js +46 -0
  177. package/dist/types.js.map +1 -0
  178. package/package.json +112 -0
  179. package/src/accounts/index.ts +26 -0
  180. package/src/accounts/liquid-fees.ts +38 -0
  181. package/src/accounts/liquid-state.ts +134 -0
  182. package/src/accounts/liquid-swap.ts +79 -0
  183. package/src/accounts/liquid.ts +100 -0
  184. package/src/client.ts +1001 -0
  185. package/src/config.ts +91 -0
  186. package/src/errors.ts +94 -0
  187. package/src/events/index.ts +42 -0
  188. package/src/events/parser.ts +90 -0
  189. package/src/events/types.ts +310 -0
  190. package/src/helpers/index.ts +23 -0
  191. package/src/helpers/preview.ts +798 -0
  192. package/src/helpers/user.ts +24 -0
  193. package/src/idl/index.ts +94 -0
  194. package/src/idl/liquid.json +10516 -0
  195. package/src/idl/liquid.ts +10522 -0
  196. package/src/idl/liquid_fees.json +1513 -0
  197. package/src/idl/liquid_fees.ts +1519 -0
  198. package/src/idl/liquid_state.json +2929 -0
  199. package/src/idl/liquid_state.ts +2935 -0
  200. package/src/idl/liquid_swap.json +5842 -0
  201. package/src/idl/liquid_swap.ts +5848 -0
  202. package/src/index.ts +98 -0
  203. package/src/instructions/index.ts +109 -0
  204. package/src/instructions/liquid-fees.ts +289 -0
  205. package/src/instructions/liquid-state.ts +336 -0
  206. package/src/instructions/liquid-swap.ts +414 -0
  207. package/src/instructions/liquid.ts +884 -0
  208. package/src/instructions/program-cache.ts +106 -0
  209. package/src/math/amm.ts +146 -0
  210. package/src/math/bonding-curve.ts +122 -0
  211. package/src/math/constants.ts +19 -0
  212. package/src/math/fees.ts +191 -0
  213. package/src/math/index.ts +40 -0
  214. package/src/math/tiered-fees.ts +165 -0
  215. package/src/oracle.ts +97 -0
  216. package/src/pda/index.ts +331 -0
  217. package/src/pda/liquid-fees.ts +58 -0
  218. package/src/pda/liquid-state.ts +123 -0
  219. package/src/pda/liquid-swap.ts +162 -0
  220. package/src/pda/liquid.ts +152 -0
  221. package/src/provider.ts +60 -0
  222. package/src/transaction/builder.ts +80 -0
  223. package/src/transaction/index.ts +6 -0
  224. package/src/transaction/send.ts +72 -0
  225. package/src/types.ts +354 -0
@@ -0,0 +1,5 @@
1
+ export { fetchLiquidGlobalConfig, fetchNativeBondingCurve, fetchNativeBondingCurveByAddress, fetchStableBondingCurve, fetchStableBondingCurveByAddress, } from "./liquid.js";
2
+ export { fetchAmmConfig, fetchPoolState, fetchPoolStateByAddress, fetchObservationState, } from "./liquid-swap.js";
3
+ export { fetchFeeConfig, fetchFeeConfigByAddress } from "./liquid-fees.js";
4
+ export { fetchUserProperties, fetchTokenVolume, fetchGlobalCurveVolume, fetchGlobalAmmVolume, fetchCashbackConfig, fetchUserSnapshot, fetchDeal, } from "./liquid-state.js";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/accounts/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,uBAAuB,EACvB,uBAAuB,EACvB,gCAAgC,EAChC,uBAAuB,EACvB,gCAAgC,GAChC,MAAM,aAAa,CAAC;AAErB,OAAO,EACN,cAAc,EACd,cAAc,EACd,uBAAuB,EACvB,qBAAqB,GACrB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAE3E,OAAO,EACN,mBAAmB,EACnB,gBAAgB,EAChB,sBAAsB,EACtB,oBAAoB,EACpB,mBAAmB,EACnB,iBAAiB,EACjB,SAAS,GACT,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,5 @@
1
+ export { fetchLiquidGlobalConfig, fetchNativeBondingCurve, fetchNativeBondingCurveByAddress, fetchStableBondingCurve, fetchStableBondingCurveByAddress, } from "./liquid.js";
2
+ export { fetchAmmConfig, fetchPoolState, fetchPoolStateByAddress, fetchObservationState, } from "./liquid-swap.js";
3
+ export { fetchFeeConfig, fetchFeeConfigByAddress } from "./liquid-fees.js";
4
+ export { fetchUserProperties, fetchTokenVolume, fetchGlobalCurveVolume, fetchGlobalAmmVolume, fetchCashbackConfig, fetchUserSnapshot, fetchDeal, } from "./liquid-state.js";
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/accounts/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,uBAAuB,EACvB,uBAAuB,EACvB,gCAAgC,EAChC,uBAAuB,EACvB,gCAAgC,GAChC,MAAM,aAAa,CAAC;AAErB,OAAO,EACN,cAAc,EACd,cAAc,EACd,uBAAuB,EACvB,qBAAqB,GACrB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAE3E,OAAO,EACN,mBAAmB,EACnB,gBAAgB,EAChB,sBAAsB,EACtB,oBAAoB,EACpB,mBAAmB,EACnB,iBAAiB,EACjB,SAAS,GACT,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,63 @@
1
+ import type { Connection, PublicKey } from "@solana/web3.js";
2
+ import type { LiquidConfig } from "../config.js";
3
+ /**
4
+ * Fetches the fee configuration for a token mint.
5
+ *
6
+ * @param connection - Solana RPC connection
7
+ * @param tokenMint - Token mint address
8
+ * @param config - Liquid protocol configuration
9
+ * @returns The deserialized fee configuration account
10
+ */
11
+ export declare function fetchFeeConfig(connection: Connection, tokenMint: PublicKey, config: LiquidConfig): Promise<{
12
+ creator: PublicKey;
13
+ tokenMint: PublicKey;
14
+ quoteMint: PublicKey;
15
+ feeMode: ({
16
+ revoked?: undefined;
17
+ } & {
18
+ recipients: Record<string, never>;
19
+ }) | ({
20
+ recipients?: undefined;
21
+ } & {
22
+ revoked: Record<string, never>;
23
+ });
24
+ recipientsCount: number;
25
+ recipients: {
26
+ pubkey: PublicKey;
27
+ basisPoints: number;
28
+ padding: number[];
29
+ }[];
30
+ updateAuthority: PublicKey;
31
+ bump: number;
32
+ }>;
33
+ /**
34
+ * Fetches the fee configuration by its PDA address directly.
35
+ *
36
+ * @param connection - Solana RPC connection
37
+ * @param feeConfigAddress - The fee configuration PDA address
38
+ * @param config - Liquid protocol configuration
39
+ * @returns The deserialized fee configuration account
40
+ */
41
+ export declare function fetchFeeConfigByAddress(connection: Connection, feeConfigAddress: PublicKey, config: LiquidConfig): Promise<{
42
+ creator: PublicKey;
43
+ tokenMint: PublicKey;
44
+ quoteMint: PublicKey;
45
+ feeMode: ({
46
+ revoked?: undefined;
47
+ } & {
48
+ recipients: Record<string, never>;
49
+ }) | ({
50
+ recipients?: undefined;
51
+ } & {
52
+ revoked: Record<string, never>;
53
+ });
54
+ recipientsCount: number;
55
+ recipients: {
56
+ pubkey: PublicKey;
57
+ basisPoints: number;
58
+ padding: number[];
59
+ }[];
60
+ updateAuthority: PublicKey;
61
+ bump: number;
62
+ }>;
63
+ //# sourceMappingURL=liquid-fees.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"liquid-fees.d.ts","sourceRoot":"","sources":["../../src/accounts/liquid-fees.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAIjD;;;;;;;GAOG;AACH,wBAAsB,cAAc,CACnC,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,YAAY;;;;;;;;;;;;;;;;;;;;;GAIpB;AAED;;;;;;;GAOG;AACH,wBAAsB,uBAAuB,CAC5C,UAAU,EAAE,UAAU,EACtB,gBAAgB,EAAE,SAAS,EAC3B,MAAM,EAAE,YAAY;;;;;;;;;;;;;;;;;;;;;GAIpB"}
@@ -0,0 +1,27 @@
1
+ import { getFeeConfigPDA } from "../pda/liquid-fees.js";
2
+ import { getLiquidFeesProgram } from "../idl/index.js";
3
+ /**
4
+ * Fetches the fee configuration for a token mint.
5
+ *
6
+ * @param connection - Solana RPC connection
7
+ * @param tokenMint - Token mint address
8
+ * @param config - Liquid protocol configuration
9
+ * @returns The deserialized fee configuration account
10
+ */
11
+ export async function fetchFeeConfig(connection, tokenMint, config) {
12
+ const [pda] = getFeeConfigPDA(tokenMint, config.liquidFeesProgramId);
13
+ return fetchFeeConfigByAddress(connection, pda, config);
14
+ }
15
+ /**
16
+ * Fetches the fee configuration by its PDA address directly.
17
+ *
18
+ * @param connection - Solana RPC connection
19
+ * @param feeConfigAddress - The fee configuration PDA address
20
+ * @param config - Liquid protocol configuration
21
+ * @returns The deserialized fee configuration account
22
+ */
23
+ export async function fetchFeeConfigByAddress(connection, feeConfigAddress, config) {
24
+ const program = getLiquidFeesProgram(connection, config);
25
+ return program.account.unifiedFeeConfiguration.fetch(feeConfigAddress);
26
+ }
27
+ //# sourceMappingURL=liquid-fees.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"liquid-fees.js","sourceRoot":"","sources":["../../src/accounts/liquid-fees.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAEvD;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CACnC,UAAsB,EACtB,SAAoB,EACpB,MAAoB;IAEpB,MAAM,CAAC,GAAG,CAAC,GAAG,eAAe,CAAC,SAAS,EAAE,MAAM,CAAC,mBAAmB,CAAC,CAAC;IACrE,OAAO,uBAAuB,CAAC,UAAU,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;AACzD,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC5C,UAAsB,EACtB,gBAA2B,EAC3B,MAAoB;IAEpB,MAAM,OAAO,GAAG,oBAAoB,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;IACzD,OAAO,OAAO,CAAC,OAAO,CAAC,uBAAuB,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;AACxE,CAAC"}
@@ -0,0 +1,112 @@
1
+ import type { Connection, PublicKey } from "@solana/web3.js";
2
+ import type { LiquidConfig } from "../config.js";
3
+ /**
4
+ * Fetches a user's properties (referrer, volumes, cashback state).
5
+ *
6
+ * @param connection - Solana RPC connection
7
+ * @param user - User's public key
8
+ * @param config - Liquid protocol configuration
9
+ * @returns The deserialized user properties account
10
+ */
11
+ export declare function fetchUserProperties(connection: Connection, user: PublicKey, config: LiquidConfig): Promise<{
12
+ referrer: {
13
+ referrer: PublicKey;
14
+ deal: PublicKey | null;
15
+ cashbackMultiplierBps: number;
16
+ } | null;
17
+ totalSolVolume: import("bn.js");
18
+ totalTokenVolume: import("bn.js");
19
+ cashbackCredits: import("bn.js");
20
+ isSpending: boolean;
21
+ curveSolVolume: import("bn.js");
22
+ ammSolVolume: import("bn.js");
23
+ snapshotSolVolume: import("bn.js");
24
+ snapshotTokenVolume: import("bn.js");
25
+ snapshotCount: number;
26
+ latestSnapshot: PublicKey | null;
27
+ }>;
28
+ /**
29
+ * Fetches the token volume accumulator for a mint.
30
+ *
31
+ * @param connection - Solana RPC connection
32
+ * @param mint - Token mint address
33
+ * @param config - Liquid protocol configuration
34
+ * @returns The deserialized token volume accumulator account
35
+ */
36
+ export declare function fetchTokenVolume(connection: Connection, mint: PublicKey, config: LiquidConfig): Promise<{
37
+ mint: PublicKey;
38
+ totalSolVolume: import("bn.js");
39
+ totalTokenVolume: import("bn.js");
40
+ curveSolVolume: import("bn.js");
41
+ ammSolVolume: import("bn.js");
42
+ }>;
43
+ /**
44
+ * Fetches the global curve volume accumulator.
45
+ *
46
+ * @param connection - Solana RPC connection
47
+ * @param config - Liquid protocol configuration
48
+ * @returns The deserialized global curve volume accumulator account
49
+ */
50
+ export declare function fetchGlobalCurveVolume(connection: Connection, config: LiquidConfig): Promise<{
51
+ totalSolVolume: import("bn.js");
52
+ totalTokenVolume: import("bn.js");
53
+ }>;
54
+ /**
55
+ * Fetches the global AMM volume accumulator.
56
+ *
57
+ * @param connection - Solana RPC connection
58
+ * @param config - Liquid protocol configuration
59
+ * @returns The deserialized global AMM volume accumulator account
60
+ */
61
+ export declare function fetchGlobalAmmVolume(connection: Connection, config: LiquidConfig): Promise<{
62
+ totalSolVolume: import("bn.js");
63
+ totalTokenVolume: import("bn.js");
64
+ }>;
65
+ /**
66
+ * Fetches the cashback configuration.
67
+ *
68
+ * @param connection - Solana RPC connection
69
+ * @param config - Liquid protocol configuration
70
+ * @returns The deserialized cashback configuration account
71
+ */
72
+ export declare function fetchCashbackConfig(connection: Connection, config: LiquidConfig): Promise<{
73
+ adminAuthority: PublicKey;
74
+ ranges: {
75
+ rangeStartInclusive: import("bn.js");
76
+ rangeEndExclusive: import("bn.js");
77
+ multiplierBasisPoints: number;
78
+ }[];
79
+ traderCashbackBasisPoints: number;
80
+ pendingAdmin: PublicKey | null;
81
+ }>;
82
+ /**
83
+ * Fetches a user snapshot by user and index.
84
+ *
85
+ * @param connection - Solana RPC connection
86
+ * @param user - User's public key
87
+ * @param index - Snapshot index (0-based)
88
+ * @param config - Liquid protocol configuration
89
+ * @returns The deserialized user snapshot account
90
+ */
91
+ export declare function fetchUserSnapshot(connection: Connection, user: PublicKey, index: number, config: LiquidConfig): Promise<{
92
+ user: PublicKey;
93
+ index: number;
94
+ prevSnapshot: PublicKey | null;
95
+ solVolume: import("bn.js");
96
+ tokenVolume: import("bn.js");
97
+ createdAt: import("bn.js");
98
+ }>;
99
+ /**
100
+ * Fetches a deal account by its owner.
101
+ *
102
+ * @param connection - Solana RPC connection
103
+ * @param owner - Deal owner's public key
104
+ * @param config - Liquid protocol configuration
105
+ * @returns The deserialized deal account
106
+ */
107
+ export declare function fetchDeal(connection: Connection, owner: PublicKey, config: LiquidConfig): Promise<{
108
+ owner: PublicKey;
109
+ cashbackMultiplierBps: number;
110
+ redemptionCount: number;
111
+ }>;
112
+ //# sourceMappingURL=liquid-state.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"liquid-state.d.ts","sourceRoot":"","sources":["../../src/accounts/liquid-state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAYjD;;;;;;;GAOG;AACH,wBAAsB,mBAAmB,CACxC,UAAU,EAAE,UAAU,EACtB,IAAI,EAAE,SAAS,EACf,MAAM,EAAE,YAAY;;;;;;;;;;;;;;;;GAKpB;AAED;;;;;;;GAOG;AACH,wBAAsB,gBAAgB,CACrC,UAAU,EAAE,UAAU,EACtB,IAAI,EAAE,SAAS,EACf,MAAM,EAAE,YAAY;;;;;;GAKpB;AAED;;;;;;GAMG;AACH,wBAAsB,sBAAsB,CAC3C,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,YAAY;;;GAKpB;AAED;;;;;;GAMG;AACH,wBAAsB,oBAAoB,CACzC,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,YAAY;;;GAKpB;AAED;;;;;;GAMG;AACH,wBAAsB,mBAAmB,CACxC,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,YAAY;;;;;;;;;GAKpB;AAED;;;;;;;;GAQG;AACH,wBAAsB,iBAAiB,CACtC,UAAU,EAAE,UAAU,EACtB,IAAI,EAAE,SAAS,EACf,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,YAAY;;;;;;;GAKpB;AAED;;;;;;;GAOG;AACH,wBAAsB,SAAS,CAC9B,UAAU,EAAE,UAAU,EACtB,KAAK,EAAE,SAAS,EAChB,MAAM,EAAE,YAAY;;;;GAKpB"}
@@ -0,0 +1,92 @@
1
+ import { getUserPropertiesPDA, getTokenVolumePDA, getGlobalCurveVolumePDA, getGlobalAmmVolumePDA, getCashbackConfigPDA, getUserSnapshotPDA, getDealPDA, } from "../pda/liquid-state.js";
2
+ import { getLiquidStateProgram } from "../idl/index.js";
3
+ /**
4
+ * Fetches a user's properties (referrer, volumes, cashback state).
5
+ *
6
+ * @param connection - Solana RPC connection
7
+ * @param user - User's public key
8
+ * @param config - Liquid protocol configuration
9
+ * @returns The deserialized user properties account
10
+ */
11
+ export async function fetchUserProperties(connection, user, config) {
12
+ const program = getLiquidStateProgram(connection, config);
13
+ const [pda] = getUserPropertiesPDA(user, config.liquidStateProgramId);
14
+ return program.account.userProperties.fetch(pda);
15
+ }
16
+ /**
17
+ * Fetches the token volume accumulator for a mint.
18
+ *
19
+ * @param connection - Solana RPC connection
20
+ * @param mint - Token mint address
21
+ * @param config - Liquid protocol configuration
22
+ * @returns The deserialized token volume accumulator account
23
+ */
24
+ export async function fetchTokenVolume(connection, mint, config) {
25
+ const program = getLiquidStateProgram(connection, config);
26
+ const [pda] = getTokenVolumePDA(mint, config.liquidStateProgramId);
27
+ return program.account.tokenVolumeAccumulator.fetch(pda);
28
+ }
29
+ /**
30
+ * Fetches the global curve volume accumulator.
31
+ *
32
+ * @param connection - Solana RPC connection
33
+ * @param config - Liquid protocol configuration
34
+ * @returns The deserialized global curve volume accumulator account
35
+ */
36
+ export async function fetchGlobalCurveVolume(connection, config) {
37
+ const program = getLiquidStateProgram(connection, config);
38
+ const [pda] = getGlobalCurveVolumePDA(config.liquidStateProgramId);
39
+ return program.account.globalCurveVolumeAccumulator.fetch(pda);
40
+ }
41
+ /**
42
+ * Fetches the global AMM volume accumulator.
43
+ *
44
+ * @param connection - Solana RPC connection
45
+ * @param config - Liquid protocol configuration
46
+ * @returns The deserialized global AMM volume accumulator account
47
+ */
48
+ export async function fetchGlobalAmmVolume(connection, config) {
49
+ const program = getLiquidStateProgram(connection, config);
50
+ const [pda] = getGlobalAmmVolumePDA(config.liquidStateProgramId);
51
+ return program.account.globalAmmVolumeAccumulator.fetch(pda);
52
+ }
53
+ /**
54
+ * Fetches the cashback configuration.
55
+ *
56
+ * @param connection - Solana RPC connection
57
+ * @param config - Liquid protocol configuration
58
+ * @returns The deserialized cashback configuration account
59
+ */
60
+ export async function fetchCashbackConfig(connection, config) {
61
+ const program = getLiquidStateProgram(connection, config);
62
+ const [pda] = getCashbackConfigPDA(config.liquidStateProgramId);
63
+ return program.account.cashbackConfiguration.fetch(pda);
64
+ }
65
+ /**
66
+ * Fetches a user snapshot by user and index.
67
+ *
68
+ * @param connection - Solana RPC connection
69
+ * @param user - User's public key
70
+ * @param index - Snapshot index (0-based)
71
+ * @param config - Liquid protocol configuration
72
+ * @returns The deserialized user snapshot account
73
+ */
74
+ export async function fetchUserSnapshot(connection, user, index, config) {
75
+ const program = getLiquidStateProgram(connection, config);
76
+ const [pda] = getUserSnapshotPDA(user, index, config.liquidStateProgramId);
77
+ return program.account.userSnapshot.fetch(pda);
78
+ }
79
+ /**
80
+ * Fetches a deal account by its owner.
81
+ *
82
+ * @param connection - Solana RPC connection
83
+ * @param owner - Deal owner's public key
84
+ * @param config - Liquid protocol configuration
85
+ * @returns The deserialized deal account
86
+ */
87
+ export async function fetchDeal(connection, owner, config) {
88
+ const program = getLiquidStateProgram(connection, config);
89
+ const [pda] = getDealPDA(owner, config.liquidStateProgramId);
90
+ return program.account.deal.fetch(pda);
91
+ }
92
+ //# sourceMappingURL=liquid-state.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"liquid-state.js","sourceRoot":"","sources":["../../src/accounts/liquid-state.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,97 @@
1
+ import type { Connection, PublicKey } from "@solana/web3.js";
2
+ import type { LiquidConfig } from "../config.js";
3
+ /**
4
+ * Fetches the AMM global configuration.
5
+ *
6
+ * @param connection - Solana RPC connection
7
+ * @param config - Liquid protocol configuration
8
+ * @returns The deserialized AMM configuration account
9
+ */
10
+ export declare function fetchAmmConfig(connection: Connection, config: LiquidConfig): Promise<{
11
+ adminAuthority: PublicKey;
12
+ feeRecipients: PublicKey[];
13
+ quoteMints: PublicKey[];
14
+ feeTiers: {
15
+ rangeStartInclusive: import("bn.js");
16
+ rangeEndExclusive: import("bn.js");
17
+ lpFeeRate: number;
18
+ protocolFeeRate: number;
19
+ creatorFeeRate: number;
20
+ }[];
21
+ oraclePriceFeed: PublicKey;
22
+ pendingAdmin: PublicKey | null;
23
+ bump: number;
24
+ paused: boolean;
25
+ }>;
26
+ /**
27
+ * Fetches an AMM pool state by base and quote mint.
28
+ *
29
+ * @param connection - Solana RPC connection
30
+ * @param baseMint - Base token mint address
31
+ * @param quoteMint - Quote token mint address
32
+ * @param config - Liquid protocol configuration
33
+ * @returns The deserialized pool state account
34
+ */
35
+ export declare function fetchPoolState(connection: Connection, baseMint: PublicKey, quoteMint: PublicKey, config: LiquidConfig): Promise<{
36
+ baseVault: PublicKey;
37
+ quoteVault: PublicKey;
38
+ lpMint: PublicKey;
39
+ baseMint: PublicKey;
40
+ quoteMint: PublicKey;
41
+ baseTokenProgram: PublicKey;
42
+ quoteTokenProgram: PublicKey;
43
+ observationKey: PublicKey;
44
+ authBump: number;
45
+ lpMintDecimals: number;
46
+ baseDecimals: number;
47
+ quoteDecimals: number;
48
+ lpSupply: import("bn.js");
49
+ recentEpoch: import("bn.js");
50
+ creator: PublicKey;
51
+ }>;
52
+ /**
53
+ * Fetches a pool state by its PDA address directly.
54
+ *
55
+ * @param connection - Solana RPC connection
56
+ * @param poolAddress - The pool state PDA address
57
+ * @param config - Liquid protocol configuration
58
+ * @returns The deserialized pool state account
59
+ */
60
+ export declare function fetchPoolStateByAddress(connection: Connection, poolAddress: PublicKey, config: LiquidConfig): Promise<{
61
+ baseVault: PublicKey;
62
+ quoteVault: PublicKey;
63
+ lpMint: PublicKey;
64
+ baseMint: PublicKey;
65
+ quoteMint: PublicKey;
66
+ baseTokenProgram: PublicKey;
67
+ quoteTokenProgram: PublicKey;
68
+ observationKey: PublicKey;
69
+ authBump: number;
70
+ lpMintDecimals: number;
71
+ baseDecimals: number;
72
+ quoteDecimals: number;
73
+ lpSupply: import("bn.js");
74
+ recentEpoch: import("bn.js");
75
+ creator: PublicKey;
76
+ }>;
77
+ /**
78
+ * Fetches the observation state (oracle) for a pool.
79
+ *
80
+ * @param connection - Solana RPC connection
81
+ * @param poolAddress - The pool state PDA address
82
+ * @param config - Liquid protocol configuration
83
+ * @returns The deserialized observation state account
84
+ */
85
+ export declare function fetchObservationState(connection: Connection, poolAddress: PublicKey, config: LiquidConfig): Promise<{
86
+ initialized: boolean;
87
+ observationIndex: number;
88
+ poolId: PublicKey;
89
+ observations: {
90
+ blockTimestamp: import("bn.js");
91
+ cumulativeBasePriceX32: import("bn.js");
92
+ cumulativeQuotePriceX32: import("bn.js");
93
+ }[];
94
+ lastUpdateTimestamp: import("bn.js");
95
+ padding: import("bn.js")[];
96
+ }>;
97
+ //# sourceMappingURL=liquid-swap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"liquid-swap.d.ts","sourceRoot":"","sources":["../../src/accounts/liquid-swap.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAQjD;;;;;;GAMG;AACH,wBAAsB,cAAc,CACnC,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,YAAY;;;;;;;;;;;;;;;GAKpB;AAED;;;;;;;;GAQG;AACH,wBAAsB,cAAc,CACnC,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,SAAS,EACnB,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,YAAY;;;;;;;;;;;;;;;;GAKpB;AAED;;;;;;;GAOG;AACH,wBAAsB,uBAAuB,CAC5C,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,SAAS,EACtB,MAAM,EAAE,YAAY;;;;;;;;;;;;;;;;GAIpB;AAED;;;;;;;GAOG;AACH,wBAAsB,qBAAqB,CAC1C,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,SAAS,EACtB,MAAM,EAAE,YAAY;;;;;;;;;;;GAKpB"}
@@ -0,0 +1,54 @@
1
+ import { getSwapGlobalConfigPDA, getPoolPDA, getObservationPDA, } from "../pda/liquid-swap.js";
2
+ import { getLiquidSwapProgram } from "../idl/index.js";
3
+ /**
4
+ * Fetches the AMM global configuration.
5
+ *
6
+ * @param connection - Solana RPC connection
7
+ * @param config - Liquid protocol configuration
8
+ * @returns The deserialized AMM configuration account
9
+ */
10
+ export async function fetchAmmConfig(connection, config) {
11
+ const program = getLiquidSwapProgram(connection, config);
12
+ const [pda] = getSwapGlobalConfigPDA(config.liquidSwapProgramId);
13
+ return program.account.ammConfig.fetch(pda);
14
+ }
15
+ /**
16
+ * Fetches an AMM pool state by base and quote mint.
17
+ *
18
+ * @param connection - Solana RPC connection
19
+ * @param baseMint - Base token mint address
20
+ * @param quoteMint - Quote token mint address
21
+ * @param config - Liquid protocol configuration
22
+ * @returns The deserialized pool state account
23
+ */
24
+ export async function fetchPoolState(connection, baseMint, quoteMint, config) {
25
+ const program = getLiquidSwapProgram(connection, config);
26
+ const [pda] = getPoolPDA(baseMint, quoteMint, config.liquidSwapProgramId);
27
+ return program.account.poolState.fetch(pda);
28
+ }
29
+ /**
30
+ * Fetches a pool state by its PDA address directly.
31
+ *
32
+ * @param connection - Solana RPC connection
33
+ * @param poolAddress - The pool state PDA address
34
+ * @param config - Liquid protocol configuration
35
+ * @returns The deserialized pool state account
36
+ */
37
+ export async function fetchPoolStateByAddress(connection, poolAddress, config) {
38
+ const program = getLiquidSwapProgram(connection, config);
39
+ return program.account.poolState.fetch(poolAddress);
40
+ }
41
+ /**
42
+ * Fetches the observation state (oracle) for a pool.
43
+ *
44
+ * @param connection - Solana RPC connection
45
+ * @param poolAddress - The pool state PDA address
46
+ * @param config - Liquid protocol configuration
47
+ * @returns The deserialized observation state account
48
+ */
49
+ export async function fetchObservationState(connection, poolAddress, config) {
50
+ const program = getLiquidSwapProgram(connection, config);
51
+ const [pda] = getObservationPDA(poolAddress, config.liquidSwapProgramId);
52
+ return program.account.observationState.fetch(pda);
53
+ }
54
+ //# sourceMappingURL=liquid-swap.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"liquid-swap.js","sourceRoot":"","sources":["../../src/accounts/liquid-swap.ts"],"names":[],"mappings":"AAEA,OAAO,EACN,sBAAsB,EACtB,UAAU,EACV,iBAAiB,GACjB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAEvD;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CACnC,UAAsB,EACtB,MAAoB;IAEpB,MAAM,OAAO,GAAG,oBAAoB,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;IACzD,MAAM,CAAC,GAAG,CAAC,GAAG,sBAAsB,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC;IACjE,OAAO,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AAC7C,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CACnC,UAAsB,EACtB,QAAmB,EACnB,SAAoB,EACpB,MAAoB;IAEpB,MAAM,OAAO,GAAG,oBAAoB,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;IACzD,MAAM,CAAC,GAAG,CAAC,GAAG,UAAU,CAAC,QAAQ,EAAE,SAAS,EAAE,MAAM,CAAC,mBAAmB,CAAC,CAAC;IAC1E,OAAO,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AAC7C,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC5C,UAAsB,EACtB,WAAsB,EACtB,MAAoB;IAEpB,MAAM,OAAO,GAAG,oBAAoB,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;IACzD,OAAO,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;AACrD,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAC1C,UAAsB,EACtB,WAAsB,EACtB,MAAoB;IAEpB,MAAM,OAAO,GAAG,oBAAoB,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;IACzD,MAAM,CAAC,GAAG,CAAC,GAAG,iBAAiB,CAAC,WAAW,EAAE,MAAM,CAAC,mBAAmB,CAAC,CAAC;IACzE,OAAO,OAAO,CAAC,OAAO,CAAC,gBAAgB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AACpD,CAAC"}
@@ -0,0 +1,175 @@
1
+ import type { Connection, PublicKey } from "@solana/web3.js";
2
+ import type { LiquidConfig } from "../config.js";
3
+ /**
4
+ * Fetches the global configuration for the bonding curve program.
5
+ *
6
+ * @param connection - Solana RPC connection
7
+ * @param config - Liquid protocol configuration
8
+ * @returns The deserialized global configuration account
9
+ */
10
+ export declare function fetchLiquidGlobalConfig(connection: Connection, config: LiquidConfig): Promise<{
11
+ adminAuthority: PublicKey;
12
+ initialVirtualReserveUsd: import("bn.js");
13
+ migrationMarketCapUsd: import("bn.js");
14
+ initialVirtualTokenReserves: import("bn.js");
15
+ initialRealTokenReserves: import("bn.js");
16
+ tokenTotalSupply: import("bn.js");
17
+ creatorFeeBasisPoints: number;
18
+ creatorReferralRewardBasisPoints: number;
19
+ traderReferralRewardBasisPoints: number;
20
+ protocolFeeBasisPoints: number;
21
+ feeRecipients: PublicKey[];
22
+ quoteMints: PublicKey[];
23
+ solUsdPriceFeed: PublicKey;
24
+ pendingAdmin: PublicKey | null;
25
+ bump: number;
26
+ paused: boolean;
27
+ }>;
28
+ /**
29
+ * Fetches a bonding curve account by mint address.
30
+ *
31
+ * @param connection - Solana RPC connection
32
+ * @param mint - Token mint address
33
+ * @param config - Liquid protocol configuration
34
+ * @returns The deserialized bonding curve account
35
+ */
36
+ export declare function fetchNativeBondingCurve(connection: Connection, mint: PublicKey, config: LiquidConfig): Promise<{
37
+ creator: PublicKey;
38
+ tokenMint: PublicKey;
39
+ realTokenReserves: import("bn.js");
40
+ virtualTokenReserves: import("bn.js");
41
+ realSolReserves: import("bn.js");
42
+ tokenTotalSupply: import("bn.js");
43
+ initialVirtualReserveUsd: import("bn.js");
44
+ status: ({
45
+ complete?: undefined;
46
+ migrated?: undefined;
47
+ } & {
48
+ active: Record<string, never>;
49
+ }) | ({
50
+ active?: undefined;
51
+ migrated?: undefined;
52
+ } & {
53
+ complete: {
54
+ solPriceSnapshot: import("bn.js");
55
+ };
56
+ }) | ({
57
+ active?: undefined;
58
+ complete?: undefined;
59
+ } & {
60
+ migrated: Record<string, never>;
61
+ });
62
+ bump: number;
63
+ }>;
64
+ /**
65
+ * Fetches a bonding curve account by its PDA address directly.
66
+ *
67
+ * @param connection - Solana RPC connection
68
+ * @param bondingCurveAddress - The bonding curve PDA address
69
+ * @param config - Liquid protocol configuration
70
+ * @returns The deserialized bonding curve account
71
+ */
72
+ export declare function fetchNativeBondingCurveByAddress(connection: Connection, bondingCurveAddress: PublicKey, config: LiquidConfig): Promise<{
73
+ creator: PublicKey;
74
+ tokenMint: PublicKey;
75
+ realTokenReserves: import("bn.js");
76
+ virtualTokenReserves: import("bn.js");
77
+ realSolReserves: import("bn.js");
78
+ tokenTotalSupply: import("bn.js");
79
+ initialVirtualReserveUsd: import("bn.js");
80
+ status: ({
81
+ complete?: undefined;
82
+ migrated?: undefined;
83
+ } & {
84
+ active: Record<string, never>;
85
+ }) | ({
86
+ active?: undefined;
87
+ migrated?: undefined;
88
+ } & {
89
+ complete: {
90
+ solPriceSnapshot: import("bn.js");
91
+ };
92
+ }) | ({
93
+ active?: undefined;
94
+ complete?: undefined;
95
+ } & {
96
+ migrated: Record<string, never>;
97
+ });
98
+ bump: number;
99
+ }>;
100
+ /**
101
+ * Fetches a token bonding curve account by mint and quote mint addresses.
102
+ *
103
+ * @param connection - Solana RPC connection
104
+ * @param mint - Token mint address (base token)
105
+ * @param quoteMint - Quote token mint address (e.g., USDC)
106
+ * @param config - Liquid protocol configuration
107
+ * @returns The deserialized token bonding curve account
108
+ */
109
+ export declare function fetchStableBondingCurve(connection: Connection, mint: PublicKey, quoteMint: PublicKey, config: LiquidConfig): Promise<{
110
+ creator: PublicKey;
111
+ tokenMint: PublicKey;
112
+ quoteMint: PublicKey;
113
+ realTokenReserves: import("bn.js");
114
+ virtualTokenReserves: import("bn.js");
115
+ realQuoteReserves: import("bn.js");
116
+ virtualQuoteReserves: import("bn.js");
117
+ tokenTotalSupply: import("bn.js");
118
+ status: ({
119
+ complete?: undefined;
120
+ migrated?: undefined;
121
+ } & {
122
+ active: Record<string, never>;
123
+ }) | ({
124
+ active?: undefined;
125
+ migrated?: undefined;
126
+ } & {
127
+ complete: {
128
+ solPriceSnapshot: import("bn.js");
129
+ };
130
+ }) | ({
131
+ active?: undefined;
132
+ complete?: undefined;
133
+ } & {
134
+ migrated: Record<string, never>;
135
+ });
136
+ bump: number;
137
+ }>;
138
+ /**
139
+ * Fetches a token bonding curve account by its PDA address directly.
140
+ *
141
+ * @param connection - Solana RPC connection
142
+ * @param stableBondingCurveAddress - The token bonding curve PDA address
143
+ * @param config - Liquid protocol configuration
144
+ * @returns The deserialized token bonding curve account
145
+ */
146
+ export declare function fetchStableBondingCurveByAddress(connection: Connection, stableBondingCurveAddress: PublicKey, config: LiquidConfig): Promise<{
147
+ creator: PublicKey;
148
+ tokenMint: PublicKey;
149
+ quoteMint: PublicKey;
150
+ realTokenReserves: import("bn.js");
151
+ virtualTokenReserves: import("bn.js");
152
+ realQuoteReserves: import("bn.js");
153
+ virtualQuoteReserves: import("bn.js");
154
+ tokenTotalSupply: import("bn.js");
155
+ status: ({
156
+ complete?: undefined;
157
+ migrated?: undefined;
158
+ } & {
159
+ active: Record<string, never>;
160
+ }) | ({
161
+ active?: undefined;
162
+ migrated?: undefined;
163
+ } & {
164
+ complete: {
165
+ solPriceSnapshot: import("bn.js");
166
+ };
167
+ }) | ({
168
+ active?: undefined;
169
+ complete?: undefined;
170
+ } & {
171
+ migrated: Record<string, never>;
172
+ });
173
+ bump: number;
174
+ }>;
175
+ //# sourceMappingURL=liquid.d.ts.map