@prosopo/database 0.2.2 → 0.2.4
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/cjs/contracts/captcha/dist/build-extrinsic/captcha.cjs +339 -0
- package/dist/cjs/contracts/captcha/dist/contract-info/captcha.cjs +6 -0
- package/dist/cjs/contracts/captcha/dist/contracts/captcha.cjs +79 -0
- package/dist/cjs/contracts/captcha/dist/data/captcha.json.cjs +3374 -0
- package/dist/cjs/contracts/captcha/dist/event-data/captcha.json.cjs +3 -0
- package/dist/cjs/contracts/captcha/dist/events/captcha.cjs +23 -0
- package/dist/cjs/contracts/captcha/dist/index.cjs +44 -0
- package/dist/cjs/contracts/captcha/dist/mixed-methods/captcha.cjs +470 -0
- package/dist/cjs/contracts/captcha/dist/query/captcha.cjs +468 -0
- package/dist/cjs/contracts/captcha/dist/shared/utils.cjs +31 -0
- package/dist/cjs/contracts/captcha/dist/tx-sign-and-send/captcha.cjs +426 -0
- package/dist/cjs/contracts/captcha/dist/types-arguments/captcha.cjs +62 -0
- package/dist/cjs/databases/mongo.cjs +19 -17
- package/dist/databases/mongo.d.ts +8 -7
- package/dist/databases/mongo.d.ts.map +1 -1
- package/dist/databases/mongo.js +2 -1
- package/dist/databases/mongo.js.map +1 -1
- package/package.json +10 -6
|
@@ -0,0 +1,426 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const typechainTypes = require("@727-ventures/typechain-types");
|
|
3
|
+
const utils = require("../shared/utils.cjs");
|
|
4
|
+
const captcha = require("../event-data/captcha.json.cjs");
|
|
5
|
+
class Methods {
|
|
6
|
+
constructor(apiPromise, nativeContract, keyringPair) {
|
|
7
|
+
this.__apiPromise = apiPromise;
|
|
8
|
+
this.__nativeContract = nativeContract;
|
|
9
|
+
this.__keyringPair = keyringPair;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* getGitCommitId
|
|
13
|
+
*
|
|
14
|
+
*/
|
|
15
|
+
getGitCommitId(__options) {
|
|
16
|
+
return typechainTypes.txSignAndSend(this.__apiPromise, this.__nativeContract, this.__keyringPair, "getGitCommitId", (events) => {
|
|
17
|
+
return utils.decodeEvents(events, this.__nativeContract, captcha);
|
|
18
|
+
}, [], __options);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* getAdmin
|
|
22
|
+
*
|
|
23
|
+
*/
|
|
24
|
+
getAdmin(__options) {
|
|
25
|
+
return typechainTypes.txSignAndSend(this.__apiPromise, this.__nativeContract, this.__keyringPair, "getAdmin", (events) => {
|
|
26
|
+
return utils.decodeEvents(events, this.__nativeContract, captcha);
|
|
27
|
+
}, [], __options);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* getPayees
|
|
31
|
+
*
|
|
32
|
+
*/
|
|
33
|
+
getPayees(__options) {
|
|
34
|
+
return typechainTypes.txSignAndSend(this.__apiPromise, this.__nativeContract, this.__keyringPair, "getPayees", (events) => {
|
|
35
|
+
return utils.decodeEvents(events, this.__nativeContract, captcha);
|
|
36
|
+
}, [], __options);
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* getDappPayees
|
|
40
|
+
*
|
|
41
|
+
*/
|
|
42
|
+
getDappPayees(__options) {
|
|
43
|
+
return typechainTypes.txSignAndSend(this.__apiPromise, this.__nativeContract, this.__keyringPair, "getDappPayees", (events) => {
|
|
44
|
+
return utils.decodeEvents(events, this.__nativeContract, captcha);
|
|
45
|
+
}, [], __options);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* getStatuses
|
|
49
|
+
*
|
|
50
|
+
*/
|
|
51
|
+
getStatuses(__options) {
|
|
52
|
+
return typechainTypes.txSignAndSend(this.__apiPromise, this.__nativeContract, this.__keyringPair, "getStatuses", (events) => {
|
|
53
|
+
return utils.decodeEvents(events, this.__nativeContract, captcha);
|
|
54
|
+
}, [], __options);
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* getProviderStakeThreshold
|
|
58
|
+
*
|
|
59
|
+
*/
|
|
60
|
+
getProviderStakeThreshold(__options) {
|
|
61
|
+
return typechainTypes.txSignAndSend(this.__apiPromise, this.__nativeContract, this.__keyringPair, "getProviderStakeThreshold", (events) => {
|
|
62
|
+
return utils.decodeEvents(events, this.__nativeContract, captcha);
|
|
63
|
+
}, [], __options);
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* getDappStakeThreshold
|
|
67
|
+
*
|
|
68
|
+
*/
|
|
69
|
+
getDappStakeThreshold(__options) {
|
|
70
|
+
return typechainTypes.txSignAndSend(this.__apiPromise, this.__nativeContract, this.__keyringPair, "getDappStakeThreshold", (events) => {
|
|
71
|
+
return utils.decodeEvents(events, this.__nativeContract, captcha);
|
|
72
|
+
}, [], __options);
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* getMaxProviderFee
|
|
76
|
+
*
|
|
77
|
+
*/
|
|
78
|
+
getMaxProviderFee(__options) {
|
|
79
|
+
return typechainTypes.txSignAndSend(this.__apiPromise, this.__nativeContract, this.__keyringPair, "getMaxProviderFee", (events) => {
|
|
80
|
+
return utils.decodeEvents(events, this.__nativeContract, captcha);
|
|
81
|
+
}, [], __options);
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* getMinNumActiveProviders
|
|
85
|
+
*
|
|
86
|
+
*/
|
|
87
|
+
getMinNumActiveProviders(__options) {
|
|
88
|
+
return typechainTypes.txSignAndSend(this.__apiPromise, this.__nativeContract, this.__keyringPair, "getMinNumActiveProviders", (events) => {
|
|
89
|
+
return utils.decodeEvents(events, this.__nativeContract, captcha);
|
|
90
|
+
}, [], __options);
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* getBlockTime
|
|
94
|
+
*
|
|
95
|
+
*/
|
|
96
|
+
getBlockTime(__options) {
|
|
97
|
+
return typechainTypes.txSignAndSend(this.__apiPromise, this.__nativeContract, this.__keyringPair, "getBlockTime", (events) => {
|
|
98
|
+
return utils.decodeEvents(events, this.__nativeContract, captcha);
|
|
99
|
+
}, [], __options);
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* getMaxUserHistoryAgeSeconds
|
|
103
|
+
*
|
|
104
|
+
*/
|
|
105
|
+
getMaxUserHistoryAgeSeconds(__options) {
|
|
106
|
+
return typechainTypes.txSignAndSend(this.__apiPromise, this.__nativeContract, this.__keyringPair, "getMaxUserHistoryAgeSeconds", (events) => {
|
|
107
|
+
return utils.decodeEvents(events, this.__nativeContract, captcha);
|
|
108
|
+
}, [], __options);
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* getMaxUserHistoryLen
|
|
112
|
+
*
|
|
113
|
+
*/
|
|
114
|
+
getMaxUserHistoryLen(__options) {
|
|
115
|
+
return typechainTypes.txSignAndSend(this.__apiPromise, this.__nativeContract, this.__keyringPair, "getMaxUserHistoryLen", (events) => {
|
|
116
|
+
return utils.decodeEvents(events, this.__nativeContract, captcha);
|
|
117
|
+
}, [], __options);
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* getMaxUserHistoryAgeBlocks
|
|
121
|
+
*
|
|
122
|
+
*/
|
|
123
|
+
getMaxUserHistoryAgeBlocks(__options) {
|
|
124
|
+
return typechainTypes.txSignAndSend(this.__apiPromise, this.__nativeContract, this.__keyringPair, "getMaxUserHistoryAgeBlocks", (events) => {
|
|
125
|
+
return utils.decodeEvents(events, this.__nativeContract, captcha);
|
|
126
|
+
}, [], __options);
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* providerRegister
|
|
130
|
+
*
|
|
131
|
+
* @param { Array<(number | string | BN)> } url,
|
|
132
|
+
* @param { (number | string | BN) } fee,
|
|
133
|
+
* @param { ArgumentTypes.Payee } payee,
|
|
134
|
+
*/
|
|
135
|
+
providerRegister(url, fee, payee, __options) {
|
|
136
|
+
return typechainTypes.txSignAndSend(this.__apiPromise, this.__nativeContract, this.__keyringPair, "providerRegister", (events) => {
|
|
137
|
+
return utils.decodeEvents(events, this.__nativeContract, captcha);
|
|
138
|
+
}, [url, fee, payee], __options);
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* providerUpdate
|
|
142
|
+
*
|
|
143
|
+
* @param { Array<(number | string | BN)> } url,
|
|
144
|
+
* @param { (number | string | BN) } fee,
|
|
145
|
+
* @param { ArgumentTypes.Payee } payee,
|
|
146
|
+
*/
|
|
147
|
+
providerUpdate(url, fee, payee, __options) {
|
|
148
|
+
return typechainTypes.txSignAndSend(this.__apiPromise, this.__nativeContract, this.__keyringPair, "providerUpdate", (events) => {
|
|
149
|
+
return utils.decodeEvents(events, this.__nativeContract, captcha);
|
|
150
|
+
}, [url, fee, payee], __options);
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* providerDeactivate
|
|
154
|
+
*
|
|
155
|
+
*/
|
|
156
|
+
providerDeactivate(__options) {
|
|
157
|
+
return typechainTypes.txSignAndSend(this.__apiPromise, this.__nativeContract, this.__keyringPair, "providerDeactivate", (events) => {
|
|
158
|
+
return utils.decodeEvents(events, this.__nativeContract, captcha);
|
|
159
|
+
}, [], __options);
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* providerDeregister
|
|
163
|
+
*
|
|
164
|
+
*/
|
|
165
|
+
providerDeregister(__options) {
|
|
166
|
+
return typechainTypes.txSignAndSend(this.__apiPromise, this.__nativeContract, this.__keyringPair, "providerDeregister", (events) => {
|
|
167
|
+
return utils.decodeEvents(events, this.__nativeContract, captcha);
|
|
168
|
+
}, [], __options);
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* getProvider
|
|
172
|
+
*
|
|
173
|
+
* @param { ArgumentTypes.AccountId } account,
|
|
174
|
+
*/
|
|
175
|
+
getProvider(account, __options) {
|
|
176
|
+
return typechainTypes.txSignAndSend(this.__apiPromise, this.__nativeContract, this.__keyringPair, "getProvider", (events) => {
|
|
177
|
+
return utils.decodeEvents(events, this.__nativeContract, captcha);
|
|
178
|
+
}, [account], __options);
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* providerFund
|
|
182
|
+
*
|
|
183
|
+
*/
|
|
184
|
+
providerFund(__options) {
|
|
185
|
+
return typechainTypes.txSignAndSend(this.__apiPromise, this.__nativeContract, this.__keyringPair, "providerFund", (events) => {
|
|
186
|
+
return utils.decodeEvents(events, this.__nativeContract, captcha);
|
|
187
|
+
}, [], __options);
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* providerSetDataset
|
|
191
|
+
*
|
|
192
|
+
* @param { ArgumentTypes.Hash } datasetId,
|
|
193
|
+
* @param { ArgumentTypes.Hash } datasetIdContent,
|
|
194
|
+
*/
|
|
195
|
+
providerSetDataset(datasetId, datasetIdContent, __options) {
|
|
196
|
+
return typechainTypes.txSignAndSend(this.__apiPromise, this.__nativeContract, this.__keyringPair, "providerSetDataset", (events) => {
|
|
197
|
+
return utils.decodeEvents(events, this.__nativeContract, captcha);
|
|
198
|
+
}, [datasetId, datasetIdContent], __options);
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* getDapp
|
|
202
|
+
*
|
|
203
|
+
* @param { ArgumentTypes.AccountId } contract,
|
|
204
|
+
*/
|
|
205
|
+
getDapp(contract, __options) {
|
|
206
|
+
return typechainTypes.txSignAndSend(this.__apiPromise, this.__nativeContract, this.__keyringPair, "getDapp", (events) => {
|
|
207
|
+
return utils.decodeEvents(events, this.__nativeContract, captcha);
|
|
208
|
+
}, [contract], __options);
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* dappRegister
|
|
212
|
+
*
|
|
213
|
+
* @param { ArgumentTypes.AccountId } contract,
|
|
214
|
+
* @param { ArgumentTypes.DappPayee } payee,
|
|
215
|
+
*/
|
|
216
|
+
dappRegister(contract, payee, __options) {
|
|
217
|
+
return typechainTypes.txSignAndSend(this.__apiPromise, this.__nativeContract, this.__keyringPair, "dappRegister", (events) => {
|
|
218
|
+
return utils.decodeEvents(events, this.__nativeContract, captcha);
|
|
219
|
+
}, [contract, payee], __options);
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* dappUpdate
|
|
223
|
+
*
|
|
224
|
+
* @param { ArgumentTypes.AccountId } contract,
|
|
225
|
+
* @param { ArgumentTypes.DappPayee } payee,
|
|
226
|
+
* @param { ArgumentTypes.AccountId } owner,
|
|
227
|
+
*/
|
|
228
|
+
dappUpdate(contract, payee, owner, __options) {
|
|
229
|
+
return typechainTypes.txSignAndSend(this.__apiPromise, this.__nativeContract, this.__keyringPair, "dappUpdate", (events) => {
|
|
230
|
+
return utils.decodeEvents(events, this.__nativeContract, captcha);
|
|
231
|
+
}, [contract, payee, owner], __options);
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* dappFund
|
|
235
|
+
*
|
|
236
|
+
* @param { ArgumentTypes.AccountId } contract,
|
|
237
|
+
*/
|
|
238
|
+
dappFund(contract, __options) {
|
|
239
|
+
return typechainTypes.txSignAndSend(this.__apiPromise, this.__nativeContract, this.__keyringPair, "dappFund", (events) => {
|
|
240
|
+
return utils.decodeEvents(events, this.__nativeContract, captcha);
|
|
241
|
+
}, [contract], __options);
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* dappDeregister
|
|
245
|
+
*
|
|
246
|
+
* @param { ArgumentTypes.AccountId } contract,
|
|
247
|
+
*/
|
|
248
|
+
dappDeregister(contract, __options) {
|
|
249
|
+
return typechainTypes.txSignAndSend(this.__apiPromise, this.__nativeContract, this.__keyringPair, "dappDeregister", (events) => {
|
|
250
|
+
return utils.decodeEvents(events, this.__nativeContract, captcha);
|
|
251
|
+
}, [contract], __options);
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* dappDeactivate
|
|
255
|
+
*
|
|
256
|
+
* @param { ArgumentTypes.AccountId } contract,
|
|
257
|
+
*/
|
|
258
|
+
dappDeactivate(contract, __options) {
|
|
259
|
+
return typechainTypes.txSignAndSend(this.__apiPromise, this.__nativeContract, this.__keyringPair, "dappDeactivate", (events) => {
|
|
260
|
+
return utils.decodeEvents(events, this.__nativeContract, captcha);
|
|
261
|
+
}, [contract], __options);
|
|
262
|
+
}
|
|
263
|
+
/**
|
|
264
|
+
* getUserHistorySummary
|
|
265
|
+
*
|
|
266
|
+
* @param { ArgumentTypes.AccountId } userAccount,
|
|
267
|
+
*/
|
|
268
|
+
getUserHistorySummary(userAccount, __options) {
|
|
269
|
+
return typechainTypes.txSignAndSend(this.__apiPromise, this.__nativeContract, this.__keyringPair, "getUserHistorySummary", (events) => {
|
|
270
|
+
return utils.decodeEvents(events, this.__nativeContract, captcha);
|
|
271
|
+
}, [userAccount], __options);
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* providerCommit
|
|
275
|
+
*
|
|
276
|
+
* @param { ArgumentTypes.Commit } commit,
|
|
277
|
+
*/
|
|
278
|
+
providerCommit(commit, __options) {
|
|
279
|
+
return typechainTypes.txSignAndSend(this.__apiPromise, this.__nativeContract, this.__keyringPair, "providerCommit", (events) => {
|
|
280
|
+
return utils.decodeEvents(events, this.__nativeContract, captcha);
|
|
281
|
+
}, [commit], __options);
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* providerCommitMany
|
|
285
|
+
*
|
|
286
|
+
* @param { Array<ArgumentTypes.Commit> } commits,
|
|
287
|
+
*/
|
|
288
|
+
providerCommitMany(commits, __options) {
|
|
289
|
+
return typechainTypes.txSignAndSend(this.__apiPromise, this.__nativeContract, this.__keyringPair, "providerCommitMany", (events) => {
|
|
290
|
+
return utils.decodeEvents(events, this.__nativeContract, captcha);
|
|
291
|
+
}, [commits], __options);
|
|
292
|
+
}
|
|
293
|
+
/**
|
|
294
|
+
* dappOperatorIsHumanUser
|
|
295
|
+
*
|
|
296
|
+
* @param { ArgumentTypes.AccountId } userAccount,
|
|
297
|
+
* @param { (number | string | BN) } threshold,
|
|
298
|
+
*/
|
|
299
|
+
dappOperatorIsHumanUser(userAccount, threshold, __options) {
|
|
300
|
+
return typechainTypes.txSignAndSend(this.__apiPromise, this.__nativeContract, this.__keyringPair, "dappOperatorIsHumanUser", (events) => {
|
|
301
|
+
return utils.decodeEvents(events, this.__nativeContract, captcha);
|
|
302
|
+
}, [userAccount, threshold], __options);
|
|
303
|
+
}
|
|
304
|
+
/**
|
|
305
|
+
* dappOperatorLastCorrectCaptcha
|
|
306
|
+
*
|
|
307
|
+
* @param { ArgumentTypes.AccountId } userAccount,
|
|
308
|
+
*/
|
|
309
|
+
dappOperatorLastCorrectCaptcha(userAccount, __options) {
|
|
310
|
+
return typechainTypes.txSignAndSend(this.__apiPromise, this.__nativeContract, this.__keyringPair, "dappOperatorLastCorrectCaptcha", (events) => {
|
|
311
|
+
return utils.decodeEvents(events, this.__nativeContract, captcha);
|
|
312
|
+
}, [userAccount], __options);
|
|
313
|
+
}
|
|
314
|
+
/**
|
|
315
|
+
* getCaptchaData
|
|
316
|
+
*
|
|
317
|
+
* @param { ArgumentTypes.Hash } datasetId,
|
|
318
|
+
*/
|
|
319
|
+
getCaptchaData(datasetId, __options) {
|
|
320
|
+
return typechainTypes.txSignAndSend(this.__apiPromise, this.__nativeContract, this.__keyringPair, "getCaptchaData", (events) => {
|
|
321
|
+
return utils.decodeEvents(events, this.__nativeContract, captcha);
|
|
322
|
+
}, [datasetId], __options);
|
|
323
|
+
}
|
|
324
|
+
/**
|
|
325
|
+
* getUser
|
|
326
|
+
*
|
|
327
|
+
* @param { ArgumentTypes.AccountId } userAccount,
|
|
328
|
+
*/
|
|
329
|
+
getUser(userAccount, __options) {
|
|
330
|
+
return typechainTypes.txSignAndSend(this.__apiPromise, this.__nativeContract, this.__keyringPair, "getUser", (events) => {
|
|
331
|
+
return utils.decodeEvents(events, this.__nativeContract, captcha);
|
|
332
|
+
}, [userAccount], __options);
|
|
333
|
+
}
|
|
334
|
+
/**
|
|
335
|
+
* getCommit
|
|
336
|
+
*
|
|
337
|
+
* @param { ArgumentTypes.Hash } commitId,
|
|
338
|
+
*/
|
|
339
|
+
getCommit(commitId, __options) {
|
|
340
|
+
return typechainTypes.txSignAndSend(this.__apiPromise, this.__nativeContract, this.__keyringPair, "getCommit", (events) => {
|
|
341
|
+
return utils.decodeEvents(events, this.__nativeContract, captcha);
|
|
342
|
+
}, [commitId], __options);
|
|
343
|
+
}
|
|
344
|
+
/**
|
|
345
|
+
* listProvidersByAccounts
|
|
346
|
+
*
|
|
347
|
+
* @param { Array<ArgumentTypes.AccountId> } providerAccounts,
|
|
348
|
+
*/
|
|
349
|
+
listProvidersByAccounts(providerAccounts, __options) {
|
|
350
|
+
return typechainTypes.txSignAndSend(this.__apiPromise, this.__nativeContract, this.__keyringPair, "listProvidersByAccounts", (events) => {
|
|
351
|
+
return utils.decodeEvents(events, this.__nativeContract, captcha);
|
|
352
|
+
}, [providerAccounts], __options);
|
|
353
|
+
}
|
|
354
|
+
/**
|
|
355
|
+
* listProvidersByStatus
|
|
356
|
+
*
|
|
357
|
+
* @param { Array<ArgumentTypes.GovernanceStatus> } statuses,
|
|
358
|
+
*/
|
|
359
|
+
listProvidersByStatus(statuses, __options) {
|
|
360
|
+
return typechainTypes.txSignAndSend(this.__apiPromise, this.__nativeContract, this.__keyringPair, "listProvidersByStatus", (events) => {
|
|
361
|
+
return utils.decodeEvents(events, this.__nativeContract, captcha);
|
|
362
|
+
}, [statuses], __options);
|
|
363
|
+
}
|
|
364
|
+
/**
|
|
365
|
+
* getRandomActiveProvider
|
|
366
|
+
*
|
|
367
|
+
* @param { ArgumentTypes.AccountId } userAccount,
|
|
368
|
+
* @param { ArgumentTypes.AccountId } dappContract,
|
|
369
|
+
*/
|
|
370
|
+
getRandomActiveProvider(userAccount, dappContract, __options) {
|
|
371
|
+
return typechainTypes.txSignAndSend(this.__apiPromise, this.__nativeContract, this.__keyringPair, "getRandomActiveProvider", (events) => {
|
|
372
|
+
return utils.decodeEvents(events, this.__nativeContract, captcha);
|
|
373
|
+
}, [userAccount, dappContract], __options);
|
|
374
|
+
}
|
|
375
|
+
/**
|
|
376
|
+
* getAllProviderAccounts
|
|
377
|
+
*
|
|
378
|
+
*/
|
|
379
|
+
getAllProviderAccounts(__options) {
|
|
380
|
+
return typechainTypes.txSignAndSend(this.__apiPromise, this.__nativeContract, this.__keyringPair, "getAllProviderAccounts", (events) => {
|
|
381
|
+
return utils.decodeEvents(events, this.__nativeContract, captcha);
|
|
382
|
+
}, [], __options);
|
|
383
|
+
}
|
|
384
|
+
/**
|
|
385
|
+
* getRandomNumber
|
|
386
|
+
*
|
|
387
|
+
* @param { (string | number | BN) } len,
|
|
388
|
+
* @param { ArgumentTypes.AccountId } userAccount,
|
|
389
|
+
* @param { ArgumentTypes.AccountId } dappContract,
|
|
390
|
+
*/
|
|
391
|
+
getRandomNumber(len, userAccount, dappContract, __options) {
|
|
392
|
+
return typechainTypes.txSignAndSend(this.__apiPromise, this.__nativeContract, this.__keyringPair, "getRandomNumber", (events) => {
|
|
393
|
+
return utils.decodeEvents(events, this.__nativeContract, captcha);
|
|
394
|
+
}, [len, userAccount, dappContract], __options);
|
|
395
|
+
}
|
|
396
|
+
/**
|
|
397
|
+
* terminate
|
|
398
|
+
*
|
|
399
|
+
*/
|
|
400
|
+
terminate(__options) {
|
|
401
|
+
return typechainTypes.txSignAndSend(this.__apiPromise, this.__nativeContract, this.__keyringPair, "terminate", (events) => {
|
|
402
|
+
return utils.decodeEvents(events, this.__nativeContract, captcha);
|
|
403
|
+
}, [], __options);
|
|
404
|
+
}
|
|
405
|
+
/**
|
|
406
|
+
* withdraw
|
|
407
|
+
*
|
|
408
|
+
* @param { (string | number | BN) } amount,
|
|
409
|
+
*/
|
|
410
|
+
withdraw(amount, __options) {
|
|
411
|
+
return typechainTypes.txSignAndSend(this.__apiPromise, this.__nativeContract, this.__keyringPair, "withdraw", (events) => {
|
|
412
|
+
return utils.decodeEvents(events, this.__nativeContract, captcha);
|
|
413
|
+
}, [amount], __options);
|
|
414
|
+
}
|
|
415
|
+
/**
|
|
416
|
+
* setCodeHash
|
|
417
|
+
*
|
|
418
|
+
* @param { Array<(number | string | BN)> } codeHash,
|
|
419
|
+
*/
|
|
420
|
+
setCodeHash(codeHash, __options) {
|
|
421
|
+
return typechainTypes.txSignAndSend(this.__apiPromise, this.__nativeContract, this.__keyringPair, "setCodeHash", (events) => {
|
|
422
|
+
return utils.decodeEvents(events, this.__nativeContract, captcha);
|
|
423
|
+
}, [codeHash], __options);
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
module.exports = Methods;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
exports.Error = void 0;
|
|
4
|
+
(function(Error) {
|
|
5
|
+
Error["notAuthorised"] = "NotAuthorised";
|
|
6
|
+
Error["transferFailed"] = "TransferFailed";
|
|
7
|
+
Error["setCodeHashFailed"] = "SetCodeHashFailed";
|
|
8
|
+
Error["invalidDestination"] = "InvalidDestination";
|
|
9
|
+
Error["unknownMessage"] = "UnknownMessage";
|
|
10
|
+
Error["providerAccountExists"] = "ProviderAccountExists";
|
|
11
|
+
Error["providerExists"] = "ProviderExists";
|
|
12
|
+
Error["providerAccountDoesNotExist"] = "ProviderAccountDoesNotExist";
|
|
13
|
+
Error["providerDoesNotExist"] = "ProviderDoesNotExist";
|
|
14
|
+
Error["providerInsufficientFunds"] = "ProviderInsufficientFunds";
|
|
15
|
+
Error["providerInactive"] = "ProviderInactive";
|
|
16
|
+
Error["providerUrlUsed"] = "ProviderUrlUsed";
|
|
17
|
+
Error["dappExists"] = "DappExists";
|
|
18
|
+
Error["dappDoesNotExist"] = "DappDoesNotExist";
|
|
19
|
+
Error["dappInactive"] = "DappInactive";
|
|
20
|
+
Error["dappInsufficientFunds"] = "DappInsufficientFunds";
|
|
21
|
+
Error["captchaDataDoesNotExist"] = "CaptchaDataDoesNotExist";
|
|
22
|
+
Error["commitDoesNotExist"] = "CommitDoesNotExist";
|
|
23
|
+
Error["dappUserDoesNotExist"] = "DappUserDoesNotExist";
|
|
24
|
+
Error["noActiveProviders"] = "NoActiveProviders";
|
|
25
|
+
Error["datasetIdSolutionsSame"] = "DatasetIdSolutionsSame";
|
|
26
|
+
Error["codeNotFound"] = "CodeNotFound";
|
|
27
|
+
Error["unknown"] = "Unknown";
|
|
28
|
+
Error["invalidContract"] = "InvalidContract";
|
|
29
|
+
Error["invalidPayee"] = "InvalidPayee";
|
|
30
|
+
Error["invalidCaptchaStatus"] = "InvalidCaptchaStatus";
|
|
31
|
+
Error["noCorrectCaptcha"] = "NoCorrectCaptcha";
|
|
32
|
+
Error["notEnoughActiveProviders"] = "NotEnoughActiveProviders";
|
|
33
|
+
Error["providerFeeTooHigh"] = "ProviderFeeTooHigh";
|
|
34
|
+
Error["commitAlreadyExists"] = "CommitAlreadyExists";
|
|
35
|
+
Error["notAuthor"] = "NotAuthor";
|
|
36
|
+
})(exports.Error || (exports.Error = {}));
|
|
37
|
+
exports.LangError = void 0;
|
|
38
|
+
(function(LangError) {
|
|
39
|
+
LangError["couldNotReadInput"] = "CouldNotReadInput";
|
|
40
|
+
})(exports.LangError || (exports.LangError = {}));
|
|
41
|
+
exports.Payee = void 0;
|
|
42
|
+
(function(Payee) {
|
|
43
|
+
Payee["provider"] = "Provider";
|
|
44
|
+
Payee["dapp"] = "Dapp";
|
|
45
|
+
})(exports.Payee || (exports.Payee = {}));
|
|
46
|
+
exports.DappPayee = void 0;
|
|
47
|
+
(function(DappPayee) {
|
|
48
|
+
DappPayee["provider"] = "Provider";
|
|
49
|
+
DappPayee["dapp"] = "Dapp";
|
|
50
|
+
DappPayee["any"] = "Any";
|
|
51
|
+
})(exports.DappPayee || (exports.DappPayee = {}));
|
|
52
|
+
exports.GovernanceStatus = void 0;
|
|
53
|
+
(function(GovernanceStatus) {
|
|
54
|
+
GovernanceStatus["active"] = "Active";
|
|
55
|
+
GovernanceStatus["inactive"] = "Inactive";
|
|
56
|
+
})(exports.GovernanceStatus || (exports.GovernanceStatus = {}));
|
|
57
|
+
exports.CaptchaStatus = void 0;
|
|
58
|
+
(function(CaptchaStatus) {
|
|
59
|
+
CaptchaStatus["pending"] = "Pending";
|
|
60
|
+
CaptchaStatus["approved"] = "Approved";
|
|
61
|
+
CaptchaStatus["disapproved"] = "Disapproved";
|
|
62
|
+
})(exports.CaptchaStatus || (exports.CaptchaStatus = {}));
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const types = require("@prosopo/types");
|
|
4
3
|
const common = require("@prosopo/common");
|
|
4
|
+
const types = require("@prosopo/types");
|
|
5
5
|
const typesDatabase = require("@prosopo/types-database");
|
|
6
|
+
require("../contracts/captcha/dist/index.cjs");
|
|
6
7
|
const mongodb = require("mongodb");
|
|
7
8
|
const util = require("@polkadot/util");
|
|
8
9
|
const mongoose = require("mongoose");
|
|
10
|
+
const captcha = require("../contracts/captcha/dist/types-arguments/captcha.cjs");
|
|
9
11
|
mongoose.set("strictQuery", false);
|
|
10
12
|
const DEFAULT_ENDPOINT = "mongodb://127.0.0.1:27017";
|
|
11
13
|
class ProsopoDatabase extends common.AsyncFactory {
|
|
@@ -92,8 +94,8 @@ class ProsopoDatabase extends common.AsyncFactory {
|
|
|
92
94
|
{ upsert: true }
|
|
93
95
|
));
|
|
94
96
|
this.logger.info("parsedDataset.captchas", parsedDataset.captchas);
|
|
95
|
-
const captchaDocs = parsedDataset.captchas.map(({ solution, ...
|
|
96
|
-
...
|
|
97
|
+
const captchaDocs = parsedDataset.captchas.map(({ solution, ...captcha2 }, index) => ({
|
|
98
|
+
...captcha2,
|
|
97
99
|
datasetId: parsedDataset.datasetId,
|
|
98
100
|
datasetContentId: parsedDataset.datasetContentId,
|
|
99
101
|
index,
|
|
@@ -111,11 +113,11 @@ class ProsopoDatabase extends common.AsyncFactory {
|
|
|
111
113
|
}))
|
|
112
114
|
));
|
|
113
115
|
}
|
|
114
|
-
const captchaSolutionDocs = parsedDataset.captchas.filter(({ solution }) => solution == null ? void 0 : solution.length).map((
|
|
115
|
-
captchaId:
|
|
116
|
-
captchaContentId:
|
|
117
|
-
solution:
|
|
118
|
-
salt:
|
|
116
|
+
const captchaSolutionDocs = parsedDataset.captchas.filter(({ solution }) => solution == null ? void 0 : solution.length).map((captcha2) => ({
|
|
117
|
+
captchaId: captcha2.captchaId,
|
|
118
|
+
captchaContentId: captcha2.captchaContentId,
|
|
119
|
+
solution: captcha2.solution,
|
|
120
|
+
salt: captcha2.salt,
|
|
119
121
|
datasetId: parsedDataset.datasetId,
|
|
120
122
|
datasetContentId: parsedDataset.datasetContentId
|
|
121
123
|
}));
|
|
@@ -232,13 +234,13 @@ class ProsopoDatabase extends common.AsyncFactory {
|
|
|
232
234
|
* @param {Captcha} captcha
|
|
233
235
|
* @param {string} datasetId the id of the data set
|
|
234
236
|
*/
|
|
235
|
-
async updateCaptcha(
|
|
237
|
+
async updateCaptcha(captcha2, datasetId) {
|
|
236
238
|
var _a;
|
|
237
239
|
if (!util.isHex(datasetId)) {
|
|
238
240
|
throw new common.ProsopoEnvError("DATABASE.INVALID_HASH", this.updateCaptcha.name, {}, datasetId);
|
|
239
241
|
}
|
|
240
242
|
try {
|
|
241
|
-
await ((_a = this.tables) == null ? void 0 : _a.captcha.updateOne({ datasetId }, { $set:
|
|
243
|
+
await ((_a = this.tables) == null ? void 0 : _a.captcha.updateOne({ datasetId }, { $set: captcha2 }, { upsert: false }));
|
|
242
244
|
} catch (err) {
|
|
243
245
|
throw new common.ProsopoEnvError(err);
|
|
244
246
|
}
|
|
@@ -278,15 +280,15 @@ class ProsopoDatabase extends common.AsyncFactory {
|
|
|
278
280
|
commitmentRecord,
|
|
279
281
|
{ upsert: true }
|
|
280
282
|
));
|
|
281
|
-
const ops = captchas.map((
|
|
283
|
+
const ops = captchas.map((captcha2) => ({
|
|
282
284
|
updateOne: {
|
|
283
|
-
filter: { commitmentId: commit.id, captchaId:
|
|
285
|
+
filter: { commitmentId: commit.id, captchaId: captcha2.captchaId },
|
|
284
286
|
update: {
|
|
285
287
|
$set: {
|
|
286
|
-
captchaId:
|
|
287
|
-
captchaContentId:
|
|
288
|
-
salt:
|
|
289
|
-
solution:
|
|
288
|
+
captchaId: captcha2.captchaId,
|
|
289
|
+
captchaContentId: captcha2.captchaContentId,
|
|
290
|
+
salt: captcha2.salt,
|
|
291
|
+
solution: captcha2.solution,
|
|
290
292
|
commitmentId: commit.id,
|
|
291
293
|
processed: false
|
|
292
294
|
}
|
|
@@ -518,7 +520,7 @@ class ProsopoDatabase extends common.AsyncFactory {
|
|
|
518
520
|
try {
|
|
519
521
|
await ((_b = (_a = this.tables) == null ? void 0 : _a.commitment) == null ? void 0 : _b.findOneAndUpdate(
|
|
520
522
|
{ id: commitmentId },
|
|
521
|
-
{ $set: { status:
|
|
523
|
+
{ $set: { status: captcha.CaptchaStatus.approved } },
|
|
522
524
|
{ upsert: false }
|
|
523
525
|
).lean());
|
|
524
526
|
} catch (err) {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/// <reference types="mongoose/types/connection.js" />
|
|
2
|
-
import { ArgumentTypes, Captcha, CaptchaSolution, CaptchaStates, DatasetBase, DatasetWithIds, DatasetWithIdsAndTree, PendingCaptchaRequest, ScheduledTaskNames, ScheduledTaskResult, ScheduledTaskStatus } from '@prosopo/types';
|
|
3
2
|
import { AsyncFactory, Logger } from '@prosopo/common';
|
|
3
|
+
import { Captcha, CaptchaSolution, CaptchaStates, DatasetBase, DatasetWithIds, DatasetWithIdsAndTree, PendingCaptchaRequest, ScheduledTaskNames, ScheduledTaskResult, ScheduledTaskStatus } from '@prosopo/types';
|
|
4
4
|
import { Database, ScheduledTaskRecord, Tables, UserCommitmentRecord, UserSolutionRecord } from '@prosopo/types-database';
|
|
5
|
+
import { Hash } from '@prosopo/captcha-contract';
|
|
5
6
|
import { DeleteResult } from 'mongodb';
|
|
6
7
|
import { Connection } from 'mongoose';
|
|
7
8
|
/**
|
|
@@ -39,7 +40,7 @@ export declare class ProsopoDatabase extends AsyncFactory implements Database {
|
|
|
39
40
|
* @param {string} datasetId the id of the data set
|
|
40
41
|
* @param {number} size the number of records to be returned
|
|
41
42
|
*/
|
|
42
|
-
getRandomCaptcha(solved: boolean, datasetId:
|
|
43
|
+
getRandomCaptcha(solved: boolean, datasetId: Hash, size?: number): Promise<Captcha[] | undefined>;
|
|
43
44
|
/**
|
|
44
45
|
* @description Get captchas by id
|
|
45
46
|
* @param {string[]} captchaId
|
|
@@ -50,7 +51,7 @@ export declare class ProsopoDatabase extends AsyncFactory implements Database {
|
|
|
50
51
|
* @param {Captcha} captcha
|
|
51
52
|
* @param {string} datasetId the id of the data set
|
|
52
53
|
*/
|
|
53
|
-
updateCaptcha(captcha: Captcha, datasetId:
|
|
54
|
+
updateCaptcha(captcha: Captcha, datasetId: Hash): Promise<void>;
|
|
54
55
|
/**
|
|
55
56
|
* @description Remove captchas
|
|
56
57
|
*/
|
|
@@ -58,7 +59,7 @@ export declare class ProsopoDatabase extends AsyncFactory implements Database {
|
|
|
58
59
|
/**
|
|
59
60
|
* @description Get a dataset by Id
|
|
60
61
|
*/
|
|
61
|
-
getDatasetDetails(datasetId:
|
|
62
|
+
getDatasetDetails(datasetId: Hash): Promise<DatasetBase>;
|
|
62
63
|
/**
|
|
63
64
|
* @description Store a Dapp User's captcha solution commitment
|
|
64
65
|
*/
|
|
@@ -127,17 +128,17 @@ export declare class ProsopoDatabase extends AsyncFactory implements Database {
|
|
|
127
128
|
* @description Flag a dapp user's solutions as used by calculated solution
|
|
128
129
|
* @param {string[]} captchaIds
|
|
129
130
|
*/
|
|
130
|
-
flagProcessedDappUserSolutions(captchaIds:
|
|
131
|
+
flagProcessedDappUserSolutions(captchaIds: Hash[]): Promise<void>;
|
|
131
132
|
/**
|
|
132
133
|
* @description Flag dapp users' commitments as used by calculated solution
|
|
133
134
|
* @param {string[]} commitmentIds
|
|
134
135
|
*/
|
|
135
|
-
flagProcessedDappUserCommitments(commitmentIds:
|
|
136
|
+
flagProcessedDappUserCommitments(commitmentIds: Hash[]): Promise<void>;
|
|
136
137
|
/**
|
|
137
138
|
* @description Flag dapp users' commitments as used by calculated solution
|
|
138
139
|
* @param {string[]} commitmentIds
|
|
139
140
|
*/
|
|
140
|
-
flagBatchedDappUserCommitments(commitmentIds:
|
|
141
|
+
flagBatchedDappUserCommitments(commitmentIds: Hash[]): Promise<void>;
|
|
141
142
|
/**
|
|
142
143
|
* @description Get the last batch commit time or return 0 if none
|
|
143
144
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mongo.d.ts","sourceRoot":"","sources":["../../src/databases/mongo.ts"],"names":[],"mappings":";AAcA,OAAO,
|
|
1
|
+
{"version":3,"file":"mongo.d.ts","sourceRoot":"","sources":["../../src/databases/mongo.ts"],"names":[],"mappings":"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"}
|
package/dist/databases/mongo.js
CHANGED
|
@@ -12,9 +12,10 @@
|
|
|
12
12
|
// See the License for the specific language governing permissions and
|
|
13
13
|
// limitations under the License.
|
|
14
14
|
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
|
15
|
-
import { CaptchaStates, CaptchaStatus, DatasetWithIdsAndTreeSchema, ScheduledTaskNames, ScheduledTaskStatus, } from '@prosopo/types';
|
|
16
15
|
import { AsyncFactory, ProsopoEnvError, getLoggerDefault } from '@prosopo/common';
|
|
16
|
+
import { CaptchaStates, DatasetWithIdsAndTreeSchema, ScheduledTaskNames, ScheduledTaskStatus, } from '@prosopo/types';
|
|
17
17
|
import { CaptchaRecordSchema, DatasetRecordSchema, PendingRecordSchema, ScheduledTaskRecordSchema, ScheduledTaskSchema, SolutionRecordSchema, UserCommitmentRecordSchema, UserCommitmentSchema, UserSolutionRecordSchema, UserSolutionSchema, } from '@prosopo/types-database';
|
|
18
|
+
import { CaptchaStatus } from '@prosopo/captcha-contract';
|
|
18
19
|
import { ServerApiVersion } from 'mongodb';
|
|
19
20
|
import { isHex } from '@polkadot/util';
|
|
20
21
|
import mongoose from 'mongoose';
|