@prosopo/cli 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/README.md +120 -0
- package/dist/cjs/commands/dappRegister.cjs +3 -2
- package/dist/cjs/commands/dappUpdate.cjs +3 -2
- package/dist/cjs/commands/providerRegister.cjs +3 -2
- package/dist/cjs/commands/providerUpdate.cjs +3 -2
- 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/env.cjs +1 -1
- package/dist/commands/dappRegister.d.ts +2 -2
- package/dist/commands/dappRegister.d.ts.map +1 -1
- package/dist/commands/dappRegister.js +1 -1
- package/dist/commands/dappRegister.js.map +1 -1
- package/dist/commands/dappUpdate.d.ts +2 -2
- package/dist/commands/dappUpdate.d.ts.map +1 -1
- package/dist/commands/dappUpdate.js +1 -1
- package/dist/commands/dappUpdate.js.map +1 -1
- package/dist/commands/providerRegister.d.ts.map +1 -1
- package/dist/commands/providerRegister.js +1 -1
- package/dist/commands/providerRegister.js.map +1 -1
- package/dist/commands/providerUpdate.d.ts +2 -1
- package/dist/commands/providerUpdate.d.ts.map +1 -1
- package/dist/commands/providerUpdate.js +1 -1
- package/dist/commands/providerUpdate.js.map +1 -1
- package/dist/commands/validators.d.ts +1 -1
- package/dist/env.js +1 -1
- package/dist/env.js.map +1 -1
- package/package.json +14 -10
package/README.md
ADDED
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
# Prosopo Provider Command Line Interface
|
|
2
|
+
|
|
3
|
+
The Provier CLI allows you to set up a Provider instance and begin to serve CAPTCHA challenges to the Prosopo Network.
|
|
4
|
+
This will allow you to obtain valuable human-labelled image data. As we are currently in beta testing, the CLI is **only
|
|
5
|
+
useable for development purposes**.
|
|
6
|
+
|
|
7
|
+
The Provider CLI is intended to be used from within the Prosopo Provider Container Image. It is not intended to be used
|
|
8
|
+
directly from the host machine. A bundled version of the CLI is available in the Provider Container Image.
|
|
9
|
+
|
|
10
|
+
## Container Image
|
|
11
|
+
|
|
12
|
+
### Get the Container ID
|
|
13
|
+
|
|
14
|
+
To execute commands against the running Provider, you must first get the Container ID of the running Provider Container.
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
$ PROVIDER_CONTAINER = docker ps -q -f name=docker-provider
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
### Execute a command inside the provider container
|
|
21
|
+
|
|
22
|
+
You can then execute the commands as follows:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
$ docker exec -it $PROVIDER_CONTAINER bash -c "npx provider <command>"
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Executing Commands in the Container
|
|
29
|
+
|
|
30
|
+
### Register your Provider
|
|
31
|
+
|
|
32
|
+
You must first register your Provider in the network contract in order to be selected as a CAPTCHA Provider.
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
$ npx provider provider_register --url https://YOUR_URL --fee 0 --payee Dapp
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Fund your Provider
|
|
39
|
+
|
|
40
|
+
It is necessary to fund your Provider with at least the minimum fee amount in order to serve CAPTCHA challenges. The
|
|
41
|
+
funds are used to incentivise good behaviour by Providers.
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
$ npx provider provider_update --value 1000 --address YOUR_ADDRESS
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### Set a new Dataset
|
|
48
|
+
|
|
49
|
+
You must load a dataset in to your database in order to provider CAPTCHA challenges. The dataset contains the CAPTCHA
|
|
50
|
+
challenges that will be served to users. The format for the dataset is
|
|
51
|
+
defined [here](https://github.com/prosopo/captcha/blob/main/packages/types/src/datasets/dataset.ts) and an example
|
|
52
|
+
dataset can be seen [here](https://github.com/prosopo/captcha/blob/main/dev/data/captchas.json).
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
$ npx provider provider_set_data_set --file /path/to/dataset.json
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Start the API
|
|
59
|
+
|
|
60
|
+
Start the API and a begin to serve CAPTCHA challenges.
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
$ npx provider start
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Deregister your Provider
|
|
67
|
+
|
|
68
|
+
When you no longer wish to be part of the Prosopo Network, you can stop serving CAPTCHA challenges by deregistering.
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
$ npx provider provider_deregister
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### List details of a single Provider
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
$ npx provider provider_details --address PROVIDER_ADDRESS
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Get a list of provider accounts from the contract
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
$ npx provider provider_accounts
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### View the Provider Version
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
$ npx provider version
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## Full CLI Usage
|
|
93
|
+
|
|
94
|
+
`--help` output from the CLI.
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
Usage: cli.js [global options] <command> [options]
|
|
98
|
+
|
|
99
|
+
Commands:
|
|
100
|
+
cli.js provider_register Register a Provider
|
|
101
|
+
cli.js provider_update Update a Provider
|
|
102
|
+
cli.js provider_deregister Deregister a Provider
|
|
103
|
+
cli.js provider_set_data_set Add a dataset as a Provider
|
|
104
|
+
cli.js dapp_register Register a Dapp
|
|
105
|
+
cli.js dapp_update Register a Dapp
|
|
106
|
+
cli.js provider_accounts List all provider accounts
|
|
107
|
+
cli.js dapp_accounts List all dapp accounts
|
|
108
|
+
cli.js provider_details List details of a single Provider
|
|
109
|
+
cli.js provider_dataset Exports a dataset from the provider database
|
|
110
|
+
cli.js dapp_details List details of a single Dapp
|
|
111
|
+
cli.js calculate_captcha_solutions Calculate captcha solutions
|
|
112
|
+
cli.js batch_commit Batch commit user solutions to contract
|
|
113
|
+
cli.js version Return the version of the software
|
|
114
|
+
|
|
115
|
+
Options:
|
|
116
|
+
--help Show help [boolean]
|
|
117
|
+
--version Show version number [boolean]
|
|
118
|
+
--api [boolean] [default: false]
|
|
119
|
+
|
|
120
|
+
```
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
2
|
+
require("../contracts/captcha/dist/index.cjs");
|
|
3
3
|
const common = require("@prosopo/common");
|
|
4
4
|
const env = require("@prosopo/env");
|
|
5
5
|
const provider = require("@prosopo/provider");
|
|
@@ -7,6 +7,7 @@ const util = require("@prosopo/util");
|
|
|
7
7
|
const validators = require("./validators.cjs");
|
|
8
8
|
const contract = require("@prosopo/contract");
|
|
9
9
|
const z = require("zod");
|
|
10
|
+
const captcha = require("../contracts/captcha/dist/types-arguments/captcha.cjs");
|
|
10
11
|
const commandDappRegister = (pair, config, cmdArgs) => {
|
|
11
12
|
const logger = (cmdArgs == null ? void 0 : cmdArgs.logger) || common.getLogger(common.LogLevel.enum.info, "cli.dapp_register");
|
|
12
13
|
return {
|
|
@@ -28,7 +29,7 @@ const commandDappRegister = (pair, config, cmdArgs) => {
|
|
|
28
29
|
const tasks = new provider.Tasks(env$1);
|
|
29
30
|
const dappRegisterArgs = [
|
|
30
31
|
z.z.string().parse(argv.contract),
|
|
31
|
-
util.get(
|
|
32
|
+
util.get(captcha.DappPayee, z.z.string().parse(argv.payee)),
|
|
32
33
|
{
|
|
33
34
|
value: 0
|
|
34
35
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
2
|
+
require("../contracts/captcha/dist/index.cjs");
|
|
3
3
|
const common = require("@prosopo/common");
|
|
4
4
|
const env = require("@prosopo/env");
|
|
5
5
|
const provider = require("@prosopo/provider");
|
|
@@ -7,6 +7,7 @@ const util = require("@prosopo/util");
|
|
|
7
7
|
const validators = require("./validators.cjs");
|
|
8
8
|
const contract = require("@prosopo/contract");
|
|
9
9
|
const z = require("zod");
|
|
10
|
+
const captcha = require("../contracts/captcha/dist/types-arguments/captcha.cjs");
|
|
10
11
|
const commandDappUpdate = (pair, config, cmdArgs) => {
|
|
11
12
|
const logger = (cmdArgs == null ? void 0 : cmdArgs.logger) || common.getLogger(common.LogLevel.enum.info, "cli.dapp_update");
|
|
12
13
|
return {
|
|
@@ -29,7 +30,7 @@ const commandDappUpdate = (pair, config, cmdArgs) => {
|
|
|
29
30
|
const stakeThreshold = (await tasks.contract.query.getDappStakeThreshold({})).value.unwrap();
|
|
30
31
|
const dappRegisterArgs = [
|
|
31
32
|
z.z.string().parse(argv.contract),
|
|
32
|
-
util.get(
|
|
33
|
+
util.get(captcha.DappPayee, z.z.string().parse(argv.payee)),
|
|
33
34
|
z.z.string().parse(argv.owner),
|
|
34
35
|
{
|
|
35
36
|
value: stakeThreshold.toNumber()
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const z = require("zod");
|
|
3
3
|
const common = require("@prosopo/common");
|
|
4
|
-
|
|
4
|
+
require("../contracts/captcha/dist/index.cjs");
|
|
5
5
|
const env = require("@prosopo/env");
|
|
6
6
|
const provider = require("@prosopo/provider");
|
|
7
7
|
const util = require("@polkadot/util");
|
|
8
8
|
const validators = require("./validators.cjs");
|
|
9
9
|
const contract = require("@prosopo/contract");
|
|
10
|
+
const captcha = require("../contracts/captcha/dist/types-arguments/captcha.cjs");
|
|
10
11
|
function _interopNamespaceDefault(e) {
|
|
11
12
|
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
12
13
|
if (e) {
|
|
@@ -27,7 +28,7 @@ const z__namespace = /* @__PURE__ */ _interopNamespaceDefault(z);
|
|
|
27
28
|
const providerRegisterArgsParser = z__namespace.object({
|
|
28
29
|
url: z__namespace.string(),
|
|
29
30
|
fee: z__namespace.number(),
|
|
30
|
-
payee: z__namespace.nativeEnum(
|
|
31
|
+
payee: z__namespace.nativeEnum(captcha.Payee)
|
|
31
32
|
});
|
|
32
33
|
const commandProviderRegister = (pair, config, cmdArgs) => {
|
|
33
34
|
const logger = (cmdArgs == null ? void 0 : cmdArgs.logger) || common.getLogger(common.LogLevel.enum.info, "cli.provider_register");
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const common = require("@prosopo/common");
|
|
3
|
-
|
|
3
|
+
require("../contracts/captcha/dist/index.cjs");
|
|
4
4
|
const env = require("@prosopo/env");
|
|
5
5
|
const provider = require("@prosopo/provider");
|
|
6
6
|
const validators = require("./validators.cjs");
|
|
7
7
|
const contract = require("@prosopo/contract");
|
|
8
8
|
const z = require("zod");
|
|
9
|
+
const captcha = require("../contracts/captcha/dist/types-arguments/captcha.cjs");
|
|
9
10
|
const commandProviderUpdate = (pair, config, cmdArgs) => {
|
|
10
11
|
const logger = (cmdArgs == null ? void 0 : cmdArgs.logger) || common.getLogger(common.LogLevel.enum.info, "cli.provider_update");
|
|
11
12
|
return {
|
|
@@ -36,7 +37,7 @@ const commandProviderUpdate = (pair, config, cmdArgs) => {
|
|
|
36
37
|
const { url, fee, payee, value, address } = z.z.object({
|
|
37
38
|
url: z.z.string().optional(),
|
|
38
39
|
fee: z.z.number().optional(),
|
|
39
|
-
payee: z.z.nativeEnum(
|
|
40
|
+
payee: z.z.nativeEnum(captcha.Payee).optional(),
|
|
40
41
|
value: z.z.number().optional(),
|
|
41
42
|
address: z.z.string()
|
|
42
43
|
}).parse(argv);
|
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const typechainTypes = require("@727-ventures/typechain-types");
|
|
3
|
+
class Methods {
|
|
4
|
+
constructor(nativeContract, apiPromise) {
|
|
5
|
+
this.__nativeContract = nativeContract;
|
|
6
|
+
this.__apiPromise = apiPromise;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* getGitCommitId
|
|
10
|
+
*
|
|
11
|
+
*/
|
|
12
|
+
getGitCommitId(__options) {
|
|
13
|
+
return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "getGitCommitId", [], __options);
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* getAdmin
|
|
17
|
+
*
|
|
18
|
+
*/
|
|
19
|
+
getAdmin(__options) {
|
|
20
|
+
return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "getAdmin", [], __options);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* getPayees
|
|
24
|
+
*
|
|
25
|
+
*/
|
|
26
|
+
getPayees(__options) {
|
|
27
|
+
return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "getPayees", [], __options);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* getDappPayees
|
|
31
|
+
*
|
|
32
|
+
*/
|
|
33
|
+
getDappPayees(__options) {
|
|
34
|
+
return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "getDappPayees", [], __options);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* getStatuses
|
|
38
|
+
*
|
|
39
|
+
*/
|
|
40
|
+
getStatuses(__options) {
|
|
41
|
+
return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "getStatuses", [], __options);
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* getProviderStakeThreshold
|
|
45
|
+
*
|
|
46
|
+
*/
|
|
47
|
+
getProviderStakeThreshold(__options) {
|
|
48
|
+
return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "getProviderStakeThreshold", [], __options);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* getDappStakeThreshold
|
|
52
|
+
*
|
|
53
|
+
*/
|
|
54
|
+
getDappStakeThreshold(__options) {
|
|
55
|
+
return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "getDappStakeThreshold", [], __options);
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* getMaxProviderFee
|
|
59
|
+
*
|
|
60
|
+
*/
|
|
61
|
+
getMaxProviderFee(__options) {
|
|
62
|
+
return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "getMaxProviderFee", [], __options);
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* getMinNumActiveProviders
|
|
66
|
+
*
|
|
67
|
+
*/
|
|
68
|
+
getMinNumActiveProviders(__options) {
|
|
69
|
+
return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "getMinNumActiveProviders", [], __options);
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* getBlockTime
|
|
73
|
+
*
|
|
74
|
+
*/
|
|
75
|
+
getBlockTime(__options) {
|
|
76
|
+
return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "getBlockTime", [], __options);
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* getMaxUserHistoryAgeSeconds
|
|
80
|
+
*
|
|
81
|
+
*/
|
|
82
|
+
getMaxUserHistoryAgeSeconds(__options) {
|
|
83
|
+
return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "getMaxUserHistoryAgeSeconds", [], __options);
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* getMaxUserHistoryLen
|
|
87
|
+
*
|
|
88
|
+
*/
|
|
89
|
+
getMaxUserHistoryLen(__options) {
|
|
90
|
+
return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "getMaxUserHistoryLen", [], __options);
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* getMaxUserHistoryAgeBlocks
|
|
94
|
+
*
|
|
95
|
+
*/
|
|
96
|
+
getMaxUserHistoryAgeBlocks(__options) {
|
|
97
|
+
return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "getMaxUserHistoryAgeBlocks", [], __options);
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* providerRegister
|
|
101
|
+
*
|
|
102
|
+
* @param { Array<(number | string | BN)> } url,
|
|
103
|
+
* @param { (number | string | BN) } fee,
|
|
104
|
+
* @param { ArgumentTypes.Payee } payee,
|
|
105
|
+
*/
|
|
106
|
+
providerRegister(url, fee, payee, __options) {
|
|
107
|
+
return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "providerRegister", [url, fee, payee], __options);
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* providerUpdate
|
|
111
|
+
*
|
|
112
|
+
* @param { Array<(number | string | BN)> } url,
|
|
113
|
+
* @param { (number | string | BN) } fee,
|
|
114
|
+
* @param { ArgumentTypes.Payee } payee,
|
|
115
|
+
*/
|
|
116
|
+
providerUpdate(url, fee, payee, __options) {
|
|
117
|
+
return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "providerUpdate", [url, fee, payee], __options);
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* providerDeactivate
|
|
121
|
+
*
|
|
122
|
+
*/
|
|
123
|
+
providerDeactivate(__options) {
|
|
124
|
+
return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "providerDeactivate", [], __options);
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* providerDeregister
|
|
128
|
+
*
|
|
129
|
+
*/
|
|
130
|
+
providerDeregister(__options) {
|
|
131
|
+
return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "providerDeregister", [], __options);
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* getProvider
|
|
135
|
+
*
|
|
136
|
+
* @param { ArgumentTypes.AccountId } account,
|
|
137
|
+
*/
|
|
138
|
+
getProvider(account, __options) {
|
|
139
|
+
return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "getProvider", [account], __options);
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* providerFund
|
|
143
|
+
*
|
|
144
|
+
*/
|
|
145
|
+
providerFund(__options) {
|
|
146
|
+
return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "providerFund", [], __options);
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* providerSetDataset
|
|
150
|
+
*
|
|
151
|
+
* @param { ArgumentTypes.Hash } datasetId,
|
|
152
|
+
* @param { ArgumentTypes.Hash } datasetIdContent,
|
|
153
|
+
*/
|
|
154
|
+
providerSetDataset(datasetId, datasetIdContent, __options) {
|
|
155
|
+
return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "providerSetDataset", [datasetId, datasetIdContent], __options);
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* getDapp
|
|
159
|
+
*
|
|
160
|
+
* @param { ArgumentTypes.AccountId } contract,
|
|
161
|
+
*/
|
|
162
|
+
getDapp(contract, __options) {
|
|
163
|
+
return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "getDapp", [contract], __options);
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* dappRegister
|
|
167
|
+
*
|
|
168
|
+
* @param { ArgumentTypes.AccountId } contract,
|
|
169
|
+
* @param { ArgumentTypes.DappPayee } payee,
|
|
170
|
+
*/
|
|
171
|
+
dappRegister(contract, payee, __options) {
|
|
172
|
+
return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "dappRegister", [contract, payee], __options);
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* dappUpdate
|
|
176
|
+
*
|
|
177
|
+
* @param { ArgumentTypes.AccountId } contract,
|
|
178
|
+
* @param { ArgumentTypes.DappPayee } payee,
|
|
179
|
+
* @param { ArgumentTypes.AccountId } owner,
|
|
180
|
+
*/
|
|
181
|
+
dappUpdate(contract, payee, owner, __options) {
|
|
182
|
+
return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "dappUpdate", [contract, payee, owner], __options);
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* dappFund
|
|
186
|
+
*
|
|
187
|
+
* @param { ArgumentTypes.AccountId } contract,
|
|
188
|
+
*/
|
|
189
|
+
dappFund(contract, __options) {
|
|
190
|
+
return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "dappFund", [contract], __options);
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* dappDeregister
|
|
194
|
+
*
|
|
195
|
+
* @param { ArgumentTypes.AccountId } contract,
|
|
196
|
+
*/
|
|
197
|
+
dappDeregister(contract, __options) {
|
|
198
|
+
return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "dappDeregister", [contract], __options);
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* dappDeactivate
|
|
202
|
+
*
|
|
203
|
+
* @param { ArgumentTypes.AccountId } contract,
|
|
204
|
+
*/
|
|
205
|
+
dappDeactivate(contract, __options) {
|
|
206
|
+
return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "dappDeactivate", [contract], __options);
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* getUserHistorySummary
|
|
210
|
+
*
|
|
211
|
+
* @param { ArgumentTypes.AccountId } userAccount,
|
|
212
|
+
*/
|
|
213
|
+
getUserHistorySummary(userAccount, __options) {
|
|
214
|
+
return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "getUserHistorySummary", [userAccount], __options);
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* providerCommit
|
|
218
|
+
*
|
|
219
|
+
* @param { ArgumentTypes.Commit } commit,
|
|
220
|
+
*/
|
|
221
|
+
providerCommit(commit, __options) {
|
|
222
|
+
return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "providerCommit", [commit], __options);
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* providerCommitMany
|
|
226
|
+
*
|
|
227
|
+
* @param { Array<ArgumentTypes.Commit> } commits,
|
|
228
|
+
*/
|
|
229
|
+
providerCommitMany(commits, __options) {
|
|
230
|
+
return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "providerCommitMany", [commits], __options);
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* dappOperatorIsHumanUser
|
|
234
|
+
*
|
|
235
|
+
* @param { ArgumentTypes.AccountId } userAccount,
|
|
236
|
+
* @param { (number | string | BN) } threshold,
|
|
237
|
+
*/
|
|
238
|
+
dappOperatorIsHumanUser(userAccount, threshold, __options) {
|
|
239
|
+
return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "dappOperatorIsHumanUser", [userAccount, threshold], __options);
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* dappOperatorLastCorrectCaptcha
|
|
243
|
+
*
|
|
244
|
+
* @param { ArgumentTypes.AccountId } userAccount,
|
|
245
|
+
*/
|
|
246
|
+
dappOperatorLastCorrectCaptcha(userAccount, __options) {
|
|
247
|
+
return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "dappOperatorLastCorrectCaptcha", [userAccount], __options);
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* getCaptchaData
|
|
251
|
+
*
|
|
252
|
+
* @param { ArgumentTypes.Hash } datasetId,
|
|
253
|
+
*/
|
|
254
|
+
getCaptchaData(datasetId, __options) {
|
|
255
|
+
return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "getCaptchaData", [datasetId], __options);
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* getUser
|
|
259
|
+
*
|
|
260
|
+
* @param { ArgumentTypes.AccountId } userAccount,
|
|
261
|
+
*/
|
|
262
|
+
getUser(userAccount, __options) {
|
|
263
|
+
return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "getUser", [userAccount], __options);
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* getCommit
|
|
267
|
+
*
|
|
268
|
+
* @param { ArgumentTypes.Hash } commitId,
|
|
269
|
+
*/
|
|
270
|
+
getCommit(commitId, __options) {
|
|
271
|
+
return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "getCommit", [commitId], __options);
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* listProvidersByAccounts
|
|
275
|
+
*
|
|
276
|
+
* @param { Array<ArgumentTypes.AccountId> } providerAccounts,
|
|
277
|
+
*/
|
|
278
|
+
listProvidersByAccounts(providerAccounts, __options) {
|
|
279
|
+
return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "listProvidersByAccounts", [providerAccounts], __options);
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* listProvidersByStatus
|
|
283
|
+
*
|
|
284
|
+
* @param { Array<ArgumentTypes.GovernanceStatus> } statuses,
|
|
285
|
+
*/
|
|
286
|
+
listProvidersByStatus(statuses, __options) {
|
|
287
|
+
return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "listProvidersByStatus", [statuses], __options);
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
* getRandomActiveProvider
|
|
291
|
+
*
|
|
292
|
+
* @param { ArgumentTypes.AccountId } userAccount,
|
|
293
|
+
* @param { ArgumentTypes.AccountId } dappContract,
|
|
294
|
+
*/
|
|
295
|
+
getRandomActiveProvider(userAccount, dappContract, __options) {
|
|
296
|
+
return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "getRandomActiveProvider", [userAccount, dappContract], __options);
|
|
297
|
+
}
|
|
298
|
+
/**
|
|
299
|
+
* getAllProviderAccounts
|
|
300
|
+
*
|
|
301
|
+
*/
|
|
302
|
+
getAllProviderAccounts(__options) {
|
|
303
|
+
return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "getAllProviderAccounts", [], __options);
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* getRandomNumber
|
|
307
|
+
*
|
|
308
|
+
* @param { (string | number | BN) } len,
|
|
309
|
+
* @param { ArgumentTypes.AccountId } userAccount,
|
|
310
|
+
* @param { ArgumentTypes.AccountId } dappContract,
|
|
311
|
+
*/
|
|
312
|
+
getRandomNumber(len, userAccount, dappContract, __options) {
|
|
313
|
+
return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "getRandomNumber", [len, userAccount, dappContract], __options);
|
|
314
|
+
}
|
|
315
|
+
/**
|
|
316
|
+
* terminate
|
|
317
|
+
*
|
|
318
|
+
*/
|
|
319
|
+
terminate(__options) {
|
|
320
|
+
return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "terminate", [], __options);
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
* withdraw
|
|
324
|
+
*
|
|
325
|
+
* @param { (string | number | BN) } amount,
|
|
326
|
+
*/
|
|
327
|
+
withdraw(amount, __options) {
|
|
328
|
+
return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "withdraw", [amount], __options);
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* setCodeHash
|
|
332
|
+
*
|
|
333
|
+
* @param { Array<(number | string | BN)> } codeHash,
|
|
334
|
+
*/
|
|
335
|
+
setCodeHash(codeHash, __options) {
|
|
336
|
+
return typechainTypes.buildSubmittableExtrinsic(this.__apiPromise, this.__nativeContract, "setCodeHash", [codeHash], __options);
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
module.exports = Methods;
|