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