@aastar/core 0.16.7
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/LICENSE +21 -0
- package/dist/abis/BLSAggregator.json +686 -0
- package/dist/abis/BLSValidator.json +42 -0
- package/dist/abis/DVTValidator.json +368 -0
- package/dist/abis/Eip7702Support.json +24 -0
- package/dist/abis/EntryPoint.json +1382 -0
- package/dist/abis/GToken.json +513 -0
- package/dist/abis/GTokenStaking.json +949 -0
- package/dist/abis/LegacyAccount.json +625 -0
- package/dist/abis/MySBT.json +1518 -0
- package/dist/abis/Paymaster.json +1143 -0
- package/dist/abis/PaymasterFactory.json +640 -0
- package/dist/abis/Registry.json +1942 -0
- package/dist/abis/ReputationSystem.json +699 -0
- package/dist/abis/SenderCreator.json +99 -0
- package/dist/abis/Simple7702Account.json +395 -0
- package/dist/abis/SimpleAccount.json +560 -0
- package/dist/abis/SimpleAccountFactory.json +111 -0
- package/dist/abis/SimpleAccountFactoryV08.json +87 -0
- package/dist/abis/SimpleAccountV08.json +557 -0
- package/dist/abis/SuperPaymaster.json +1781 -0
- package/dist/abis/UserOperationLib.json +57 -0
- package/dist/abis/abi.config.json +24 -0
- package/dist/abis/index.d.ts +1126 -0
- package/dist/abis/index.js +91 -0
- package/dist/abis/xPNTsFactory.json +718 -0
- package/dist/abis/xPNTsToken.json +1280 -0
- package/dist/actions/StateValidator.d.ts +68 -0
- package/dist/actions/StateValidator.js +187 -0
- package/dist/actions/StateValidator.test.d.ts +1 -0
- package/dist/actions/StateValidator.test.js +144 -0
- package/dist/actions/account.d.ts +55 -0
- package/dist/actions/account.js +133 -0
- package/dist/actions/account.test.d.ts +1 -0
- package/dist/actions/account.test.js +118 -0
- package/dist/actions/aggregator.d.ts +17 -0
- package/dist/actions/aggregator.js +31 -0
- package/dist/actions/aggregator.test.d.ts +1 -0
- package/dist/actions/aggregator.test.js +67 -0
- package/dist/actions/dvt.d.ts +30 -0
- package/dist/actions/dvt.js +41 -0
- package/dist/actions/dvt.test.d.ts +1 -0
- package/dist/actions/dvt.test.js +98 -0
- package/dist/actions/entryPoint.d.ts +90 -0
- package/dist/actions/entryPoint.js +211 -0
- package/dist/actions/entryPoint.test.d.ts +1 -0
- package/dist/actions/entryPoint.test.js +139 -0
- package/dist/actions/factory.d.ts +215 -0
- package/dist/actions/factory.js +442 -0
- package/dist/actions/factory.test.d.ts +1 -0
- package/dist/actions/factory.test.js +197 -0
- package/dist/actions/faucet.d.ts +48 -0
- package/dist/actions/faucet.js +337 -0
- package/dist/actions/faucet.test.d.ts +1 -0
- package/dist/actions/faucet.test.js +120 -0
- package/dist/actions/gtokenExtended.d.ts +39 -0
- package/dist/actions/gtokenExtended.js +115 -0
- package/dist/actions/gtokenExtended.test.d.ts +1 -0
- package/dist/actions/gtokenExtended.test.js +118 -0
- package/dist/actions/index.d.ts +15 -0
- package/dist/actions/index.js +17 -0
- package/dist/actions/paymasterV4.d.ts +170 -0
- package/dist/actions/paymasterV4.js +334 -0
- package/dist/actions/paymasterV4.test.d.ts +1 -0
- package/dist/actions/paymasterV4.test.js +159 -0
- package/dist/actions/registry.d.ts +246 -0
- package/dist/actions/registry.js +667 -0
- package/dist/actions/registry.test.d.ts +1 -0
- package/dist/actions/registry.test.js +360 -0
- package/dist/actions/reputation.d.ts +129 -0
- package/dist/actions/reputation.js +281 -0
- package/dist/actions/reputation.test.d.ts +1 -0
- package/dist/actions/reputation.test.js +169 -0
- package/dist/actions/sbt.d.ts +191 -0
- package/dist/actions/sbt.js +533 -0
- package/dist/actions/sbt.test.d.ts +1 -0
- package/dist/actions/sbt.test.js +256 -0
- package/dist/actions/staking.d.ts +132 -0
- package/dist/actions/staking.js +330 -0
- package/dist/actions/staking.test.d.ts +1 -0
- package/dist/actions/staking.test.js +223 -0
- package/dist/actions/superPaymaster.d.ts +237 -0
- package/dist/actions/superPaymaster.js +644 -0
- package/dist/actions/superPaymaster.test.d.ts +1 -0
- package/dist/actions/superPaymaster.test.js +287 -0
- package/dist/actions/tokens.d.ts +229 -0
- package/dist/actions/tokens.js +415 -0
- package/dist/actions/tokens.test.d.ts +1 -0
- package/dist/actions/tokens.test.js +53 -0
- package/dist/actions/validators.d.ts +194 -0
- package/dist/actions/validators.js +433 -0
- package/dist/actions/validators.test.d.ts +1 -0
- package/dist/actions/validators.test.js +215 -0
- package/dist/branding.d.ts +30 -0
- package/dist/branding.js +30 -0
- package/dist/clients/BaseClient.d.ts +25 -0
- package/dist/clients/BaseClient.js +66 -0
- package/dist/clients/types.d.ts +60 -0
- package/dist/clients/types.js +1 -0
- package/dist/clients.d.ts +5 -0
- package/dist/clients.js +11 -0
- package/dist/communities.d.ts +52 -0
- package/dist/communities.js +73 -0
- package/dist/config/ContractConfigManager.d.ts +20 -0
- package/dist/config/ContractConfigManager.js +48 -0
- package/dist/constants.d.ts +88 -0
- package/dist/constants.js +125 -0
- package/dist/contract-addresses.d.ts +110 -0
- package/dist/contract-addresses.js +99 -0
- package/dist/contracts.d.ts +424 -0
- package/dist/contracts.js +343 -0
- package/dist/contracts.test.d.ts +1 -0
- package/dist/contracts.test.js +40 -0
- package/dist/crypto/blsSigner.d.ts +64 -0
- package/dist/crypto/blsSigner.js +98 -0
- package/dist/crypto/index.d.ts +1 -0
- package/dist/crypto/index.js +1 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.js +21 -0
- package/dist/networks.d.ts +127 -0
- package/dist/networks.js +118 -0
- package/dist/requirementChecker.d.ts +38 -0
- package/dist/requirementChecker.js +139 -0
- package/dist/requirementChecker.test.d.ts +1 -0
- package/dist/requirementChecker.test.js +60 -0
- package/dist/roles.d.ts +204 -0
- package/dist/roles.js +211 -0
- package/dist/roles.test.d.ts +1 -0
- package/dist/roles.test.js +23 -0
- package/dist/utils/validation.d.ts +24 -0
- package/dist/utils/validation.js +56 -0
- package/dist/utils/validation.test.d.ts +1 -0
- package/dist/utils/validation.test.js +40 -0
- package/dist/utils.d.ts +12 -0
- package/dist/utils.js +14 -0
- package/package.json +33 -0
|
@@ -0,0 +1,644 @@
|
|
|
1
|
+
import { SuperPaymasterABI } from '../abis/index.js';
|
|
2
|
+
export const superPaymasterActions = (address) => (client) => ({
|
|
3
|
+
// Deposit & Withdrawal
|
|
4
|
+
async superPaymasterDeposit({ amount, account }) {
|
|
5
|
+
return client.writeContract({
|
|
6
|
+
address,
|
|
7
|
+
abi: SuperPaymasterABI,
|
|
8
|
+
functionName: 'deposit',
|
|
9
|
+
args: [amount],
|
|
10
|
+
account: account,
|
|
11
|
+
chain: client.chain
|
|
12
|
+
});
|
|
13
|
+
},
|
|
14
|
+
// Semantic alias: depositAPNTs - uses aPNTs token (nonpayable)
|
|
15
|
+
async superPaymasterDepositAPNTs({ amount, account }) {
|
|
16
|
+
return this.superPaymasterDeposit({ amount, account });
|
|
17
|
+
},
|
|
18
|
+
// depositETH - uses native ETH (payable, no args)
|
|
19
|
+
async superPaymasterDepositETH({ value, account }) {
|
|
20
|
+
return client.writeContract({
|
|
21
|
+
address,
|
|
22
|
+
abi: SuperPaymasterABI,
|
|
23
|
+
functionName: 'deposit',
|
|
24
|
+
args: [],
|
|
25
|
+
value,
|
|
26
|
+
account: account,
|
|
27
|
+
chain: client.chain
|
|
28
|
+
});
|
|
29
|
+
},
|
|
30
|
+
async superPaymasterWithdraw({ amount, account }) {
|
|
31
|
+
return client.writeContract({
|
|
32
|
+
address,
|
|
33
|
+
abi: SuperPaymasterABI,
|
|
34
|
+
functionName: 'withdraw',
|
|
35
|
+
args: [amount],
|
|
36
|
+
account: account,
|
|
37
|
+
chain: client.chain
|
|
38
|
+
});
|
|
39
|
+
},
|
|
40
|
+
async superPaymasterDepositFor({ operator, amount, account }) {
|
|
41
|
+
return client.writeContract({
|
|
42
|
+
address,
|
|
43
|
+
abi: SuperPaymasterABI,
|
|
44
|
+
functionName: 'depositFor',
|
|
45
|
+
args: [operator, amount],
|
|
46
|
+
account: account,
|
|
47
|
+
chain: client.chain
|
|
48
|
+
});
|
|
49
|
+
},
|
|
50
|
+
async superPaymasterWithdrawTo({ to, amount, account }) {
|
|
51
|
+
return client.writeContract({
|
|
52
|
+
address,
|
|
53
|
+
abi: SuperPaymasterABI,
|
|
54
|
+
functionName: 'withdrawTo',
|
|
55
|
+
args: [to, amount],
|
|
56
|
+
account: account,
|
|
57
|
+
chain: client.chain
|
|
58
|
+
});
|
|
59
|
+
},
|
|
60
|
+
async superPaymasterAddSuperStake({ amount, account }) {
|
|
61
|
+
return client.writeContract({
|
|
62
|
+
address,
|
|
63
|
+
abi: SuperPaymasterABI,
|
|
64
|
+
functionName: 'addStake',
|
|
65
|
+
args: [amount],
|
|
66
|
+
account: account,
|
|
67
|
+
chain: client.chain
|
|
68
|
+
});
|
|
69
|
+
},
|
|
70
|
+
async superPaymasterUnlockSuperStake({ account }) {
|
|
71
|
+
return client.writeContract({
|
|
72
|
+
address,
|
|
73
|
+
abi: SuperPaymasterABI,
|
|
74
|
+
functionName: 'unlockStake',
|
|
75
|
+
args: [],
|
|
76
|
+
account: account,
|
|
77
|
+
chain: client.chain
|
|
78
|
+
});
|
|
79
|
+
},
|
|
80
|
+
async superPaymasterWithdrawStake({ to, account }) {
|
|
81
|
+
return client.writeContract({
|
|
82
|
+
address,
|
|
83
|
+
abi: SuperPaymasterABI,
|
|
84
|
+
functionName: 'withdrawStake',
|
|
85
|
+
args: [to],
|
|
86
|
+
account: account,
|
|
87
|
+
chain: client.chain
|
|
88
|
+
});
|
|
89
|
+
},
|
|
90
|
+
// Operator Management
|
|
91
|
+
async superPaymasterConfigureOperator({ xPNTsToken, treasury, exchangeRate, account }) {
|
|
92
|
+
return client.writeContract({
|
|
93
|
+
address,
|
|
94
|
+
abi: SuperPaymasterABI,
|
|
95
|
+
functionName: 'configureOperator',
|
|
96
|
+
args: [xPNTsToken, treasury, exchangeRate],
|
|
97
|
+
account: account,
|
|
98
|
+
chain: client.chain
|
|
99
|
+
});
|
|
100
|
+
},
|
|
101
|
+
async superPaymasterSetOperatorPaused({ operator, paused, account }) {
|
|
102
|
+
return client.writeContract({
|
|
103
|
+
address,
|
|
104
|
+
abi: SuperPaymasterABI,
|
|
105
|
+
functionName: 'setOperatorPaused',
|
|
106
|
+
args: [operator, paused],
|
|
107
|
+
account: account,
|
|
108
|
+
chain: client.chain
|
|
109
|
+
});
|
|
110
|
+
},
|
|
111
|
+
async superPaymasterUpdateReputation({ operator, newReputation, account }) {
|
|
112
|
+
return client.writeContract({
|
|
113
|
+
address,
|
|
114
|
+
abi: SuperPaymasterABI,
|
|
115
|
+
functionName: 'updateReputation',
|
|
116
|
+
args: [operator, newReputation],
|
|
117
|
+
account: account,
|
|
118
|
+
chain: client.chain
|
|
119
|
+
});
|
|
120
|
+
},
|
|
121
|
+
async superPaymasterExecuteSlashWithBLS({ operator, roleId, amount, reason, blsSignature, account }) {
|
|
122
|
+
return client.writeContract({
|
|
123
|
+
address,
|
|
124
|
+
abi: SuperPaymasterABI,
|
|
125
|
+
functionName: 'executeSlashWithBLS',
|
|
126
|
+
args: [operator, roleId, amount, reason, blsSignature],
|
|
127
|
+
account: account,
|
|
128
|
+
chain: client.chain
|
|
129
|
+
});
|
|
130
|
+
},
|
|
131
|
+
// Price & Configuration
|
|
132
|
+
async superPaymasterSetAPNTsPrice({ priceUSD, account }) {
|
|
133
|
+
return client.writeContract({
|
|
134
|
+
address,
|
|
135
|
+
abi: SuperPaymasterABI,
|
|
136
|
+
functionName: 'setAPNTsPrice',
|
|
137
|
+
args: [priceUSD],
|
|
138
|
+
account: account,
|
|
139
|
+
chain: client.chain
|
|
140
|
+
});
|
|
141
|
+
},
|
|
142
|
+
async superPaymasterSetCachedPrice({ price, account }) {
|
|
143
|
+
return client.writeContract({
|
|
144
|
+
address,
|
|
145
|
+
abi: SuperPaymasterABI,
|
|
146
|
+
functionName: 'setCachedPrice',
|
|
147
|
+
args: [price],
|
|
148
|
+
account: account,
|
|
149
|
+
chain: client.chain
|
|
150
|
+
});
|
|
151
|
+
},
|
|
152
|
+
async superPaymasterSetProtocolFee({ feeRecipient, feeBps, account }) {
|
|
153
|
+
return client.writeContract({
|
|
154
|
+
address,
|
|
155
|
+
abi: SuperPaymasterABI,
|
|
156
|
+
functionName: 'setProtocolFee',
|
|
157
|
+
args: [feeRecipient, feeBps],
|
|
158
|
+
account: account,
|
|
159
|
+
chain: client.chain
|
|
160
|
+
});
|
|
161
|
+
},
|
|
162
|
+
// User Management
|
|
163
|
+
async superPaymasterBlockUser({ user, blocked, account }) {
|
|
164
|
+
return client.writeContract({
|
|
165
|
+
address,
|
|
166
|
+
abi: SuperPaymasterABI,
|
|
167
|
+
functionName: 'blockUser',
|
|
168
|
+
args: [user, blocked],
|
|
169
|
+
account: account,
|
|
170
|
+
chain: client.chain
|
|
171
|
+
});
|
|
172
|
+
},
|
|
173
|
+
// Validation (EntryPoint calls)
|
|
174
|
+
async superPaymasterValidatePaymasterUserOp({ userOp, userOpHash, maxCost }) {
|
|
175
|
+
return client.readContract({
|
|
176
|
+
address,
|
|
177
|
+
abi: SuperPaymasterABI,
|
|
178
|
+
functionName: 'validatePaymasterUserOp',
|
|
179
|
+
args: [userOp, userOpHash, maxCost]
|
|
180
|
+
});
|
|
181
|
+
},
|
|
182
|
+
async superPaymasterPostOp({ mode, context, actualGasCost, actualUserOpFeePerGas }) {
|
|
183
|
+
// postOp is called by EntryPoint, typically not called directly
|
|
184
|
+
throw new Error('postOp is called by EntryPoint after UserOp execution');
|
|
185
|
+
},
|
|
186
|
+
// View Functions
|
|
187
|
+
async superPaymasterOperators({ operator }) {
|
|
188
|
+
return client.readContract({
|
|
189
|
+
address,
|
|
190
|
+
abi: SuperPaymasterABI,
|
|
191
|
+
functionName: 'operators',
|
|
192
|
+
args: [operator]
|
|
193
|
+
});
|
|
194
|
+
},
|
|
195
|
+
async superPaymasterGetDeposit() {
|
|
196
|
+
return client.readContract({
|
|
197
|
+
address,
|
|
198
|
+
abi: SuperPaymasterABI,
|
|
199
|
+
functionName: 'getDeposit',
|
|
200
|
+
args: []
|
|
201
|
+
});
|
|
202
|
+
},
|
|
203
|
+
async superPaymasterGetAvailableCredit({ operator, user }) {
|
|
204
|
+
return client.readContract({
|
|
205
|
+
address,
|
|
206
|
+
abi: SuperPaymasterABI,
|
|
207
|
+
functionName: 'getAvailableCredit',
|
|
208
|
+
args: [operator, user]
|
|
209
|
+
});
|
|
210
|
+
},
|
|
211
|
+
async superPaymasterBlockedUsers({ user }) {
|
|
212
|
+
return client.readContract({
|
|
213
|
+
address,
|
|
214
|
+
abi: SuperPaymasterABI,
|
|
215
|
+
functionName: 'blockedUsers',
|
|
216
|
+
args: [user]
|
|
217
|
+
});
|
|
218
|
+
},
|
|
219
|
+
// Convenience function: Get operator's aPNTs balance
|
|
220
|
+
async superPaymasterBalanceOfOperator({ operator }) {
|
|
221
|
+
const operatorConfig = await this.superPaymasterOperators({ operator });
|
|
222
|
+
return operatorConfig[0]; // aPNTsBalance is the first field
|
|
223
|
+
},
|
|
224
|
+
async superPaymasterAPNTsPriceUSD() {
|
|
225
|
+
return client.readContract({
|
|
226
|
+
address,
|
|
227
|
+
abi: SuperPaymasterABI,
|
|
228
|
+
functionName: 'aPNTsPriceUSD',
|
|
229
|
+
args: []
|
|
230
|
+
});
|
|
231
|
+
},
|
|
232
|
+
async superPaymasterCachedPrice() {
|
|
233
|
+
return client.readContract({
|
|
234
|
+
address,
|
|
235
|
+
abi: SuperPaymasterABI,
|
|
236
|
+
functionName: 'cachedPrice',
|
|
237
|
+
args: []
|
|
238
|
+
});
|
|
239
|
+
},
|
|
240
|
+
async superPaymasterProtocolFee() {
|
|
241
|
+
return client.readContract({
|
|
242
|
+
address,
|
|
243
|
+
abi: SuperPaymasterABI,
|
|
244
|
+
functionName: 'protocolFee',
|
|
245
|
+
args: []
|
|
246
|
+
});
|
|
247
|
+
},
|
|
248
|
+
async superPaymasterEntryPoint() {
|
|
249
|
+
return client.readContract({
|
|
250
|
+
address,
|
|
251
|
+
abi: SuperPaymasterABI,
|
|
252
|
+
functionName: 'entryPoint',
|
|
253
|
+
args: []
|
|
254
|
+
});
|
|
255
|
+
},
|
|
256
|
+
// Constants
|
|
257
|
+
async superPaymasterAPNTS_TOKEN() {
|
|
258
|
+
return client.readContract({
|
|
259
|
+
address,
|
|
260
|
+
abi: SuperPaymasterABI,
|
|
261
|
+
functionName: 'APNTS_TOKEN',
|
|
262
|
+
args: []
|
|
263
|
+
});
|
|
264
|
+
},
|
|
265
|
+
async superPaymasterREGISTRY() {
|
|
266
|
+
return client.readContract({
|
|
267
|
+
address,
|
|
268
|
+
abi: SuperPaymasterABI,
|
|
269
|
+
functionName: 'REGISTRY',
|
|
270
|
+
args: []
|
|
271
|
+
});
|
|
272
|
+
},
|
|
273
|
+
async superPaymasterBLS_AGGREGATOR() {
|
|
274
|
+
return client.readContract({
|
|
275
|
+
address,
|
|
276
|
+
abi: SuperPaymasterABI,
|
|
277
|
+
functionName: 'BLS_AGGREGATOR',
|
|
278
|
+
args: []
|
|
279
|
+
});
|
|
280
|
+
},
|
|
281
|
+
async superPaymasterETH_USD_PRICE_FEED() {
|
|
282
|
+
return client.readContract({
|
|
283
|
+
address,
|
|
284
|
+
abi: SuperPaymasterABI,
|
|
285
|
+
functionName: 'ETH_USD_PRICE_FEED',
|
|
286
|
+
args: []
|
|
287
|
+
});
|
|
288
|
+
},
|
|
289
|
+
async superPaymasterPAYMASTER_DATA_OFFSET() {
|
|
290
|
+
return client.readContract({
|
|
291
|
+
address,
|
|
292
|
+
abi: SuperPaymasterABI,
|
|
293
|
+
functionName: 'PAYMASTER_DATA_OFFSET',
|
|
294
|
+
args: []
|
|
295
|
+
});
|
|
296
|
+
},
|
|
297
|
+
async superPaymasterRATE_OFFSET() {
|
|
298
|
+
return client.readContract({
|
|
299
|
+
address,
|
|
300
|
+
abi: SuperPaymasterABI,
|
|
301
|
+
functionName: 'RATE_OFFSET',
|
|
302
|
+
args: []
|
|
303
|
+
});
|
|
304
|
+
},
|
|
305
|
+
async superPaymasterBPS_DENOMINATOR() {
|
|
306
|
+
return client.readContract({
|
|
307
|
+
address,
|
|
308
|
+
abi: SuperPaymasterABI,
|
|
309
|
+
functionName: 'BPS_DENOMINATOR',
|
|
310
|
+
args: []
|
|
311
|
+
});
|
|
312
|
+
},
|
|
313
|
+
async superPaymasterPRICE_CACHE_DURATION() {
|
|
314
|
+
return client.readContract({
|
|
315
|
+
address,
|
|
316
|
+
abi: SuperPaymasterABI,
|
|
317
|
+
functionName: 'PRICE_CACHE_DURATION',
|
|
318
|
+
args: []
|
|
319
|
+
});
|
|
320
|
+
},
|
|
321
|
+
async superPaymasterPRICE_STALENESS_THRESHOLD() {
|
|
322
|
+
return client.readContract({
|
|
323
|
+
address,
|
|
324
|
+
abi: SuperPaymasterABI,
|
|
325
|
+
functionName: 'PRICE_STALENESS_THRESHOLD',
|
|
326
|
+
args: []
|
|
327
|
+
});
|
|
328
|
+
},
|
|
329
|
+
async superPaymasterMAX_ETH_USD_PRICE() {
|
|
330
|
+
return client.readContract({
|
|
331
|
+
address,
|
|
332
|
+
abi: SuperPaymasterABI,
|
|
333
|
+
functionName: 'MAX_ETH_USD_PRICE',
|
|
334
|
+
args: []
|
|
335
|
+
});
|
|
336
|
+
},
|
|
337
|
+
async superPaymasterMIN_ETH_USD_PRICE() {
|
|
338
|
+
return client.readContract({
|
|
339
|
+
address,
|
|
340
|
+
abi: SuperPaymasterABI,
|
|
341
|
+
functionName: 'MIN_ETH_USD_PRICE',
|
|
342
|
+
args: []
|
|
343
|
+
});
|
|
344
|
+
},
|
|
345
|
+
// Admin
|
|
346
|
+
async transferSuperPaymasterOwnership({ newOwner, account }) {
|
|
347
|
+
return client.writeContract({
|
|
348
|
+
address,
|
|
349
|
+
abi: SuperPaymasterABI,
|
|
350
|
+
functionName: 'transferOwnership',
|
|
351
|
+
args: [newOwner],
|
|
352
|
+
account: account,
|
|
353
|
+
chain: client.chain
|
|
354
|
+
});
|
|
355
|
+
},
|
|
356
|
+
async superPaymasterOwner() {
|
|
357
|
+
return client.readContract({
|
|
358
|
+
address,
|
|
359
|
+
abi: SuperPaymasterABI,
|
|
360
|
+
functionName: 'owner',
|
|
361
|
+
args: []
|
|
362
|
+
});
|
|
363
|
+
},
|
|
364
|
+
async renounceSuperPaymasterOwnership({ account }) {
|
|
365
|
+
return client.writeContract({
|
|
366
|
+
address,
|
|
367
|
+
abi: SuperPaymasterABI,
|
|
368
|
+
functionName: 'renounceOwnership',
|
|
369
|
+
args: [],
|
|
370
|
+
account: account,
|
|
371
|
+
chain: client.chain
|
|
372
|
+
});
|
|
373
|
+
},
|
|
374
|
+
// Additional Operator Management
|
|
375
|
+
async superPaymasterSetOperatorLimits({ operator, limits, account }) {
|
|
376
|
+
return client.writeContract({
|
|
377
|
+
address,
|
|
378
|
+
abi: SuperPaymasterABI,
|
|
379
|
+
functionName: 'setOperatorLimits',
|
|
380
|
+
args: [operator, limits],
|
|
381
|
+
account: account,
|
|
382
|
+
chain: client.chain
|
|
383
|
+
});
|
|
384
|
+
},
|
|
385
|
+
async superPaymasterSlashOperator({ operator, amount, reason, account }) {
|
|
386
|
+
return client.writeContract({
|
|
387
|
+
address,
|
|
388
|
+
abi: SuperPaymasterABI,
|
|
389
|
+
functionName: 'slashOperator',
|
|
390
|
+
args: [operator, amount, reason],
|
|
391
|
+
account: account,
|
|
392
|
+
chain: client.chain
|
|
393
|
+
});
|
|
394
|
+
},
|
|
395
|
+
// User Management
|
|
396
|
+
async superPaymasterUpdateBlockedStatus({ user, blocked, account }) {
|
|
397
|
+
return client.writeContract({
|
|
398
|
+
address,
|
|
399
|
+
abi: SuperPaymasterABI,
|
|
400
|
+
functionName: 'updateBlockedStatus',
|
|
401
|
+
args: [user, blocked],
|
|
402
|
+
account: account,
|
|
403
|
+
chain: client.chain
|
|
404
|
+
});
|
|
405
|
+
},
|
|
406
|
+
// Additional View Functions
|
|
407
|
+
async superPaymasterProtocolFeeBPS() {
|
|
408
|
+
return client.readContract({
|
|
409
|
+
address,
|
|
410
|
+
abi: SuperPaymasterABI,
|
|
411
|
+
functionName: 'protocolFeeBPS',
|
|
412
|
+
args: []
|
|
413
|
+
});
|
|
414
|
+
},
|
|
415
|
+
async superPaymasterProtocolRevenue() {
|
|
416
|
+
return client.readContract({
|
|
417
|
+
address,
|
|
418
|
+
abi: SuperPaymasterABI,
|
|
419
|
+
functionName: 'protocolRevenue',
|
|
420
|
+
args: []
|
|
421
|
+
});
|
|
422
|
+
},
|
|
423
|
+
async superPaymasterTreasury() {
|
|
424
|
+
return client.readContract({
|
|
425
|
+
address,
|
|
426
|
+
abi: SuperPaymasterABI,
|
|
427
|
+
functionName: 'treasury',
|
|
428
|
+
args: []
|
|
429
|
+
});
|
|
430
|
+
},
|
|
431
|
+
async superPaymasterXpntsFactory() {
|
|
432
|
+
return client.readContract({
|
|
433
|
+
address,
|
|
434
|
+
abi: SuperPaymasterABI,
|
|
435
|
+
functionName: 'xpntsFactory',
|
|
436
|
+
args: []
|
|
437
|
+
});
|
|
438
|
+
},
|
|
439
|
+
async superPaymasterTotalTrackedBalance() {
|
|
440
|
+
return client.readContract({
|
|
441
|
+
address,
|
|
442
|
+
abi: SuperPaymasterABI,
|
|
443
|
+
functionName: 'totalTrackedBalance',
|
|
444
|
+
args: []
|
|
445
|
+
});
|
|
446
|
+
},
|
|
447
|
+
async superPaymasterLastUserOpTimestamp({ user }) {
|
|
448
|
+
return client.readContract({
|
|
449
|
+
address,
|
|
450
|
+
abi: SuperPaymasterABI,
|
|
451
|
+
functionName: 'lastUserOpTimestamp',
|
|
452
|
+
args: [user]
|
|
453
|
+
});
|
|
454
|
+
},
|
|
455
|
+
// Slash History
|
|
456
|
+
async superPaymasterGetSlashHistory({ operator }) {
|
|
457
|
+
return client.readContract({
|
|
458
|
+
address,
|
|
459
|
+
abi: SuperPaymasterABI,
|
|
460
|
+
functionName: 'getSlashHistory',
|
|
461
|
+
args: [operator]
|
|
462
|
+
});
|
|
463
|
+
},
|
|
464
|
+
async superPaymasterGetSlashCount({ operator }) {
|
|
465
|
+
return client.readContract({
|
|
466
|
+
address,
|
|
467
|
+
abi: SuperPaymasterABI,
|
|
468
|
+
functionName: 'getSlashCount',
|
|
469
|
+
args: [operator]
|
|
470
|
+
});
|
|
471
|
+
},
|
|
472
|
+
async superPaymasterGetLatestSlash({ operator }) {
|
|
473
|
+
return client.readContract({
|
|
474
|
+
address,
|
|
475
|
+
abi: SuperPaymasterABI,
|
|
476
|
+
functionName: 'getLatestSlash',
|
|
477
|
+
args: [operator]
|
|
478
|
+
});
|
|
479
|
+
},
|
|
480
|
+
async superPaymasterSlashHistory({ operator, index }) {
|
|
481
|
+
return client.readContract({
|
|
482
|
+
address,
|
|
483
|
+
abi: SuperPaymasterABI,
|
|
484
|
+
functionName: 'slashHistory',
|
|
485
|
+
args: [operator, index]
|
|
486
|
+
});
|
|
487
|
+
},
|
|
488
|
+
// Price Management
|
|
489
|
+
async superPaymasterUpdatePrice({ account }) {
|
|
490
|
+
return client.writeContract({
|
|
491
|
+
address,
|
|
492
|
+
abi: SuperPaymasterABI,
|
|
493
|
+
functionName: 'updatePrice',
|
|
494
|
+
args: [],
|
|
495
|
+
account: account,
|
|
496
|
+
chain: client.chain
|
|
497
|
+
});
|
|
498
|
+
},
|
|
499
|
+
async superPaymasterUpdatePriceDVT({ price, proof, account }) {
|
|
500
|
+
return client.writeContract({
|
|
501
|
+
address,
|
|
502
|
+
abi: SuperPaymasterABI,
|
|
503
|
+
functionName: 'updatePriceDVT',
|
|
504
|
+
args: [price, proof],
|
|
505
|
+
account: account,
|
|
506
|
+
chain: client.chain
|
|
507
|
+
});
|
|
508
|
+
},
|
|
509
|
+
// Treasury & Revenue
|
|
510
|
+
async superPaymasterSetTreasury({ treasury, account }) {
|
|
511
|
+
return client.writeContract({
|
|
512
|
+
address,
|
|
513
|
+
abi: SuperPaymasterABI,
|
|
514
|
+
functionName: 'setTreasury',
|
|
515
|
+
args: [treasury],
|
|
516
|
+
account: account,
|
|
517
|
+
chain: client.chain
|
|
518
|
+
});
|
|
519
|
+
},
|
|
520
|
+
async superPaymasterWithdrawProtocolRevenue({ to, account }) {
|
|
521
|
+
return client.writeContract({
|
|
522
|
+
address,
|
|
523
|
+
abi: SuperPaymasterABI,
|
|
524
|
+
functionName: 'withdrawProtocolRevenue',
|
|
525
|
+
args: [to],
|
|
526
|
+
account: account,
|
|
527
|
+
chain: client.chain
|
|
528
|
+
});
|
|
529
|
+
},
|
|
530
|
+
// Factory & Config
|
|
531
|
+
async superPaymasterSetXPNTsFactory({ factory, account }) {
|
|
532
|
+
return client.writeContract({
|
|
533
|
+
address,
|
|
534
|
+
abi: SuperPaymasterABI,
|
|
535
|
+
functionName: 'setXPNTsFactory',
|
|
536
|
+
args: [factory],
|
|
537
|
+
account: account,
|
|
538
|
+
chain: client.chain
|
|
539
|
+
});
|
|
540
|
+
},
|
|
541
|
+
async superPaymasterSetAPNTsToken({ token, account }) {
|
|
542
|
+
return client.writeContract({
|
|
543
|
+
address,
|
|
544
|
+
abi: SuperPaymasterABI,
|
|
545
|
+
functionName: 'setAPNTsToken',
|
|
546
|
+
args: [token],
|
|
547
|
+
account: account,
|
|
548
|
+
chain: client.chain
|
|
549
|
+
});
|
|
550
|
+
},
|
|
551
|
+
async superPaymasterSetBLSAggregator({ aggregator, account }) {
|
|
552
|
+
return client.writeContract({
|
|
553
|
+
address,
|
|
554
|
+
abi: SuperPaymasterABI,
|
|
555
|
+
functionName: 'setBLSAggregator',
|
|
556
|
+
args: [aggregator],
|
|
557
|
+
account: account,
|
|
558
|
+
chain: client.chain
|
|
559
|
+
});
|
|
560
|
+
},
|
|
561
|
+
// Transfer callback
|
|
562
|
+
async superPaymasterOnTransferReceived({ from, amount, data }) {
|
|
563
|
+
return client.readContract({
|
|
564
|
+
address,
|
|
565
|
+
abi: SuperPaymasterABI,
|
|
566
|
+
functionName: 'onTransferReceived',
|
|
567
|
+
args: [from, amount, data]
|
|
568
|
+
});
|
|
569
|
+
},
|
|
570
|
+
// Withdraw alias
|
|
571
|
+
async superPaymasterWithdrawAPNTs({ amount, account }) {
|
|
572
|
+
return client.writeContract({
|
|
573
|
+
address,
|
|
574
|
+
abi: SuperPaymasterABI,
|
|
575
|
+
functionName: 'withdraw',
|
|
576
|
+
args: [amount],
|
|
577
|
+
account: account,
|
|
578
|
+
chain: client.chain
|
|
579
|
+
});
|
|
580
|
+
},
|
|
581
|
+
async superPaymasterVersion() {
|
|
582
|
+
return client.readContract({
|
|
583
|
+
address,
|
|
584
|
+
abi: SuperPaymasterABI,
|
|
585
|
+
functionName: 'version',
|
|
586
|
+
args: []
|
|
587
|
+
});
|
|
588
|
+
},
|
|
589
|
+
// Aliases including implementation
|
|
590
|
+
async superPaymasterAddStake(args) { return this.superPaymasterDepositFor(args); },
|
|
591
|
+
async superPaymasterDepositForAlias(args) { return this.superPaymasterDepositFor(args); },
|
|
592
|
+
async superPaymasterUnlockStake(args) { return this.superPaymasterUnlockSuperStake(args); },
|
|
593
|
+
async superPaymasterWithdrawAlias(args) { return this.superPaymasterWithdraw(args); },
|
|
594
|
+
async superPaymasterMAX_PROTOCOL_FEE() {
|
|
595
|
+
return client.readContract({
|
|
596
|
+
address,
|
|
597
|
+
abi: SuperPaymasterABI,
|
|
598
|
+
functionName: 'MAX_PROTOCOL_FEE',
|
|
599
|
+
args: []
|
|
600
|
+
});
|
|
601
|
+
},
|
|
602
|
+
async superPaymasterVALIDATION_BUFFER_BPS() {
|
|
603
|
+
return client.readContract({
|
|
604
|
+
address,
|
|
605
|
+
abi: SuperPaymasterABI,
|
|
606
|
+
functionName: 'VALIDATION_BUFFER_BPS',
|
|
607
|
+
args: []
|
|
608
|
+
});
|
|
609
|
+
},
|
|
610
|
+
async superPaymasterPriceStalenessThreshold() {
|
|
611
|
+
return client.readContract({
|
|
612
|
+
address,
|
|
613
|
+
abi: SuperPaymasterABI,
|
|
614
|
+
functionName: 'priceStalenessThreshold', // Assuming ABI has this exact name
|
|
615
|
+
args: []
|
|
616
|
+
});
|
|
617
|
+
},
|
|
618
|
+
async superPaymasterSbtHolders({ user }) {
|
|
619
|
+
return client.readContract({
|
|
620
|
+
address,
|
|
621
|
+
abi: SuperPaymasterABI,
|
|
622
|
+
functionName: 'sbtHolders',
|
|
623
|
+
args: [user]
|
|
624
|
+
});
|
|
625
|
+
},
|
|
626
|
+
async superPaymasterUserOpState({ userOpHash }) {
|
|
627
|
+
return client.readContract({
|
|
628
|
+
address,
|
|
629
|
+
abi: SuperPaymasterABI,
|
|
630
|
+
functionName: 'userOpState',
|
|
631
|
+
args: [userOpHash]
|
|
632
|
+
});
|
|
633
|
+
},
|
|
634
|
+
async superPaymasterUpdateSBTStatus({ user, hasSBT, account }) {
|
|
635
|
+
return client.writeContract({
|
|
636
|
+
address,
|
|
637
|
+
abi: SuperPaymasterABI,
|
|
638
|
+
functionName: 'updateSBTStatus',
|
|
639
|
+
args: [user, hasSBT],
|
|
640
|
+
account: account,
|
|
641
|
+
chain: client.chain
|
|
642
|
+
});
|
|
643
|
+
}
|
|
644
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|