@burnt-labs/abstraxion 0.0.1-alpha.1
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 +59 -0
- package/dist/index.d.ts +38 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/main.js +1125 -0
- package/dist/main.js.map +1 -0
- package/dist/module.js +1113 -0
- package/dist/module.js.map +1 -0
- package/package.json +59 -0
package/dist/main.js
ADDED
|
@@ -0,0 +1,1125 @@
|
|
|
1
|
+
var $8zHUo$reactjsxruntime = require("react/jsx-runtime");
|
|
2
|
+
var $8zHUo$react = require("react");
|
|
3
|
+
var $8zHUo$graz = require("graz");
|
|
4
|
+
var $8zHUo$stytchreact = require("@stytch/react");
|
|
5
|
+
var $8zHUo$apolloclient = require("@apollo/client");
|
|
6
|
+
var $8zHUo$styledcomponents = require("styled-components");
|
|
7
|
+
var $8zHUo$reactpininput = require("react-pin-input");
|
|
8
|
+
var $8zHUo$stytchvanillajs = require("@stytch/vanilla-js");
|
|
9
|
+
var $8zHUo$grazdistcosmjs = require("graz/dist/cosmjs");
|
|
10
|
+
var $8zHUo$burntlabsabstractsigners = require("@burnt-labs/abstract-signers");
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
function $parcel$export(e, n, v, s) {
|
|
14
|
+
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function $parcel$interopDefault(a) {
|
|
18
|
+
return a && a.__esModule ? a.default : a;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
$parcel$export(module.exports, "Abstraxion", () => $48cebc9c8153b310$export$7623e21b9721522e);
|
|
22
|
+
$parcel$export(module.exports, "AbstraxionProvider", () => $48cebc9c8153b310$export$b49560c6340d7499);
|
|
23
|
+
$parcel$export(module.exports, "useAbstraxionAccount", () => $8253037134647552$export$d6717fe814f1a6da);
|
|
24
|
+
$parcel$export(module.exports, "useAbstraxionSigningClient", () => $9b22f0a1f3460f8c$export$78e6fbad821288ed);
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
const $db7520b0c9ed95b0$var$CloseSvg = /*#__PURE__*/ (0, ($parcel$interopDefault($8zHUo$styledcomponents))).svg.withConfig({
|
|
33
|
+
componentId: "sc-1r5d3ey-0"
|
|
34
|
+
})([
|
|
35
|
+
"height:20px;width:20px;"
|
|
36
|
+
]);
|
|
37
|
+
const $db7520b0c9ed95b0$export$cae179f078f4b4a4 = ({ className: className })=>{
|
|
38
|
+
return /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsxs)($db7520b0c9ed95b0$var$CloseSvg, {
|
|
39
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
40
|
+
width: "24",
|
|
41
|
+
height: "24",
|
|
42
|
+
viewBox: "0 0 24 24",
|
|
43
|
+
fill: "none",
|
|
44
|
+
stroke: "black",
|
|
45
|
+
strokeWidth: "2",
|
|
46
|
+
strokeLinecap: "round",
|
|
47
|
+
strokeLinejoin: "round",
|
|
48
|
+
children: [
|
|
49
|
+
/*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)("path", {
|
|
50
|
+
d: "M18 6 6 18"
|
|
51
|
+
}),
|
|
52
|
+
/*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)("path", {
|
|
53
|
+
d: "m6 6 12 12"
|
|
54
|
+
})
|
|
55
|
+
]
|
|
56
|
+
});
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
const $da400face81accc1$export$2d5d2ba3c7c8c40b = /*#__PURE__*/ (0, ($parcel$interopDefault($8zHUo$styledcomponents))).button.withConfig({
|
|
65
|
+
componentId: "sc-12l4kfi-0"
|
|
66
|
+
})([
|
|
67
|
+
"font-size:14px;font-weight:700;padding:14px 20px;border-radius:5px;border:none;cursor:pointer;&:hover{opacity:0.7;}",
|
|
68
|
+
" ",
|
|
69
|
+
""
|
|
70
|
+
], (props)=>props.$fullwidth && (0, $8zHUo$styledcomponents.css)([
|
|
71
|
+
"width:100%;"
|
|
72
|
+
]), ({ $structure: $structure, $theme: $theme, disabled: disabled })=>{
|
|
73
|
+
// The disabled prop overrides the $theme prop and gives buttons a greyed-out look.
|
|
74
|
+
if (disabled) return (0, $8zHUo$styledcomponents.css)([
|
|
75
|
+
"pointer-events:none;",
|
|
76
|
+
" ",
|
|
77
|
+
" ",
|
|
78
|
+
""
|
|
79
|
+
], $structure === "base" && // disabled & base
|
|
80
|
+
(0, $8zHUo$styledcomponents.css)([
|
|
81
|
+
"background-color:#bdbdbd;color:#fff;"
|
|
82
|
+
]), $structure === "outlined" && // disabled & outlined
|
|
83
|
+
(0, $8zHUo$styledcomponents.css)([
|
|
84
|
+
"background-color:transparent;border:1px solid #bdbdbd;color:#bdbdbd;"
|
|
85
|
+
]), $structure === "naked" && // disabled & naked
|
|
86
|
+
(0, $8zHUo$styledcomponents.css)([
|
|
87
|
+
"color:#bdbdbd;"
|
|
88
|
+
]));
|
|
89
|
+
if ($structure === "outlined") {
|
|
90
|
+
if ($theme === "primary") // outlined & primary
|
|
91
|
+
return (0, $8zHUo$styledcomponents.css)([
|
|
92
|
+
"border:1px solid #01000a;background-color:transparent;"
|
|
93
|
+
]);
|
|
94
|
+
else if ($theme === "secondary") // outlined & secondary
|
|
95
|
+
return (0, $8zHUo$styledcomponents.css)([
|
|
96
|
+
"border:1px solid #00000033;background-color:transparent;color:black;"
|
|
97
|
+
]);
|
|
98
|
+
else if ($theme === "destructive") // outlined & destructive
|
|
99
|
+
return (0, $8zHUo$styledcomponents.css)([
|
|
100
|
+
"border:1px solid #ff4136;background-color:transparent;color:#ff4136;"
|
|
101
|
+
]);
|
|
102
|
+
} else if ($structure === "naked") {
|
|
103
|
+
if ($theme === "primary") // naked & primary
|
|
104
|
+
return (0, $8zHUo$styledcomponents.css)([
|
|
105
|
+
"border:none;background-color:inherit;color:black;text-decoration:underline;font-weight:400;"
|
|
106
|
+
]);
|
|
107
|
+
else if ($theme === "secondary") // naked & secondary
|
|
108
|
+
return (0, $8zHUo$styledcomponents.css)([
|
|
109
|
+
"border:none;background-color:transparent;color:#00000033;"
|
|
110
|
+
]);
|
|
111
|
+
else if ($theme === "destructive") // naked & destructive
|
|
112
|
+
return (0, $8zHUo$styledcomponents.css)([
|
|
113
|
+
"border:none;background-color:transparent;color:#ff4136;"
|
|
114
|
+
]);
|
|
115
|
+
} else {
|
|
116
|
+
// base
|
|
117
|
+
if ($theme === "primary") // base & primary
|
|
118
|
+
return (0, $8zHUo$styledcomponents.css)([
|
|
119
|
+
"background-color:#01000a;color:white;"
|
|
120
|
+
]);
|
|
121
|
+
else if ($theme === "secondary") // base & secondary
|
|
122
|
+
return (0, $8zHUo$styledcomponents.css)([
|
|
123
|
+
"background-color:#f0f0f0;"
|
|
124
|
+
]);
|
|
125
|
+
else if ($theme === "destructive") // base & destructive
|
|
126
|
+
return (0, $8zHUo$styledcomponents.css)([
|
|
127
|
+
"background-color:#ff4136;color:white;"
|
|
128
|
+
]);
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
const $d9dd93c5f3fbc1f7$export$353f5b6fc5456de1 = ({ structure: structure = "base", theme: theme = "primary", fullwidth: fullwidth = false, disabled: disabled = false, onClick: onClick, children: children, style: style })=>{
|
|
134
|
+
return /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $da400face81accc1$export$2d5d2ba3c7c8c40b), {
|
|
135
|
+
disabled: disabled,
|
|
136
|
+
onClick: onClick,
|
|
137
|
+
$structure: structure,
|
|
138
|
+
$theme: theme,
|
|
139
|
+
$fullwidth: fullwidth,
|
|
140
|
+
style: style,
|
|
141
|
+
children: children
|
|
142
|
+
});
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
const $6cbec8dd895efec9$export$e3d48f88b07b12f5 = /*#__PURE__*/ (0, ($parcel$interopDefault($8zHUo$styledcomponents))).div.withConfig({
|
|
148
|
+
componentId: "sc-ydvlg3-0"
|
|
149
|
+
})([
|
|
150
|
+
"display:flex;flex-direction:column;justify-content:center;align-items:flex-start;width:100%;height:100%;padding:2rem;gap:1rem;"
|
|
151
|
+
]);
|
|
152
|
+
const $6cbec8dd895efec9$export$dd1282f862e2055a = /*#__PURE__*/ (0, ($parcel$interopDefault($8zHUo$styledcomponents))).h1.withConfig({
|
|
153
|
+
componentId: "sc-ydvlg3-1"
|
|
154
|
+
})([
|
|
155
|
+
"color:black;font-size:32px;font-style:normal;font-weight:700;line-height:32px;letter-spacing:-0.96px;text-transform:uppercase;"
|
|
156
|
+
]);
|
|
157
|
+
const $6cbec8dd895efec9$export$a4fdd701a4280948 = /*#__PURE__*/ (0, ($parcel$interopDefault($8zHUo$styledcomponents))).h1.withConfig({
|
|
158
|
+
componentId: "sc-ydvlg3-2"
|
|
159
|
+
})([
|
|
160
|
+
"color:#6c6a6a;font-size:14px;font-style:normal;font-weight:400;line-height:20px;letter-spacing:-0.14px;"
|
|
161
|
+
]);
|
|
162
|
+
const $6cbec8dd895efec9$export$f9805d60e5ffbd25 = /*#__PURE__*/ (0, ($parcel$interopDefault($8zHUo$styledcomponents))).p.withConfig({
|
|
163
|
+
componentId: "sc-ydvlg3-3"
|
|
164
|
+
})([
|
|
165
|
+
"color:#6c6a6a;opacity:60%;font-size:14px;font-style:normal;font-weight:400;line-height:20px;letter-spacing:-0.14px;"
|
|
166
|
+
]);
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
const $0584e7e581a05238$export$b73cf336ef9f46b0 = /*#__PURE__*/ (0, $8zHUo$react.createContext)({});
|
|
172
|
+
const $0584e7e581a05238$export$94738ca1d1a3ac6d = ({ children: children })=>{
|
|
173
|
+
const [connectionType, setConnectionType] = (0, $8zHUo$react.useState)("none");
|
|
174
|
+
const [abstractAccount, setAbstractAccount] = (0, $8zHUo$react.useState)(undefined);
|
|
175
|
+
const [abstraxionError, setAbstraxionError] = (0, $8zHUo$react.useState)("");
|
|
176
|
+
return /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)($0584e7e581a05238$export$b73cf336ef9f46b0.Provider, {
|
|
177
|
+
value: {
|
|
178
|
+
connectionType: connectionType,
|
|
179
|
+
setConnectionType: setConnectionType,
|
|
180
|
+
abstractAccount: abstractAccount,
|
|
181
|
+
setAbstractAccount: setAbstractAccount,
|
|
182
|
+
abstraxionError: abstraxionError,
|
|
183
|
+
setAbstraxionError: setAbstraxionError
|
|
184
|
+
},
|
|
185
|
+
children: children
|
|
186
|
+
});
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
const $12f76906ffa65343$export$d56b0569bceb92ae = ({ message: message, onClose: onClose })=>{
|
|
191
|
+
const { setAbstraxionError: setAbstraxionError } = (0, $8zHUo$react.useContext)((0, $0584e7e581a05238$export$b73cf336ef9f46b0));
|
|
192
|
+
return /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsxs)((0, $6cbec8dd895efec9$export$e3d48f88b07b12f5), {
|
|
193
|
+
children: [
|
|
194
|
+
/*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $6cbec8dd895efec9$export$dd1282f862e2055a), {
|
|
195
|
+
children: "Uh oh."
|
|
196
|
+
}),
|
|
197
|
+
/*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $6cbec8dd895efec9$export$a4fdd701a4280948), {
|
|
198
|
+
children: "Something went wrong."
|
|
199
|
+
}),
|
|
200
|
+
message && /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $6cbec8dd895efec9$export$f9805d60e5ffbd25), {
|
|
201
|
+
children: message
|
|
202
|
+
}),
|
|
203
|
+
/*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $d9dd93c5f3fbc1f7$export$353f5b6fc5456de1), {
|
|
204
|
+
structure: "outlined",
|
|
205
|
+
theme: "secondary",
|
|
206
|
+
fullwidth: true,
|
|
207
|
+
onClick: ()=>{
|
|
208
|
+
onClose();
|
|
209
|
+
setAbstraxionError("");
|
|
210
|
+
},
|
|
211
|
+
children: "Dismiss"
|
|
212
|
+
})
|
|
213
|
+
]
|
|
214
|
+
});
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
const $f7d0d4a08cf217d9$export$3a45b3deef0778be = /*#__PURE__*/ (0, ($parcel$interopDefault($8zHUo$styledcomponents))).div.withConfig({
|
|
221
|
+
componentId: "sc-664vob-0"
|
|
222
|
+
})([
|
|
223
|
+
"display:flex;justify-content:center;align-items:center;position:fixed;top:0;left:0;width:100vw;height:100vh;z-index:100000;background-color:rgba(0,0,0,0.5);backdrop-filter:blur(2px);"
|
|
224
|
+
]);
|
|
225
|
+
const $f7d0d4a08cf217d9$export$2baf58024285a14c = /*#__PURE__*/ (0, ($parcel$interopDefault($8zHUo$styledcomponents))).div.withConfig({
|
|
226
|
+
componentId: "sc-664vob-1"
|
|
227
|
+
})([
|
|
228
|
+
"position:relative;width:100%;max-width:465px;background:white;color:black;"
|
|
229
|
+
]);
|
|
230
|
+
const $f7d0d4a08cf217d9$export$f55c3db6ddec6d02 = /*#__PURE__*/ (0, ($parcel$interopDefault($8zHUo$styledcomponents))).button.withConfig({
|
|
231
|
+
componentId: "sc-664vob-2"
|
|
232
|
+
})([
|
|
233
|
+
"padding:0.5rem;border-radius:8px;position:absolute;top:1rem;right:1rem;z-index:999;border:none;display:flex;align-items:center;justify-content:center;background-color:transparent;cursor:pointer;&:hover{background-color:#fafafa;}"
|
|
234
|
+
]);
|
|
235
|
+
const $f7d0d4a08cf217d9$export$57142b04d9e3944c = /*#__PURE__*/ (0, ($parcel$interopDefault($8zHUo$styledcomponents))).div.withConfig({
|
|
236
|
+
componentId: "sc-664vob-3"
|
|
237
|
+
})([
|
|
238
|
+
"width:100%;height:100%;display:inline-flex;padding:40px;flex-direction:column;align-items:flex-start;justify-content:space-between;gap:50px;"
|
|
239
|
+
]);
|
|
240
|
+
const $f7d0d4a08cf217d9$export$c3f823b2b7f71b6c = /*#__PURE__*/ (0, ($parcel$interopDefault($8zHUo$styledcomponents))).h1.withConfig({
|
|
241
|
+
componentId: "sc-664vob-4"
|
|
242
|
+
})([
|
|
243
|
+
"font-size:24px;font-weight:700;margin-bottom:12px;line-height:28px;"
|
|
244
|
+
]);
|
|
245
|
+
const $f7d0d4a08cf217d9$export$f3145f7fe860d62b = /*#__PURE__*/ (0, ($parcel$interopDefault($8zHUo$styledcomponents))).h2.withConfig({
|
|
246
|
+
componentId: "sc-664vob-5"
|
|
247
|
+
})([
|
|
248
|
+
"font-size:16px;font-weight:400;margin-bottom:12px;line-height:24px;"
|
|
249
|
+
]);
|
|
250
|
+
const $f7d0d4a08cf217d9$export$c5b7fb08338d9b33 = /*#__PURE__*/ (0, ($parcel$interopDefault($8zHUo$styledcomponents))).h1.withConfig({
|
|
251
|
+
componentId: "sc-664vob-6"
|
|
252
|
+
})([
|
|
253
|
+
'display:flex;flex-direction:row;font-size:12px;font-weight:500;width:100%;color:rgba(0,0,0,0.5);&:before,&:after{content:"";flex:1 1;border-bottom:1px solid rgba(0,0,0,0.1);margin:auto;}&:before{margin-right:20px;}&:after{margin-left:20px;}'
|
|
254
|
+
]);
|
|
255
|
+
const $f7d0d4a08cf217d9$export$69b1032f2ecdf404 = /*#__PURE__*/ (0, ($parcel$interopDefault($8zHUo$styledcomponents))).div.withConfig({
|
|
256
|
+
componentId: "sc-664vob-7"
|
|
257
|
+
})([
|
|
258
|
+
"display:flex;align-items:center;width:100%;gap:1rem;"
|
|
259
|
+
]);
|
|
260
|
+
const $f7d0d4a08cf217d9$export$dff4827a2e9bcd71 = /*#__PURE__*/ (0, ($parcel$interopDefault($8zHUo$styledcomponents))).p.withConfig({
|
|
261
|
+
componentId: "sc-664vob-8"
|
|
262
|
+
})([
|
|
263
|
+
"font-size:11px;line-height:16px;color:#a6a6a6;"
|
|
264
|
+
]);
|
|
265
|
+
const $f7d0d4a08cf217d9$export$3c9884e35bbfb1c9 = /*#__PURE__*/ (0, ($parcel$interopDefault($8zHUo$styledcomponents))).a.withConfig({
|
|
266
|
+
componentId: "sc-664vob-9"
|
|
267
|
+
})([
|
|
268
|
+
"color:black;text-decoration:none;&:hover{text-decoration:underline;}"
|
|
269
|
+
]);
|
|
270
|
+
const $f7d0d4a08cf217d9$export$2b556955fae2f624 = /*#__PURE__*/ (0, ($parcel$interopDefault($8zHUo$styledcomponents))).div.withConfig({
|
|
271
|
+
componentId: "sc-664vob-10"
|
|
272
|
+
})([
|
|
273
|
+
"width:100%;height:100%;display:flex;align-items:center;justify-content:center;"
|
|
274
|
+
]);
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
const $955915532c7140b2$export$7f7cbe89f1eacd2 = ()=>{
|
|
279
|
+
return /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)("svg", {
|
|
280
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
281
|
+
width: "3rem",
|
|
282
|
+
height: "3rem",
|
|
283
|
+
viewBox: "0 0 100 100",
|
|
284
|
+
preserveAspectRatio: "xMidYMid",
|
|
285
|
+
children: /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)("circle", {
|
|
286
|
+
cx: "50",
|
|
287
|
+
cy: "50",
|
|
288
|
+
fill: "none",
|
|
289
|
+
stroke: "#0a0a0a",
|
|
290
|
+
strokeWidth: "8",
|
|
291
|
+
r: "35",
|
|
292
|
+
strokeDasharray: "164.93361431346415 56.97787143782138",
|
|
293
|
+
children: /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)("animateTransform", {
|
|
294
|
+
attributeName: "transform",
|
|
295
|
+
type: "rotate",
|
|
296
|
+
repeatCount: "indefinite",
|
|
297
|
+
dur: "1.25s",
|
|
298
|
+
values: "0 50 50;360 50 50",
|
|
299
|
+
keyTimes: "0;1"
|
|
300
|
+
})
|
|
301
|
+
})
|
|
302
|
+
});
|
|
303
|
+
};
|
|
304
|
+
|
|
305
|
+
|
|
306
|
+
const $4e401ff008868fb1$export$fcbc8ef838a7ca2a = ()=>{
|
|
307
|
+
return /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsxs)((0, $f7d0d4a08cf217d9$export$57142b04d9e3944c), {
|
|
308
|
+
children: [
|
|
309
|
+
/*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsxs)("div", {
|
|
310
|
+
children: [
|
|
311
|
+
/*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $f7d0d4a08cf217d9$export$c3f823b2b7f71b6c), {
|
|
312
|
+
children: "Let's go"
|
|
313
|
+
}),
|
|
314
|
+
/*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $f7d0d4a08cf217d9$export$f3145f7fe860d62b), {
|
|
315
|
+
children: "Starting your journey..."
|
|
316
|
+
})
|
|
317
|
+
]
|
|
318
|
+
}),
|
|
319
|
+
/*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $f7d0d4a08cf217d9$export$2b556955fae2f624), {
|
|
320
|
+
children: /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $955915532c7140b2$export$7f7cbe89f1eacd2), {})
|
|
321
|
+
})
|
|
322
|
+
]
|
|
323
|
+
});
|
|
324
|
+
};
|
|
325
|
+
|
|
326
|
+
|
|
327
|
+
|
|
328
|
+
|
|
329
|
+
|
|
330
|
+
|
|
331
|
+
|
|
332
|
+
|
|
333
|
+
|
|
334
|
+
|
|
335
|
+
|
|
336
|
+
const $ceca9b2af98b0c95$export$24959d1cf524e21e = /*#__PURE__*/ (0, ($parcel$interopDefault($8zHUo$styledcomponents))).div.withConfig({
|
|
337
|
+
componentId: "sc-19qbcde-0"
|
|
338
|
+
})([
|
|
339
|
+
"width:100%;height:100%;display:inline-flex;padding:40px;flex-direction:column;align-items:flex-start;justify-content:space-between;gap:30px;"
|
|
340
|
+
]);
|
|
341
|
+
const $ceca9b2af98b0c95$export$b97d6b58b4bed532 = /*#__PURE__*/ (0, ($parcel$interopDefault($8zHUo$styledcomponents))).div.withConfig({
|
|
342
|
+
componentId: "sc-19qbcde-1"
|
|
343
|
+
})([
|
|
344
|
+
"display:flex;flex-direction:column;align-items:flex-start;justify-content:center;width:100%;gap:1rem;"
|
|
345
|
+
]);
|
|
346
|
+
const $ceca9b2af98b0c95$export$c14550826a96138d = /*#__PURE__*/ (0, ($parcel$interopDefault($8zHUo$styledcomponents))).div.withConfig({
|
|
347
|
+
componentId: "sc-19qbcde-2"
|
|
348
|
+
})([
|
|
349
|
+
"display:flex;flex-direction:column;align-items:flex-start;width:100%;gap:1rem;max-height:250px;overflow:scroll;"
|
|
350
|
+
]);
|
|
351
|
+
const $ceca9b2af98b0c95$export$dde344fa38e1a334 = /*#__PURE__*/ (0, ($parcel$interopDefault($8zHUo$styledcomponents))).h2.withConfig({
|
|
352
|
+
componentId: "sc-19qbcde-3"
|
|
353
|
+
})([
|
|
354
|
+
"font-size:16px;font-style:normal;font-weight:700;line-height:20px;letter-spacing:-0.16px;"
|
|
355
|
+
]);
|
|
356
|
+
const $ceca9b2af98b0c95$export$2528756baaccf436 = /*#__PURE__*/ (0, ($parcel$interopDefault($8zHUo$styledcomponents))).div.withConfig({
|
|
357
|
+
componentId: "sc-19qbcde-4"
|
|
358
|
+
})([
|
|
359
|
+
"display:flex;padding:1rem;border-radius:8px;background:#fafafa;align-items:center;width:100%;gap:1rem;",
|
|
360
|
+
""
|
|
361
|
+
], (props)=>props.$selected && (0, $8zHUo$styledcomponents.css)([
|
|
362
|
+
"border:1.5px solid black;"
|
|
363
|
+
]));
|
|
364
|
+
const $ceca9b2af98b0c95$export$ba2cca49c1fdb2e7 = /*#__PURE__*/ (0, ($parcel$interopDefault($8zHUo$styledcomponents))).div.withConfig({
|
|
365
|
+
componentId: "sc-19qbcde-5"
|
|
366
|
+
})([
|
|
367
|
+
"display:flex;flex-direction:column;gap:5px;"
|
|
368
|
+
]);
|
|
369
|
+
const $ceca9b2af98b0c95$export$cb9c7572ce233849 = /*#__PURE__*/ (0, ($parcel$interopDefault($8zHUo$styledcomponents))).h1.withConfig({
|
|
370
|
+
componentId: "sc-19qbcde-6"
|
|
371
|
+
})([
|
|
372
|
+
"font-size:14px;font-weight:700;color:black;"
|
|
373
|
+
]);
|
|
374
|
+
const $ceca9b2af98b0c95$export$616b2cea969b4f5b = /*#__PURE__*/ (0, ($parcel$interopDefault($8zHUo$styledcomponents))).h1.withConfig({
|
|
375
|
+
componentId: "sc-19qbcde-7"
|
|
376
|
+
})([
|
|
377
|
+
"font-size:12px;font-weight:400;color:#6c6a6a;"
|
|
378
|
+
]);
|
|
379
|
+
|
|
380
|
+
|
|
381
|
+
|
|
382
|
+
|
|
383
|
+
|
|
384
|
+
|
|
385
|
+
|
|
386
|
+
const $8253037134647552$export$d6717fe814f1a6da = ()=>{
|
|
387
|
+
const { session: session } = (0, $8zHUo$stytchreact.useStytchSession)();
|
|
388
|
+
const { data: data, isConnected: isConnected, isConnecting: isConnecting, isReconnecting: isReconnecting } = (0, $8zHUo$graz.useAccount)();
|
|
389
|
+
const { connectionType: connectionType, setConnectionType: setConnectionType, abstractAccount: abstractAccount } = (0, $8zHUo$react.useContext)((0, $0584e7e581a05238$export$b73cf336ef9f46b0));
|
|
390
|
+
(0, $8zHUo$react.useEffect)(()=>{
|
|
391
|
+
const refreshConnectionType = ()=>{
|
|
392
|
+
if (session) setConnectionType("stytch");
|
|
393
|
+
else if (data) setConnectionType("graz");
|
|
394
|
+
};
|
|
395
|
+
if (connectionType === "none") refreshConnectionType();
|
|
396
|
+
}, [
|
|
397
|
+
session,
|
|
398
|
+
data
|
|
399
|
+
]);
|
|
400
|
+
switch(connectionType){
|
|
401
|
+
case "stytch":
|
|
402
|
+
return {
|
|
403
|
+
data: {
|
|
404
|
+
...abstractAccount,
|
|
405
|
+
bech32Address: abstractAccount?.id
|
|
406
|
+
},
|
|
407
|
+
isConnected: !!session
|
|
408
|
+
};
|
|
409
|
+
case "graz":
|
|
410
|
+
return {
|
|
411
|
+
data: data,
|
|
412
|
+
isConnected: isConnected,
|
|
413
|
+
isConnecting: isConnecting,
|
|
414
|
+
isReconnecting: isReconnecting
|
|
415
|
+
};
|
|
416
|
+
default:
|
|
417
|
+
return {
|
|
418
|
+
data: undefined,
|
|
419
|
+
isConnected: false
|
|
420
|
+
};
|
|
421
|
+
}
|
|
422
|
+
};
|
|
423
|
+
|
|
424
|
+
|
|
425
|
+
function $66b494751fd65daa$export$cd8822fabcdefd67(address) {
|
|
426
|
+
if (!address) return "";
|
|
427
|
+
return address.slice(0, 8) + "..." + address.slice(address.length - 4, address.length);
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
|
|
431
|
+
|
|
432
|
+
const $dcd0906c9c15647f$export$e5ca334ad04deaa4 = (0, $8zHUo$apolloclient.gql)`
|
|
433
|
+
fragment SmartAccountFragment on SmartAccountAuthenticator {
|
|
434
|
+
id
|
|
435
|
+
type
|
|
436
|
+
authenticator
|
|
437
|
+
authenticatorIndex
|
|
438
|
+
version
|
|
439
|
+
}
|
|
440
|
+
`;
|
|
441
|
+
const $dcd0906c9c15647f$export$e8c9e309e360320d = (0, $8zHUo$apolloclient.gql)`
|
|
442
|
+
${$dcd0906c9c15647f$export$e5ca334ad04deaa4}
|
|
443
|
+
query ($authenticator: String!) {
|
|
444
|
+
smartAccounts(
|
|
445
|
+
filter: {
|
|
446
|
+
authenticators: { some: { authenticator: { equalTo: $authenticator } } }
|
|
447
|
+
}
|
|
448
|
+
) {
|
|
449
|
+
nodes {
|
|
450
|
+
id
|
|
451
|
+
authenticators {
|
|
452
|
+
nodes {
|
|
453
|
+
...SmartAccountFragment
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
`;
|
|
460
|
+
const $dcd0906c9c15647f$export$a1737fb1bf8d8022 = (0, $8zHUo$apolloclient.gql)`
|
|
461
|
+
${$dcd0906c9c15647f$export$e5ca334ad04deaa4}
|
|
462
|
+
query ($id: String!) {
|
|
463
|
+
smartAccount(id: $id) {
|
|
464
|
+
id
|
|
465
|
+
latestAuthenticatorId
|
|
466
|
+
authenticators {
|
|
467
|
+
nodes {
|
|
468
|
+
...SmartAccountFragment
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
`;
|
|
474
|
+
const $dcd0906c9c15647f$export$584bee8705d9f218 = (0, $8zHUo$apolloclient.gql)`
|
|
475
|
+
${$dcd0906c9c15647f$export$e5ca334ad04deaa4}
|
|
476
|
+
query ($id: String!) {
|
|
477
|
+
smartAccounts(filter: { id: { equalTo: $id } }) {
|
|
478
|
+
nodes {
|
|
479
|
+
authenticators {
|
|
480
|
+
nodes {
|
|
481
|
+
...SmartAccountFragment
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
`;
|
|
488
|
+
const $dcd0906c9c15647f$export$f5d2d3ca044e60b6 = (0, $8zHUo$apolloclient.gql)`
|
|
489
|
+
${$dcd0906c9c15647f$export$e5ca334ad04deaa4}
|
|
490
|
+
query ($id: String!, $authenticator: String!) {
|
|
491
|
+
smartAccounts(
|
|
492
|
+
filter: {
|
|
493
|
+
id: { equalTo: $id }
|
|
494
|
+
authenticators: { some: { authenticator: { equalTo: $authenticator } } }
|
|
495
|
+
}
|
|
496
|
+
) {
|
|
497
|
+
nodes {
|
|
498
|
+
authenticators {
|
|
499
|
+
nodes {
|
|
500
|
+
...SmartAccountFragment
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
`;
|
|
507
|
+
const $dcd0906c9c15647f$export$ba4a5dfb874610e3 = (0, $8zHUo$apolloclient.gql)`
|
|
508
|
+
${$dcd0906c9c15647f$export$e5ca334ad04deaa4}
|
|
509
|
+
query ($id: String!, $type: String!) {
|
|
510
|
+
smartAccounts(
|
|
511
|
+
filter: {
|
|
512
|
+
id: { equalTo: $id }
|
|
513
|
+
authenticators: { some: { type: { equalTo: $type } } }
|
|
514
|
+
}
|
|
515
|
+
) {
|
|
516
|
+
nodes {
|
|
517
|
+
authenticators {
|
|
518
|
+
nodes {
|
|
519
|
+
...SmartAccountFragment
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
`;
|
|
526
|
+
const $dcd0906c9c15647f$export$2e1622f171c08a50 = (0, $8zHUo$apolloclient.gql)`
|
|
527
|
+
${$dcd0906c9c15647f$export$e5ca334ad04deaa4}
|
|
528
|
+
query ($id: String!, $type: String!, $authenticator: String!) {
|
|
529
|
+
smartAccounts(
|
|
530
|
+
filter: {
|
|
531
|
+
id: { equalTo: $id }
|
|
532
|
+
authenticators: {
|
|
533
|
+
some: {
|
|
534
|
+
authenticator: { equalTo: $authenticator }
|
|
535
|
+
type: { equalTo: $type }
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
) {
|
|
540
|
+
nodes {
|
|
541
|
+
authenticators {
|
|
542
|
+
nodes {
|
|
543
|
+
...SmartAccountFragment
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
`;
|
|
550
|
+
|
|
551
|
+
|
|
552
|
+
|
|
553
|
+
const $201c8b5e37adde79$export$90101a63b8c75f3e = ()=>{
|
|
554
|
+
return /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsxs)("svg", {
|
|
555
|
+
width: "48",
|
|
556
|
+
height: "48",
|
|
557
|
+
viewBox: "0 0 48 48",
|
|
558
|
+
fill: "none",
|
|
559
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
560
|
+
children: [
|
|
561
|
+
/*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)("rect", {
|
|
562
|
+
width: "48",
|
|
563
|
+
height: "48",
|
|
564
|
+
rx: "24",
|
|
565
|
+
fill: "black"
|
|
566
|
+
}),
|
|
567
|
+
/*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)("path", {
|
|
568
|
+
d: "M33.8947 30.8289V31.9342C33.8947 33.15 32.9 34.1447 31.6842 34.1447H16.2105C14.9837 34.1447 14 33.15 14 31.9342V16.4605C14 15.2447 14.9837 14.25 16.2105 14.25H31.6842C32.9 14.25 33.8947 15.2447 33.8947 16.4605V17.5658H23.9474C22.7205 17.5658 21.7368 18.5605 21.7368 19.7763V28.6184C21.7368 29.8342 22.7205 30.8289 23.9474 30.8289H33.8947ZM23.9474 28.6184H35V19.7763H23.9474V28.6184ZM28.3684 25.8553C27.4511 25.8553 26.7105 25.1147 26.7105 24.1974C26.7105 23.28 27.4511 22.5395 28.3684 22.5395C29.2858 22.5395 30.0263 23.28 30.0263 24.1974C30.0263 25.1147 29.2858 25.8553 28.3684 25.8553Z",
|
|
569
|
+
fill: "white"
|
|
570
|
+
})
|
|
571
|
+
]
|
|
572
|
+
});
|
|
573
|
+
};
|
|
574
|
+
|
|
575
|
+
|
|
576
|
+
const $195efaaf99fc5ea5$export$4b898609373c6c7c = ()=>{
|
|
577
|
+
const { connectionType: connectionType, setConnectionType: setConnectionType, abstractAccount: abstractAccount, setAbstractAccount: setAbstractAccount, setAbstraxionError: setAbstraxionError } = (0, $8zHUo$react.useContext)((0, $0584e7e581a05238$export$b73cf336ef9f46b0));
|
|
578
|
+
const { user: user } = (0, $8zHUo$stytchreact.useStytchUser)();
|
|
579
|
+
const stytchClient = (0, $8zHUo$stytchreact.useStytch)();
|
|
580
|
+
const session_jwt = stytchClient.session.getTokens()?.session_jwt;
|
|
581
|
+
const session_token = stytchClient.session.getTokens()?.session_token;
|
|
582
|
+
const { disconnect: disconnect } = (0, $8zHUo$graz.useDisconnect)();
|
|
583
|
+
const { data: account } = (0, $8253037134647552$export$d6717fe814f1a6da)();
|
|
584
|
+
const { loading: loading, error: error, data: data, refetch: refetch } = (0, $8zHUo$apolloclient.useQuery)((0, $dcd0906c9c15647f$export$e8c9e309e360320d), {
|
|
585
|
+
variables: {
|
|
586
|
+
authenticator: `project-test-185e9a9f-8bab-42f2-a924-953a59e8ff94.${user?.user_id}`
|
|
587
|
+
}
|
|
588
|
+
});
|
|
589
|
+
const [isGeneratingNewWallet, setIsGeneratingNewWallet] = (0, $8zHUo$react.useState)(false);
|
|
590
|
+
if (error) {
|
|
591
|
+
setAbstraxionError(error.message);
|
|
592
|
+
return null;
|
|
593
|
+
}
|
|
594
|
+
const handleDisconnect = async ()=>{
|
|
595
|
+
if (connectionType === "stytch") await stytchClient.session.revoke();
|
|
596
|
+
else if (connectionType === "graz") disconnect();
|
|
597
|
+
setConnectionType("none");
|
|
598
|
+
setAbstractAccount(undefined);
|
|
599
|
+
};
|
|
600
|
+
const handleJwtAALoginOrCreate = async (session_jwt, session_token)=>{
|
|
601
|
+
try {
|
|
602
|
+
if (!session_jwt || !session_token) throw new Error("Missing token/jwt");
|
|
603
|
+
setIsGeneratingNewWallet(true);
|
|
604
|
+
const res = await fetch("https://burnt-abstraxion-api.onrender.com/api/v1/jwt-accounts/create", {
|
|
605
|
+
method: "POST",
|
|
606
|
+
headers: {
|
|
607
|
+
"content-type": "application/json"
|
|
608
|
+
},
|
|
609
|
+
body: JSON.stringify({
|
|
610
|
+
salt: Date.now().toString(),
|
|
611
|
+
session_jwt: session_jwt,
|
|
612
|
+
session_token: session_token
|
|
613
|
+
})
|
|
614
|
+
});
|
|
615
|
+
const body = await res.json();
|
|
616
|
+
if (!res.ok) throw new Error(body.error);
|
|
617
|
+
await refetch();
|
|
618
|
+
return;
|
|
619
|
+
} catch (error) {
|
|
620
|
+
setAbstraxionError("Error creating abstract account.");
|
|
621
|
+
} finally{
|
|
622
|
+
setIsGeneratingNewWallet(false);
|
|
623
|
+
}
|
|
624
|
+
};
|
|
625
|
+
return /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $8zHUo$reactjsxruntime.Fragment), {
|
|
626
|
+
children: isGeneratingNewWallet || loading ? /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $4e401ff008868fb1$export$fcbc8ef838a7ca2a), {}) : /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsxs)((0, $ceca9b2af98b0c95$export$24959d1cf524e21e), {
|
|
627
|
+
children: [
|
|
628
|
+
/*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $f7d0d4a08cf217d9$export$c3f823b2b7f71b6c), {
|
|
629
|
+
children: "Welcome Back"
|
|
630
|
+
}),
|
|
631
|
+
connectionType === "graz" ? /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsxs)((0, $ceca9b2af98b0c95$export$2528756baaccf436), {
|
|
632
|
+
$selected: true,
|
|
633
|
+
children: [
|
|
634
|
+
/*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $201c8b5e37adde79$export$90101a63b8c75f3e), {}),
|
|
635
|
+
/*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsxs)((0, $ceca9b2af98b0c95$export$ba2cca49c1fdb2e7), {
|
|
636
|
+
children: [
|
|
637
|
+
/*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $ceca9b2af98b0c95$export$cb9c7572ce233849), {
|
|
638
|
+
children: account?.name
|
|
639
|
+
}),
|
|
640
|
+
/*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $ceca9b2af98b0c95$export$616b2cea969b4f5b), {
|
|
641
|
+
children: (0, $66b494751fd65daa$export$cd8822fabcdefd67)(account?.bech32Address)
|
|
642
|
+
})
|
|
643
|
+
]
|
|
644
|
+
})
|
|
645
|
+
]
|
|
646
|
+
}) : /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsxs)((0, $ceca9b2af98b0c95$export$b97d6b58b4bed532), {
|
|
647
|
+
children: [
|
|
648
|
+
/*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $ceca9b2af98b0c95$export$dde344fa38e1a334), {
|
|
649
|
+
children: "Accounts"
|
|
650
|
+
}),
|
|
651
|
+
/*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $ceca9b2af98b0c95$export$c14550826a96138d), {
|
|
652
|
+
children: data?.smartAccounts.nodes.length >= 1 ? data?.smartAccounts?.nodes?.map((node, i)=>/*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsxs)((0, $ceca9b2af98b0c95$export$2528756baaccf436), {
|
|
653
|
+
onClick: ()=>setAbstractAccount(node),
|
|
654
|
+
$selected: node.id === abstractAccount?.id,
|
|
655
|
+
children: [
|
|
656
|
+
/*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $201c8b5e37adde79$export$90101a63b8c75f3e), {}),
|
|
657
|
+
/*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsxs)((0, $ceca9b2af98b0c95$export$ba2cca49c1fdb2e7), {
|
|
658
|
+
children: [
|
|
659
|
+
/*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsxs)((0, $ceca9b2af98b0c95$export$cb9c7572ce233849), {
|
|
660
|
+
children: [
|
|
661
|
+
"Personal Account ",
|
|
662
|
+
i + 1
|
|
663
|
+
]
|
|
664
|
+
}),
|
|
665
|
+
/*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $ceca9b2af98b0c95$export$616b2cea969b4f5b), {
|
|
666
|
+
children: (0, $66b494751fd65daa$export$cd8822fabcdefd67)(node.id)
|
|
667
|
+
})
|
|
668
|
+
]
|
|
669
|
+
})
|
|
670
|
+
]
|
|
671
|
+
}, i)) : /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)("p", {
|
|
672
|
+
children: "No Accounts Found."
|
|
673
|
+
})
|
|
674
|
+
}),
|
|
675
|
+
/*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $d9dd93c5f3fbc1f7$export$353f5b6fc5456de1), {
|
|
676
|
+
structure: "naked",
|
|
677
|
+
theme: "primary",
|
|
678
|
+
fullwidth: true,
|
|
679
|
+
onClick: async ()=>{
|
|
680
|
+
await handleJwtAALoginOrCreate(session_jwt, session_token);
|
|
681
|
+
},
|
|
682
|
+
children: "Create a new account"
|
|
683
|
+
})
|
|
684
|
+
]
|
|
685
|
+
}),
|
|
686
|
+
/*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $d9dd93c5f3fbc1f7$export$353f5b6fc5456de1), {
|
|
687
|
+
structure: "outlined",
|
|
688
|
+
theme: "secondary",
|
|
689
|
+
fullwidth: true,
|
|
690
|
+
onClick: handleDisconnect,
|
|
691
|
+
children: "Disconnect"
|
|
692
|
+
})
|
|
693
|
+
]
|
|
694
|
+
})
|
|
695
|
+
});
|
|
696
|
+
};
|
|
697
|
+
|
|
698
|
+
|
|
699
|
+
|
|
700
|
+
|
|
701
|
+
|
|
702
|
+
|
|
703
|
+
|
|
704
|
+
|
|
705
|
+
|
|
706
|
+
|
|
707
|
+
|
|
708
|
+
const $b9371389db99d149$export$a195049fd73b3fe2 = /*#__PURE__*/ (0, ($parcel$interopDefault($8zHUo$styledcomponents))).input.withConfig({
|
|
709
|
+
componentId: "sc-3uk7i4-0"
|
|
710
|
+
})([
|
|
711
|
+
"font-size:16px;background-color:#f2f2f2;color:black;padding:8px 20px;border-radius:5px;height:46px;border:none;",
|
|
712
|
+
" ",
|
|
713
|
+
" &:focus{outline:none;}&::placeholder{color:#bdbdbd;}"
|
|
714
|
+
], (props)=>props.$fullwidth && (0, $8zHUo$styledcomponents.css)([
|
|
715
|
+
"width:100%;"
|
|
716
|
+
]), (props)=>props.$error && (0, $8zHUo$styledcomponents.css)([
|
|
717
|
+
"border:1px solid red;"
|
|
718
|
+
]));
|
|
719
|
+
const $b9371389db99d149$export$b821cb5d358838ed = /*#__PURE__*/ (0, ($parcel$interopDefault($8zHUo$styledcomponents))).div.withConfig({
|
|
720
|
+
componentId: "sc-3uk7i4-1"
|
|
721
|
+
})([
|
|
722
|
+
"display:flex;width:100%;flex-direction:column;gap:1px;s"
|
|
723
|
+
]);
|
|
724
|
+
const $b9371389db99d149$export$aefc266febf947fb = /*#__PURE__*/ (0, ($parcel$interopDefault($8zHUo$styledcomponents))).p.withConfig({
|
|
725
|
+
componentId: "sc-3uk7i4-2"
|
|
726
|
+
})([
|
|
727
|
+
"color:red;font-size:11px;font-weight:500;"
|
|
728
|
+
]);
|
|
729
|
+
|
|
730
|
+
|
|
731
|
+
const $e07fcdfb6a30195d$export$f5b8910cec6cf069 = ({ type: type = "text", placeholder: placeholder = "", name: name = "", value: value = "", onChange: onChange, className: className, fullwidth: fullwidth = false, error: error, ...props })=>{
|
|
732
|
+
return /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsxs)((0, $b9371389db99d149$export$b821cb5d358838ed), {
|
|
733
|
+
children: [
|
|
734
|
+
/*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $b9371389db99d149$export$a195049fd73b3fe2), {
|
|
735
|
+
type: type,
|
|
736
|
+
placeholder: placeholder,
|
|
737
|
+
name: name,
|
|
738
|
+
value: value,
|
|
739
|
+
onChange: onChange,
|
|
740
|
+
className: className,
|
|
741
|
+
$fullwidth: fullwidth,
|
|
742
|
+
$error: error,
|
|
743
|
+
...props
|
|
744
|
+
}),
|
|
745
|
+
/*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $b9371389db99d149$export$aefc266febf947fb), {
|
|
746
|
+
children: error
|
|
747
|
+
})
|
|
748
|
+
]
|
|
749
|
+
});
|
|
750
|
+
};
|
|
751
|
+
|
|
752
|
+
|
|
753
|
+
|
|
754
|
+
|
|
755
|
+
const $1ac068bc6646581d$export$8ef08231381742ee = /*#__PURE__*/ (0, ($parcel$interopDefault($8zHUo$styledcomponents))).div.withConfig({
|
|
756
|
+
componentId: "sc-rmeupu-0"
|
|
757
|
+
})([
|
|
758
|
+
"display:flex;flex-direction:column;align-items:center;width:100%;gap:1rem;"
|
|
759
|
+
]);
|
|
760
|
+
|
|
761
|
+
|
|
762
|
+
|
|
763
|
+
const $86c16da18bdb1446$export$e7ff1bd16d5eb216 = {
|
|
764
|
+
coinDenom: "XION",
|
|
765
|
+
coinMinimalDenom: "uxion",
|
|
766
|
+
coinDecimals: 6,
|
|
767
|
+
gasPriceStep: {
|
|
768
|
+
low: 0.01,
|
|
769
|
+
average: 0.025,
|
|
770
|
+
high: 0.03
|
|
771
|
+
}
|
|
772
|
+
};
|
|
773
|
+
const $86c16da18bdb1446$var$commonInfo = {
|
|
774
|
+
rpc: "undefined",
|
|
775
|
+
rest: "undefined",
|
|
776
|
+
chainId: "base",
|
|
777
|
+
chainName: "Xion Testnet",
|
|
778
|
+
bip44: {
|
|
779
|
+
coinType: 118
|
|
780
|
+
},
|
|
781
|
+
bech32Config: {
|
|
782
|
+
bech32PrefixAccAddr: "xion",
|
|
783
|
+
bech32PrefixValAddr: "xionvaloper",
|
|
784
|
+
bech32PrefixValPub: "xionvaloperpub",
|
|
785
|
+
bech32PrefixAccPub: "xionpub",
|
|
786
|
+
bech32PrefixConsAddr: "xionvalcons",
|
|
787
|
+
bech32PrefixConsPub: "xionvalconspub"
|
|
788
|
+
},
|
|
789
|
+
stakeCurrency: $86c16da18bdb1446$export$e7ff1bd16d5eb216,
|
|
790
|
+
currencies: [
|
|
791
|
+
$86c16da18bdb1446$export$e7ff1bd16d5eb216
|
|
792
|
+
],
|
|
793
|
+
feeCurrencies: [
|
|
794
|
+
$86c16da18bdb1446$export$e7ff1bd16d5eb216
|
|
795
|
+
],
|
|
796
|
+
features: [
|
|
797
|
+
"cosmwasm"
|
|
798
|
+
]
|
|
799
|
+
};
|
|
800
|
+
const $86c16da18bdb1446$export$bc893a2504cf19a1 = {
|
|
801
|
+
...$86c16da18bdb1446$var$commonInfo,
|
|
802
|
+
rpc: "https://rpc.xion-testnet-1.burnt.com:443",
|
|
803
|
+
rest: "https://api.xion-testnet-1.burnt.com",
|
|
804
|
+
chainId: "xion-testnet-1",
|
|
805
|
+
chainName: "Xion Testnet"
|
|
806
|
+
};
|
|
807
|
+
const $86c16da18bdb1446$export$5b63e9de9294fc1 = {
|
|
808
|
+
...$86c16da18bdb1446$var$commonInfo,
|
|
809
|
+
rpc: "http://localhost:26657",
|
|
810
|
+
rest: "http://localhost:26656",
|
|
811
|
+
chainId: "xion-local-testnet-1",
|
|
812
|
+
chainName: "Xion Testnet Local"
|
|
813
|
+
};
|
|
814
|
+
|
|
815
|
+
|
|
816
|
+
const $70478cdf8156474b$export$7b7637218245c8a = /\S+@\S+\.\S+/;
|
|
817
|
+
|
|
818
|
+
|
|
819
|
+
const $077796d4c8abc907$export$aab39041dd279955 = ()=>{
|
|
820
|
+
const stytchClient = (0, $8zHUo$stytchreact.useStytch)();
|
|
821
|
+
const [email, setEmail] = (0, $8zHUo$react.useState)("");
|
|
822
|
+
const [methodId, setMethodId] = (0, $8zHUo$react.useState)("");
|
|
823
|
+
const [emailError, setEmailError] = (0, $8zHUo$react.useState)("");
|
|
824
|
+
const [isOnOtpStep, setIsOnOtpStep] = (0, $8zHUo$react.useState)(false);
|
|
825
|
+
const [otp, setOtp] = (0, $8zHUo$react.useState)("");
|
|
826
|
+
const [otpError, setOtpError] = (0, $8zHUo$react.useState)("");
|
|
827
|
+
const [timeLeft, setTimeLeft] = (0, $8zHUo$react.useState)(null);
|
|
828
|
+
const { setConnectionType: setConnectionType } = (0, $8zHUo$react.useContext)((0, $0584e7e581a05238$export$b73cf336ef9f46b0));
|
|
829
|
+
const { suggestAndConnect: suggestAndConnect } = (0, $8zHUo$graz.useSuggestChainAndConnect)({
|
|
830
|
+
onError (error) {
|
|
831
|
+
setConnectionType("none");
|
|
832
|
+
if (error.message.includes("is not defined")) alert("Wallet not found. Make sure you download the wallet extension before trying again.");
|
|
833
|
+
}
|
|
834
|
+
});
|
|
835
|
+
const handleEmailChange = (e)=>{
|
|
836
|
+
setEmailError("");
|
|
837
|
+
setEmail(e.target.value.toLowerCase());
|
|
838
|
+
};
|
|
839
|
+
const validateEmail = ()=>{
|
|
840
|
+
if ((0, $70478cdf8156474b$export$7b7637218245c8a).test(email) || email === "") setEmailError("");
|
|
841
|
+
else setEmailError("Invalid Email Format");
|
|
842
|
+
};
|
|
843
|
+
const handleEmail = async (event)=>{
|
|
844
|
+
event.preventDefault();
|
|
845
|
+
if (!email) {
|
|
846
|
+
setEmailError("Please enter your email");
|
|
847
|
+
return;
|
|
848
|
+
}
|
|
849
|
+
try {
|
|
850
|
+
setConnectionType("stytch");
|
|
851
|
+
const emailRes = await stytchClient.otps.email.loginOrCreate(email);
|
|
852
|
+
setMethodId(emailRes.method_id);
|
|
853
|
+
setIsOnOtpStep(true);
|
|
854
|
+
setTimeLeft(60);
|
|
855
|
+
} catch (error) {
|
|
856
|
+
setEmailError("Error sending email");
|
|
857
|
+
setConnectionType("none");
|
|
858
|
+
}
|
|
859
|
+
};
|
|
860
|
+
const handleOtp = async (event)=>{
|
|
861
|
+
event.preventDefault();
|
|
862
|
+
try {
|
|
863
|
+
await stytchClient.otps.authenticate(otp, methodId, {
|
|
864
|
+
session_duration_minutes: 60
|
|
865
|
+
});
|
|
866
|
+
} catch (error) {
|
|
867
|
+
setOtpError("Error verifying otp");
|
|
868
|
+
}
|
|
869
|
+
};
|
|
870
|
+
const handleConnect = (wallet)=>{
|
|
871
|
+
setConnectionType("graz");
|
|
872
|
+
suggestAndConnect({
|
|
873
|
+
chainInfo: (0, $86c16da18bdb1446$export$bc893a2504cf19a1),
|
|
874
|
+
walletType: wallet
|
|
875
|
+
});
|
|
876
|
+
};
|
|
877
|
+
// For the "resend otp" countdown
|
|
878
|
+
(0, $8zHUo$react.useEffect)(()=>{
|
|
879
|
+
if (timeLeft === 0) setTimeLeft(null);
|
|
880
|
+
if (!timeLeft) return;
|
|
881
|
+
const intervalId = setInterval(()=>{
|
|
882
|
+
setTimeLeft(timeLeft - 1);
|
|
883
|
+
}, 1000);
|
|
884
|
+
return ()=>clearInterval(intervalId);
|
|
885
|
+
}, [
|
|
886
|
+
timeLeft
|
|
887
|
+
]);
|
|
888
|
+
return /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $f7d0d4a08cf217d9$export$57142b04d9e3944c), {
|
|
889
|
+
children: isOnOtpStep ? /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsxs)((0, $8zHUo$reactjsxruntime.Fragment), {
|
|
890
|
+
children: [
|
|
891
|
+
/*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsxs)("div", {
|
|
892
|
+
children: [
|
|
893
|
+
/*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $f7d0d4a08cf217d9$export$c3f823b2b7f71b6c), {
|
|
894
|
+
children: "Input 6 Digit Code"
|
|
895
|
+
}),
|
|
896
|
+
/*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $f7d0d4a08cf217d9$export$f3145f7fe860d62b), {
|
|
897
|
+
children: "Please check your email for the verification code."
|
|
898
|
+
})
|
|
899
|
+
]
|
|
900
|
+
}),
|
|
901
|
+
/*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, ($parcel$interopDefault($8zHUo$reactpininput))), {
|
|
902
|
+
length: 6,
|
|
903
|
+
initialValue: "",
|
|
904
|
+
onChange: (value)=>{
|
|
905
|
+
setOtpError("");
|
|
906
|
+
setOtp(value);
|
|
907
|
+
},
|
|
908
|
+
type: "numeric",
|
|
909
|
+
inputMode: "number",
|
|
910
|
+
style: {
|
|
911
|
+
width: "100%",
|
|
912
|
+
display: "flex",
|
|
913
|
+
justifyContent: "space-between"
|
|
914
|
+
},
|
|
915
|
+
inputStyle: {
|
|
916
|
+
border: otpError ? "1px solid red" : "none",
|
|
917
|
+
backgroundColor: "#F2F2F2",
|
|
918
|
+
borderRadius: "2px",
|
|
919
|
+
height: "64px",
|
|
920
|
+
color: "black",
|
|
921
|
+
fontSize: "16px"
|
|
922
|
+
},
|
|
923
|
+
onComplete: (value)=>{
|
|
924
|
+
setOtp(value);
|
|
925
|
+
},
|
|
926
|
+
autoSelect: true,
|
|
927
|
+
regexCriteria: /^[ A-Za-z0-9_@./#&+-]*$/
|
|
928
|
+
}),
|
|
929
|
+
/*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsxs)((0, $1ac068bc6646581d$export$8ef08231381742ee), {
|
|
930
|
+
children: [
|
|
931
|
+
/*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $d9dd93c5f3fbc1f7$export$353f5b6fc5456de1), {
|
|
932
|
+
fullwidth: true,
|
|
933
|
+
onClick: handleOtp,
|
|
934
|
+
children: "Confirm"
|
|
935
|
+
}),
|
|
936
|
+
/*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsxs)((0, $d9dd93c5f3fbc1f7$export$353f5b6fc5456de1), {
|
|
937
|
+
structure: "outlined",
|
|
938
|
+
theme: "secondary",
|
|
939
|
+
fullwidth: true,
|
|
940
|
+
onClick: handleEmail,
|
|
941
|
+
disabled: !!timeLeft,
|
|
942
|
+
children: [
|
|
943
|
+
"Resend Code ",
|
|
944
|
+
timeLeft && `in ${timeLeft} seconds`
|
|
945
|
+
]
|
|
946
|
+
})
|
|
947
|
+
]
|
|
948
|
+
})
|
|
949
|
+
]
|
|
950
|
+
}) : /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsxs)((0, $8zHUo$reactjsxruntime.Fragment), {
|
|
951
|
+
children: [
|
|
952
|
+
/*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $f7d0d4a08cf217d9$export$c3f823b2b7f71b6c), {
|
|
953
|
+
children: "Welcome to XION"
|
|
954
|
+
}),
|
|
955
|
+
/*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $e07fcdfb6a30195d$export$f5b8910cec6cf069), {
|
|
956
|
+
placeholder: "Email address",
|
|
957
|
+
fullwidth: true,
|
|
958
|
+
value: email,
|
|
959
|
+
onChange: handleEmailChange,
|
|
960
|
+
error: emailError,
|
|
961
|
+
onBlur: validateEmail
|
|
962
|
+
}),
|
|
963
|
+
/*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $d9dd93c5f3fbc1f7$export$353f5b6fc5456de1), {
|
|
964
|
+
structure: "base",
|
|
965
|
+
fullwidth: true,
|
|
966
|
+
onClick: handleEmail,
|
|
967
|
+
disabled: !!emailError,
|
|
968
|
+
children: "Log in / Sign up"
|
|
969
|
+
}),
|
|
970
|
+
/*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $f7d0d4a08cf217d9$export$c5b7fb08338d9b33), {
|
|
971
|
+
children: "OR"
|
|
972
|
+
}),
|
|
973
|
+
/*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsxs)((0, $f7d0d4a08cf217d9$export$69b1032f2ecdf404), {
|
|
974
|
+
children: [
|
|
975
|
+
/*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $d9dd93c5f3fbc1f7$export$353f5b6fc5456de1), {
|
|
976
|
+
structure: "outlined",
|
|
977
|
+
theme: "secondary",
|
|
978
|
+
fullwidth: true,
|
|
979
|
+
onClick: ()=>{
|
|
980
|
+
handleConnect((0, $8zHUo$graz.WalletType).METAMASK_SNAP_LEAP);
|
|
981
|
+
},
|
|
982
|
+
children: "Metamask"
|
|
983
|
+
}),
|
|
984
|
+
/*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $d9dd93c5f3fbc1f7$export$353f5b6fc5456de1), {
|
|
985
|
+
structure: "outlined",
|
|
986
|
+
theme: "secondary",
|
|
987
|
+
fullwidth: true,
|
|
988
|
+
onClick: ()=>{
|
|
989
|
+
handleConnect((0, $8zHUo$graz.WalletType).KEPLR);
|
|
990
|
+
},
|
|
991
|
+
children: "Keplr"
|
|
992
|
+
})
|
|
993
|
+
]
|
|
994
|
+
}),
|
|
995
|
+
/*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsxs)((0, $f7d0d4a08cf217d9$export$dff4827a2e9bcd71), {
|
|
996
|
+
children: [
|
|
997
|
+
"By continuing, you agree to Burnt's",
|
|
998
|
+
" ",
|
|
999
|
+
/*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $f7d0d4a08cf217d9$export$3c9884e35bbfb1c9), {
|
|
1000
|
+
href: "https://google.com",
|
|
1001
|
+
children: "Terms of Service"
|
|
1002
|
+
}),
|
|
1003
|
+
" and acknowledge that you have read and understand the XION",
|
|
1004
|
+
" ",
|
|
1005
|
+
/*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $f7d0d4a08cf217d9$export$3c9884e35bbfb1c9), {
|
|
1006
|
+
href: "https://google.com",
|
|
1007
|
+
children: "Disclaimer"
|
|
1008
|
+
}),
|
|
1009
|
+
"."
|
|
1010
|
+
]
|
|
1011
|
+
})
|
|
1012
|
+
]
|
|
1013
|
+
})
|
|
1014
|
+
});
|
|
1015
|
+
};
|
|
1016
|
+
|
|
1017
|
+
|
|
1018
|
+
|
|
1019
|
+
|
|
1020
|
+
|
|
1021
|
+
|
|
1022
|
+
|
|
1023
|
+
const $6324ce8b5bc4dc81$export$9f276da64da65062 = new (0, $8zHUo$stytchvanillajs.StytchUIClient)("public-token-test-62177c24-f8f4-4ddd-962b-0436b445ccaa");
|
|
1024
|
+
const $6324ce8b5bc4dc81$export$d1325c0cda90af4f = new (0, $8zHUo$apolloclient.ApolloClient)({
|
|
1025
|
+
uri: "https://api.subquery.network/sq/burnt-labs/xion-indexer",
|
|
1026
|
+
cache: new (0, $8zHUo$apolloclient.InMemoryCache)(),
|
|
1027
|
+
assumeImmutableResults: true
|
|
1028
|
+
});
|
|
1029
|
+
|
|
1030
|
+
|
|
1031
|
+
const $48cebc9c8153b310$export$7623e21b9721522e = ({ isOpen: isOpen, onClose: onClose })=>{
|
|
1032
|
+
const modalRef = (0, $8zHUo$react.useRef)(null);
|
|
1033
|
+
const { abstraxionError: abstraxionError } = (0, $8zHUo$react.useContext)((0, $0584e7e581a05238$export$b73cf336ef9f46b0));
|
|
1034
|
+
const { isConnected: isConnected, isConnecting: isConnecting, isReconnecting: isReconnecting } = (0, $8253037134647552$export$d6717fe814f1a6da)();
|
|
1035
|
+
(0, $8zHUo$react.useEffect)(()=>{
|
|
1036
|
+
const closeOnEscKey = (e)=>e.key === "Escape" ? onClose() : null;
|
|
1037
|
+
document.addEventListener("keydown", closeOnEscKey);
|
|
1038
|
+
return ()=>{
|
|
1039
|
+
document.removeEventListener("keydown", closeOnEscKey);
|
|
1040
|
+
};
|
|
1041
|
+
}, [
|
|
1042
|
+
onClose
|
|
1043
|
+
]);
|
|
1044
|
+
if (!isOpen) return null;
|
|
1045
|
+
return /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $f7d0d4a08cf217d9$export$3a45b3deef0778be), {
|
|
1046
|
+
ref: modalRef,
|
|
1047
|
+
children: /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsxs)((0, $f7d0d4a08cf217d9$export$2baf58024285a14c), {
|
|
1048
|
+
children: [
|
|
1049
|
+
/*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $f7d0d4a08cf217d9$export$f55c3db6ddec6d02), {
|
|
1050
|
+
onClick: onClose,
|
|
1051
|
+
children: /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $db7520b0c9ed95b0$export$cae179f078f4b4a4), {})
|
|
1052
|
+
}),
|
|
1053
|
+
abstraxionError ? /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $12f76906ffa65343$export$d56b0569bceb92ae), {
|
|
1054
|
+
message: abstraxionError,
|
|
1055
|
+
onClose: onClose
|
|
1056
|
+
}) : isConnecting || isReconnecting ? /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $4e401ff008868fb1$export$fcbc8ef838a7ca2a), {}) : isConnected ? /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $195efaaf99fc5ea5$export$4b898609373c6c7c), {}) : /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $077796d4c8abc907$export$aab39041dd279955), {})
|
|
1057
|
+
]
|
|
1058
|
+
})
|
|
1059
|
+
});
|
|
1060
|
+
};
|
|
1061
|
+
const $48cebc9c8153b310$export$b49560c6340d7499 = ({ children: children })=>{
|
|
1062
|
+
return /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $0584e7e581a05238$export$94738ca1d1a3ac6d), {
|
|
1063
|
+
children: /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $8zHUo$stytchreact.StytchProvider), {
|
|
1064
|
+
stytch: (0, $6324ce8b5bc4dc81$export$9f276da64da65062),
|
|
1065
|
+
children: /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $8zHUo$apolloclient.ApolloProvider), {
|
|
1066
|
+
client: (0, $6324ce8b5bc4dc81$export$d1325c0cda90af4f),
|
|
1067
|
+
children: /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $8zHUo$graz.GrazProvider), {
|
|
1068
|
+
children: children
|
|
1069
|
+
})
|
|
1070
|
+
})
|
|
1071
|
+
})
|
|
1072
|
+
});
|
|
1073
|
+
};
|
|
1074
|
+
|
|
1075
|
+
|
|
1076
|
+
|
|
1077
|
+
|
|
1078
|
+
|
|
1079
|
+
|
|
1080
|
+
|
|
1081
|
+
|
|
1082
|
+
|
|
1083
|
+
|
|
1084
|
+
const $9b22f0a1f3460f8c$export$78e6fbad821288ed = ()=>{
|
|
1085
|
+
const { connectionType: connectionType, abstractAccount: abstractAccount } = (0, $8zHUo$react.useContext)((0, $0584e7e581a05238$export$b73cf336ef9f46b0));
|
|
1086
|
+
const stytch = (0, $8zHUo$stytchreact.useStytch)();
|
|
1087
|
+
const sessionToken = stytch.session.getTokens()?.session_token;
|
|
1088
|
+
const { data: grazClient } = (0, $8zHUo$graz.useCosmWasmSigningClient)();
|
|
1089
|
+
const [abstractClient, setAbstractClient] = (0, $8zHUo$react.useState)(undefined);
|
|
1090
|
+
(0, $8zHUo$react.useEffect)(()=>{
|
|
1091
|
+
async function getStytchSigner() {
|
|
1092
|
+
const jwtSigner = new (0, $8zHUo$burntlabsabstractsigners.AbstractAccountJWTSigner)(abstractAccount.bech32Address, sessionToken);
|
|
1093
|
+
const jwtClient = await (0, $8zHUo$burntlabsabstractsigners.AAClient).connectWithSigner((0, $86c16da18bdb1446$export$bc893a2504cf19a1).rpc, jwtSigner, {
|
|
1094
|
+
gasPrice: (0, $8zHUo$grazdistcosmjs.GasPrice).fromString("10uxion")
|
|
1095
|
+
});
|
|
1096
|
+
setAbstractClient(jwtClient);
|
|
1097
|
+
}
|
|
1098
|
+
if (connectionType === "stytch" && abstractAccount) getStytchSigner();
|
|
1099
|
+
}, [
|
|
1100
|
+
sessionToken,
|
|
1101
|
+
abstractAccount,
|
|
1102
|
+
connectionType
|
|
1103
|
+
]);
|
|
1104
|
+
switch(connectionType){
|
|
1105
|
+
case "stytch":
|
|
1106
|
+
return {
|
|
1107
|
+
client: abstractClient
|
|
1108
|
+
};
|
|
1109
|
+
case "graz":
|
|
1110
|
+
return {
|
|
1111
|
+
client: grazClient
|
|
1112
|
+
};
|
|
1113
|
+
default:
|
|
1114
|
+
return {
|
|
1115
|
+
client: undefined
|
|
1116
|
+
};
|
|
1117
|
+
}
|
|
1118
|
+
};
|
|
1119
|
+
|
|
1120
|
+
|
|
1121
|
+
|
|
1122
|
+
|
|
1123
|
+
|
|
1124
|
+
|
|
1125
|
+
//# sourceMappingURL=main.js.map
|