@prosopo/types 0.2.6 → 0.2.8
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/config/config.cjs +34 -43
- package/dist/cjs/config/enumMap.cjs +8 -0
- package/dist/cjs/config/index.cjs +5 -3
- package/dist/cjs/config/network.cjs +32 -0
- package/dist/cjs/contracts/captcha/dist/contract-info/captcha.cjs +2 -2
- package/dist/cjs/datasets/captcha.cjs +7 -0
- package/dist/cjs/datasets/dataset.cjs +4 -0
- package/dist/cjs/datasets/index.cjs +3 -0
- package/dist/cjs/index.cjs +10 -3
- package/dist/cjs/networks/index.cjs +38 -0
- package/dist/config/config.d.ts +557 -311
- package/dist/config/config.d.ts.map +1 -1
- package/dist/config/config.js +42 -45
- package/dist/config/config.js.map +1 -1
- package/dist/config/enumMap.d.ts +3 -0
- package/dist/config/enumMap.d.ts.map +1 -0
- package/dist/config/enumMap.js +6 -0
- package/dist/config/enumMap.js.map +1 -0
- package/dist/config/index.d.ts +1 -0
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +1 -0
- package/dist/config/index.js.map +1 -1
- package/dist/config/network.d.ts +84 -0
- package/dist/config/network.d.ts.map +1 -0
- package/dist/config/network.js +27 -0
- package/dist/config/network.js.map +1 -0
- package/dist/datasets/captcha.d.ts +96 -1
- package/dist/datasets/captcha.d.ts.map +1 -1
- package/dist/datasets/captcha.js +5 -0
- package/dist/datasets/captcha.js.map +1 -1
- package/dist/datasets/dataset.d.ts +98 -0
- package/dist/datasets/dataset.d.ts.map +1 -1
- package/dist/datasets/dataset.js +4 -1
- package/dist/datasets/dataset.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/networks/index.d.ts +4 -0
- package/dist/networks/index.d.ts.map +1 -0
- package/dist/networks/index.js +45 -0
- package/dist/networks/index.js.map +1 -0
- package/package.json +3 -3
|
@@ -45,7 +45,12 @@ const SelectAllCaptchaSchema = SelectAllCaptchaSchemaRaw.extend({
|
|
|
45
45
|
solution: z.z.string().array().optional(),
|
|
46
46
|
unlabelled: z.z.string().array().optional()
|
|
47
47
|
});
|
|
48
|
+
const SelectAllCaptchaSchemaWithNumericSolution = SelectAllCaptchaSchema.extend({
|
|
49
|
+
solution: z.z.number().array().optional(),
|
|
50
|
+
unlabelled: z.z.number().array().optional()
|
|
51
|
+
});
|
|
48
52
|
const CaptchasSchema = z.z.array(SelectAllCaptchaSchemaRaw);
|
|
53
|
+
const CaptchasWithNumericSolutionSchema = z.z.array(SelectAllCaptchaSchemaWithNumericSolution);
|
|
49
54
|
const CaptchaSolutionSchema = z.z.object({
|
|
50
55
|
captchaId: z.z.string(),
|
|
51
56
|
captchaContentId: z.z.string(),
|
|
@@ -75,6 +80,7 @@ exports.CaptchaStates = CaptchaStates;
|
|
|
75
80
|
exports.CaptchaTypes = CaptchaTypes;
|
|
76
81
|
exports.CaptchasContainerSchema = CaptchasContainerSchema;
|
|
77
82
|
exports.CaptchasSchema = CaptchasSchema;
|
|
83
|
+
exports.CaptchasWithNumericSolutionSchema = CaptchasWithNumericSolutionSchema;
|
|
78
84
|
exports.DataSchema = DataSchema;
|
|
79
85
|
exports.HashedCaptchaItemSchema = HashedCaptchaItemSchema;
|
|
80
86
|
exports.LabelledDataSchema = LabelledDataSchema;
|
|
@@ -83,3 +89,4 @@ exports.LabelsContainerSchema = LabelsContainerSchema;
|
|
|
83
89
|
exports.MaybeLabelledHashedItemSchema = MaybeLabelledHashedItemSchema;
|
|
84
90
|
exports.SelectAllCaptchaSchema = SelectAllCaptchaSchema;
|
|
85
91
|
exports.SelectAllCaptchaSchemaRaw = SelectAllCaptchaSchemaRaw;
|
|
92
|
+
exports.SelectAllCaptchaSchemaWithNumericSolution = SelectAllCaptchaSchemaWithNumericSolution;
|
|
@@ -11,6 +11,9 @@ const DatasetSchema = z.z.object({
|
|
|
11
11
|
contentTree: z.z.array(z.z.array(z.z.string())).optional(),
|
|
12
12
|
timeLimit: z.z.number().optional()
|
|
13
13
|
});
|
|
14
|
+
const DatasetWithNumericSolutionSchema = DatasetSchema.extend({
|
|
15
|
+
captchas: captcha.CaptchasWithNumericSolutionSchema
|
|
16
|
+
});
|
|
14
17
|
const DatasetWithIdsSchema = z.z.object({
|
|
15
18
|
datasetId: z.z.string(),
|
|
16
19
|
datasetContentId: z.z.string().optional(),
|
|
@@ -26,3 +29,4 @@ const DatasetWithIdsAndTreeSchema = DatasetWithIdsSchema.extend({
|
|
|
26
29
|
exports.DatasetSchema = DatasetSchema;
|
|
27
30
|
exports.DatasetWithIdsAndTreeSchema = DatasetWithIdsAndTreeSchema;
|
|
28
31
|
exports.DatasetWithIdsSchema = DatasetWithIdsSchema;
|
|
32
|
+
exports.DatasetWithNumericSolutionSchema = DatasetWithNumericSolutionSchema;
|
|
@@ -13,6 +13,7 @@ exports.CaptchaStates = captcha.CaptchaStates;
|
|
|
13
13
|
exports.CaptchaTypes = captcha.CaptchaTypes;
|
|
14
14
|
exports.CaptchasContainerSchema = captcha.CaptchasContainerSchema;
|
|
15
15
|
exports.CaptchasSchema = captcha.CaptchasSchema;
|
|
16
|
+
exports.CaptchasWithNumericSolutionSchema = captcha.CaptchasWithNumericSolutionSchema;
|
|
16
17
|
exports.DataSchema = captcha.DataSchema;
|
|
17
18
|
exports.HashedCaptchaItemSchema = captcha.HashedCaptchaItemSchema;
|
|
18
19
|
exports.LabelledDataSchema = captcha.LabelledDataSchema;
|
|
@@ -21,6 +22,8 @@ exports.LabelsContainerSchema = captcha.LabelsContainerSchema;
|
|
|
21
22
|
exports.MaybeLabelledHashedItemSchema = captcha.MaybeLabelledHashedItemSchema;
|
|
22
23
|
exports.SelectAllCaptchaSchema = captcha.SelectAllCaptchaSchema;
|
|
23
24
|
exports.SelectAllCaptchaSchemaRaw = captcha.SelectAllCaptchaSchemaRaw;
|
|
25
|
+
exports.SelectAllCaptchaSchemaWithNumericSolution = captcha.SelectAllCaptchaSchemaWithNumericSolution;
|
|
24
26
|
exports.DatasetSchema = dataset.DatasetSchema;
|
|
25
27
|
exports.DatasetWithIdsAndTreeSchema = dataset.DatasetWithIdsAndTreeSchema;
|
|
26
28
|
exports.DatasetWithIdsSchema = dataset.DatasetWithIdsSchema;
|
|
29
|
+
exports.DatasetWithNumericSolutionSchema = dataset.DatasetWithNumericSolutionSchema;
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -5,7 +5,9 @@ require("./contract/index.cjs");
|
|
|
5
5
|
require("./datasets/index.cjs");
|
|
6
6
|
require("./provider/index.cjs");
|
|
7
7
|
require("./procaptcha/index.cjs");
|
|
8
|
+
const index = require("./networks/index.cjs");
|
|
8
9
|
const config = require("./config/config.cjs");
|
|
10
|
+
const network = require("./config/network.cjs");
|
|
9
11
|
const artifacts = require("./contract/artifacts.cjs");
|
|
10
12
|
const captcha = require("./datasets/captcha.cjs");
|
|
11
13
|
const dataset = require("./datasets/dataset.cjs");
|
|
@@ -13,13 +15,12 @@ const api = require("./provider/api.cjs");
|
|
|
13
15
|
const scheduler = require("./provider/scheduler.cjs");
|
|
14
16
|
const argv = require("./provider/argv.cjs");
|
|
15
17
|
const manager = require("./procaptcha/manager.cjs");
|
|
18
|
+
exports.networks = index;
|
|
16
19
|
exports.AccountCreatorConfigSchema = config.AccountCreatorConfigSchema;
|
|
17
20
|
exports.BatchCommitConfigSchema = config.BatchCommitConfigSchema;
|
|
18
21
|
exports.DatabaseConfigSchema = config.DatabaseConfigSchema;
|
|
19
22
|
exports.DatabaseTypes = config.DatabaseTypes;
|
|
20
23
|
exports.EnvironmentTypesSchema = config.EnvironmentTypesSchema;
|
|
21
|
-
exports.NetworkConfigSchema = config.NetworkConfigSchema;
|
|
22
|
-
exports.NetworkNamesSchema = config.NetworkNamesSchema;
|
|
23
24
|
exports.ProcaptchaConfigSchema = config.ProcaptchaConfigSchema;
|
|
24
25
|
exports.ProsopoBaseConfigSchema = config.ProsopoBaseConfigSchema;
|
|
25
26
|
exports.ProsopoBasicConfigSchema = config.ProsopoBasicConfigSchema;
|
|
@@ -28,8 +29,11 @@ exports.ProsopoCaptchaSolutionConfigSchema = config.ProsopoCaptchaSolutionConfig
|
|
|
28
29
|
exports.ProsopoClientConfigSchema = config.ProsopoClientConfigSchema;
|
|
29
30
|
exports.ProsopoConfigSchema = config.ProsopoConfigSchema;
|
|
30
31
|
exports.ProsopoImageServerConfigSchema = config.ProsopoImageServerConfigSchema;
|
|
31
|
-
exports.ProsopoNetworksSchema = config.ProsopoNetworksSchema;
|
|
32
32
|
exports.ProsopoServerConfigSchema = config.ProsopoServerConfigSchema;
|
|
33
|
+
exports.NetworkConfigSchema = network.NetworkConfigSchema;
|
|
34
|
+
exports.NetworkNamesSchema = network.NetworkNamesSchema;
|
|
35
|
+
exports.NetworkPairTypeSchema = network.NetworkPairTypeSchema;
|
|
36
|
+
exports.ProsopoNetworksSchema = network.ProsopoNetworksSchema;
|
|
33
37
|
exports.AbiCellSpec = artifacts.AbiCellSpec;
|
|
34
38
|
exports.AbiDetailsSpec = artifacts.AbiDetailsSpec;
|
|
35
39
|
exports.AbiEnumSpec = artifacts.AbiEnumSpec;
|
|
@@ -54,6 +58,7 @@ exports.CaptchaStates = captcha.CaptchaStates;
|
|
|
54
58
|
exports.CaptchaTypes = captcha.CaptchaTypes;
|
|
55
59
|
exports.CaptchasContainerSchema = captcha.CaptchasContainerSchema;
|
|
56
60
|
exports.CaptchasSchema = captcha.CaptchasSchema;
|
|
61
|
+
exports.CaptchasWithNumericSolutionSchema = captcha.CaptchasWithNumericSolutionSchema;
|
|
57
62
|
exports.DataSchema = captcha.DataSchema;
|
|
58
63
|
exports.HashedCaptchaItemSchema = captcha.HashedCaptchaItemSchema;
|
|
59
64
|
exports.LabelledDataSchema = captcha.LabelledDataSchema;
|
|
@@ -62,9 +67,11 @@ exports.LabelsContainerSchema = captcha.LabelsContainerSchema;
|
|
|
62
67
|
exports.MaybeLabelledHashedItemSchema = captcha.MaybeLabelledHashedItemSchema;
|
|
63
68
|
exports.SelectAllCaptchaSchema = captcha.SelectAllCaptchaSchema;
|
|
64
69
|
exports.SelectAllCaptchaSchemaRaw = captcha.SelectAllCaptchaSchemaRaw;
|
|
70
|
+
exports.SelectAllCaptchaSchemaWithNumericSolution = captcha.SelectAllCaptchaSchemaWithNumericSolution;
|
|
65
71
|
exports.DatasetSchema = dataset.DatasetSchema;
|
|
66
72
|
exports.DatasetWithIdsAndTreeSchema = dataset.DatasetWithIdsAndTreeSchema;
|
|
67
73
|
exports.DatasetWithIdsSchema = dataset.DatasetWithIdsSchema;
|
|
74
|
+
exports.DatasetWithNumericSolutionSchema = dataset.DatasetWithNumericSolutionSchema;
|
|
68
75
|
exports.ApiParams = api.ApiParams;
|
|
69
76
|
exports.ApiPaths = api.ApiPaths;
|
|
70
77
|
exports.CaptchaRequestBody = api.CaptchaRequestBody;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const network = require("../config/network.cjs");
|
|
3
|
+
const pairTypeSr25519 = network.NetworkPairTypeSchema.parse("sr25519");
|
|
4
|
+
const getContractAddress = (defaultAddress) => {
|
|
5
|
+
return process.env.PROTOCOL_CONTRACT_ADDRESS || process.env.PROSOPO_CONTRACT_ADDRESS || process.env.REACT_APP_PROSOPO_CONTRACT_ADDRESS || defaultAddress || "";
|
|
6
|
+
};
|
|
7
|
+
const networks = () => {
|
|
8
|
+
return {
|
|
9
|
+
[network.NetworkNamesSchema.Values.development]: {
|
|
10
|
+
endpoint: process.env.REACT_APP_SUBSTRATE_ENDPOINT || process.env.SUBSTRATE_NODE_URL || "ws://127.0.0.1:9944",
|
|
11
|
+
contract: {
|
|
12
|
+
name: "captcha",
|
|
13
|
+
address: getContractAddress("CONTRACT_NOT_DEPLOYED")
|
|
14
|
+
},
|
|
15
|
+
pairType: pairTypeSr25519,
|
|
16
|
+
ss58Format: 42
|
|
17
|
+
},
|
|
18
|
+
[network.NetworkNamesSchema.Values.rococo]: {
|
|
19
|
+
endpoint: process.env.REACT_APP_SUBSTRATE_ENDPOINT || process.env.SUBSTRATE_NODE_URL || "wss://rococo-contracts-rpc.polkadot.io:443",
|
|
20
|
+
contract: {
|
|
21
|
+
name: "captcha",
|
|
22
|
+
address: getContractAddress("5HiVWQhJrysNcFNEWf2crArKht16zrhro3FcekVWocyQjx5u")
|
|
23
|
+
},
|
|
24
|
+
pairType: pairTypeSr25519,
|
|
25
|
+
ss58Format: 42
|
|
26
|
+
},
|
|
27
|
+
[network.NetworkNamesSchema.Values.shiden]: {
|
|
28
|
+
endpoint: process.env.REACT_APP_SUBSTRATE_ENDPOINT || process.env.SUBSTRATE_NODE_URL || "wss://shiden.public.blastapi.io",
|
|
29
|
+
contract: {
|
|
30
|
+
address: getContractAddress("XpRox5bNg6YV8BHafsuHQ3b8i7gSq3GKPeYLA1b8EZwrDb3"),
|
|
31
|
+
name: "captcha"
|
|
32
|
+
},
|
|
33
|
+
pairType: pairTypeSr25519,
|
|
34
|
+
ss58Format: 5
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
module.exports = networks;
|