@prosopo/api 0.1.16 → 0.1.18
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/package.json +30 -29
- package/dist/api/HttpClientBase.d.ts +0 -9
- package/dist/api/HttpClientBase.d.ts.map +0 -1
- package/dist/api/HttpClientBase.js +0 -36
- package/dist/api/HttpClientBase.js.map +0 -1
- package/dist/api/ProviderApi.d.ts +0 -13
- package/dist/api/ProviderApi.d.ts.map +0 -1
- package/dist/api/ProviderApi.js +0 -63
- package/dist/api/ProviderApi.js.map +0 -1
- package/dist/api/index.d.ts +0 -3
- package/dist/api/index.d.ts.map +0 -1
- package/dist/api/index.js +0 -23
- package/dist/api/index.js.map +0 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -21
- package/dist/index.js.map +0 -1
- package/dist/types/api.d.ts +0 -60
- package/dist/types/api.d.ts.map +0 -1
- package/dist/types/api.js +0 -18
- package/dist/types/api.js.map +0 -1
- package/dist/types/index.d.ts +0 -2
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/index.js +0 -20
- package/dist/types/index.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,31 +1,32 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
"
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
2
|
+
"name": "@prosopo/api",
|
|
3
|
+
"version": "0.1.18",
|
|
4
|
+
"description": "Wrapper for the provider API",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"clean": "tsc --build --clean",
|
|
9
|
+
"build": "tsc --build --verbose",
|
|
10
|
+
"lint": "npx eslint .",
|
|
11
|
+
"lint:fix": "npx eslint . --fix --config ../../.eslintrc.js"
|
|
12
|
+
},
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "git+https://github.com/prosopo/captcha.git"
|
|
16
|
+
},
|
|
17
|
+
"author": "PROSOPO LIMITED <info@prosopo.io>",
|
|
18
|
+
"license": "Apache-2.0",
|
|
19
|
+
"bugs": {
|
|
20
|
+
"url": "https://github.com/prosopo/captcha/issues"
|
|
21
|
+
},
|
|
22
|
+
"homepage": "https://github.com/prosopo/captcha#readme",
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"@prosopo/types": "^0.1.18",
|
|
25
|
+
"axios": "^0.27.2"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"tslib": "^2.6.2",
|
|
29
|
+
"typescript": "^5.1.6"
|
|
30
|
+
},
|
|
31
|
+
"sideEffects": false
|
|
31
32
|
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { AxiosInstance, AxiosResponse } from 'axios';
|
|
2
|
-
export declare class HttpClientBase {
|
|
3
|
-
protected readonly axios: AxiosInstance;
|
|
4
|
-
constructor(baseURL: string, prefix?: string);
|
|
5
|
-
protected responseHandler: (response: AxiosResponse) => any;
|
|
6
|
-
protected errorHandler: (error: any) => Promise<never>;
|
|
7
|
-
}
|
|
8
|
-
export default HttpClientBase;
|
|
9
|
-
//# sourceMappingURL=HttpClientBase.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"HttpClientBase.d.ts","sourceRoot":"","sources":["../../src/api/HttpClientBase.ts"],"names":[],"mappings":"AAeA,OAAc,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAE3D,qBAAa,cAAc;IACvB,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAA;gBAE3B,OAAO,EAAE,MAAM,EAAE,MAAM,SAAK;IAMxC,SAAS,CAAC,eAAe,aAAc,aAAa,SAGnD;IAED,SAAS,CAAC,YAAY,UAAW,GAAG,oBAA0B;CACjE;AAED,eAAe,cAAc,CAAA"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.HttpClientBase = 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 axios_1 = tslib_1.__importDefault(require("axios"));
|
|
21
|
-
class HttpClientBase {
|
|
22
|
-
axios;
|
|
23
|
-
constructor(baseURL, prefix = '') {
|
|
24
|
-
baseURL = baseURL + prefix;
|
|
25
|
-
this.axios = axios_1.default.create({ baseURL });
|
|
26
|
-
this.axios.interceptors.response.use(this.responseHandler, this.errorHandler);
|
|
27
|
-
}
|
|
28
|
-
responseHandler = (response) => {
|
|
29
|
-
console.log('API REQUEST', response.request);
|
|
30
|
-
return response.data;
|
|
31
|
-
};
|
|
32
|
-
errorHandler = (error) => Promise.reject(error);
|
|
33
|
-
}
|
|
34
|
-
exports.HttpClientBase = HttpClientBase;
|
|
35
|
-
exports.default = HttpClientBase;
|
|
36
|
-
//# sourceMappingURL=HttpClientBase.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"HttpClientBase.js","sourceRoot":"","sources":["../../src/api/HttpClientBase.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,0DAA2D;AAE3D,MAAa,cAAc;IACJ,KAAK,CAAe;IAEvC,YAAY,OAAe,EAAE,MAAM,GAAG,EAAE;QACpC,OAAO,GAAG,OAAO,GAAG,MAAM,CAAA;QAC1B,IAAI,CAAC,KAAK,GAAG,eAAK,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC,CAAA;QACtC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,eAAe,EAAE,IAAI,CAAC,YAAY,CAAC,CAAA;IACjF,CAAC;IAES,eAAe,GAAG,CAAC,QAAuB,EAAE,EAAE;QACpD,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAA;QAC5C,OAAO,QAAQ,CAAC,IAAI,CAAA;IACxB,CAAC,CAAA;IAES,YAAY,GAAG,CAAC,KAAU,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;CACjE;AAfD,wCAeC;AAED,kBAAe,cAAc,CAAA"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { AccountId, CaptchaSolution, RandomProvider } from '@prosopo/types';
|
|
2
|
-
import { CaptchaSolutionResponse, GetCaptchaResponse, VerificationResponse } from '../types';
|
|
3
|
-
import { NetworkConfig } from '@prosopo/types';
|
|
4
|
-
import HttpClientBase from './HttpClientBase';
|
|
5
|
-
export default class ProviderApi extends HttpClientBase {
|
|
6
|
-
private network;
|
|
7
|
-
private account;
|
|
8
|
-
constructor(network: NetworkConfig, providerUrl: string, account: AccountId);
|
|
9
|
-
getCaptchaChallenge(userAccount: string, randomProvider: RandomProvider): Promise<GetCaptchaResponse>;
|
|
10
|
-
submitCaptchaSolution(captchas: CaptchaSolution[], requestHash: string, userAccount: string, salt: string, signature?: string): Promise<CaptchaSolutionResponse>;
|
|
11
|
-
verifyDappUser(userAccount: string, commitmentId?: string): Promise<VerificationResponse>;
|
|
12
|
-
}
|
|
13
|
-
//# 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,EACH,SAAS,EAET,eAAe,EAGf,cAAc,EAEjB,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AAC5F,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,cAAc,MAAM,kBAAkB,CAAA;AAE7C,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,cAAc;IACnD,OAAO,CAAC,OAAO,CAAe;IAC9B,OAAO,CAAC,OAAO,CAAW;gBAEd,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS;IAUpE,mBAAmB,CAAC,WAAW,EAAE,MAAM,EAAE,cAAc,EAAE,cAAc,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAWrG,qBAAqB,CACxB,QAAQ,EAAE,eAAe,EAAE,EAC3B,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,MAAM,EACZ,SAAS,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,uBAAuB,CAAC;IAY5B,cAAc,CAAC,WAAW,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC;CAOnG"}
|
package/dist/api/ProviderApi.js
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
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 types_1 = require("@prosopo/types");
|
|
20
|
-
const HttpClientBase_1 = tslib_1.__importDefault(require("./HttpClientBase"));
|
|
21
|
-
class ProviderApi extends HttpClientBase_1.default {
|
|
22
|
-
network;
|
|
23
|
-
account;
|
|
24
|
-
constructor(network, providerUrl, account) {
|
|
25
|
-
if (!providerUrl.startsWith('http')) {
|
|
26
|
-
providerUrl = `https://${providerUrl}`;
|
|
27
|
-
}
|
|
28
|
-
console.log('ProviderApi', providerUrl);
|
|
29
|
-
super(providerUrl);
|
|
30
|
-
this.network = network;
|
|
31
|
-
this.account = account;
|
|
32
|
-
}
|
|
33
|
-
getCaptchaChallenge(userAccount, randomProvider) {
|
|
34
|
-
const { provider } = randomProvider;
|
|
35
|
-
const { blockNumber } = randomProvider;
|
|
36
|
-
const dappAccount = this.account;
|
|
37
|
-
const url = `${types_1.ApiPaths.GetCaptchaChallenge}/${provider.datasetId}/${userAccount}/${dappAccount}/${blockNumber
|
|
38
|
-
.toString()
|
|
39
|
-
.replace(/,/g, '')}`;
|
|
40
|
-
console.log(url);
|
|
41
|
-
return this.axios.get(url);
|
|
42
|
-
}
|
|
43
|
-
submitCaptchaSolution(captchas, requestHash, userAccount, salt, signature) {
|
|
44
|
-
const captchaSolutionBody = types_1.CaptchaSolutionBody.parse({
|
|
45
|
-
captchas,
|
|
46
|
-
requestHash,
|
|
47
|
-
user: userAccount,
|
|
48
|
-
dapp: this.account,
|
|
49
|
-
salt,
|
|
50
|
-
signature,
|
|
51
|
-
});
|
|
52
|
-
return this.axios.post(types_1.ApiPaths.SubmitCaptchaSolution, captchaSolutionBody);
|
|
53
|
-
}
|
|
54
|
-
verifyDappUser(userAccount, commitmentId) {
|
|
55
|
-
const payload = { user: userAccount };
|
|
56
|
-
if (commitmentId) {
|
|
57
|
-
payload['commitmentId'] = commitmentId;
|
|
58
|
-
}
|
|
59
|
-
return this.axios.post(types_1.ApiPaths.VerifyCaptchaSolution, payload);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
exports.default = ProviderApi;
|
|
63
|
-
//# 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,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O;YAClB,IAAI;YACJ,SAAS;SACZ,CAAC,CAAA;QACF,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,gBAAQ,CAAC,qBAAqB,EAAE,mBAAmB,CAAC,CAAA;IAC/E,CAAC;IAEM,cAAc,CAAC,WAAmB,EAAE,YAAqB;QAC5D,MAAM,OAAO,GAAG,EAAE,IAAI,EAAE,WAAW,EAAE,CAAA;QACrC,IAAI,YAAY,EAAE;YACd,OAAO,CAAC,cAAc,CAAC,GAAG,YAAY,CAAA;SACzC;QACD,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,gBAAQ,CAAC,qBAAqB,EAAE,OAAiC,CAAC,CAAA;IAC7F,CAAC;CACJ;AAlDD,8BAkDC"}
|
package/dist/api/index.d.ts
DELETED
package/dist/api/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAeA,cAAc,kBAAkB,CAAA;AAChC,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAA"}
|
package/dist/api/index.js
DELETED
|
@@ -1,23 +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
|
-
tslib_1.__exportStar(require("./HttpClientBase"), exports);
|
|
21
|
-
var ProviderApi_1 = require("./ProviderApi");
|
|
22
|
-
Object.defineProperty(exports, "ProviderApi", { enumerable: true, get: function () { return tslib_1.__importDefault(ProviderApi_1).default; } });
|
|
23
|
-
//# sourceMappingURL=index.js.map
|
package/dist/api/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/api/index.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,2DAAgC;AAChC,6CAAsD;AAA7C,mIAAA,OAAO,OAAe"}
|
package/dist/index.d.ts
DELETED
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAeA,cAAc,OAAO,CAAA;AACrB,cAAc,SAAS,CAAA"}
|
package/dist/index.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
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
|
-
tslib_1.__exportStar(require("./api"), exports);
|
|
20
|
-
tslib_1.__exportStar(require("./types"), exports);
|
|
21
|
-
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.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,gDAAqB;AACrB,kDAAuB"}
|
package/dist/types/api.d.ts
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { Captcha, MerkleProof } from '@prosopo/types';
|
|
2
|
-
export interface ProsopoRandomProviderResponse {
|
|
3
|
-
providerId: string;
|
|
4
|
-
blockNumber: string;
|
|
5
|
-
provider: ProposoProvider;
|
|
6
|
-
}
|
|
7
|
-
export type CaptchaSolutionCommitmentId = string;
|
|
8
|
-
export type ProsopoDappOperatorIsHumanUserResponse = boolean;
|
|
9
|
-
export interface ProposoProvider {
|
|
10
|
-
balance: string;
|
|
11
|
-
datasetId: string;
|
|
12
|
-
datasetIdContent: string;
|
|
13
|
-
fee: string;
|
|
14
|
-
payee: string;
|
|
15
|
-
serviceOrigin: string;
|
|
16
|
-
status: string;
|
|
17
|
-
}
|
|
18
|
-
export interface CaptchaResponseCaptcha {
|
|
19
|
-
captcha: Omit<Captcha, 'solution'>;
|
|
20
|
-
proof: MerkleProof;
|
|
21
|
-
}
|
|
22
|
-
export interface GetCaptchaResponse {
|
|
23
|
-
captchas: CaptchaResponseCaptcha[];
|
|
24
|
-
requestHash: string;
|
|
25
|
-
}
|
|
26
|
-
export interface VerificationResponse {
|
|
27
|
-
status: string;
|
|
28
|
-
solutionApproved: boolean;
|
|
29
|
-
commitmentId: CaptchaSolutionCommitmentId;
|
|
30
|
-
}
|
|
31
|
-
export interface CaptchaSolutionResponse {
|
|
32
|
-
captchas: CaptchaResponseCaptcha[];
|
|
33
|
-
status: string;
|
|
34
|
-
partialFee: string;
|
|
35
|
-
solutionApproved: boolean;
|
|
36
|
-
}
|
|
37
|
-
export interface AccountCreatorConfig {
|
|
38
|
-
area: {
|
|
39
|
-
width: number;
|
|
40
|
-
height: number;
|
|
41
|
-
};
|
|
42
|
-
offsetParameter: number;
|
|
43
|
-
multiplier: number;
|
|
44
|
-
fontSizeFactor: number;
|
|
45
|
-
maxShadowBlur: number;
|
|
46
|
-
numberOfRounds: number;
|
|
47
|
-
seed: number;
|
|
48
|
-
}
|
|
49
|
-
export interface ProsopoNetwork {
|
|
50
|
-
endpoint: string;
|
|
51
|
-
contract: {
|
|
52
|
-
address: string;
|
|
53
|
-
name: string;
|
|
54
|
-
};
|
|
55
|
-
dappAccount: {
|
|
56
|
-
address: string;
|
|
57
|
-
name: string;
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
//# sourceMappingURL=api.d.ts.map
|
package/dist/types/api.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/types/api.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,OAAO,EA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AAM,CAAA;IACrB,cAAc,EAAE,MAAM,CAAA;IACtB,IAAI,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,cAAc;IAC3B,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE;QACN,OAAO,EAAE,MAAM,CAAA;QACf,IAAI,EAAE,MAAM,CAAA;KACf,CAAA;IACD,WAAW,EAAE;QACT,OAAO,EAAE,MAAM,CAAA;QACf,IAAI,EAAE,MAAM,CAAA;KACf,CAAA;CACJ"}
|
package/dist/types/api.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// Copyright (C) 2021-2022 Prosopo (UK) Ltd.
|
|
3
|
-
// This file is part of procaptcha <https://github.com/prosopo/procaptcha>.
|
|
4
|
-
//
|
|
5
|
-
// procaptcha is free software: you can redistribute it and/or modify
|
|
6
|
-
// it under the terms of the GNU General Public License as published by
|
|
7
|
-
// the Free Software Foundation, either version 3 of the License, or
|
|
8
|
-
// (at your option) any later version.
|
|
9
|
-
//
|
|
10
|
-
// procaptcha is distributed in the hope that it will be useful,
|
|
11
|
-
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
-
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
-
// GNU General Public License for more details.
|
|
14
|
-
//
|
|
15
|
-
// You should have received a copy of the GNU General Public License
|
|
16
|
-
// along with procaptcha. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
//# sourceMappingURL=api.js.map
|
package/dist/types/api.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/types/api.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"}
|
package/dist/types/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAeA,cAAc,OAAO,CAAA"}
|
package/dist/types/index.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
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
|
-
tslib_1.__exportStar(require("./api"), exports);
|
|
20
|
-
//# sourceMappingURL=index.js.map
|
package/dist/types/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.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,gDAAqB"}
|