@cubee_ee/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 (179) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +110 -0
  3. package/dist/clients/AdminClient.d.ts +61 -0
  4. package/dist/clients/AdminClient.d.ts.map +1 -0
  5. package/dist/clients/AdminClient.js +196 -0
  6. package/dist/clients/AdminClient.js.map +1 -0
  7. package/dist/clients/CubeBackendClient.d.ts +67 -0
  8. package/dist/clients/CubeBackendClient.d.ts.map +1 -0
  9. package/dist/clients/CubeBackendClient.js +126 -0
  10. package/dist/clients/CubeBackendClient.js.map +1 -0
  11. package/dist/clients/CubicPoolClient.d.ts +73 -0
  12. package/dist/clients/CubicPoolClient.d.ts.map +1 -0
  13. package/dist/clients/CubicPoolClient.js +425 -0
  14. package/dist/clients/CubicPoolClient.js.map +1 -0
  15. package/dist/clients/PoolFactoryClient.d.ts +45 -0
  16. package/dist/clients/PoolFactoryClient.d.ts.map +1 -0
  17. package/dist/clients/PoolFactoryClient.js +83 -0
  18. package/dist/clients/PoolFactoryClient.js.map +1 -0
  19. package/dist/clients/RpcClient.d.ts +28 -0
  20. package/dist/clients/RpcClient.d.ts.map +1 -0
  21. package/dist/clients/RpcClient.js +58 -0
  22. package/dist/clients/RpcClient.js.map +1 -0
  23. package/dist/clients/SingleTokenDepositClient.d.ts +45 -0
  24. package/dist/clients/SingleTokenDepositClient.d.ts.map +1 -0
  25. package/dist/clients/SingleTokenDepositClient.js +63 -0
  26. package/dist/clients/SingleTokenDepositClient.js.map +1 -0
  27. package/dist/clients/index.d.ts +8 -0
  28. package/dist/clients/index.d.ts.map +1 -0
  29. package/dist/clients/index.js +24 -0
  30. package/dist/clients/index.js.map +1 -0
  31. package/dist/clients/tx-builders.d.ts +32 -0
  32. package/dist/clients/tx-builders.d.ts.map +1 -0
  33. package/dist/clients/tx-builders.js +398 -0
  34. package/dist/clients/tx-builders.js.map +1 -0
  35. package/dist/config/index.d.ts +60 -0
  36. package/dist/config/index.d.ts.map +1 -0
  37. package/dist/config/index.js +59 -0
  38. package/dist/config/index.js.map +1 -0
  39. package/dist/config/networks.d.ts +10 -0
  40. package/dist/config/networks.d.ts.map +1 -0
  41. package/dist/config/networks.js +31 -0
  42. package/dist/config/networks.js.map +1 -0
  43. package/dist/config/tokens.d.ts +19 -0
  44. package/dist/config/tokens.d.ts.map +1 -0
  45. package/dist/config/tokens.js +43 -0
  46. package/dist/config/tokens.js.map +1 -0
  47. package/dist/idl/cubic_pool.json +2497 -0
  48. package/dist/idl/index.d.ts +975 -0
  49. package/dist/idl/index.d.ts.map +1 -0
  50. package/dist/idl/index.js +18 -0
  51. package/dist/idl/index.js.map +1 -0
  52. package/dist/idl/protocol_admin.json +1816 -0
  53. package/dist/idl/single_token_liquidity.json +745 -0
  54. package/dist/index.d.ts +48 -0
  55. package/dist/index.d.ts.map +1 -0
  56. package/dist/index.js +136 -0
  57. package/dist/index.js.map +1 -0
  58. package/dist/math/cubicMath.d.ts +40 -0
  59. package/dist/math/cubicMath.d.ts.map +1 -0
  60. package/dist/math/cubicMath.js +75 -0
  61. package/dist/math/cubicMath.js.map +1 -0
  62. package/dist/math/fixedPoint.d.ts +14 -0
  63. package/dist/math/fixedPoint.d.ts.map +1 -0
  64. package/dist/math/fixedPoint.js +46 -0
  65. package/dist/math/fixedPoint.js.map +1 -0
  66. package/dist/math/index.d.ts +7 -0
  67. package/dist/math/index.d.ts.map +1 -0
  68. package/dist/math/index.js +23 -0
  69. package/dist/math/index.js.map +1 -0
  70. package/dist/math/logExp.d.ts +15 -0
  71. package/dist/math/logExp.d.ts.map +1 -0
  72. package/dist/math/logExp.js +91 -0
  73. package/dist/math/logExp.js.map +1 -0
  74. package/dist/math/singleToken.d.ts +53 -0
  75. package/dist/math/singleToken.d.ts.map +1 -0
  76. package/dist/math/singleToken.js +185 -0
  77. package/dist/math/singleToken.js.map +1 -0
  78. package/dist/math/slippage.d.ts +24 -0
  79. package/dist/math/slippage.d.ts.map +1 -0
  80. package/dist/math/slippage.js +54 -0
  81. package/dist/math/slippage.js.map +1 -0
  82. package/dist/math/weightedMath.d.ts +18 -0
  83. package/dist/math/weightedMath.d.ts.map +1 -0
  84. package/dist/math/weightedMath.js +45 -0
  85. package/dist/math/weightedMath.js.map +1 -0
  86. package/dist/parsers/borsh.d.ts +24 -0
  87. package/dist/parsers/borsh.d.ts.map +1 -0
  88. package/dist/parsers/borsh.js +80 -0
  89. package/dist/parsers/borsh.js.map +1 -0
  90. package/dist/parsers/events.d.ts +3 -0
  91. package/dist/parsers/events.d.ts.map +1 -0
  92. package/dist/parsers/events.js +172 -0
  93. package/dist/parsers/events.js.map +1 -0
  94. package/dist/parsers/index.d.ts +5 -0
  95. package/dist/parsers/index.d.ts.map +1 -0
  96. package/dist/parsers/index.js +21 -0
  97. package/dist/parsers/index.js.map +1 -0
  98. package/dist/parsers/mintAccount.d.ts +22 -0
  99. package/dist/parsers/mintAccount.d.ts.map +1 -0
  100. package/dist/parsers/mintAccount.js +22 -0
  101. package/dist/parsers/mintAccount.js.map +1 -0
  102. package/dist/parsers/poolAccount.d.ts +32 -0
  103. package/dist/parsers/poolAccount.d.ts.map +1 -0
  104. package/dist/parsers/poolAccount.js +88 -0
  105. package/dist/parsers/poolAccount.js.map +1 -0
  106. package/dist/types/events.d.ts +82 -0
  107. package/dist/types/events.d.ts.map +1 -0
  108. package/dist/types/events.js +3 -0
  109. package/dist/types/events.js.map +1 -0
  110. package/dist/types/index.d.ts +5 -0
  111. package/dist/types/index.d.ts.map +1 -0
  112. package/dist/types/index.js +21 -0
  113. package/dist/types/index.js.map +1 -0
  114. package/dist/types/pool.d.ts +66 -0
  115. package/dist/types/pool.d.ts.map +1 -0
  116. package/dist/types/pool.js +3 -0
  117. package/dist/types/pool.js.map +1 -0
  118. package/dist/types/result.d.ts +23 -0
  119. package/dist/types/result.d.ts.map +1 -0
  120. package/dist/types/result.js +11 -0
  121. package/dist/types/result.js.map +1 -0
  122. package/dist/types/tx.d.ts +80 -0
  123. package/dist/types/tx.d.ts.map +1 -0
  124. package/dist/types/tx.js +3 -0
  125. package/dist/types/tx.js.map +1 -0
  126. package/dist/utils/errors.d.ts +8 -0
  127. package/dist/utils/errors.d.ts.map +1 -0
  128. package/dist/utils/errors.js +83 -0
  129. package/dist/utils/errors.js.map +1 -0
  130. package/dist/utils/index.d.ts +4 -0
  131. package/dist/utils/index.d.ts.map +1 -0
  132. package/dist/utils/index.js +20 -0
  133. package/dist/utils/index.js.map +1 -0
  134. package/dist/utils/pda.d.ts +8 -0
  135. package/dist/utils/pda.d.ts.map +1 -0
  136. package/dist/utils/pda.js +27 -0
  137. package/dist/utils/pda.js.map +1 -0
  138. package/dist/utils/retry.d.ts +22 -0
  139. package/dist/utils/retry.d.ts.map +1 -0
  140. package/dist/utils/retry.js +62 -0
  141. package/dist/utils/retry.js.map +1 -0
  142. package/package.json +54 -0
  143. package/src/clients/AdminClient.ts +254 -0
  144. package/src/clients/CubeBackendClient.ts +193 -0
  145. package/src/clients/CubicPoolClient.ts +492 -0
  146. package/src/clients/PoolFactoryClient.ts +102 -0
  147. package/src/clients/RpcClient.ts +78 -0
  148. package/src/clients/SingleTokenDepositClient.ts +91 -0
  149. package/src/clients/index.ts +7 -0
  150. package/src/clients/tx-builders.ts +538 -0
  151. package/src/config/index.ts +82 -0
  152. package/src/config/networks.ts +49 -0
  153. package/src/config/tokens.ts +52 -0
  154. package/src/idl/cubic_pool.json +2497 -0
  155. package/src/idl/index.ts +13 -0
  156. package/src/idl/protocol_admin.json +1816 -0
  157. package/src/idl/single_token_liquidity.json +745 -0
  158. package/src/index.ts +154 -0
  159. package/src/math/cubicMath.ts +89 -0
  160. package/src/math/fixedPoint.ts +39 -0
  161. package/src/math/index.ts +6 -0
  162. package/src/math/logExp.ts +82 -0
  163. package/src/math/singleToken.ts +250 -0
  164. package/src/math/slippage.ts +49 -0
  165. package/src/math/weightedMath.ts +48 -0
  166. package/src/parsers/borsh.ts +80 -0
  167. package/src/parsers/events.ts +172 -0
  168. package/src/parsers/index.ts +4 -0
  169. package/src/parsers/mintAccount.ts +37 -0
  170. package/src/parsers/poolAccount.ts +113 -0
  171. package/src/types/events.ts +100 -0
  172. package/src/types/index.ts +4 -0
  173. package/src/types/pool.ts +64 -0
  174. package/src/types/result.ts +45 -0
  175. package/src/types/tx.ts +87 -0
  176. package/src/utils/errors.ts +78 -0
  177. package/src/utils/index.ts +3 -0
  178. package/src/utils/pda.ts +58 -0
  179. package/src/utils/retry.ts +85 -0
@@ -0,0 +1,83 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PoolFactoryClient = void 0;
4
+ const web3_js_1 = require("@solana/web3.js");
5
+ const result_1 = require("../types/result");
6
+ const tx_builders_1 = require("./tx-builders");
7
+ const pda_1 = require("../utils/pda");
8
+ /**
9
+ * Builds transactions for protocol governance / pool deployment. Consumed
10
+ * by the deploy-pool UI flow and by the backend's admin tools.
11
+ */
12
+ class PoolFactoryClient {
13
+ constructor(params) {
14
+ this.config = params.config;
15
+ }
16
+ /**
17
+ * Deploy a new pool atop an existing `CubicPoolConfig`. Caller is
18
+ * responsible for funding `params.payer` with enough SOL to cover rent
19
+ * for the pool account and the BPT mint PDA.
20
+ *
21
+ * Returns the `pool` and `bptMint` pubkeys it WILL create (derived PDAs)
22
+ * plus the signable tx.
23
+ */
24
+ buildDeployPoolTx(params) {
25
+ if (params.tokens.length < 2 || params.tokens.length > 10) {
26
+ return (0, result_1.err)("invalid_input", "tokens.length must be in [2, 10]");
27
+ }
28
+ if (params.tokens.length !== params.weightsBps.length) {
29
+ return (0, result_1.err)("invalid_input", "tokens/weightsBps length mismatch");
30
+ }
31
+ if (params.tokens.length !== params.virtualBalances.length) {
32
+ return (0, result_1.err)("invalid_input", "tokens/virtualBalances length mismatch");
33
+ }
34
+ const sum = params.weightsBps.reduce((a, b) => a + b, 0);
35
+ if (sum !== 10000)
36
+ return (0, result_1.err)("invalid_input", `weights must sum to 10000 (got ${sum})`);
37
+ for (const vb of params.virtualBalances) {
38
+ if (vb.isZero())
39
+ return (0, result_1.err)("invalid_input", "virtualBalances must all be > 0");
40
+ }
41
+ const [pool] = (0, pda_1.derivePoolPda)(this.config.programs.cubicPool, params.configKey, params.poolId);
42
+ const [bptMint] = web3_js_1.PublicKey.findProgramAddressSync([Buffer.from("bpt_mint"), pool.toBuffer()], this.config.programs.cubicPool);
43
+ try {
44
+ const tx = (0, tx_builders_1.buildDeployPoolTx)(this.config, params);
45
+ return (0, result_1.ok)({ ...tx, pool, bptMint });
46
+ }
47
+ catch (e) {
48
+ return (0, result_1.err)("tx_build_failed", "Failed to build deploy-pool tx", e);
49
+ }
50
+ }
51
+ /**
52
+ * Initialize a new CubicPoolConfig. The `config` signer must be freshly
53
+ * generated and paired with its keypair when signing the outer tx.
54
+ * Returns the tx + the config keypair the caller should sign with.
55
+ */
56
+ buildInitializeConfigTx(params) {
57
+ try {
58
+ const configKeypair = web3_js_1.Keypair.generate();
59
+ const ix = (0, tx_builders_1.buildInitializeConfigIx)(this.config, {
60
+ config: configKeypair.publicKey,
61
+ payer: params.payer,
62
+ defaultProtocolFeeRate: params.defaultProtocolFeeRate,
63
+ });
64
+ return (0, result_1.ok)({
65
+ instructions: [web3_js_1.ComputeBudgetProgram.setComputeUnitLimit({ units: 200000 }), ix],
66
+ suggestedCuLimit: 200000,
67
+ configKeypair,
68
+ });
69
+ }
70
+ catch (e) {
71
+ return (0, result_1.err)("tx_build_failed", "Failed to build initialize_config tx", e);
72
+ }
73
+ }
74
+ /**
75
+ * Low-level: return the raw `initialize_cubic_pool` ix without a CU
76
+ * budget or wrapping. Useful for combining with other ixs in the same tx.
77
+ */
78
+ initializeCubicPoolIx(params) {
79
+ return (0, tx_builders_1.buildInitializeCubicPoolIx)(this.config, params);
80
+ }
81
+ }
82
+ exports.PoolFactoryClient = PoolFactoryClient;
83
+ //# sourceMappingURL=PoolFactoryClient.js.map
@@ -0,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,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,OAAO,IAAA,YAAG,EAAC,iBAAiB,EAAE,sCAAsC,EAAE,CAAC,CAAC,CAAC;QAC3E,CAAC;IACH,CAAC;IAED;;;OAGG;IACH,qBAAqB,CAAC,MAAwB;QAC5C,OAAO,IAAA,wCAA0B,EAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzD,CAAC;CACF;AA5ED,8CA4EC"}
@@ -0,0 +1,28 @@
1
+ import { Commitment, Connection, PublicKey } from "@solana/web3.js";
2
+ import { SdkResult } from "../types/result";
3
+ import { RetryOptions } from "../utils/retry";
4
+ export interface RpcClientParams {
5
+ endpoint: string;
6
+ apiKey?: string;
7
+ commitment?: Commitment;
8
+ /** Optional headers (e.g. for Helius/Triton auth). */
9
+ headers?: Record<string, string>;
10
+ }
11
+ /**
12
+ * Thin wrapper around `@solana/web3.js` Connection with built-in retry +
13
+ * human-readable error mapping. Every public method returns a SdkResult<T>.
14
+ */
15
+ export declare class RpcClient {
16
+ readonly connection: Connection;
17
+ private readonly defaultCommitment;
18
+ constructor(params: RpcClientParams);
19
+ call<T>(fn: (conn: Connection) => Promise<T>, retry?: RetryOptions): Promise<SdkResult<T>>;
20
+ getAccountInfo(pk: PublicKey, retry?: RetryOptions): Promise<SdkResult<{
21
+ data: Buffer;
22
+ owner: PublicKey;
23
+ lamports: number;
24
+ } | null>>;
25
+ getMultipleAccountsInfo(pks: PublicKey[], retry?: RetryOptions): Promise<SdkResult<(Buffer | null)[]>>;
26
+ getSlot(retry?: RetryOptions): Promise<SdkResult<number>>;
27
+ }
28
+ //# sourceMappingURL=RpcClient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RpcClient.d.ts","sourceRoot":"","sources":["../../src/clients/RpcClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACpE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAY,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAExD,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,sDAAsD;IACtD,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC;AAED;;;GAGG;AACH,qBAAa,SAAS;IACpB,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;IAChC,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAa;gBAEnC,MAAM,EAAE,eAAe;IAWnC,IAAI,CAAC,CAAC,EACJ,EAAE,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,OAAO,CAAC,CAAC,CAAC,EACpC,KAAK,GAAE,YAAiB,GACvB,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IAIxB,cAAc,CACZ,EAAE,EAAE,SAAS,EACb,KAAK,GAAE,YAAiB,GACvB,OAAO,CAAC,SAAS,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,SAAS,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC,CAAC;IAYlF,uBAAuB,CACrB,GAAG,EAAE,SAAS,EAAE,EAChB,KAAK,GAAE,YAAiB,GACvB,OAAO,CAAC,SAAS,CAAC,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC;IAOxC,OAAO,CAAC,KAAK,GAAE,YAAiB,GAAG,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;CAG9D"}
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RpcClient = void 0;
4
+ const web3_js_1 = require("@solana/web3.js");
5
+ const retry_1 = require("../utils/retry");
6
+ /**
7
+ * Thin wrapper around `@solana/web3.js` Connection with built-in retry +
8
+ * human-readable error mapping. Every public method returns a SdkResult<T>.
9
+ */
10
+ class RpcClient {
11
+ constructor(params) {
12
+ const endpoint = params.apiKey
13
+ ? appendApiKey(params.endpoint, params.apiKey)
14
+ : params.endpoint;
15
+ this.defaultCommitment = params.commitment ?? "confirmed";
16
+ this.connection = new web3_js_1.Connection(endpoint, {
17
+ commitment: this.defaultCommitment,
18
+ httpHeaders: params.headers,
19
+ });
20
+ }
21
+ call(fn, retry = {}) {
22
+ return (0, retry_1.safeCall)(() => fn(this.connection), retry);
23
+ }
24
+ getAccountInfo(pk, retry = {}) {
25
+ return (0, retry_1.safeCall)(async () => {
26
+ const info = await this.connection.getAccountInfo(pk, this.defaultCommitment);
27
+ if (!info)
28
+ return null;
29
+ return {
30
+ data: info.data,
31
+ owner: info.owner,
32
+ lamports: info.lamports,
33
+ };
34
+ }, retry);
35
+ }
36
+ getMultipleAccountsInfo(pks, retry = {}) {
37
+ return (0, retry_1.safeCall)(async () => {
38
+ const infos = await this.connection.getMultipleAccountsInfo(pks, this.defaultCommitment);
39
+ return infos.map((i) => (i ? i.data : null));
40
+ }, retry);
41
+ }
42
+ getSlot(retry = {}) {
43
+ return (0, retry_1.safeCall)(() => this.connection.getSlot(this.defaultCommitment), retry);
44
+ }
45
+ }
46
+ exports.RpcClient = RpcClient;
47
+ function appendApiKey(endpoint, apiKey) {
48
+ try {
49
+ const u = new URL(endpoint);
50
+ u.searchParams.set("api-key", apiKey);
51
+ return u.toString();
52
+ }
53
+ catch {
54
+ const sep = endpoint.includes("?") ? "&" : "?";
55
+ return `${endpoint}${sep}api-key=${encodeURIComponent(apiKey)}`;
56
+ }
57
+ }
58
+ //# sourceMappingURL=RpcClient.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RpcClient.js","sourceRoot":"","sources":["../../src/clients/RpcClient.ts"],"names":[],"mappings":";;;AAAA,6CAAoE;AAEpE,0CAAwD;AAUxD;;;G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CAAC,iBAAiB,CAAC,CAAC;YACzF,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;QAC/C,CAAC,EAAE,KAAK,CAAC,CAAC;IACZ,CAAC;IAED,OAAO,CAAC,QAAsB,EAAE;QAC9B,OAAO,IAAA,gBAAQ,EAAC,GAAG,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,iBAAiB,CAAC,EAAE,KAAK,CAAC,CAAC;IAChF,CAAC;CACF;AAlDD,8BAkDC;AAED,SAAS,YAAY,CAAC,QAAgB,EAAE,MAAc;IACpD,IAAI,CAAC;QACH,MAAM,CAAC,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,CAAC;QAC5B,CAAC,CAAC,YAAY,CAAC,GAAG,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;QACtC,OAAO,CAAC,CAAC,QAAQ,EAAE,CAAC;IACtB,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,GAAG,GAAG,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;QAC/C,OAAO,GAAG,QAAQ,GAAG,GAAG,WAAW,kBAAkB,CAAC,MAAM,CAAC,EAAE,CAAC;IAClE,CAAC;AACH,CAAC"}
@@ -0,0 +1,45 @@
1
+ import { Commitment, PublicKey } from "@solana/web3.js";
2
+ import BN from "bn.js";
3
+ import { CubeConfig } from "../config";
4
+ import { PoolInfo } from "../types/pool";
5
+ import { SdkResult } from "../types/result";
6
+ import { BuiltTx, SingleTokenDepositParams, SingleTokenDepositQuote } from "../types/tx";
7
+ import { RpcClient } from "./RpcClient";
8
+ import { CubicPoolClient } from "./CubicPoolClient";
9
+ export interface SingleTokenDepositClientParams {
10
+ config: CubeConfig;
11
+ poolAddress: PublicKey;
12
+ /** Optional — reuses an existing one if provided. */
13
+ rpc?: RpcClient | {
14
+ endpoint: string;
15
+ apiKey?: string;
16
+ commitment?: Commitment;
17
+ };
18
+ /**
19
+ * Optional parent pool client — lets the deposit client reuse an already
20
+ * synced PoolInfo instead of making a fresh RPC round-trip.
21
+ */
22
+ poolClient?: CubicPoolClient;
23
+ }
24
+ /**
25
+ * Convenience class that wraps the single-token deposit flow end-to-end:
26
+ * quoting, transaction building, and helper-PDA derivation.
27
+ *
28
+ * Most consumers don't need to instantiate this directly — they can call
29
+ * `CubicPoolClient.singleTokenDeposit.*` which proxies here.
30
+ */
31
+ export declare class SingleTokenDepositClient {
32
+ readonly config: CubeConfig;
33
+ readonly poolAddress: PublicKey;
34
+ private readonly poolClient;
35
+ constructor(params: SingleTokenDepositClientParams);
36
+ /** Derived helper PDA for this pool. */
37
+ helperPda(): PublicKey;
38
+ /** Ensure pool state is loaded; populates the underlying CubicPoolClient cache. */
39
+ sync(): Promise<SdkResult<PoolInfo>>;
40
+ /** Off-chain estimate of the deposit outcome. */
41
+ quote(tokenInIndex: number, amountIn: BN, slippageHundredthsBps?: number): SdkResult<SingleTokenDepositQuote>;
42
+ /** Build a ready-to-sign transaction. Includes idempotent helper-ATA creates. */
43
+ buildTx(params: SingleTokenDepositParams): SdkResult<BuiltTx>;
44
+ }
45
+ //# sourceMappingURL=SingleTokenDepositClient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SingleTokenDepositClient.d.ts","sourceRoot":"","sources":["../../src/clients/SingleTokenDepositClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,MAAM,OAAO,CAAC;AACvB,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,SAAS,EAAW,MAAM,iBAAiB,CAAC;AACrD,OAAO,EACL,OAAO,EACP,wBAAwB,EACxB,uBAAuB,EACxB,MAAM,aAAa,CAAC;AAGrB,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,MAAM,WAAW,8BAA8B;IAC7C,MAAM,EAAE,UAAU,CAAC;IACnB,WAAW,EAAE,SAAS,CAAC;IACvB,qDAAqD;IACrD,GAAG,CAAC,EAAE,SAAS,GAAG;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,UAAU,CAAA;KAAE,CAAC;IACjF;;;OAGG;IACH,UAAU,CAAC,EAAE,eAAe,CAAC;CAC9B;AAED;;;;;;GAMG;AACH,qBAAa,wBAAwB;IACnC,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;IAC5B,QAAQ,CAAC,WAAW,EAAE,SAAS,CAAC;IAChC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAkB;gBAEjC,MAAM,EAAE,8BAA8B;IAiBlD,wCAAwC;IACxC,SAAS,IAAI,SAAS;IAItB,mFAAmF;IAC7E,IAAI,IAAI,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;IAI1C,iDAAiD;IACjD,KAAK,CACH,YAAY,EAAE,MAAM,EACpB,QAAQ,EAAE,EAAE,EACZ,qBAAqB,CAAC,EAAE,MAAM,GAC7B,SAAS,CAAC,uBAAuB,CAAC;IAIrC,iFAAiF;IACjF,OAAO,CAAC,MAAM,EAAE,wBAAwB,GAAG,SAAS,CAAC,OAAO,CAAC;CAc9D"}
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SingleTokenDepositClient = void 0;
4
+ const result_1 = require("../types/result");
5
+ const pda_1 = require("../utils/pda");
6
+ const tx_builders_1 = require("./tx-builders");
7
+ const CubicPoolClient_1 = require("./CubicPoolClient");
8
+ /**
9
+ * Convenience class that wraps the single-token deposit flow end-to-end:
10
+ * quoting, transaction building, and helper-PDA derivation.
11
+ *
12
+ * Most consumers don't need to instantiate this directly — they can call
13
+ * `CubicPoolClient.singleTokenDeposit.*` which proxies here.
14
+ */
15
+ class SingleTokenDepositClient {
16
+ constructor(params) {
17
+ this.config = params.config;
18
+ this.poolAddress = params.poolAddress;
19
+ this.poolClient =
20
+ params.poolClient ??
21
+ new CubicPoolClient_1.CubicPoolClient({
22
+ config: params.config,
23
+ poolAddress: params.poolAddress,
24
+ rpc: params.rpc ??
25
+ {
26
+ endpoint: params.config.defaults.rpcEndpoint,
27
+ commitment: params.config.defaults.rpcCommitment,
28
+ },
29
+ });
30
+ }
31
+ /** Derived helper PDA for this pool. */
32
+ helperPda() {
33
+ return (0, pda_1.deriveHelperPda)(this.config.programs.singleTokenLiquidity, this.poolAddress)[0];
34
+ }
35
+ /** Ensure pool state is loaded; populates the underlying CubicPoolClient cache. */
36
+ async sync() {
37
+ return this.poolClient.sync();
38
+ }
39
+ /** Off-chain estimate of the deposit outcome. */
40
+ quote(tokenInIndex, amountIn, slippageHundredthsBps) {
41
+ return this.poolClient.quoteSingleTokenDeposit(tokenInIndex, amountIn, slippageHundredthsBps);
42
+ }
43
+ /** Build a ready-to-sign transaction. Includes idempotent helper-ATA creates. */
44
+ buildTx(params) {
45
+ const pool = this.poolClient.getCached();
46
+ if (!pool)
47
+ return (0, result_1.err)("invalid_input", "Call sync() first to populate pool state");
48
+ if (params.tokenInIndex < 0 || params.tokenInIndex >= pool.tokenCount) {
49
+ return (0, result_1.err)("invalid_input", "Invalid tokenInIndex");
50
+ }
51
+ if (params.amountIn.lten(0))
52
+ return (0, result_1.err)("invalid_input", "amountIn must be > 0");
53
+ try {
54
+ const tx = (0, tx_builders_1.buildSingleTokenDepositTx)(this.config, pool, params);
55
+ return (0, result_1.ok)(tx);
56
+ }
57
+ catch (e) {
58
+ return (0, result_1.err)("tx_build_failed", "Failed to build single-token deposit tx", e);
59
+ }
60
+ }
61
+ }
62
+ exports.SingleTokenDepositClient = SingleTokenDepositClient;
63
+ //# sourceMappingURL=SingleTokenDepositClient.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SingleTokenDepositClient.js","sourceRoot":"","sources":["../../src/clients/SingleTokenDepositClient.ts"],"names":[],"mappings":";;;AAIA,4CAAqD;AAMrD,sCAA+C;AAC/C,+CAA0D;AAE1D,uDAAoD;AAcpD;;;;;;GAMG;AACH,MAAa,wBAAwB;IAKnC,YAAY,MAAsC;QAChD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QAC5B,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC;QACtC,IAAI,CAAC,UAAU;YACb,MAAM,CAAC,UAAU;gBACjB,IAAI,iCAAe,CAAC;oBAClB,MAAM,EAAE,MAAM,CAAC,MAAM;oBACrB,WAAW,EAAE,MAAM,CAAC,WAAW;oBAC/B,GAAG,EACD,MAAM,CAAC,GAAG;wBACV;4BACE,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,WAAW;4BAC5C,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,aAAa;yBACjD;iBACJ,CAAC,CAAC;IACP,CAAC;IAED,wCAAwC;IACxC,SAAS;QACP,OAAO,IAAA,qBAAe,EAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,oBAAoB,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;IACzF,CAAC;IAED,mFAAmF;IACnF,KAAK,CAAC,IAAI;QACR,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC;IAChC,CAAC;IAED,iDAAiD;IACjD,KAAK,CACH,YAAoB,EACpB,QAAY,EACZ,qBAA8B;QAE9B,OAAO,IAAI,CAAC,UAAU,CAAC,uBAAuB,CAAC,YAAY,EAAE,QAAQ,EAAE,qBAAqB,CAAC,CAAC;IAChG,CAAC;IAED,iFAAiF;IACjF,OAAO,CAAC,MAAgC;QACtC,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,SAAS,EAAE,CAAC;QACzC,IAAI,CAAC,IAAI;YAAE,OAAO,IAAA,YAAG,EAAC,eAAe,EAAE,0CAA0C,CAAC,CAAC;QACnF,IAAI,MAAM,CAAC,YAAY,GAAG,CAAC,IAAI,MAAM,CAAC,YAAY,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YACtE,OAAO,IAAA,YAAG,EAAC,eAAe,EAAE,sBAAsB,CAAC,CAAC;QACtD,CAAC;QACD,IAAI,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;YAAE,OAAO,IAAA,YAAG,EAAC,eAAe,EAAE,sBAAsB,CAAC,CAAC;QACjF,IAAI,CAAC;YACH,MAAM,EAAE,GAAG,IAAA,uCAAyB,EAAC,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;YAChE,OAAO,IAAA,WAAE,EAAC,EAAE,CAAC,CAAC;QAChB,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,OAAO,IAAA,YAAG,EAAC,iBAAiB,EAAE,yCAAyC,EAAE,CAAC,CAAC,CAAC;QAC9E,CAAC;IACH,CAAC;CACF;AAxDD,4DAwDC"}
@@ -0,0 +1,8 @@
1
+ export * from "./RpcClient";
2
+ export * from "./CubeBackendClient";
3
+ export * from "./CubicPoolClient";
4
+ export * from "./tx-builders";
5
+ export * from "./SingleTokenDepositClient";
6
+ export * from "./PoolFactoryClient";
7
+ export * from "./AdminClient";
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/clients/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./RpcClient"), exports);
18
+ __exportStar(require("./CubeBackendClient"), exports);
19
+ __exportStar(require("./CubicPoolClient"), exports);
20
+ __exportStar(require("./tx-builders"), exports);
21
+ __exportStar(require("./SingleTokenDepositClient"), exports);
22
+ __exportStar(require("./PoolFactoryClient"), exports);
23
+ __exportStar(require("./AdminClient"), exports);
24
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/clients/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,sDAAoC;AACpC,oDAAkC;AAClC,gDAA8B;AAC9B,6DAA2C;AAC3C,sDAAoC;AACpC,gDAA8B"}
@@ -0,0 +1,32 @@
1
+ import { PublicKey, TransactionInstruction } from "@solana/web3.js";
2
+ import BN from "bn.js";
3
+ import { CubeConfig } from "../config";
4
+ import { PoolInfo } from "../types/pool";
5
+ import { AddLiquidityParams, BuiltTx, DeployPoolParams, RemoveLiquidityParams, SingleTokenDepositParams, SwapParams } from "../types/tx";
6
+ export declare function buildSwapIx(cfg: CubeConfig, pool: PoolInfo, params: SwapParams & {
7
+ minAmountOut: BN;
8
+ }): TransactionInstruction;
9
+ export declare function buildSwapTx(cfg: CubeConfig, pool: PoolInfo, params: SwapParams & {
10
+ minAmountOut: BN;
11
+ }): BuiltTx;
12
+ export declare function buildAddLiquidityIx(cfg: CubeConfig, pool: PoolInfo, params: AddLiquidityParams): TransactionInstruction;
13
+ export declare function buildAddLiquidityTx(cfg: CubeConfig, pool: PoolInfo, params: AddLiquidityParams): BuiltTx;
14
+ export declare function buildRemoveLiquidityIx(cfg: CubeConfig, pool: PoolInfo, params: RemoveLiquidityParams): TransactionInstruction;
15
+ export declare function buildRemoveLiquidityTx(cfg: CubeConfig, pool: PoolInfo, params: RemoveLiquidityParams): BuiltTx;
16
+ export declare function buildSingleTokenDepositIx(cfg: CubeConfig, pool: PoolInfo, params: SingleTokenDepositParams): TransactionInstruction;
17
+ /**
18
+ * Full single-token deposit tx: makes sure helper ATAs and the user's
19
+ * per-token ATAs exist (idempotent create instructions), creates the user's
20
+ * BPT ATA if absent, then the deposit ix itself. The helper program validates
21
+ * all user ATAs up front because it may refund dust for any pool token.
22
+ * CU limit set to 1.4M (mainnet/devnet max).
23
+ */
24
+ export declare function buildSingleTokenDepositTx(cfg: CubeConfig, pool: PoolInfo, params: SingleTokenDepositParams): BuiltTx;
25
+ export declare function buildInitializeConfigIx(cfg: CubeConfig, params: {
26
+ config: PublicKey;
27
+ payer: PublicKey;
28
+ defaultProtocolFeeRate: number;
29
+ }): TransactionInstruction;
30
+ export declare function buildInitializeCubicPoolIx(cfg: CubeConfig, params: DeployPoolParams): TransactionInstruction;
31
+ export declare function buildDeployPoolTx(cfg: CubeConfig, params: DeployPoolParams): BuiltTx;
32
+ //# sourceMappingURL=tx-builders.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tx-builders.d.ts","sourceRoot":"","sources":["../../src/clients/tx-builders.ts"],"names":[],"mappings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