@prosopo/provider 0.2.32 → 0.2.33

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/util.cjs CHANGED
@@ -10,15 +10,15 @@ const pl = require("nodejs-polars");
10
10
  function encodeStringAddress(address$1) {
11
11
  try {
12
12
  return address.encodeAddress(is.isHex(address$1) ? hex.hexToU8a(address$1) : address.decodeAddress(address$1));
13
- } catch (error) {
14
- throw new common.ProsopoEnvError(error, "CONTRACT.INVALID_ADDRESS", {}, address$1);
13
+ } catch (err) {
14
+ throw new common.ProsopoContractError("CONTRACT.INVALID_ADDRESS", { context: { address: address$1 } });
15
15
  }
16
16
  }
17
17
  function shuffleArray(array) {
18
18
  for (let arrayIndex = array.length - 1; arrayIndex > 0; arrayIndex--) {
19
19
  const randIndex = Math.floor(Math.random() * (arrayIndex + 1));
20
- const tmp = util.at(array, randIndex, { optional: true });
21
- array[randIndex] = util.at(array, arrayIndex, { optional: true });
20
+ const tmp = util.at(array, randIndex);
21
+ array[randIndex] = util.at(array, arrayIndex);
22
22
  array[arrayIndex] = tmp;
23
23
  }
24
24
  return array;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prosopo/provider",
3
- "version": "0.2.32",
3
+ "version": "0.2.33",
4
4
  "author": "PROSOPO LIMITED <info@prosopo.io>",
5
5
  "license": "Apache-2.0",
6
6
  "main": "./dist/index.js",
@@ -37,15 +37,15 @@
37
37
  "@polkadot/types": "10.11.1",
38
38
  "@polkadot/util": "12.6.1",
39
39
  "@polkadot/util-crypto": "12.6.1",
40
- "@prosopo/captcha-contract": "0.2.32",
41
- "@prosopo/common": "0.2.32",
42
- "@prosopo/contract": "0.2.32",
43
- "@prosopo/database": "0.2.32",
44
- "@prosopo/datasets": "0.2.32",
45
- "@prosopo/env": "0.2.32",
46
- "@prosopo/types": "0.2.32",
47
- "@prosopo/types-database": "0.2.32",
48
- "@prosopo/types-env": "0.2.32",
40
+ "@prosopo/captcha-contract": "0.2.33",
41
+ "@prosopo/common": "0.2.33",
42
+ "@prosopo/contract": "0.2.33",
43
+ "@prosopo/database": "0.2.33",
44
+ "@prosopo/datasets": "0.2.33",
45
+ "@prosopo/env": "0.2.33",
46
+ "@prosopo/types": "0.2.33",
47
+ "@prosopo/types-database": "0.2.33",
48
+ "@prosopo/types-env": "0.2.33",
49
49
  "cron": "^2.1.0",
50
50
  "cron-parser": "^4.5.0",
51
51
  "express": "^4.18.1",
@@ -1,62 +0,0 @@
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,37 +0,0 @@
1
- export declare const captchaData: {
2
- datasetId: string;
3
- captchas: ({
4
- salt: string;
5
- solution: number[];
6
- timeLimit: number;
7
- items: {
8
- hash: string;
9
- data: string;
10
- type: string;
11
- }[];
12
- target: string;
13
- } | {
14
- salt: string;
15
- solution: number[];
16
- items: {
17
- hash: string;
18
- data: string;
19
- type: string;
20
- }[];
21
- target: string;
22
- timeLimit?: undefined;
23
- } | {
24
- salt: string;
25
- items: {
26
- hash: string;
27
- data: string;
28
- type: string;
29
- }[];
30
- target: string;
31
- solution?: undefined;
32
- timeLimit?: undefined;
33
- })[];
34
- format: string;
35
- timeLimit: number;
36
- };
37
- //# sourceMappingURL=captchas.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"captchas.d.ts","sourceRoot":"","sources":["../../../src/tests/data/captchas.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAu3BvB,CAAA"}