@keelcodes/sdk 2.1.3 → 2.3.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/aa/bundler.d.ts +28 -0
- package/dist/aa/bundler.js +95 -0
- package/dist/aa/chain-defaults.d.ts +30 -0
- package/dist/aa/chain-defaults.js +63 -0
- package/dist/aa/index.d.ts +10 -0
- package/dist/aa/index.js +29 -0
- package/dist/aa/keel-session.d.ts +37 -0
- package/dist/aa/keel-session.js +90 -0
- package/dist/aa/nonce.d.ts +8 -0
- package/dist/aa/nonce.js +22 -0
- package/dist/aa/signer.d.ts +3 -0
- package/dist/aa/signer.js +16 -0
- package/dist/aa/token-paymaster.d.ts +9 -0
- package/dist/aa/token-paymaster.js +18 -0
- package/dist/aa/types.d.ts +92 -0
- package/dist/aa/types.js +8 -0
- package/dist/aa/userop.d.ts +26 -0
- package/dist/aa/userop.js +100 -0
- package/dist/aa/x402-session.d.ts +96 -0
- package/dist/aa/x402-session.js +203 -0
- package/dist/aa/x402.d.ts +144 -0
- package/dist/aa/x402.js +185 -0
- package/dist/account.js +16 -15
- package/dist/data.js +82 -81
- package/dist/errors.js +4 -0
- package/dist/http.d.ts +2 -2
- package/dist/http.js +7 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js +20 -0
- package/dist/payment.js +23 -22
- package/dist/wallet/index.d.ts +1 -0
- package/dist/wallet/index.js +1 -0
- package/dist/wallet/types.d.ts +78 -0
- package/dist/wallet/wallet-api.d.ts +11 -2
- package/dist/wallet/wallet-api.js +113 -103
- package/package.json +8 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HttpClient } from '../http';
|
|
2
2
|
import type { KeelEnvelope } from '../types';
|
|
3
|
-
import type { CreateWalletParams, WalletCreated, ImportWalletParams, SignParams, SignResult, SendParams, SendResult, ChainParams, ChainResult, WalletBalanceParams, WalletBalanceResult } from './types';
|
|
3
|
+
import type { CreateWalletParams, WalletCreated, ImportWalletParams, SignParams, SignResult, SendParams, SendResult, ChainParams, ChainResult, WalletBalanceParams, WalletBalanceResult, SessionCreateParams, SessionCreated, PaymasterInfo, PaymasterVoucherParams, PaymasterVoucher } from './types';
|
|
4
4
|
import type { SolanaDeriveAccountParams, SolanaDerivedAccount, SolanaCreateAccountParams, SolanaInstallPolicyParams, SolanaCreatePolicyTransactionParams, SolanaCreateProposalParams, SolanaApproveProposalParams, SolanaExecutePolicyTransactionParams, SolanaRemovePolicyParams } from './solana-account-types';
|
|
5
5
|
import type { SolanaExecutePolicyPayloadParams, SolanaCloseSettingsParams, SolanaCloseTransactionParams, SolanaExecutePolicyParams, SolanaExecuteParams, SolanaRemoveSignerParams, SolanaSubmitParams, SolanaUnsignedTransaction, SolanaSubmitResult } from './solana-execution-types';
|
|
6
6
|
import type { MpcSendCodeParams, MpcVerifyParams, MpcBalanceParams, MpcSignMessageParams, MpcSignTypedDataParams, MpcSendTransactionParams, MpcContractCallParams, MpcContractWriteParams, MpcGasEstimateParams, MpcRegisterParams, MpcRegisterResult, MpcSolanaSignParams, MpcSolanaSignResult, MpcSolanaSendParams, MpcSolanaSendResult } from './mpc-types';
|
|
@@ -134,9 +134,18 @@ export declare class WalletAPI {
|
|
|
134
134
|
}) => Promise<unknown>;
|
|
135
135
|
};
|
|
136
136
|
session: {
|
|
137
|
-
|
|
137
|
+
/** 创建链上 session;传 `signer` 为客户自持 session key(relay 不生成、不落库私钥)。 */
|
|
138
|
+
create: (p: SessionCreateParams) => Promise<KeelEnvelope<SessionCreated>>;
|
|
138
139
|
revoke: (sessionId: string) => Promise<unknown>;
|
|
139
140
|
execute: (p: Record<string, unknown>) => Promise<unknown>;
|
|
141
|
+
/**
|
|
142
|
+
* KeelTokenPaymaster:gas 由 paymaster deposit 垫付,账户以稳定币结算(零 native)。
|
|
143
|
+
* `info` 用于发现配置;`voucher` 赞助「首笔 approve」(解决 allowance 循环依赖)。
|
|
144
|
+
*/
|
|
145
|
+
paymaster: {
|
|
146
|
+
info: () => Promise<KeelEnvelope<PaymasterInfo>>;
|
|
147
|
+
voucher: (p: PaymasterVoucherParams) => Promise<KeelEnvelope<PaymasterVoucher>>;
|
|
148
|
+
};
|
|
140
149
|
/** Solana(Squads Smart Account):构建未签名交易 + 广播已签名交易。 */
|
|
141
150
|
solana: {
|
|
142
151
|
deriveAccount: (p: SolanaDeriveAccountParams) => Promise<SolanaDerivedAccount>;
|
|
@@ -2,111 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.WalletAPI = void 0;
|
|
4
4
|
class WalletAPI {
|
|
5
|
+
http;
|
|
5
6
|
constructor(http) {
|
|
6
7
|
this.http = http;
|
|
7
|
-
/** Chain-RPC 子域:池状态 / 读套餐订阅面(canonical `/v1/wallet/chain/*`)。 */
|
|
8
|
-
this.chainRpc = {
|
|
9
|
-
/** chain-rpc 网关池状态(各链健康 / 活跃端点,脱敏)。 */
|
|
10
|
-
status: () => this.http.get('/v1/wallet/chain/status'),
|
|
11
|
-
/** chain-rpc 网关健康检查。 */
|
|
12
|
-
health: () => this.http.get('/v1/wallet/chain/health'),
|
|
13
|
-
/** RPC 读套餐订阅面。 */
|
|
14
|
-
subscription: {
|
|
15
|
-
/** 套餐目录 + 完整链表(公开,无需 key)。 */
|
|
16
|
-
plans: () => this.http.get('/v1/wallet/chain/subscription/plans'),
|
|
17
|
-
/** 发起订阅支付(rx_ key 鉴权):免费即时激活,付费返回支付意图。 */
|
|
18
|
-
checkout: (p) => this.http.post('/v1/wallet/chain/subscription/checkout', { plan_id: p.planId, rail: p.rail, subscriber: p.subscriber }, { 'x-rpc-key': p.rpcKey }),
|
|
19
|
-
/** 轮询订阅支付状态(chain rail 链上确认)。 */
|
|
20
|
-
paymentCheck: (p) => this.http.post('/v1/wallet/chain/subscription/payment-check', { subscriber: p.subscriber }, { 'x-rpc-key': p.rpcKey }),
|
|
21
|
-
/** 确认 x402 rail 支付(提交 base64 PAYMENT-SIGNATURE)以激活订阅。 */
|
|
22
|
-
verify: (p) => this.http.post('/v1/wallet/chain/subscription/verify', { paymentSignature: p.paymentSignature }, { 'x-rpc-key': p.rpcKey }),
|
|
23
|
-
/** 查询订阅用量(套餐 / 月配额 / 当前用量 / 日聚合)。 */
|
|
24
|
-
usage: (rpcKey) => this.http.get('/v1/wallet/chain/subscription/usage', { 'x-rpc-key': rpcKey }),
|
|
25
|
-
},
|
|
26
|
-
};
|
|
27
|
-
this.safe = {
|
|
28
|
-
/** Vault 概览:Safe 总数 / 待签 / 启用风控规则数。 */
|
|
29
|
-
dashboard: () => this.http.get('/v1/wallet/safe/dashboard'),
|
|
30
|
-
/** 列出多签 Safe(按 userId 过滤)。 */
|
|
31
|
-
list: (userId) => this.http.get('/v1/wallet/safe/list' + (userId ? '?userId=' + encodeURIComponent(userId) : '')),
|
|
32
|
-
/** 单个 Safe 详情(含交易历史)。 */
|
|
33
|
-
info: (address) => this.http.get('/v1/wallet/safe/' + encodeURIComponent(address)),
|
|
34
|
-
/** 创建并链上部署多签 Safe。 */
|
|
35
|
-
create: (p) => this.http.post('/v1/wallet/safe/create', p),
|
|
36
|
-
propose: (p) => this.http.post('/v1/wallet/safe/propose', p),
|
|
37
|
-
confirm: (p) => this.http.post('/v1/wallet/safe/confirm', p),
|
|
38
|
-
execute: (p) => this.http.post('/v1/wallet/safe/execute', p),
|
|
39
|
-
/** 更新 owner 集合与阈值(走链上多签提案)。 */
|
|
40
|
-
updateOwners: (address, p) => this.http.put('/v1/wallet/safe/' + encodeURIComponent(address) + '/owners', p),
|
|
41
|
-
/** 重试待部署 Safe(可按 chainId)。 */
|
|
42
|
-
retry: (chainId) => this.http.post('/v1/wallet/safe/retry', { chainId }),
|
|
43
|
-
/** 执行所有已达阈值的交易。 */
|
|
44
|
-
executeReady: (safeAddress) => this.http.post('/v1/wallet/safe/execute-ready', { safeAddress }),
|
|
45
|
-
/** 同步 Safe 链上状态到库。 */
|
|
46
|
-
sync: (safeAddress) => this.http.post('/v1/wallet/safe/sync', { safeAddress }),
|
|
47
|
-
/** Safe 状态(enabled / count)。 */
|
|
48
|
-
status: (walletAddress) => this.http.get('/v1/wallet/safe/status' + (walletAddress ? '?walletAddress=' + encodeURIComponent(walletAddress) : '')),
|
|
49
|
-
/** 风控检查(按链规则判定单笔是否超限)。 */
|
|
50
|
-
riskCheck: (p) => this.http.post('/v1/wallet/safe/risk/check', p),
|
|
51
|
-
};
|
|
52
|
-
this.session = {
|
|
53
|
-
create: (p) => this.http.post('/v1/wallet/session/create', p),
|
|
54
|
-
revoke: (sessionId) => this.http.post('/v1/wallet/session/revoke', { sessionId }),
|
|
55
|
-
execute: (p) => this.http.post('/v1/wallet/session/execute', p),
|
|
56
|
-
/** Solana(Squads Smart Account):构建未签名交易 + 广播已签名交易。 */
|
|
57
|
-
solana: {
|
|
58
|
-
deriveAccount: (p) => this.http.post('/v1/wallet/session/solana/account/derive', p),
|
|
59
|
-
createAccount: (p) => this.http.post('/v1/wallet/session/solana/account/create', p),
|
|
60
|
-
installPolicy: (p) => this.http.post('/v1/wallet/session/solana/session/policy', p),
|
|
61
|
-
executePolicy: (p) => this.http.post('/v1/wallet/session/solana/session/policy/execute', p),
|
|
62
|
-
/** 新口径:创建 spending limit policy 交易(待多签审批)。 */
|
|
63
|
-
createPolicyTransaction: (p) => this.http.post('/v1/wallet/session/solana/session/policy/create-transaction', p),
|
|
64
|
-
/** settings / policy 交易提案:创建。 */
|
|
65
|
-
createProposal: (p) => this.http.post('/v1/wallet/session/solana/session/proposal', p),
|
|
66
|
-
/** settings / policy 交易提案:审批(threshold 达成即 Approved)。 */
|
|
67
|
-
approveProposal: (p) => this.http.post('/v1/wallet/session/solana/session/proposal/approve', p),
|
|
68
|
-
/** 新口径:异步执行已批准的 policy 交易。 */
|
|
69
|
-
executePolicyTransaction: (p) => this.http.post('/v1/wallet/session/solana/session/policy/execute-transaction', p),
|
|
70
|
-
/** 新口径:删除 policy(PolicyRemove)并回收其 rent。 */
|
|
71
|
-
removePolicy: (p) => this.http.post('/v1/wallet/session/solana/session/policy/remove', p),
|
|
72
|
-
/** 新口径:同步执行 spending limit policy。 */
|
|
73
|
-
executePolicyPayload: (p) => this.http.post('/v1/wallet/session/solana/session/policy/execute-payload', p),
|
|
74
|
-
/** 关闭废弃 settings 交易并回收 rent。 */
|
|
75
|
-
closeSettings: (p) => this.http.post('/v1/wallet/session/solana/settings/close', p),
|
|
76
|
-
/** 关闭 policy 交易并回收 transaction/proposal rent。 */
|
|
77
|
-
closeTransaction: (p) => this.http.post('/v1/wallet/session/solana/session/policy/close-transaction', p),
|
|
78
|
-
execute: (p) => this.http.post('/v1/wallet/session/solana/session/execute', p),
|
|
79
|
-
removeSigner: (p) => this.http.post('/v1/wallet/session/solana/session/remove-signer', p),
|
|
80
|
-
submit: (p) => this.http.post('/v1/wallet/session/solana/submit', p),
|
|
81
|
-
},
|
|
82
|
-
};
|
|
83
|
-
/** MPC(email 分片钱包)子域:canonical `/v1/wallet/mpc/*`。 */
|
|
84
|
-
this.mpc = {
|
|
85
|
-
sendCode: (p) => this.http.post('/v1/wallet/mpc/send-code', p),
|
|
86
|
-
register: (p) => this.http.post('/v1/wallet/mpc/register', p),
|
|
87
|
-
recover: (p) => this.http.post('/v1/wallet/mpc/recover', p),
|
|
88
|
-
status: (email) => this.http.get('/v1/wallet/mpc/status?email=' + encodeURIComponent(email)),
|
|
89
|
-
wallets: (email) => this.http.get('/v1/wallet/mpc/wallets' + (email ? '?email=' + encodeURIComponent(email) : '')),
|
|
90
|
-
sessionUnlock: (p) => this.http.post('/v1/wallet/mpc/session/unlock', p),
|
|
91
|
-
sessionLock: (p) => this.http.post('/v1/wallet/mpc/session/lock', p),
|
|
92
|
-
sessionStatus: (token) => this.http.get('/v1/wallet/mpc/session/status?token=' + encodeURIComponent(token)),
|
|
93
|
-
balance: (p) => this.http.post('/v1/wallet/mpc/balance', p),
|
|
94
|
-
signMessage: (p) => this.http.post('/v1/wallet/mpc/sign-message', p),
|
|
95
|
-
signTypedData: (p) => this.http.post('/v1/wallet/mpc/sign-typed-data', p),
|
|
96
|
-
sendTransaction: (p) => this.http.post('/v1/wallet/mpc/send-transaction', p),
|
|
97
|
-
contractRead: (p) => this.http.post('/v1/wallet/mpc/contract-read', p),
|
|
98
|
-
contractWrite: (p) => this.http.post('/v1/wallet/mpc/contract-write', p),
|
|
99
|
-
gasEstimate: (p) => this.http.post('/v1/wallet/mpc/gas-estimate', p),
|
|
100
|
-
// ── Solana(Ed25519 / FROST 2-of-3)──────────────────────────────────
|
|
101
|
-
/**
|
|
102
|
-
* 签 Solana 交易 message **原文**(hex,可带 0x)。
|
|
103
|
-
* ⚠️ 不能传 32B 摘要:Solana 只认对原文的 Ed25519 签名(Ed25519ph 不被支持)。
|
|
104
|
-
* 返回 64B `R‖z`(128 hex,**无 0x**),无 `v` 恢复 id,用 `publicKey` 对账。
|
|
105
|
-
*/
|
|
106
|
-
signSolana: (p) => this.http.post('/v1/wallet/mpc/solana/sign', p),
|
|
107
|
-
/** 广播 base64 编码的**已签名**交易(经 chain-rpc `sendTransaction` + `getSignatureStatuses`)。 */
|
|
108
|
-
sendSolanaTransaction: (p) => this.http.post('/v1/wallet/mpc/solana/send-transaction', p),
|
|
109
|
-
};
|
|
110
8
|
}
|
|
111
9
|
create(params) {
|
|
112
10
|
return this.http.post('/v1/wallet/create', params);
|
|
@@ -172,5 +70,117 @@ class WalletAPI {
|
|
|
172
70
|
batchProgress(batchId) {
|
|
173
71
|
return this.http.get('/v1/wallet/batch/' + encodeURIComponent(batchId) + '/progress');
|
|
174
72
|
}
|
|
73
|
+
/** Chain-RPC 子域:池状态 / 读套餐订阅面(canonical `/v1/wallet/chain/*`)。 */
|
|
74
|
+
chainRpc = {
|
|
75
|
+
/** chain-rpc 网关池状态(各链健康 / 活跃端点,脱敏)。 */
|
|
76
|
+
status: () => this.http.get('/v1/wallet/chain/status'),
|
|
77
|
+
/** chain-rpc 网关健康检查。 */
|
|
78
|
+
health: () => this.http.get('/v1/wallet/chain/health'),
|
|
79
|
+
/** RPC 读套餐订阅面。 */
|
|
80
|
+
subscription: {
|
|
81
|
+
/** 套餐目录 + 完整链表(公开,无需 key)。 */
|
|
82
|
+
plans: () => this.http.get('/v1/wallet/chain/subscription/plans'),
|
|
83
|
+
/** 发起订阅支付(rx_ key 鉴权):免费即时激活,付费返回支付意图。 */
|
|
84
|
+
checkout: (p) => this.http.post('/v1/wallet/chain/subscription/checkout', { plan_id: p.planId, rail: p.rail, subscriber: p.subscriber }, { 'x-rpc-key': p.rpcKey }),
|
|
85
|
+
/** 轮询订阅支付状态(chain rail 链上确认)。 */
|
|
86
|
+
paymentCheck: (p) => this.http.post('/v1/wallet/chain/subscription/payment-check', { subscriber: p.subscriber }, { 'x-rpc-key': p.rpcKey }),
|
|
87
|
+
/** 确认 x402 rail 支付(提交 base64 PAYMENT-SIGNATURE)以激活订阅。 */
|
|
88
|
+
verify: (p) => this.http.post('/v1/wallet/chain/subscription/verify', { paymentSignature: p.paymentSignature }, { 'x-rpc-key': p.rpcKey }),
|
|
89
|
+
/** 查询订阅用量(套餐 / 月配额 / 当前用量 / 日聚合)。 */
|
|
90
|
+
usage: (rpcKey) => this.http.get('/v1/wallet/chain/subscription/usage', { 'x-rpc-key': rpcKey }),
|
|
91
|
+
},
|
|
92
|
+
};
|
|
93
|
+
safe = {
|
|
94
|
+
/** Vault 概览:Safe 总数 / 待签 / 启用风控规则数。 */
|
|
95
|
+
dashboard: () => this.http.get('/v1/wallet/safe/dashboard'),
|
|
96
|
+
/** 列出多签 Safe(按 userId 过滤)。 */
|
|
97
|
+
list: (userId) => this.http.get('/v1/wallet/safe/list' + (userId ? '?userId=' + encodeURIComponent(userId) : '')),
|
|
98
|
+
/** 单个 Safe 详情(含交易历史)。 */
|
|
99
|
+
info: (address) => this.http.get('/v1/wallet/safe/' + encodeURIComponent(address)),
|
|
100
|
+
/** 创建并链上部署多签 Safe。 */
|
|
101
|
+
create: (p) => this.http.post('/v1/wallet/safe/create', p),
|
|
102
|
+
propose: (p) => this.http.post('/v1/wallet/safe/propose', p),
|
|
103
|
+
confirm: (p) => this.http.post('/v1/wallet/safe/confirm', p),
|
|
104
|
+
execute: (p) => this.http.post('/v1/wallet/safe/execute', p),
|
|
105
|
+
/** 更新 owner 集合与阈值(走链上多签提案)。 */
|
|
106
|
+
updateOwners: (address, p) => this.http.put('/v1/wallet/safe/' + encodeURIComponent(address) + '/owners', p),
|
|
107
|
+
/** 重试待部署 Safe(可按 chainId)。 */
|
|
108
|
+
retry: (chainId) => this.http.post('/v1/wallet/safe/retry', { chainId }),
|
|
109
|
+
/** 执行所有已达阈值的交易。 */
|
|
110
|
+
executeReady: (safeAddress) => this.http.post('/v1/wallet/safe/execute-ready', { safeAddress }),
|
|
111
|
+
/** 同步 Safe 链上状态到库。 */
|
|
112
|
+
sync: (safeAddress) => this.http.post('/v1/wallet/safe/sync', { safeAddress }),
|
|
113
|
+
/** Safe 状态(enabled / count)。 */
|
|
114
|
+
status: (walletAddress) => this.http.get('/v1/wallet/safe/status' + (walletAddress ? '?walletAddress=' + encodeURIComponent(walletAddress) : '')),
|
|
115
|
+
/** 风控检查(按链规则判定单笔是否超限)。 */
|
|
116
|
+
riskCheck: (p) => this.http.post('/v1/wallet/safe/risk/check', p),
|
|
117
|
+
};
|
|
118
|
+
session = {
|
|
119
|
+
/** 创建链上 session;传 `signer` 为客户自持 session key(relay 不生成、不落库私钥)。 */
|
|
120
|
+
create: (p) => this.http.post('/v1/wallet/session/create', p),
|
|
121
|
+
revoke: (sessionId) => this.http.post('/v1/wallet/session/revoke', { sessionId }),
|
|
122
|
+
execute: (p) => this.http.post('/v1/wallet/session/execute', p),
|
|
123
|
+
/**
|
|
124
|
+
* KeelTokenPaymaster:gas 由 paymaster deposit 垫付,账户以稳定币结算(零 native)。
|
|
125
|
+
* `info` 用于发现配置;`voucher` 赞助「首笔 approve」(解决 allowance 循环依赖)。
|
|
126
|
+
*/
|
|
127
|
+
paymaster: {
|
|
128
|
+
info: () => this.http.get('/v1/wallet/session/paymaster/info'),
|
|
129
|
+
voucher: (p) => this.http.post('/v1/wallet/session/paymaster/voucher', p),
|
|
130
|
+
},
|
|
131
|
+
/** Solana(Squads Smart Account):构建未签名交易 + 广播已签名交易。 */
|
|
132
|
+
solana: {
|
|
133
|
+
deriveAccount: (p) => this.http.post('/v1/wallet/session/solana/account/derive', p),
|
|
134
|
+
createAccount: (p) => this.http.post('/v1/wallet/session/solana/account/create', p),
|
|
135
|
+
installPolicy: (p) => this.http.post('/v1/wallet/session/solana/session/policy', p),
|
|
136
|
+
executePolicy: (p) => this.http.post('/v1/wallet/session/solana/session/policy/execute', p),
|
|
137
|
+
/** 新口径:创建 spending limit policy 交易(待多签审批)。 */
|
|
138
|
+
createPolicyTransaction: (p) => this.http.post('/v1/wallet/session/solana/session/policy/create-transaction', p),
|
|
139
|
+
/** settings / policy 交易提案:创建。 */
|
|
140
|
+
createProposal: (p) => this.http.post('/v1/wallet/session/solana/session/proposal', p),
|
|
141
|
+
/** settings / policy 交易提案:审批(threshold 达成即 Approved)。 */
|
|
142
|
+
approveProposal: (p) => this.http.post('/v1/wallet/session/solana/session/proposal/approve', p),
|
|
143
|
+
/** 新口径:异步执行已批准的 policy 交易。 */
|
|
144
|
+
executePolicyTransaction: (p) => this.http.post('/v1/wallet/session/solana/session/policy/execute-transaction', p),
|
|
145
|
+
/** 新口径:删除 policy(PolicyRemove)并回收其 rent。 */
|
|
146
|
+
removePolicy: (p) => this.http.post('/v1/wallet/session/solana/session/policy/remove', p),
|
|
147
|
+
/** 新口径:同步执行 spending limit policy。 */
|
|
148
|
+
executePolicyPayload: (p) => this.http.post('/v1/wallet/session/solana/session/policy/execute-payload', p),
|
|
149
|
+
/** 关闭废弃 settings 交易并回收 rent。 */
|
|
150
|
+
closeSettings: (p) => this.http.post('/v1/wallet/session/solana/settings/close', p),
|
|
151
|
+
/** 关闭 policy 交易并回收 transaction/proposal rent。 */
|
|
152
|
+
closeTransaction: (p) => this.http.post('/v1/wallet/session/solana/session/policy/close-transaction', p),
|
|
153
|
+
execute: (p) => this.http.post('/v1/wallet/session/solana/session/execute', p),
|
|
154
|
+
removeSigner: (p) => this.http.post('/v1/wallet/session/solana/session/remove-signer', p),
|
|
155
|
+
submit: (p) => this.http.post('/v1/wallet/session/solana/submit', p),
|
|
156
|
+
},
|
|
157
|
+
};
|
|
158
|
+
/** MPC(email 分片钱包)子域:canonical `/v1/wallet/mpc/*`。 */
|
|
159
|
+
mpc = {
|
|
160
|
+
sendCode: (p) => this.http.post('/v1/wallet/mpc/send-code', p),
|
|
161
|
+
register: (p) => this.http.post('/v1/wallet/mpc/register', p),
|
|
162
|
+
recover: (p) => this.http.post('/v1/wallet/mpc/recover', p),
|
|
163
|
+
status: (email) => this.http.get('/v1/wallet/mpc/status?email=' + encodeURIComponent(email)),
|
|
164
|
+
wallets: (email) => this.http.get('/v1/wallet/mpc/wallets' + (email ? '?email=' + encodeURIComponent(email) : '')),
|
|
165
|
+
sessionUnlock: (p) => this.http.post('/v1/wallet/mpc/session/unlock', p),
|
|
166
|
+
sessionLock: (p) => this.http.post('/v1/wallet/mpc/session/lock', p),
|
|
167
|
+
sessionStatus: (token) => this.http.get('/v1/wallet/mpc/session/status?token=' + encodeURIComponent(token)),
|
|
168
|
+
balance: (p) => this.http.post('/v1/wallet/mpc/balance', p),
|
|
169
|
+
signMessage: (p) => this.http.post('/v1/wallet/mpc/sign-message', p),
|
|
170
|
+
signTypedData: (p) => this.http.post('/v1/wallet/mpc/sign-typed-data', p),
|
|
171
|
+
sendTransaction: (p) => this.http.post('/v1/wallet/mpc/send-transaction', p),
|
|
172
|
+
contractRead: (p) => this.http.post('/v1/wallet/mpc/contract-read', p),
|
|
173
|
+
contractWrite: (p) => this.http.post('/v1/wallet/mpc/contract-write', p),
|
|
174
|
+
gasEstimate: (p) => this.http.post('/v1/wallet/mpc/gas-estimate', p),
|
|
175
|
+
// ── Solana(Ed25519 / FROST 2-of-3)──────────────────────────────────
|
|
176
|
+
/**
|
|
177
|
+
* 签 Solana 交易 message **原文**(hex,可带 0x)。
|
|
178
|
+
* ⚠️ 不能传 32B 摘要:Solana 只认对原文的 Ed25519 签名(Ed25519ph 不被支持)。
|
|
179
|
+
* 返回 64B `R‖z`(128 hex,**无 0x**),无 `v` 恢复 id,用 `publicKey` 对账。
|
|
180
|
+
*/
|
|
181
|
+
signSolana: (p) => this.http.post('/v1/wallet/mpc/solana/sign', p),
|
|
182
|
+
/** 广播 base64 编码的**已签名**交易(经 chain-rpc `sendTransaction` + `getSignatureStatuses`)。 */
|
|
183
|
+
sendSolanaTransaction: (p) => this.http.post('/v1/wallet/mpc/solana/send-transaction', p),
|
|
184
|
+
};
|
|
175
185
|
}
|
|
176
186
|
exports.WalletAPI = WalletAPI;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@keelcodes/sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"description": "Keel SDK — unified access to payment / wallet / data / account modules over https://keel.codes",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -24,6 +24,10 @@
|
|
|
24
24
|
"./account": {
|
|
25
25
|
"types": "./dist/account.d.ts",
|
|
26
26
|
"default": "./dist/account.js"
|
|
27
|
+
},
|
|
28
|
+
"./aa": {
|
|
29
|
+
"types": "./dist/aa/index.d.ts",
|
|
30
|
+
"default": "./dist/aa/index.js"
|
|
27
31
|
}
|
|
28
32
|
},
|
|
29
33
|
"files": [
|
|
@@ -49,6 +53,9 @@
|
|
|
49
53
|
],
|
|
50
54
|
"license": "MIT",
|
|
51
55
|
"author": "Keel",
|
|
56
|
+
"dependencies": {
|
|
57
|
+
"viem": "^2.55.0"
|
|
58
|
+
},
|
|
52
59
|
"devDependencies": {
|
|
53
60
|
"typescript": "^5.0.0"
|
|
54
61
|
}
|