@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,13 +1,25 @@
1
1
  import { type Address, type PublicClient, type WalletClient, type Hex, type Hash, type Account } from 'viem';
2
+ export type ReputationRule = {
3
+ baseScore: bigint;
4
+ activityBonus: bigint;
5
+ maxBonus: bigint;
6
+ description: string;
7
+ };
8
+ export type ReputationBreakdown = {
9
+ baseScore: bigint;
10
+ nftBonus: bigint;
11
+ activityBonus: bigint;
12
+ multiplier: bigint;
13
+ };
2
14
  export type ReputationActions = {
3
15
  setReputationRule: (args: {
4
16
  ruleId: Hex;
5
- rule: any;
17
+ rule: ReputationRule;
6
18
  account?: Account | Address;
7
19
  }) => Promise<Hash>;
8
20
  getReputationRule: (args: {
9
21
  ruleId: Hex;
10
- }) => Promise<any>;
22
+ }) => Promise<ReputationRule>;
11
23
  enableRule: (args: {
12
24
  ruleId: Hex;
13
25
  account?: Account | Address;
@@ -23,10 +35,42 @@ export type ReputationActions = {
23
35
  community: Address;
24
36
  }) => Promise<Hex[]>;
25
37
  getRuleCount: () => Promise<bigint>;
38
+ setRule: (args: {
39
+ ruleId: Hex;
40
+ base: bigint;
41
+ bonus: bigint;
42
+ max: bigint;
43
+ desc: string;
44
+ account?: Account | Address;
45
+ }) => Promise<Hash>;
46
+ communityRules: (args: {
47
+ community: Address;
48
+ ruleId: Hex;
49
+ }) => Promise<ReputationRule>;
50
+ communityActiveRules: (args: {
51
+ community: Address;
52
+ index: bigint;
53
+ }) => Promise<Hex>;
54
+ defaultRule: () => Promise<ReputationRule>;
26
55
  computeScore: (args: {
27
56
  user: Address;
28
- community: Address;
57
+ communities: Address[];
58
+ ruleIds: Hex[][];
59
+ activities: bigint[][];
29
60
  }) => Promise<bigint>;
61
+ calculateReputation: (args: {
62
+ user: Address;
63
+ community: Address;
64
+ timestamp: bigint;
65
+ }) => Promise<{
66
+ communityScore: bigint;
67
+ globalScore: bigint;
68
+ }>;
69
+ getReputationBreakdown: (args: {
70
+ user: Address;
71
+ community: Address;
72
+ timestamp: bigint;
73
+ }) => Promise<ReputationBreakdown>;
30
74
  getUserScore: (args: {
31
75
  user: Address;
32
76
  }) => Promise<bigint>;
@@ -37,17 +81,33 @@ export type ReputationActions = {
37
81
  community: Address;
38
82
  user: Address;
39
83
  }) => Promise<bigint>;
40
- setRule: (args: {
41
- ruleId: Hex;
42
- rule: any;
84
+ setCommunityReputation: (args: {
85
+ community: Address;
86
+ user: Address;
87
+ score: bigint;
43
88
  account?: Account | Address;
44
89
  }) => Promise<Hash>;
45
- calculateReputation: (args: {
90
+ setNFTBoost: (args: {
91
+ collection: Address;
92
+ boost: bigint;
93
+ account?: Account | Address;
94
+ }) => Promise<Hash>;
95
+ nftCollectionBoost: (args: {
96
+ collection: Address;
97
+ }) => Promise<bigint>;
98
+ nftHoldStart: (args: {
46
99
  user: Address;
47
- community: Address;
100
+ collection: Address;
48
101
  }) => Promise<bigint>;
49
- nftCollectionBoost: (args: {
102
+ updateNFTHoldStart: (args: {
50
103
  collection: Address;
104
+ account?: Account | Address;
105
+ }) => Promise<Hash>;
106
+ boostedCollections: (args: {
107
+ index: bigint;
108
+ }) => Promise<Address>;
109
+ entropyFactors: (args: {
110
+ community: Address;
51
111
  }) => Promise<bigint>;
52
112
  batchUpdateScores: (args: {
53
113
  users: Address[];
@@ -72,58 +132,20 @@ export type ReputationActions = {
72
132
  account?: Account | Address;
73
133
  }) => Promise<Hash>;
74
134
  setEntropyFactor: (args: {
135
+ community: Address;
75
136
  factor: bigint;
76
137
  account?: Account | Address;
77
138
  }) => Promise<Hash>;
78
139
  getEntropyFactor: () => Promise<bigint>;
79
140
  REGISTRY: () => Promise<Address>;
80
- reputationOwner: () => Promise<Address>;
81
- transferReputationOwnership: (args: {
141
+ owner: () => Promise<Address>;
142
+ transferOwnership: (args: {
82
143
  newOwner: Address;
83
144
  account?: Account | Address;
84
145
  }) => Promise<Hash>;
85
- renounceReputationOwnership: (args: {
86
- account?: Account | Address;
87
- }) => Promise<Hash>;
88
- setCommunityReputation: (args: {
89
- community: Address;
90
- reputation: bigint;
91
- account?: Account | Address;
92
- }) => Promise<Hash>;
93
- updateNFTHoldStart: (args: {
94
- user: Address;
95
- collection: Address;
96
- start: bigint;
97
- account?: Account | Address;
98
- }) => Promise<Hash>;
99
- communityRules: (args: {
100
- community: Address;
101
- ruleId: Hex;
102
- }) => Promise<boolean>;
103
- defaultRule: () => Promise<Hex>;
104
- entropyFactors: (args: {
105
- factorId: bigint;
106
- }) => Promise<bigint>;
107
- nftHoldStart: (args: {
108
- user: Address;
109
- collection: Address;
110
- }) => Promise<bigint>;
111
- boostedCollections: (args: {
112
- collection: Address;
113
- }) => Promise<bigint>;
114
- communityActiveRules: (args: {
115
- community: Address;
116
- ruleId: Hex;
117
- }) => Promise<boolean>;
118
- getReputationBreakdown: (args: {
119
- user: Address;
120
- community: Address;
121
- }) => Promise<any>;
122
- setNFTBoost: (args: {
123
- collection: Address;
124
- boost: bigint;
146
+ renounceOwnership: (args: {
125
147
  account?: Account | Address;
126
148
  }) => Promise<Hash>;
127
- reputationVersion: () => Promise<string>;
149
+ version: () => Promise<string>;
128
150
  };
129
151
  export declare const reputationActions: (address: Address) => (client: PublicClient | WalletClient) => ReputationActions;