@candledottv/agent-sdk 0.4.5 → 0.4.7
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 +80 -16
- package/dist/client.d.ts +499 -22
- package/dist/client.d.ts.map +1 -1
- package/dist/hyperliquid-pnl.d.ts +34 -0
- package/dist/hyperliquid-pnl.d.ts.map +1 -0
- package/dist/hyperliquid.d.ts +116 -0
- package/dist/hyperliquid.d.ts.map +1 -0
- package/dist/index.d.ts +5 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +759 -1
- package/dist/plans.d.ts +103 -0
- package/dist/plans.d.ts.map +1 -0
- package/package.json +2 -1
package/dist/plans.d.ts
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The served plan table (Plans v2, PL-ED-1 and PL-ED-14): its types and one way to render it.
|
|
3
|
+
*
|
|
4
|
+
* `GET /api/v1/agent/plans` (no credential) and the `planTable` field of `GET /api/v1/agent/tier`
|
|
5
|
+
* return the table in force on the deployment that answered: each plan's price, agent fee, perps
|
|
6
|
+
* builder fee, the limits a new key gets, and what the plan can do. A client quotes these numbers
|
|
7
|
+
* rather than numbers it bundled, so it never shows a price or a fee the server is not charging.
|
|
8
|
+
*
|
|
9
|
+
* Dependency-free on purpose. The CLI and the MCP server carry byte-identical copies
|
|
10
|
+
* (`plans.drift.test.ts` in each), and the repo's docs freshness gate renders the docs plan table
|
|
11
|
+
* through this file, so the CLI, the MCP text and the docs say the same thing in the same words.
|
|
12
|
+
* Copy any change verbatim: `cp packages/sdk/src/plans.ts packages/cli/src/plans.ts` and the same
|
|
13
|
+
* for `packages/mcp/src/plans.ts`.
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* A plan name. `believer` is served only by a deployment that has not switched to the three plans
|
|
17
|
+
* (Free, Pro, Max); it is accepted here for one release after that launch, then removed.
|
|
18
|
+
*/
|
|
19
|
+
export type PlanName = "free" | "pro" | "max" | "believer";
|
|
20
|
+
/** A sold plan's price, in the shape the tier response's `maxPricing` has always had. */
|
|
21
|
+
export interface PlanPrice {
|
|
22
|
+
pricePerMonthUsd: number;
|
|
23
|
+
currency: string;
|
|
24
|
+
approval: string;
|
|
25
|
+
}
|
|
26
|
+
/** What a freshly issued key on the plan gets. Enforcement never lowers a key set higher by hand. */
|
|
27
|
+
export interface PlanLimits {
|
|
28
|
+
rateLimitPerMin: number;
|
|
29
|
+
dailyLaunchCap: number;
|
|
30
|
+
uploadsPerMin: number;
|
|
31
|
+
/** Linked wallets the account may have active at once. */
|
|
32
|
+
linkedWallets: number;
|
|
33
|
+
}
|
|
34
|
+
/** What a plan can do, one flag per gate the API enforces (PL-ED-14). */
|
|
35
|
+
export interface PlanCapabilities {
|
|
36
|
+
/** Buy a token that was not launched on Candle and is not a base asset. */
|
|
37
|
+
buyExternalTokens: boolean;
|
|
38
|
+
/** Sell such a token. True on every plan, so losing a plan never traps a position. */
|
|
39
|
+
sellExternalTokens: boolean;
|
|
40
|
+
tradeBaseAssets: boolean;
|
|
41
|
+
tradeCandleTokens: boolean;
|
|
42
|
+
selfLaunch: boolean;
|
|
43
|
+
atomicLaunch: boolean;
|
|
44
|
+
createLinkedWallets: boolean;
|
|
45
|
+
importLinkedWallets: boolean;
|
|
46
|
+
/** Plan eligibility only: whether perps are open on the deployment is its own switch, and trading needs the wallet and scopes. */
|
|
47
|
+
hyperliquidPerps: boolean;
|
|
48
|
+
limitOrders: boolean;
|
|
49
|
+
/** The quant bot on Telegram. */
|
|
50
|
+
quant: boolean;
|
|
51
|
+
/** Base-pair swaps and base-asset bridges between the key's own wallets carry no Candle fee. A bridge also needs its own deployment switch. */
|
|
52
|
+
freeBaseTransfers: boolean;
|
|
53
|
+
}
|
|
54
|
+
export interface PlanTableEntry {
|
|
55
|
+
plan: PlanName;
|
|
56
|
+
/**
|
|
57
|
+
* Absent from a deployment that predates the capability table. A newer deployment may add a
|
|
58
|
+
* capability this release does not name; `planTableRows` shows it under its own key.
|
|
59
|
+
*/
|
|
60
|
+
capabilities?: PlanCapabilities;
|
|
61
|
+
/** The agent platform fee this deployment charges, in basis points, overrides included. */
|
|
62
|
+
feeBps: number;
|
|
63
|
+
/** The Hyperliquid perps builder fee, in basis points. */
|
|
64
|
+
perpFeeBps: number;
|
|
65
|
+
/** Null when the plan is not sold: Free, Believer, and Pro before the three-plan launch. */
|
|
66
|
+
price: PlanPrice | null;
|
|
67
|
+
limits: PlanLimits;
|
|
68
|
+
}
|
|
69
|
+
export interface PlanTable {
|
|
70
|
+
plans: PlanTableEntry[];
|
|
71
|
+
/** Days of Max a first Pro purchase grants. 0 when there is no promotion. */
|
|
72
|
+
promoMaxDays: number;
|
|
73
|
+
}
|
|
74
|
+
/** `GET /api/v1/agent/plans`. */
|
|
75
|
+
export interface AgentPlansResult extends PlanTable {
|
|
76
|
+
success: true;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* What a capability "yes" means. It is the plan's eligibility, not a statement that the deployment has
|
|
80
|
+
* the feature switched on, so perps and own-wallet bridges say "when enabled" in their labels.
|
|
81
|
+
*/
|
|
82
|
+
export declare const PLAN_CAPABILITY_NOTE = "A capability marked yes is what the plan allows. It is subject to the deployment's own switches (perps and own-wallet bridges each have one) and to the wallet, scopes and setup the feature needs.";
|
|
83
|
+
/** The row label for each capability, in the order the rows are shown. */
|
|
84
|
+
export declare const PLAN_CAPABILITY_LABELS: Record<keyof PlanCapabilities, string>;
|
|
85
|
+
/** "Free", "Pro", "Max", "Believer"; an unknown name as served. */
|
|
86
|
+
export declare function planLabel(plan: string): string;
|
|
87
|
+
/** Basis points as a percentage: 100 is "1%", 25 is "0.25%", 0 is "none". */
|
|
88
|
+
export declare function formatPlanBps(bps: number): string;
|
|
89
|
+
/**
|
|
90
|
+
* The table as rows of text cells: a header row of plan names, then price, fees, limits and one
|
|
91
|
+
* row per capability. The CLI prints it as a terminal table and the docs as a Markdown table.
|
|
92
|
+
* Capabilities this release does not name are appended under their own key, so a newer server's
|
|
93
|
+
* additions are shown rather than dropped.
|
|
94
|
+
*/
|
|
95
|
+
export declare function planTableRows(table: PlanTable): {
|
|
96
|
+
headers: string[];
|
|
97
|
+
rows: string[][];
|
|
98
|
+
};
|
|
99
|
+
/** The promotion as a sentence, or null when there is none. */
|
|
100
|
+
export declare function planPromotionLine(table: PlanTable): string | null;
|
|
101
|
+
/** The table as Markdown: what the MCP tool returns beside the JSON, and what the docs embed. */
|
|
102
|
+
export declare function planTableMarkdown(table: PlanTable): string;
|
|
103
|
+
//# sourceMappingURL=plans.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plans.d.ts","sourceRoot":"","sources":["../src/plans.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH;;;GAGG;AACH,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,KAAK,GAAG,KAAK,GAAG,UAAU,CAAA;AAE1D,yFAAyF;AACzF,MAAM,WAAW,SAAS;IACxB,gBAAgB,EAAE,MAAM,CAAA;IACxB,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED,qGAAqG;AACrG,MAAM,WAAW,UAAU;IACzB,eAAe,EAAE,MAAM,CAAA;IACvB,cAAc,EAAE,MAAM,CAAA;IACtB,aAAa,EAAE,MAAM,CAAA;IACrB,0DAA0D;IAC1D,aAAa,EAAE,MAAM,CAAA;CACtB;AAED,yEAAyE;AACzE,MAAM,WAAW,gBAAgB;IAC/B,2EAA2E;IAC3E,iBAAiB,EAAE,OAAO,CAAA;IAC1B,sFAAsF;IACtF,kBAAkB,EAAE,OAAO,CAAA;IAC3B,eAAe,EAAE,OAAO,CAAA;IACxB,iBAAiB,EAAE,OAAO,CAAA;IAC1B,UAAU,EAAE,OAAO,CAAA;IACnB,YAAY,EAAE,OAAO,CAAA;IACrB,mBAAmB,EAAE,OAAO,CAAA;IAC5B,mBAAmB,EAAE,OAAO,CAAA;IAC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G;AACjG,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAI1D"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@candledottv/agent-sdk",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.7",
|
|
4
4
|
"description": "TypeScript SDK for the Candle agent rail: typed headless launches, market reads, and webhook verification",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -49,6 +49,7 @@
|
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@hpke/chacha20poly1305": "^1.6.2",
|
|
51
51
|
"@hpke/core": "^1.7.2",
|
|
52
|
+
"@noble/hashes": "1.8.0",
|
|
52
53
|
"@scure/base": "^1.2.6",
|
|
53
54
|
"canonicalize": "^2.1.0"
|
|
54
55
|
},
|