@frontiertower/frontier-sdk 0.1.1 → 0.1.3
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/ui-utils/index.d.ts
CHANGED
package/dist/ui-utils/index.js
CHANGED
|
@@ -28,32 +28,8 @@ __export(ui_utils_exports, {
|
|
|
28
28
|
module.exports = __toCommonJS(ui_utils_exports);
|
|
29
29
|
|
|
30
30
|
// src/ui-utils/detection.ts
|
|
31
|
-
var ALLOWED_ORIGINS = [
|
|
32
|
-
"http://localhost:5173",
|
|
33
|
-
"https://sandbox.wallet.frontiertower.io",
|
|
34
|
-
"https://alpha.wallet.frontiertower.io",
|
|
35
|
-
"https://beta.wallet.frontiertower.io",
|
|
36
|
-
"https://wallet.frontiertower.io"
|
|
37
|
-
];
|
|
38
31
|
function isInFrontierApp() {
|
|
39
|
-
|
|
40
|
-
return false;
|
|
41
|
-
}
|
|
42
|
-
try {
|
|
43
|
-
const parentOrigin = document.referrer ? new URL(document.referrer).origin : null;
|
|
44
|
-
if (parentOrigin && ALLOWED_ORIGINS.includes(parentOrigin)) {
|
|
45
|
-
return true;
|
|
46
|
-
}
|
|
47
|
-
if (window.parent.location.origin && ALLOWED_ORIGINS.includes(window.parent.location.origin)) {
|
|
48
|
-
return true;
|
|
49
|
-
}
|
|
50
|
-
} catch (e) {
|
|
51
|
-
if (document.referrer) {
|
|
52
|
-
const referrerOrigin = new URL(document.referrer).origin;
|
|
53
|
-
return ALLOWED_ORIGINS.includes(referrerOrigin);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
return false;
|
|
32
|
+
return window.self !== window.top;
|
|
57
33
|
}
|
|
58
34
|
function getParentOrigin() {
|
|
59
35
|
try {
|
package/dist/ui-utils/index.mjs
CHANGED
|
@@ -1,30 +1,6 @@
|
|
|
1
1
|
// src/ui-utils/detection.ts
|
|
2
|
-
var ALLOWED_ORIGINS = [
|
|
3
|
-
"http://localhost:5173",
|
|
4
|
-
"https://sandbox.wallet.frontiertower.io",
|
|
5
|
-
"https://alpha.wallet.frontiertower.io",
|
|
6
|
-
"https://beta.wallet.frontiertower.io",
|
|
7
|
-
"https://wallet.frontiertower.io"
|
|
8
|
-
];
|
|
9
2
|
function isInFrontierApp() {
|
|
10
|
-
|
|
11
|
-
return false;
|
|
12
|
-
}
|
|
13
|
-
try {
|
|
14
|
-
const parentOrigin = document.referrer ? new URL(document.referrer).origin : null;
|
|
15
|
-
if (parentOrigin && ALLOWED_ORIGINS.includes(parentOrigin)) {
|
|
16
|
-
return true;
|
|
17
|
-
}
|
|
18
|
-
if (window.parent.location.origin && ALLOWED_ORIGINS.includes(window.parent.location.origin)) {
|
|
19
|
-
return true;
|
|
20
|
-
}
|
|
21
|
-
} catch (e) {
|
|
22
|
-
if (document.referrer) {
|
|
23
|
-
const referrerOrigin = new URL(document.referrer).origin;
|
|
24
|
-
return ALLOWED_ORIGINS.includes(referrerOrigin);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
return false;
|
|
3
|
+
return window.self !== window.top;
|
|
28
4
|
}
|
|
29
5
|
function getParentOrigin() {
|
|
30
6
|
try {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frontiertower/frontier-sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "SDK for building apps on Frontier Wallet",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
20
|
"files": [
|
|
21
|
-
"dist"
|
|
21
|
+
"dist",
|
|
22
|
+
"README.md"
|
|
22
23
|
],
|
|
23
24
|
"scripts": {
|
|
24
25
|
"build": "tsup src/index.ts src/ui-utils/index.ts --format cjs,esm --dts --clean",
|