@cubee_ee/sdk 0.1.3 → 0.1.6
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.
- package/README.md +30 -5
- package/dist/clients/CubeBackendClient.d.ts +41 -2
- package/dist/clients/CubeBackendClient.d.ts.map +1 -1
- package/dist/clients/CubeBackendClient.js +10 -0
- package/dist/clients/CubeBackendClient.js.map +1 -1
- package/dist/clients/CubicPoolClient.d.ts +5 -2
- package/dist/clients/CubicPoolClient.d.ts.map +1 -1
- package/dist/clients/CubicPoolClient.js +6 -3
- package/dist/clients/CubicPoolClient.js.map +1 -1
- package/dist/clients/RpcClient.d.ts +18 -2
- package/dist/clients/RpcClient.d.ts.map +1 -1
- package/dist/clients/RpcClient.js +85 -14
- package/dist/clients/RpcClient.js.map +1 -1
- package/dist/clients/SingleTokenDepositClient.d.ts +4 -1
- package/dist/clients/SingleTokenDepositClient.d.ts.map +1 -1
- package/dist/clients/SingleTokenDepositClient.js +2 -1
- package/dist/clients/SingleTokenDepositClient.js.map +1 -1
- package/dist/config/index.d.ts +4 -0
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +16 -1
- package/dist/config/index.js.map +1 -1
- package/dist/config/networks.d.ts +2 -0
- package/dist/config/networks.d.ts.map +1 -1
- package/dist/config/networks.js +11 -1
- package/dist/config/networks.js.map +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -5
- package/dist/index.js.map +1 -1
- package/dist/utils/errors.js +1 -1
- package/dist/utils/errors.js.map +1 -1
- package/package.json +1 -1
- package/src/clients/CubeBackendClient.ts +61 -2
- package/src/clients/CubicPoolClient.ts +11 -5
- package/src/clients/RpcClient.ts +123 -16
- package/src/clients/SingleTokenDepositClient.ts +10 -2
- package/src/config/index.ts +30 -2
- package/src/config/networks.ts +12 -0
- package/src/index.ts +13 -4
- package/src/utils/errors.ts +1 -1
package/src/index.ts
CHANGED
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
// See LICENSE at the repository root.
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
* @
|
|
6
|
+
* @cubee_ee/sdk — client library for the Cubic Pool AMM on Solana.
|
|
7
7
|
*
|
|
8
8
|
* Entry point barrel. Most consumers will want to import from this root:
|
|
9
9
|
*
|
|
10
10
|
* ```ts
|
|
11
|
-
* import { CubicPoolClient, CubeBackendClient, getConfig } from "@
|
|
11
|
+
* import { CubicPoolClient, CubeBackendClient, getConfig } from "@cubee_ee/sdk";
|
|
12
12
|
*
|
|
13
13
|
* const cfg = getConfig("mainnet", { backendEndpoint: "https://api.cube.fi" });
|
|
14
|
-
* const pool = new CubicPoolClient({ config: cfg, poolAddress
|
|
14
|
+
* const pool = new CubicPoolClient({ config: cfg, poolAddress });
|
|
15
15
|
* const info = await pool.sync();
|
|
16
16
|
* if (info.ok) console.log(info.data.tokens.map(t => t.metadata?.symbol));
|
|
17
17
|
* ```
|
|
@@ -48,7 +48,12 @@ export {
|
|
|
48
48
|
SLIPPAGE_PRECISION,
|
|
49
49
|
MIN_SLIPPAGE_HBPS,
|
|
50
50
|
} from "./config";
|
|
51
|
-
export {
|
|
51
|
+
export {
|
|
52
|
+
NETWORK_PROGRAMS,
|
|
53
|
+
DEFAULT_RPC_ENDPOINT,
|
|
54
|
+
DEFAULT_RPC_ENDPOINTS,
|
|
55
|
+
DEFAULT_RPC_TIMEOUT_MS,
|
|
56
|
+
} from "./config/networks";
|
|
52
57
|
export { KNOWN_TOKENS, resolveKnownToken } from "./config/tokens";
|
|
53
58
|
export { ok, err } from "./types/result";
|
|
54
59
|
export {
|
|
@@ -150,6 +155,10 @@ export type {
|
|
|
150
155
|
LeaderboardEntry,
|
|
151
156
|
LeaderboardResponse,
|
|
152
157
|
LeaderboardUserStats,
|
|
158
|
+
XpAccrualHistoryEntry,
|
|
159
|
+
XpAccrualHistoryResponse,
|
|
160
|
+
EpochHistoryEntry,
|
|
161
|
+
LeaderboardEpochResponse,
|
|
153
162
|
CubicPoolClientParams,
|
|
154
163
|
SingleTokenDepositClientParams,
|
|
155
164
|
PoolFactoryClientParams,
|
package/src/utils/errors.ts
CHANGED
|
@@ -41,7 +41,7 @@ export function toSdkError(cause: unknown): SdkError {
|
|
|
41
41
|
if (/429|rate limit/i.test(msg)) {
|
|
42
42
|
return { code: "rpc_rate_limited", humanMessage: "RPC rate-limited — slow down", cause };
|
|
43
43
|
}
|
|
44
|
-
if (/fetch failed|ECONNREFUSED|ENOTFOUND/i.test(msg)) {
|
|
44
|
+
if (/fetch failed|ECONNREFUSED|ENOTFOUND|Proxy error|-32056|-32052|403/i.test(msg)) {
|
|
45
45
|
return { code: "rpc_unavailable", humanMessage: "RPC endpoint unreachable", cause };
|
|
46
46
|
}
|
|
47
47
|
if (/Account does not exist|account not found/i.test(msg)) {
|