@portkey/onboarding 1.4.0-alpha.3 → 1.5.0-alpha.5
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/commonjs/constants/index.d.ts +1 -1
- package/dist/commonjs/constants/index.js +1 -1
- package/dist/commonjs/evokePortkey/checkPortkeyExtension.d.ts +2 -1
- package/dist/commonjs/evokePortkey/checkPortkeyExtension.js +3 -2
- package/dist/commonjs/evokePortkey/evokeByThirdParty.js +1 -29
- package/dist/commonjs/evokePortkey/index.d.ts +1 -1
- package/dist/commonjs/evokePortkey/types.d.ts +3 -0
- package/dist/esm/constants/index.d.ts +1 -1
- package/dist/esm/constants/index.js +1 -1
- package/dist/esm/evokePortkey/checkPortkeyExtension.d.ts +2 -1
- package/dist/esm/evokePortkey/checkPortkeyExtension.js +3 -2
- package/dist/esm/evokePortkey/evokeByThirdParty.js +1 -29
- package/dist/esm/evokePortkey/index.d.ts +1 -1
- package/dist/esm/evokePortkey/types.d.ts +3 -0
- package/dist/types/constants/index.d.ts +1 -1
- package/dist/types/constants/index.d.ts.map +1 -1
- package/dist/types/evokePortkey/checkPortkeyExtension.d.ts +2 -1
- package/dist/types/evokePortkey/checkPortkeyExtension.d.ts.map +1 -1
- package/dist/types/evokePortkey/evokeByThirdParty.d.ts.map +1 -1
- package/dist/types/evokePortkey/index.d.ts +1 -1
- package/dist/types/evokePortkey/types.d.ts +3 -0
- package/dist/types/evokePortkey/types.d.ts.map +1 -1
- package/package.json +4 -4
@@ -10,4 +10,4 @@ exports.EXTENSION_DOWNLOAD_URL = {
|
|
10
10
|
EDGE: 'https://chrome.google.com/webstore/detail/portkey-did-crypto-nft/hpjiiechbbhefmpggegmahejiiphbmij',
|
11
11
|
DEFAULT: 'https://portkey.finance/download',
|
12
12
|
};
|
13
|
-
exports.WEB_PAGE = '
|
13
|
+
exports.WEB_PAGE = 'https://openlogin-test.portkey.finance';
|
@@ -12,7 +12,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
const utils_1 = require("@portkey/utils");
|
13
13
|
const utils_2 = require("../utils");
|
14
14
|
const constants_1 = require("../constants");
|
15
|
-
const checkPortkeyExtension = () => __awaiter(void 0, void 0, void 0, function* () {
|
15
|
+
const checkPortkeyExtension = (params) => __awaiter(void 0, void 0, void 0, function* () {
|
16
|
+
const openTarget = params === null || params === void 0 ? void 0 : params.openTarget;
|
16
17
|
if (typeof window === 'undefined')
|
17
18
|
return false;
|
18
19
|
const _window = window;
|
@@ -23,7 +24,7 @@ const checkPortkeyExtension = () => __awaiter(void 0, void 0, void 0, function*
|
|
23
24
|
return true;
|
24
25
|
const browserName = (0, utils_2.detectBrowserName)();
|
25
26
|
const downloadURL = constants_1.EXTENSION_DOWNLOAD_URL[browserName] || constants_1.EXTENSION_DOWNLOAD_URL.DEFAULT;
|
26
|
-
_window.open(downloadURL,
|
27
|
+
_window.open(downloadURL, openTarget);
|
27
28
|
return false;
|
28
29
|
});
|
29
30
|
exports.default = checkPortkeyExtension;
|
@@ -2,33 +2,5 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
const query_string_1 = require("query-string");
|
4
4
|
const constants_1 = require("../constants");
|
5
|
-
const evokeByThirdParty = params =>
|
6
|
-
let timer = null;
|
7
|
-
const onMessage = (event) => {
|
8
|
-
const type = event.data.type;
|
9
|
-
if (type === 'PortkeyDownloadOnSuccess' || type === 'PortkeyDownloadOnFailure') {
|
10
|
-
timer && clearInterval(timer);
|
11
|
-
}
|
12
|
-
switch (type) {
|
13
|
-
case 'PortkeyDownloadOnSuccess':
|
14
|
-
resolve(event.data.data);
|
15
|
-
break;
|
16
|
-
case 'PortkeyDownloadOnFailure':
|
17
|
-
reject(event.data.error);
|
18
|
-
break;
|
19
|
-
default:
|
20
|
-
return;
|
21
|
-
}
|
22
|
-
window.removeEventListener('message', onMessage);
|
23
|
-
};
|
24
|
-
window.addEventListener('message', onMessage);
|
25
|
-
const windowOpener = window.open(`${constants_1.WEB_PAGE}/portkey-download?${(0, query_string_1.stringify)(params)}`);
|
26
|
-
timer = setInterval(() => {
|
27
|
-
if (windowOpener === null || windowOpener === void 0 ? void 0 : windowOpener.closed) {
|
28
|
-
clearInterval(timer);
|
29
|
-
reject('User close the prompt');
|
30
|
-
timer = null;
|
31
|
-
}
|
32
|
-
}, 1600);
|
33
|
-
});
|
5
|
+
const evokeByThirdParty = params => Promise.resolve(window.open(`${constants_1.WEB_PAGE}/portkey-download?${(0, query_string_1.stringify)(params)}`));
|
34
6
|
exports.default = evokeByThirdParty;
|
@@ -8,7 +8,7 @@ export declare const evokePortkey: {
|
|
8
8
|
custom: import("@portkey/utils/dist/commonjs/scheme").LinkDappData;
|
9
9
|
} & import("./types").IBaseEvokeAppOption): void;
|
10
10
|
};
|
11
|
-
extension: () => Promise<boolean>;
|
11
|
+
extension: (params?: import("./types").IEvokeExtensionProps | undefined) => Promise<boolean>;
|
12
12
|
thirdParty: {
|
13
13
|
(params?: ({
|
14
14
|
action: "login";
|
@@ -7,4 +7,4 @@ export const EXTENSION_DOWNLOAD_URL = {
|
|
7
7
|
EDGE: 'https://chrome.google.com/webstore/detail/portkey-did-crypto-nft/hpjiiechbbhefmpggegmahejiiphbmij',
|
8
8
|
DEFAULT: 'https://portkey.finance/download',
|
9
9
|
};
|
10
|
-
export const WEB_PAGE = '
|
10
|
+
export const WEB_PAGE = 'https://openlogin-test.portkey.finance';
|
@@ -10,7 +10,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
10
10
|
import { sleep } from '@portkey/utils';
|
11
11
|
import { detectBrowserName } from '../utils/index.js';
|
12
12
|
import { EXTENSION_DOWNLOAD_URL } from '../constants/index.js';
|
13
|
-
const checkPortkeyExtension = () => __awaiter(void 0, void 0, void 0, function* () {
|
13
|
+
const checkPortkeyExtension = (params) => __awaiter(void 0, void 0, void 0, function* () {
|
14
|
+
const openTarget = params === null || params === void 0 ? void 0 : params.openTarget;
|
14
15
|
if (typeof window === 'undefined')
|
15
16
|
return false;
|
16
17
|
const _window = window;
|
@@ -21,7 +22,7 @@ const checkPortkeyExtension = () => __awaiter(void 0, void 0, void 0, function*
|
|
21
22
|
return true;
|
22
23
|
const browserName = detectBrowserName();
|
23
24
|
const downloadURL = EXTENSION_DOWNLOAD_URL[browserName] || EXTENSION_DOWNLOAD_URL.DEFAULT;
|
24
|
-
_window.open(downloadURL,
|
25
|
+
_window.open(downloadURL, openTarget);
|
25
26
|
return false;
|
26
27
|
});
|
27
28
|
export default checkPortkeyExtension;
|
@@ -1,32 +1,4 @@
|
|
1
1
|
import { stringify } from 'query-string';
|
2
2
|
import { WEB_PAGE } from '../constants/index.js';
|
3
|
-
const evokeByThirdParty = params =>
|
4
|
-
let timer = null;
|
5
|
-
const onMessage = (event) => {
|
6
|
-
const type = event.data.type;
|
7
|
-
if (type === 'PortkeyDownloadOnSuccess' || type === 'PortkeyDownloadOnFailure') {
|
8
|
-
timer && clearInterval(timer);
|
9
|
-
}
|
10
|
-
switch (type) {
|
11
|
-
case 'PortkeyDownloadOnSuccess':
|
12
|
-
resolve(event.data.data);
|
13
|
-
break;
|
14
|
-
case 'PortkeyDownloadOnFailure':
|
15
|
-
reject(event.data.error);
|
16
|
-
break;
|
17
|
-
default:
|
18
|
-
return;
|
19
|
-
}
|
20
|
-
window.removeEventListener('message', onMessage);
|
21
|
-
};
|
22
|
-
window.addEventListener('message', onMessage);
|
23
|
-
const windowOpener = window.open(`${WEB_PAGE}/portkey-download?${stringify(params)}`);
|
24
|
-
timer = setInterval(() => {
|
25
|
-
if (windowOpener === null || windowOpener === void 0 ? void 0 : windowOpener.closed) {
|
26
|
-
clearInterval(timer);
|
27
|
-
reject('User close the prompt');
|
28
|
-
timer = null;
|
29
|
-
}
|
30
|
-
}, 1600);
|
31
|
-
});
|
3
|
+
const evokeByThirdParty = params => Promise.resolve(window.open(`${WEB_PAGE}/portkey-download?${stringify(params)}`));
|
32
4
|
export default evokeByThirdParty;
|
@@ -8,7 +8,7 @@ export declare const evokePortkey: {
|
|
8
8
|
custom: import("@portkey/utils/dist/commonjs/scheme").LinkDappData;
|
9
9
|
} & import("./types").IBaseEvokeAppOption): void;
|
10
10
|
};
|
11
|
-
extension: () => Promise<boolean>;
|
11
|
+
extension: (params?: import("./types").IEvokeExtensionProps | undefined) => Promise<boolean>;
|
12
12
|
thirdParty: {
|
13
13
|
(params?: ({
|
14
14
|
action: "login";
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/constants/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB;;;CAG5B,CAAC;AACF,eAAO,MAAM,sBAAsB;;;;CAIlC,CAAC;
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/constants/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB;;;CAG5B,CAAC;AACF,eAAO,MAAM,sBAAsB;;;;CAIlC,CAAC;AAGF,eAAO,MAAM,QAAQ,2CAA2C,CAAC"}
|
@@ -1,3 +1,4 @@
|
|
1
|
-
|
1
|
+
import { IEvokeExtensionProps } from './types';
|
2
|
+
declare const checkPortkeyExtension: (params?: IEvokeExtensionProps) => Promise<boolean>;
|
2
3
|
export default checkPortkeyExtension;
|
3
4
|
//# sourceMappingURL=checkPortkeyExtension.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"checkPortkeyExtension.d.ts","sourceRoot":"","sources":["../../../src/evokePortkey/checkPortkeyExtension.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"checkPortkeyExtension.d.ts","sourceRoot":"","sources":["../../../src/evokePortkey/checkPortkeyExtension.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAE/C,QAAA,MAAM,qBAAqB,YAAmB,oBAAoB,qBAajE,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"evokeByThirdParty.d.ts","sourceRoot":"","sources":["../../../src/evokePortkey/evokeByThirdParty.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC,KAAK,WAAW,GAAG;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,UAAU,kBAAkB;IAC1B,iBAAiB,CACf,MAAM,CAAC,EAAE;QACP,MAAM,EAAE,OAAO,CAAC;QAChB,MAAM,EAAE,MAAM,CAAC,wBAAwB,CAAC,QAAQ,CAAC,CAAC;KACnD,GAAG,WAAW,GACd,OAAO,CAAC,GAAG,CAAC,CAAC;IAChB,iBAAiB,CACf,MAAM,CAAC,EAAE;QACP,MAAM,EAAE,UAAU,CAAC;QACnB,MAAM,EAAE,MAAM,CAAC,2BAA2B,CAAC,QAAQ,CAAC,CAAC;KACtD,GAAG,WAAW,GACd,OAAO,CAAC,GAAG,CAAC,CAAC;CACjB;AAED,QAAA,MAAM,iBAAiB,EAAE,kBAAkB,CAAC,mBAAmB,
|
1
|
+
{"version":3,"file":"evokeByThirdParty.d.ts","sourceRoot":"","sources":["../../../src/evokePortkey/evokeByThirdParty.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC,KAAK,WAAW,GAAG;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,UAAU,kBAAkB;IAC1B,iBAAiB,CACf,MAAM,CAAC,EAAE;QACP,MAAM,EAAE,OAAO,CAAC;QAChB,MAAM,EAAE,MAAM,CAAC,wBAAwB,CAAC,QAAQ,CAAC,CAAC;KACnD,GAAG,WAAW,GACd,OAAO,CAAC,GAAG,CAAC,CAAC;IAChB,iBAAiB,CACf,MAAM,CAAC,EAAE;QACP,MAAM,EAAE,UAAU,CAAC;QACnB,MAAM,EAAE,MAAM,CAAC,2BAA2B,CAAC,QAAQ,CAAC,CAAC;KACtD,GAAG,WAAW,GACd,OAAO,CAAC,GAAG,CAAC,CAAC;CACjB;AAED,QAAA,MAAM,iBAAiB,EAAE,kBAAkB,CAAC,mBAAmB,CACoB,CAAC;AAEpF,eAAe,iBAAiB,CAAC"}
|
@@ -8,7 +8,7 @@ export declare const evokePortkey: {
|
|
8
8
|
custom: import("@portkey/utils/dist/commonjs/scheme").LinkDappData;
|
9
9
|
} & import("./types").IBaseEvokeAppOption): void;
|
10
10
|
};
|
11
|
-
extension: () => Promise<boolean>;
|
11
|
+
extension: (params?: import("./types").IEvokeExtensionProps | undefined) => Promise<boolean>;
|
12
12
|
thirdParty: {
|
13
13
|
(params?: ({
|
14
14
|
action: "login";
|
@@ -12,5 +12,8 @@ export interface IEvokePortkeyApp {
|
|
12
12
|
evokePortkeyApp(params: EvokePortkeyByLogin): void;
|
13
13
|
evokePortkeyApp(params: EvokePortkeyByLinkDapp): void;
|
14
14
|
}
|
15
|
+
export interface IEvokeExtensionProps {
|
16
|
+
openTarget?: '_self' | '_blank';
|
17
|
+
}
|
15
18
|
export {};
|
16
19
|
//# sourceMappingURL=types.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/evokePortkey/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,MAAM,IAAI,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAEvD,MAAM,WAAW,mBAAmB;IAClC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,qBAAqB,CAAC,EAAE,MAAM,IAAI,CAAC;IACnC,cAAc,CAAC,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;CAC7C;AAED,MAAM,MAAM,mBAAmB,GAAG,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC,wBAAwB,EAAE,QAAQ,CAAC,EAAE,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package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@portkey/onboarding",
|
3
|
-
"version": "1.
|
3
|
+
"version": "1.5.0-alpha.5",
|
4
4
|
"description": "",
|
5
5
|
"main": "./dist/commonjs/index.js",
|
6
6
|
"module": "./dist/esm/index.js",
|
@@ -40,10 +40,10 @@
|
|
40
40
|
"start": "tsc --watch"
|
41
41
|
},
|
42
42
|
"dependencies": {
|
43
|
-
"@portkey/types": "^1.
|
44
|
-
"@portkey/utils": "^1.
|
43
|
+
"@portkey/types": "^1.5.0-alpha.5",
|
44
|
+
"@portkey/utils": "^1.5.0-alpha.5",
|
45
45
|
"bowser": "^2.11.0",
|
46
46
|
"query-string": "^7.1.1"
|
47
47
|
},
|
48
|
-
"gitHead": "
|
48
|
+
"gitHead": "6cfa5706ea9c452fcaa46f922a034284c6506096"
|
49
49
|
}
|