@aastar/paymaster 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 (107) hide show
  1. package/dist/V4/BundlerCompat.d.ts +28 -0
  2. package/dist/V4/BundlerCompat.js +37 -0
  3. package/dist/{paymaster/src/V4 → V4}/PaymasterClient.d.ts +5 -0
  4. package/dist/{paymaster/src/V4 → V4}/PaymasterClient.js +108 -15
  5. package/dist/{paymaster/src/V4 → V4}/PaymasterUtils.d.ts +11 -0
  6. package/dist/{paymaster/src/V4 → V4}/PaymasterUtils.js +36 -19
  7. package/dist/{paymaster/src/V4 → V4}/SuperPaymasterClient.js +16 -10
  8. package/package.json +5 -8
  9. package/dist/core/src/abis/BLSAggregator.json +0 -686
  10. package/dist/core/src/abis/BLSValidator.json +0 -42
  11. package/dist/core/src/abis/DVTValidator.json +0 -368
  12. package/dist/core/src/abis/EntryPoint.json +0 -1382
  13. package/dist/core/src/abis/GToken.json +0 -513
  14. package/dist/core/src/abis/GTokenStaking.json +0 -949
  15. package/dist/core/src/abis/MySBT.json +0 -1518
  16. package/dist/core/src/abis/Paymaster.json +0 -1143
  17. package/dist/core/src/abis/PaymasterFactory.json +0 -640
  18. package/dist/core/src/abis/Registry.json +0 -1942
  19. package/dist/core/src/abis/ReputationSystem.json +0 -699
  20. package/dist/core/src/abis/SimpleAccount.json +0 -560
  21. package/dist/core/src/abis/SimpleAccountFactory.json +0 -111
  22. package/dist/core/src/abis/SuperPaymaster.json +0 -1781
  23. package/dist/core/src/abis/index.d.ts +0 -1126
  24. package/dist/core/src/abis/index.js +0 -91
  25. package/dist/core/src/abis/xPNTsFactory.json +0 -718
  26. package/dist/core/src/abis/xPNTsToken.json +0 -1280
  27. package/dist/core/src/actions/StateValidator.d.ts +0 -68
  28. package/dist/core/src/actions/StateValidator.js +0 -187
  29. package/dist/core/src/actions/account.d.ts +0 -55
  30. package/dist/core/src/actions/account.js +0 -133
  31. package/dist/core/src/actions/aggregator.d.ts +0 -17
  32. package/dist/core/src/actions/aggregator.js +0 -31
  33. package/dist/core/src/actions/dvt.d.ts +0 -30
  34. package/dist/core/src/actions/dvt.js +0 -41
  35. package/dist/core/src/actions/entryPoint.d.ts +0 -90
  36. package/dist/core/src/actions/entryPoint.js +0 -211
  37. package/dist/core/src/actions/factory.d.ts +0 -215
  38. package/dist/core/src/actions/factory.js +0 -442
  39. package/dist/core/src/actions/faucet.d.ts +0 -48
  40. package/dist/core/src/actions/faucet.js +0 -337
  41. package/dist/core/src/actions/gtokenExtended.d.ts +0 -39
  42. package/dist/core/src/actions/gtokenExtended.js +0 -115
  43. package/dist/core/src/actions/index.d.ts +0 -15
  44. package/dist/core/src/actions/index.js +0 -17
  45. package/dist/core/src/actions/paymasterV4.d.ts +0 -170
  46. package/dist/core/src/actions/paymasterV4.js +0 -334
  47. package/dist/core/src/actions/registry.d.ts +0 -246
  48. package/dist/core/src/actions/registry.js +0 -667
  49. package/dist/core/src/actions/reputation.d.ts +0 -129
  50. package/dist/core/src/actions/reputation.js +0 -281
  51. package/dist/core/src/actions/sbt.d.ts +0 -191
  52. package/dist/core/src/actions/sbt.js +0 -533
  53. package/dist/core/src/actions/staking.d.ts +0 -132
  54. package/dist/core/src/actions/staking.js +0 -330
  55. package/dist/core/src/actions/superPaymaster.d.ts +0 -237
  56. package/dist/core/src/actions/superPaymaster.js +0 -644
  57. package/dist/core/src/actions/tokens.d.ts +0 -229
  58. package/dist/core/src/actions/tokens.js +0 -415
  59. package/dist/core/src/branding.d.ts +0 -30
  60. package/dist/core/src/branding.js +0 -30
  61. package/dist/core/src/clients/BaseClient.d.ts +0 -25
  62. package/dist/core/src/clients/BaseClient.js +0 -66
  63. package/dist/core/src/clients/types.d.ts +0 -60
  64. package/dist/core/src/clients/types.js +0 -1
  65. package/dist/core/src/clients.d.ts +0 -5
  66. package/dist/core/src/clients.js +0 -11
  67. package/dist/core/src/communities.d.ts +0 -52
  68. package/dist/core/src/communities.js +0 -73
  69. package/dist/core/src/config/ContractConfigManager.d.ts +0 -20
  70. package/dist/core/src/config/ContractConfigManager.js +0 -48
  71. package/dist/core/src/constants.d.ts +0 -88
  72. package/dist/core/src/constants.js +0 -125
  73. package/dist/core/src/contract-addresses.d.ts +0 -110
  74. package/dist/core/src/contract-addresses.js +0 -99
  75. package/dist/core/src/contracts.d.ts +0 -424
  76. package/dist/core/src/contracts.js +0 -343
  77. package/dist/core/src/crypto/blsSigner.d.ts +0 -64
  78. package/dist/core/src/crypto/blsSigner.js +0 -98
  79. package/dist/core/src/crypto/index.d.ts +0 -1
  80. package/dist/core/src/crypto/index.js +0 -1
  81. package/dist/core/src/index.d.ts +0 -21
  82. package/dist/core/src/index.js +0 -21
  83. package/dist/core/src/networks.d.ts +0 -127
  84. package/dist/core/src/networks.js +0 -118
  85. package/dist/core/src/requirementChecker.d.ts +0 -38
  86. package/dist/core/src/requirementChecker.js +0 -139
  87. package/dist/core/src/roles.d.ts +0 -204
  88. package/dist/core/src/roles.js +0 -211
  89. package/dist/core/src/utils/validation.d.ts +0 -24
  90. package/dist/core/src/utils/validation.js +0 -56
  91. /package/dist/{paymaster/src/SuperPaymaster → SuperPaymaster}/index.d.ts +0 -0
  92. /package/dist/{paymaster/src/SuperPaymaster → SuperPaymaster}/index.js +0 -0
  93. /package/dist/{paymaster/src/V4 → V4}/PaymasterClient.test.d.ts +0 -0
  94. /package/dist/{paymaster/src/V4 → V4}/PaymasterClient.test.js +0 -0
  95. /package/dist/{paymaster/src/V4 → V4}/PaymasterOperator.d.ts +0 -0
  96. /package/dist/{paymaster/src/V4 → V4}/PaymasterOperator.js +0 -0
  97. /package/dist/{paymaster/src/V4 → V4}/PaymasterOperator.test.d.ts +0 -0
  98. /package/dist/{paymaster/src/V4 → V4}/PaymasterOperator.test.js +0 -0
  99. /package/dist/{paymaster/src/V4 → V4}/PaymasterUtils.test.d.ts +0 -0
  100. /package/dist/{paymaster/src/V4 → V4}/PaymasterUtils.test.js +0 -0
  101. /package/dist/{paymaster/src/V4 → V4}/SuperPaymasterClient.d.ts +0 -0
  102. /package/dist/{paymaster/src/V4 → V4}/SuperPaymasterClient.test.d.ts +0 -0
  103. /package/dist/{paymaster/src/V4 → V4}/SuperPaymasterClient.test.js +0 -0
  104. /package/dist/{paymaster/src/V4 → V4}/index.d.ts +0 -0
  105. /package/dist/{paymaster/src/V4 → V4}/index.js +0 -0
  106. /package/dist/{paymaster/src/index.d.ts → index.d.ts} +0 -0
  107. /package/dist/{paymaster/src/index.js → index.js} +0 -0
@@ -1,170 +0,0 @@
1
- import { type Address, type PublicClient, type WalletClient, type Hex, type Hash, type Account } from 'viem';
2
- export type PaymasterV4Actions = {
3
- paymasterV4DepositFor: (args: {
4
- user: Address;
5
- token: Address;
6
- amount: bigint;
7
- account?: Account | Address;
8
- }) => Promise<Hash>;
9
- paymasterV4Withdraw: (args: {
10
- token: Address;
11
- amount: bigint;
12
- account?: Account | Address;
13
- }) => Promise<Hash>;
14
- paymasterV4Balances: (args: {
15
- user: Address;
16
- token: Address;
17
- }) => Promise<bigint>;
18
- paymasterV4SetTokenPrice: (args: {
19
- token: Address;
20
- price: bigint;
21
- account?: Account | Address;
22
- }) => Promise<Hash>;
23
- paymasterV4TokenPrices: (args: {
24
- token: Address;
25
- }) => Promise<bigint>;
26
- /** @deprecated V4 uses depositFor + tokenPrices instead */
27
- paymasterV4AddGasToken: (args: {
28
- token: Address;
29
- priceFeed: Address;
30
- account?: Account | Address;
31
- }) => Promise<Hash>;
32
- /** @deprecated V4 uses depositFor + tokenPrices instead */
33
- paymasterV4RemoveGasToken: (args: {
34
- token: Address;
35
- account?: Account | Address;
36
- }) => Promise<Hash>;
37
- /** @deprecated V4 uses depositFor + tokenPrices instead */
38
- paymasterV4GetSupportedGasTokens: () => Promise<Address[]>;
39
- /** @deprecated V4 uses depositFor + tokenPrices instead */
40
- paymasterV4IsGasTokenSupported: (args: {
41
- token: Address;
42
- }) => Promise<boolean>;
43
- /** @deprecated V4 does not use SBT whitelist */
44
- paymasterV4AddSBT: (args: {
45
- sbt: Address;
46
- account?: Account | Address;
47
- }) => Promise<Hash>;
48
- /** @deprecated V4 does not use SBT whitelist */
49
- paymasterV4RemoveSBT: (args: {
50
- sbt: Address;
51
- account?: Account | Address;
52
- }) => Promise<Hash>;
53
- /** @deprecated V4 does not use SBT whitelist */
54
- paymasterV4GetSupportedSBTs: () => Promise<Address[]>;
55
- /** @deprecated V4 does not use SBT whitelist */
56
- paymasterV4IsSBTSupported: (args: {
57
- sbt: Address;
58
- }) => Promise<boolean>;
59
- paymasterV4ValidatePaymasterUserOp: (args: {
60
- userOp: any;
61
- userOpHash: Hex;
62
- maxCost: bigint;
63
- }) => Promise<any>;
64
- paymasterV4PostOp: (args: {
65
- mode: number;
66
- context: Hex;
67
- actualGasCost: bigint;
68
- actualUserOpFeePerGas: bigint;
69
- }) => Promise<void>;
70
- paymasterV4Deposit: (args: {
71
- account?: Account | Address;
72
- }) => Promise<Hash>;
73
- paymasterV4WithdrawTo: (args: {
74
- to: Address;
75
- amount: bigint;
76
- account?: Account | Address;
77
- }) => Promise<Hash>;
78
- paymasterV4AddStake: (args: {
79
- unstakeDelaySec: bigint;
80
- amount: bigint;
81
- account?: Account | Address;
82
- }) => Promise<Hash>;
83
- paymasterV4UnlockPaymasterStake: (args: {
84
- account?: Account | Address;
85
- }) => Promise<Hash>;
86
- paymasterV4WithdrawStake: (args: {
87
- to: Address;
88
- account?: Account | Address;
89
- }) => Promise<Hash>;
90
- paymasterV4GetDeposit: () => Promise<bigint>;
91
- paymasterV4EntryPoint: () => Promise<Address>;
92
- paymasterV4Owner: () => Promise<Address>;
93
- paymasterV4TransferOwnership: (args: {
94
- newOwner: Address;
95
- account?: Account | Address;
96
- }) => 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;
166
- account?: Account | Address;
167
- }) => Promise<Hash>;
168
- paymasterV4Version: () => Promise<string>;
169
- };
170
- export declare const paymasterV4Actions: (address: Address) => (client: PublicClient | WalletClient) => PaymasterV4Actions;
@@ -1,334 +0,0 @@
1
- import { PaymasterV4ABI } from '../abis/index.js';
2
- export const paymasterV4Actions = (address) => (client) => ({
3
- // === NEW: Deposit-Only Model ===
4
- async paymasterV4DepositFor({ user, token, amount, account }) {
5
- return client.writeContract({
6
- address,
7
- abi: PaymasterV4ABI,
8
- functionName: 'depositFor',
9
- args: [user, token, amount],
10
- account: account,
11
- chain: client.chain
12
- });
13
- },
14
- async paymasterV4Withdraw({ token, amount, account }) {
15
- return client.writeContract({
16
- address,
17
- abi: PaymasterV4ABI,
18
- functionName: 'withdraw',
19
- args: [token, amount],
20
- account: account,
21
- chain: client.chain
22
- });
23
- },
24
- async paymasterV4Balances({ user, token }) {
25
- return client.readContract({
26
- address,
27
- abi: PaymasterV4ABI,
28
- functionName: 'balances',
29
- args: [user, token]
30
- });
31
- },
32
- async paymasterV4SetTokenPrice({ token, price, account }) {
33
- return client.writeContract({
34
- address,
35
- abi: PaymasterV4ABI,
36
- functionName: 'setTokenPrice',
37
- args: [token, price],
38
- account: account,
39
- chain: client.chain
40
- });
41
- },
42
- async paymasterV4TokenPrices({ token }) {
43
- return client.readContract({
44
- address,
45
- abi: PaymasterV4ABI,
46
- functionName: 'tokenPrices',
47
- args: [token]
48
- });
49
- },
50
- // === DEPRECATED: Legacy Gas Token Management ===
51
- async paymasterV4AddGasToken({ token, priceFeed, account }) {
52
- return client.writeContract({
53
- address,
54
- abi: PaymasterV4ABI,
55
- functionName: 'addGasToken',
56
- args: [token, priceFeed],
57
- account: account,
58
- chain: client.chain
59
- });
60
- },
61
- async paymasterV4RemoveGasToken({ token, account }) {
62
- return client.writeContract({
63
- address,
64
- abi: PaymasterV4ABI,
65
- functionName: 'removeGasToken',
66
- args: [token],
67
- account: account,
68
- chain: client.chain
69
- });
70
- },
71
- async paymasterV4GetSupportedGasTokens() {
72
- return client.readContract({
73
- address,
74
- abi: PaymasterV4ABI,
75
- functionName: 'getSupportedGasTokens',
76
- args: []
77
- });
78
- },
79
- async paymasterV4IsGasTokenSupported({ token }) {
80
- return client.readContract({
81
- address,
82
- abi: PaymasterV4ABI,
83
- functionName: 'isGasTokenSupported',
84
- args: [token]
85
- });
86
- },
87
- // SBT Management
88
- async paymasterV4AddSBT({ sbt, account }) {
89
- return client.writeContract({
90
- address,
91
- abi: PaymasterV4ABI,
92
- functionName: 'addSBT',
93
- args: [sbt],
94
- account: account,
95
- chain: client.chain
96
- });
97
- },
98
- async paymasterV4RemoveSBT({ sbt, account }) {
99
- return client.writeContract({
100
- address,
101
- abi: PaymasterV4ABI,
102
- functionName: 'removeSBT',
103
- args: [sbt],
104
- account: account,
105
- chain: client.chain
106
- });
107
- },
108
- async paymasterV4GetSupportedSBTs() {
109
- return client.readContract({
110
- address,
111
- abi: PaymasterV4ABI,
112
- functionName: 'getSupportedSBTs',
113
- args: []
114
- });
115
- },
116
- async paymasterV4IsSBTSupported({ sbt }) {
117
- return client.readContract({
118
- address,
119
- abi: PaymasterV4ABI,
120
- functionName: 'isSBTSupported',
121
- args: [sbt]
122
- });
123
- },
124
- // Validation
125
- async paymasterV4ValidatePaymasterUserOp({ userOp, userOpHash, maxCost }) {
126
- return client.readContract({
127
- address,
128
- abi: PaymasterV4ABI,
129
- functionName: 'validatePaymasterUserOp',
130
- args: [userOp, userOpHash, maxCost]
131
- });
132
- },
133
- async paymasterV4PostOp({ mode, context, actualGasCost, actualUserOpFeePerGas }) {
134
- throw new Error('postOp is called by EntryPoint, not directly invoked');
135
- },
136
- // Deposit & Withdrawal (EntryPoint accounting)
137
- async paymasterV4Deposit({ account }) {
138
- return client.writeContract({
139
- address,
140
- abi: PaymasterV4ABI,
141
- functionName: 'deposit',
142
- args: [],
143
- account: account,
144
- chain: client.chain,
145
- value: 0n // Assuming non-payable or handled elsewhere if payable
146
- });
147
- },
148
- async paymasterV4WithdrawTo({ to, amount, account }) {
149
- return client.writeContract({
150
- address,
151
- abi: PaymasterV4ABI,
152
- functionName: 'withdrawTo',
153
- args: [to, amount],
154
- account: account,
155
- chain: client.chain
156
- });
157
- },
158
- async paymasterV4AddStake({ unstakeDelaySec, amount, account }) {
159
- return client.writeContract({
160
- address,
161
- abi: PaymasterV4ABI,
162
- functionName: 'addStake',
163
- args: [unstakeDelaySec],
164
- value: amount,
165
- account: account,
166
- chain: client.chain
167
- });
168
- },
169
- async paymasterV4UnlockPaymasterStake({ account }) {
170
- return client.writeContract({
171
- address,
172
- abi: PaymasterV4ABI,
173
- functionName: 'unlockStake',
174
- args: [],
175
- account: account,
176
- chain: client.chain
177
- });
178
- },
179
- async paymasterV4WithdrawStake({ to, account }) {
180
- return client.writeContract({
181
- address,
182
- abi: PaymasterV4ABI,
183
- functionName: 'withdrawStake',
184
- args: [to],
185
- account: account,
186
- chain: client.chain
187
- });
188
- },
189
- async paymasterV4GetDeposit() {
190
- return client.readContract({
191
- address,
192
- abi: PaymasterV4ABI,
193
- functionName: 'getDeposit',
194
- args: []
195
- });
196
- },
197
- // EntryPoint
198
- async paymasterV4EntryPoint() {
199
- return client.readContract({
200
- address,
201
- abi: PaymasterV4ABI,
202
- functionName: 'entryPoint',
203
- args: []
204
- });
205
- },
206
- // Ownership
207
- async paymasterV4Owner() {
208
- return client.readContract({
209
- address,
210
- abi: PaymasterV4ABI,
211
- functionName: 'owner',
212
- args: []
213
- });
214
- },
215
- async paymasterV4TransferOwnership({ newOwner, account }) {
216
- return client.writeContract({
217
- address,
218
- abi: PaymasterV4ABI,
219
- functionName: 'transferOwnership',
220
- args: [newOwner],
221
- account: account,
222
- chain: client.chain
223
- });
224
- },
225
- async paymasterV4RenounceOwnership({ account }) {
226
- return client.writeContract({
227
- address,
228
- abi: PaymasterV4ABI,
229
- functionName: 'renounceOwnership',
230
- args: [],
231
- account: account,
232
- chain: client.chain
233
- });
234
- },
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() {
327
- return client.readContract({
328
- address,
329
- abi: PaymasterV4ABI,
330
- functionName: 'version',
331
- args: []
332
- });
333
- }
334
- });