@aastar/core 0.16.7 → 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.
Files changed (60) hide show
  1. package/dist/abis/PaymasterV4_2.json +1193 -0
  2. package/dist/abis/SuperPaymaster.json +1 -1
  3. package/dist/abis/aPNTs.json +1160 -0
  4. package/dist/abis/abi.config.json +3 -3
  5. package/dist/abis/index.d.ts +15 -104
  6. package/dist/abis/index.js +22 -46
  7. package/dist/actions/account.d.ts +0 -15
  8. package/dist/actions/account.js +143 -108
  9. package/dist/actions/aggregator.d.ts +68 -7
  10. package/dist/actions/aggregator.js +328 -28
  11. package/dist/actions/dvt.d.ts +33 -5
  12. package/dist/actions/dvt.js +238 -38
  13. package/dist/actions/entryPoint.d.ts +3 -63
  14. package/dist/actions/entryPoint.js +52 -184
  15. package/dist/actions/factory.d.ts +48 -115
  16. package/dist/actions/factory.js +638 -438
  17. package/dist/actions/faucet.d.ts +23 -27
  18. package/dist/actions/faucet.js +150 -289
  19. package/dist/actions/index.d.ts +1 -2
  20. package/dist/actions/index.js +2 -4
  21. package/dist/actions/paymaster.d.ts +147 -0
  22. package/dist/actions/paymaster.js +706 -0
  23. package/dist/actions/paymasterV4.d.ts +26 -95
  24. package/dist/actions/paymasterV4.js +28 -121
  25. package/dist/actions/registry.d.ts +116 -165
  26. package/dist/actions/registry.js +855 -654
  27. package/dist/actions/reputation.d.ts +74 -52
  28. package/dist/actions/reputation.js +548 -242
  29. package/dist/actions/sbt.d.ts +90 -100
  30. package/dist/actions/sbt.js +801 -518
  31. package/dist/actions/staking.d.ts +45 -32
  32. package/dist/actions/staking.js +431 -260
  33. package/dist/actions/superPaymaster.d.ts +140 -158
  34. package/dist/actions/superPaymaster.js +965 -631
  35. package/dist/actions/tokens.d.ts +130 -108
  36. package/dist/actions/tokens.js +470 -414
  37. package/dist/actions/validators.d.ts +0 -73
  38. package/dist/actions/validators.js +0 -94
  39. package/dist/clients/BaseClient.d.ts +3 -3
  40. package/dist/clients/BundlerClient.d.ts +55 -0
  41. package/dist/clients/BundlerClient.js +92 -0
  42. package/dist/communities.js +2 -2
  43. package/dist/constants.js +1 -28
  44. package/dist/contract-addresses.d.ts +5 -14
  45. package/dist/contract-addresses.js +3 -9
  46. package/dist/contract-versions.d.ts +138 -0
  47. package/dist/contract-versions.js +328 -0
  48. package/dist/contracts.d.ts +6 -24
  49. package/dist/contracts.js +2 -2
  50. package/dist/errors/index.d.ts +57 -0
  51. package/dist/errors/index.js +123 -0
  52. package/dist/index.d.ts +2 -1
  53. package/dist/index.js +2 -1
  54. package/dist/requirementChecker.d.ts +35 -1
  55. package/dist/requirementChecker.js +39 -1
  56. package/dist/roles.d.ts +50 -61
  57. package/dist/roles.js +50 -61
  58. package/dist/validators/index.d.ts +35 -0
  59. package/dist/validators/index.js +60 -0
  60. package/package.json +5 -13
@@ -1,170 +1,101 @@
1
1
  import { type Address, type PublicClient, type WalletClient, type Hex, type Hash, type Account } from 'viem';
2
2
  export type PaymasterV4Actions = {
3
- paymasterV4DepositFor: (args: {
3
+ depositFor: (args: {
4
4
  user: Address;
5
5
  token: Address;
6
6
  amount: bigint;
7
7
  account?: Account | Address;
8
8
  }) => Promise<Hash>;
9
- paymasterV4Withdraw: (args: {
9
+ withdraw: (args: {
10
10
  token: Address;
11
11
  amount: bigint;
12
12
  account?: Account | Address;
13
13
  }) => Promise<Hash>;
14
- paymasterV4Balances: (args: {
14
+ balances: (args: {
15
15
  user: Address;
16
16
  token: Address;
17
17
  }) => Promise<bigint>;
18
- paymasterV4SetTokenPrice: (args: {
18
+ setTokenPrice: (args: {
19
19
  token: Address;
20
20
  price: bigint;
21
21
  account?: Account | Address;
22
22
  }) => Promise<Hash>;
23
- paymasterV4TokenPrices: (args: {
23
+ tokenPrices: (args: {
24
24
  token: Address;
25
25
  }) => Promise<bigint>;
26
26
  /** @deprecated V4 uses depositFor + tokenPrices instead */
27
- paymasterV4AddGasToken: (args: {
27
+ addGasToken: (args: {
28
28
  token: Address;
29
29
  priceFeed: Address;
30
30
  account?: Account | Address;
31
31
  }) => Promise<Hash>;
32
32
  /** @deprecated V4 uses depositFor + tokenPrices instead */
33
- paymasterV4RemoveGasToken: (args: {
33
+ removeGasToken: (args: {
34
34
  token: Address;
35
35
  account?: Account | Address;
36
36
  }) => Promise<Hash>;
37
37
  /** @deprecated V4 uses depositFor + tokenPrices instead */
38
- paymasterV4GetSupportedGasTokens: () => Promise<Address[]>;
38
+ getSupportedGasTokens: () => Promise<Address[]>;
39
39
  /** @deprecated V4 uses depositFor + tokenPrices instead */
40
- paymasterV4IsGasTokenSupported: (args: {
40
+ isGasTokenSupported: (args: {
41
41
  token: Address;
42
42
  }) => Promise<boolean>;
43
43
  /** @deprecated V4 does not use SBT whitelist */
44
- paymasterV4AddSBT: (args: {
44
+ addSBT: (args: {
45
45
  sbt: Address;
46
46
  account?: Account | Address;
47
47
  }) => Promise<Hash>;
48
48
  /** @deprecated V4 does not use SBT whitelist */
49
- paymasterV4RemoveSBT: (args: {
49
+ removeSBT: (args: {
50
50
  sbt: Address;
51
51
  account?: Account | Address;
52
52
  }) => Promise<Hash>;
53
53
  /** @deprecated V4 does not use SBT whitelist */
54
- paymasterV4GetSupportedSBTs: () => Promise<Address[]>;
54
+ getSupportedSBTs: () => Promise<Address[]>;
55
55
  /** @deprecated V4 does not use SBT whitelist */
56
- paymasterV4IsSBTSupported: (args: {
56
+ isSBTSupported: (args: {
57
57
  sbt: Address;
58
58
  }) => Promise<boolean>;
59
- paymasterV4ValidatePaymasterUserOp: (args: {
59
+ validatePaymasterUserOp: (args: {
60
60
  userOp: any;
61
61
  userOpHash: Hex;
62
62
  maxCost: bigint;
63
63
  }) => Promise<any>;
64
- paymasterV4PostOp: (args: {
64
+ postOp: (args: {
65
65
  mode: number;
66
66
  context: Hex;
67
67
  actualGasCost: bigint;
68
68
  actualUserOpFeePerGas: bigint;
69
69
  }) => Promise<void>;
70
- paymasterV4Deposit: (args: {
70
+ deposit: (args: {
71
71
  account?: Account | Address;
72
72
  }) => Promise<Hash>;
73
- paymasterV4WithdrawTo: (args: {
73
+ withdrawTo: (args: {
74
74
  to: Address;
75
75
  amount: bigint;
76
76
  account?: Account | Address;
77
77
  }) => Promise<Hash>;
78
- paymasterV4AddStake: (args: {
78
+ addStake: (args: {
79
79
  unstakeDelaySec: bigint;
80
- amount: bigint;
81
80
  account?: Account | Address;
82
81
  }) => Promise<Hash>;
83
- paymasterV4UnlockPaymasterStake: (args: {
82
+ unlockPaymasterStake: (args: {
84
83
  account?: Account | Address;
85
84
  }) => Promise<Hash>;
86
- paymasterV4WithdrawStake: (args: {
85
+ withdrawStake: (args: {
87
86
  to: Address;
88
87
  account?: Account | Address;
89
88
  }) => Promise<Hash>;
90
- paymasterV4GetDeposit: () => Promise<bigint>;
91
- paymasterV4EntryPoint: () => Promise<Address>;
92
- paymasterV4Owner: () => Promise<Address>;
93
- paymasterV4TransferOwnership: (args: {
89
+ getDeposit: () => Promise<bigint>;
90
+ entryPoint: () => Promise<Address>;
91
+ owner: () => Promise<Address>;
92
+ transferOwnership: (args: {
94
93
  newOwner: Address;
95
94
  account?: Account | Address;
96
95
  }) => Promise<Hash>;
97
- paymasterV4RenounceOwnership: (args: {
98
- account?: Account | Address;
99
- }) => Promise<Hash>;
100
- paymasterV4Registry: () => Promise<Address>;
101
- paymasterV4Treasury: () => Promise<Address>;
102
- paymasterV4Paused: () => Promise<boolean>;
103
- paymasterV4MaxGasCostCap: () => Promise<bigint>;
104
- paymasterV4MaxEthUsdPrice: () => Promise<bigint>;
105
- paymasterV4MaxGasTokens: () => Promise<bigint>;
106
- paymasterV4MaxSbts: () => Promise<bigint>;
107
- paymasterV4MaxServiceFee: () => Promise<bigint>;
108
- paymasterV4MinEthUsdPrice: () => Promise<bigint>;
109
- paymasterV4PriceStalenessThreshold: () => Promise<bigint>;
110
- paymasterV4AddDeposit: (args: {
111
- account?: Account | Address;
112
- }) => Promise<Hash>;
113
- paymasterV4UnlockStake: (args: {
114
- account?: Account | Address;
115
- }) => Promise<Hash>;
116
- paymasterV4EthUsdPriceFeed: () => Promise<Address>;
117
- paymasterV4OracleDecimals: () => Promise<number>;
118
- paymasterV4TokenDecimals: (args: {
119
- token: Address;
120
- }) => Promise<number>;
121
- paymasterV4ServiceFeeRate: () => Promise<bigint>;
122
- paymasterV4CalculateCost: (args: {
123
- token: Address;
124
- gasCost: bigint;
125
- param: any;
126
- }) => Promise<bigint>;
127
- paymasterV4GetRealtimeTokenCost: (args: {
128
- token: Address;
129
- gasCost: bigint;
130
- }) => Promise<bigint>;
131
- paymasterV4IsActiveInRegistry: () => Promise<boolean>;
132
- paymasterV4IsRegistrySet: () => Promise<boolean>;
133
- paymasterV4CachedPriceView: (args: {
134
- token: Address;
135
- }) => Promise<bigint>;
136
- paymasterV4SetCachedPrice: (args: {
137
- token: Address;
138
- price: bigint;
139
- account?: Account | Address;
140
- }) => Promise<Hash>;
141
- paymasterV4SetServiceFeeRate: (args: {
142
- rate: bigint;
143
- account?: Account | Address;
144
- }) => Promise<Hash>;
145
- paymasterV4SetMaxGasCostCap: (args: {
146
- cap: bigint;
147
- account?: Account | Address;
148
- }) => Promise<Hash>;
149
- paymasterV4SetPriceStalenessThreshold: (args: {
150
- threshold: bigint;
151
- account?: Account | Address;
152
- }) => Promise<Hash>;
153
- paymasterV4SetTreasury: (args: {
154
- treasury: Address;
155
- account?: Account | Address;
156
- }) => Promise<Hash>;
157
- paymasterV4UpdatePrice: (args: {
158
- token: Address;
159
- account?: Account | Address;
160
- }) => Promise<Hash>;
161
- paymasterV4DeactivateFromRegistry: (args: {
162
- account?: Account | Address;
163
- }) => Promise<Hash>;
164
- paymasterV4Initialize: (args: {
165
- owner: Address;
96
+ renounceOwnership: (args: {
166
97
  account?: Account | Address;
167
98
  }) => Promise<Hash>;
168
- paymasterV4Version: () => Promise<string>;
99
+ version: () => Promise<string>;
169
100
  };
170
101
  export declare const paymasterV4Actions: (address: Address) => (client: PublicClient | WalletClient) => PaymasterV4Actions;
@@ -1,7 +1,7 @@
1
1
  import { PaymasterV4ABI } from '../abis/index.js';
2
2
  export const paymasterV4Actions = (address) => (client) => ({
3
3
  // === NEW: Deposit-Only Model ===
4
- async paymasterV4DepositFor({ user, token, amount, account }) {
4
+ async depositFor({ user, token, amount, account }) {
5
5
  return client.writeContract({
6
6
  address,
7
7
  abi: PaymasterV4ABI,
@@ -11,7 +11,7 @@ export const paymasterV4Actions = (address) => (client) => ({
11
11
  chain: client.chain
12
12
  });
13
13
  },
14
- async paymasterV4Withdraw({ token, amount, account }) {
14
+ async withdraw({ token, amount, account }) {
15
15
  return client.writeContract({
16
16
  address,
17
17
  abi: PaymasterV4ABI,
@@ -21,7 +21,7 @@ export const paymasterV4Actions = (address) => (client) => ({
21
21
  chain: client.chain
22
22
  });
23
23
  },
24
- async paymasterV4Balances({ user, token }) {
24
+ async balances({ user, token }) {
25
25
  return client.readContract({
26
26
  address,
27
27
  abi: PaymasterV4ABI,
@@ -29,7 +29,7 @@ export const paymasterV4Actions = (address) => (client) => ({
29
29
  args: [user, token]
30
30
  });
31
31
  },
32
- async paymasterV4SetTokenPrice({ token, price, account }) {
32
+ async setTokenPrice({ token, price, account }) {
33
33
  return client.writeContract({
34
34
  address,
35
35
  abi: PaymasterV4ABI,
@@ -39,7 +39,7 @@ export const paymasterV4Actions = (address) => (client) => ({
39
39
  chain: client.chain
40
40
  });
41
41
  },
42
- async paymasterV4TokenPrices({ token }) {
42
+ async tokenPrices({ token }) {
43
43
  return client.readContract({
44
44
  address,
45
45
  abi: PaymasterV4ABI,
@@ -48,7 +48,7 @@ export const paymasterV4Actions = (address) => (client) => ({
48
48
  });
49
49
  },
50
50
  // === DEPRECATED: Legacy Gas Token Management ===
51
- async paymasterV4AddGasToken({ token, priceFeed, account }) {
51
+ async addGasToken({ token, priceFeed, account }) {
52
52
  return client.writeContract({
53
53
  address,
54
54
  abi: PaymasterV4ABI,
@@ -58,7 +58,7 @@ export const paymasterV4Actions = (address) => (client) => ({
58
58
  chain: client.chain
59
59
  });
60
60
  },
61
- async paymasterV4RemoveGasToken({ token, account }) {
61
+ async removeGasToken({ token, account }) {
62
62
  return client.writeContract({
63
63
  address,
64
64
  abi: PaymasterV4ABI,
@@ -68,7 +68,7 @@ export const paymasterV4Actions = (address) => (client) => ({
68
68
  chain: client.chain
69
69
  });
70
70
  },
71
- async paymasterV4GetSupportedGasTokens() {
71
+ async getSupportedGasTokens() {
72
72
  return client.readContract({
73
73
  address,
74
74
  abi: PaymasterV4ABI,
@@ -76,7 +76,7 @@ export const paymasterV4Actions = (address) => (client) => ({
76
76
  args: []
77
77
  });
78
78
  },
79
- async paymasterV4IsGasTokenSupported({ token }) {
79
+ async isGasTokenSupported({ token }) {
80
80
  return client.readContract({
81
81
  address,
82
82
  abi: PaymasterV4ABI,
@@ -85,7 +85,7 @@ export const paymasterV4Actions = (address) => (client) => ({
85
85
  });
86
86
  },
87
87
  // SBT Management
88
- async paymasterV4AddSBT({ sbt, account }) {
88
+ async addSBT({ sbt, account }) {
89
89
  return client.writeContract({
90
90
  address,
91
91
  abi: PaymasterV4ABI,
@@ -95,7 +95,7 @@ export const paymasterV4Actions = (address) => (client) => ({
95
95
  chain: client.chain
96
96
  });
97
97
  },
98
- async paymasterV4RemoveSBT({ sbt, account }) {
98
+ async removeSBT({ sbt, account }) {
99
99
  return client.writeContract({
100
100
  address,
101
101
  abi: PaymasterV4ABI,
@@ -105,7 +105,7 @@ export const paymasterV4Actions = (address) => (client) => ({
105
105
  chain: client.chain
106
106
  });
107
107
  },
108
- async paymasterV4GetSupportedSBTs() {
108
+ async getSupportedSBTs() {
109
109
  return client.readContract({
110
110
  address,
111
111
  abi: PaymasterV4ABI,
@@ -113,7 +113,7 @@ export const paymasterV4Actions = (address) => (client) => ({
113
113
  args: []
114
114
  });
115
115
  },
116
- async paymasterV4IsSBTSupported({ sbt }) {
116
+ async isSBTSupported({ sbt }) {
117
117
  return client.readContract({
118
118
  address,
119
119
  abi: PaymasterV4ABI,
@@ -122,7 +122,7 @@ export const paymasterV4Actions = (address) => (client) => ({
122
122
  });
123
123
  },
124
124
  // Validation
125
- async paymasterV4ValidatePaymasterUserOp({ userOp, userOpHash, maxCost }) {
125
+ async validatePaymasterUserOp({ userOp, userOpHash, maxCost }) {
126
126
  return client.readContract({
127
127
  address,
128
128
  abi: PaymasterV4ABI,
@@ -130,22 +130,21 @@ export const paymasterV4Actions = (address) => (client) => ({
130
130
  args: [userOp, userOpHash, maxCost]
131
131
  });
132
132
  },
133
- async paymasterV4PostOp({ mode, context, actualGasCost, actualUserOpFeePerGas }) {
133
+ async postOp({ mode, context, actualGasCost, actualUserOpFeePerGas }) {
134
134
  throw new Error('postOp is called by EntryPoint, not directly invoked');
135
135
  },
136
- // Deposit & Withdrawal (EntryPoint accounting)
137
- async paymasterV4Deposit({ account }) {
136
+ // Deposit & Withdrawal
137
+ async deposit({ account }) {
138
138
  return client.writeContract({
139
139
  address,
140
140
  abi: PaymasterV4ABI,
141
141
  functionName: 'deposit',
142
142
  args: [],
143
143
  account: account,
144
- chain: client.chain,
145
- value: 0n // Assuming non-payable or handled elsewhere if payable
144
+ chain: client.chain
146
145
  });
147
146
  },
148
- async paymasterV4WithdrawTo({ to, amount, account }) {
147
+ async withdrawTo({ to, amount, account }) {
149
148
  return client.writeContract({
150
149
  address,
151
150
  abi: PaymasterV4ABI,
@@ -155,18 +154,17 @@ export const paymasterV4Actions = (address) => (client) => ({
155
154
  chain: client.chain
156
155
  });
157
156
  },
158
- async paymasterV4AddStake({ unstakeDelaySec, amount, account }) {
157
+ async addStake({ unstakeDelaySec, account }) {
159
158
  return client.writeContract({
160
159
  address,
161
160
  abi: PaymasterV4ABI,
162
161
  functionName: 'addStake',
163
162
  args: [unstakeDelaySec],
164
- value: amount,
165
163
  account: account,
166
164
  chain: client.chain
167
165
  });
168
166
  },
169
- async paymasterV4UnlockPaymasterStake({ account }) {
167
+ async unlockPaymasterStake({ account }) {
170
168
  return client.writeContract({
171
169
  address,
172
170
  abi: PaymasterV4ABI,
@@ -176,7 +174,7 @@ export const paymasterV4Actions = (address) => (client) => ({
176
174
  chain: client.chain
177
175
  });
178
176
  },
179
- async paymasterV4WithdrawStake({ to, account }) {
177
+ async withdrawStake({ to, account }) {
180
178
  return client.writeContract({
181
179
  address,
182
180
  abi: PaymasterV4ABI,
@@ -186,7 +184,7 @@ export const paymasterV4Actions = (address) => (client) => ({
186
184
  chain: client.chain
187
185
  });
188
186
  },
189
- async paymasterV4GetDeposit() {
187
+ async getDeposit() {
190
188
  return client.readContract({
191
189
  address,
192
190
  abi: PaymasterV4ABI,
@@ -195,7 +193,7 @@ export const paymasterV4Actions = (address) => (client) => ({
195
193
  });
196
194
  },
197
195
  // EntryPoint
198
- async paymasterV4EntryPoint() {
196
+ async entryPoint() {
199
197
  return client.readContract({
200
198
  address,
201
199
  abi: PaymasterV4ABI,
@@ -204,7 +202,7 @@ export const paymasterV4Actions = (address) => (client) => ({
204
202
  });
205
203
  },
206
204
  // Ownership
207
- async paymasterV4Owner() {
205
+ async owner() {
208
206
  return client.readContract({
209
207
  address,
210
208
  abi: PaymasterV4ABI,
@@ -212,7 +210,7 @@ export const paymasterV4Actions = (address) => (client) => ({
212
210
  args: []
213
211
  });
214
212
  },
215
- async paymasterV4TransferOwnership({ newOwner, account }) {
213
+ async transferOwnership({ newOwner, account }) {
216
214
  return client.writeContract({
217
215
  address,
218
216
  abi: PaymasterV4ABI,
@@ -222,7 +220,7 @@ export const paymasterV4Actions = (address) => (client) => ({
222
220
  chain: client.chain
223
221
  });
224
222
  },
225
- async paymasterV4RenounceOwnership({ account }) {
223
+ async renounceOwnership({ account }) {
226
224
  return client.writeContract({
227
225
  address,
228
226
  abi: PaymasterV4ABI,
@@ -232,98 +230,7 @@ export const paymasterV4Actions = (address) => (client) => ({
232
230
  chain: client.chain
233
231
  });
234
232
  },
235
- // View Functions & Constants
236
- async paymasterV4Registry() {
237
- return client.readContract({ address, abi: PaymasterV4ABI, functionName: 'registry', args: [] });
238
- },
239
- async paymasterV4Treasury() {
240
- return client.readContract({ address, abi: PaymasterV4ABI, functionName: 'treasury', args: [] });
241
- },
242
- async paymasterV4Paused() {
243
- return client.readContract({ address, abi: PaymasterV4ABI, functionName: 'paused', args: [] });
244
- },
245
- async paymasterV4MaxGasCostCap() {
246
- return client.readContract({ address, abi: PaymasterV4ABI, functionName: 'maxGasCostCap', args: [] });
247
- },
248
- async paymasterV4MaxEthUsdPrice() {
249
- return client.readContract({ address, abi: PaymasterV4ABI, functionName: 'MAX_ETH_USD_PRICE', args: [] });
250
- },
251
- async paymasterV4MaxGasTokens() {
252
- return client.readContract({ address, abi: PaymasterV4ABI, functionName: 'MAX_GAS_TOKENS', args: [] });
253
- },
254
- async paymasterV4MaxSbts() {
255
- return client.readContract({ address, abi: PaymasterV4ABI, functionName: 'MAX_SBTS', args: [] });
256
- },
257
- async paymasterV4MaxServiceFee() {
258
- return client.readContract({ address, abi: PaymasterV4ABI, functionName: 'MAX_SERVICE_FEE', args: [] });
259
- },
260
- async paymasterV4MinEthUsdPrice() {
261
- return client.readContract({ address, abi: PaymasterV4ABI, functionName: 'MIN_ETH_USD_PRICE', args: [] });
262
- },
263
- async paymasterV4PriceStalenessThreshold() {
264
- return client.readContract({ address, abi: PaymasterV4ABI, functionName: 'priceStalenessThreshold', args: [] });
265
- },
266
- // Aliases
267
- async paymasterV4AddDeposit(args) {
268
- return this.paymasterV4Deposit(args);
269
- },
270
- async paymasterV4UnlockStake(args) {
271
- return this.paymasterV4UnlockPaymasterStake(args);
272
- },
273
- // View Functions & Constants (Missing)
274
- async paymasterV4EthUsdPriceFeed() {
275
- return client.readContract({ address, abi: PaymasterV4ABI, functionName: 'ethUsdPriceFeed', args: [] });
276
- },
277
- async paymasterV4OracleDecimals() {
278
- return client.readContract({ address, abi: PaymasterV4ABI, functionName: 'oracleDecimals', args: [] });
279
- },
280
- async paymasterV4TokenDecimals({ token }) {
281
- return client.readContract({ address, abi: PaymasterV4ABI, functionName: 'tokenDecimals', args: [token] });
282
- },
283
- async paymasterV4ServiceFeeRate() {
284
- return client.readContract({ address, abi: PaymasterV4ABI, functionName: 'serviceFeeRate', args: [] });
285
- },
286
- async paymasterV4CalculateCost({ token, gasCost, param }) {
287
- return client.readContract({ address, abi: PaymasterV4ABI, functionName: 'calculateCost', args: [token, gasCost, param] });
288
- },
289
- async paymasterV4GetRealtimeTokenCost({ token, gasCost }) {
290
- return client.readContract({ address, abi: PaymasterV4ABI, functionName: 'getRealtimeTokenCost', args: [token, gasCost] });
291
- },
292
- async paymasterV4IsActiveInRegistry() {
293
- return client.readContract({ address, abi: PaymasterV4ABI, functionName: 'isActiveInRegistry', args: [] });
294
- },
295
- async paymasterV4IsRegistrySet() {
296
- return client.readContract({ address, abi: PaymasterV4ABI, functionName: 'isRegistrySet', args: [] });
297
- },
298
- async paymasterV4CachedPriceView({ token }) {
299
- return client.readContract({ address, abi: PaymasterV4ABI, functionName: 'cachedPrice', args: [token] });
300
- },
301
- // Admin (Missing)
302
- async paymasterV4SetCachedPrice({ token, price, account }) {
303
- return client.writeContract({ address, abi: PaymasterV4ABI, functionName: 'setCachedPrice', args: [token, price], account: account, chain: client.chain });
304
- },
305
- async paymasterV4SetServiceFeeRate({ rate, account }) {
306
- return client.writeContract({ address, abi: PaymasterV4ABI, functionName: 'setServiceFeeRate', args: [rate], account: account, chain: client.chain });
307
- },
308
- async paymasterV4SetMaxGasCostCap({ cap, account }) {
309
- return client.writeContract({ address, abi: PaymasterV4ABI, functionName: 'setMaxGasCostCap', args: [cap], account: account, chain: client.chain });
310
- },
311
- async paymasterV4SetPriceStalenessThreshold({ threshold, account }) {
312
- return client.writeContract({ address, abi: PaymasterV4ABI, functionName: 'setPriceStalenessThreshold', args: [threshold], account: account, chain: client.chain });
313
- },
314
- async paymasterV4SetTreasury({ treasury, account }) {
315
- return client.writeContract({ address, abi: PaymasterV4ABI, functionName: 'setTreasury', args: [treasury], account: account, chain: client.chain });
316
- },
317
- async paymasterV4UpdatePrice({ token, account }) {
318
- return client.writeContract({ address, abi: PaymasterV4ABI, functionName: 'updatePrice', args: [token], account: account, chain: client.chain });
319
- },
320
- async paymasterV4DeactivateFromRegistry({ account }) {
321
- return client.writeContract({ address, abi: PaymasterV4ABI, functionName: 'deactivateFromRegistry', args: [], account: account, chain: client.chain });
322
- },
323
- async paymasterV4Initialize({ owner, account }) {
324
- return client.writeContract({ address, abi: PaymasterV4ABI, functionName: 'initialize', args: [owner], account: account, chain: client.chain });
325
- },
326
- async paymasterV4Version() {
233
+ async version() {
327
234
  return client.readContract({
328
235
  address,
329
236
  abi: PaymasterV4ABI,