@aastar/sdk 0.20.2 → 0.20.3
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 +115 -35
- package/dist/UserClient-JMNNZT4P.js +6 -0
- package/dist/{UserClient-YUHCJJJL.js.map → UserClient-JMNNZT4P.js.map} +1 -1
- package/dist/account.js +3 -3
- package/dist/admin.js +3 -3
- package/dist/channel.js +3 -3
- package/dist/{chunk-4DVUM4MC.js → chunk-5TDDS3T5.js} +3 -3
- package/dist/{chunk-4DVUM4MC.js.map → chunk-5TDDS3T5.js.map} +1 -1
- package/dist/{chunk-O3Y7II3B.js → chunk-KL6SCEIU.js} +4 -4
- package/dist/{chunk-O3Y7II3B.js.map → chunk-KL6SCEIU.js.map} +1 -1
- package/dist/{chunk-DI3E6PMI.js → chunk-LNICTATJ.js} +6 -6
- package/dist/{chunk-DI3E6PMI.js.map → chunk-LNICTATJ.js.map} +1 -1
- package/dist/{chunk-PCLPYRTX.js → chunk-M5ORP2PM.js} +8 -8
- package/dist/{chunk-PCLPYRTX.js.map → chunk-M5ORP2PM.js.map} +1 -1
- package/dist/{chunk-MPOMWT2J.js → chunk-NAPMVAVJ.js} +3 -3
- package/dist/{chunk-MPOMWT2J.js.map → chunk-NAPMVAVJ.js.map} +1 -1
- package/dist/{chunk-NZGXB2C5.js → chunk-O454V5ML.js} +3 -3
- package/dist/{chunk-NZGXB2C5.js.map → chunk-O454V5ML.js.map} +1 -1
- package/dist/{chunk-XFI3AK32.js → chunk-QNYP7RPI.js} +3 -3
- package/dist/{chunk-XFI3AK32.js.map → chunk-QNYP7RPI.js.map} +1 -1
- package/dist/{chunk-YHM77LIP.js → chunk-R2RATIK2.js} +9 -9
- package/dist/{chunk-YHM77LIP.js.map → chunk-R2RATIK2.js.map} +1 -1
- package/dist/{chunk-ZSSNU3UF.js → chunk-TBDMSJVL.js} +12 -12
- package/dist/{chunk-ZSSNU3UF.js.map → chunk-TBDMSJVL.js.map} +1 -1
- package/dist/{chunk-OSPRJZ5T.js → chunk-Y3KP7R2Y.js} +3 -3
- package/dist/{chunk-OSPRJZ5T.js.map → chunk-Y3KP7R2Y.js.map} +1 -1
- package/dist/{chunk-HVAB4TTT.js → chunk-YSDWB6DO.js} +3 -3
- package/dist/{chunk-HVAB4TTT.js.map → chunk-YSDWB6DO.js.map} +1 -1
- package/dist/{chunk-DSZ372PH.js → chunk-ZJLIKMCA.js} +20 -3
- package/dist/chunk-ZJLIKMCA.js.map +1 -0
- package/dist/{contract-addresses-JE3X6DFY.js → contract-addresses-VLAHHXOO.js} +3 -3
- package/dist/{contract-addresses-JE3X6DFY.js.map → contract-addresses-VLAHHXOO.js.map} +1 -1
- package/dist/core.js +2 -2
- package/dist/dapp.js +3 -3
- package/dist/{dist-GHTBO7CD.js → dist-WMYQOYRO.js} +5 -5
- package/dist/{dist-GHTBO7CD.js.map → dist-WMYQOYRO.js.map} +1 -1
- package/dist/enduser.js +4 -4
- package/dist/identity.js +3 -3
- package/dist/index.js +45 -23
- package/dist/index.js.map +1 -1
- package/dist/{index.node-55LOPHNQ.js → index.node-GNYPFVZQ.js} +4 -4
- package/dist/{index.node-55LOPHNQ.js.map → index.node-GNYPFVZQ.js.map} +1 -1
- package/dist/operator.js +3 -3
- package/dist/paymaster.js +3 -3
- package/dist/tokens.js +3 -3
- package/dist/x402.js +3 -3
- package/package.json +34 -9
- package/dist/UserClient-YUHCJJJL.js +0 -6
- package/dist/chunk-DSZ372PH.js.map +0 -1
package/README.md
CHANGED
|
@@ -14,33 +14,100 @@ AAstar SDK provides a complete suite of tools to interact with the AAstar Protoc
|
|
|
14
14
|
|
|
15
15
|
AAstar SDK 提供了一套完整的工具集用于交互 AAstar 协议。它采用了 **"先检查,后执行"** 的设计理念,帮助开发者构建低错误率、健壮的去中心化应用。
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
17
|
+
> **📦 Single-package since v0.20.x | 自 v0.20.x 起单包发布**
|
|
18
|
+
> Everything ships in ONE package — `@aastar/sdk` — with **subpath exports** that preserve the
|
|
19
|
+
> original module structure. The legacy split packages (`@aastar/core`, `@aastar/account`,
|
|
20
|
+
> `@aastar/paymaster`, `@aastar/identity`, `@aastar/tokens`, `@aastar/dapp`, `@aastar/x402`,
|
|
21
|
+
> `@aastar/channel`, `@aastar/enduser`, `@aastar/operator`, `@aastar/admin`, `@aastar/airaccount`)
|
|
22
|
+
> are **deprecated on npm** and now live as subpaths of `@aastar/sdk`.
|
|
23
|
+
> 所有能力合并到 **一个包** `@aastar/sdk`,通过 **子路径导出** 保留原有模块结构;上述老的分包已在 npm 上标记弃用。
|
|
24
|
+
|
|
25
|
+
### Modules (now subpaths) | 模块(现为子路径)
|
|
26
|
+
|
|
27
|
+
| Import | Functionality (功能) |
|
|
28
|
+
|---|---|
|
|
29
|
+
| `@aastar/sdk` | Umbrella: re-exports everything + role-based client factories (总入口 + 角色客户端) |
|
|
30
|
+
| `@aastar/sdk/core` | Shared logic, Roles, ABIs, **per-chain addresses** (共享逻辑、角色、ABI、多链地址) |
|
|
31
|
+
| `@aastar/sdk/account` | Smart Account (ERC-4337) utilities (智能账户工具) |
|
|
32
|
+
| `@aastar/sdk/paymaster` | SuperPaymaster middleware, gas sponsorship (代付中间件) |
|
|
33
|
+
| `@aastar/sdk/identity` | Reputation, SBT, credit limits (声誉、SBT、信用额度) |
|
|
34
|
+
| `@aastar/sdk/tokens` | GToken & xPNTs finance tools (代币金融工具) |
|
|
35
|
+
| `@aastar/sdk/dapp` | React components & hooks — **requires `react` peer dep** (React 组件与 hooks) |
|
|
36
|
+
| `@aastar/sdk/x402` | x402 settlement (x402 结算) |
|
|
37
|
+
| `@aastar/sdk/channel` | Micro-payment channels (微支付通道) |
|
|
38
|
+
| `@aastar/sdk/enduser` · `/operator` · `/admin` | Role lifecycle workflows (角色生命周期) |
|
|
39
|
+
| `@aastar/sdk/airaccount` | KMS WebAuthn passkeys, BLS aggregate signatures, tiered ERC-4337 accounts (Passkey + BLS + 分层签名) |
|
|
40
|
+
|
|
41
|
+
> ⚠️ **`react` / `react-dom` are optional peer deps.** They're only needed for the `@aastar/sdk/dapp`
|
|
42
|
+
> subpath. The root `import '@aastar/sdk'` and all non-UI subpaths work in Node/server with no React.
|
|
43
|
+
> React 是可选 peer 依赖,仅 `@aastar/sdk/dapp` 需要;root 及其它子路径在 Node/服务端无需 React。
|
|
30
44
|
|
|
31
45
|
---
|
|
32
46
|
|
|
33
47
|
## 📦 Installation | 安装
|
|
34
48
|
|
|
35
49
|
```bash
|
|
36
|
-
pnpm add @aastar/sdk viem
|
|
50
|
+
pnpm add @aastar/sdk viem ethers
|
|
37
51
|
# or
|
|
38
|
-
npm install @aastar/sdk viem
|
|
52
|
+
npm install @aastar/sdk viem ethers
|
|
39
53
|
|
|
40
|
-
#
|
|
41
|
-
pnpm add
|
|
54
|
+
# Only if you use the React UI subpath (@aastar/sdk/dapp):
|
|
55
|
+
pnpm add react react-dom
|
|
42
56
|
```
|
|
43
57
|
|
|
58
|
+
> AirAccount / KMS / BLS features are included — no separate install. Import them from `@aastar/sdk/airaccount`.
|
|
59
|
+
> AirAccount / KMS / BLS 能力已内置,无需单独安装,从 `@aastar/sdk/airaccount` 导入即可。
|
|
60
|
+
|
|
61
|
+
### Importing | 导入方式
|
|
62
|
+
|
|
63
|
+
```typescript
|
|
64
|
+
// Everything from the root barrel (no React pulled in):
|
|
65
|
+
import { createEndUserClient, createOperatorClient, CANONICAL_ADDRESSES } from '@aastar/sdk';
|
|
66
|
+
|
|
67
|
+
// …or cherry-pick from a subpath to keep bundles lean:
|
|
68
|
+
import { registryActions } from '@aastar/sdk/core';
|
|
69
|
+
import { KmsManager, P256PasskeySigner } from '@aastar/sdk/airaccount';
|
|
70
|
+
import { useGasless } from '@aastar/sdk/dapp'; // requires react
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## 🌐 Multi-chain | 多链配置
|
|
76
|
+
|
|
77
|
+
Contract addresses are keyed by **chainId** in `CANONICAL_ADDRESSES`, so switching chains means
|
|
78
|
+
switching the viem `chain` + `transport` and passing the matching address set.
|
|
79
|
+
合约地址在 `CANONICAL_ADDRESSES` 中按 **chainId** 分组,切链 = 切换 viem `chain` + `transport` 并传入对应链的地址集。
|
|
80
|
+
|
|
81
|
+
| Network | chainId | Status |
|
|
82
|
+
|---|---|---|
|
|
83
|
+
| Optimism (mainnet) | `10` | ✅ deployed |
|
|
84
|
+
| Sepolia (testnet) | `11155111` | ✅ deployed (primary test target) |
|
|
85
|
+
| OP Sepolia (testnet) | `11155420` | ✅ deployed |
|
|
86
|
+
| Ethereum mainnet | `1` | ⏳ not yet deployed |
|
|
87
|
+
|
|
88
|
+
```typescript
|
|
89
|
+
import { createEndUserClient, CANONICAL_ADDRESSES } from '@aastar/sdk';
|
|
90
|
+
import { sepolia, optimism } from 'viem/chains';
|
|
91
|
+
import { http } from 'viem';
|
|
92
|
+
|
|
93
|
+
// Sepolia testnet
|
|
94
|
+
const test = createEndUserClient({
|
|
95
|
+
chain: sepolia,
|
|
96
|
+
transport: http(process.env.SEPOLIA_RPC_URL),
|
|
97
|
+
addresses: CANONICAL_ADDRESSES[11155111],
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
// Optimism mainnet — same code, just swap chain + transport + address set
|
|
101
|
+
const prod = createEndUserClient({
|
|
102
|
+
chain: optimism,
|
|
103
|
+
transport: http('https://mainnet.optimism.io'),
|
|
104
|
+
addresses: CANONICAL_ADDRESSES[10],
|
|
105
|
+
});
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Helpers for RPC URLs and explorer links live in `@aastar/sdk` too:
|
|
109
|
+
`getNetwork(name)`, `getRpcUrl(name)`, `getChainId(name)`, `getTxUrl(name, hash)`, `getAddressUrl(name, addr)`.
|
|
110
|
+
|
|
44
111
|
---
|
|
45
112
|
|
|
46
113
|
## 📚 Documentation | 文档导航
|
|
@@ -61,17 +128,27 @@ pnpm add @aastar/airaccount
|
|
|
61
128
|
### 1. Initialize Client | 初始化客户端
|
|
62
129
|
|
|
63
130
|
```typescript
|
|
64
|
-
import {
|
|
131
|
+
import { http } from 'viem';
|
|
132
|
+
import { privateKeyToAccount } from 'viem/accounts';
|
|
65
133
|
import { sepolia } from 'viem/chains';
|
|
66
|
-
import {
|
|
134
|
+
import { createEndUserClient, createOperatorClient, CANONICAL_ADDRESSES } from '@aastar/sdk';
|
|
135
|
+
|
|
136
|
+
const account = privateKeyToAccount(process.env.PRIVATE_KEY as `0x${string}`);
|
|
67
137
|
|
|
68
|
-
//
|
|
69
|
-
const
|
|
70
|
-
|
|
138
|
+
// Role-based clients compose viem action factories under the hood.
|
|
139
|
+
const enduser = createEndUserClient({
|
|
140
|
+
chain: sepolia,
|
|
141
|
+
transport: http(process.env.SEPOLIA_RPC_URL),
|
|
142
|
+
account,
|
|
143
|
+
addresses: CANONICAL_ADDRESSES[11155111],
|
|
144
|
+
});
|
|
71
145
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
146
|
+
const operator = createOperatorClient({
|
|
147
|
+
chain: sepolia,
|
|
148
|
+
transport: http(process.env.SEPOLIA_RPC_URL),
|
|
149
|
+
account,
|
|
150
|
+
addresses: CANONICAL_ADDRESSES[11155111],
|
|
151
|
+
});
|
|
75
152
|
```
|
|
76
153
|
|
|
77
154
|
### 2. "Pre-check" Pattern | "预检查" 模式
|
|
@@ -147,17 +224,20 @@ AAstar SDK is built on top of **viem**, ensuring lightweight and type-safe inter
|
|
|
147
224
|
|
|
148
225
|
AAstar SDK 基于 **viem** 构建,确保轻量级和类型安全的交互。它将复杂的合约逻辑抽象为直观的业务原语。
|
|
149
226
|
|
|
150
|
-
|
|
227
|
+
All capabilities are bundled into `@aastar/sdk`; the table below maps each former package to its subpath.
|
|
228
|
+
所有能力已打包进 `@aastar/sdk`,下表对应每个旧分包现在的子路径。
|
|
229
|
+
|
|
230
|
+
| Subpath | Functionality (功能) |
|
|
151
231
|
|---------|---------------------|
|
|
152
|
-
| `@aastar/core` | Shared logic, Roles, RequirementChecker |
|
|
153
|
-
| `@aastar/
|
|
154
|
-
| `@aastar/operator` | Paymaster ops, Staking management |
|
|
155
|
-
| `@aastar/enduser` | User onboarding, SBT minting |
|
|
156
|
-
| `@aastar/tokens` | Finance, Tokenomics, Approval flows |
|
|
157
|
-
| `@aastar/identity` | Reputation, Credit limits, ZK Proofs |
|
|
158
|
-
| `@aastar/paymaster` | EntryPoint & Paymaster low-level API |
|
|
159
|
-
| `@aastar/dapp` | React Components & Integration Hooks |
|
|
160
|
-
| `@aastar/airaccount` | KMS WebAuthn, BLS Signatures, ERC-4337 Tiered Accounts |
|
|
232
|
+
| `@aastar/sdk/core` | Shared logic, Roles, RequirementChecker, per-chain addresses |
|
|
233
|
+
| `@aastar/sdk/account` | Smart Account (ERC-4337) utilities |
|
|
234
|
+
| `@aastar/sdk/operator` | Paymaster ops, Staking management |
|
|
235
|
+
| `@aastar/sdk/enduser` | User onboarding, SBT minting |
|
|
236
|
+
| `@aastar/sdk/tokens` | Finance, Tokenomics, Approval flows |
|
|
237
|
+
| `@aastar/sdk/identity` | Reputation, Credit limits, ZK Proofs |
|
|
238
|
+
| `@aastar/sdk/paymaster` | EntryPoint & Paymaster low-level API |
|
|
239
|
+
| `@aastar/sdk/dapp` | React Components & Integration Hooks (needs `react`) |
|
|
240
|
+
| `@aastar/sdk/airaccount` | KMS WebAuthn, BLS Signatures, ERC-4337 Tiered Accounts |
|
|
161
241
|
|
|
162
242
|
---
|
|
163
243
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"UserClient-
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"UserClient-JMNNZT4P.js"}
|
package/dist/account.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { UserOpClient, createEOAWalletClient, getUserOpHash, packUserOpLimits, toSimpleSmartAccount } from './chunk-
|
|
2
|
-
import './chunk-
|
|
3
|
-
import './chunk-
|
|
1
|
+
export { UserOpClient, createEOAWalletClient, getUserOpHash, packUserOpLimits, toSimpleSmartAccount } from './chunk-YSDWB6DO.js';
|
|
2
|
+
import './chunk-TBDMSJVL.js';
|
|
3
|
+
import './chunk-ZJLIKMCA.js';
|
|
4
4
|
import './chunk-PZ5AY32C.js';
|
|
5
5
|
//# sourceMappingURL=account.js.map
|
|
6
6
|
//# sourceMappingURL=account.js.map
|
package/dist/admin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { ProtocolGovernance } from './chunk-
|
|
2
|
-
import './chunk-
|
|
3
|
-
import './chunk-
|
|
1
|
+
export { ProtocolGovernance } from './chunk-5TDDS3T5.js';
|
|
2
|
+
import './chunk-TBDMSJVL.js';
|
|
3
|
+
import './chunk-ZJLIKMCA.js';
|
|
4
4
|
import './chunk-PZ5AY32C.js';
|
|
5
5
|
//# sourceMappingURL=admin.js.map
|
|
6
6
|
//# sourceMappingURL=admin.js.map
|
package/dist/channel.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { ChannelClient, VOUCHER_TYPES, getVoucherDomain, signVoucher } from './chunk-
|
|
2
|
-
import './chunk-
|
|
3
|
-
import './chunk-
|
|
1
|
+
export { ChannelClient, VOUCHER_TYPES, getVoucherDomain, signVoucher } from './chunk-Y3KP7R2Y.js';
|
|
2
|
+
import './chunk-TBDMSJVL.js';
|
|
3
|
+
import './chunk-ZJLIKMCA.js';
|
|
4
4
|
import './chunk-PZ5AY32C.js';
|
|
5
5
|
//# sourceMappingURL=channel.js.map
|
|
6
6
|
//# sourceMappingURL=channel.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseClient, registryActions } from './chunk-
|
|
1
|
+
import { BaseClient, registryActions } from './chunk-TBDMSJVL.js';
|
|
2
2
|
|
|
3
3
|
// ../admin/dist/ProtocolGovernance.js
|
|
4
4
|
var ProtocolGovernance = class extends BaseClient {
|
|
@@ -102,5 +102,5 @@ var ProtocolGovernance = class extends BaseClient {
|
|
|
102
102
|
};
|
|
103
103
|
|
|
104
104
|
export { ProtocolGovernance };
|
|
105
|
-
//# sourceMappingURL=chunk-
|
|
106
|
-
//# sourceMappingURL=chunk-
|
|
105
|
+
//# sourceMappingURL=chunk-5TDDS3T5.js.map
|
|
106
|
+
//# sourceMappingURL=chunk-5TDDS3T5.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../admin/dist/ProtocolGovernance.js"],"names":[],"mappings":";;;AAUO,IAAM,kBAAA,GAAN,cAAiC,UAAA,CAAW;AAAA,EAC/C,eAAA;AAAA,EACA,iBAAA;AAAA,EACA,YAAY,MAAA,EAAQ;AAChB,IAAA,KAAA,CAAM,MAAM,CAAA;AACZ,IAAA,IAAA,CAAK,kBAAkB,MAAA,CAAO,eAAA;AAC9B,IAAA,IAAA,CAAK,oBAAoB,MAAA,CAAO,iBAAA;AAAA,EACpC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,WAAA,CAAY,QAAA,EAAU,OAAA,EAAS;AASjC,IAAA,MAAM,IAAI,MAAM,2EAA2E,CAAA;AAAA,EAC/F;AAAA;AAAA;AAAA;AAAA,EAIA,MAAM,gBAAA,CAAiB,UAAA,EAAY,OAAA,EAAS;AAIxC,IAAA,MAAM,IAAI,MAAM,sCAAsC,CAAA;AAAA,EAC1D;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,iBAAA,CAAkB,SAAA,EAAW,OAAA,EAAS;AACxC,IAAA,MAAM,QAAA,GAAW,eAAA,CAAgB,IAAA,CAAK,eAAe,CAAA;AACrD,IAAA,OAAO,MAAM,QAAA,CAAS,IAAA,CAAK,MAAM,EAAE,iBAAA,CAA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/L1 Actions\n/**\n * ProtocolGovernance - L3 Pattern\n *\n * Responsibilities:\n * 1. Global Protocol Parameter Management (Registry, EntryPoint)\n * 2. High-level Governance Operations (DAO Transfer, Upgrades)\n * 3. SuperPaymaster & Module Approval\n */\nexport class ProtocolGovernance extends BaseClient {\n registryAddress;\n entryPointAddress;\n constructor(config) {\n super(config);\n this.registryAddress = config.registryAddress;\n this.entryPointAddress = config.entryPointAddress;\n }\n // ===========================================\n // 1. Global Parameter Management\n // ===========================================\n /**\n * Update the Global Treasury Address where protocol fees are collected\n */\n async setTreasury(treasury, options) {\n // Note: Registry might not have direct setTreasury if it relies on SuperPaymaster's config.\n // Assuming Registry has ownership pointers or config pointers.\n // If Logic resides in SuperPaymaster, we would use superPaymasterActions.\n // Based on provided ABI/Actions, Registry manages Role Configs mainly.\n // Let's assume we are updating a System Role or similar global config if available,\n // OR adhering to what registryActions provides.\n // Checking registryActions... it has 'transferOwnership' but maybe not direct 'setTreasury' depending on version.\n // If strictly following ABI, we might need to update a specific Role Parameter (e.g. AOA/Super config).\n throw new Error(\"Method not mapped to RegistryABI v1. Please verify contract capabilities.\");\n }\n /**\n * Update the supported EntryPoint address\n */\n async updateEntryPoint(entryPoint, options) {\n // Placeholder: Real implementation depends on if Registry stores EntryPoint\n // registryActions typically provides getters. Setters usually restricted to Owner.\n // If action not available, throw standard error.\n throw new Error(\"Method not mapped to RegistryABI v1.\");\n }\n // ===========================================\n // 2. Role & Module Governance\n // ===========================================\n /**\n * Approve a new SuperPaymaster contract address\n */\n async setSuperPaymaster(paymaster, options) {\n const registry = registryActions(this.registryAddress);\n return await registry(this.client).setSuperPaymaster({\n paymaster,\n account: options?.account\n });\n }\n /**\n * Set the Staking contract address\n */\n async setStaking(staking, options) {\n const registry = registryActions(this.registryAddress);\n return await registry(this.client).setStaking({\n staking,\n account: options?.account\n });\n }\n /**\n * Configure a Role's parameters (Admin only).\n * Reads the current on-chain config first, then merges the provided overrides\n * and writes back the full struct via configureRole.\n */\n async configureRole(params, options) {\n const registry = registryActions(this.registryAddress)(this.client);\n const current = await registry.getRoleConfig({ roleId: params.roleId });\n return await registry.configureRole({\n roleId: params.roleId,\n config: {\n ...current,\n ...(params.minStake !== undefined && { minStake: params.minStake }),\n ...(params.ticketPrice !== undefined && { ticketPrice: params.ticketPrice }),\n ...(params.exitFeePercent !== undefined && { exitFeePercent: params.exitFeePercent }),\n ...(params.minExitFee !== undefined && { minExitFee: params.minExitFee }),\n },\n account: options?.account,\n });\n }\n // ===========================================\n // 3. Transfer to DAO (Exit/Upgrade)\n // ===========================================\n /**\n * Transfer Protocol Ownership to a DAO (Multisig/Timelock)\n * This is the final step of \"Protocol Admin\" lifecycle.\n */\n async transferToDAO(daoAddress, options) {\n const registry = registryActions(this.registryAddress);\n return await registry(this.client).transferOwnership({\n newOwner: daoAddress,\n account: options?.account\n });\n }\n // ===========================================\n // 4. Query Capabilities\n // ===========================================\n async getProtocolParams() {\n const registry = registryActions(this.registryAddress)(this.client); // Read-only via Client\n // Parallel fetch\n const [sp, staking] = await Promise.all([\n registry.SUPER_PAYMASTER(),\n registry.GTOKEN_STAKING()\n ]);\n return {\n minStake: 0n, // Global default not directly exposed, usually per role\n treasury: await registry.owner(), // Approximation for now\n entryPoint: this.entryPointAddress,\n superPaymaster: sp\n };\n }\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseClient, registryActions, tokenActions, paymasterFactoryActions, PaymasterABI, superPaymasterActions, paymasterActions, dvtActions, aggregatorActions } from './chunk-
|
|
1
|
+
import { BaseClient, registryActions, tokenActions, paymasterFactoryActions, PaymasterABI, superPaymasterActions, paymasterActions, dvtActions, aggregatorActions } from './chunk-TBDMSJVL.js';
|
|
2
2
|
import { parseEther } from 'viem';
|
|
3
3
|
|
|
4
4
|
var PaymasterOperatorClient = class extends BaseClient {
|
|
@@ -506,7 +506,7 @@ var OperatorLifecycle = class extends PaymasterOperatorClient {
|
|
|
506
506
|
depositAmount: params.depositAmount
|
|
507
507
|
}, options);
|
|
508
508
|
hashes.push(h);
|
|
509
|
-
const factory = await import('./index.node-
|
|
509
|
+
const factory = await import('./index.node-GNYPFVZQ.js').then((m) => m.xPNTsFactoryActions(this.xpntsFactory)(this.getStartPublicClient()));
|
|
510
510
|
const token = await factory.getTokenAddress({ community: this.getAddress() });
|
|
511
511
|
if (token && token !== "0x0000000000000000000000000000000000000000") {
|
|
512
512
|
const hConfig = await this.configureOperator(
|
|
@@ -574,5 +574,5 @@ var OperatorLifecycle = class extends PaymasterOperatorClient {
|
|
|
574
574
|
};
|
|
575
575
|
|
|
576
576
|
export { OperatorLifecycle, PaymasterOperatorClient, ProposalState, ProtocolClient };
|
|
577
|
-
//# sourceMappingURL=chunk-
|
|
578
|
-
//# sourceMappingURL=chunk-
|
|
577
|
+
//# sourceMappingURL=chunk-KL6SCEIU.js.map
|
|
578
|
+
//# sourceMappingURL=chunk-KL6SCEIU.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../operator/dist/PaymasterOperatorClient.js","../../operator/dist/ProtocolClient.js","../../operator/dist/OperatorLifecycle.js"],"names":["ProposalState"],"mappings":";;;AAMO,IAAM,uBAAA,GAAN,cAAsC,UAAA,CAAW;AAAA,EACpD,qBAAA;AAAA,EACA,YAAA;AAAA,EACA,eAAA;AAAA,EACA,YAAA;AAAA,EACA,YAAY,MAAA,EAAQ;AAChB,IAAA,KAAA,CAAM,MAAM,CAAA;AACZ,IAAA,IAAA,CAAK,wBAAwB,MAAA,CAAO,qBAAA;AACpC,IAAA,IAAA,CAAK,eAAe,MAAA,CAAO,YAAA;AAC3B,IAAA,IAAA,CAAK,eAAA,GAAkB,OAAO,sBAAA,IAA0B,4CAAA;AACxD,IAAA,IAAA,CAAK,YAAA,GAAe,OAAO,mBAAA,IAAuB,4CAAA;AAAA,EACtD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;A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mB,SAAA,EAAW,KAAA,CAAM,SAAS,OAAO,CAAA;AAC5E,MAAA,MAAA,CAAO,KAAK,IAAI,CAAA;AAAA,IACpB;AAIA,IAAA,MAAM,MAAA,GAAS,KAAK,oBAAA,EAAqB;AACzC,IAAA,MAAM,QAAA,GAAW,eAAA,CAAgB,IAAA,CAAK,eAAe,CAAA;AACrD,IAAA,MAAM,iBAAiB,eAAA,CAAgB,IAAA,CAAK,eAAe,CAAA,CAAE,KAAK,MAAM,CAAA;AAGxE,IAAA,MAAM,oBAAA,GAAuB,MAAM,QAAA,CAAS,MAAM,EAAE,oBAAA,EAAqB;AACzE,IAAA,MAAM,OAAA,GAAU,MAAM,QAAA,CAAS,MAAM,CAAA,CAAE,OAAA,CAAQ,EAAE,IAAA,EAAM,IAAA,CAAK,UAAA,EAAW,EAAG,MAAA,EAAQ,sBAAsB,CAAA;AACxG,IAAA,IAAI,OAAA,EAAS;AACT,MAAA,MAAM,KAAA,GAAQ,MAAM,cAAA,CAAe,QAAA,CAAS,EAAE,QAAQ,oBAAA,EAAsB,OAAA,EAAS,OAAA,EAAS,OAAA,EAAS,CAAA;AACvG,MAAA,MAAA,CAAO,KAAK,KAAK,CAAA;AAAA,IACrB;AACA,IAAA,OAAO,MAAA;AAAA,EACX;AAAA;AAAA,EAEA,MAAM,eAAA,GAAkB;AACpB,IAAA,IAAI,CAAC,IAAA,CAAK,YAAA;AACN,MAAA,OAAO,EAAA;AACX,IAAA,MAAM,KAAA,GAAQ,YAAA,EAAa,CAAE,IAAA,CAAK,sBAAsB,CAAA;AACxD,IAAA,OAAO,MAAM,KAAA,CAAM,SAAA,CAAU,EAAE,KAAA,EAAO,IAAA,CAAK,YAAA,EAAc,OAAA,EAAS,IAAA,CAAK,UAAA,EAAW,EAAG,CAAA;AAAA,EACzF;AACJ","file":"chunk-O3Y7II3B.js","sourcesContent":["import { parseEther } from 'viem';\nimport { BaseClient, PaymasterABI } from '@aastar/core';\nimport { superPaymasterActions, tokenActions, paymasterActions, registryActions, paymasterFactoryActions } from '@aastar/core';\n/**\n * Client for Paymaster Operators (ROLE_PAYMASTER_SUPER)\n */\nexport class PaymasterOperatorClient extends BaseClient {\n superPaymasterAddress;\n tokenAddress;\n ethUsdPriceFeed;\n xpntsFactory;\n constructor(config) {\n super(config);\n this.superPaymasterAddress = config.superPaymasterAddress;\n this.tokenAddress = config.tokenAddress;\n this.ethUsdPriceFeed = config.ethUsdPriceFeedAddress || '0x694AA1769357215DE4FAC081bf1f309aDC325306'; // Default Sepolia\n this.xpntsFactory = config.xpntsFactoryAddress || '0x0000000000000000000000000000000000000000'; // Should be provided\n }\n // ========================================\n // 0. 注册与入驻 (One-Stop Registration)\n // ========================================\n /**\n * Register as SuperPaymaster Operator (one-stop API).\n * This method handles all necessary steps:\n * 1. Checks prerequisites (must have ROLE_COMMUNITY)\n * 2. Checks and approves GToken to GTokenStaking\n * 3. Registers ROLE_PAYMASTER_SUPER\n * 4. Optionally deposits collateral to SuperPaymaster\n *\n * @param params Registration parameters\n * @param options Transaction options\n * @returns Transaction hash of role registration\n */\n async registerAsSuperPaymasterOperator(params, options) {\n try {\n const registryAddr = this.requireRegistry();\n const gTokenAddr = this.requireGToken();\n const gTokenStakingAddr = this.requireGTokenStaking();\n const registry = registryActions(registryAddr);\n const gToken = tokenActions();\n const publicClient = this.getStartPublicClient();\n // 1. Check prerequisites\n const ROLE_COMMUNITY = await registry(publicClient).ROLE_COMMUNITY();\n const hasCommunity = await registry(publicClient).hasRole({\n user: this.getAddress(),\n roleId: ROLE_COMMUNITY\n });\n if (!hasCommunity) {\n throw new Error('Must have ROLE_COMMUNITY before registering as SuperPaymaster operator');\n }\n // 2. Check if already has role\n const ROLE_PAYMASTER_SUPER = await registry(publicClient).ROLE_PAYMASTER_SUPER();\n const hasSuper = await registry(publicClient).hasRole({\n user: this.getAddress(),\n roleId: ROLE_PAYMASTER_SUPER\n });\n if (hasSuper) {\n // Still handle deposit if requested\n if (params?.depositAmount) {\n return this.depositCollateral(params.depositAmount, options);\n }\n throw new Error('Already registered as SuperPaymaster operator');\n }\n // 3. Prepare stake amount (default 50 GToken as per Registry config)\n const stakeAmount = params?.stakeAmount || parseEther('50');\n // 4. Check and approve GToken to GTokenStaking\n const allowance = await gToken(publicClient).allowance({\n token: gTokenAddr,\n owner: this.getAddress(),\n spender: gTokenStakingAddr\n });\n if (allowance < stakeAmount) {\n const approveHash = await gToken(this.client).approve({\n token: gTokenAddr,\n spender: gTokenStakingAddr,\n amount: stakeAmount * 2n, // Approve 2x for future use\n account: options?.account\n });\n await publicClient.waitForTransactionReceipt({ hash: approveHash });\n }\n // 5. Register ROLE_PAYMASTER_SUPER\n const registerHash = await registry(this.client).registerRoleSelf({\n roleId: ROLE_PAYMASTER_SUPER,\n data: '0x', // SuperPaymaster role doesn't need special data\n account: options?.account\n });\n // Wait for registration to complete\n await publicClient.waitForTransactionReceipt({ hash: registerHash });\n // 6. Optional: Deposit collateral to SuperPaymaster\n if (params?.depositAmount) {\n await this.depositCollateral(params.depositAmount, options);\n }\n return registerHash;\n }\n catch (error) {\n throw error;\n }\n }\n /**\n * Deploy a new Paymaster V4 and Register as AOA Operator (one-stop API).\n * This method handles:\n * 1. Checks prerequisites (ROLE_COMMUNITY)\n * 2. Predicts new Paymaster address\n * 3. Deploys Paymaster V4 via Factory\n * 4. Registers ROLE_PAYMASTER_AOA with staking\n *\n * @param params Deployment parameters\n * @param options Transaction options\n * @returns Object containing new paymaster address and transaction hashes\n */\n async deployAndRegisterPaymasterV4(params, options) {\n try {\n const registryAddr = this.requireRegistry();\n const gTokenAddr = this.requireGToken();\n const gTokenStakingAddr = this.requireGTokenStaking();\n const factoryAddr = this.requirePaymasterFactory();\n const registry = registryActions(registryAddr);\n const gToken = tokenActions();\n const factory = paymasterFactoryActions(factoryAddr);\n const publicClient = this.getStartPublicClient();\n const account = options?.account || this.client.account || this.getAddress();\n const accountAddr = typeof account === 'string' ? account : account.address;\n // 1. Check prerequisites (ROLE_COMMUNITY)\n const ROLE_COMMUNITY = await registry(publicClient).ROLE_COMMUNITY();\n const hasCommunity = await registry(publicClient).hasRole({\n user: accountAddr,\n roleId: ROLE_COMMUNITY\n });\n if (!hasCommunity) {\n throw new Error('Must have ROLE_COMMUNITY before deploying Paymaster V4');\n }\n // 2. Deployment (Idempotent Check)\n const existingPaymaster = await factory(publicClient).getPaymaster({ owner: accountAddr });\n let deployHash = '0x0000000000000000000000000000000000000000000000000000000000000000';\n let paymasterAddress;\n if (existingPaymaster && existingPaymaster !== '0x0000000000000000000000000000000000000000') {\n console.log(` ℹ️ Paymaster already deployed at: ${existingPaymaster}`);\n paymasterAddress = existingPaymaster;\n }\n else {\n console.log(' 🛠️ Deploying Paymaster V4 with args:', {\n entryPoint: this.requireEntryPoint(),\n owner: accountAddr,\n priceFeed: this.ethUsdPriceFeed,\n factory: factoryAddr\n });\n const { encodeFunctionData } = await import('viem');\n const initData = encodeFunctionData({\n abi: PaymasterABI,\n functionName: 'initialize',\n args: [\n this.requireEntryPoint(), // EntryPoint v0.7\n accountAddr,\n accountAddr, // Treasury defaults to owner\n this.ethUsdPriceFeed,\n 200n, // serviceFeeRate (2%)\n parseEther('0.1'), // maxGasCostCap\n 3600n // priceStalenessThreshold (1 hour)\n ]\n });\n deployHash = await factory(this.client).deployPaymaster({\n version: params?.version,\n initData,\n account\n });\n await publicClient.waitForTransactionReceipt({ hash: deployHash });\n paymasterAddress = await factory(publicClient).getPaymaster({ owner: accountAddr });\n }\n if (!paymasterAddress || paymasterAddress === '0x0000000000000000000000000000000000000000') {\n throw new Error('Failed to retrieve Paymaster address from Factory');\n }\n // 3. Register ROLE_PAYMASTER_AOA\n const ROLE_PAYMASTER_AOA = await registry(publicClient).ROLE_PAYMASTER_AOA();\n const hasAOA = await registry(publicClient).hasRole({\n user: accountAddr,\n roleId: ROLE_PAYMASTER_AOA\n });\n if (hasAOA) {\n return { paymasterAddress, deployHash, registerHash: '0x0000000000000000000000000000000000000000000000000000000000000000' };\n }\n const stakeAmount = params?.stakeAmount || parseEther('30');\n const allowance = await gToken(publicClient).allowance({\n token: gTokenAddr,\n owner: accountAddr,\n spender: gTokenStakingAddr\n });\n if (allowance < stakeAmount) {\n const approveHash = await gToken(this.client).approve({\n token: gTokenAddr,\n spender: gTokenStakingAddr,\n amount: stakeAmount * 2n,\n account: account\n });\n await publicClient.waitForTransactionReceipt({ hash: approveHash });\n }\n const { encodeAbiParameters, parseAbiParameters } = await import('viem');\n let roleData = '0x';\n if (stakeAmount > 0) {\n roleData = encodeAbiParameters(parseAbiParameters('uint256'), [stakeAmount]);\n }\n const registerHash = await registry(this.client).registerRoleSelf({\n roleId: ROLE_PAYMASTER_AOA,\n data: roleData,\n account: account\n });\n await publicClient.waitForTransactionReceipt({ hash: registerHash });\n return {\n paymasterAddress,\n deployHash,\n registerHash\n };\n }\n catch (error) {\n throw error;\n }\n }\n /**\n * Deposit collateral (aPNTs/GToken) to SuperPaymaster.\n * This is a helper method used by registerAsSuperPaymasterOperator.\n */\n async depositCollateral(amount, options) {\n try {\n const pm = superPaymasterActions(this.superPaymasterAddress);\n const publicClient = this.getStartPublicClient();\n // V3.7: Dynamically fetch the token expected by SuperPaymaster\n const depositToken = await pm(publicClient).APNTS_TOKEN();\n const token = tokenActions();\n // Approve SuperPaymaster to spend the token (usually aPNTs on Sepolia)\n const allowance = await token(publicClient).allowance({\n token: depositToken,\n owner: this.getAddress(),\n spender: this.superPaymasterAddress\n });\n if (allowance < amount) {\n const approveHash = await token(this.client).approve({\n token: depositToken,\n spender: this.superPaymasterAddress,\n amount,\n account: options?.account\n });\n await publicClient.waitForTransactionReceipt({ hash: approveHash });\n }\n // Deposit to SuperPaymaster\n return pm(this.client).deposit({\n amount,\n account: options?.account\n });\n }\n catch (error) {\n throw error;\n }\n }\n /**\n * Configure operator parameters (Token, Treasury).\n * Exchange rate is now read live from xPNTsToken.exchangeRate() at runtime.\n * If parameters are undefined, existing values are preserved.\n */\n async configureOperator(xPNTsToken, treasury, options) {\n try {\n const sp = superPaymasterActions(this.superPaymasterAddress);\n const publicClient = this.getStartPublicClient();\n // Fetch current config to preserve missing values\n const currentConfig = await sp(publicClient).operators({ operator: this.getAddress() });\n const currentToken = currentConfig.xPNTsToken;\n const currentTreasury = currentConfig.treasury;\n return await sp(this.client).configureOperator({\n xPNTsToken: xPNTsToken || currentToken,\n opTreasury: treasury || currentTreasury,\n account: options?.account\n });\n }\n catch (error) {\n throw error;\n }\n }\n async withdrawCollateral(to, amount, options) {\n try {\n const sp = superPaymasterActions(this.superPaymasterAddress);\n return await sp(this.client).withdrawTo({\n to,\n amount,\n account: options?.account\n });\n }\n catch (error) {\n throw error;\n }\n }\n async isOperator(operator) {\n try {\n const sp = superPaymasterActions(this.superPaymasterAddress);\n const config = await sp(this.getStartPublicClient()).operators({ operator });\n return config.isConfigured;\n }\n catch (error) {\n return false;\n }\n }\n async getOperatorDetails(operator) {\n try {\n const target = operator || this.getAddress();\n const sp = superPaymasterActions(this.superPaymasterAddress);\n return await sp(this.getStartPublicClient()).operators({ operator: target });\n }\n catch (error) {\n throw error;\n }\n }\n async initiateExit(options) {\n try {\n const sp = superPaymasterActions(this.superPaymasterAddress);\n return await sp(this.client).unlockStake({\n account: options?.account\n });\n }\n catch (error) {\n throw error;\n }\n }\n async withdrawStake(to, options) {\n try {\n const sp = superPaymasterActions(this.superPaymasterAddress);\n return await sp(this.client).withdrawStake({\n to,\n account: options?.account\n });\n }\n catch (error) {\n throw error;\n }\n }\n // ========================================\n // 3. 支付代币管理 (基于 PaymasterActions)\n // ========================================\n async addGasToken(token, price, options) {\n try {\n const pm = paymasterActions(this.superPaymasterAddress);\n return await pm(this.client).setTokenPrice({\n token,\n price,\n account: options?.account\n });\n }\n catch (error) {\n throw error;\n }\n }\n async getTokenPrice(token) {\n try {\n const pm = paymasterActions(this.superPaymasterAddress);\n return await pm(this.getStartPublicClient()).tokenPrices({ token });\n }\n catch (error) {\n throw error;\n }\n }\n async setupPaymasterDeposit(params, options) {\n try {\n const pm = paymasterActions(params.paymaster);\n return await pm(this.client).depositFor({\n user: params.user,\n token: params.token,\n amount: params.amount,\n account: options?.account\n });\n }\n catch (error) {\n throw error;\n }\n }\n}\n","import { BaseClient } from '@aastar/core';\nimport { dvtActions, aggregatorActions, superPaymasterActions } from '@aastar/core';\nexport var ProposalState;\n(function (ProposalState) {\n ProposalState[ProposalState[\"Pending\"] = 0] = \"Pending\";\n ProposalState[ProposalState[\"Active\"] = 1] = \"Active\";\n ProposalState[ProposalState[\"Canceled\"] = 2] = \"Canceled\";\n ProposalState[ProposalState[\"Defeated\"] = 3] = \"Defeated\";\n ProposalState[ProposalState[\"Succeeded\"] = 4] = \"Succeeded\";\n ProposalState[ProposalState[\"Queued\"] = 5] = \"Queued\";\n ProposalState[ProposalState[\"Expired\"] = 6] = \"Expired\";\n ProposalState[ProposalState[\"Executed\"] = 7] = \"Executed\";\n})(ProposalState || (ProposalState = {}));\n/**\n * Client for Protocol Governors and Validators (Infrastructure)\n */\nexport class ProtocolClient extends BaseClient {\n dvtValidatorAddress;\n blsAggregatorAddress;\n superPaymasterAddress;\n constructor(config) {\n super(config);\n this.dvtValidatorAddress = config.dvtValidatorAddress;\n this.blsAggregatorAddress = config.blsAggregatorAddress;\n this.superPaymasterAddress = config.superPaymasterAddress;\n }\n // ========================================\n // 1. 提案管理 (DVT)\n // ========================================\n /**\n * Create a new proposal\n */\n async createProposal(target, calldata, description, options) {\n try {\n const dvt = dvtActions(this.dvtValidatorAddress)(this.client);\n // Mapping general \"createProposal\" to \"createSlashProposal\" for now\n // Assuming Governance uses Validator logic or this Client is for Slash.\n // Using createSlashProposal as the available action.\n return await dvt.createSlashProposal({\n operator: target,\n level: 1, // Default level\n reason: description,\n account: options?.account\n });\n }\n catch (error) {\n throw error;\n }\n }\n async signProposal(proposalId, signature = '0x', options) {\n try {\n const dvt = dvtActions(this.dvtValidatorAddress)(this.client);\n return await dvt.signSlashProposal({\n proposalId,\n signature,\n account: options?.account\n });\n }\n catch (error) {\n throw error;\n }\n }\n /**\n * Execute a proposal with collected signatures\n */\n async executeWithProof(proposalId, signatures, options) {\n try {\n // Mock proof generation logic or placeholder\n const proof = '0x';\n const dvt = dvtActions(this.dvtValidatorAddress)(this.client);\n return await dvt.executeSlashWithProof({\n proposalId,\n repUsers: [], // Needs real data in production\n newScores: [],\n epoch: 0n,\n proof,\n account: options?.account\n });\n }\n catch (error) {\n throw error;\n }\n }\n // ========================================\n // 2. 验证器管理 / BLS\n // ========================================\n async registerBLSKey(publicKey, options) {\n try {\n if (!this.blsAggregatorAddress) {\n throw new Error('BLS Aggregator address required for this client');\n }\n // Aggregator actions now handle the type internally or via mapping\n const agg = aggregatorActions(this.blsAggregatorAddress)(this.client);\n return await agg.registerBLSPublicKey({\n validator: this.getAddress(),\n publicKey,\n account: options?.account\n });\n }\n catch (error) {\n throw error;\n }\n }\n // ========================================\n // 3. 全局参数管理 (Admin)\n // ========================================\n async setProtocolFee(bps, options) {\n try {\n if (!this.superPaymasterAddress) {\n throw new Error('SuperPaymaster address required for this client');\n }\n const sp = superPaymasterActions(this.superPaymasterAddress);\n return await sp(this.client).setProtocolFee({\n newFeeBPS: bps,\n account: options?.account\n });\n }\n catch (error) {\n throw error;\n }\n }\n async setTreasury(treasury, options) {\n try {\n if (!this.superPaymasterAddress) {\n throw new Error('SuperPaymaster address required for this client');\n }\n const sp = superPaymasterActions(this.superPaymasterAddress);\n return await sp(this.client).setTreasury({\n treasury,\n account: options?.account\n });\n }\n catch (error) {\n throw error;\n }\n }\n}\n","import { PaymasterOperatorClient } from './PaymasterOperatorClient.js';\nimport { tokenActions, registryActions } from '@aastar/core'; // L2/L1 Actions\n/**\n * OperatorLifecycle - L3 Pattern\n *\n * Responsibilities:\n * 1. Managing the complete lifecycle of a Paymaster Operator\n * 2. Unifying setup (onboard), operation (config), and exit (withdraw)\n */\nexport class OperatorLifecycle extends PaymasterOperatorClient {\n constructor(config) {\n super(config);\n }\n // ===========================================\n // 1. Setup Phase (Onboarding)\n // ===========================================\n /**\n * Check if the account is ready to become an operator\n * (e.g., has GToken, has ROLE_COMMUNITY, etc.)\n */\n async checkReadiness() {\n const isOp = await this.isOperator(this.getAddress());\n // For SuperPaymaster, balance is 'aPNTsBalance' (Collateral)\n const details = await this.getOperatorDetails();\n const balance = details.aPNTsBalance || 0n;\n return {\n isConfigured: isOp,\n isActive: isOp, // Simplification\n balance\n };\n }\n /**\n * One-click Setup: Register + Deposit + Deploy Node\n * Wraps existing registerAsSuperPaymasterOperator or deployAndRegisterPaymasterV4\n */\n async setupNode(params, options) {\n const hashes = [];\n if (params.type === 'SUPER') {\n const h = await this.registerAsSuperPaymasterOperator({\n stakeAmount: params.stakeAmount,\n depositAmount: params.depositAmount\n }, options);\n hashes.push(h);\n // Fetch Token Address and Configure\n const factory = await import('@aastar/core').then(m => m.xPNTsFactoryActions(this.xpntsFactory)(this.getStartPublicClient()));\n const token = await factory.getTokenAddress({ community: this.getAddress() });\n if (token && token !== '0x0000000000000000000000000000000000000000') {\n const hConfig = await this.configureOperator(token, this.getAddress(), // Default treasury to self\n options);\n hashes.push(hConfig);\n }\n }\n else {\n const result = await this.deployAndRegisterPaymasterV4({\n stakeAmount: params.stakeAmount\n }, options);\n hashes.push(result.deployHash);\n hashes.push(result.registerHash);\n }\n return hashes;\n }\n // ===========================================\n // 2. Operational Phase (Config & Funds)\n // ===========================================\n // Inherits: addGasToken, configureOperator, depositCollateral from PaymasterOperatorClient\n async getOperatorStats() {\n return await this.getOperatorDetails();\n }\n // ===========================================\n // 3. Exit Phase (Withdraw & Leave)\n // ===========================================\n /**\n * Start the exit process: Unstake from Registry/SuperPaymaster and Unlock funds\n */\n async initiateExit(options) {\n // 1. Unlock Stake from SuperPaymaster (if applicable)\n return await super.initiateExit(options);\n }\n /**\n * Finalize exit: Withdraw all funds (Collateral + Rewards)\n */\n async withdrawAllFunds(to, options) {\n const recipient = to || this.getAddress();\n const hashes = [];\n // 1. Withdraw Collateral from SuperPaymaster (if any)\n // Note: We need to know the balance to withdraw exact amount.\n // For current L3 pattern, we assume the user tracks it or we fetch it.\n const stats = await this.checkReadiness();\n if (stats.balance > 0n) {\n const hCol = await this.withdrawCollateral(recipient, stats.balance, options);\n hashes.push(hCol);\n }\n // 2. Exit Role in Registry (Unstake GToken)\n // This will fail if lock duration > 0 and not yet cooldown.\n // Or it will initiate cooldown.\n const client = this.getStartPublicClient();\n const registry = registryActions(this.registryAddress); // Use local registry address\n const registryWriter = registryActions(this.registryAddress)(this.client);\n // Check if we have the role\n // For Super Operator\n const ROLE_PAYMASTER_SUPER = await registry(client).ROLE_PAYMASTER_SUPER();\n const hasRole = await registry(client).hasRole({ user: this.getAddress(), roleId: ROLE_PAYMASTER_SUPER });\n if (hasRole) {\n const hExit = await registryWriter.exitRole({ roleId: ROLE_PAYMASTER_SUPER, account: options?.account });\n hashes.push(hExit);\n }\n return hashes;\n }\n // Helper: Get GToken Balance\n async getTokenBalance() {\n if (!this.tokenAddress)\n return 0n;\n const token = tokenActions()(this.getStartPublicClient());\n return await token.balanceOf({ token: this.tokenAddress, account: this.getAddress() });\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../../operator/dist/PaymasterOperatorClient.js","../../operator/dist/ProtocolClient.js","../../operator/dist/OperatorLifecycle.js"],"names":["ProposalState"],"mappings":";;;AAMO,IAAM,uBAAA,GAAN,cAAsC,UAAA,CAAW;AAAA,EACpD,qBAAA;AAAA,EACA,YAAA;AAAA,EACA,eAAA;AAAA,EACA,YAAA;AAAA,EACA,YAAY,MAAA,EAAQ;AAChB,IAAA,KAAA,CAAM,MAAM,CAAA;AACZ,IAAA,IAAA,CAAK,wBAAwB,MAAA,CAAO,qBAAA;AACpC,IAAA,IAAA,CAAK,eAAe,MAAA,CAAO,YAAA;AAC3B,IAAA,IAAA,CAAK,eAAA,GAAkB,OAAO,sBAAA,IAA0B,4CAAA;AACxD,IAAA,IAAA,CAAK,YAAA,GAAe,OAAO,mBAAA,IAAuB,4CAAA;AAAA,EACtD;AAAA;AAAA;AAA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seEther } from 'viem';\nimport { BaseClient, PaymasterABI } from '@aastar/core';\nimport { superPaymasterActions, tokenActions, paymasterActions, registryActions, paymasterFactoryActions } from '@aastar/core';\n/**\n * Client for Paymaster Operators (ROLE_PAYMASTER_SUPER)\n */\nexport class PaymasterOperatorClient extends BaseClient {\n superPaymasterAddress;\n tokenAddress;\n ethUsdPriceFeed;\n xpntsFactory;\n constructor(config) {\n super(config);\n this.superPaymasterAddress = config.superPaymasterAddress;\n this.tokenAddress = config.tokenAddress;\n this.ethUsdPriceFeed = config.ethUsdPriceFeedAddress || '0x694AA1769357215DE4FAC081bf1f309aDC325306'; // Default Sepolia\n this.xpntsFactory = config.xpntsFactoryAddress || '0x0000000000000000000000000000000000000000'; // Should be provided\n }\n // ========================================\n // 0. 注册与入驻 (One-Stop Registration)\n // ========================================\n /**\n * Register as SuperPaymaster Operator (one-stop API).\n * This method handles all necessary steps:\n * 1. Checks prerequisites (must have ROLE_COMMUNITY)\n * 2. Checks and approves GToken to GTokenStaking\n * 3. Registers ROLE_PAYMASTER_SUPER\n * 4. Optionally deposits collateral to SuperPaymaster\n *\n * @param params Registration parameters\n * @param options Transaction options\n * @returns Transaction hash of role registration\n */\n async registerAsSuperPaymasterOperator(params, options) {\n try {\n const registryAddr = this.requireRegistry();\n const gTokenAddr = this.requireGToken();\n const gTokenStakingAddr = this.requireGTokenStaking();\n const registry = registryActions(registryAddr);\n const gToken = tokenActions();\n const publicClient = this.getStartPublicClient();\n // 1. Check prerequisites\n const ROLE_COMMUNITY = await registry(publicClient).ROLE_COMMUNITY();\n const hasCommunity = await registry(publicClient).hasRole({\n user: this.getAddress(),\n roleId: ROLE_COMMUNITY\n });\n if (!hasCommunity) {\n throw new Error('Must have ROLE_COMMUNITY before registering as SuperPaymaster operator');\n }\n // 2. Check if already has role\n const ROLE_PAYMASTER_SUPER = await registry(publicClient).ROLE_PAYMASTER_SUPER();\n const hasSuper = await registry(publicClient).hasRole({\n user: this.getAddress(),\n roleId: ROLE_PAYMASTER_SUPER\n });\n if (hasSuper) {\n // Still handle deposit if requested\n if (params?.depositAmount) {\n return this.depositCollateral(params.depositAmount, options);\n }\n throw new Error('Already registered as SuperPaymaster operator');\n }\n // 3. Prepare stake amount (default 50 GToken as per Registry config)\n const stakeAmount = params?.stakeAmount || parseEther('50');\n // 4. Check and approve GToken to GTokenStaking\n const allowance = await gToken(publicClient).allowance({\n token: gTokenAddr,\n owner: this.getAddress(),\n spender: gTokenStakingAddr\n });\n if (allowance < stakeAmount) {\n const approveHash = await gToken(this.client).approve({\n token: gTokenAddr,\n spender: gTokenStakingAddr,\n amount: stakeAmount * 2n, // Approve 2x for future use\n account: options?.account\n });\n await publicClient.waitForTransactionReceipt({ hash: approveHash });\n }\n // 5. Register ROLE_PAYMASTER_SUPER\n const registerHash = await registry(this.client).registerRoleSelf({\n roleId: ROLE_PAYMASTER_SUPER,\n data: '0x', // SuperPaymaster role doesn't need special data\n account: options?.account\n });\n // Wait for registration to complete\n await publicClient.waitForTransactionReceipt({ hash: registerHash });\n // 6. Optional: Deposit collateral to SuperPaymaster\n if (params?.depositAmount) {\n await this.depositCollateral(params.depositAmount, options);\n }\n return registerHash;\n }\n catch (error) {\n throw error;\n }\n }\n /**\n * Deploy a new Paymaster V4 and Register as AOA Operator (one-stop API).\n * This method handles:\n * 1. Checks prerequisites (ROLE_COMMUNITY)\n * 2. Predicts new Paymaster address\n * 3. Deploys Paymaster V4 via Factory\n * 4. Registers ROLE_PAYMASTER_AOA with staking\n *\n * @param params Deployment parameters\n * @param options Transaction options\n * @returns Object containing new paymaster address and transaction hashes\n */\n async deployAndRegisterPaymasterV4(params, options) {\n try {\n const registryAddr = this.requireRegistry();\n const gTokenAddr = this.requireGToken();\n const gTokenStakingAddr = this.requireGTokenStaking();\n const factoryAddr = this.requirePaymasterFactory();\n const registry = registryActions(registryAddr);\n const gToken = tokenActions();\n const factory = paymasterFactoryActions(factoryAddr);\n const publicClient = this.getStartPublicClient();\n const account = options?.account || this.client.account || this.getAddress();\n const accountAddr = typeof account === 'string' ? account : account.address;\n // 1. Check prerequisites (ROLE_COMMUNITY)\n const ROLE_COMMUNITY = await registry(publicClient).ROLE_COMMUNITY();\n const hasCommunity = await registry(publicClient).hasRole({\n user: accountAddr,\n roleId: ROLE_COMMUNITY\n });\n if (!hasCommunity) {\n throw new Error('Must have ROLE_COMMUNITY before deploying Paymaster V4');\n }\n // 2. Deployment (Idempotent Check)\n const existingPaymaster = await factory(publicClient).getPaymaster({ owner: accountAddr });\n let deployHash = '0x0000000000000000000000000000000000000000000000000000000000000000';\n let paymasterAddress;\n if (existingPaymaster && existingPaymaster !== '0x0000000000000000000000000000000000000000') {\n console.log(` ℹ️ Paymaster already deployed at: ${existingPaymaster}`);\n paymasterAddress = existingPaymaster;\n }\n else {\n console.log(' 🛠️ Deploying Paymaster V4 with args:', {\n entryPoint: this.requireEntryPoint(),\n owner: accountAddr,\n priceFeed: this.ethUsdPriceFeed,\n factory: factoryAddr\n });\n const { encodeFunctionData } = await import('viem');\n const initData = encodeFunctionData({\n abi: PaymasterABI,\n functionName: 'initialize',\n args: [\n this.requireEntryPoint(), // EntryPoint v0.7\n accountAddr,\n accountAddr, // Treasury defaults to owner\n this.ethUsdPriceFeed,\n 200n, // serviceFeeRate (2%)\n parseEther('0.1'), // maxGasCostCap\n 3600n // priceStalenessThreshold (1 hour)\n ]\n });\n deployHash = await factory(this.client).deployPaymaster({\n version: params?.version,\n initData,\n account\n });\n await publicClient.waitForTransactionReceipt({ hash: deployHash });\n paymasterAddress = await factory(publicClient).getPaymaster({ owner: accountAddr });\n }\n if (!paymasterAddress || paymasterAddress === '0x0000000000000000000000000000000000000000') {\n throw new Error('Failed to retrieve Paymaster address from Factory');\n }\n // 3. Register ROLE_PAYMASTER_AOA\n const ROLE_PAYMASTER_AOA = await registry(publicClient).ROLE_PAYMASTER_AOA();\n const hasAOA = await registry(publicClient).hasRole({\n user: accountAddr,\n roleId: ROLE_PAYMASTER_AOA\n });\n if (hasAOA) {\n return { paymasterAddress, deployHash, registerHash: '0x0000000000000000000000000000000000000000000000000000000000000000' };\n }\n const stakeAmount = params?.stakeAmount || parseEther('30');\n const allowance = await gToken(publicClient).allowance({\n token: gTokenAddr,\n owner: accountAddr,\n spender: gTokenStakingAddr\n });\n if (allowance < stakeAmount) {\n const approveHash = await gToken(this.client).approve({\n token: gTokenAddr,\n spender: gTokenStakingAddr,\n amount: stakeAmount * 2n,\n account: account\n });\n await publicClient.waitForTransactionReceipt({ hash: approveHash });\n }\n const { encodeAbiParameters, parseAbiParameters } = await import('viem');\n let roleData = '0x';\n if (stakeAmount > 0) {\n roleData = encodeAbiParameters(parseAbiParameters('uint256'), [stakeAmount]);\n }\n const registerHash = await registry(this.client).registerRoleSelf({\n roleId: ROLE_PAYMASTER_AOA,\n data: roleData,\n account: account\n });\n await publicClient.waitForTransactionReceipt({ hash: registerHash });\n return {\n paymasterAddress,\n deployHash,\n registerHash\n };\n }\n catch (error) {\n throw error;\n }\n }\n /**\n * Deposit collateral (aPNTs/GToken) to SuperPaymaster.\n * This is a helper method used by registerAsSuperPaymasterOperator.\n */\n async depositCollateral(amount, options) {\n try {\n const pm = superPaymasterActions(this.superPaymasterAddress);\n const publicClient = this.getStartPublicClient();\n // V3.7: Dynamically fetch the token expected by SuperPaymaster\n const depositToken = await pm(publicClient).APNTS_TOKEN();\n const token = tokenActions();\n // Approve SuperPaymaster to spend the token (usually aPNTs on Sepolia)\n const allowance = await token(publicClient).allowance({\n token: depositToken,\n owner: this.getAddress(),\n spender: this.superPaymasterAddress\n });\n if (allowance < amount) {\n const approveHash = await token(this.client).approve({\n token: depositToken,\n spender: this.superPaymasterAddress,\n amount,\n account: options?.account\n });\n await publicClient.waitForTransactionReceipt({ hash: approveHash });\n }\n // Deposit to SuperPaymaster\n return pm(this.client).deposit({\n amount,\n account: options?.account\n });\n }\n catch (error) {\n throw error;\n }\n }\n /**\n * Configure operator parameters (Token, Treasury).\n * Exchange rate is now read live from xPNTsToken.exchangeRate() at runtime.\n * If parameters are undefined, existing values are preserved.\n */\n async configureOperator(xPNTsToken, treasury, options) {\n try {\n const sp = superPaymasterActions(this.superPaymasterAddress);\n const publicClient = this.getStartPublicClient();\n // Fetch current config to preserve missing values\n const currentConfig = await sp(publicClient).operators({ operator: this.getAddress() });\n const currentToken = currentConfig.xPNTsToken;\n const currentTreasury = currentConfig.treasury;\n return await sp(this.client).configureOperator({\n xPNTsToken: xPNTsToken || currentToken,\n opTreasury: treasury || currentTreasury,\n account: options?.account\n });\n }\n catch (error) {\n throw error;\n }\n }\n async withdrawCollateral(to, amount, options) {\n try {\n const sp = superPaymasterActions(this.superPaymasterAddress);\n return await sp(this.client).withdrawTo({\n to,\n amount,\n account: options?.account\n });\n }\n catch (error) {\n throw error;\n }\n }\n async isOperator(operator) {\n try {\n const sp = superPaymasterActions(this.superPaymasterAddress);\n const config = await sp(this.getStartPublicClient()).operators({ operator });\n return config.isConfigured;\n }\n catch (error) {\n return false;\n }\n }\n async getOperatorDetails(operator) {\n try {\n const target = operator || this.getAddress();\n const sp = superPaymasterActions(this.superPaymasterAddress);\n return await sp(this.getStartPublicClient()).operators({ operator: target });\n }\n catch (error) {\n throw error;\n }\n }\n async initiateExit(options) {\n try {\n const sp = superPaymasterActions(this.superPaymasterAddress);\n return await sp(this.client).unlockStake({\n account: options?.account\n });\n }\n catch (error) {\n throw error;\n }\n }\n async withdrawStake(to, options) {\n try {\n const sp = superPaymasterActions(this.superPaymasterAddress);\n return await sp(this.client).withdrawStake({\n to,\n account: options?.account\n });\n }\n catch (error) {\n throw error;\n }\n }\n // ========================================\n // 3. 支付代币管理 (基于 PaymasterActions)\n // ========================================\n async addGasToken(token, price, options) {\n try {\n const pm = paymasterActions(this.superPaymasterAddress);\n return await pm(this.client).setTokenPrice({\n token,\n price,\n account: options?.account\n });\n }\n catch (error) {\n throw error;\n }\n }\n async getTokenPrice(token) {\n try {\n const pm = paymasterActions(this.superPaymasterAddress);\n return await pm(this.getStartPublicClient()).tokenPrices({ token });\n }\n catch (error) {\n throw error;\n }\n }\n async setupPaymasterDeposit(params, options) {\n try {\n const pm = paymasterActions(params.paymaster);\n return await pm(this.client).depositFor({\n user: params.user,\n token: params.token,\n amount: params.amount,\n account: options?.account\n });\n }\n catch (error) {\n throw error;\n }\n }\n}\n","import { BaseClient } from '@aastar/core';\nimport { dvtActions, aggregatorActions, superPaymasterActions } from '@aastar/core';\nexport var ProposalState;\n(function (ProposalState) {\n ProposalState[ProposalState[\"Pending\"] = 0] = \"Pending\";\n ProposalState[ProposalState[\"Active\"] = 1] = \"Active\";\n ProposalState[ProposalState[\"Canceled\"] = 2] = \"Canceled\";\n ProposalState[ProposalState[\"Defeated\"] = 3] = \"Defeated\";\n ProposalState[ProposalState[\"Succeeded\"] = 4] = \"Succeeded\";\n ProposalState[ProposalState[\"Queued\"] = 5] = \"Queued\";\n ProposalState[ProposalState[\"Expired\"] = 6] = \"Expired\";\n ProposalState[ProposalState[\"Executed\"] = 7] = \"Executed\";\n})(ProposalState || (ProposalState = {}));\n/**\n * Client for Protocol Governors and Validators (Infrastructure)\n */\nexport class ProtocolClient extends BaseClient {\n dvtValidatorAddress;\n blsAggregatorAddress;\n superPaymasterAddress;\n constructor(config) {\n super(config);\n this.dvtValidatorAddress = config.dvtValidatorAddress;\n this.blsAggregatorAddress = config.blsAggregatorAddress;\n this.superPaymasterAddress = config.superPaymasterAddress;\n }\n // ========================================\n // 1. 提案管理 (DVT)\n // ========================================\n /**\n * Create a new proposal\n */\n async createProposal(target, calldata, description, options) {\n try {\n const dvt = dvtActions(this.dvtValidatorAddress)(this.client);\n // Mapping general \"createProposal\" to \"createSlashProposal\" for now\n // Assuming Governance uses Validator logic or this Client is for Slash.\n // Using createSlashProposal as the available action.\n return await dvt.createSlashProposal({\n operator: target,\n level: 1, // Default level\n reason: description,\n account: options?.account\n });\n }\n catch (error) {\n throw error;\n }\n }\n async signProposal(proposalId, signature = '0x', options) {\n try {\n const dvt = dvtActions(this.dvtValidatorAddress)(this.client);\n return await dvt.signSlashProposal({\n proposalId,\n signature,\n account: options?.account\n });\n }\n catch (error) {\n throw error;\n }\n }\n /**\n * Execute a proposal with collected signatures\n */\n async executeWithProof(proposalId, signatures, options) {\n try {\n // Mock proof generation logic or placeholder\n const proof = '0x';\n const dvt = dvtActions(this.dvtValidatorAddress)(this.client);\n return await dvt.executeSlashWithProof({\n proposalId,\n repUsers: [], // Needs real data in production\n newScores: [],\n epoch: 0n,\n proof,\n account: options?.account\n });\n }\n catch (error) {\n throw error;\n }\n }\n // ========================================\n // 2. 验证器管理 / BLS\n // ========================================\n async registerBLSKey(publicKey, options) {\n try {\n if (!this.blsAggregatorAddress) {\n throw new Error('BLS Aggregator address required for this client');\n }\n // Aggregator actions now handle the type internally or via mapping\n const agg = aggregatorActions(this.blsAggregatorAddress)(this.client);\n return await agg.registerBLSPublicKey({\n validator: this.getAddress(),\n publicKey,\n account: options?.account\n });\n }\n catch (error) {\n throw error;\n }\n }\n // ========================================\n // 3. 全局参数管理 (Admin)\n // ========================================\n async setProtocolFee(bps, options) {\n try {\n if (!this.superPaymasterAddress) {\n throw new Error('SuperPaymaster address required for this client');\n }\n const sp = superPaymasterActions(this.superPaymasterAddress);\n return await sp(this.client).setProtocolFee({\n newFeeBPS: bps,\n account: options?.account\n });\n }\n catch (error) {\n throw error;\n }\n }\n async setTreasury(treasury, options) {\n try {\n if (!this.superPaymasterAddress) {\n throw new Error('SuperPaymaster address required for this client');\n }\n const sp = superPaymasterActions(this.superPaymasterAddress);\n return await sp(this.client).setTreasury({\n treasury,\n account: options?.account\n });\n }\n catch (error) {\n throw error;\n }\n }\n}\n","import { PaymasterOperatorClient } from './PaymasterOperatorClient.js';\nimport { tokenActions, registryActions } from '@aastar/core'; // L2/L1 Actions\n/**\n * OperatorLifecycle - L3 Pattern\n *\n * Responsibilities:\n * 1. Managing the complete lifecycle of a Paymaster Operator\n * 2. Unifying setup (onboard), operation (config), and exit (withdraw)\n */\nexport class OperatorLifecycle extends PaymasterOperatorClient {\n constructor(config) {\n super(config);\n }\n // ===========================================\n // 1. Setup Phase (Onboarding)\n // ===========================================\n /**\n * Check if the account is ready to become an operator\n * (e.g., has GToken, has ROLE_COMMUNITY, etc.)\n */\n async checkReadiness() {\n const isOp = await this.isOperator(this.getAddress());\n // For SuperPaymaster, balance is 'aPNTsBalance' (Collateral)\n const details = await this.getOperatorDetails();\n const balance = details.aPNTsBalance || 0n;\n return {\n isConfigured: isOp,\n isActive: isOp, // Simplification\n balance\n };\n }\n /**\n * One-click Setup: Register + Deposit + Deploy Node\n * Wraps existing registerAsSuperPaymasterOperator or deployAndRegisterPaymasterV4\n */\n async setupNode(params, options) {\n const hashes = [];\n if (params.type === 'SUPER') {\n const h = await this.registerAsSuperPaymasterOperator({\n stakeAmount: params.stakeAmount,\n depositAmount: params.depositAmount\n }, options);\n hashes.push(h);\n // Fetch Token Address and Configure\n const factory = await import('@aastar/core').then(m => m.xPNTsFactoryActions(this.xpntsFactory)(this.getStartPublicClient()));\n const token = await factory.getTokenAddress({ community: this.getAddress() });\n if (token && token !== '0x0000000000000000000000000000000000000000') {\n const hConfig = await this.configureOperator(token, this.getAddress(), // Default treasury to self\n options);\n hashes.push(hConfig);\n }\n }\n else {\n const result = await this.deployAndRegisterPaymasterV4({\n stakeAmount: params.stakeAmount\n }, options);\n hashes.push(result.deployHash);\n hashes.push(result.registerHash);\n }\n return hashes;\n }\n // ===========================================\n // 2. Operational Phase (Config & Funds)\n // ===========================================\n // Inherits: addGasToken, configureOperator, depositCollateral from PaymasterOperatorClient\n async getOperatorStats() {\n return await this.getOperatorDetails();\n }\n // ===========================================\n // 3. Exit Phase (Withdraw & Leave)\n // ===========================================\n /**\n * Start the exit process: Unstake from Registry/SuperPaymaster and Unlock funds\n */\n async initiateExit(options) {\n // 1. Unlock Stake from SuperPaymaster (if applicable)\n return await super.initiateExit(options);\n }\n /**\n * Finalize exit: Withdraw all funds (Collateral + Rewards)\n */\n async withdrawAllFunds(to, options) {\n const recipient = to || this.getAddress();\n const hashes = [];\n // 1. Withdraw Collateral from SuperPaymaster (if any)\n // Note: We need to know the balance to withdraw exact amount.\n // For current L3 pattern, we assume the user tracks it or we fetch it.\n const stats = await this.checkReadiness();\n if (stats.balance > 0n) {\n const hCol = await this.withdrawCollateral(recipient, stats.balance, options);\n hashes.push(hCol);\n }\n // 2. Exit Role in Registry (Unstake GToken)\n // This will fail if lock duration > 0 and not yet cooldown.\n // Or it will initiate cooldown.\n const client = this.getStartPublicClient();\n const registry = registryActions(this.registryAddress); // Use local registry address\n const registryWriter = registryActions(this.registryAddress)(this.client);\n // Check if we have the role\n // For Super Operator\n const ROLE_PAYMASTER_SUPER = await registry(client).ROLE_PAYMASTER_SUPER();\n const hasRole = await registry(client).hasRole({ user: this.getAddress(), roleId: ROLE_PAYMASTER_SUPER });\n if (hasRole) {\n const hExit = await registryWriter.exitRole({ roleId: ROLE_PAYMASTER_SUPER, account: options?.account });\n hashes.push(hExit);\n }\n return hashes;\n }\n // Helper: Get GToken Balance\n async getTokenBalance() {\n if (!this.tokenAddress)\n return 0n;\n const token = tokenActions()(this.getStartPublicClient());\n return await token.balanceOf({ token: this.tokenAddress, account: this.getAddress() });\n }\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseClient, entryPointActions, accountActions, sbtActions, tokenActions, stakingActions, registryActions } from './chunk-
|
|
1
|
+
import { BaseClient, entryPointActions, accountActions, sbtActions, tokenActions, stakingActions, registryActions } from './chunk-TBDMSJVL.js';
|
|
2
2
|
import { encodeFunctionData } from 'viem';
|
|
3
3
|
import { bundlerActions } from 'viem/account-abstraction';
|
|
4
4
|
|
|
@@ -29,7 +29,7 @@ var UserClient = class extends BaseClient {
|
|
|
29
29
|
* @returns Object containing the deployed account address and transaction hash
|
|
30
30
|
*/
|
|
31
31
|
static async deployAccount(client, params) {
|
|
32
|
-
const { accountFactoryActions, SimpleAccountFactoryABI } = await import('./index.node-
|
|
32
|
+
const { accountFactoryActions, SimpleAccountFactoryABI } = await import('./index.node-GNYPFVZQ.js');
|
|
33
33
|
let abi = params.customAbi || (SimpleAccountFactoryABI?.abi || SimpleAccountFactoryABI);
|
|
34
34
|
const factoryAddr = params.factoryAddress || "0x9406Cc6185a346906296840746125a0E44976454";
|
|
35
35
|
const salt = params.salt || 0n;
|
|
@@ -363,13 +363,13 @@ var UserClient = class extends BaseClient {
|
|
|
363
363
|
functionName: "execute",
|
|
364
364
|
args: [params.target, params.value, params.data]
|
|
365
365
|
});
|
|
366
|
-
const { PaymasterClient: SDKPaymasterClient } = await import('./dist-
|
|
366
|
+
const { PaymasterClient: SDKPaymasterClient } = await import('./dist-WMYQOYRO.js');
|
|
367
367
|
let verificationGasLimit;
|
|
368
368
|
let paymasterVerificationGasLimit;
|
|
369
369
|
let paymasterPostOpGasLimit;
|
|
370
370
|
let autoEstimate = true;
|
|
371
371
|
if (params.paymasterType === "Super") {
|
|
372
|
-
const { tuneGasLimit } = await import('./dist-
|
|
372
|
+
const { tuneGasLimit } = await import('./dist-WMYQOYRO.js');
|
|
373
373
|
const est = await SDKPaymasterClient.estimateUserOperationGas(
|
|
374
374
|
this.client,
|
|
375
375
|
this.client,
|
|
@@ -422,5 +422,5 @@ var UserClient = class extends BaseClient {
|
|
|
422
422
|
};
|
|
423
423
|
|
|
424
424
|
export { UserClient };
|
|
425
|
-
//# sourceMappingURL=chunk-
|
|
426
|
-
//# sourceMappingURL=chunk-
|
|
425
|
+
//# sourceMappingURL=chunk-LNICTATJ.js.map
|
|
426
|
+
//# sourceMappingURL=chunk-LNICTATJ.js.map
|