@aastar/account 0.16.8 → 0.16.12
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/{account/src/eoa.js → eoa.js} +1 -2
- package/package.json +4 -7
- package/dist/core/src/abis/index.d.ts +0 -1126
- package/dist/core/src/abis/index.js +0 -91
- package/dist/core/src/actions/StateValidator.d.ts +0 -68
- package/dist/core/src/actions/StateValidator.js +0 -187
- package/dist/core/src/actions/account.d.ts +0 -55
- package/dist/core/src/actions/account.js +0 -133
- package/dist/core/src/actions/aggregator.d.ts +0 -17
- package/dist/core/src/actions/aggregator.js +0 -31
- package/dist/core/src/actions/dvt.d.ts +0 -30
- package/dist/core/src/actions/dvt.js +0 -41
- package/dist/core/src/actions/entryPoint.d.ts +0 -90
- package/dist/core/src/actions/entryPoint.js +0 -211
- package/dist/core/src/actions/factory.d.ts +0 -215
- package/dist/core/src/actions/factory.js +0 -442
- package/dist/core/src/actions/faucet.d.ts +0 -48
- package/dist/core/src/actions/faucet.js +0 -337
- package/dist/core/src/actions/gtokenExtended.d.ts +0 -39
- package/dist/core/src/actions/gtokenExtended.js +0 -115
- package/dist/core/src/actions/index.d.ts +0 -15
- package/dist/core/src/actions/index.js +0 -17
- package/dist/core/src/actions/paymasterV4.d.ts +0 -170
- package/dist/core/src/actions/paymasterV4.js +0 -334
- package/dist/core/src/actions/registry.d.ts +0 -246
- package/dist/core/src/actions/registry.js +0 -667
- package/dist/core/src/actions/reputation.d.ts +0 -129
- package/dist/core/src/actions/reputation.js +0 -281
- package/dist/core/src/actions/sbt.d.ts +0 -191
- package/dist/core/src/actions/sbt.js +0 -533
- package/dist/core/src/actions/staking.d.ts +0 -132
- package/dist/core/src/actions/staking.js +0 -330
- package/dist/core/src/actions/superPaymaster.d.ts +0 -237
- package/dist/core/src/actions/superPaymaster.js +0 -644
- package/dist/core/src/actions/tokens.d.ts +0 -229
- package/dist/core/src/actions/tokens.js +0 -415
- package/dist/core/src/branding.d.ts +0 -30
- package/dist/core/src/branding.js +0 -30
- package/dist/core/src/clients/BaseClient.d.ts +0 -25
- package/dist/core/src/clients/BaseClient.js +0 -66
- package/dist/core/src/clients/types.d.ts +0 -60
- package/dist/core/src/clients/types.js +0 -1
- package/dist/core/src/clients.d.ts +0 -5
- package/dist/core/src/clients.js +0 -11
- package/dist/core/src/communities.d.ts +0 -52
- package/dist/core/src/communities.js +0 -73
- package/dist/core/src/config/ContractConfigManager.d.ts +0 -20
- package/dist/core/src/config/ContractConfigManager.js +0 -48
- package/dist/core/src/constants.d.ts +0 -88
- package/dist/core/src/constants.js +0 -125
- package/dist/core/src/contract-addresses.d.ts +0 -110
- package/dist/core/src/contract-addresses.js +0 -99
- package/dist/core/src/contracts.d.ts +0 -424
- package/dist/core/src/contracts.js +0 -343
- package/dist/core/src/crypto/blsSigner.d.ts +0 -64
- package/dist/core/src/crypto/blsSigner.js +0 -98
- package/dist/core/src/crypto/index.d.ts +0 -1
- package/dist/core/src/crypto/index.js +0 -1
- package/dist/core/src/index.d.ts +0 -21
- package/dist/core/src/index.js +0 -21
- package/dist/core/src/networks.d.ts +0 -127
- package/dist/core/src/networks.js +0 -118
- package/dist/core/src/requirementChecker.d.ts +0 -38
- package/dist/core/src/requirementChecker.js +0 -139
- package/dist/core/src/roles.d.ts +0 -204
- package/dist/core/src/roles.js +0 -211
- package/dist/core/src/utils/validation.d.ts +0 -24
- package/dist/core/src/utils/validation.js +0 -56
- /package/dist/{account/src/accounts → accounts}/simple.d.ts +0 -0
- /package/dist/{account/src/accounts → accounts}/simple.js +0 -0
- /package/dist/{account/src/accounts → accounts}/simple.test.d.ts +0 -0
- /package/dist/{account/src/accounts → accounts}/simple.test.js +0 -0
- /package/dist/{account/src/eoa.d.ts → eoa.d.ts} +0 -0
- /package/dist/{account/src/eoa.test.d.ts → eoa.test.d.ts} +0 -0
- /package/dist/{account/src/eoa.test.js → eoa.test.js} +0 -0
- /package/dist/{account/src/index.d.ts → index.d.ts} +0 -0
- /package/dist/{account/src/index.js → index.js} +0 -0
- /package/dist/{account/src/index.test.d.ts → index.test.d.ts} +0 -0
- /package/dist/{account/src/index.test.js → index.test.js} +0 -0
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
import { type Address, type PublicClient, type WalletClient, type Hex, type Hash, type Account } from 'viem';
|
|
2
|
-
export type ReputationActions = {
|
|
3
|
-
setReputationRule: (args: {
|
|
4
|
-
ruleId: Hex;
|
|
5
|
-
rule: any;
|
|
6
|
-
account?: Account | Address;
|
|
7
|
-
}) => Promise<Hash>;
|
|
8
|
-
getReputationRule: (args: {
|
|
9
|
-
ruleId: Hex;
|
|
10
|
-
}) => Promise<any>;
|
|
11
|
-
enableRule: (args: {
|
|
12
|
-
ruleId: Hex;
|
|
13
|
-
account?: Account | Address;
|
|
14
|
-
}) => Promise<Hash>;
|
|
15
|
-
disableRule: (args: {
|
|
16
|
-
ruleId: Hex;
|
|
17
|
-
account?: Account | Address;
|
|
18
|
-
}) => Promise<Hash>;
|
|
19
|
-
isRuleActive: (args: {
|
|
20
|
-
ruleId: Hex;
|
|
21
|
-
}) => Promise<boolean>;
|
|
22
|
-
getActiveRules: (args: {
|
|
23
|
-
community: Address;
|
|
24
|
-
}) => Promise<Hex[]>;
|
|
25
|
-
getRuleCount: () => Promise<bigint>;
|
|
26
|
-
computeScore: (args: {
|
|
27
|
-
user: Address;
|
|
28
|
-
community: Address;
|
|
29
|
-
}) => Promise<bigint>;
|
|
30
|
-
getUserScore: (args: {
|
|
31
|
-
user: Address;
|
|
32
|
-
}) => Promise<bigint>;
|
|
33
|
-
getCommunityScore: (args: {
|
|
34
|
-
community: Address;
|
|
35
|
-
}) => Promise<bigint>;
|
|
36
|
-
communityReputations: (args: {
|
|
37
|
-
community: Address;
|
|
38
|
-
user: Address;
|
|
39
|
-
}) => Promise<bigint>;
|
|
40
|
-
setRule: (args: {
|
|
41
|
-
ruleId: Hex;
|
|
42
|
-
rule: any;
|
|
43
|
-
account?: Account | Address;
|
|
44
|
-
}) => Promise<Hash>;
|
|
45
|
-
calculateReputation: (args: {
|
|
46
|
-
user: Address;
|
|
47
|
-
community: Address;
|
|
48
|
-
}) => Promise<bigint>;
|
|
49
|
-
nftCollectionBoost: (args: {
|
|
50
|
-
collection: Address;
|
|
51
|
-
}) => Promise<bigint>;
|
|
52
|
-
batchUpdateScores: (args: {
|
|
53
|
-
users: Address[];
|
|
54
|
-
scores: bigint[];
|
|
55
|
-
account?: Account | Address;
|
|
56
|
-
}) => Promise<Hash>;
|
|
57
|
-
batchSyncToRegistry: (args: {
|
|
58
|
-
users: Address[];
|
|
59
|
-
account?: Account | Address;
|
|
60
|
-
}) => Promise<Hash>;
|
|
61
|
-
syncToRegistry: (args: {
|
|
62
|
-
user: Address;
|
|
63
|
-
communities: Address[];
|
|
64
|
-
ruleIds: Hex[][];
|
|
65
|
-
activities: bigint[][];
|
|
66
|
-
epoch: bigint;
|
|
67
|
-
proof: Hex;
|
|
68
|
-
account?: Account | Address;
|
|
69
|
-
}) => Promise<Hash>;
|
|
70
|
-
setRegistry: (args: {
|
|
71
|
-
registry: Address;
|
|
72
|
-
account?: Account | Address;
|
|
73
|
-
}) => Promise<Hash>;
|
|
74
|
-
setEntropyFactor: (args: {
|
|
75
|
-
factor: bigint;
|
|
76
|
-
account?: Account | Address;
|
|
77
|
-
}) => Promise<Hash>;
|
|
78
|
-
getEntropyFactor: () => Promise<bigint>;
|
|
79
|
-
REGISTRY: () => Promise<Address>;
|
|
80
|
-
reputationOwner: () => Promise<Address>;
|
|
81
|
-
transferReputationOwnership: (args: {
|
|
82
|
-
newOwner: Address;
|
|
83
|
-
account?: Account | Address;
|
|
84
|
-
}) => 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;
|
|
125
|
-
account?: Account | Address;
|
|
126
|
-
}) => Promise<Hash>;
|
|
127
|
-
reputationVersion: () => Promise<string>;
|
|
128
|
-
};
|
|
129
|
-
export declare const reputationActions: (address: Address) => (client: PublicClient | WalletClient) => ReputationActions;
|
|
@@ -1,281 +0,0 @@
|
|
|
1
|
-
import { ReputationSystemABI } from '../abis/index.js';
|
|
2
|
-
export const reputationActions = (address) => (client) => ({
|
|
3
|
-
// 规则配置
|
|
4
|
-
async setReputationRule({ ruleId, rule, account }) {
|
|
5
|
-
return client.writeContract({
|
|
6
|
-
address,
|
|
7
|
-
abi: ReputationSystemABI,
|
|
8
|
-
functionName: 'setReputationRule',
|
|
9
|
-
args: [ruleId, rule],
|
|
10
|
-
account: account,
|
|
11
|
-
chain: client.chain
|
|
12
|
-
});
|
|
13
|
-
},
|
|
14
|
-
async getReputationRule({ ruleId }) {
|
|
15
|
-
return client.readContract({
|
|
16
|
-
address,
|
|
17
|
-
abi: ReputationSystemABI,
|
|
18
|
-
functionName: 'getReputationRule',
|
|
19
|
-
args: [ruleId]
|
|
20
|
-
});
|
|
21
|
-
},
|
|
22
|
-
async enableRule({ ruleId, account }) {
|
|
23
|
-
return client.writeContract({
|
|
24
|
-
address,
|
|
25
|
-
abi: ReputationSystemABI,
|
|
26
|
-
functionName: 'enableRule',
|
|
27
|
-
args: [ruleId],
|
|
28
|
-
account: account,
|
|
29
|
-
chain: client.chain
|
|
30
|
-
});
|
|
31
|
-
},
|
|
32
|
-
async disableRule({ ruleId, account }) {
|
|
33
|
-
return client.writeContract({
|
|
34
|
-
address,
|
|
35
|
-
abi: ReputationSystemABI,
|
|
36
|
-
functionName: 'disableRule',
|
|
37
|
-
args: [ruleId],
|
|
38
|
-
account: account,
|
|
39
|
-
chain: client.chain
|
|
40
|
-
});
|
|
41
|
-
},
|
|
42
|
-
async isRuleActive({ ruleId }) {
|
|
43
|
-
return client.readContract({
|
|
44
|
-
address,
|
|
45
|
-
abi: ReputationSystemABI,
|
|
46
|
-
functionName: 'isRuleActive',
|
|
47
|
-
args: [ruleId]
|
|
48
|
-
});
|
|
49
|
-
},
|
|
50
|
-
async getActiveRules({ community }) {
|
|
51
|
-
return client.readContract({
|
|
52
|
-
address,
|
|
53
|
-
abi: ReputationSystemABI,
|
|
54
|
-
functionName: 'getActiveRules',
|
|
55
|
-
args: [community]
|
|
56
|
-
});
|
|
57
|
-
},
|
|
58
|
-
async getRuleCount() {
|
|
59
|
-
return client.readContract({
|
|
60
|
-
address,
|
|
61
|
-
abi: ReputationSystemABI,
|
|
62
|
-
functionName: 'getRuleCount',
|
|
63
|
-
args: []
|
|
64
|
-
});
|
|
65
|
-
},
|
|
66
|
-
// 积分计算
|
|
67
|
-
async computeScore({ user, community }) {
|
|
68
|
-
return client.readContract({
|
|
69
|
-
address,
|
|
70
|
-
abi: ReputationSystemABI,
|
|
71
|
-
functionName: 'computeScore',
|
|
72
|
-
args: [user, community]
|
|
73
|
-
});
|
|
74
|
-
},
|
|
75
|
-
async getUserScore({ user }) {
|
|
76
|
-
return client.readContract({
|
|
77
|
-
address,
|
|
78
|
-
abi: ReputationSystemABI,
|
|
79
|
-
functionName: 'getUserScore',
|
|
80
|
-
args: [user]
|
|
81
|
-
});
|
|
82
|
-
},
|
|
83
|
-
async getCommunityScore({ community }) {
|
|
84
|
-
return client.readContract({
|
|
85
|
-
address,
|
|
86
|
-
abi: ReputationSystemABI,
|
|
87
|
-
functionName: 'getCommunityScore',
|
|
88
|
-
args: [community]
|
|
89
|
-
});
|
|
90
|
-
},
|
|
91
|
-
// Public mapping getter
|
|
92
|
-
async communityReputations({ community, user }) {
|
|
93
|
-
return client.readContract({
|
|
94
|
-
address,
|
|
95
|
-
abi: ReputationSystemABI,
|
|
96
|
-
functionName: 'communityReputations',
|
|
97
|
-
args: [community, user]
|
|
98
|
-
});
|
|
99
|
-
},
|
|
100
|
-
// Missing Critical Actions
|
|
101
|
-
async setRule(args) {
|
|
102
|
-
return this.setReputationRule(args);
|
|
103
|
-
},
|
|
104
|
-
async calculateReputation(args) {
|
|
105
|
-
// Assuming calculateReputation calls computeScore or check if dedicated function exists
|
|
106
|
-
// Report said calculateReputation matches ABI.
|
|
107
|
-
return client.readContract({
|
|
108
|
-
address,
|
|
109
|
-
abi: ReputationSystemABI,
|
|
110
|
-
functionName: 'calculateReputation', // If this fails, it means calculateReputation is NOT in ABI and tool was confused? But report said it IS in ABI.
|
|
111
|
-
args: [args.user, args.community]
|
|
112
|
-
});
|
|
113
|
-
},
|
|
114
|
-
async nftCollectionBoost({ collection }) {
|
|
115
|
-
return client.readContract({
|
|
116
|
-
address,
|
|
117
|
-
abi: ReputationSystemABI,
|
|
118
|
-
functionName: 'nftCollectionBoost',
|
|
119
|
-
args: [collection]
|
|
120
|
-
});
|
|
121
|
-
},
|
|
122
|
-
// 批量操作
|
|
123
|
-
async batchUpdateScores({ users, scores, account }) {
|
|
124
|
-
return client.writeContract({
|
|
125
|
-
address,
|
|
126
|
-
abi: ReputationSystemABI,
|
|
127
|
-
functionName: 'batchUpdateScores',
|
|
128
|
-
args: [users, scores],
|
|
129
|
-
account: account,
|
|
130
|
-
chain: client.chain
|
|
131
|
-
});
|
|
132
|
-
},
|
|
133
|
-
async batchSyncToRegistry({ users, account }) {
|
|
134
|
-
return client.writeContract({
|
|
135
|
-
address,
|
|
136
|
-
abi: ReputationSystemABI,
|
|
137
|
-
functionName: 'batchSyncToRegistry',
|
|
138
|
-
args: [users],
|
|
139
|
-
account: account,
|
|
140
|
-
chain: client.chain
|
|
141
|
-
});
|
|
142
|
-
},
|
|
143
|
-
async syncToRegistry({ user, communities, ruleIds, activities, epoch, proof, account }) {
|
|
144
|
-
return client.writeContract({
|
|
145
|
-
address,
|
|
146
|
-
abi: ReputationSystemABI,
|
|
147
|
-
functionName: 'syncToRegistry',
|
|
148
|
-
args: [user, communities, ruleIds, activities, epoch, proof],
|
|
149
|
-
account: account,
|
|
150
|
-
chain: client.chain
|
|
151
|
-
});
|
|
152
|
-
},
|
|
153
|
-
// Admin & Config
|
|
154
|
-
async setRegistry({ registry, account }) {
|
|
155
|
-
return client.writeContract({
|
|
156
|
-
address,
|
|
157
|
-
abi: ReputationSystemABI,
|
|
158
|
-
functionName: 'setRegistry',
|
|
159
|
-
args: [registry],
|
|
160
|
-
account: account,
|
|
161
|
-
chain: client.chain
|
|
162
|
-
});
|
|
163
|
-
},
|
|
164
|
-
async setEntropyFactor({ factor, account }) {
|
|
165
|
-
return client.writeContract({
|
|
166
|
-
address,
|
|
167
|
-
abi: ReputationSystemABI,
|
|
168
|
-
functionName: 'setEntropyFactor',
|
|
169
|
-
args: [factor],
|
|
170
|
-
account: account,
|
|
171
|
-
chain: client.chain
|
|
172
|
-
});
|
|
173
|
-
},
|
|
174
|
-
async getEntropyFactor() {
|
|
175
|
-
return client.readContract({
|
|
176
|
-
address,
|
|
177
|
-
abi: ReputationSystemABI,
|
|
178
|
-
functionName: 'getEntropyFactor',
|
|
179
|
-
args: []
|
|
180
|
-
});
|
|
181
|
-
},
|
|
182
|
-
// Constants
|
|
183
|
-
async REGISTRY() {
|
|
184
|
-
return client.readContract({
|
|
185
|
-
address,
|
|
186
|
-
abi: ReputationSystemABI,
|
|
187
|
-
functionName: 'REGISTRY',
|
|
188
|
-
args: []
|
|
189
|
-
});
|
|
190
|
-
},
|
|
191
|
-
// Ownership
|
|
192
|
-
async reputationOwner() {
|
|
193
|
-
return client.readContract({
|
|
194
|
-
address,
|
|
195
|
-
abi: ReputationSystemABI,
|
|
196
|
-
functionName: 'owner',
|
|
197
|
-
args: []
|
|
198
|
-
});
|
|
199
|
-
},
|
|
200
|
-
async renounceReputationOwnership({ account } = {}) {
|
|
201
|
-
return client.writeContract({
|
|
202
|
-
address,
|
|
203
|
-
abi: ReputationSystemABI,
|
|
204
|
-
functionName: 'renounceOwnership',
|
|
205
|
-
args: [],
|
|
206
|
-
account: account,
|
|
207
|
-
chain: client.chain
|
|
208
|
-
});
|
|
209
|
-
},
|
|
210
|
-
async transferReputationOwnership({ newOwner, account }) {
|
|
211
|
-
return client.writeContract({
|
|
212
|
-
address,
|
|
213
|
-
abi: ReputationSystemABI,
|
|
214
|
-
functionName: 'transferOwnership',
|
|
215
|
-
args: [newOwner],
|
|
216
|
-
account: account,
|
|
217
|
-
chain: client.chain
|
|
218
|
-
});
|
|
219
|
-
},
|
|
220
|
-
async setCommunityReputation({ community, reputation, account }) {
|
|
221
|
-
return client.writeContract({
|
|
222
|
-
address,
|
|
223
|
-
abi: ReputationSystemABI,
|
|
224
|
-
functionName: 'setCommunityReputation',
|
|
225
|
-
args: [community, reputation],
|
|
226
|
-
account: account,
|
|
227
|
-
chain: client.chain
|
|
228
|
-
});
|
|
229
|
-
},
|
|
230
|
-
async updateNFTHoldStart({ user, collection, start, account }) {
|
|
231
|
-
return client.writeContract({
|
|
232
|
-
address,
|
|
233
|
-
abi: ReputationSystemABI,
|
|
234
|
-
functionName: 'updateNFTHoldStart',
|
|
235
|
-
args: [user, collection, start],
|
|
236
|
-
account: account,
|
|
237
|
-
chain: client.chain
|
|
238
|
-
});
|
|
239
|
-
},
|
|
240
|
-
// Views
|
|
241
|
-
async communityRules({ community, ruleId }) {
|
|
242
|
-
return client.readContract({ address, abi: ReputationSystemABI, functionName: 'communityRules', args: [community, ruleId] });
|
|
243
|
-
},
|
|
244
|
-
async defaultRule() {
|
|
245
|
-
return client.readContract({ address, abi: ReputationSystemABI, functionName: 'defaultRule', args: [] });
|
|
246
|
-
},
|
|
247
|
-
async entropyFactors({ factorId }) {
|
|
248
|
-
return client.readContract({ address, abi: ReputationSystemABI, functionName: 'entropyFactors', args: [factorId] });
|
|
249
|
-
},
|
|
250
|
-
async nftHoldStart({ user, collection }) {
|
|
251
|
-
return client.readContract({ address, abi: ReputationSystemABI, functionName: 'nftHoldStart', args: [user, collection] });
|
|
252
|
-
},
|
|
253
|
-
async boostedCollections({ collection }) {
|
|
254
|
-
return client.readContract({ address, abi: ReputationSystemABI, functionName: 'boostedCollections', args: [collection] });
|
|
255
|
-
},
|
|
256
|
-
async communityActiveRules({ community, ruleId }) {
|
|
257
|
-
return client.readContract({ address, abi: ReputationSystemABI, functionName: 'communityActiveRules', args: [community, ruleId] });
|
|
258
|
-
},
|
|
259
|
-
async getReputationBreakdown({ user, community }) {
|
|
260
|
-
return client.readContract({ address, abi: ReputationSystemABI, functionName: 'getReputationBreakdown', args: [user, community] });
|
|
261
|
-
},
|
|
262
|
-
async setNFTBoost({ collection, boost, account }) {
|
|
263
|
-
return client.writeContract({
|
|
264
|
-
address,
|
|
265
|
-
abi: ReputationSystemABI,
|
|
266
|
-
functionName: 'setNFTBoost',
|
|
267
|
-
args: [collection, boost],
|
|
268
|
-
account: account,
|
|
269
|
-
chain: client.chain
|
|
270
|
-
});
|
|
271
|
-
},
|
|
272
|
-
// Version
|
|
273
|
-
async reputationVersion() {
|
|
274
|
-
return client.readContract({
|
|
275
|
-
address,
|
|
276
|
-
abi: ReputationSystemABI,
|
|
277
|
-
functionName: 'version',
|
|
278
|
-
args: []
|
|
279
|
-
});
|
|
280
|
-
}
|
|
281
|
-
});
|
|
@@ -1,191 +0,0 @@
|
|
|
1
|
-
import { type Address, type PublicClient, type WalletClient, type Hex, type Hash, type Account } from 'viem';
|
|
2
|
-
export type SBTActions = {
|
|
3
|
-
sbtSafeMintForRole: (args: {
|
|
4
|
-
roleId: Hex;
|
|
5
|
-
to: Address;
|
|
6
|
-
tokenURI: string;
|
|
7
|
-
account?: Account | Address;
|
|
8
|
-
}) => Promise<Hash>;
|
|
9
|
-
sbtAirdropMint: (args: {
|
|
10
|
-
roleId: Hex;
|
|
11
|
-
to: Address;
|
|
12
|
-
tokenURI: string;
|
|
13
|
-
account?: Account | Address;
|
|
14
|
-
}) => Promise<Hash>;
|
|
15
|
-
sbtMintForRole: (args: {
|
|
16
|
-
roleId: Hex;
|
|
17
|
-
to: Address;
|
|
18
|
-
account?: Account | Address;
|
|
19
|
-
}) => Promise<Hash>;
|
|
20
|
-
sbtGetUserSBT: (args: {
|
|
21
|
-
user: Address;
|
|
22
|
-
roleId: Hex;
|
|
23
|
-
}) => Promise<bigint>;
|
|
24
|
-
sbtGetSBTData: (args: {
|
|
25
|
-
tokenId: bigint;
|
|
26
|
-
}) => Promise<any>;
|
|
27
|
-
sbtGetCommunityMembership: (args: {
|
|
28
|
-
user: Address;
|
|
29
|
-
community: Address;
|
|
30
|
-
}) => Promise<bigint>;
|
|
31
|
-
sbtGetMemberships: (args: {
|
|
32
|
-
user: Address;
|
|
33
|
-
}) => Promise<any[]>;
|
|
34
|
-
sbtGetActiveMemberships: (args: {
|
|
35
|
-
user: Address;
|
|
36
|
-
}) => Promise<any[]>;
|
|
37
|
-
sbtVerifyCommunityMembership: (args: {
|
|
38
|
-
user: Address;
|
|
39
|
-
community: Address;
|
|
40
|
-
}) => Promise<boolean>;
|
|
41
|
-
sbtUserToSBT: (args: {
|
|
42
|
-
user: Address;
|
|
43
|
-
}) => Promise<bigint>;
|
|
44
|
-
sbtSbtData: (args: {
|
|
45
|
-
tokenId: bigint;
|
|
46
|
-
}) => Promise<any>;
|
|
47
|
-
sbtMembershipIndex: (args: {
|
|
48
|
-
user: Address;
|
|
49
|
-
index: bigint;
|
|
50
|
-
}) => Promise<any>;
|
|
51
|
-
sbtBalanceOf: (args: {
|
|
52
|
-
owner: Address;
|
|
53
|
-
}) => Promise<bigint>;
|
|
54
|
-
sbtOwnerOf: (args: {
|
|
55
|
-
tokenId: bigint;
|
|
56
|
-
}) => Promise<Address>;
|
|
57
|
-
sbtSafeTransferFrom: (args: {
|
|
58
|
-
from: Address;
|
|
59
|
-
to: Address;
|
|
60
|
-
tokenId: bigint;
|
|
61
|
-
account?: Account | Address;
|
|
62
|
-
}) => Promise<Hash>;
|
|
63
|
-
sbtTransferFrom: (args: {
|
|
64
|
-
from: Address;
|
|
65
|
-
to: Address;
|
|
66
|
-
tokenId: bigint;
|
|
67
|
-
account?: Account | Address;
|
|
68
|
-
}) => Promise<Hash>;
|
|
69
|
-
sbtApprove: (args: {
|
|
70
|
-
to: Address;
|
|
71
|
-
tokenId: bigint;
|
|
72
|
-
account?: Account | Address;
|
|
73
|
-
}) => Promise<Hash>;
|
|
74
|
-
sbtSetApprovalForAll: (args: {
|
|
75
|
-
operator: Address;
|
|
76
|
-
approved: boolean;
|
|
77
|
-
account?: Account | Address;
|
|
78
|
-
}) => Promise<Hash>;
|
|
79
|
-
sbtGetApproved: (args: {
|
|
80
|
-
tokenId: bigint;
|
|
81
|
-
}) => Promise<Address>;
|
|
82
|
-
sbtIsApprovedForAll: (args: {
|
|
83
|
-
owner: Address;
|
|
84
|
-
operator: Address;
|
|
85
|
-
}) => Promise<boolean>;
|
|
86
|
-
sbtName: () => Promise<string>;
|
|
87
|
-
sbtSymbol: () => Promise<string>;
|
|
88
|
-
sbtTokenURI: (args: {
|
|
89
|
-
tokenId: bigint;
|
|
90
|
-
}) => Promise<string>;
|
|
91
|
-
sbtTotalSupply: () => Promise<bigint>;
|
|
92
|
-
sbtTokenByIndex: (args: {
|
|
93
|
-
index: bigint;
|
|
94
|
-
}) => Promise<bigint>;
|
|
95
|
-
sbtTokenOfOwnerByIndex: (args: {
|
|
96
|
-
owner: Address;
|
|
97
|
-
index: bigint;
|
|
98
|
-
}) => Promise<bigint>;
|
|
99
|
-
sbtSupportsInterface: (args: {
|
|
100
|
-
interfaceId: Hex;
|
|
101
|
-
}) => Promise<boolean>;
|
|
102
|
-
sbtNextTokenId: () => Promise<bigint>;
|
|
103
|
-
sbtMint: (args: {
|
|
104
|
-
to: Address;
|
|
105
|
-
tokenURI: string;
|
|
106
|
-
account?: Account | Address;
|
|
107
|
-
}) => Promise<Hash>;
|
|
108
|
-
sbtBurn: (args: {
|
|
109
|
-
tokenId: bigint;
|
|
110
|
-
account?: Account | Address;
|
|
111
|
-
}) => Promise<Hash>;
|
|
112
|
-
sbtBurnSBT: (args: {
|
|
113
|
-
tokenId: bigint;
|
|
114
|
-
account?: Account | Address;
|
|
115
|
-
}) => Promise<Hash>;
|
|
116
|
-
sbtDeactivateAllMemberships: (args: {
|
|
117
|
-
user: Address;
|
|
118
|
-
account?: Account | Address;
|
|
119
|
-
}) => Promise<Hash>;
|
|
120
|
-
sbtSetBaseURI: (args: {
|
|
121
|
-
baseURI: string;
|
|
122
|
-
account?: Account | Address;
|
|
123
|
-
}) => Promise<Hash>;
|
|
124
|
-
sbtLeaveCommunity: (args: {
|
|
125
|
-
community: Address;
|
|
126
|
-
account?: Account | Address;
|
|
127
|
-
}) => Promise<Hash>;
|
|
128
|
-
sbtDeactivateMembership: (args: {
|
|
129
|
-
tokenId: bigint;
|
|
130
|
-
account?: Account | Address;
|
|
131
|
-
}) => Promise<Hash>;
|
|
132
|
-
sbtRecordActivity: (args: {
|
|
133
|
-
user: Address;
|
|
134
|
-
account?: Account | Address;
|
|
135
|
-
}) => Promise<Hash>;
|
|
136
|
-
sbtLastActivityTime: (args: {
|
|
137
|
-
user: Address;
|
|
138
|
-
}) => Promise<bigint>;
|
|
139
|
-
sbtWeeklyActivity: (args: {
|
|
140
|
-
user: Address;
|
|
141
|
-
}) => Promise<bigint>;
|
|
142
|
-
sbtReputationCalculator: () => Promise<Address>;
|
|
143
|
-
sbtSetReputationCalculator: (args: {
|
|
144
|
-
calculator: Address;
|
|
145
|
-
account?: Account | Address;
|
|
146
|
-
}) => Promise<Hash>;
|
|
147
|
-
sbtMintFee: () => Promise<bigint>;
|
|
148
|
-
sbtSetMintFee: (args: {
|
|
149
|
-
fee: bigint;
|
|
150
|
-
account?: Account | Address;
|
|
151
|
-
}) => Promise<Hash>;
|
|
152
|
-
sbtMinLockAmount: () => Promise<bigint>;
|
|
153
|
-
sbtSetMinLockAmount: (args: {
|
|
154
|
-
amount: bigint;
|
|
155
|
-
account?: Account | Address;
|
|
156
|
-
}) => Promise<Hash>;
|
|
157
|
-
sbtPause: (args: {
|
|
158
|
-
account?: Account | Address;
|
|
159
|
-
}) => Promise<Hash>;
|
|
160
|
-
sbtUnpause: (args: {
|
|
161
|
-
account?: Account | Address;
|
|
162
|
-
}) => Promise<Hash>;
|
|
163
|
-
sbtPaused: () => Promise<boolean>;
|
|
164
|
-
sbtDaoMultisig: () => Promise<Address>;
|
|
165
|
-
sbtSetDAOMultisig: (args: {
|
|
166
|
-
multisig: Address;
|
|
167
|
-
account?: Account | Address;
|
|
168
|
-
}) => Promise<Hash>;
|
|
169
|
-
sbtSetRegistry: (args: {
|
|
170
|
-
registry: Address;
|
|
171
|
-
account?: Account | Address;
|
|
172
|
-
}) => Promise<Hash>;
|
|
173
|
-
sbtSetSuperPaymaster: (args: {
|
|
174
|
-
paymaster: Address;
|
|
175
|
-
account?: Account | Address;
|
|
176
|
-
}) => Promise<Hash>;
|
|
177
|
-
sbtVersion: () => Promise<string>;
|
|
178
|
-
sbtREGISTRY: () => Promise<Address>;
|
|
179
|
-
sbtGTOKEN_STAKING: () => Promise<Address>;
|
|
180
|
-
sbtGTOKEN: () => Promise<Address>;
|
|
181
|
-
sbtSUPER_PAYMASTER: () => Promise<Address>;
|
|
182
|
-
sbtOwner: () => Promise<Address>;
|
|
183
|
-
sbtTransferSBTOwnership: (args: {
|
|
184
|
-
newOwner: Address;
|
|
185
|
-
account?: Account | Address;
|
|
186
|
-
}) => Promise<Hash>;
|
|
187
|
-
sbtRenounceOwnership: (args: {
|
|
188
|
-
account?: Account | Address;
|
|
189
|
-
}) => Promise<Hash>;
|
|
190
|
-
};
|
|
191
|
-
export declare const sbtActions: (address: Address) => (client: PublicClient | WalletClient) => SBTActions;
|