@aastar/sdk 0.22.0 → 0.23.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/UserClient-J3JPDIG7.cjs +15 -0
- package/dist/{UserClient-AJOGJXOC.cjs.map → UserClient-J3JPDIG7.cjs.map} +1 -1
- package/dist/UserClient-XTHQ2AP3.js +6 -0
- package/dist/{UserClient-Y65JLJ23.js.map → UserClient-XTHQ2AP3.js.map} +1 -1
- package/dist/account.cjs +7 -7
- package/dist/account.js +2 -2
- package/dist/admin.cjs +3 -3
- package/dist/admin.js +2 -2
- package/dist/airaccount.cjs +117 -97
- package/dist/airaccount.d.cts +2 -1
- package/dist/airaccount.d.ts +2 -1
- package/dist/airaccount.js +2 -2
- package/dist/channel.cjs +6 -6
- package/dist/channel.js +2 -2
- package/dist/{chunk-VUNNHEND.js → chunk-2DDWYKF2.js} +9 -9
- package/dist/{chunk-VUNNHEND.js.map → chunk-2DDWYKF2.js.map} +1 -1
- package/dist/{chunk-MG72SGVS.cjs → chunk-2GZMRCQW.cjs} +5 -5
- package/dist/{chunk-MG72SGVS.cjs.map → chunk-2GZMRCQW.cjs.map} +1 -1
- package/dist/{chunk-T2GF4S3E.js → chunk-2UDF62XV.js} +6 -6
- package/dist/{chunk-T2GF4S3E.js.map → chunk-2UDF62XV.js.map} +1 -1
- package/dist/{chunk-XTF6MNIK.js → chunk-2WBSYPUY.js} +3 -3
- package/dist/{chunk-XTF6MNIK.js.map → chunk-2WBSYPUY.js.map} +1 -1
- package/dist/{chunk-2TS6T2WY.js → chunk-5G5SB6CP.js} +3 -3
- package/dist/{chunk-2TS6T2WY.js.map → chunk-5G5SB6CP.js.map} +1 -1
- package/dist/{chunk-BBZAD5G2.cjs → chunk-6I22EW6V.cjs} +11 -11
- package/dist/{chunk-BBZAD5G2.cjs.map → chunk-6I22EW6V.cjs.map} +1 -1
- package/dist/{chunk-6ISQM3SF.cjs → chunk-6PJAHZZ2.cjs} +26 -26
- package/dist/{chunk-6ISQM3SF.cjs.map → chunk-6PJAHZZ2.cjs.map} +1 -1
- package/dist/{chunk-RF3MSLRW.cjs → chunk-CGKPULZX.cjs} +16 -16
- package/dist/{chunk-RF3MSLRW.cjs.map → chunk-CGKPULZX.cjs.map} +1 -1
- package/dist/{chunk-SNVHOCU6.js → chunk-D23CZFOM.js} +3 -3
- package/dist/{chunk-SNVHOCU6.js.map → chunk-D23CZFOM.js.map} +1 -1
- package/dist/{chunk-7RNOKMAJ.cjs → chunk-E37CPC2U.cjs} +9 -9
- package/dist/{chunk-7RNOKMAJ.cjs.map → chunk-E37CPC2U.cjs.map} +1 -1
- package/dist/{chunk-LKSQASFZ.js → chunk-EZC7Q3SG.js} +3 -3
- package/dist/{chunk-LKSQASFZ.js.map → chunk-EZC7Q3SG.js.map} +1 -1
- package/dist/{chunk-JCK7VAZF.js → chunk-H5EQBNC6.js} +8 -8
- package/dist/{chunk-JCK7VAZF.js.map → chunk-H5EQBNC6.js.map} +1 -1
- package/dist/{chunk-OVNOSAL3.cjs → chunk-LAZA3JD7.cjs} +182 -6
- package/dist/chunk-LAZA3JD7.cjs.map +1 -0
- package/dist/{chunk-TS5CXRNI.cjs → chunk-MFBTMF5U.cjs} +3 -3
- package/dist/{chunk-TS5CXRNI.cjs.map → chunk-MFBTMF5U.cjs.map} +1 -1
- package/dist/{chunk-XZDMKHKG.js → chunk-PFMCPSS4.js} +3 -3
- package/dist/{chunk-XZDMKHKG.js.map → chunk-PFMCPSS4.js.map} +1 -1
- package/dist/{chunk-7HO4IUHZ.cjs → chunk-PKYWLTIJ.cjs} +32 -32
- package/dist/{chunk-7HO4IUHZ.cjs.map → chunk-PKYWLTIJ.cjs.map} +1 -1
- package/dist/{chunk-MQMTICTP.js → chunk-SXLWFZFX.js} +3 -3
- package/dist/{chunk-MQMTICTP.js.map → chunk-SXLWFZFX.js.map} +1 -1
- package/dist/{chunk-UUT246S2.js → chunk-TM2LH4ZE.js} +3 -3
- package/dist/{chunk-UUT246S2.js.map → chunk-TM2LH4ZE.js.map} +1 -1
- package/dist/{chunk-R3N7L7RE.js → chunk-UMTCWOQV.js} +4 -4
- package/dist/{chunk-R3N7L7RE.js.map → chunk-UMTCWOQV.js.map} +1 -1
- package/dist/{chunk-DOVGH7HB.cjs → chunk-UQMMEDHO.cjs} +4 -4
- package/dist/{chunk-DOVGH7HB.cjs.map → chunk-UQMMEDHO.cjs.map} +1 -1
- package/dist/{chunk-FZLBMUPN.cjs → chunk-UULR2KA6.cjs} +5 -5
- package/dist/{chunk-FZLBMUPN.cjs.map → chunk-UULR2KA6.cjs.map} +1 -1
- package/dist/{chunk-6OWZOTE7.js → chunk-V65JXHM6.js} +178 -7
- package/dist/chunk-V65JXHM6.js.map +1 -0
- package/dist/{chunk-3OIVYXUG.cjs → chunk-W4ENVPZH.cjs} +6 -6
- package/dist/{chunk-3OIVYXUG.cjs.map → chunk-W4ENVPZH.cjs.map} +1 -1
- package/dist/{chunk-BLA57KBS.cjs → chunk-XFJSY5LG.cjs} +12 -12
- package/dist/{chunk-BLA57KBS.cjs.map → chunk-XFJSY5LG.cjs.map} +1 -1
- package/dist/core.cjs +202 -202
- package/dist/core.d.cts +3 -516
- package/dist/core.d.ts +3 -516
- package/dist/core.js +1 -1
- package/dist/dapp.cjs +5 -5
- package/dist/dapp.js +2 -2
- package/dist/enduser.cjs +6 -6
- package/dist/enduser.js +3 -3
- package/dist/identity.cjs +5 -5
- package/dist/identity.js +2 -2
- package/dist/index.cjs +303 -303
- package/dist/index.d.cts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +15 -15
- package/dist/initConfig-D8jgrcDb.d.cts +518 -0
- package/dist/initConfig-D8jgrcDb.d.ts +518 -0
- package/dist/kms.cjs +117 -97
- package/dist/kms.d.cts +183 -3
- package/dist/kms.d.ts +183 -3
- package/dist/kms.js +2 -2
- package/dist/operator.cjs +6 -6
- package/dist/operator.js +2 -2
- package/dist/paymaster.cjs +15 -15
- package/dist/paymaster.js +2 -2
- package/dist/{src-SCR3OCME.js → src-2P72LYVT.js} +3 -3
- package/dist/src-2P72LYVT.js.map +1 -0
- package/dist/{src-UQ4RDCJG.cjs → src-4Q2WFLO2.cjs} +204 -204
- package/dist/src-4Q2WFLO2.cjs.map +1 -0
- package/dist/{src-WGYHZSLY.cjs → src-HECKBVR2.cjs} +17 -17
- package/dist/src-HECKBVR2.cjs.map +1 -0
- package/dist/{src-MDGW57S5.js → src-KLP4Q2Y3.js} +4 -4
- package/dist/src-KLP4Q2Y3.js.map +1 -0
- package/dist/tokens.cjs +3 -3
- package/dist/tokens.js +2 -2
- package/dist/x402.cjs +25 -25
- package/dist/x402.js +2 -2
- package/package.json +1 -1
- package/dist/UserClient-AJOGJXOC.cjs +0 -15
- package/dist/UserClient-Y65JLJ23.js +0 -6
- package/dist/chunk-6OWZOTE7.js.map +0 -1
- package/dist/chunk-OVNOSAL3.cjs.map +0 -1
- package/dist/src-MDGW57S5.js.map +0 -1
- package/dist/src-SCR3OCME.js.map +0 -1
- package/dist/src-UQ4RDCJG.cjs.map +0 -1
- package/dist/src-WGYHZSLY.cjs.map +0 -1
|
@@ -0,0 +1,518 @@
|
|
|
1
|
+
import { Hex, Address, Account, Hash, PublicClient, WalletClient } from 'viem';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ERC-4337 v0.7 PackedUserOperation tuple, matching the `struct PackedUserOperation`
|
|
5
|
+
* input of `dryRunValidation` / `validatePaymasterUserOp` in the SuperPaymaster ABI.
|
|
6
|
+
* Field order is load-bearing: viem encodes the tuple positionally from this shape.
|
|
7
|
+
*/
|
|
8
|
+
type PackedUserOperation = {
|
|
9
|
+
sender: Address;
|
|
10
|
+
nonce: bigint;
|
|
11
|
+
initCode: Hex;
|
|
12
|
+
callData: Hex;
|
|
13
|
+
accountGasLimits: Hex;
|
|
14
|
+
preVerificationGas: bigint;
|
|
15
|
+
gasFees: Hex;
|
|
16
|
+
paymasterAndData: Hex;
|
|
17
|
+
signature: Hex;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Result of an off-chain `dryRunValidation` pre-flight check.
|
|
21
|
+
* `ok` mirrors whether the paymaster would accept the UserOp; `reasonCode` is a
|
|
22
|
+
* bytes32 machine-readable rejection code (zero when `ok` is true).
|
|
23
|
+
*/
|
|
24
|
+
type DryRunValidationResult = {
|
|
25
|
+
ok: boolean;
|
|
26
|
+
reasonCode: Hex;
|
|
27
|
+
};
|
|
28
|
+
type SlashRecord = {
|
|
29
|
+
timestamp: bigint;
|
|
30
|
+
amount: bigint;
|
|
31
|
+
reputationLoss: bigint;
|
|
32
|
+
reason: string;
|
|
33
|
+
level: number;
|
|
34
|
+
};
|
|
35
|
+
type OperatorConfig = {
|
|
36
|
+
aPNTsBalance: bigint;
|
|
37
|
+
isConfigured: boolean;
|
|
38
|
+
isPaused: boolean;
|
|
39
|
+
xPNTsToken: Address;
|
|
40
|
+
reputation: number;
|
|
41
|
+
minTxInterval: number;
|
|
42
|
+
treasury: Address;
|
|
43
|
+
totalSpent: bigint;
|
|
44
|
+
totalTxSponsored: bigint;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Runtime-resolved aPNTs token state read live from the SuperPaymaster contract.
|
|
48
|
+
*
|
|
49
|
+
* The contract exposes the currently active token via `APNTS_TOKEN()` and an
|
|
50
|
+
* upcoming (timelocked) token via `pendingAPNTsToken()` / `pendingAPNTsTokenEta()`.
|
|
51
|
+
* Consumers should prefer `active` and may surface `pending` to warn about an
|
|
52
|
+
* upcoming migration.
|
|
53
|
+
*/
|
|
54
|
+
type ResolvedAPNTsToken = {
|
|
55
|
+
/** Currently active aPNTs token address, read from `APNTS_TOKEN()`. */
|
|
56
|
+
active: Address;
|
|
57
|
+
/** aPNTs token queued for migration; `zeroAddress` when none is queued. */
|
|
58
|
+
pending: Address;
|
|
59
|
+
/** Unix-second ETA when the pending change becomes executable; `0n` when none is queued. */
|
|
60
|
+
pendingEta: bigint;
|
|
61
|
+
/** True only when `active` came from the explicit `fallback` option after a failed chain read. */
|
|
62
|
+
fallbackUsed: boolean;
|
|
63
|
+
};
|
|
64
|
+
type SuperPaymasterActions = {
|
|
65
|
+
deposit: (args: {
|
|
66
|
+
amount: bigint;
|
|
67
|
+
account?: Account | Address;
|
|
68
|
+
}) => Promise<Hash>;
|
|
69
|
+
depositETH: (args: {
|
|
70
|
+
value: bigint;
|
|
71
|
+
account?: Account | Address;
|
|
72
|
+
}) => Promise<Hash>;
|
|
73
|
+
depositFor: (args: {
|
|
74
|
+
targetOperator: Address;
|
|
75
|
+
amount: bigint;
|
|
76
|
+
account?: Account | Address;
|
|
77
|
+
}) => Promise<Hash>;
|
|
78
|
+
withdrawTo: (args: {
|
|
79
|
+
to: Address;
|
|
80
|
+
amount: bigint;
|
|
81
|
+
account?: Account | Address;
|
|
82
|
+
}) => Promise<Hash>;
|
|
83
|
+
withdraw: (args: {
|
|
84
|
+
amount: bigint;
|
|
85
|
+
account?: Account | Address;
|
|
86
|
+
}) => Promise<Hash>;
|
|
87
|
+
addStake: (args: {
|
|
88
|
+
unstakeDelaySec: number;
|
|
89
|
+
value: bigint;
|
|
90
|
+
account?: Account | Address;
|
|
91
|
+
}) => Promise<Hash>;
|
|
92
|
+
unlockStake: (args: {
|
|
93
|
+
account?: Account | Address;
|
|
94
|
+
}) => Promise<Hash>;
|
|
95
|
+
withdrawStake: (args: {
|
|
96
|
+
to: Address;
|
|
97
|
+
account?: Account | Address;
|
|
98
|
+
}) => Promise<Hash>;
|
|
99
|
+
configureOperator: (args: {
|
|
100
|
+
xPNTsToken: Address;
|
|
101
|
+
opTreasury: Address;
|
|
102
|
+
account?: Account | Address;
|
|
103
|
+
}) => Promise<Hash>;
|
|
104
|
+
setOperatorPaused: (args: {
|
|
105
|
+
operator: Address;
|
|
106
|
+
paused: boolean;
|
|
107
|
+
account?: Account | Address;
|
|
108
|
+
}) => Promise<Hash>;
|
|
109
|
+
setOperatorLimits: (args: {
|
|
110
|
+
minTxInterval: number;
|
|
111
|
+
account?: Account | Address;
|
|
112
|
+
}) => Promise<Hash>;
|
|
113
|
+
updateReputation: (args: {
|
|
114
|
+
operator: Address;
|
|
115
|
+
newScore: bigint;
|
|
116
|
+
account?: Account | Address;
|
|
117
|
+
}) => Promise<Hash>;
|
|
118
|
+
executeSlashWithBLS: (args: {
|
|
119
|
+
operator: Address;
|
|
120
|
+
level: number;
|
|
121
|
+
proof: Hex;
|
|
122
|
+
account?: Account | Address;
|
|
123
|
+
}) => Promise<Hash>;
|
|
124
|
+
slashOperator: (args: {
|
|
125
|
+
operator: Address;
|
|
126
|
+
level: number;
|
|
127
|
+
penaltyAmount: bigint;
|
|
128
|
+
reason: string;
|
|
129
|
+
account?: Account | Address;
|
|
130
|
+
}) => Promise<Hash>;
|
|
131
|
+
updateBlockedStatus: (args: {
|
|
132
|
+
operator: Address;
|
|
133
|
+
users: Address[];
|
|
134
|
+
statuses: boolean[];
|
|
135
|
+
account?: Account | Address;
|
|
136
|
+
}) => Promise<Hash>;
|
|
137
|
+
updateSBTStatus: (args: {
|
|
138
|
+
user: Address;
|
|
139
|
+
status: boolean;
|
|
140
|
+
account?: Account | Address;
|
|
141
|
+
}) => Promise<Hash>;
|
|
142
|
+
/** Read the unrecovered debt recorded for a user after a failed burn/recordDebt. */
|
|
143
|
+
pendingDebts: (args: {
|
|
144
|
+
token: Address;
|
|
145
|
+
user: Address;
|
|
146
|
+
}) => Promise<bigint>;
|
|
147
|
+
/** Operator retries recovering up to `amount` of the user's pending debt. */
|
|
148
|
+
retryPendingDebt: (args: {
|
|
149
|
+
token: Address;
|
|
150
|
+
user: Address;
|
|
151
|
+
amount: bigint;
|
|
152
|
+
account?: Account | Address;
|
|
153
|
+
}) => Promise<Hash>;
|
|
154
|
+
/** Operator force-clears the user's pending-debt entry without recording it. */
|
|
155
|
+
clearPendingDebt: (args: {
|
|
156
|
+
token: Address;
|
|
157
|
+
user: Address;
|
|
158
|
+
account?: Account | Address;
|
|
159
|
+
}) => Promise<Hash>;
|
|
160
|
+
setAPNTSPrice: (args: {
|
|
161
|
+
newPrice: bigint;
|
|
162
|
+
account?: Account | Address;
|
|
163
|
+
}) => Promise<Hash>;
|
|
164
|
+
updatePrice: (args: {
|
|
165
|
+
account?: Account | Address;
|
|
166
|
+
}) => Promise<Hash>;
|
|
167
|
+
updatePriceDVT: (args: {
|
|
168
|
+
price: bigint;
|
|
169
|
+
updatedAt: bigint;
|
|
170
|
+
proof: Hex;
|
|
171
|
+
account?: Account | Address;
|
|
172
|
+
}) => Promise<Hash>;
|
|
173
|
+
setProtocolFee: (args: {
|
|
174
|
+
newFeeBPS: bigint;
|
|
175
|
+
account?: Account | Address;
|
|
176
|
+
}) => Promise<Hash>;
|
|
177
|
+
setTreasury: (args: {
|
|
178
|
+
treasury: Address;
|
|
179
|
+
account?: Account | Address;
|
|
180
|
+
}) => Promise<Hash>;
|
|
181
|
+
setXPNTsFactory: (args: {
|
|
182
|
+
factory: Address;
|
|
183
|
+
account?: Account | Address;
|
|
184
|
+
}) => Promise<Hash>;
|
|
185
|
+
setAPNTsToken: (args: {
|
|
186
|
+
token: Address;
|
|
187
|
+
account?: Account | Address;
|
|
188
|
+
}) => Promise<Hash>;
|
|
189
|
+
/** @deprecated The deployed SuperPaymaster ABI has no direct `setBLSAggregator` — the aggregator change is timelocked via {@link queueBLSAggregator} + {@link applyBLSAggregator}. Throws {@link ErrorCode.NOT_IMPLEMENTED}. */
|
|
190
|
+
setBLSAggregator: (args: {
|
|
191
|
+
aggregator: Address;
|
|
192
|
+
account?: Account | Address;
|
|
193
|
+
}) => Promise<Hash>;
|
|
194
|
+
withdrawProtocolRevenue: (args: {
|
|
195
|
+
to: Address;
|
|
196
|
+
amount: bigint;
|
|
197
|
+
account?: Account | Address;
|
|
198
|
+
}) => Promise<Hash>;
|
|
199
|
+
executeAPNTsTokenChange: (args: {
|
|
200
|
+
account?: Account | Address;
|
|
201
|
+
}) => Promise<Hash>;
|
|
202
|
+
cancelAPNTsTokenChange: (args: {
|
|
203
|
+
account?: Account | Address;
|
|
204
|
+
}) => Promise<Hash>;
|
|
205
|
+
pendingAPNTsToken: () => Promise<Address>;
|
|
206
|
+
pendingAPNTsTokenEta: () => Promise<bigint>;
|
|
207
|
+
/**
|
|
208
|
+
* Resolve the live aPNTs token address from chain instead of relying on a static constant.
|
|
209
|
+
*
|
|
210
|
+
* Reads `APNTS_TOKEN()` (active), `pendingAPNTsToken()` and `pendingAPNTsTokenEta()`
|
|
211
|
+
* in parallel and returns them as a structured result. Prefer `active` for runtime use.
|
|
212
|
+
*
|
|
213
|
+
* If `fallback` is supplied and the chain reads fail, the static `fallback` address is
|
|
214
|
+
* returned with `fallbackUsed: true` (pending fields zeroed). Without a `fallback` the
|
|
215
|
+
* underlying error is re-thrown rather than silently masked.
|
|
216
|
+
*/
|
|
217
|
+
resolveAPNTsToken: (args?: {
|
|
218
|
+
fallback?: Address;
|
|
219
|
+
}) => Promise<ResolvedAPNTsToken>;
|
|
220
|
+
emergencySetPrice: (args: {
|
|
221
|
+
newPrice: bigint;
|
|
222
|
+
account?: Account | Address;
|
|
223
|
+
}) => Promise<Hash>;
|
|
224
|
+
executeEmergencyPrice: (args: {
|
|
225
|
+
account?: Account | Address;
|
|
226
|
+
}) => Promise<Hash>;
|
|
227
|
+
cancelEmergencyPrice: (args: {
|
|
228
|
+
account?: Account | Address;
|
|
229
|
+
}) => Promise<Hash>;
|
|
230
|
+
emergencyPendingPrice: () => Promise<bigint>;
|
|
231
|
+
emergencyActivatedAt: () => Promise<bigint>;
|
|
232
|
+
emergencyQueuedAt: () => Promise<bigint>;
|
|
233
|
+
EMERGENCY_TIMELOCK: () => Promise<bigint>;
|
|
234
|
+
queueBLSAggregator: (args: {
|
|
235
|
+
aggregator: Address;
|
|
236
|
+
account?: Account | Address;
|
|
237
|
+
}) => Promise<Hash>;
|
|
238
|
+
applyBLSAggregator: (args: {
|
|
239
|
+
account?: Account | Address;
|
|
240
|
+
}) => Promise<Hash>;
|
|
241
|
+
onTransferReceived: (args: {
|
|
242
|
+
operator: Address;
|
|
243
|
+
from: Address;
|
|
244
|
+
value: bigint;
|
|
245
|
+
data: Hex;
|
|
246
|
+
}) => Promise<Hex>;
|
|
247
|
+
validatePaymasterUserOp: (args: {
|
|
248
|
+
userOp: any;
|
|
249
|
+
userOpHash: Hex;
|
|
250
|
+
maxCost: bigint;
|
|
251
|
+
}) => Promise<{
|
|
252
|
+
context: Hex;
|
|
253
|
+
validationData: bigint;
|
|
254
|
+
}>;
|
|
255
|
+
/**
|
|
256
|
+
* Off-chain pre-flight validation of a UserOp against this paymaster.
|
|
257
|
+
* Returns `{ ok, reasonCode }` so callers can detect AA34-style rejections
|
|
258
|
+
* before submitting the UserOp on-chain. View call; never mutates state.
|
|
259
|
+
*/
|
|
260
|
+
dryRunValidation: (args: {
|
|
261
|
+
userOp: PackedUserOperation;
|
|
262
|
+
maxCost: bigint;
|
|
263
|
+
}) => Promise<DryRunValidationResult>;
|
|
264
|
+
operators: (args: {
|
|
265
|
+
operator: Address;
|
|
266
|
+
}) => Promise<OperatorConfig>;
|
|
267
|
+
getAvailableCredit: (args: {
|
|
268
|
+
user: Address;
|
|
269
|
+
token: Address;
|
|
270
|
+
}) => Promise<bigint>;
|
|
271
|
+
getDeposit: () => Promise<bigint>;
|
|
272
|
+
getLatestSlash: (args: {
|
|
273
|
+
operator: Address;
|
|
274
|
+
}) => Promise<SlashRecord>;
|
|
275
|
+
getSlashCount: (args: {
|
|
276
|
+
operator: Address;
|
|
277
|
+
}) => Promise<bigint>;
|
|
278
|
+
getSlashHistory: (args: {
|
|
279
|
+
operator: Address;
|
|
280
|
+
}) => Promise<SlashRecord[]>;
|
|
281
|
+
slashHistory: (args: {
|
|
282
|
+
operator: Address;
|
|
283
|
+
index: bigint;
|
|
284
|
+
}) => Promise<SlashRecord>;
|
|
285
|
+
userOpState: (args: {
|
|
286
|
+
user: Address;
|
|
287
|
+
operator: Address;
|
|
288
|
+
}) => Promise<{
|
|
289
|
+
lastTimestamp: number;
|
|
290
|
+
isBlocked: boolean;
|
|
291
|
+
}>;
|
|
292
|
+
cachedPrice: () => Promise<{
|
|
293
|
+
price: bigint;
|
|
294
|
+
updatedAt: bigint;
|
|
295
|
+
roundId: bigint;
|
|
296
|
+
decimals: number;
|
|
297
|
+
}>;
|
|
298
|
+
aPNTsPriceUSD: () => Promise<bigint>;
|
|
299
|
+
protocolFeeBPS: () => Promise<bigint>;
|
|
300
|
+
protocolRevenue: () => Promise<bigint>;
|
|
301
|
+
totalTrackedBalance: () => Promise<bigint>;
|
|
302
|
+
priceStalenessThreshold: () => Promise<bigint>;
|
|
303
|
+
sbtHolders: (args: {
|
|
304
|
+
user: Address;
|
|
305
|
+
}) => Promise<boolean>;
|
|
306
|
+
/** True when the Chainlink ETH/USD feed is considered stale by the contract. */
|
|
307
|
+
isChainlinkStale: () => Promise<boolean>;
|
|
308
|
+
/** Current pricing mode (uint8 enum on the contract). */
|
|
309
|
+
priceMode: () => Promise<number>;
|
|
310
|
+
/** Unix-second timestamp until which the cached price remains valid (uint48). */
|
|
311
|
+
priceValidUntil: () => Promise<bigint>;
|
|
312
|
+
/** Address of the BLS aggregator pending the timelock (`zeroAddress` if none queued). */
|
|
313
|
+
pendingBLSAgg: () => Promise<Address>;
|
|
314
|
+
/** Unix-second ETA at which the pending BLS aggregator change becomes executable (uint48). */
|
|
315
|
+
pendingBLSAggEta: () => Promise<bigint>;
|
|
316
|
+
APNTS_TOKEN: () => Promise<Address>;
|
|
317
|
+
REGISTRY: () => Promise<Address>;
|
|
318
|
+
BLS_AGGREGATOR: () => Promise<Address>;
|
|
319
|
+
ETH_USD_PRICE_FEED: () => Promise<Address>;
|
|
320
|
+
treasury: () => Promise<Address>;
|
|
321
|
+
xpntsFactory: () => Promise<Address>;
|
|
322
|
+
entryPoint: () => Promise<Address>;
|
|
323
|
+
/** @deprecated Removed in the v5.x contract refactor — not in the deployed SuperPaymaster ABI. Throws {@link ErrorCode.NOT_IMPLEMENTED}. */
|
|
324
|
+
MAX_PROTOCOL_FEE: () => Promise<bigint>;
|
|
325
|
+
/** @deprecated Removed from SuperPaymaster in the v5.x refactor (this bound belongs to the standalone Paymaster contract). Throws {@link ErrorCode.NOT_IMPLEMENTED}. */
|
|
326
|
+
MAX_ETH_USD_PRICE: () => Promise<bigint>;
|
|
327
|
+
/** @deprecated Removed from SuperPaymaster in the v5.x refactor (this bound belongs to the standalone Paymaster contract). Throws {@link ErrorCode.NOT_IMPLEMENTED}. */
|
|
328
|
+
MIN_ETH_USD_PRICE: () => Promise<bigint>;
|
|
329
|
+
/** @deprecated Removed in the v5.x contract refactor — not in the deployed SuperPaymaster ABI. Throws {@link ErrorCode.NOT_IMPLEMENTED}. */
|
|
330
|
+
PAYMASTER_DATA_OFFSET: () => Promise<bigint>;
|
|
331
|
+
/** @deprecated Removed in the v5.x contract refactor — not in the deployed SuperPaymaster ABI. Throws {@link ErrorCode.NOT_IMPLEMENTED}. */
|
|
332
|
+
PRICE_CACHE_DURATION: () => Promise<bigint>;
|
|
333
|
+
/** @deprecated Removed in the v5.x contract refactor — not in the deployed SuperPaymaster ABI. Throws {@link ErrorCode.NOT_IMPLEMENTED}. */
|
|
334
|
+
RATE_OFFSET: () => Promise<bigint>;
|
|
335
|
+
/** @deprecated Removed in the v5.x contract refactor — not in the deployed SuperPaymaster ABI. Throws {@link ErrorCode.NOT_IMPLEMENTED}. */
|
|
336
|
+
VALIDATION_BUFFER_BPS: () => Promise<bigint>;
|
|
337
|
+
/** @deprecated Removed in the v5.x contract refactor — not in the deployed SuperPaymaster ABI. Throws {@link ErrorCode.NOT_IMPLEMENTED}. */
|
|
338
|
+
BPS_DENOMINATOR: () => Promise<bigint>;
|
|
339
|
+
/** Duration (seconds) of the aPNTs-token-change timelock. */
|
|
340
|
+
APNTS_TOKEN_TIMELOCK: () => Promise<bigint>;
|
|
341
|
+
owner: () => Promise<Address>;
|
|
342
|
+
transferOwnership: (args: {
|
|
343
|
+
newOwner: Address;
|
|
344
|
+
account?: Account | Address;
|
|
345
|
+
}) => Promise<Hash>;
|
|
346
|
+
renounceOwnership: (args: {
|
|
347
|
+
account?: Account | Address;
|
|
348
|
+
}) => Promise<Hash>;
|
|
349
|
+
version: () => Promise<string>;
|
|
350
|
+
};
|
|
351
|
+
declare const superPaymasterActions: (address: Address) => (client: PublicClient | WalletClient) => SuperPaymasterActions;
|
|
352
|
+
|
|
353
|
+
type TokenConfig = {
|
|
354
|
+
tier1Limit: bigint;
|
|
355
|
+
tier2Limit: bigint;
|
|
356
|
+
dailyLimit: bigint;
|
|
357
|
+
};
|
|
358
|
+
type InitConfig = {
|
|
359
|
+
guardians: readonly [Address, Address, Address];
|
|
360
|
+
guardianP256X: readonly [Hex, Hex, Hex];
|
|
361
|
+
guardianP256Y: readonly [Hex, Hex, Hex];
|
|
362
|
+
dailyLimit: bigint;
|
|
363
|
+
approvedAlgIds: readonly number[];
|
|
364
|
+
minDailyLimit: bigint;
|
|
365
|
+
initialTokens: readonly Address[];
|
|
366
|
+
initialTokenConfigs: readonly TokenConfig[];
|
|
367
|
+
};
|
|
368
|
+
type PendingModuleInstall = {
|
|
369
|
+
module: Address;
|
|
370
|
+
moduleTypeId: number;
|
|
371
|
+
proposedAt: number;
|
|
372
|
+
executeAfter: number;
|
|
373
|
+
initDataHash: Hex;
|
|
374
|
+
};
|
|
375
|
+
type AirAccountActions = {
|
|
376
|
+
owner: () => Promise<Address>;
|
|
377
|
+
guardianCount: () => Promise<number>;
|
|
378
|
+
guardians: (args: {
|
|
379
|
+
index: bigint | number;
|
|
380
|
+
}) => Promise<Address>;
|
|
381
|
+
accountId: () => Promise<string>;
|
|
382
|
+
isValidSignature: (args: {
|
|
383
|
+
hash: Hex;
|
|
384
|
+
sig: Hex;
|
|
385
|
+
}) => Promise<Hex>;
|
|
386
|
+
requiredTier: (args: {
|
|
387
|
+
txValue: bigint;
|
|
388
|
+
}) => Promise<number>;
|
|
389
|
+
supportsModule: (args: {
|
|
390
|
+
moduleTypeId: bigint;
|
|
391
|
+
}) => Promise<boolean>;
|
|
392
|
+
p256KeyX: () => Promise<Hex>;
|
|
393
|
+
p256KeyY: () => Promise<Hex>;
|
|
394
|
+
parserRegistry: () => Promise<Address>;
|
|
395
|
+
moduleManagementNonce: () => Promise<bigint>;
|
|
396
|
+
moduleInstallTimelock: () => Promise<bigint>;
|
|
397
|
+
pendingModuleInstall: () => Promise<PendingModuleInstall>;
|
|
398
|
+
setP256Key: (args: {
|
|
399
|
+
x: Hex;
|
|
400
|
+
y: Hex;
|
|
401
|
+
account?: Account | Address;
|
|
402
|
+
}) => Promise<Hash>;
|
|
403
|
+
setTierLimits: (args: {
|
|
404
|
+
tier1: bigint;
|
|
405
|
+
tier2: bigint;
|
|
406
|
+
account?: Account | Address;
|
|
407
|
+
}) => Promise<Hash>;
|
|
408
|
+
setValidator: (args: {
|
|
409
|
+
validator: Address;
|
|
410
|
+
account?: Account | Address;
|
|
411
|
+
}) => Promise<Hash>;
|
|
412
|
+
setParserRegistry: (args: {
|
|
413
|
+
registry: Address;
|
|
414
|
+
account?: Account | Address;
|
|
415
|
+
}) => Promise<Hash>;
|
|
416
|
+
/**
|
|
417
|
+
* Execute calls via an installed executor module (ERC-7579 `executeFromExecutor`).
|
|
418
|
+
* NOTE: this is a state-changing tx, so it resolves to the transaction `Hash` — the
|
|
419
|
+
* on-chain `bytes[] returnData` is NOT recoverable from a write. If you need the
|
|
420
|
+
* decoded return data, `simulateContract`/`call` the same function separately.
|
|
421
|
+
*/
|
|
422
|
+
executeFromExecutor: (args: {
|
|
423
|
+
mode: Hex;
|
|
424
|
+
executionCalldata: Hex;
|
|
425
|
+
account?: Account | Address;
|
|
426
|
+
}) => Promise<Hash>;
|
|
427
|
+
validateUserOp: (args: {
|
|
428
|
+
userOp: PackedUserOperation;
|
|
429
|
+
userOpHash: Hex;
|
|
430
|
+
missingAccountFunds: bigint;
|
|
431
|
+
account?: Account | Address;
|
|
432
|
+
}) => Promise<Hash>;
|
|
433
|
+
initializeAgentAccount: (args: {
|
|
434
|
+
entryPoint: Address;
|
|
435
|
+
owner: Address;
|
|
436
|
+
config: InitConfig;
|
|
437
|
+
guardAddr: Address;
|
|
438
|
+
account?: Account | Address;
|
|
439
|
+
}) => Promise<Hash>;
|
|
440
|
+
guardAddTokenConfig: (args: {
|
|
441
|
+
token: Address;
|
|
442
|
+
config: TokenConfig;
|
|
443
|
+
account?: Account | Address;
|
|
444
|
+
}) => Promise<Hash>;
|
|
445
|
+
guardApproveAlgorithm: (args: {
|
|
446
|
+
algId: number;
|
|
447
|
+
account?: Account | Address;
|
|
448
|
+
}) => Promise<Hash>;
|
|
449
|
+
guardDecreaseDailyLimit: (args: {
|
|
450
|
+
newLimit: bigint;
|
|
451
|
+
account?: Account | Address;
|
|
452
|
+
}) => Promise<Hash>;
|
|
453
|
+
guardDecreaseTokenDailyLimit: (args: {
|
|
454
|
+
token: Address;
|
|
455
|
+
newLimit: bigint;
|
|
456
|
+
account?: Account | Address;
|
|
457
|
+
}) => Promise<Hash>;
|
|
458
|
+
guardSetStrictMode: (args: {
|
|
459
|
+
enabled: boolean;
|
|
460
|
+
account?: Account | Address;
|
|
461
|
+
}) => Promise<Hash>;
|
|
462
|
+
proposeModuleInstall: (args: {
|
|
463
|
+
moduleTypeId: bigint;
|
|
464
|
+
module: Address;
|
|
465
|
+
initData: Hex;
|
|
466
|
+
account?: Account | Address;
|
|
467
|
+
}) => Promise<Hash>;
|
|
468
|
+
executeModuleInstall: (args: {
|
|
469
|
+
moduleInitData: Hex;
|
|
470
|
+
account?: Account | Address;
|
|
471
|
+
}) => Promise<Hash>;
|
|
472
|
+
cancelModuleInstall: (args: {
|
|
473
|
+
account?: Account | Address;
|
|
474
|
+
}) => Promise<Hash>;
|
|
475
|
+
setModuleInstallTimelock: (args: {
|
|
476
|
+
newTimelock: bigint;
|
|
477
|
+
guardianSigs: Hex;
|
|
478
|
+
account?: Account | Address;
|
|
479
|
+
}) => Promise<Hash>;
|
|
480
|
+
};
|
|
481
|
+
declare const airAccountActions: (address: Address) => (client: PublicClient | WalletClient) => AirAccountActions;
|
|
482
|
+
|
|
483
|
+
/** One guardian slot for {@link buildInitConfig}: supply EXACTLY one of `ecdsa` or `p256`. */
|
|
484
|
+
interface GuardianSpec {
|
|
485
|
+
/** An ECDSA (EOA / Safe) guardian address. Mutually exclusive with `p256`. */
|
|
486
|
+
ecdsa?: Address;
|
|
487
|
+
/** A P-256 (WebAuthn passkey) guardian public key (x, y, each bytes32). Mutually exclusive with `ecdsa`. */
|
|
488
|
+
p256?: {
|
|
489
|
+
x: Hex;
|
|
490
|
+
y: Hex;
|
|
491
|
+
};
|
|
492
|
+
}
|
|
493
|
+
/** Parameters for {@link buildInitConfig}. */
|
|
494
|
+
interface BuildInitConfigParams {
|
|
495
|
+
/** Up to 3 guardian slots (ECDSA and/or P-256, freely mixed). Empty/omitted ⇒ no guardians. */
|
|
496
|
+
guardians?: readonly GuardianSpec[];
|
|
497
|
+
/** Per-account daily spend limit (wei). Must be > 0 to enable the on-chain GUARD. */
|
|
498
|
+
dailyLimit: bigint;
|
|
499
|
+
/**
|
|
500
|
+
* Validator algorithm ids approved at init (0x02 = ECDSA, 0x03 = P-256/passkey). If omitted,
|
|
501
|
+
* deriving from the owner/guardian mix is NOT possible (owner alg is separate), so it defaults
|
|
502
|
+
* to `[0x02]` (ECDSA) plus `0x03` (P-256) when any P-256 guardian is present — i.e. `[0x02, 0x03]`.
|
|
503
|
+
*/
|
|
504
|
+
approvedAlgIds?: readonly number[];
|
|
505
|
+
/** Floor the daily limit can be decreased to via the guard. Defaults to 0. */
|
|
506
|
+
minDailyLimit?: bigint;
|
|
507
|
+
/** ERC-20 tokens to pre-register with the guard. Defaults to none. */
|
|
508
|
+
initialTokens?: readonly Address[];
|
|
509
|
+
/** Per-token tier configs, index-aligned with `initialTokens`. Defaults to none. */
|
|
510
|
+
initialTokenConfigs?: readonly TokenConfig[];
|
|
511
|
+
}
|
|
512
|
+
/**
|
|
513
|
+
* Build a v0.20.0 `InitConfig` with mixed ECDSA + P-256 guardians.
|
|
514
|
+
* @throws {AAStarError} if any slot is ambiguous, the sentinel is misused, or > 3 guardians are given.
|
|
515
|
+
*/
|
|
516
|
+
declare function buildInitConfig(params: BuildInitConfigParams): InitConfig;
|
|
517
|
+
|
|
518
|
+
export { type AirAccountActions as A, type BuildInitConfigParams as B, type DryRunValidationResult as D, type GuardianSpec as G, type InitConfig as I, type OperatorConfig as O, type PendingModuleInstall as P, type ResolvedAPNTsToken as R, type SuperPaymasterActions as S, type TokenConfig as T, type SlashRecord as a, airAccountActions as b, buildInitConfig as c, type PackedUserOperation as d, superPaymasterActions as s };
|