@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.
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,246 +1,197 @@
1
1
  import { type Address, type PublicClient, type WalletClient, type Hex, type Hash, type Account } from 'viem';
2
- import type { RoleConfig } from '../roles.js';
2
+ export type RoleConfigDetailed = {
3
+ minStake: bigint;
4
+ entryBurn: bigint;
5
+ slashThreshold: number;
6
+ slashBase: number;
7
+ slashInc: number;
8
+ slashMax: number;
9
+ exitFeePercent: number;
10
+ isActive: boolean;
11
+ minExitFee: bigint;
12
+ description: string;
13
+ owner: Address;
14
+ roleLockDuration: bigint;
15
+ };
3
16
  export type RegistryActions = {
4
- registryConfigureRole: (args: {
17
+ configureRole: (args: {
18
+ roleId: Hex;
19
+ config: RoleConfigDetailed;
20
+ account?: Account | Address;
21
+ }) => Promise<Hash>;
22
+ adminConfigureRole: (args: {
23
+ roleId: Hex;
24
+ minStake: bigint;
25
+ entryBurn: bigint;
26
+ exitFeePercent: bigint;
27
+ minExitFee: bigint;
28
+ account?: Account | Address;
29
+ }) => Promise<Hash>;
30
+ createNewRole: (args: {
5
31
  roleId: Hex;
6
- config: RoleConfig;
32
+ config: RoleConfigDetailed;
33
+ roleOwner: Address;
7
34
  account?: Account | Address;
8
35
  }) => Promise<Hash>;
9
- registryRegisterRole: (args: {
36
+ registerRole: (args: {
10
37
  roleId: Hex;
11
38
  user: Address;
12
39
  data: Hex;
13
40
  account?: Account | Address;
14
41
  }) => Promise<Hash>;
15
- registryRegisterRoleSelf: (args: {
42
+ registerRoleSelf: (args: {
16
43
  roleId: Hex;
17
44
  data: Hex;
18
45
  account?: Account | Address;
19
46
  }) => Promise<Hash>;
20
- registryHasRole: (args: {
21
- user: Address;
47
+ safeMintForRole: (args: {
22
48
  roleId: Hex;
23
- }) => Promise<boolean>;
24
- registryUnRegisterRole: (args: {
25
49
  user: Address;
26
- roleId: Hex;
50
+ data: Hex;
27
51
  account?: Account | Address;
28
52
  }) => Promise<Hash>;
29
- registryGetRoleConfig: (args: {
53
+ hasRole: (args: {
54
+ roleId: Hex;
55
+ user: Address;
56
+ }) => Promise<boolean>;
57
+ getRoleConfig: (args: {
30
58
  roleId: Hex;
31
- }) => Promise<any>;
32
- registrySetRoleLockDuration: (args: {
59
+ }) => Promise<RoleConfigDetailed>;
60
+ setRoleLockDuration: (args: {
33
61
  roleId: Hex;
34
62
  duration: bigint;
35
63
  account?: Account | Address;
36
64
  }) => Promise<Hash>;
37
- registrySetRoleOwner: (args: {
65
+ setRoleOwner: (args: {
38
66
  roleId: Hex;
39
67
  newOwner: Address;
40
68
  account?: Account | Address;
41
69
  }) => Promise<Hash>;
42
- registryIsCommunityMember: (args: {
43
- community: Address;
44
- user: Address;
45
- }) => Promise<boolean>;
46
- registryCommunityByName: (args: {
47
- name: string;
48
- }) => Promise<Address>;
49
- registryCommunityByENS: (args: {
50
- ensName: string;
51
- }) => Promise<Address>;
52
- registryCommunityByNameV3: (args: {
70
+ exitRole: (args: {
71
+ roleId: Hex;
72
+ account?: Account | Address;
73
+ }) => Promise<Hash>;
74
+ communityByName: (args: {
53
75
  name: string;
54
76
  }) => Promise<Address>;
55
- registryCommunityByENSV3: (args: {
77
+ communityByENS: (args: {
56
78
  ensName: string;
57
79
  }) => Promise<Address>;
58
- registryProposedRoleNames: (args: {
59
- roleId: Hex;
60
- }) => Promise<string>;
61
- registryExecutedProposals: (args: {
62
- proposalId: bigint;
63
- }) => Promise<boolean>;
64
- registryGetAccountCommunity: (args: {
65
- account: Address;
66
- }) => Promise<Address>;
67
- registryLastReputationEpoch: () => Promise<bigint>;
68
- registryIsReputationSource: (args: {
69
- source: Address;
70
- }) => Promise<boolean>;
71
- registryRoleCounts: (args: {
72
- roleId: Hex;
73
- }) => Promise<bigint>;
74
- registryRoleMembers: (args: {
75
- roleId: Hex;
76
- index: bigint;
77
- }) => Promise<Address>;
78
- registryRoleMemberIndex: (args: {
79
- roleId: Hex;
80
- user: Address;
81
- }) => Promise<bigint>;
82
- registryRoleMetadata: (args: {
83
- roleId: Hex;
84
- user?: Address;
85
- }) => Promise<Hex>;
86
- registryRoleStakes: (args: {
87
- roleId: Hex;
88
- user: Address;
89
- }) => Promise<bigint>;
90
- registryRoleSBTTokenIds: (args: {
91
- roleId: Hex;
92
- user: Address;
93
- }) => Promise<bigint>;
94
- registryUserRoles: (args: {
95
- user: Address;
96
- index: bigint;
97
- }) => Promise<Hex>;
98
- registryUserRoleCount: (args: {
80
+ getCreditLimit: (args: {
99
81
  user: Address;
100
82
  }) => Promise<bigint>;
101
- registryGlobalReputation: (args: {
83
+ globalReputation: (args: {
102
84
  user: Address;
103
85
  }) => Promise<bigint>;
104
- registryBatchUpdateGlobalReputation: (args: {
105
- users: Address[];
106
- scores: bigint[];
107
- epoch: bigint;
108
- proof: Hex;
86
+ addLevelThreshold: (args: {
87
+ threshold: bigint;
109
88
  account?: Account | Address;
110
89
  }) => Promise<Hash>;
111
- registryUpdateOperatorBlacklist: (args: {
112
- operator: Address;
90
+ batchUpdateGlobalReputation: (args: {
91
+ proposalId: bigint;
113
92
  users: Address[];
114
- statuses: boolean[];
93
+ newScores: bigint[];
94
+ epoch: bigint;
115
95
  proof: Hex;
116
96
  account?: Account | Address;
117
97
  }) => Promise<Hash>;
118
- registryIsOperatorBlacklisted: (args: {
119
- operator: Address;
120
- }) => Promise<boolean>;
121
- registrySetBLSValidator: (args: {
98
+ setBLSValidator: (args: {
122
99
  validator: Address;
123
100
  account?: Account | Address;
124
101
  }) => Promise<Hash>;
125
- registrySetBLSAggregator: (args: {
102
+ setBLSAggregator: (args: {
126
103
  aggregator: Address;
127
104
  account?: Account | Address;
128
105
  }) => Promise<Hash>;
129
- registrySetMySBT: (args: {
106
+ setMySBT: (args: {
130
107
  sbt: Address;
131
108
  account?: Account | Address;
132
109
  }) => Promise<Hash>;
133
- registrySetSuperPaymaster: (args: {
110
+ setSuperPaymaster: (args: {
134
111
  paymaster: Address;
135
112
  account?: Account | Address;
136
113
  }) => Promise<Hash>;
137
- registrySetStaking: (args: {
114
+ setStaking: (args: {
138
115
  staking: Address;
139
116
  account?: Account | Address;
140
117
  }) => Promise<Hash>;
141
- registrySetReputationSource: (args: {
118
+ setReputationSource: (args: {
142
119
  source: Address;
143
120
  account?: Account | Address;
144
121
  }) => Promise<Hash>;
145
- registryBlsValidator: () => Promise<Address>;
146
- registryBlsAggregator: () => Promise<Address>;
147
- registryMySBT: () => Promise<Address>;
148
- registrySuperPaymaster: () => Promise<Address>;
149
- registryStaking: () => Promise<Address>;
150
- registryReputationSource: () => Promise<Address>;
151
- registryTransferOwnership: (args: {
152
- newOwner: Address;
153
- account?: Account | Address;
154
- }) => Promise<Hash>;
155
- registryOwner: () => Promise<Address>;
156
- registryRenounceOwnership: (args: {
157
- account?: Account | Address;
158
- }) => Promise<Hash>;
159
- registryRoleConfigs: (args: {
160
- roleId: Hex;
161
- }) => Promise<any>;
162
- registryGetRoleMemberCount: (args: {
163
- roleId: Hex;
164
- }) => Promise<bigint>;
165
- registryLevelThresholds: (args: {
166
- level: bigint;
122
+ blsValidator: () => Promise<Address>;
123
+ blsAggregator: () => Promise<Address>;
124
+ MYSBT: () => Promise<Address>;
125
+ SUPER_PAYMASTER: () => Promise<Address>;
126
+ GTOKEN_STAKING: () => Promise<Address>;
127
+ reputationSource: () => Promise<Address>;
128
+ isReputationSource: (args: {
129
+ source: Address;
130
+ }) => Promise<boolean>;
131
+ lastReputationEpoch: (args: {
132
+ user: Address;
167
133
  }) => Promise<bigint>;
168
- registryRoleLockDurations: (args: {
134
+ roleConfigs: (args: {
169
135
  roleId: Hex;
170
- }) => Promise<bigint>;
171
- registryRoleOwners: (args: {
136
+ }) => Promise<RoleConfigDetailed>;
137
+ getRoleUserCount: (args: {
172
138
  roleId: Hex;
173
- }) => Promise<Address>;
174
- registryGetRoleMembers: (args: {
139
+ }) => Promise<bigint>;
140
+ getRoleMembers: (args: {
175
141
  roleId: Hex;
176
142
  }) => Promise<Address[]>;
177
- registryGetRoleUserCount: (args: {
178
- roleId: Hex;
179
- }) => Promise<bigint>;
180
- registryGetUserRoles: (args: {
143
+ getUserRoles: (args: {
181
144
  user: Address;
182
145
  }) => Promise<Hex[]>;
183
- registryExitRole: (args: {
146
+ roleMembers: (args: {
184
147
  roleId: Hex;
185
- account?: Account | Address;
186
- }) => Promise<Hash>;
187
- registryCalculateExitFee: (args: {
148
+ index: bigint;
149
+ }) => Promise<Address>;
150
+ userRoles: (args: {
151
+ user: Address;
152
+ index: bigint;
153
+ }) => Promise<Hex>;
154
+ userRoleCount: (args: {
155
+ user: Address;
156
+ }) => Promise<bigint>;
157
+ creditTierConfig: (args: {
158
+ tierIndex: bigint;
159
+ }) => Promise<bigint>;
160
+ levelThresholds: (args: {
161
+ levelIndex: bigint;
162
+ }) => Promise<bigint>;
163
+ calculateExitFee: (args: {
188
164
  roleId: Hex;
189
165
  amount: bigint;
190
166
  }) => Promise<bigint>;
191
- registryAddLevelThreshold: (args: {
192
- threshold: bigint;
193
- account?: Account | Address;
194
- }) => Promise<Hash>;
195
- registrySetLevelThreshold: (args: {
196
- index: bigint;
197
- threshold: bigint;
198
- account?: Account | Address;
199
- }) => Promise<Hash>;
200
- registryAccountToUser: (args: {
167
+ accountToUser: (args: {
201
168
  account: Address;
202
169
  }) => Promise<Address>;
203
- registryGetCreditLimit: (args: {
170
+ roleOwners: (args: {
171
+ roleId: Hex;
172
+ }) => Promise<Address>;
173
+ roleStakes: (args: {
174
+ roleId: Hex;
204
175
  user: Address;
205
176
  }) => Promise<bigint>;
206
- registrySetCreditTier: (args: {
207
- level: bigint;
208
- limit: bigint;
209
- account?: Account | Address;
210
- }) => Promise<Hash>;
211
- registryCreditTierConfig: (args: {
212
- level: bigint;
213
- }) => Promise<bigint>;
214
- registryAdminConfigureRole: (args: {
215
- roleId: Hex;
216
- minStake: bigint;
217
- entryBurn: bigint;
218
- exitFeePercent: number;
219
- minExitFee: bigint;
220
- account?: Account | Address;
221
- }) => Promise<Hash>;
222
- registryCreateNewRole: (args: {
177
+ roleLockDurations: (args: {
223
178
  roleId: Hex;
224
- config: RoleConfig;
225
- roleOwner: Address;
179
+ }) => Promise<bigint>;
180
+ ROLE_COMMUNITY: () => Promise<Hex>;
181
+ ROLE_ENDUSER: () => Promise<Hex>;
182
+ ROLE_PAYMASTER_SUPER: () => Promise<Hex>;
183
+ ROLE_PAYMASTER_AOA: () => Promise<Hex>;
184
+ ROLE_DVT: () => Promise<Hex>;
185
+ ROLE_KMS: () => Promise<Hex>;
186
+ ROLE_ANODE: () => Promise<Hex>;
187
+ owner: () => Promise<Address>;
188
+ transferOwnership: (args: {
189
+ newOwner: Address;
226
190
  account?: Account | Address;
227
191
  }) => Promise<Hash>;
228
- registrySafeMintForRole: (args: {
229
- roleId: Hex;
230
- user: Address;
231
- data: Hex;
192
+ renounceOwnership: (args: {
232
193
  account?: Account | Address;
233
194
  }) => Promise<Hash>;
234
- registryROLE_COMMUNITY: () => Promise<Hex>;
235
- registryROLE_ENDUSER: () => Promise<Hex>;
236
- registryROLE_PAYMASTER_SUPER: () => Promise<Hex>;
237
- registryROLE_PAYMASTER_AOA: () => Promise<Hex>;
238
- registryROLE_DVT: () => Promise<Hex>;
239
- registryROLE_KMS: () => Promise<Hex>;
240
- registryROLE_ANODE: () => Promise<Hex>;
241
- registryGTOKEN_STAKING: () => Promise<Address>;
242
- registryMYSBT: () => Promise<Address>;
243
- registrySUPER_PAYMASTER: () => Promise<Address>;
244
- registryVersion: () => Promise<string>;
195
+ version: () => Promise<string>;
245
196
  };
246
197
  export declare const registryActions: (address: Address) => (client: PublicClient | WalletClient) => RegistryActions;