@keelcodes/sdk 2.0.0 → 2.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.
package/dist/account.d.ts CHANGED
@@ -47,4 +47,27 @@ export declare class AccountAPI {
47
47
  subscribe: (p: SubscriptionParams) => Promise<SubscriptionResult>;
48
48
  cancel: (module: KeelModule) => Promise<unknown>;
49
49
  };
50
+ /** 创建提现(钱包签名;启用 TOTP 时需带 `totpCode`)。 */
51
+ withdraw(p: {
52
+ externalUserId: string;
53
+ toAddress: string;
54
+ amount: string;
55
+ token?: string;
56
+ totpCode?: string;
57
+ }): Promise<Record<string, unknown>>;
58
+ /** 提现列表(可选 `x-api-key`;无租户上下文时返回空列表 + 热钱包概况)。 */
59
+ withdrawals(p?: {
60
+ status?: string;
61
+ limit?: number;
62
+ offset?: number;
63
+ }): Promise<Record<string, unknown>>;
64
+ /** 租户余额总览(需配置 `tenantApiKey`)。 */
65
+ balances(): Promise<Record<string, unknown>>;
66
+ /** 租户交易流水(需配置 `tenantApiKey`)。 */
67
+ transactions(p?: {
68
+ limit?: number;
69
+ offset?: number;
70
+ }): Promise<Record<string, unknown>>;
71
+ /** 租户热钱包各链原生余额(需配置 `tenantApiKey`)。 */
72
+ hotWalletBalances(): Promise<Record<string, unknown>>;
50
73
  }
package/dist/account.js CHANGED
@@ -22,5 +22,39 @@ class AccountAPI {
22
22
  cancel: (module) => this.http.post('/v1/account/subscription/cancel', { module }),
23
23
  };
24
24
  }
25
+ /** 创建提现(钱包签名;启用 TOTP 时需带 `totpCode`)。 */
26
+ withdraw(p) {
27
+ return this.http.post('/v1/account/withdraw', p);
28
+ }
29
+ /** 提现列表(可选 `x-api-key`;无租户上下文时返回空列表 + 热钱包概况)。 */
30
+ withdrawals(p = {}) {
31
+ const q = new URLSearchParams();
32
+ if (p.status)
33
+ q.set('status', p.status);
34
+ if (p.limit)
35
+ q.set('limit', String(p.limit));
36
+ if (p.offset)
37
+ q.set('offset', String(p.offset));
38
+ const qs = q.toString();
39
+ return this.http.get('/v1/account/withdrawals' + (qs ? '?' + qs : ''));
40
+ }
41
+ /** 租户余额总览(需配置 `tenantApiKey`)。 */
42
+ balances() {
43
+ return this.http.get('/v1/account/balances');
44
+ }
45
+ /** 租户交易流水(需配置 `tenantApiKey`)。 */
46
+ transactions(p = {}) {
47
+ const q = new URLSearchParams();
48
+ if (p.limit)
49
+ q.set('limit', String(p.limit));
50
+ if (p.offset)
51
+ q.set('offset', String(p.offset));
52
+ const qs = q.toString();
53
+ return this.http.get('/v1/account/transactions' + (qs ? '?' + qs : ''));
54
+ }
55
+ /** 租户热钱包各链原生余额(需配置 `tenantApiKey`)。 */
56
+ hotWalletBalances() {
57
+ return this.http.get('/v1/account/hot-wallet/balances');
58
+ }
25
59
  }
26
60
  exports.AccountAPI = AccountAPI;
package/dist/data.d.ts CHANGED
@@ -75,6 +75,31 @@ export declare class DataAPI {
75
75
  predictions(params: PredictParams): Promise<PredictResult>;
76
76
  events(params?: EventsParams): Promise<EventsResult>;
77
77
  rag(params: RagParams): Promise<RagResult>;
78
+ /**
79
+ * SSE 实时流(ticker / factors)。返回原始 `Response`,由调用方消费 `res.body`。
80
+ * 该请求不设超时,需自行处理断线与重连。
81
+ */
82
+ stream(params?: {
83
+ channels?: string | string[];
84
+ symbols?: string | string[];
85
+ }): Promise<Response>;
86
+ /** 用户级数据 Key 自助管理(钱包签名;网关另需 `sk_data_*`)。 */
87
+ myKeys: {
88
+ /** 列出当前钱包持有的 key(不含明文)。 */
89
+ list: () => Promise<Record<string, unknown>>;
90
+ /** 创建 key:`{label, scope?, rate_limit?}`;明文仅本次返回。 */
91
+ create: (p: {
92
+ label: string;
93
+ scope?: string;
94
+ rate_limit?: number;
95
+ }) => Promise<Record<string, unknown>>;
96
+ /** 用一次性认领码换取 key 明文(仅一次可见)。 */
97
+ claim: (claimCode: string) => Promise<Record<string, unknown>>;
98
+ /** 轮换 key,返回新的明文。 */
99
+ rotate: (keyId: number | string) => Promise<Record<string, unknown>>;
100
+ /** 删除 key。 */
101
+ remove: (keyId: number | string) => Promise<Record<string, unknown>>;
102
+ };
78
103
  /** 取单符号最新行情(ticker)。 */
79
104
  ticker(symbol: string): Promise<Record<string, unknown>>;
80
105
  /** 列出受支持交易符号(可按市场 / 关键词过滤)。 */
package/dist/data.js CHANGED
@@ -7,6 +7,19 @@ exports.DataAPI = void 0;
7
7
  class DataAPI {
8
8
  constructor(http) {
9
9
  this.http = http;
10
+ /** 用户级数据 Key 自助管理(钱包签名;网关另需 `sk_data_*`)。 */
11
+ this.myKeys = {
12
+ /** 列出当前钱包持有的 key(不含明文)。 */
13
+ list: () => this.http.get('/v1/data/my-keys'),
14
+ /** 创建 key:`{label, scope?, rate_limit?}`;明文仅本次返回。 */
15
+ create: (p) => this.http.post('/v1/data/my-keys', p),
16
+ /** 用一次性认领码换取 key 明文(仅一次可见)。 */
17
+ claim: (claimCode) => this.http.post('/v1/data/my-keys/claim', { claim_code: claimCode }),
18
+ /** 轮换 key,返回新的明文。 */
19
+ rotate: (keyId) => this.http.post('/v1/data/my-keys/' + encodeURIComponent(String(keyId)) + '/rotate'),
20
+ /** 删除 key。 */
21
+ remove: (keyId) => this.http.delete('/v1/data/my-keys/' + encodeURIComponent(String(keyId))),
22
+ };
10
23
  // ── Market 子域(DEX 行情 / 监控 / 订阅):canonical `/v1/data/market*` ──
11
24
  this.market = {
12
25
  /** 按名称/符号搜索 DEX 代币(DexScreener)。 */
@@ -146,6 +159,18 @@ class DataAPI {
146
159
  rag(params) {
147
160
  return this.http.post('/v1/data/rag', params);
148
161
  }
162
+ /**
163
+ * SSE 实时流(ticker / factors)。返回原始 `Response`,由调用方消费 `res.body`。
164
+ * 该请求不设超时,需自行处理断线与重连。
165
+ */
166
+ stream(params = {}) {
167
+ const channels = Array.isArray(params.channels) ? params.channels.join(',') : (params.channels ?? 'ticker');
168
+ const q = new URLSearchParams({ channels });
169
+ if (params.symbols) {
170
+ q.set('symbols', Array.isArray(params.symbols) ? params.symbols.join(',') : params.symbols);
171
+ }
172
+ return this.http.stream('/v1/data/stream?' + q.toString());
173
+ }
149
174
  // ── 行情 / 符号 / 快照(旧 hub MCP 能力)──
150
175
  /** 取单符号最新行情(ticker)。 */
151
176
  ticker(symbol) {
package/dist/http.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type { KeelConfig } from './types';
2
- /** SDK 版本(契约 §5,基线 2.0.0,随包版本同步)。 */
3
- export declare const SDK_VERSION = "2.0.0";
2
+ /** SDK 版本(契约 §5,基线 2.1.0,随包版本同步)。 */
3
+ export declare const SDK_VERSION = "2.1.0";
4
4
  export declare class HttpClient {
5
5
  private baseUrl;
6
6
  private headers;
@@ -11,7 +11,13 @@ export declare class HttpClient {
11
11
  get<T>(path: string, headers?: Record<string, string>): Promise<T>;
12
12
  post<T>(path: string, body?: unknown, headers?: Record<string, string>): Promise<T>;
13
13
  put<T>(path: string, body?: unknown, headers?: Record<string, string>): Promise<T>;
14
- private request;
14
+ delete<T>(path: string, body?: unknown, headers?: Record<string, string>): Promise<T>;
15
+ /**
16
+ * 发起 SSE / 流式 GET,返回原始 `Response`(不解析 JSON、不设超时)。
17
+ * 调用方自行消费 `res.body`;非 2xx 仍抛 `KeelApiError`。
18
+ */
19
+ stream(path: string, headers?: Record<string, string>): Promise<Response>;
20
+ request<T>(method: string, path: string, body?: unknown, extraHeaders?: Record<string, string>): Promise<T>;
15
21
  /** 静态头 + (若配置)钱包签名头。签名按 WALLET_TOKEN_TTL_MS 复用。 */
16
22
  private buildHeaders;
17
23
  }
package/dist/http.js CHANGED
@@ -5,8 +5,8 @@
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.HttpClient = exports.SDK_VERSION = void 0;
7
7
  const errors_1 = require("./errors");
8
- /** SDK 版本(契约 §5,基线 2.0.0,随包版本同步)。 */
9
- exports.SDK_VERSION = '2.0.0';
8
+ /** SDK 版本(契约 §5,基线 2.1.0,随包版本同步)。 */
9
+ exports.SDK_VERSION = '2.1.0';
10
10
  /**
11
11
  * 钱包签名的复用时长(ms):首次签名后在该窗口内复用,避免每个请求都触发钱包弹窗。
12
12
  * 服务端会话 TTL 为 24h,此处取 1h 留足余量。
@@ -19,6 +19,8 @@ class HttpClient {
19
19
  this.headers = { 'Content-Type': 'application/json', 'X-Keel-Version': exports.SDK_VERSION };
20
20
  if (config.apiKey)
21
21
  this.headers['Authorization'] = `Bearer ${config.apiKey}`;
22
+ if (config.tenantApiKey)
23
+ this.headers['x-api-key'] = config.tenantApiKey;
22
24
  if (config.serviceKey)
23
25
  this.headers['X-Service-Key'] = config.serviceKey;
24
26
  if (config.wallet)
@@ -33,6 +35,24 @@ class HttpClient {
33
35
  async put(path, body, headers) {
34
36
  return this.request('PUT', path, body, headers);
35
37
  }
38
+ delete(path, body, headers) {
39
+ return this.request('DELETE', path, body, headers);
40
+ }
41
+ /**
42
+ * 发起 SSE / 流式 GET,返回原始 `Response`(不解析 JSON、不设超时)。
43
+ * 调用方自行消费 `res.body`;非 2xx 仍抛 `KeelApiError`。
44
+ */
45
+ async stream(path, headers) {
46
+ const res = await fetch(this.baseUrl + path, {
47
+ method: 'GET',
48
+ headers: { ...(await this.buildHeaders()), ...headers },
49
+ });
50
+ if (res.status < 200 || res.status >= 300) {
51
+ const json = await res.json().catch(() => ({}));
52
+ throw new errors_1.KeelApiError(path, res.status, json?.code ?? 'INTERNAL', json);
53
+ }
54
+ return res;
55
+ }
36
56
  async request(method, path, body, extraHeaders) {
37
57
  const controller = new AbortController();
38
58
  const timer = setTimeout(() => controller.abort(), this.timeout);
package/dist/index.d.ts CHANGED
@@ -10,6 +10,16 @@ export declare class Keel {
10
10
  readonly wallet: WalletAPI;
11
11
  readonly data: DataAPI;
12
12
  readonly account: AccountAPI;
13
+ private readonly http;
13
14
  constructor(config?: KeelConfig);
15
+ /**
16
+ * 通用逃生口:直接调用任意 canonical `/v1/<module>/*` 端点。
17
+ * 与命名空间方法共用同一套鉴权头(Bearer / x-api-key / 钱包签名)。
18
+ *
19
+ * @example
20
+ * const caps = await keel.request('GET', '/v1/payment/capabilities')
21
+ * const nft = await keel.request('GET', '/v1/wallet/nfts?chain=bsc')
22
+ */
23
+ request<T = unknown>(method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE', path: string, body?: unknown, headers?: Record<string, string>): Promise<T>;
14
24
  }
15
25
  export default Keel;
package/dist/index.js CHANGED
@@ -18,11 +18,22 @@ Object.defineProperty(exports, "KeelApiError", { enumerable: true, get: function
18
18
  Object.defineProperty(exports, "isKeelApiError", { enumerable: true, get: function () { return errors_1.isKeelApiError; } });
19
19
  class Keel {
20
20
  constructor(config = {}) {
21
- const http = new http_1.HttpClient(config);
22
- this.payment = new payment_1.PaymentAPI(http);
23
- this.wallet = new wallet_1.WalletAPI(http);
24
- this.data = new data_1.DataAPI(http);
25
- this.account = new account_1.AccountAPI(http);
21
+ this.http = new http_1.HttpClient(config);
22
+ this.payment = new payment_1.PaymentAPI(this.http);
23
+ this.wallet = new wallet_1.WalletAPI(this.http);
24
+ this.data = new data_1.DataAPI(this.http);
25
+ this.account = new account_1.AccountAPI(this.http);
26
+ }
27
+ /**
28
+ * 通用逃生口:直接调用任意 canonical `/v1/<module>/*` 端点。
29
+ * 与命名空间方法共用同一套鉴权头(Bearer / x-api-key / 钱包签名)。
30
+ *
31
+ * @example
32
+ * const caps = await keel.request('GET', '/v1/payment/capabilities')
33
+ * const nft = await keel.request('GET', '/v1/wallet/nfts?chain=bsc')
34
+ */
35
+ request(method, path, body, headers) {
36
+ return this.http.request(method, path, body, headers);
26
37
  }
27
38
  }
28
39
  exports.Keel = Keel;
package/dist/payment.d.ts CHANGED
@@ -227,4 +227,41 @@ export declare class PaymentAPI {
227
227
  transferConfirm(transferId: string): Promise<Record<string, unknown>>;
228
228
  /** 取消未执行的转账。 */
229
229
  transferCancel(transferId: string): Promise<Record<string, unknown>>;
230
+ /** 周期订阅扣费(基于已创建的 authorization)。 */
231
+ period: {
232
+ /** 扣减一个周期;返回 authorizationId 与扣费结果。 */
233
+ charge: (authorizationId: string) => Promise<Record<string, unknown>>;
234
+ /** 查询周期授权状态(剩余额度 / 周期 / 状态)。 */
235
+ authorization: (authorizationId: string) => Promise<Record<string, unknown>>;
236
+ };
237
+ /** 托管(escrow)链上按量计费 / 退款。 */
238
+ escrow: {
239
+ /** relayer 代为签名扣费:`{chain, user, amountWei, reference}`。 */
240
+ charge: (p: {
241
+ chain: string;
242
+ user: string;
243
+ amountWei: string;
244
+ reference: string;
245
+ }) => Promise<Record<string, unknown>>;
246
+ /** relayer 代为签名退款:`{chain, user, amountWei, reference}`。 */
247
+ refund: (p: {
248
+ chain: string;
249
+ user: string;
250
+ amountWei: string;
251
+ reference: string;
252
+ }) => Promise<Record<string, unknown>>;
253
+ /** 查询托管余额(未配置链返回 `{configured:false, balanceWei:'0'}`)。 */
254
+ balance: (chain: string, user: string) => Promise<Record<string, unknown>>;
255
+ /** 查询链上托管配置(地址 / 限额)。 */
256
+ info: (chain: string) => Promise<Record<string, unknown>>;
257
+ /** relayer gas 健康;不传 chain 返回全部已配置链。 */
258
+ relayerStatus: (chain?: string) => Promise<Record<string, unknown>>;
259
+ /** 核验 Solana 原生 SOL 充值并入账(幂等键 `sol:<signature>`)。 */
260
+ solanaVerify: (p: {
261
+ signature: string;
262
+ from: string;
263
+ amountLamports: string | number;
264
+ waitMs?: number;
265
+ }) => Promise<Record<string, unknown>>;
266
+ };
230
267
  }
package/dist/payment.js CHANGED
@@ -7,6 +7,28 @@ exports.PaymentAPI = void 0;
7
7
  class PaymentAPI {
8
8
  constructor(http) {
9
9
  this.http = http;
10
+ /** 周期订阅扣费(基于已创建的 authorization)。 */
11
+ this.period = {
12
+ /** 扣减一个周期;返回 authorizationId 与扣费结果。 */
13
+ charge: (authorizationId) => this.http.post('/v1/payment/period/charge', { authorizationId }),
14
+ /** 查询周期授权状态(剩余额度 / 周期 / 状态)。 */
15
+ authorization: (authorizationId) => this.http.get('/v1/payment/period/authorization?authorizationId=' + encodeURIComponent(authorizationId)),
16
+ };
17
+ /** 托管(escrow)链上按量计费 / 退款。 */
18
+ this.escrow = {
19
+ /** relayer 代为签名扣费:`{chain, user, amountWei, reference}`。 */
20
+ charge: (p) => this.http.post('/v1/payment/escrow/charge', p),
21
+ /** relayer 代为签名退款:`{chain, user, amountWei, reference}`。 */
22
+ refund: (p) => this.http.post('/v1/payment/escrow/refund', p),
23
+ /** 查询托管余额(未配置链返回 `{configured:false, balanceWei:'0'}`)。 */
24
+ balance: (chain, user) => this.http.get('/v1/payment/escrow/balance?' + new URLSearchParams({ chain, user }).toString()),
25
+ /** 查询链上托管配置(地址 / 限额)。 */
26
+ info: (chain) => this.http.get('/v1/payment/escrow/info?chain=' + encodeURIComponent(chain)),
27
+ /** relayer gas 健康;不传 chain 返回全部已配置链。 */
28
+ relayerStatus: (chain) => this.http.get('/v1/payment/escrow/relayer-status' + (chain ? '?chain=' + encodeURIComponent(chain) : '')),
29
+ /** 核验 Solana 原生 SOL 充值并入账(幂等键 `sol:<signature>`)。 */
30
+ solanaVerify: (p) => this.http.post('/v1/payment/solana/verify', p),
31
+ };
10
32
  }
11
33
  /** 发起收费(内部路由 x402/a2a/batch/invite)。 */
12
34
  charge(params) {
package/dist/types.d.ts CHANGED
@@ -13,6 +13,8 @@ export interface KeelConfig {
13
13
  baseUrl?: string;
14
14
  /** Bearer API key(按模块订阅签发,`sk_<module>_*`) */
15
15
  apiKey?: string;
16
+ /** 租户级 `x-api-key`(WAAS 租户资源面:余额 / 流水 / 提现列表等)。 */
17
+ tenantApiKey?: string;
16
18
  /** 内部服务鉴权 key(`X-Service-Key`);供网关服务级旁路放行可信内部组件(如 keel-mcp)。 */
17
19
  serviceKey?: string;
18
20
  /** 请求超时(ms),默认 30000 */
@@ -0,0 +1,5 @@
1
+ export * from './types';
2
+ export * from './solana-account-types';
3
+ export * from './solana-execution-types';
4
+ export * from './mpc-types';
5
+ export * from './wallet-api';
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ // ---------------------------------------------------------------------------
3
+ // @keelcodes/sdk — wallet 模块
4
+ // ---------------------------------------------------------------------------
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = { enumerable: true, get: function() { return m[k]; } };
10
+ }
11
+ Object.defineProperty(o, k2, desc);
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
17
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
18
+ };
19
+ Object.defineProperty(exports, "__esModule", { value: true });
20
+ __exportStar(require("./types"), exports);
21
+ __exportStar(require("./solana-account-types"), exports);
22
+ __exportStar(require("./solana-execution-types"), exports);
23
+ __exportStar(require("./mpc-types"), exports);
24
+ __exportStar(require("./wallet-api"), exports);
@@ -0,0 +1,47 @@
1
+ export interface MpcSendCodeParams {
2
+ email: string;
3
+ }
4
+ export interface MpcVerifyParams {
5
+ email: string;
6
+ code: string;
7
+ }
8
+ export interface MpcBalanceParams {
9
+ token: string;
10
+ chain?: string;
11
+ tokenAddress?: string;
12
+ }
13
+ export interface MpcSignMessageParams {
14
+ token: string;
15
+ message: string;
16
+ }
17
+ export interface MpcSignTypedDataParams {
18
+ token: string;
19
+ domain: Record<string, unknown>;
20
+ types: Record<string, unknown>;
21
+ value: Record<string, unknown>;
22
+ }
23
+ export interface MpcSendTransactionParams {
24
+ token: string;
25
+ to: string;
26
+ amount: string;
27
+ chain?: string;
28
+ tokenAddress?: string;
29
+ }
30
+ export interface MpcContractCallParams {
31
+ contractAddress: string;
32
+ abi: unknown[];
33
+ method: string;
34
+ args?: unknown[];
35
+ chain?: string;
36
+ }
37
+ export interface MpcContractWriteParams extends MpcContractCallParams {
38
+ token: string;
39
+ value?: string;
40
+ gasLimit?: string;
41
+ }
42
+ export interface MpcGasEstimateParams {
43
+ to?: string;
44
+ value?: string;
45
+ data?: string;
46
+ chain?: string;
47
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,118 @@
1
+ export interface SolanaDeriveAccountParams {
2
+ chain: string;
3
+ accountIndex: string | number;
4
+ smartAccountIndex?: string | number;
5
+ }
6
+ export interface SolanaDerivedAccount {
7
+ chain: string;
8
+ accountIndex: string;
9
+ smartAccountIndex: number;
10
+ settingsPda: string;
11
+ smartAccountPda: string;
12
+ }
13
+ export interface SolanaCreateAccountParams {
14
+ chain: string;
15
+ blockhash: string;
16
+ treasury: string;
17
+ creator: string;
18
+ settingsPda: string;
19
+ signers: Array<Record<string, unknown>>;
20
+ settingsAuthority?: string;
21
+ threshold?: number;
22
+ timeLock?: number;
23
+ rentCollector?: string;
24
+ memo?: string;
25
+ }
26
+ export interface SolanaInstallPolicyParams {
27
+ chain: string;
28
+ blockhash: string;
29
+ feePayer: string;
30
+ creator: string;
31
+ settingsPda: string;
32
+ transactionIndex: string | number;
33
+ signer: Record<string, unknown>;
34
+ /** 旧口径 `SettingsAction::AddSpendingLimit`(已 deprecated) */
35
+ spendingLimit?: Record<string, unknown>;
36
+ /** 新口径 `SettingsAction::PolicyCreate`(spending limit policy) */
37
+ spendingLimitPolicy?: SolanaSpendingLimitPolicy;
38
+ }
39
+ /** 新口径 spending limit policy(`PolicyCreate`;金额/seed 为十进制整数,可用字符串)。 */
40
+ export interface SolanaSpendingLimitPolicy {
41
+ seed: string | number;
42
+ mint: string;
43
+ sourceAccountIndex?: number;
44
+ amount: string | number;
45
+ maxPerUse?: string | number;
46
+ /** 旧 `Period` 枚举值(0=OneTime / 1=Day / 2=Week / 3=Month) */
47
+ period?: number;
48
+ start?: string | number;
49
+ expiration?: string | number;
50
+ accumulateUnused?: boolean;
51
+ enforceExactQuantity?: boolean;
52
+ destinations?: string[];
53
+ signers: Array<Record<string, unknown>>;
54
+ threshold?: number;
55
+ timeLock?: number;
56
+ }
57
+ export interface SolanaCreatePolicyTransactionParams {
58
+ chain: string;
59
+ blockhash: string;
60
+ feePayer: string;
61
+ /** policy PDA */
62
+ policy: string;
63
+ transactionIndex: string | number;
64
+ creator: string;
65
+ rentPayer?: string;
66
+ accountIndex?: number;
67
+ amount: string | number;
68
+ destination: string;
69
+ decimals: number;
70
+ }
71
+ export interface SolanaCreateProposalParams {
72
+ chain: string;
73
+ blockhash: string;
74
+ feePayer: string;
75
+ /** 共识账户:settings PDA(settings 交易)或 policy PDA(policy 交易) */
76
+ settingsPda: string;
77
+ transactionIndex: string | number;
78
+ creator: string;
79
+ rentPayer?: string;
80
+ isDraft?: boolean;
81
+ }
82
+ export interface SolanaApproveProposalParams {
83
+ chain: string;
84
+ blockhash: string;
85
+ feePayer: string;
86
+ /** 共识账户:settings PDA(settings 交易)或 policy PDA(policy 交易) */
87
+ settingsPda: string;
88
+ transactionIndex: string | number;
89
+ signer: string;
90
+ memo?: string;
91
+ }
92
+ export interface SolanaExecutePolicyTransactionParams {
93
+ chain: string;
94
+ blockhash: string;
95
+ feePayer: string;
96
+ /** policy PDA */
97
+ policy: string;
98
+ transactionIndex: string | number;
99
+ signer: string;
100
+ /** 策略执行所需的剩余账户(native SOL: [source, destination, systemProgram]) */
101
+ anchorRemainingAccounts: Array<{
102
+ pubkey: string;
103
+ isWritable?: boolean;
104
+ isSigner?: boolean;
105
+ }>;
106
+ }
107
+ export interface SolanaRemovePolicyParams {
108
+ chain: string;
109
+ blockhash: string;
110
+ feePayer: string;
111
+ creator: string;
112
+ settingsPda: string;
113
+ transactionIndex: string | number;
114
+ /** 待删除的 policy PDA(同时需在 execute 时作为 remaining account 传入) */
115
+ policy: string;
116
+ rentPayer?: string;
117
+ memo?: string;
118
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,90 @@
1
+ export interface SolanaCloseTransactionParams {
2
+ chain: string;
3
+ blockhash: string;
4
+ feePayer: string;
5
+ /** 共识账户:policy PDA(policy 交易)或 settings PDA(settings 交易) */
6
+ settingsPda: string;
7
+ transactionIndex: string | number;
8
+ /** transaction 账户 rent 回收地址;缺省 feePayer */
9
+ transactionRentCollector?: string;
10
+ /** proposal 账户 rent 回收地址;缺省 transactionRentCollector */
11
+ proposalRentCollector?: string;
12
+ }
13
+ export interface SolanaExecutePolicyPayloadParams {
14
+ chain: string;
15
+ blockhash: string;
16
+ feePayer: string;
17
+ /** policy PDA */
18
+ policy: string;
19
+ accountIndex?: number;
20
+ numSigners: number;
21
+ amount: string | number;
22
+ destination: string;
23
+ decimals: number;
24
+ instructionAccounts: Array<{
25
+ pubkey: string;
26
+ isWritable?: boolean;
27
+ isSigner?: boolean;
28
+ }>;
29
+ }
30
+ export interface SolanaCloseSettingsParams {
31
+ chain: string;
32
+ blockhash: string;
33
+ feePayer: string;
34
+ settingsPda: string;
35
+ transactionIndex: string | number;
36
+ transactionRentCollector?: string;
37
+ proposalRentCollector?: string;
38
+ }
39
+ export interface SolanaExecutePolicyParams {
40
+ chain: string;
41
+ blockhash: string;
42
+ feePayer: string;
43
+ settingsPda: string;
44
+ transactionIndex: string | number;
45
+ signer: string;
46
+ rentPayer?: string;
47
+ spendingLimits?: Array<Record<string, unknown>>;
48
+ /** `PolicyCreate` / `PolicyRemove` 的 policy PDA 列表(remaining accounts) */
49
+ policies?: string[];
50
+ }
51
+ export interface SolanaExecuteParams {
52
+ chain: string;
53
+ blockhash: string;
54
+ feePayer: string;
55
+ settingsPda: string;
56
+ signer: string;
57
+ spendingLimit: string;
58
+ mint?: string;
59
+ accountIndex: number;
60
+ amount: string | number;
61
+ decimals: number;
62
+ destination: string;
63
+ tokenProgram?: string;
64
+ memo?: string;
65
+ }
66
+ export interface SolanaRemoveSignerParams {
67
+ chain: string;
68
+ blockhash: string;
69
+ feePayer: string;
70
+ settingsPda: string;
71
+ settingsAuthority: string;
72
+ oldSigner: string;
73
+ memo?: string;
74
+ }
75
+ export interface SolanaSubmitParams {
76
+ chain: string;
77
+ transaction: string;
78
+ }
79
+ /** 构建端点返回的未签名交易(base64)。 */
80
+ export interface SolanaUnsignedTransaction {
81
+ chain: string;
82
+ transaction: string;
83
+ feePayer?: string;
84
+ instructionCount?: number;
85
+ }
86
+ export interface SolanaSubmitResult {
87
+ chain: string;
88
+ signature: string;
89
+ feePayer?: string;
90
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });