@frontiertower/frontier-sdk 0.1.0
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/README.md +107 -0
- package/dist/index.d.mts +542 -0
- package/dist/index.d.ts +542 -0
- package/dist/index.js +480 -0
- package/dist/index.mjs +449 -0
- package/dist/ui-utils/index.d.mts +23 -0
- package/dist/ui-utils/index.d.ts +23 -0
- package/dist/ui-utils/index.js +268 -0
- package/dist/ui-utils/index.mjs +238 -0
- package/package.json +49 -0
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/ui-utils/index.ts
|
|
21
|
+
var ui_utils_exports = {};
|
|
22
|
+
__export(ui_utils_exports, {
|
|
23
|
+
createStandaloneHTML: () => createStandaloneHTML,
|
|
24
|
+
getParentOrigin: () => getParentOrigin,
|
|
25
|
+
isInFrontierApp: () => isInFrontierApp,
|
|
26
|
+
renderStandaloneMessage: () => renderStandaloneMessage
|
|
27
|
+
});
|
|
28
|
+
module.exports = __toCommonJS(ui_utils_exports);
|
|
29
|
+
|
|
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
|
+
function isInFrontierApp() {
|
|
39
|
+
if (window.parent === window) {
|
|
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;
|
|
57
|
+
}
|
|
58
|
+
function getParentOrigin() {
|
|
59
|
+
try {
|
|
60
|
+
if (window.parent !== window) {
|
|
61
|
+
if (document.referrer) {
|
|
62
|
+
return new URL(document.referrer).origin;
|
|
63
|
+
}
|
|
64
|
+
return window.parent.location.origin;
|
|
65
|
+
}
|
|
66
|
+
} catch (e) {
|
|
67
|
+
if (document.referrer) {
|
|
68
|
+
return new URL(document.referrer).origin;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// src/ui-utils/standalone.ts
|
|
75
|
+
function renderStandaloneMessage(container, appName = "Frontier App") {
|
|
76
|
+
container.innerHTML = `
|
|
77
|
+
<div style="
|
|
78
|
+
min-height: 100vh;
|
|
79
|
+
display: flex;
|
|
80
|
+
align-items: center;
|
|
81
|
+
justify-content: center;
|
|
82
|
+
padding: 1.5rem;
|
|
83
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
84
|
+
">
|
|
85
|
+
<div style="
|
|
86
|
+
max-width: 32rem;
|
|
87
|
+
width: 100%;
|
|
88
|
+
background: white;
|
|
89
|
+
border-radius: 1rem;
|
|
90
|
+
padding: 2rem;
|
|
91
|
+
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
|
|
92
|
+
">
|
|
93
|
+
<h1 style="
|
|
94
|
+
font-size: 2rem;
|
|
95
|
+
font-weight: bold;
|
|
96
|
+
margin-bottom: 1rem;
|
|
97
|
+
color: #1a202c;
|
|
98
|
+
">
|
|
99
|
+
\u{1F680} ${appName}
|
|
100
|
+
</h1>
|
|
101
|
+
|
|
102
|
+
<div style="
|
|
103
|
+
background: #f7fafc;
|
|
104
|
+
border-radius: 0.5rem;
|
|
105
|
+
padding: 1.5rem;
|
|
106
|
+
margin-bottom: 1rem;
|
|
107
|
+
">
|
|
108
|
+
<h2 style="
|
|
109
|
+
font-size: 1.25rem;
|
|
110
|
+
font-weight: 600;
|
|
111
|
+
margin-bottom: 0.75rem;
|
|
112
|
+
color: #2d3748;
|
|
113
|
+
">
|
|
114
|
+
Frontier Wallet Required
|
|
115
|
+
</h2>
|
|
116
|
+
<p style="
|
|
117
|
+
color: #4a5568;
|
|
118
|
+
line-height: 1.6;
|
|
119
|
+
margin-bottom: 1rem;
|
|
120
|
+
">
|
|
121
|
+
This is a Frontier App and needs to be opened within the Frontier Wallet.
|
|
122
|
+
</p>
|
|
123
|
+
<p style="
|
|
124
|
+
color: #4a5568;
|
|
125
|
+
font-weight: 600;
|
|
126
|
+
margin-bottom: 0.5rem;
|
|
127
|
+
">
|
|
128
|
+
To use this app:
|
|
129
|
+
</p>
|
|
130
|
+
<ol style="
|
|
131
|
+
margin-left: 1.5rem;
|
|
132
|
+
color: #4a5568;
|
|
133
|
+
line-height: 1.8;
|
|
134
|
+
">
|
|
135
|
+
<li>Visit <a href="https://wallet.frontiertower.io" style="color: #667eea; text-decoration: underline; font-weight: 500;">wallet.frontiertower.io</a></li>
|
|
136
|
+
<li>Go to the App Store</li>
|
|
137
|
+
<li>Install this app</li>
|
|
138
|
+
</ol>
|
|
139
|
+
</div>
|
|
140
|
+
|
|
141
|
+
<div style="
|
|
142
|
+
text-align: center;
|
|
143
|
+
padding-top: 1rem;
|
|
144
|
+
border-top: 1px solid #e2e8f0;
|
|
145
|
+
">
|
|
146
|
+
<a
|
|
147
|
+
href="https://wallet.frontiertower.io"
|
|
148
|
+
style="
|
|
149
|
+
display: inline-block;
|
|
150
|
+
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
151
|
+
color: white;
|
|
152
|
+
padding: 0.75rem 2rem;
|
|
153
|
+
border-radius: 0.5rem;
|
|
154
|
+
text-decoration: none;
|
|
155
|
+
font-weight: 600;
|
|
156
|
+
transition: transform 0.2s;
|
|
157
|
+
"
|
|
158
|
+
onmouseover="this.style.transform='scale(1.05)'"
|
|
159
|
+
onmouseout="this.style.transform='scale(1)'"
|
|
160
|
+
>
|
|
161
|
+
Open Frontier Wallet
|
|
162
|
+
</a>
|
|
163
|
+
</div>
|
|
164
|
+
</div>
|
|
165
|
+
</div>
|
|
166
|
+
`;
|
|
167
|
+
}
|
|
168
|
+
function createStandaloneHTML(appName = "Frontier App") {
|
|
169
|
+
return `
|
|
170
|
+
<div style="
|
|
171
|
+
min-height: 100vh;
|
|
172
|
+
display: flex;
|
|
173
|
+
align-items: center;
|
|
174
|
+
justify-content: center;
|
|
175
|
+
padding: 1.5rem;
|
|
176
|
+
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
177
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
178
|
+
">
|
|
179
|
+
<div style="
|
|
180
|
+
max-width: 32rem;
|
|
181
|
+
width: 100%;
|
|
182
|
+
background: white;
|
|
183
|
+
border-radius: 1rem;
|
|
184
|
+
padding: 2rem;
|
|
185
|
+
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
|
|
186
|
+
">
|
|
187
|
+
<h1 style="
|
|
188
|
+
font-size: 2rem;
|
|
189
|
+
font-weight: bold;
|
|
190
|
+
margin-bottom: 1rem;
|
|
191
|
+
color: #1a202c;
|
|
192
|
+
">
|
|
193
|
+
\u{1F680} ${appName}
|
|
194
|
+
</h1>
|
|
195
|
+
|
|
196
|
+
<div style="
|
|
197
|
+
background: #f7fafc;
|
|
198
|
+
border-radius: 0.5rem;
|
|
199
|
+
padding: 1.5rem;
|
|
200
|
+
margin-bottom: 1rem;
|
|
201
|
+
">
|
|
202
|
+
<h2 style="
|
|
203
|
+
font-size: 1.25rem;
|
|
204
|
+
font-weight: 600;
|
|
205
|
+
margin-bottom: 0.75rem;
|
|
206
|
+
color: #2d3748;
|
|
207
|
+
">
|
|
208
|
+
Frontier Wallet Required
|
|
209
|
+
</h2>
|
|
210
|
+
<p style="
|
|
211
|
+
color: #4a5568;
|
|
212
|
+
line-height: 1.6;
|
|
213
|
+
margin-bottom: 1rem;
|
|
214
|
+
">
|
|
215
|
+
This is a Frontier App and needs to be opened within the Frontier Wallet.
|
|
216
|
+
</p>
|
|
217
|
+
<p style="
|
|
218
|
+
color: #4a5568;
|
|
219
|
+
font-weight: 600;
|
|
220
|
+
margin-bottom: 0.5rem;
|
|
221
|
+
">
|
|
222
|
+
To use this app:
|
|
223
|
+
</p>
|
|
224
|
+
<ol style="
|
|
225
|
+
margin-left: 1.5rem;
|
|
226
|
+
color: #4a5568;
|
|
227
|
+
line-height: 1.8;
|
|
228
|
+
">
|
|
229
|
+
<li>Visit <a href="https://wallet.frontiertower.io" style="color: #667eea; text-decoration: underline; font-weight: 500;">wallet.frontiertower.io</a></li>
|
|
230
|
+
<li>Go to the App Store</li>
|
|
231
|
+
<li>Install this app</li>
|
|
232
|
+
</ol>
|
|
233
|
+
</div>
|
|
234
|
+
|
|
235
|
+
<div style="
|
|
236
|
+
text-align: center;
|
|
237
|
+
padding-top: 1rem;
|
|
238
|
+
border-top: 1px solid #e2e8f0;
|
|
239
|
+
">
|
|
240
|
+
<a
|
|
241
|
+
href="https://wallet.frontiertower.io"
|
|
242
|
+
style="
|
|
243
|
+
display: inline-block;
|
|
244
|
+
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
245
|
+
color: white;
|
|
246
|
+
padding: 0.75rem 2rem;
|
|
247
|
+
border-radius: 0.5rem;
|
|
248
|
+
text-decoration: none;
|
|
249
|
+
font-weight: 600;
|
|
250
|
+
transition: transform 0.2s;
|
|
251
|
+
"
|
|
252
|
+
onmouseover="this.style.transform='scale(1.05)'"
|
|
253
|
+
onmouseout="this.style.transform='scale(1)'"
|
|
254
|
+
>
|
|
255
|
+
Open Frontier Wallet
|
|
256
|
+
</a>
|
|
257
|
+
</div>
|
|
258
|
+
</div>
|
|
259
|
+
</div>
|
|
260
|
+
`;
|
|
261
|
+
}
|
|
262
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
263
|
+
0 && (module.exports = {
|
|
264
|
+
createStandaloneHTML,
|
|
265
|
+
getParentOrigin,
|
|
266
|
+
isInFrontierApp,
|
|
267
|
+
renderStandaloneMessage
|
|
268
|
+
});
|
|
@@ -0,0 +1,238 @@
|
|
|
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
|
+
function isInFrontierApp() {
|
|
10
|
+
if (window.parent === window) {
|
|
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;
|
|
28
|
+
}
|
|
29
|
+
function getParentOrigin() {
|
|
30
|
+
try {
|
|
31
|
+
if (window.parent !== window) {
|
|
32
|
+
if (document.referrer) {
|
|
33
|
+
return new URL(document.referrer).origin;
|
|
34
|
+
}
|
|
35
|
+
return window.parent.location.origin;
|
|
36
|
+
}
|
|
37
|
+
} catch (e) {
|
|
38
|
+
if (document.referrer) {
|
|
39
|
+
return new URL(document.referrer).origin;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// src/ui-utils/standalone.ts
|
|
46
|
+
function renderStandaloneMessage(container, appName = "Frontier App") {
|
|
47
|
+
container.innerHTML = `
|
|
48
|
+
<div style="
|
|
49
|
+
min-height: 100vh;
|
|
50
|
+
display: flex;
|
|
51
|
+
align-items: center;
|
|
52
|
+
justify-content: center;
|
|
53
|
+
padding: 1.5rem;
|
|
54
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
55
|
+
">
|
|
56
|
+
<div style="
|
|
57
|
+
max-width: 32rem;
|
|
58
|
+
width: 100%;
|
|
59
|
+
background: white;
|
|
60
|
+
border-radius: 1rem;
|
|
61
|
+
padding: 2rem;
|
|
62
|
+
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
|
|
63
|
+
">
|
|
64
|
+
<h1 style="
|
|
65
|
+
font-size: 2rem;
|
|
66
|
+
font-weight: bold;
|
|
67
|
+
margin-bottom: 1rem;
|
|
68
|
+
color: #1a202c;
|
|
69
|
+
">
|
|
70
|
+
\u{1F680} ${appName}
|
|
71
|
+
</h1>
|
|
72
|
+
|
|
73
|
+
<div style="
|
|
74
|
+
background: #f7fafc;
|
|
75
|
+
border-radius: 0.5rem;
|
|
76
|
+
padding: 1.5rem;
|
|
77
|
+
margin-bottom: 1rem;
|
|
78
|
+
">
|
|
79
|
+
<h2 style="
|
|
80
|
+
font-size: 1.25rem;
|
|
81
|
+
font-weight: 600;
|
|
82
|
+
margin-bottom: 0.75rem;
|
|
83
|
+
color: #2d3748;
|
|
84
|
+
">
|
|
85
|
+
Frontier Wallet Required
|
|
86
|
+
</h2>
|
|
87
|
+
<p style="
|
|
88
|
+
color: #4a5568;
|
|
89
|
+
line-height: 1.6;
|
|
90
|
+
margin-bottom: 1rem;
|
|
91
|
+
">
|
|
92
|
+
This is a Frontier App and needs to be opened within the Frontier Wallet.
|
|
93
|
+
</p>
|
|
94
|
+
<p style="
|
|
95
|
+
color: #4a5568;
|
|
96
|
+
font-weight: 600;
|
|
97
|
+
margin-bottom: 0.5rem;
|
|
98
|
+
">
|
|
99
|
+
To use this app:
|
|
100
|
+
</p>
|
|
101
|
+
<ol style="
|
|
102
|
+
margin-left: 1.5rem;
|
|
103
|
+
color: #4a5568;
|
|
104
|
+
line-height: 1.8;
|
|
105
|
+
">
|
|
106
|
+
<li>Visit <a href="https://wallet.frontiertower.io" style="color: #667eea; text-decoration: underline; font-weight: 500;">wallet.frontiertower.io</a></li>
|
|
107
|
+
<li>Go to the App Store</li>
|
|
108
|
+
<li>Install this app</li>
|
|
109
|
+
</ol>
|
|
110
|
+
</div>
|
|
111
|
+
|
|
112
|
+
<div style="
|
|
113
|
+
text-align: center;
|
|
114
|
+
padding-top: 1rem;
|
|
115
|
+
border-top: 1px solid #e2e8f0;
|
|
116
|
+
">
|
|
117
|
+
<a
|
|
118
|
+
href="https://wallet.frontiertower.io"
|
|
119
|
+
style="
|
|
120
|
+
display: inline-block;
|
|
121
|
+
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
122
|
+
color: white;
|
|
123
|
+
padding: 0.75rem 2rem;
|
|
124
|
+
border-radius: 0.5rem;
|
|
125
|
+
text-decoration: none;
|
|
126
|
+
font-weight: 600;
|
|
127
|
+
transition: transform 0.2s;
|
|
128
|
+
"
|
|
129
|
+
onmouseover="this.style.transform='scale(1.05)'"
|
|
130
|
+
onmouseout="this.style.transform='scale(1)'"
|
|
131
|
+
>
|
|
132
|
+
Open Frontier Wallet
|
|
133
|
+
</a>
|
|
134
|
+
</div>
|
|
135
|
+
</div>
|
|
136
|
+
</div>
|
|
137
|
+
`;
|
|
138
|
+
}
|
|
139
|
+
function createStandaloneHTML(appName = "Frontier App") {
|
|
140
|
+
return `
|
|
141
|
+
<div style="
|
|
142
|
+
min-height: 100vh;
|
|
143
|
+
display: flex;
|
|
144
|
+
align-items: center;
|
|
145
|
+
justify-content: center;
|
|
146
|
+
padding: 1.5rem;
|
|
147
|
+
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
148
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
149
|
+
">
|
|
150
|
+
<div style="
|
|
151
|
+
max-width: 32rem;
|
|
152
|
+
width: 100%;
|
|
153
|
+
background: white;
|
|
154
|
+
border-radius: 1rem;
|
|
155
|
+
padding: 2rem;
|
|
156
|
+
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
|
|
157
|
+
">
|
|
158
|
+
<h1 style="
|
|
159
|
+
font-size: 2rem;
|
|
160
|
+
font-weight: bold;
|
|
161
|
+
margin-bottom: 1rem;
|
|
162
|
+
color: #1a202c;
|
|
163
|
+
">
|
|
164
|
+
\u{1F680} ${appName}
|
|
165
|
+
</h1>
|
|
166
|
+
|
|
167
|
+
<div style="
|
|
168
|
+
background: #f7fafc;
|
|
169
|
+
border-radius: 0.5rem;
|
|
170
|
+
padding: 1.5rem;
|
|
171
|
+
margin-bottom: 1rem;
|
|
172
|
+
">
|
|
173
|
+
<h2 style="
|
|
174
|
+
font-size: 1.25rem;
|
|
175
|
+
font-weight: 600;
|
|
176
|
+
margin-bottom: 0.75rem;
|
|
177
|
+
color: #2d3748;
|
|
178
|
+
">
|
|
179
|
+
Frontier Wallet Required
|
|
180
|
+
</h2>
|
|
181
|
+
<p style="
|
|
182
|
+
color: #4a5568;
|
|
183
|
+
line-height: 1.6;
|
|
184
|
+
margin-bottom: 1rem;
|
|
185
|
+
">
|
|
186
|
+
This is a Frontier App and needs to be opened within the Frontier Wallet.
|
|
187
|
+
</p>
|
|
188
|
+
<p style="
|
|
189
|
+
color: #4a5568;
|
|
190
|
+
font-weight: 600;
|
|
191
|
+
margin-bottom: 0.5rem;
|
|
192
|
+
">
|
|
193
|
+
To use this app:
|
|
194
|
+
</p>
|
|
195
|
+
<ol style="
|
|
196
|
+
margin-left: 1.5rem;
|
|
197
|
+
color: #4a5568;
|
|
198
|
+
line-height: 1.8;
|
|
199
|
+
">
|
|
200
|
+
<li>Visit <a href="https://wallet.frontiertower.io" style="color: #667eea; text-decoration: underline; font-weight: 500;">wallet.frontiertower.io</a></li>
|
|
201
|
+
<li>Go to the App Store</li>
|
|
202
|
+
<li>Install this app</li>
|
|
203
|
+
</ol>
|
|
204
|
+
</div>
|
|
205
|
+
|
|
206
|
+
<div style="
|
|
207
|
+
text-align: center;
|
|
208
|
+
padding-top: 1rem;
|
|
209
|
+
border-top: 1px solid #e2e8f0;
|
|
210
|
+
">
|
|
211
|
+
<a
|
|
212
|
+
href="https://wallet.frontiertower.io"
|
|
213
|
+
style="
|
|
214
|
+
display: inline-block;
|
|
215
|
+
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
216
|
+
color: white;
|
|
217
|
+
padding: 0.75rem 2rem;
|
|
218
|
+
border-radius: 0.5rem;
|
|
219
|
+
text-decoration: none;
|
|
220
|
+
font-weight: 600;
|
|
221
|
+
transition: transform 0.2s;
|
|
222
|
+
"
|
|
223
|
+
onmouseover="this.style.transform='scale(1.05)'"
|
|
224
|
+
onmouseout="this.style.transform='scale(1)'"
|
|
225
|
+
>
|
|
226
|
+
Open Frontier Wallet
|
|
227
|
+
</a>
|
|
228
|
+
</div>
|
|
229
|
+
</div>
|
|
230
|
+
</div>
|
|
231
|
+
`;
|
|
232
|
+
}
|
|
233
|
+
export {
|
|
234
|
+
createStandaloneHTML,
|
|
235
|
+
getParentOrigin,
|
|
236
|
+
isInFrontierApp,
|
|
237
|
+
renderStandaloneMessage
|
|
238
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@frontiertower/frontier-sdk",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "SDK for building apps on Frontier Wallet",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"module": "./dist/index.mjs",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.mjs",
|
|
12
|
+
"require": "./dist/index.js"
|
|
13
|
+
},
|
|
14
|
+
"./ui-utils": {
|
|
15
|
+
"types": "./dist/ui-utils/index.d.ts",
|
|
16
|
+
"import": "./dist/ui-utils/index.mjs",
|
|
17
|
+
"require": "./dist/ui-utils/index.js"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"dist"
|
|
22
|
+
],
|
|
23
|
+
"scripts": {
|
|
24
|
+
"build": "tsup src/index.ts src/ui-utils/index.ts --format cjs,esm --dts --clean",
|
|
25
|
+
"dev": "tsup src/index.ts src/ui-utils/index.ts --format cjs,esm --dts --watch",
|
|
26
|
+
"test": "vitest run",
|
|
27
|
+
"test:watch": "vitest",
|
|
28
|
+
"prepublishOnly": "npm run build"
|
|
29
|
+
},
|
|
30
|
+
"keywords": [
|
|
31
|
+
"frontier",
|
|
32
|
+
"wallet",
|
|
33
|
+
"web3",
|
|
34
|
+
"sdk"
|
|
35
|
+
],
|
|
36
|
+
"author": "Frontier Tower",
|
|
37
|
+
"license": "MIT",
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"@vitest/ui": "^2.1.0",
|
|
40
|
+
"happy-dom": "^15.0.0",
|
|
41
|
+
"tsup": "^8.0.1",
|
|
42
|
+
"typescript": "^5.3.3",
|
|
43
|
+
"vitest": "^2.1.0"
|
|
44
|
+
},
|
|
45
|
+
"repository": {
|
|
46
|
+
"type": "git",
|
|
47
|
+
"url": "https://github.com/frontiertower/frontier-sdk.git"
|
|
48
|
+
}
|
|
49
|
+
}
|