@prosopo/procaptcha 0.1.9 → 0.1.13

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.
Files changed (127) hide show
  1. package/assets/contracts-page.png +0 -0
  2. package/dist/api/Extension.d.ts +16 -0
  3. package/dist/api/Extension.d.ts.map +1 -0
  4. package/dist/api/Extension.js +9 -0
  5. package/dist/api/Extension.js.map +1 -0
  6. package/dist/api/ExtensionWeb2.d.ts +11 -25
  7. package/dist/api/ExtensionWeb2.d.ts.map +1 -1
  8. package/dist/api/ExtensionWeb2.js +89 -94
  9. package/dist/api/ExtensionWeb2.js.map +1 -1
  10. package/dist/api/ExtensionWeb3.d.ts +6 -52
  11. package/dist/api/ExtensionWeb3.d.ts.map +1 -1
  12. package/dist/api/ExtensionWeb3.js +24 -142
  13. package/dist/api/ExtensionWeb3.js.map +1 -1
  14. package/dist/api/HttpClientBase.d.ts +1 -1
  15. package/dist/api/HttpClientBase.d.ts.map +1 -1
  16. package/dist/api/HttpClientBase.js +2 -2
  17. package/dist/api/HttpClientBase.js.map +1 -1
  18. package/dist/api/errors.d.ts +16 -0
  19. package/dist/api/errors.d.ts.map +1 -0
  20. package/dist/api/errors.js +34 -0
  21. package/dist/api/errors.js.map +1 -0
  22. package/dist/api/handlers.d.ts +2 -2
  23. package/dist/api/handlers.d.ts.map +1 -1
  24. package/dist/api/handlers.js +2 -10
  25. package/dist/api/handlers.js.map +1 -1
  26. package/dist/api/index.d.ts +0 -4
  27. package/dist/api/index.d.ts.map +1 -1
  28. package/dist/api/index.js +0 -4
  29. package/dist/api/index.js.map +1 -1
  30. package/dist/api/sign.d.ts +5 -0
  31. package/dist/api/sign.d.ts.map +1 -0
  32. package/dist/api/sign.js +16 -0
  33. package/dist/api/sign.js.map +1 -0
  34. package/dist/index.d.ts +1 -0
  35. package/dist/index.d.ts.map +1 -1
  36. package/dist/index.js +1 -0
  37. package/dist/index.js.map +1 -1
  38. package/dist/modules/Manager.d.ts +22 -0
  39. package/dist/modules/Manager.d.ts.map +1 -0
  40. package/dist/modules/Manager.js +419 -0
  41. package/dist/modules/Manager.js.map +1 -0
  42. package/dist/modules/ProsopoCaptchaApi.d.ts +15 -15
  43. package/dist/modules/ProsopoCaptchaApi.d.ts.map +1 -1
  44. package/dist/modules/ProsopoCaptchaApi.js +60 -60
  45. package/dist/modules/ProsopoCaptchaApi.js.map +1 -1
  46. package/dist/modules/canvas.d.ts.map +1 -1
  47. package/dist/modules/canvas.js +84 -21
  48. package/dist/modules/canvas.js.map +1 -1
  49. package/dist/modules/index.d.ts +1 -6
  50. package/dist/modules/index.d.ts.map +1 -1
  51. package/dist/modules/index.js +1 -6
  52. package/dist/modules/index.js.map +1 -1
  53. package/dist/modules/storage.d.ts +10 -0
  54. package/dist/modules/storage.d.ts.map +1 -1
  55. package/dist/modules/storage.js +18 -3
  56. package/dist/modules/storage.js.map +1 -1
  57. package/dist/types/api.d.ts +8 -26
  58. package/dist/types/api.d.ts.map +1 -1
  59. package/dist/types/client.d.ts +4 -60
  60. package/dist/types/client.d.ts.map +1 -1
  61. package/dist/types/contract.d.ts +1 -1
  62. package/dist/types/contract.d.ts.map +1 -1
  63. package/dist/types/index.d.ts +1 -0
  64. package/dist/types/index.d.ts.map +1 -1
  65. package/dist/types/index.js +1 -0
  66. package/dist/types/index.js.map +1 -1
  67. package/dist/types/manager.d.ts +60 -0
  68. package/dist/types/manager.d.ts.map +1 -0
  69. package/dist/types/manager.js +3 -0
  70. package/dist/types/manager.js.map +1 -0
  71. package/dist/types/utils.d.ts +2 -0
  72. package/dist/types/utils.d.ts.map +1 -0
  73. package/dist/types/utils.js +3 -0
  74. package/dist/types/utils.js.map +1 -0
  75. package/dist/utils/index.d.ts +2 -0
  76. package/dist/utils/index.d.ts.map +1 -0
  77. package/dist/utils/index.js +5 -0
  78. package/dist/utils/index.js.map +1 -0
  79. package/dist/utils/utils.d.ts +2 -0
  80. package/dist/utils/utils.d.ts.map +1 -0
  81. package/dist/utils/utils.js +8 -0
  82. package/dist/utils/utils.js.map +1 -0
  83. package/package.json +21 -23
  84. package/.eslintignore +0 -3
  85. package/.eslintrc.js +0 -37
  86. package/LICENSE +0 -201
  87. package/dist/api/AccountCreator.d.ts +0 -19
  88. package/dist/api/AccountCreator.d.ts.map +0 -1
  89. package/dist/api/AccountCreator.js +0 -88
  90. package/dist/api/AccountCreator.js.map +0 -1
  91. package/dist/api/AsyncFactory.d.ts +0 -7
  92. package/dist/api/AsyncFactory.d.ts.map +0 -1
  93. package/dist/api/AsyncFactory.js +0 -30
  94. package/dist/api/AsyncFactory.js.map +0 -1
  95. package/dist/api/ProsopoContract.d.ts +0 -13
  96. package/dist/api/ProsopoContract.d.ts.map +0 -1
  97. package/dist/api/ProsopoContract.js +0 -38
  98. package/dist/api/ProsopoContract.js.map +0 -1
  99. package/dist/api/ProsopoContractBase.d.ts +0 -32
  100. package/dist/api/ProsopoContractBase.d.ts.map +0 -1
  101. package/dist/api/ProsopoContractBase.js +0 -132
  102. package/dist/api/ProsopoContractBase.js.map +0 -1
  103. package/dist/api/ProviderApi.d.ts +0 -14
  104. package/dist/api/ProviderApi.d.ts.map +0 -1
  105. package/dist/api/ProviderApi.js +0 -53
  106. package/dist/api/ProviderApi.js.map +0 -1
  107. package/dist/modules/ProsopoCaptchaClient.d.ts +0 -26
  108. package/dist/modules/ProsopoCaptchaClient.d.ts.map +0 -1
  109. package/dist/modules/ProsopoCaptchaClient.js +0 -112
  110. package/dist/modules/ProsopoCaptchaClient.js.map +0 -1
  111. package/dist/modules/ProsopoCaptchaStateClient.d.ts +0 -18
  112. package/dist/modules/ProsopoCaptchaStateClient.d.ts.map +0 -1
  113. package/dist/modules/ProsopoCaptchaStateClient.js +0 -111
  114. package/dist/modules/ProsopoCaptchaStateClient.js.map +0 -1
  115. package/dist/modules/client.d.ts +0 -9
  116. package/dist/modules/client.d.ts.map +0 -1
  117. package/dist/modules/client.js +0 -40
  118. package/dist/modules/client.js.map +0 -1
  119. package/dist/modules/contract.d.ts +0 -7
  120. package/dist/modules/contract.d.ts.map +0 -1
  121. package/dist/modules/contract.js +0 -42
  122. package/dist/modules/contract.js.map +0 -1
  123. package/dist/modules/extension.d.ts +0 -4
  124. package/dist/modules/extension.d.ts.map +0 -1
  125. package/dist/modules/extension.js +0 -31
  126. package/dist/modules/extension.js.map +0 -1
  127. package/tsconfig.json +0 -24
@@ -1,19 +0,0 @@
1
- import { ApiPromise } from "@polkadot/api";
2
- import { InjectedAccountWithMeta } from "@polkadot/extension-inject/types";
3
- import AsyncFactory from "./AsyncFactory";
4
- import { Keyring } from "@polkadot/keyring";
5
- import { ProviderInterface } from "@polkadot/rpc-provider/types";
6
- import { AccountCreatorConfig } from "../types/index";
7
- export declare class AccountCreator extends AsyncFactory {
8
- protected api: ApiPromise;
9
- protected config: AccountCreatorConfig;
10
- protected source: string;
11
- /**
12
- * @param providerInterface
13
- * @param config
14
- */
15
- init(providerInterface: ProviderInterface, config: AccountCreatorConfig, source: string): Promise<this>;
16
- createAccount(keyring?: Keyring, address?: string): Promise<InjectedAccountWithMeta>;
17
- getFingerprint(): Promise<string>;
18
- }
19
- //# sourceMappingURL=AccountCreator.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AccountCreator.d.ts","sourceRoot":"","sources":["../../src/api/AccountCreator.ts"],"names":[],"mappings":"AAeA,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AACzC,OAAO,EAAC,uBAAuB,EAAC,MAAM,kCAAkC,CAAC;AACzE,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAC,OAAO,EAA+B,MAAM,mBAAmB,CAAC;AAExE,OAAO,EAAC,iBAAiB,EAAC,MAAM,8BAA8B,CAAC;AAK/D,OAAO,EAAC,oBAAoB,EAAC,MAAM,gBAAgB,CAAC;AAGpD,qBAAa,cAAe,SAAQ,YAAY;IAE5C,SAAS,CAAC,GAAG,EAAE,UAAU,CAAC;IAC1B,SAAS,CAAC,MAAM,EAAE,oBAAoB,CAAC;IACvC,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC;IAEzB;;;OAGG;IACU,IAAI,CAAC,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,EAAE,oBAAoB,EAAE,MAAM,EAAE,MAAM;IAOvF,aAAa,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,uBAAuB,CAAC;IAsCpF,cAAc,IAAI,OAAO,CAAC,MAAM,CAAC;CAUjD"}
@@ -1,88 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AccountCreator = void 0;
4
- const tslib_1 = require("tslib");
5
- // Copyright (C) 2021-2022 Prosopo (UK) Ltd.
6
- // This file is part of procaptcha <https://github.com/prosopo/procaptcha>.
7
- //
8
- // procaptcha is free software: you can redistribute it and/or modify
9
- // it under the terms of the GNU General Public License as published by
10
- // the Free Software Foundation, either version 3 of the License, or
11
- // (at your option) any later version.
12
- //
13
- // procaptcha is distributed in the hope that it will be useful,
14
- // but WITHOUT ANY WARRANTY; without even the implied warranty of
15
- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
- // GNU General Public License for more details.
17
- //
18
- // You should have received a copy of the GNU General Public License
19
- // along with procaptcha. If not, see <http://www.gnu.org/licenses/>.
20
- const api_1 = require("@polkadot/api");
21
- const AsyncFactory_1 = tslib_1.__importDefault(require("./AsyncFactory"));
22
- const keyring_1 = require("@polkadot/keyring");
23
- const util_crypto_1 = require("@polkadot/util-crypto");
24
- const fingerprintjs_1 = tslib_1.__importStar(require("@fingerprintjs/fingerprintjs"));
25
- const bip39_1 = require("@polkadot/util-crypto/mnemonic/bip39");
26
- const util_1 = require("@polkadot/util");
27
- const canvas_1 = require("../modules/canvas");
28
- const datasets_1 = require("@prosopo/datasets");
29
- class AccountCreator extends AsyncFactory_1.default {
30
- api;
31
- config;
32
- source;
33
- /**
34
- * @param providerInterface
35
- * @param config
36
- */
37
- async init(providerInterface, config, source) {
38
- this.api = await api_1.ApiPromise.create({ provider: providerInterface });
39
- this.source = source;
40
- this.config = config;
41
- return this;
42
- }
43
- async createAccount(keyring, address) {
44
- const params = {
45
- area: this.config.area,
46
- offsetParameter: this.config.offsetParameter,
47
- multiplier: this.config.multiplier,
48
- fontSizeFactor: this.config.fontSizeFactor,
49
- maxShadowBlur: this.config.maxShadowBlur
50
- };
51
- const browserEntropy = await this.getFingerprint();
52
- const canvasEntropy = (0, canvas_1.picassoCanvas)(this.config.numberOfRounds, this.config.seed, params);
53
- const entropy = (0, datasets_1.hexHash)([canvasEntropy, browserEntropy].join(""), 128).slice(2);
54
- console.log("canvas entropy", canvasEntropy);
55
- console.log("browserEntropy", browserEntropy);
56
- console.log("entropy", entropy);
57
- const u8Entropy = (0, util_1.stringToU8a)(entropy);
58
- const mnemonic = (0, bip39_1.entropyToMnemonic)(u8Entropy);
59
- if (!keyring) {
60
- keyring = new keyring_1.Keyring({ type: 'sr25519', ss58Format: this.api.registry.chainSS58 });
61
- }
62
- await (0, util_crypto_1.cryptoWaitReady)();
63
- if (address) {
64
- return { address: address, meta: { source: this.source, name: address } };
65
- }
66
- else {
67
- const account = keyring?.addFromMnemonic(mnemonic);
68
- return {
69
- address: account.address.length === 42
70
- ? account.address
71
- : (0, keyring_1.encodeAddress)((0, keyring_1.decodeAddress)(account.address), this.api.registry.chainSS58),
72
- meta: { source: this.source, name: account.address },
73
- };
74
- }
75
- }
76
- async getFingerprint() {
77
- // Initialize an agent at application startup.
78
- const fpPromise = fingerprintjs_1.default.load();
79
- // Get the visitor identifier when you need it.
80
- const fp = await fpPromise;
81
- const result = await fp.get();
82
- // strip out the components that change in incognito mode
83
- const { screenFrame, ...componentsReduced } = result.components;
84
- return (0, fingerprintjs_1.hashComponents)(componentsReduced);
85
- }
86
- }
87
- exports.AccountCreator = AccountCreator;
88
- //# sourceMappingURL=AccountCreator.js.map
@@ -1 +0,0 @@
1
- {"version":3,"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AG,CAAC,QAAQ,CAAC,SAAS,CAAC;gBAChF,IAAI,EAAE,EAAC,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,OAAO,EAAC;aACrD,CAAA;SACJ;IAGL,CAAC;IAEM,KAAK,CAAC,cAAc;QACvB,8CAA8C;QAC9C,MAAM,SAAS,GAAG,uBAAa,CAAC,IAAI,EAAE,CAAA;QACtC,+CAA+C;QAC/C,MAAM,EAAE,GAAG,MAAM,SAAS,CAAA;QAC1B,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC,GAAG,EAAE,CAAA;QAC7B,yDAAyD;QACzD,MAAM,EAAC,WAAW,EAAE,GAAG,iBAAiB,EAAC,GAAG,MAAM,CAAC,UAAU,CAAA;QAC7D,OAAO,IAAA,8BAAc,EAAC,iBAAiB,CAAC,CAAA;IAC5C,CAAC;CACJ;AAjED,wCAiEC"}
@@ -1,7 +0,0 @@
1
- export declare abstract class AsyncFactory {
2
- constructor();
3
- static create(...args: any[]): Promise<any>;
4
- abstract init(...args: any[]): Promise<this>;
5
- }
6
- export default AsyncFactory;
7
- //# sourceMappingURL=AsyncFactory.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AsyncFactory.d.ts","sourceRoot":"","sources":["../../src/api/AsyncFactory.ts"],"names":[],"mappings":"AAiBA,8BAAsB,YAAY;;WAMV,MAAM,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE;aAIzB,IAAI,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAEtD;AAED,eAAe,YAAY,CAAC"}
@@ -1,30 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AsyncFactory = void 0;
4
- // Copyright (C) 2021-2022 Prosopo (UK) Ltd.
5
- // This file is part of procaptcha <https://github.com/prosopo/procaptcha>.
6
- //
7
- // procaptcha is free software: you can redistribute it and/or modify
8
- // it under the terms of the GNU General Public License as published by
9
- // the Free Software Foundation, either version 3 of the License, or
10
- // (at your option) any later version.
11
- //
12
- // procaptcha is distributed in the hope that it will be useful,
13
- // but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- // GNU General Public License for more details.
16
- //
17
- // You should have received a copy of the GNU General Public License
18
- // along with procaptcha. If not, see <http://www.gnu.org/licenses/>.
19
- const contract_1 = require("@prosopo/contract");
20
- class AsyncFactory {
21
- constructor() {
22
- throw new contract_1.ProsopoEnvError("GENERAL.ASYNC_FACTORY_CREATE");
23
- }
24
- static async create(...args) {
25
- return await Object.create(this.prototype).init(...args);
26
- }
27
- }
28
- exports.AsyncFactory = AsyncFactory;
29
- exports.default = AsyncFactory;
30
- //# sourceMappingURL=AsyncFactory.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AsyncFactory.js","sourceRoot":"","sources":["../../src/api/AsyncFactory.ts"],"names":[],"mappings":";;;AAAA,4CAA4C;AAC5C,2EAA2E;AAC3E,EAAE;AACF,qEAAqE;AACrE,uEAAuE;AACvE,oEAAoE;AACpE,sCAAsC;AACtC,EAAE;AACF,gEAAgE;AAChE,iEAAiE;AACjE,gEAAgE;AAChE,+CAA+C;AAC/C,EAAE;AACF,oEAAoE;AACpE,sEAAsE;AACtE,gDAAkD;AAElD,MAAsB,YAAY;IAE9B;QACI,MAAM,IAAI,0BAAe,CAAC,8BAA8B,CAAC,CAAC;IAC9D,CAAC;IAEM,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,IAAW;QACrC,OAAO,MAAM,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;IAC7D,CAAC;CAIJ;AAZD,oCAYC;AAED,kBAAe,YAAY,CAAC"}
@@ -1,13 +0,0 @@
1
- import ProsopoContractBase from "./ProsopoContractBase";
2
- import { Signer } from '@polkadot/api/types';
3
- import { ProsopoDappOperatorIsHumanUserResponse, TransactionResponse } from '../types';
4
- import { ProsopoRandomProviderResponse } from "../types";
5
- import { CaptchaSolutionCommitment } from "@prosopo/datasets";
6
- export declare class ProsopoContract extends ProsopoContractBase {
7
- getRandomProvider(): Promise<ProsopoRandomProviderResponse>;
8
- getCaptchaSolutionCommitment(commitmentId: string): Promise<CaptchaSolutionCommitment>;
9
- dappUserCommit(signer: Signer, captchaDatasetId: string, userMerkleTreeRoot: string, providerAddress: string): Promise<TransactionResponse>;
10
- dappOperatorIsHumanUser(solutionThreshold: number): Promise<ProsopoDappOperatorIsHumanUserResponse>;
11
- }
12
- export default ProsopoContract;
13
- //# sourceMappingURL=ProsopoContract.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ProsopoContract.d.ts","sourceRoot":"","sources":["../../src/api/ProsopoContract.ts"],"names":[],"mappings":"AAgBA,OAAO,mBAAmB,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAC,sCAAsC,EAAE,mBAAmB,EAAC,MAAM,UAAU,CAAC;AACrF,OAAO,EAAE,6BAA6B,EAAE,MAAM,UAAU,CAAC;AACzD,OAAO,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAE9D,qBAAa,eAAgB,SAAQ,mBAAmB;IAEvC,iBAAiB,IAAI,OAAO,CAAC,6BAA6B,CAAC;IAI3D,4BAA4B,CAAC,YAAY,EAAE,MAAM;IAIjD,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAI3I,uBAAuB,CAAC,iBAAiB,EAAE,MAAM,GAAG,OAAO,CAAC,sCAAsC,CAAC;CAOnH;AAED,eAAe,eAAe,CAAC"}
@@ -1,38 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ProsopoContract = void 0;
4
- const tslib_1 = require("tslib");
5
- // Copyright (C) 2021-2022 Prosopo (UK) Ltd.
6
- // This file is part of procaptcha <https://github.com/prosopo/procaptcha>.
7
- //
8
- // procaptcha is free software: you can redistribute it and/or modify
9
- // it under the terms of the GNU General Public License as published by
10
- // the Free Software Foundation, either version 3 of the License, or
11
- // (at your option) any later version.
12
- //
13
- // procaptcha is distributed in the hope that it will be useful,
14
- // but WITHOUT ANY WARRANTY; without even the implied warranty of
15
- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
- // GNU General Public License for more details.
17
- //
18
- // You should have received a copy of the GNU General Public License
19
- // along with procaptcha. If not, see <http://www.gnu.org/licenses/>.
20
- // import {Hash} from '@polkadot/types/interfaces';
21
- const ProsopoContractBase_1 = tslib_1.__importDefault(require("./ProsopoContractBase"));
22
- class ProsopoContract extends ProsopoContractBase_1.default {
23
- async getRandomProvider() {
24
- return await this.query('getRandomActiveProvider', [this.account.address, this.dappAddress]);
25
- }
26
- async getCaptchaSolutionCommitment(commitmentId) {
27
- return await this.query('getCaptchaSolutionCommitment', [commitmentId]);
28
- }
29
- async dappUserCommit(signer, captchaDatasetId, userMerkleTreeRoot, providerAddress) {
30
- return await this.transaction(signer, 'dappUserCommit', [this.dappAddress, captchaDatasetId, userMerkleTreeRoot, providerAddress]);
31
- }
32
- async dappOperatorIsHumanUser(solutionThreshold) {
33
- return await this.query('dappOperatorIsHumanUser', [this.account.address, solutionThreshold]);
34
- }
35
- }
36
- exports.ProsopoContract = ProsopoContract;
37
- exports.default = ProsopoContract;
38
- //# sourceMappingURL=ProsopoContract.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ProsopoContract.js","sourceRoot":"","sources":["../../src/api/ProsopoContract.ts"],"names":[],"mappings":";;;;AAAA,4CAA4C;AAC5C,2EAA2E;AAC3E,EAAE;AACF,qEAAqE;AACrE,uEAAuE;AACvE,oEAAoE;AACpE,sCAAsC;AACtC,EAAE;AACF,gEAAgE;AAChE,iEAAiE;AACjE,gEAAgE;AAChE,+CAA+C;AAC/C,EAAE;AACF,oEAAoE;AACpE,sEAAsE;AACtE,mDAAmD;AACnD,wFAAwD;AAMxD,MAAa,eAAgB,SAAQ,6BAAmB;IAE7C,KAAK,CAAC,iBAAiB;QAC1B,OAAO,MAAM,IAAI,CAAC,KAAK,CAAC,yBAAyB,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,WAAW,CAAC,CAAkC,CAAC;IAClI,CAAC;IAEM,KAAK,CAAC,4BAA4B,CAAC,YAAoB;QAC1D,OAAO,MAAM,IAAI,CAAC,KAAK,CAAC,8BAA8B,EAAE,CAAC,YAAY,CAAC,CAA8B,CAAC;IACzG,CAAC;IAEM,KAAK,CAAC,cAAc,CAAC,MAAc,EAAE,gBAAwB,EAAE,kBAA0B,EAAE,eAAuB;QACrH,OAAO,MAAM,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,gBAAgB,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,eAAe,CAAC,CAAC,CAAC;IACvI,CAAC;IAEM,KAAK,CAAC,uBAAuB,CAAC,iBAAyB;QAE1D,OAAO,MAAM,IAAI,CAAC,KAAK,CAAC,yBAAyB,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,iBAAiB,CAAC,CAA2C,CAAC;IAC5I,CAAC;CAIJ;AArBD,0CAqBC;AAED,kBAAe,eAAe,CAAC"}
@@ -1,32 +0,0 @@
1
- import { ApiPromise } from "@polkadot/api";
2
- import { Abi, ContractPromise } from "@polkadot/api-contract";
3
- import { InjectedAccountWithMeta } from "@polkadot/extension-inject/types";
4
- import { AnyJson } from "@polkadot/types/types/codec";
5
- import { ProviderInterface } from "@polkadot/rpc-provider/types";
6
- import { Signer } from "@polkadot/api/types";
7
- import { TransactionResponse } from '../types';
8
- import AsyncFactory from "./AsyncFactory";
9
- export declare class ProsopoContractBase extends AsyncFactory {
10
- protected api: ApiPromise;
11
- protected abi: Abi;
12
- protected contract: ContractPromise;
13
- protected account: InjectedAccountWithMeta;
14
- protected dappAddress: string;
15
- address: string;
16
- /**
17
- * @param address
18
- * @param dappAddress
19
- * @param account
20
- * @param providerInterface
21
- */
22
- init(address: string, dappAddress: string, account: InjectedAccountWithMeta, providerInterface: ProviderInterface): Promise<this>;
23
- getApi(): ApiPromise;
24
- getContract(): ContractPromise;
25
- getAccount(): InjectedAccountWithMeta;
26
- getDappAddress(): string;
27
- disconnect(): Promise<void>;
28
- query<T>(method: string, args: any[]): Promise<T | AnyJson | null>;
29
- transaction(signer: Signer, method: string, args: any[]): Promise<TransactionResponse>;
30
- }
31
- export default ProsopoContractBase;
32
- //# sourceMappingURL=ProsopoContractBase.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ProsopoContractBase.d.ts","sourceRoot":"","sources":["../../src/api/ProsopoContractBase.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,UAAU,EAAqB,MAAM,eAAe,CAAC;AAC9D,OAAO,EAAE,GAAG,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAG3E,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAE1C,qBAAa,mBAAoB,SAAQ,YAAY;IAEjD,SAAS,CAAC,GAAG,EAAE,UAAU,CAAC;IAC1B,SAAS,CAAC,GAAG,EAAE,GAAG,CAAC;IACnB,SAAS,CAAC,QAAQ,EAAE,eAAe,CAAC;IACpC,SAAS,CAAC,OAAO,EAAE,uBAAuB,CAAC;IAC3C,SAAS,CAAC,WAAW,EAAE,MAAM,CAAC;IAEvB,OAAO,EAAE,MAAM,CAAC;IAEvB;;;;;KAKC;IACY,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,iBAAiB;IAUvH,MAAM,IAAI,UAAU;IAIpB,WAAW,IAAI,eAAe;IAI9B,UAAU,IAAI,uBAAuB;IAIrC,cAAc,IAAI,MAAM;IAIlB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAK3B,KAAK,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,CAAC,GAAG,OAAO,GAAG,IAAI,CAAC;IA0BlE,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,mBAAmB,CAAC;CAwEtG;AAED,eAAe,mBAAmB,CAAC"}
@@ -1,132 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ProsopoContractBase = void 0;
4
- const tslib_1 = require("tslib");
5
- // Copyright (C) 2021-2022 Prosopo (UK) Ltd.
6
- // This file is part of procaptcha <https://github.com/prosopo/procaptcha>.
7
- //
8
- // procaptcha is free software: you can redistribute it and/or modify
9
- // it under the terms of the GNU General Public License as published by
10
- // the Free Software Foundation, either version 3 of the License, or
11
- // (at your option) any later version.
12
- //
13
- // procaptcha is distributed in the hope that it will be useful,
14
- // but WITHOUT ANY WARRANTY; without even the implied warranty of
15
- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
- // GNU General Public License for more details.
17
- //
18
- // You should have received a copy of the GNU General Public License
19
- // along with procaptcha. If not, see <http://www.gnu.org/licenses/>.
20
- const api_1 = require("@polkadot/api");
21
- const api_contract_1 = require("@polkadot/api-contract");
22
- const contract_1 = require("@prosopo/contract");
23
- const AsyncFactory_1 = tslib_1.__importDefault(require("./AsyncFactory"));
24
- class ProsopoContractBase extends AsyncFactory_1.default {
25
- api;
26
- abi;
27
- contract;
28
- account;
29
- dappAddress;
30
- address;
31
- /**
32
- * @param address
33
- * @param dappAddress
34
- * @param account
35
- * @param providerInterface
36
- */
37
- async init(address, dappAddress, account, providerInterface) {
38
- this.api = await api_1.ApiPromise.create({ provider: providerInterface });
39
- this.abi = new api_contract_1.Abi(contract_1.abiJson, this.api.registry.getChainProperties());
40
- this.contract = new api_contract_1.ContractPromise(this.api, this.abi, address);
41
- this.address = address;
42
- this.dappAddress = dappAddress;
43
- this.account = account;
44
- return this;
45
- }
46
- getApi() {
47
- return this.api;
48
- }
49
- getContract() {
50
- return this.contract;
51
- }
52
- getAccount() {
53
- return this.account;
54
- }
55
- getDappAddress() {
56
- return this.dappAddress;
57
- }
58
- async disconnect() {
59
- await this.api.disconnect();
60
- }
61
- async query(method, args) {
62
- try {
63
- const abiMessage = this.abi.findMessage(method);
64
- const response = await this.contract.query[method](this.account.address, {}, ...(0, contract_1.encodeStringArgs)(abiMessage, args));
65
- console.log("QUERY RESPONSE", method, args, response);
66
- if (response.result.isOk) {
67
- if (response.output) {
68
- return (0, contract_1.unwrap)(response.output.toHuman());
69
- }
70
- else {
71
- return null;
72
- }
73
- }
74
- else {
75
- throw new contract_1.ProsopoContractError(response.result.asErr);
76
- }
77
- }
78
- catch (e) {
79
- console.error("ERROR", e);
80
- return null;
81
- }
82
- }
83
- // https://polkadot.js.org/docs/api/cookbook/tx/
84
- // https://polkadot.js.org/docs/api/start/api.tx.subs/
85
- async transaction(signer, method, args) {
86
- const queryBeforeTx = await this.query(method, args);
87
- console.log("QUERY BEFORE TX....................", queryBeforeTx);
88
- const abiMessage = this.abi.findMessage(method);
89
- const extrinsic = this.contract.tx[method]({}, ...(0, contract_1.encodeStringArgs)(abiMessage, args));
90
- // this.api.setSigner(signer);
91
- // const response = await buildTx(this.api.registry, extrinsic, this.account.address, { signer });
92
- // console.log("buildTx RESPONSE", response);
93
- // return;
94
- return new Promise((resolve, reject) => {
95
- extrinsic.signAndSend(this.account.address, { signer }, (result) => {
96
- const { dispatchError, dispatchInfo, events, internalError, status, txHash, txIndex } = result;
97
- console.log("TX STATUS", status.type);
98
- console.log("IS FINALIZED", status?.isFinalized);
99
- console.log("IN BLOCK", status?.isInBlock);
100
- console.log("EVENTS", events);
101
- if (internalError) {
102
- console.error("internalError", internalError);
103
- reject(internalError);
104
- return;
105
- }
106
- if (dispatchError) {
107
- console.error("dispatchError", dispatchError);
108
- reject(dispatchError);
109
- return;
110
- }
111
- // [Ready, InBlock, Finalized...]
112
- // Instant seal ON.
113
- if (status?.isInBlock) {
114
- const blockHash = status.asInBlock.toHex();
115
- resolve({ dispatchError, dispatchInfo, events, internalError, status, txHash, txIndex, blockHash });
116
- }
117
- // Instant seal OFF.
118
- // if (status?.isFinalized) {
119
- // const blockHash = status.asFinalized.toHex();
120
- // resolve({ dispatchError, dispatchInfo, events, internalError, status, txHash, txIndex, blockHash });
121
- // }
122
- })
123
- .catch((e) => {
124
- console.error("signAndSend ERROR", e);
125
- reject(e);
126
- });
127
- });
128
- }
129
- }
130
- exports.ProsopoContractBase = ProsopoContractBase;
131
- exports.default = ProsopoContractBase;
132
- //# sourceMappingURL=ProsopoContractBase.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ProsopoContractBase.js","sourceRoot":"","sources":["../../src/api/ProsopoContractBase.ts"],"names":[],"mappings":";;;;AAAA,4CAA4C;AAC5C,2EAA2E;AAC3E,EAAE;AACF,qEAAqE;AACrE,uEAAuE;AACvE,oEAAoE;AACpE,sCAAsC;AACtC,EAAE;AACF,gEAAgE;AAChE,iEAAiE;AACjE,gEAAgE;AAChE,+CAA+C;AAC/C,EAAE;AACF,oEAAoE;AACpE,sEAAsE;AACtE,uCAA8D;AAC9D,yDAA8D;AAG9D,gDAA4F;AAK5F,0EAA0C;AAE1C,MAA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AEzG,IAAI;YAER,CAAC,CAAC;iBACG,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE;gBACT,OAAO,CAAC,KAAK,CAAC,mBAAmB,EAAE,CAAC,CAAC,CAAC;gBACtC,MAAM,CAAC,CAAC,CAAC,CAAC;YACd,CAAC,CAAC,CAAC;QAEX,CAAC,CAAC,CAAC;IAEP,CAAC;CAEJ;AAjJD,kDAiJC;AAED,kBAAe,mBAAmB,CAAC"}
@@ -1,14 +0,0 @@
1
- import HttpClientBase from "./HttpClientBase";
2
- import { CaptchaSolutionResponse, GetCaptchaResponse, ProsopoCaptchaConfig, ProsopoRandomProviderResponse } from '../types';
3
- import { CaptchaSolution } from "@prosopo/datasets";
4
- export declare class ProviderApi extends HttpClientBase {
5
- private config;
6
- constructor(config: ProsopoCaptchaConfig);
7
- getProviders(): Promise<{
8
- accounts: string[];
9
- }>;
10
- getCaptchaChallenge(randomProvider: ProsopoRandomProviderResponse): Promise<GetCaptchaResponse>;
11
- submitCaptchaSolution(captchas: CaptchaSolution[], requestHash: string, userAccount: string, salt: string, blockHash?: string, txHash?: string, web2?: boolean): Promise<CaptchaSolutionResponse>;
12
- }
13
- export default ProviderApi;
14
- //# sourceMappingURL=ProviderApi.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ProviderApi.d.ts","sourceRoot":"","sources":["../../src/api/ProviderApi.ts"],"names":[],"mappings":"AAeA,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EACH,uBAAuB,EACvB,kBAAkB,EAClB,oBAAoB,EACpB,6BAA6B,EAChC,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,qBAAa,WAAY,SAAQ,cAAc;IAE3C,OAAO,CAAC,MAAM,CAAuB;gBAEzB,MAAM,EAAE,oBAAoB;IAKjC,YAAY,IAAI,OAAO,CAAC;QAAE,QAAQ,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IAI/C,mBAAmB,CAAC,cAAc,EAAE,6BAA6B,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAQ/F,qBAAqB,CAAC,QAAQ,EAAE,eAAe,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,uBAAuB,CAAC;CAa3M;AAED,eAAe,WAAW,CAAC"}
@@ -1,53 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ProviderApi = void 0;
4
- const tslib_1 = require("tslib");
5
- // Copyright (C) 2021-2022 Prosopo (UK) Ltd.
6
- // This file is part of procaptcha <https://github.com/prosopo/procaptcha>.
7
- //
8
- // procaptcha is free software: you can redistribute it and/or modify
9
- // it under the terms of the GNU General Public License as published by
10
- // the Free Software Foundation, either version 3 of the License, or
11
- // (at your option) any later version.
12
- //
13
- // procaptcha is distributed in the hope that it will be useful,
14
- // but WITHOUT ANY WARRANTY; without even the implied warranty of
15
- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
- // GNU General Public License for more details.
17
- //
18
- // You should have received a copy of the GNU General Public License
19
- // along with procaptcha. If not, see <http://www.gnu.org/licenses/>.
20
- const HttpClientBase_1 = tslib_1.__importDefault(require("./HttpClientBase"));
21
- const storage_1 = tslib_1.__importDefault(require("../modules/storage"));
22
- class ProviderApi extends HttpClientBase_1.default {
23
- config;
24
- constructor(config) {
25
- super(config['providerApi.baseURL'], config['providerApi.prefix']);
26
- this.config = config;
27
- }
28
- getProviders() {
29
- return this.axios.get(`/providers`);
30
- }
31
- getCaptchaChallenge(randomProvider) {
32
- const { provider } = randomProvider;
33
- let { blockNumber } = randomProvider;
34
- blockNumber = blockNumber.replace(/,/g, '');
35
- const userAccount = storage_1.default.getAccount();
36
- return this.axios.get(`/provider/captcha/${provider.datasetId}/${userAccount}/${this.config['dappAccount']}/${blockNumber}`);
37
- }
38
- submitCaptchaSolution(captchas, requestHash, userAccount, salt, blockHash, txHash, web2) {
39
- return this.axios.post(`/provider/solution`, {
40
- blockHash,
41
- captchas,
42
- requestHash,
43
- txHash,
44
- userAccount,
45
- dappAccount: this.config['dappAccount'],
46
- web2,
47
- salt
48
- });
49
- }
50
- }
51
- exports.ProviderApi = ProviderApi;
52
- exports.default = ProviderApi;
53
- //# sourceMappingURL=ProviderApi.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ProviderApi.js","sourceRoot":"","sources":["../../src/api/ProviderApi.ts"],"names":[],"mappings":";;;;AAAA,4CAA4C;AAC5C,2EAA2E;AAC3E,EAAE;AACF,qEAAqE;AACrE,uEAAuE;AACvE,oEAAoE;AACpE,sCAAsC;AACtC,EAAE;AACF,gEAAgE;AAChE,iEAAiE;AACjE,gEAAgE;AAChE,+CAA+C;AAC/C,EAAE;AACF,oEAAoE;AACpE,sEAAsE;AACtE,8EAA8C;AAC9C,yEAAyC;AASzC,MAAa,WAAY,SAAQ,wBAAc;IAEnC,MAAM,CAAuB;IAErC,YAAY,MAA4B;QACpC,KAAK,CAAC,MAAM,CAAC,qBAAqB,CAAC,EAAE,MAAM,CAAC,oBAAoB,CAAC,CAAC,CAAC;QACnE,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACzB,CAAC;IAEM,YAAY;QACf,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IACxC,CAAC;IAEM,mBAAmB,CAAC,cAA6C;QACpE,MAAM,EAAC,QAAQ,EAAC,GAAG,cAAc,CAAC;QAClC,IAAI,EAAC,WAAW,EAAC,GAAG,cAAc,CAAC;QACnC,WAAW,GAAG,WAAW,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QAC5C,MAAM,WAAW,GAAG,iBAAO,CAAC,UAAU,EAAE,CAAC;QACzC,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,qBAAqB,QAAQ,CAAC,SAAS,IAAI,WAAW,IAAI,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,WAAW,EAAE,CAAC,CAAC;IACjI,CAAC;IAEM,qBAAqB,CAAC,QAA2B,EAAE,WAAmB,EAAE,WAAmB,EAAE,IAAY,EAAE,SAAkB,EAAE,MAAe,EAAE,IAAc;QACjK,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,oBAAoB,EAAE;YACzC,SAAS;YACT,QAAQ;YACR,WAAW;YACX,MAAM;YACN,WAAW;YACX,WAAW,EAAE,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC;YACvC,IAAI;YACJ,IAAI;SACP,CAAC,CAAC;IACP,CAAC;CAEJ;AAlCD,kCAkCC;AAED,kBAAe,WAAW,CAAC"}
@@ -1,26 +0,0 @@
1
- import { CaptchaEventCallbacks, ICaptchaContextReducer, ICaptchaStatusReducer, IExtensionInterface, TExtensionAccount } from "../types/client";
2
- import { ProsopoRandomProviderResponse } from "../types/api";
3
- import { ProsopoContract } from "../api/ProsopoContract";
4
- import { ProviderApi } from "../api/ProviderApi";
5
- import { ProsopoCaptchaApi } from "./ProsopoCaptchaApi";
6
- export declare class ProsopoCaptchaClient {
7
- manager: ICaptchaContextReducer;
8
- status: ICaptchaStatusReducer;
9
- callbacks: CaptchaEventCallbacks | undefined;
10
- providerApi: ProviderApi;
11
- private static extension;
12
- private static contract;
13
- private static provider;
14
- private static captchaApi;
15
- constructor(manager: ICaptchaContextReducer, status: ICaptchaStatusReducer, callbacks?: CaptchaEventCallbacks);
16
- getExtension(): IExtensionInterface;
17
- setExtension(extension: IExtensionInterface): void;
18
- getContract(): ProsopoContract | undefined;
19
- getProvider(): ProsopoRandomProviderResponse | undefined;
20
- getCaptchaApi(): ProsopoCaptchaApi | undefined;
21
- onLoad(createAccount?: boolean): Promise<void>;
22
- onAccountChange(account?: TExtensionAccount): Promise<void>;
23
- onAccountUnset(): void;
24
- }
25
- export default ProsopoCaptchaClient;
26
- //# sourceMappingURL=ProsopoCaptchaClient.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ProsopoCaptchaClient.d.ts","sourceRoot":"","sources":["../../src/modules/ProsopoCaptchaClient.ts"],"names":[],"mappings":"AAeA,OAAO,EACH,qBAAqB,EACrB,sBAAsB,EACtB,qBAAqB,EACrB,mBAAmB,EACnB,iBAAiB,EACpB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAC,6BAA6B,EAAC,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAC,eAAe,EAAC,MAAM,wBAAwB,CAAC;AAGvD,OAAO,EAAC,WAAW,EAAC,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAC,iBAAiB,EAAC,MAAM,qBAAqB,CAAC;AAGtD,qBAAa,oBAAoB;IAEtB,OAAO,EAAE,sBAAsB,CAAC;IAChC,MAAM,EAAE,qBAAqB,CAAC;IAC9B,SAAS,EAAE,qBAAqB,GAAG,SAAS,CAAC;IAC7C,WAAW,EAAE,WAAW,CAAC;IAEhC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAsB;IAC9C,OAAO,CAAC,MAAM,CAAC,QAAQ,CAA8B;IACrD,OAAO,CAAC,MAAM,CAAC,QAAQ,CAA4C;IACnE,OAAO,CAAC,MAAM,CAAC,UAAU,CAAgC;gBAE7C,OAAO,EAAE,sBAAsB,EAAE,MAAM,EAAE,qBAAqB,EAAE,SAAS,CAAC,EAAE,qBAAqB;IAOtG,YAAY;IAIZ,YAAY,CAAC,SAAS,EAAE,mBAAmB;IAI3C,WAAW;IAIX,WAAW;IAIX,aAAa;IAIP,MAAM,CAAC,aAAa,CAAC,EAAE,OAAO;IAsC9B,eAAe,CAAC,OAAO,CAAC,EAAE,iBAAiB;IA2CjD,cAAc;CAYxB;AAED,eAAe,oBAAoB,CAAC"}
@@ -1,112 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ProsopoCaptchaClient = void 0;
4
- const contract_1 = require("./contract");
5
- const extension_1 = require("./extension");
6
- const ProviderApi_1 = require("../api/ProviderApi");
7
- const ProsopoCaptchaApi_1 = require("./ProsopoCaptchaApi");
8
- const contract_2 = require("@prosopo/contract");
9
- class ProsopoCaptchaClient {
10
- manager;
11
- status;
12
- callbacks;
13
- providerApi;
14
- static extension;
15
- static contract;
16
- static provider;
17
- static captchaApi;
18
- constructor(manager, status, callbacks) {
19
- this.manager = manager;
20
- this.status = status;
21
- this.callbacks = callbacks;
22
- this.providerApi = new ProviderApi_1.ProviderApi(manager.state.config);
23
- }
24
- getExtension() {
25
- return ProsopoCaptchaClient.extension;
26
- }
27
- setExtension(extension) {
28
- ProsopoCaptchaClient.extension = extension;
29
- }
30
- getContract() {
31
- return ProsopoCaptchaClient.contract;
32
- }
33
- getProvider() {
34
- return ProsopoCaptchaClient.provider;
35
- }
36
- getCaptchaApi() {
37
- return ProsopoCaptchaClient.captchaApi;
38
- }
39
- async onLoad(createAccount) {
40
- if (!ProsopoCaptchaClient.extension) {
41
- try {
42
- ProsopoCaptchaClient.extension = await (0, extension_1.getExtension)((0, contract_1.getWsProvider)(this.manager.state.config['dappUrl']), this.manager.state.config['web2'], this.manager.state.config['accountCreator'], this.manager.state.config['dappName']);
43
- }
44
- catch (err) {
45
- throw new contract_2.ProsopoEnvError(err);
46
- }
47
- }
48
- if (this.callbacks?.onLoad) {
49
- this.callbacks.onLoad(ProsopoCaptchaClient.extension, this.manager.state.config['prosopoContractAccount']);
50
- this.manager.update({ contractAddress: this.manager.state.config['prosopoContractAccount'] });
51
- }
52
- let account;
53
- if (createAccount) {
54
- try {
55
- account = await this.getExtension().createAccount();
56
- }
57
- catch (err) {
58
- throw new contract_2.ProsopoEnvError(err);
59
- }
60
- }
61
- else {
62
- try {
63
- account = await this.getExtension().getAccount();
64
- }
65
- catch (err) {
66
- throw new contract_2.ProsopoEnvError(err);
67
- }
68
- }
69
- await this.onAccountChange(account);
70
- }
71
- async onAccountChange(account) {
72
- if (!account) {
73
- this.onAccountUnset();
74
- return;
75
- }
76
- try {
77
- ProsopoCaptchaClient.extension.setAccount(account.address);
78
- }
79
- catch (err) {
80
- throw new contract_2.ProsopoEnvError(err);
81
- }
82
- try {
83
- ProsopoCaptchaClient.contract = await (0, contract_1.getProsopoContract)(this.manager.state.config['prosopoContractAccount'], this.manager.state.config['dappAccount'], account, (0, contract_1.getWsProvider)(this.manager.state.config['dappUrl']));
84
- }
85
- catch (err) {
86
- throw new contract_2.ProsopoEnvError(err);
87
- }
88
- try {
89
- ProsopoCaptchaClient.provider = await ProsopoCaptchaClient.contract.getRandomProvider();
90
- }
91
- catch (err) {
92
- throw new contract_2.ProsopoEnvError(err);
93
- }
94
- ProsopoCaptchaClient.captchaApi = new ProsopoCaptchaApi_1.ProsopoCaptchaApi(ProsopoCaptchaClient.contract, ProsopoCaptchaClient.provider, this.providerApi, this.manager.state.config['web2']);
95
- if (this.callbacks?.onAccountChange) {
96
- this.callbacks.onAccountChange(account);
97
- }
98
- this.manager.update({ account });
99
- }
100
- onAccountUnset() {
101
- ProsopoCaptchaClient.contract = undefined;
102
- ProsopoCaptchaClient.provider = undefined;
103
- ProsopoCaptchaClient.captchaApi = undefined;
104
- if (this.callbacks?.onAccountChange) {
105
- this.callbacks.onAccountChange(undefined);
106
- }
107
- this.manager.update({ account: undefined });
108
- }
109
- }
110
- exports.ProsopoCaptchaClient = ProsopoCaptchaClient;
111
- exports.default = ProsopoCaptchaClient;
112
- //# sourceMappingURL=ProsopoCaptchaClient.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ProsopoCaptchaClient.js","sourceRoot":"","sources":["../../src/modules/ProsopoCaptchaClient.ts"],"names":[],"mappings":";;;AAwBA,yCAA6D;AAC7D,2CAAyC;AACzC,oDAA+C;AAC/C,2DAAsD;AACtD,gDAAkD;AAElD,MAAa,oBAAoB;IAEtB,OAAO,CAAyB;IAChC,MAAM,CAAwB;IAC9B,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