moltspay 0.2.0 → 0.2.2

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 (49) hide show
  1. package/dist/chains/index.d.mts +6 -6
  2. package/dist/chains/index.d.ts +6 -6
  3. package/dist/chains/index.js +2 -2
  4. package/dist/chains/index.js.map +1 -1
  5. package/dist/chains/index.mjs +2 -2
  6. package/dist/chains/index.mjs.map +1 -1
  7. package/dist/cli.js +36 -36
  8. package/dist/cli.js.map +1 -1
  9. package/dist/cli.mjs +36 -36
  10. package/dist/cli.mjs.map +1 -1
  11. package/dist/guide/index.d.mts +7 -7
  12. package/dist/guide/index.d.ts +7 -7
  13. package/dist/guide/index.js +50 -50
  14. package/dist/guide/index.js.map +1 -1
  15. package/dist/guide/index.mjs +50 -50
  16. package/dist/guide/index.mjs.map +1 -1
  17. package/dist/{index-CZzgdtin.d.mts → index-CyFg9s2m.d.mts} +1 -1
  18. package/dist/{index-CZzgdtin.d.ts → index-CyFg9s2m.d.ts} +1 -1
  19. package/dist/index.d.mts +89 -89
  20. package/dist/index.d.ts +89 -89
  21. package/dist/index.js +275 -275
  22. package/dist/index.js.map +1 -1
  23. package/dist/index.mjs +275 -275
  24. package/dist/index.mjs.map +1 -1
  25. package/dist/orders/index.d.mts +13 -13
  26. package/dist/orders/index.d.ts +13 -13
  27. package/dist/orders/index.js +10 -10
  28. package/dist/orders/index.js.map +1 -1
  29. package/dist/orders/index.mjs +10 -10
  30. package/dist/orders/index.mjs.map +1 -1
  31. package/dist/permit/index.d.mts +11 -11
  32. package/dist/permit/index.d.ts +11 -11
  33. package/dist/permit/index.js +14 -14
  34. package/dist/permit/index.js.map +1 -1
  35. package/dist/permit/index.mjs +14 -14
  36. package/dist/permit/index.mjs.map +1 -1
  37. package/dist/verify/index.d.mts +4 -4
  38. package/dist/verify/index.d.ts +4 -4
  39. package/dist/verify/index.js +13 -13
  40. package/dist/verify/index.js.map +1 -1
  41. package/dist/verify/index.mjs +13 -13
  42. package/dist/verify/index.mjs.map +1 -1
  43. package/dist/wallet/index.d.mts +72 -72
  44. package/dist/wallet/index.d.ts +72 -72
  45. package/dist/wallet/index.js +48 -48
  46. package/dist/wallet/index.js.map +1 -1
  47. package/dist/wallet/index.mjs +48 -48
  48. package/dist/wallet/index.mjs.map +1 -1
  49. package/package.json +1 -1
@@ -1,11 +1,11 @@
1
- import { C as ChainName, a as ChainConfig, W as WalletBalance, j as TransferResult, S as SecureWalletConfig, T as TransferParams, e as PendingTransfer, i as SecurityLimits } from '../index-CZzgdtin.mjs';
1
+ import { C as ChainName, a as ChainConfig, W as WalletBalance, j as TransferResult, S as SecureWalletConfig, T as TransferParams, e as PendingTransfer, i as SecurityLimits } from '../index-CyFg9s2m.mjs';
2
2
 
3
3
  /**
4
- * Wallet - 基础托管钱包
4
+ * Wallet - Basic Custody Wallet
5
5
  *
6
- * 功能:
7
- * - 查询余额
8
- * - 发送 USDC 转账
6
+ * Features:
7
+ * - Query balance
8
+ * - Send USDC transfer
9
9
  */
10
10
 
11
11
  interface WalletConfig {
@@ -22,19 +22,19 @@ declare class Wallet {
22
22
  private usdcContract;
23
23
  constructor(config?: WalletConfig);
24
24
  /**
25
- * 获取钱包余额
25
+ * Get wallet balance
26
26
  */
27
27
  getBalance(): Promise<WalletBalance>;
28
28
  /**
29
- * 发送 USDC 转账
29
+ * Send USDC transfer
30
30
  */
31
31
  transfer(to: string, amount: number): Promise<TransferResult>;
32
32
  /**
33
- * 获取 ETH 余额
33
+ * Get ETH balance
34
34
  */
35
35
  getEthBalance(): Promise<string>;
36
36
  /**
37
- * 获取 USDC 余额
37
+ * Get USDC balance
38
38
  */
39
39
  getUsdcBalance(): Promise<string>;
40
40
  }
@@ -49,75 +49,75 @@ declare class SecureWallet {
49
49
  private pendingTransfers;
50
50
  constructor(config?: SecureWalletConfig);
51
51
  /**
52
- * 获取钱包地址
52
+ * Get wallet address
53
53
  */
54
54
  get address(): string;
55
55
  /**
56
- * 获取余额
56
+ * Get balance
57
57
  */
58
58
  getBalance(): Promise<WalletBalance>;
59
59
  /**
60
- * 安全转账(带限额和白名单检查)
60
+ * Secure transfer (with limit and whitelist checks)
61
61
  *
62
- * 支持两种调用方式:
62
+ * Supports two calling methods:
63
63
  * - transfer({ to, amount, reason?, requester? })
64
64
  * - transfer(to, amount)
65
65
  */
66
66
  transfer(paramsOrTo: TransferParams | string, amountArg?: number | string): Promise<TransferResult>;
67
67
  /**
68
- * 审批待处理转账
68
+ * Approve pending transfer
69
69
  */
70
70
  approve(requestId: string, approver: string): Promise<TransferResult>;
71
71
  /**
72
- * 拒绝待处理转账
72
+ * Reject pending transfer
73
73
  */
74
74
  reject(requestId: string, rejecter: string, reason?: string): Promise<void>;
75
75
  /**
76
- * 添加白名单地址
76
+ * Add to whitelist
77
77
  */
78
78
  addToWhitelist(address: string, addedBy: string): Promise<void>;
79
79
  /**
80
- * 移除白名单地址
80
+ * Remove from whitelist
81
81
  */
82
82
  removeFromWhitelist(address: string, removedBy: string): Promise<void>;
83
83
  /**
84
- * 检查地址是否在白名单
84
+ * Check if address is whitelisted
85
85
  */
86
86
  isWhitelisted(address: string): boolean;
87
87
  /**
88
- * 获取待处理转账列表
88
+ * Get pending transfers list
89
89
  */
90
90
  getPendingTransfers(): PendingTransfer[];
91
91
  /**
92
- * 获取当前限额配置
92
+ * Get current limit config
93
93
  */
94
94
  getLimits(): SecurityLimits;
95
95
  /**
96
- * 获取今日已用额度
96
+ * Get daily used amount
97
97
  */
98
98
  getDailyUsed(): number;
99
99
  /**
100
- * 更新日限额计数器
100
+ * Update daily limit counter
101
101
  */
102
102
  private updateDailyTotal;
103
103
  }
104
104
 
105
105
  /**
106
- * createWallet - Agent 创建新钱包
106
+ * createWallet - Create a new wallet for Agent
107
107
  *
108
- * 功能:
109
- * - 生成新的以太坊钱包
110
- * - 安全存储私钥(加密或明文,取决于配置)
111
- * - 返回钱包地址(不返回私钥)
108
+ * Features:
109
+ * - Generate new Ethereum wallet
110
+ * - Securely store private key (encrypted or plaintext, depending on config)
111
+ * - Return wallet address (never return private key)
112
112
  */
113
113
  interface CreateWalletOptions {
114
- /** 存储路径,默认 ~/.moltspay/wallet.json */
114
+ /** Storage path, default ~/.moltspay/wallet.json */
115
115
  storagePath?: string;
116
- /** 加密密码(可选,不提供则明文存储) */
116
+ /** Encryption password (optional, plaintext if not provided) */
117
117
  password?: string;
118
- /** 钱包标签/名称 */
118
+ /** Wallet label/name */
119
119
  label?: string;
120
- /** 如果钱包已存在,是否覆盖 */
120
+ /** Overwrite if wallet exists */
121
121
  overwrite?: boolean;
122
122
  }
123
123
  interface WalletData {
@@ -125,11 +125,11 @@ interface WalletData {
125
125
  label?: string;
126
126
  createdAt: string;
127
127
  encrypted: boolean;
128
- /** 加密后的私钥或明文私钥 */
128
+ /** Encrypted or plaintext private key */
129
129
  privateKey: string;
130
- /** 加密用的 IV */
130
+ /** Encryption IV */
131
131
  iv?: string;
132
- /** 加密用的 salt */
132
+ /** Encryption salt */
133
133
  salt?: string;
134
134
  }
135
135
  interface CreateWalletResult {
@@ -137,28 +137,28 @@ interface CreateWalletResult {
137
137
  address?: string;
138
138
  storagePath?: string;
139
139
  error?: string;
140
- /** 是否是新创建的(false 表示加载了已有钱包) */
140
+ /** Whether newly created (false means loaded existing) */
141
141
  isNew?: boolean;
142
142
  }
143
143
  /**
144
- * 创建新钱包
144
+ * Create new wallet
145
145
  *
146
146
  * @example
147
147
  * ```typescript
148
- * // 创建未加密钱包
148
+ * // Create unencrypted wallet
149
149
  * const result = await createWallet();
150
- * console.log('钱包地址:', result.address);
150
+ * console.log('Wallet address:', result.address);
151
151
  *
152
- * // 创建加密钱包
152
+ * // Create encrypted wallet
153
153
  * const result = await createWallet({ password: 'mySecurePassword' });
154
154
  *
155
- * // 指定存储路径
155
+ * // Specify storage path
156
156
  * const result = await createWallet({ storagePath: './my-wallet.json' });
157
157
  * ```
158
158
  */
159
159
  declare function createWallet(options?: CreateWalletOptions): CreateWalletResult;
160
160
  /**
161
- * 加载已有钱包
161
+ * Load existing wallet
162
162
  */
163
163
  declare function loadWallet(options?: {
164
164
  storagePath?: string;
@@ -170,61 +170,61 @@ declare function loadWallet(options?: {
170
170
  error?: string;
171
171
  };
172
172
  /**
173
- * 获取钱包地址(不需要密码)
173
+ * Get wallet address (no password required)
174
174
  */
175
175
  declare function getWalletAddress(storagePath?: string): string | null;
176
176
  /**
177
- * 检查钱包是否存在
177
+ * Check if wallet exists
178
178
  */
179
179
  declare function walletExists(storagePath?: string): boolean;
180
180
 
181
181
  /**
182
- * PermitWallet - 使用 Boss 授权的 Permit 进行支付
182
+ * PermitWallet - Pay using Boss's Permit authorization
183
183
  *
184
- * 场景:
185
- * - Agent 没有自己的 USDC,但 Boss 给了 Permit 授权
186
- * - Agent 使用 Permit 签名 + 自己的钱包执行 transferFrom
187
- * - Agent 只需要少量 ETH gasUSDC Boss 钱包扣除
184
+ * Scenario:
185
+ * - Agent doesn't have USDC, but Boss gave a Permit authorization
186
+ * - Agent uses Permit signature + own wallet to execute transferFrom
187
+ * - Agent only needs small amount of ETH for gas, USDC is deducted from Boss's wallet
188
188
  */
189
189
 
190
190
  interface PermitData {
191
- /** Boss 的钱包地址(USDC 持有者) */
191
+ /** Boss's wallet address (USDC holder) */
192
192
  owner: string;
193
- /** Agent 的钱包地址(被授权者) */
193
+ /** Agent's wallet address (authorized spender) */
194
194
  spender: string;
195
- /** 授权金额(USDC6位小数的原始值) */
195
+ /** Authorized amount (USDC, raw 6 decimal value) */
196
196
  value: string;
197
- /** 过期时间戳 */
197
+ /** Expiration timestamp */
198
198
  deadline: number;
199
- /** 签名 v */
199
+ /** Signature v */
200
200
  v: number;
201
- /** 签名 r */
201
+ /** Signature r */
202
202
  r: string;
203
- /** 签名 s */
203
+ /** Signature s */
204
204
  s: string;
205
205
  }
206
206
  interface PermitWalletConfig {
207
207
  chain?: ChainName;
208
- /** Agent 的私钥(用于执行交易) */
208
+ /** Agent's private key (for executing transactions) */
209
209
  privateKey?: string;
210
- /** 从文件加载私钥 */
210
+ /** Load private key from file */
211
211
  walletPath?: string;
212
- /** 解密密码 */
212
+ /** Decryption password */
213
213
  walletPassword?: string;
214
214
  rpcUrl?: string;
215
215
  }
216
216
  interface TransferWithPermitParams {
217
- /** 收款地址 */
217
+ /** Recipient address */
218
218
  to: string;
219
- /** 金额(USDC */
219
+ /** Amount (USDC) */
220
220
  amount: number;
221
- /** Boss 签署的 Permit 数据 */
221
+ /** Boss-signed Permit data */
222
222
  permit: PermitData;
223
223
  }
224
224
  interface TransferWithPermitResult extends TransferResult {
225
- /** Permit 交易 hash */
225
+ /** Permit transaction hash */
226
226
  permitTxHash?: string;
227
- /** Transfer 交易 hash */
227
+ /** Transfer transaction hash */
228
228
  transferTxHash?: string;
229
229
  }
230
230
  declare class PermitWallet {
@@ -236,21 +236,21 @@ declare class PermitWallet {
236
236
  private usdcContract;
237
237
  constructor(config?: PermitWalletConfig);
238
238
  /**
239
- * 检查 Permit 是否有效
239
+ * Check if Permit is valid (current allowance)
240
240
  */
241
241
  checkPermitAllowance(owner: string): Promise<string>;
242
242
  /**
243
- * 使用 Permit 授权进行支付
243
+ * Pay using Permit authorization
244
244
  *
245
- * 流程:
246
- * 1. 调用 permit() 让合约记录 Boss 的授权
247
- * 2. 调用 transferFrom() Boss 钱包转账到收款方
245
+ * Flow:
246
+ * 1. Call permit() to record Boss's authorization in the contract
247
+ * 2. Call transferFrom() to transfer from Boss's wallet to recipient
248
248
  *
249
249
  * @example
250
250
  * ```typescript
251
251
  * const wallet = new PermitWallet({ chain: 'base' });
252
252
  *
253
- * // Boss 签署的 permit 数据
253
+ * // Boss-signed permit data
254
254
  * const permit = {
255
255
  * owner: '0xBOSS...',
256
256
  * spender: wallet.address,
@@ -270,16 +270,16 @@ declare class PermitWallet {
270
270
  */
271
271
  transferWithPermit(params: TransferWithPermitParams): Promise<TransferWithPermitResult>;
272
272
  /**
273
- * 获取 ETH 余额(用于支付 gas
273
+ * Get ETH balance (for gas)
274
274
  */
275
275
  getGasBalance(): Promise<string>;
276
276
  /**
277
- * 检查是否有足够的 gas
277
+ * Check if there's enough gas
278
278
  */
279
279
  hasEnoughGas(minEth?: number): Promise<boolean>;
280
280
  }
281
281
  /**
282
- * 格式化 Permit 请求消息(发给 Boss
282
+ * Format Permit request message (to send to Boss)
283
283
  */
284
284
  declare function formatPermitRequest(params: {
285
285
  agentAddress: string;
@@ -1,11 +1,11 @@
1
- import { C as ChainName, a as ChainConfig, W as WalletBalance, j as TransferResult, S as SecureWalletConfig, T as TransferParams, e as PendingTransfer, i as SecurityLimits } from '../index-CZzgdtin.js';
1
+ import { C as ChainName, a as ChainConfig, W as WalletBalance, j as TransferResult, S as SecureWalletConfig, T as TransferParams, e as PendingTransfer, i as SecurityLimits } from '../index-CyFg9s2m.js';
2
2
 
3
3
  /**
4
- * Wallet - 基础托管钱包
4
+ * Wallet - Basic Custody Wallet
5
5
  *
6
- * 功能:
7
- * - 查询余额
8
- * - 发送 USDC 转账
6
+ * Features:
7
+ * - Query balance
8
+ * - Send USDC transfer
9
9
  */
10
10
 
11
11
  interface WalletConfig {
@@ -22,19 +22,19 @@ declare class Wallet {
22
22
  private usdcContract;
23
23
  constructor(config?: WalletConfig);
24
24
  /**
25
- * 获取钱包余额
25
+ * Get wallet balance
26
26
  */
27
27
  getBalance(): Promise<WalletBalance>;
28
28
  /**
29
- * 发送 USDC 转账
29
+ * Send USDC transfer
30
30
  */
31
31
  transfer(to: string, amount: number): Promise<TransferResult>;
32
32
  /**
33
- * 获取 ETH 余额
33
+ * Get ETH balance
34
34
  */
35
35
  getEthBalance(): Promise<string>;
36
36
  /**
37
- * 获取 USDC 余额
37
+ * Get USDC balance
38
38
  */
39
39
  getUsdcBalance(): Promise<string>;
40
40
  }
@@ -49,75 +49,75 @@ declare class SecureWallet {
49
49
  private pendingTransfers;
50
50
  constructor(config?: SecureWalletConfig);
51
51
  /**
52
- * 获取钱包地址
52
+ * Get wallet address
53
53
  */
54
54
  get address(): string;
55
55
  /**
56
- * 获取余额
56
+ * Get balance
57
57
  */
58
58
  getBalance(): Promise<WalletBalance>;
59
59
  /**
60
- * 安全转账(带限额和白名单检查)
60
+ * Secure transfer (with limit and whitelist checks)
61
61
  *
62
- * 支持两种调用方式:
62
+ * Supports two calling methods:
63
63
  * - transfer({ to, amount, reason?, requester? })
64
64
  * - transfer(to, amount)
65
65
  */
66
66
  transfer(paramsOrTo: TransferParams | string, amountArg?: number | string): Promise<TransferResult>;
67
67
  /**
68
- * 审批待处理转账
68
+ * Approve pending transfer
69
69
  */
70
70
  approve(requestId: string, approver: string): Promise<TransferResult>;
71
71
  /**
72
- * 拒绝待处理转账
72
+ * Reject pending transfer
73
73
  */
74
74
  reject(requestId: string, rejecter: string, reason?: string): Promise<void>;
75
75
  /**
76
- * 添加白名单地址
76
+ * Add to whitelist
77
77
  */
78
78
  addToWhitelist(address: string, addedBy: string): Promise<void>;
79
79
  /**
80
- * 移除白名单地址
80
+ * Remove from whitelist
81
81
  */
82
82
  removeFromWhitelist(address: string, removedBy: string): Promise<void>;
83
83
  /**
84
- * 检查地址是否在白名单
84
+ * Check if address is whitelisted
85
85
  */
86
86
  isWhitelisted(address: string): boolean;
87
87
  /**
88
- * 获取待处理转账列表
88
+ * Get pending transfers list
89
89
  */
90
90
  getPendingTransfers(): PendingTransfer[];
91
91
  /**
92
- * 获取当前限额配置
92
+ * Get current limit config
93
93
  */
94
94
  getLimits(): SecurityLimits;
95
95
  /**
96
- * 获取今日已用额度
96
+ * Get daily used amount
97
97
  */
98
98
  getDailyUsed(): number;
99
99
  /**
100
- * 更新日限额计数器
100
+ * Update daily limit counter
101
101
  */
102
102
  private updateDailyTotal;
103
103
  }
104
104
 
105
105
  /**
106
- * createWallet - Agent 创建新钱包
106
+ * createWallet - Create a new wallet for Agent
107
107
  *
108
- * 功能:
109
- * - 生成新的以太坊钱包
110
- * - 安全存储私钥(加密或明文,取决于配置)
111
- * - 返回钱包地址(不返回私钥)
108
+ * Features:
109
+ * - Generate new Ethereum wallet
110
+ * - Securely store private key (encrypted or plaintext, depending on config)
111
+ * - Return wallet address (never return private key)
112
112
  */
113
113
  interface CreateWalletOptions {
114
- /** 存储路径,默认 ~/.moltspay/wallet.json */
114
+ /** Storage path, default ~/.moltspay/wallet.json */
115
115
  storagePath?: string;
116
- /** 加密密码(可选,不提供则明文存储) */
116
+ /** Encryption password (optional, plaintext if not provided) */
117
117
  password?: string;
118
- /** 钱包标签/名称 */
118
+ /** Wallet label/name */
119
119
  label?: string;
120
- /** 如果钱包已存在,是否覆盖 */
120
+ /** Overwrite if wallet exists */
121
121
  overwrite?: boolean;
122
122
  }
123
123
  interface WalletData {
@@ -125,11 +125,11 @@ interface WalletData {
125
125
  label?: string;
126
126
  createdAt: string;
127
127
  encrypted: boolean;
128
- /** 加密后的私钥或明文私钥 */
128
+ /** Encrypted or plaintext private key */
129
129
  privateKey: string;
130
- /** 加密用的 IV */
130
+ /** Encryption IV */
131
131
  iv?: string;
132
- /** 加密用的 salt */
132
+ /** Encryption salt */
133
133
  salt?: string;
134
134
  }
135
135
  interface CreateWalletResult {
@@ -137,28 +137,28 @@ interface CreateWalletResult {
137
137
  address?: string;
138
138
  storagePath?: string;
139
139
  error?: string;
140
- /** 是否是新创建的(false 表示加载了已有钱包) */
140
+ /** Whether newly created (false means loaded existing) */
141
141
  isNew?: boolean;
142
142
  }
143
143
  /**
144
- * 创建新钱包
144
+ * Create new wallet
145
145
  *
146
146
  * @example
147
147
  * ```typescript
148
- * // 创建未加密钱包
148
+ * // Create unencrypted wallet
149
149
  * const result = await createWallet();
150
- * console.log('钱包地址:', result.address);
150
+ * console.log('Wallet address:', result.address);
151
151
  *
152
- * // 创建加密钱包
152
+ * // Create encrypted wallet
153
153
  * const result = await createWallet({ password: 'mySecurePassword' });
154
154
  *
155
- * // 指定存储路径
155
+ * // Specify storage path
156
156
  * const result = await createWallet({ storagePath: './my-wallet.json' });
157
157
  * ```
158
158
  */
159
159
  declare function createWallet(options?: CreateWalletOptions): CreateWalletResult;
160
160
  /**
161
- * 加载已有钱包
161
+ * Load existing wallet
162
162
  */
163
163
  declare function loadWallet(options?: {
164
164
  storagePath?: string;
@@ -170,61 +170,61 @@ declare function loadWallet(options?: {
170
170
  error?: string;
171
171
  };
172
172
  /**
173
- * 获取钱包地址(不需要密码)
173
+ * Get wallet address (no password required)
174
174
  */
175
175
  declare function getWalletAddress(storagePath?: string): string | null;
176
176
  /**
177
- * 检查钱包是否存在
177
+ * Check if wallet exists
178
178
  */
179
179
  declare function walletExists(storagePath?: string): boolean;
180
180
 
181
181
  /**
182
- * PermitWallet - 使用 Boss 授权的 Permit 进行支付
182
+ * PermitWallet - Pay using Boss's Permit authorization
183
183
  *
184
- * 场景:
185
- * - Agent 没有自己的 USDC,但 Boss 给了 Permit 授权
186
- * - Agent 使用 Permit 签名 + 自己的钱包执行 transferFrom
187
- * - Agent 只需要少量 ETH gasUSDC Boss 钱包扣除
184
+ * Scenario:
185
+ * - Agent doesn't have USDC, but Boss gave a Permit authorization
186
+ * - Agent uses Permit signature + own wallet to execute transferFrom
187
+ * - Agent only needs small amount of ETH for gas, USDC is deducted from Boss's wallet
188
188
  */
189
189
 
190
190
  interface PermitData {
191
- /** Boss 的钱包地址(USDC 持有者) */
191
+ /** Boss's wallet address (USDC holder) */
192
192
  owner: string;
193
- /** Agent 的钱包地址(被授权者) */
193
+ /** Agent's wallet address (authorized spender) */
194
194
  spender: string;
195
- /** 授权金额(USDC6位小数的原始值) */
195
+ /** Authorized amount (USDC, raw 6 decimal value) */
196
196
  value: string;
197
- /** 过期时间戳 */
197
+ /** Expiration timestamp */
198
198
  deadline: number;
199
- /** 签名 v */
199
+ /** Signature v */
200
200
  v: number;
201
- /** 签名 r */
201
+ /** Signature r */
202
202
  r: string;
203
- /** 签名 s */
203
+ /** Signature s */
204
204
  s: string;
205
205
  }
206
206
  interface PermitWalletConfig {
207
207
  chain?: ChainName;
208
- /** Agent 的私钥(用于执行交易) */
208
+ /** Agent's private key (for executing transactions) */
209
209
  privateKey?: string;
210
- /** 从文件加载私钥 */
210
+ /** Load private key from file */
211
211
  walletPath?: string;
212
- /** 解密密码 */
212
+ /** Decryption password */
213
213
  walletPassword?: string;
214
214
  rpcUrl?: string;
215
215
  }
216
216
  interface TransferWithPermitParams {
217
- /** 收款地址 */
217
+ /** Recipient address */
218
218
  to: string;
219
- /** 金额(USDC */
219
+ /** Amount (USDC) */
220
220
  amount: number;
221
- /** Boss 签署的 Permit 数据 */
221
+ /** Boss-signed Permit data */
222
222
  permit: PermitData;
223
223
  }
224
224
  interface TransferWithPermitResult extends TransferResult {
225
- /** Permit 交易 hash */
225
+ /** Permit transaction hash */
226
226
  permitTxHash?: string;
227
- /** Transfer 交易 hash */
227
+ /** Transfer transaction hash */
228
228
  transferTxHash?: string;
229
229
  }
230
230
  declare class PermitWallet {
@@ -236,21 +236,21 @@ declare class PermitWallet {
236
236
  private usdcContract;
237
237
  constructor(config?: PermitWalletConfig);
238
238
  /**
239
- * 检查 Permit 是否有效
239
+ * Check if Permit is valid (current allowance)
240
240
  */
241
241
  checkPermitAllowance(owner: string): Promise<string>;
242
242
  /**
243
- * 使用 Permit 授权进行支付
243
+ * Pay using Permit authorization
244
244
  *
245
- * 流程:
246
- * 1. 调用 permit() 让合约记录 Boss 的授权
247
- * 2. 调用 transferFrom() Boss 钱包转账到收款方
245
+ * Flow:
246
+ * 1. Call permit() to record Boss's authorization in the contract
247
+ * 2. Call transferFrom() to transfer from Boss's wallet to recipient
248
248
  *
249
249
  * @example
250
250
  * ```typescript
251
251
  * const wallet = new PermitWallet({ chain: 'base' });
252
252
  *
253
- * // Boss 签署的 permit 数据
253
+ * // Boss-signed permit data
254
254
  * const permit = {
255
255
  * owner: '0xBOSS...',
256
256
  * spender: wallet.address,
@@ -270,16 +270,16 @@ declare class PermitWallet {
270
270
  */
271
271
  transferWithPermit(params: TransferWithPermitParams): Promise<TransferWithPermitResult>;
272
272
  /**
273
- * 获取 ETH 余额(用于支付 gas
273
+ * Get ETH balance (for gas)
274
274
  */
275
275
  getGasBalance(): Promise<string>;
276
276
  /**
277
- * 检查是否有足够的 gas
277
+ * Check if there's enough gas
278
278
  */
279
279
  hasEnoughGas(minEth?: number): Promise<boolean>;
280
280
  }
281
281
  /**
282
- * 格式化 Permit 请求消息(发给 Boss
282
+ * Format Permit request message (to send to Boss)
283
283
  */
284
284
  declare function formatPermitRequest(params: {
285
285
  agentAddress: string;