@aastar/core 0.16.8 → 0.16.11
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/abis/PaymasterV4_2.json +1193 -0
- package/dist/abis/SuperPaymaster.json +1 -1
- package/dist/abis/aPNTs.json +1160 -0
- package/dist/abis/abi.config.json +3 -3
- package/dist/abis/index.d.ts +15 -104
- package/dist/abis/index.js +22 -46
- package/dist/actions/account.d.ts +0 -15
- package/dist/actions/account.js +143 -108
- package/dist/actions/aggregator.d.ts +68 -7
- package/dist/actions/aggregator.js +328 -28
- package/dist/actions/dvt.d.ts +33 -5
- package/dist/actions/dvt.js +238 -38
- package/dist/actions/entryPoint.d.ts +3 -63
- package/dist/actions/entryPoint.js +52 -184
- package/dist/actions/factory.d.ts +48 -115
- package/dist/actions/factory.js +638 -438
- package/dist/actions/faucet.d.ts +23 -27
- package/dist/actions/faucet.js +150 -289
- package/dist/actions/index.d.ts +1 -2
- package/dist/actions/index.js +2 -4
- package/dist/actions/paymaster.d.ts +147 -0
- package/dist/actions/paymaster.js +706 -0
- package/dist/actions/paymasterV4.d.ts +26 -95
- package/dist/actions/paymasterV4.js +28 -121
- package/dist/actions/registry.d.ts +116 -165
- package/dist/actions/registry.js +855 -654
- package/dist/actions/reputation.d.ts +74 -52
- package/dist/actions/reputation.js +548 -242
- package/dist/actions/sbt.d.ts +90 -100
- package/dist/actions/sbt.js +801 -518
- package/dist/actions/staking.d.ts +45 -32
- package/dist/actions/staking.js +431 -260
- package/dist/actions/superPaymaster.d.ts +140 -158
- package/dist/actions/superPaymaster.js +965 -631
- package/dist/actions/tokens.d.ts +130 -108
- package/dist/actions/tokens.js +470 -414
- package/dist/actions/validators.d.ts +0 -73
- package/dist/actions/validators.js +0 -94
- package/dist/clients/BaseClient.d.ts +3 -3
- package/dist/clients/BundlerClient.d.ts +55 -0
- package/dist/clients/BundlerClient.js +92 -0
- package/dist/communities.js +2 -2
- package/dist/constants.js +1 -28
- package/dist/contract-addresses.d.ts +5 -14
- package/dist/contract-addresses.js +3 -9
- package/dist/contract-versions.d.ts +138 -0
- package/dist/contract-versions.js +328 -0
- package/dist/contracts.d.ts +6 -24
- package/dist/contracts.js +2 -2
- package/dist/errors/index.d.ts +57 -0
- package/dist/errors/index.js +123 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/requirementChecker.d.ts +35 -1
- package/dist/requirementChecker.js +39 -1
- package/dist/roles.d.ts +50 -61
- package/dist/roles.js +50 -61
- package/dist/validators/index.d.ts +35 -0
- package/dist/validators/index.js +60 -0
- package/package.json +5 -13
|
@@ -1,237 +1,219 @@
|
|
|
1
1
|
import { type Address, type PublicClient, type WalletClient, type Hex, type Hash, type Account } from 'viem';
|
|
2
|
+
export type SlashRecord = {
|
|
3
|
+
timestamp: bigint;
|
|
4
|
+
amount: bigint;
|
|
5
|
+
reputationLoss: bigint;
|
|
6
|
+
reason: string;
|
|
7
|
+
level: number;
|
|
8
|
+
};
|
|
9
|
+
export type OperatorConfig = {
|
|
10
|
+
aPNTsBalance: bigint;
|
|
11
|
+
exchangeRate: bigint;
|
|
12
|
+
isConfigured: boolean;
|
|
13
|
+
isPaused: boolean;
|
|
14
|
+
xPNTsToken: Address;
|
|
15
|
+
reputation: number;
|
|
16
|
+
minTxInterval: number;
|
|
17
|
+
treasury: Address;
|
|
18
|
+
totalSpent: bigint;
|
|
19
|
+
totalTxSponsored: bigint;
|
|
20
|
+
};
|
|
2
21
|
export type SuperPaymasterActions = {
|
|
3
|
-
|
|
4
|
-
amount: bigint;
|
|
5
|
-
account?: Account | Address;
|
|
6
|
-
}) => Promise<Hash>;
|
|
7
|
-
/** @deprecated Use superPaymasterDeposit for clarity */
|
|
8
|
-
superPaymasterDepositAPNTs: (args: {
|
|
22
|
+
deposit: (args: {
|
|
9
23
|
amount: bigint;
|
|
10
24
|
account?: Account | Address;
|
|
11
25
|
}) => Promise<Hash>;
|
|
12
|
-
|
|
26
|
+
depositETH: (args: {
|
|
13
27
|
value: bigint;
|
|
14
28
|
account?: Account | Address;
|
|
15
29
|
}) => Promise<Hash>;
|
|
16
|
-
|
|
17
|
-
|
|
30
|
+
depositFor: (args: {
|
|
31
|
+
targetOperator: Address;
|
|
18
32
|
amount: bigint;
|
|
19
33
|
account?: Account | Address;
|
|
20
34
|
}) => Promise<Hash>;
|
|
21
|
-
|
|
35
|
+
withdrawTo: (args: {
|
|
22
36
|
to: Address;
|
|
23
37
|
amount: bigint;
|
|
24
38
|
account?: Account | Address;
|
|
25
39
|
}) => Promise<Hash>;
|
|
26
|
-
|
|
40
|
+
withdraw: (args: {
|
|
27
41
|
amount: bigint;
|
|
28
42
|
account?: Account | Address;
|
|
29
43
|
}) => Promise<Hash>;
|
|
30
|
-
|
|
44
|
+
addStake: (args: {
|
|
45
|
+
unstakeDelaySec: number;
|
|
46
|
+
value: bigint;
|
|
47
|
+
account?: Account | Address;
|
|
48
|
+
}) => Promise<Hash>;
|
|
49
|
+
unlockStake: (args: {
|
|
31
50
|
account?: Account | Address;
|
|
32
51
|
}) => Promise<Hash>;
|
|
33
|
-
|
|
52
|
+
withdrawStake: (args: {
|
|
34
53
|
to: Address;
|
|
35
54
|
account?: Account | Address;
|
|
36
55
|
}) => Promise<Hash>;
|
|
37
|
-
|
|
56
|
+
configureOperator: (args: {
|
|
38
57
|
xPNTsToken: Address;
|
|
39
|
-
|
|
58
|
+
opTreasury: Address;
|
|
40
59
|
exchangeRate: bigint;
|
|
41
60
|
account?: Account | Address;
|
|
42
61
|
}) => Promise<Hash>;
|
|
43
|
-
|
|
62
|
+
setOperatorPaused: (args: {
|
|
44
63
|
operator: Address;
|
|
45
64
|
paused: boolean;
|
|
46
65
|
account?: Account | Address;
|
|
47
66
|
}) => Promise<Hash>;
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
limits: any;
|
|
67
|
+
setOperatorLimits: (args: {
|
|
68
|
+
minTxInterval: number;
|
|
51
69
|
account?: Account | Address;
|
|
52
70
|
}) => Promise<Hash>;
|
|
53
|
-
|
|
71
|
+
updateReputation: (args: {
|
|
54
72
|
operator: Address;
|
|
55
|
-
|
|
73
|
+
newScore: bigint;
|
|
56
74
|
account?: Account | Address;
|
|
57
75
|
}) => Promise<Hash>;
|
|
58
|
-
|
|
76
|
+
executeSlashWithBLS: (args: {
|
|
59
77
|
operator: Address;
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
reason: string;
|
|
63
|
-
blsSignature: Hex;
|
|
78
|
+
level: number;
|
|
79
|
+
proof: Hex;
|
|
64
80
|
account?: Account | Address;
|
|
65
81
|
}) => Promise<Hash>;
|
|
66
|
-
|
|
82
|
+
slashOperator: (args: {
|
|
67
83
|
operator: Address;
|
|
68
|
-
|
|
84
|
+
level: number;
|
|
85
|
+
penaltyAmount: bigint;
|
|
69
86
|
reason: string;
|
|
70
87
|
account?: Account | Address;
|
|
71
88
|
}) => Promise<Hash>;
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
superPaymasterSetCachedPrice: (args: {
|
|
77
|
-
price: bigint;
|
|
78
|
-
account?: Account | Address;
|
|
79
|
-
}) => Promise<Hash>;
|
|
80
|
-
superPaymasterSetProtocolFee: (args: {
|
|
81
|
-
feeRecipient: Address;
|
|
82
|
-
feeBps: bigint;
|
|
89
|
+
updateBlockedStatus: (args: {
|
|
90
|
+
operator: Address;
|
|
91
|
+
users: Address[];
|
|
92
|
+
statuses: boolean[];
|
|
83
93
|
account?: Account | Address;
|
|
84
94
|
}) => Promise<Hash>;
|
|
85
|
-
|
|
95
|
+
updateSBTStatus: (args: {
|
|
86
96
|
user: Address;
|
|
87
|
-
|
|
97
|
+
status: boolean;
|
|
88
98
|
account?: Account | Address;
|
|
89
99
|
}) => Promise<Hash>;
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
blocked: boolean;
|
|
100
|
+
setAPNTSPrice: (args: {
|
|
101
|
+
newPrice: bigint;
|
|
93
102
|
account?: Account | Address;
|
|
94
103
|
}) => Promise<Hash>;
|
|
95
|
-
|
|
96
|
-
userOp: any;
|
|
97
|
-
userOpHash: Hex;
|
|
98
|
-
maxCost: bigint;
|
|
99
|
-
}) => Promise<any>;
|
|
100
|
-
superPaymasterPostOp: (args: {
|
|
101
|
-
mode: number;
|
|
102
|
-
context: Hex;
|
|
103
|
-
actualGasCost: bigint;
|
|
104
|
-
actualUserOpFeePerGas: bigint;
|
|
105
|
-
}) => Promise<void>;
|
|
106
|
-
superPaymasterOperators: (args: {
|
|
107
|
-
operator: Address;
|
|
108
|
-
}) => Promise<any>;
|
|
109
|
-
superPaymasterGetDeposit: () => Promise<bigint>;
|
|
110
|
-
superPaymasterGetAvailableCredit: (args: {
|
|
111
|
-
operator: Address;
|
|
112
|
-
user: Address;
|
|
113
|
-
}) => Promise<bigint>;
|
|
114
|
-
superPaymasterBlockedUsers: (args: {
|
|
115
|
-
user: Address;
|
|
116
|
-
}) => Promise<boolean>;
|
|
117
|
-
superPaymasterBalanceOfOperator: (args: {
|
|
118
|
-
operator: Address;
|
|
119
|
-
}) => Promise<bigint>;
|
|
120
|
-
superPaymasterAPNTsPriceUSD: () => Promise<bigint>;
|
|
121
|
-
superPaymasterCachedPrice: () => Promise<any>;
|
|
122
|
-
superPaymasterProtocolFee: () => Promise<any>;
|
|
123
|
-
superPaymasterProtocolFeeBPS: () => Promise<bigint>;
|
|
124
|
-
superPaymasterProtocolRevenue: () => Promise<bigint>;
|
|
125
|
-
superPaymasterTreasury: () => Promise<Address>;
|
|
126
|
-
superPaymasterXpntsFactory: () => Promise<Address>;
|
|
127
|
-
superPaymasterEntryPoint: () => Promise<Address>;
|
|
128
|
-
superPaymasterTotalTrackedBalance: () => Promise<bigint>;
|
|
129
|
-
superPaymasterLastUserOpTimestamp: (args: {
|
|
130
|
-
user: Address;
|
|
131
|
-
}) => Promise<bigint>;
|
|
132
|
-
superPaymasterGetSlashHistory: (args: {
|
|
133
|
-
operator: Address;
|
|
134
|
-
}) => Promise<any[]>;
|
|
135
|
-
superPaymasterGetSlashCount: (args: {
|
|
136
|
-
operator: Address;
|
|
137
|
-
}) => Promise<bigint>;
|
|
138
|
-
superPaymasterGetLatestSlash: (args: {
|
|
139
|
-
operator: Address;
|
|
140
|
-
}) => Promise<any>;
|
|
141
|
-
superPaymasterSlashHistory: (args: {
|
|
142
|
-
operator: Address;
|
|
143
|
-
index: bigint;
|
|
144
|
-
}) => Promise<any>;
|
|
145
|
-
superPaymasterUpdatePrice: (args: {
|
|
104
|
+
updatePrice: (args: {
|
|
146
105
|
account?: Account | Address;
|
|
147
106
|
}) => Promise<Hash>;
|
|
148
|
-
|
|
107
|
+
updatePriceDVT: (args: {
|
|
149
108
|
price: bigint;
|
|
109
|
+
updatedAt: bigint;
|
|
150
110
|
proof: Hex;
|
|
151
111
|
account?: Account | Address;
|
|
152
112
|
}) => Promise<Hash>;
|
|
153
|
-
|
|
154
|
-
|
|
113
|
+
setProtocolFee: (args: {
|
|
114
|
+
newFeeBPS: bigint;
|
|
155
115
|
account?: Account | Address;
|
|
156
116
|
}) => Promise<Hash>;
|
|
157
|
-
|
|
158
|
-
|
|
117
|
+
setTreasury: (args: {
|
|
118
|
+
treasury: Address;
|
|
159
119
|
account?: Account | Address;
|
|
160
120
|
}) => Promise<Hash>;
|
|
161
|
-
|
|
121
|
+
setXPNTsFactory: (args: {
|
|
162
122
|
factory: Address;
|
|
163
123
|
account?: Account | Address;
|
|
164
124
|
}) => Promise<Hash>;
|
|
165
|
-
|
|
125
|
+
setAPNTsToken: (args: {
|
|
166
126
|
token: Address;
|
|
167
127
|
account?: Account | Address;
|
|
168
128
|
}) => Promise<Hash>;
|
|
169
|
-
|
|
129
|
+
setBLSAggregator: (args: {
|
|
170
130
|
aggregator: Address;
|
|
171
131
|
account?: Account | Address;
|
|
172
132
|
}) => Promise<Hash>;
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
amount: bigint;
|
|
176
|
-
data: Hex;
|
|
177
|
-
}) => Promise<any>;
|
|
178
|
-
superPaymasterWithdrawAPNTs: (args: {
|
|
179
|
-
amount: bigint;
|
|
180
|
-
account?: Account | Address;
|
|
181
|
-
}) => Promise<Hash>;
|
|
182
|
-
superPaymasterAPNTS_TOKEN: () => Promise<Address>;
|
|
183
|
-
superPaymasterREGISTRY: () => Promise<Address>;
|
|
184
|
-
superPaymasterBLS_AGGREGATOR: () => Promise<Address>;
|
|
185
|
-
superPaymasterETH_USD_PRICE_FEED: () => Promise<Address>;
|
|
186
|
-
superPaymasterPAYMASTER_DATA_OFFSET: () => Promise<bigint>;
|
|
187
|
-
superPaymasterRATE_OFFSET: () => Promise<bigint>;
|
|
188
|
-
superPaymasterBPS_DENOMINATOR: () => Promise<bigint>;
|
|
189
|
-
superPaymasterPRICE_CACHE_DURATION: () => Promise<bigint>;
|
|
190
|
-
superPaymasterPRICE_STALENESS_THRESHOLD: () => Promise<bigint>;
|
|
191
|
-
superPaymasterMAX_ETH_USD_PRICE: () => Promise<bigint>;
|
|
192
|
-
superPaymasterMIN_ETH_USD_PRICE: () => Promise<bigint>;
|
|
193
|
-
transferSuperPaymasterOwnership: (args: {
|
|
194
|
-
newOwner: Address;
|
|
195
|
-
account?: Account | Address;
|
|
196
|
-
}) => Promise<Hash>;
|
|
197
|
-
superPaymasterOwner: () => Promise<Address>;
|
|
198
|
-
renounceSuperPaymasterOwnership: (args: {
|
|
199
|
-
account?: Account | Address;
|
|
200
|
-
}) => Promise<Hash>;
|
|
201
|
-
superPaymasterAddStake: (args: {
|
|
133
|
+
withdrawProtocolRevenue: (args: {
|
|
134
|
+
to: Address;
|
|
202
135
|
amount: bigint;
|
|
203
136
|
account?: Account | Address;
|
|
204
137
|
}) => Promise<Hash>;
|
|
205
|
-
|
|
138
|
+
onTransferReceived: (args: {
|
|
206
139
|
operator: Address;
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
superPaymasterWithdraw: (args: {
|
|
214
|
-
amount: bigint;
|
|
215
|
-
account?: Account | Address;
|
|
216
|
-
}) => Promise<Hash>;
|
|
217
|
-
superPaymasterWithdrawAlias: (args: {
|
|
218
|
-
amount: bigint;
|
|
219
|
-
account?: Account | Address;
|
|
220
|
-
}) => Promise<Hash>;
|
|
221
|
-
superPaymasterMAX_PROTOCOL_FEE: () => Promise<bigint>;
|
|
222
|
-
superPaymasterVALIDATION_BUFFER_BPS: () => Promise<bigint>;
|
|
223
|
-
superPaymasterPriceStalenessThreshold: () => Promise<bigint>;
|
|
224
|
-
superPaymasterSbtHolders: (args: {
|
|
225
|
-
user: Address;
|
|
226
|
-
}) => Promise<boolean>;
|
|
227
|
-
superPaymasterUserOpState: (args: {
|
|
140
|
+
from: Address;
|
|
141
|
+
value: bigint;
|
|
142
|
+
data: Hex;
|
|
143
|
+
}) => Promise<Hex>;
|
|
144
|
+
validatePaymasterUserOp: (args: {
|
|
145
|
+
userOp: any;
|
|
228
146
|
userOpHash: Hex;
|
|
229
|
-
|
|
230
|
-
|
|
147
|
+
maxCost: bigint;
|
|
148
|
+
}) => Promise<{
|
|
149
|
+
context: Hex;
|
|
150
|
+
validationData: bigint;
|
|
151
|
+
}>;
|
|
152
|
+
operators: (args: {
|
|
153
|
+
operator: Address;
|
|
154
|
+
}) => Promise<OperatorConfig>;
|
|
155
|
+
getAvailableCredit: (args: {
|
|
231
156
|
user: Address;
|
|
232
|
-
|
|
157
|
+
token: Address;
|
|
158
|
+
}) => Promise<bigint>;
|
|
159
|
+
getDeposit: () => Promise<bigint>;
|
|
160
|
+
getLatestSlash: (args: {
|
|
161
|
+
operator: Address;
|
|
162
|
+
}) => Promise<SlashRecord>;
|
|
163
|
+
getSlashCount: (args: {
|
|
164
|
+
operator: Address;
|
|
165
|
+
}) => Promise<bigint>;
|
|
166
|
+
getSlashHistory: (args: {
|
|
167
|
+
operator: Address;
|
|
168
|
+
}) => Promise<SlashRecord[]>;
|
|
169
|
+
slashHistory: (args: {
|
|
170
|
+
operator: Address;
|
|
171
|
+
index: bigint;
|
|
172
|
+
}) => Promise<SlashRecord>;
|
|
173
|
+
userOpState: (args: {
|
|
174
|
+
user: Address;
|
|
175
|
+
operator: Address;
|
|
176
|
+
}) => Promise<{
|
|
177
|
+
lastTimestamp: number;
|
|
178
|
+
isBlocked: boolean;
|
|
179
|
+
}>;
|
|
180
|
+
cachedPrice: () => Promise<{
|
|
181
|
+
price: bigint;
|
|
182
|
+
updatedAt: bigint;
|
|
183
|
+
roundId: bigint;
|
|
184
|
+
decimals: number;
|
|
185
|
+
}>;
|
|
186
|
+
aPNTsPriceUSD: () => Promise<bigint>;
|
|
187
|
+
protocolFeeBPS: () => Promise<bigint>;
|
|
188
|
+
protocolRevenue: () => Promise<bigint>;
|
|
189
|
+
totalTrackedBalance: () => Promise<bigint>;
|
|
190
|
+
priceStalenessThreshold: () => Promise<bigint>;
|
|
191
|
+
sbtHolders: (args: {
|
|
192
|
+
user: Address;
|
|
193
|
+
}) => Promise<boolean>;
|
|
194
|
+
APNTS_TOKEN: () => Promise<Address>;
|
|
195
|
+
REGISTRY: () => Promise<Address>;
|
|
196
|
+
BLS_AGGREGATOR: () => Promise<Address>;
|
|
197
|
+
ETH_USD_PRICE_FEED: () => Promise<Address>;
|
|
198
|
+
treasury: () => Promise<Address>;
|
|
199
|
+
xpntsFactory: () => Promise<Address>;
|
|
200
|
+
entryPoint: () => Promise<Address>;
|
|
201
|
+
MAX_PROTOCOL_FEE: () => Promise<bigint>;
|
|
202
|
+
MAX_ETH_USD_PRICE: () => Promise<bigint>;
|
|
203
|
+
MIN_ETH_USD_PRICE: () => Promise<bigint>;
|
|
204
|
+
PAYMASTER_DATA_OFFSET: () => Promise<bigint>;
|
|
205
|
+
PRICE_CACHE_DURATION: () => Promise<bigint>;
|
|
206
|
+
RATE_OFFSET: () => Promise<bigint>;
|
|
207
|
+
VALIDATION_BUFFER_BPS: () => Promise<bigint>;
|
|
208
|
+
BPS_DENOMINATOR: () => Promise<bigint>;
|
|
209
|
+
owner: () => Promise<Address>;
|
|
210
|
+
transferOwnership: (args: {
|
|
211
|
+
newOwner: Address;
|
|
212
|
+
account?: Account | Address;
|
|
213
|
+
}) => Promise<Hash>;
|
|
214
|
+
renounceOwnership: (args: {
|
|
233
215
|
account?: Account | Address;
|
|
234
216
|
}) => Promise<Hash>;
|
|
235
|
-
|
|
217
|
+
version: () => Promise<string>;
|
|
236
218
|
};
|
|
237
219
|
export declare const superPaymasterActions: (address: Address) => (client: PublicClient | WalletClient) => SuperPaymasterActions;
|