@ffaerber/swarm-connect 0.1.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -1
- package/dist/components/StepLabel.d.ts +8 -0
- package/dist/components/SwarmConnectModal.d.ts +2 -1
- package/dist/components/tabs/SwarmTab.d.ts +3 -2
- package/dist/components/tabs/WalletTab.d.ts +3 -1
- package/dist/constants.d.ts +1 -0
- package/dist/swarm-connect.js +740 -629
- package/dist/swarm-connect.umd.cjs +12 -12
- package/dist/types.d.ts +2 -0
- package/package.json +1 -1
package/dist/swarm-connect.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import tr, { useState as
|
|
2
|
-
import { useAccount as or, useChainId as ir, useDisconnect as zr, useConnect as
|
|
1
|
+
import tr, { useState as U, useCallback as nr, useEffect as ae } from "react";
|
|
2
|
+
import { useAccount as or, useChainId as ir, useDisconnect as zr, useConnect as Ur, useSwitchChain as Mr, createConfig as Br, http as Nr, WagmiProvider as Yr } from "wagmi";
|
|
3
3
|
import { QueryClient as qr, QueryClientProvider as Vr } from "@tanstack/react-query";
|
|
4
|
-
import { getAddress as oe, SwitchChainError as
|
|
5
|
-
var
|
|
4
|
+
import { getAddress as oe, SwitchChainError as Je, numberToHex as Xe, UserRejectedRequestError as F, withRetry as Gr, withTimeout as Hr, ResourceUnavailableRpcError as xe } from "viem";
|
|
5
|
+
var we = { exports: {} }, X = {};
|
|
6
6
|
/**
|
|
7
7
|
* @license React
|
|
8
8
|
* react-jsx-runtime.production.min.js
|
|
@@ -12,19 +12,19 @@ var be = { exports: {} }, X = {};
|
|
|
12
12
|
* This source code is licensed under the MIT license found in the
|
|
13
13
|
* LICENSE file in the root directory of this source tree.
|
|
14
14
|
*/
|
|
15
|
-
var
|
|
15
|
+
var Qe;
|
|
16
16
|
function Kr() {
|
|
17
|
-
if (
|
|
18
|
-
|
|
19
|
-
var t = tr,
|
|
20
|
-
function g(
|
|
21
|
-
var
|
|
22
|
-
|
|
23
|
-
for (
|
|
24
|
-
if (
|
|
25
|
-
return { $$typeof:
|
|
17
|
+
if (Qe) return X;
|
|
18
|
+
Qe = 1;
|
|
19
|
+
var t = tr, n = Symbol.for("react.element"), i = Symbol.for("react.fragment"), c = Object.prototype.hasOwnProperty, u = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, p = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
20
|
+
function g(x, f, s) {
|
|
21
|
+
var d, v = {}, b = null, R = null;
|
|
22
|
+
s !== void 0 && (b = "" + s), f.key !== void 0 && (b = "" + f.key), f.ref !== void 0 && (R = f.ref);
|
|
23
|
+
for (d in f) c.call(f, d) && !p.hasOwnProperty(d) && (v[d] = f[d]);
|
|
24
|
+
if (x && x.defaultProps) for (d in f = x.defaultProps, f) v[d] === void 0 && (v[d] = f[d]);
|
|
25
|
+
return { $$typeof: n, type: x, key: b, ref: R, props: v, _owner: u.current };
|
|
26
26
|
}
|
|
27
|
-
return X.Fragment =
|
|
27
|
+
return X.Fragment = i, X.jsx = g, X.jsxs = g, X;
|
|
28
28
|
}
|
|
29
29
|
var Q = {};
|
|
30
30
|
/**
|
|
@@ -36,51 +36,51 @@ var Q = {};
|
|
|
36
36
|
* This source code is licensed under the MIT license found in the
|
|
37
37
|
* LICENSE file in the root directory of this source tree.
|
|
38
38
|
*/
|
|
39
|
-
var
|
|
39
|
+
var Ze;
|
|
40
40
|
function Jr() {
|
|
41
|
-
return
|
|
42
|
-
var t = tr,
|
|
43
|
-
function
|
|
41
|
+
return Ze || (Ze = 1, process.env.NODE_ENV !== "production" && function() {
|
|
42
|
+
var t = tr, n = Symbol.for("react.element"), i = Symbol.for("react.portal"), c = Symbol.for("react.fragment"), u = Symbol.for("react.strict_mode"), p = Symbol.for("react.profiler"), g = Symbol.for("react.provider"), x = Symbol.for("react.context"), f = Symbol.for("react.forward_ref"), s = Symbol.for("react.suspense"), d = Symbol.for("react.suspense_list"), v = Symbol.for("react.memo"), b = Symbol.for("react.lazy"), R = Symbol.for("react.offscreen"), A = Symbol.iterator, W = "@@iterator";
|
|
43
|
+
function L(e) {
|
|
44
44
|
if (e === null || typeof e != "object")
|
|
45
45
|
return null;
|
|
46
|
-
var
|
|
47
|
-
return typeof
|
|
46
|
+
var o = A && e[A] || e[W];
|
|
47
|
+
return typeof o == "function" ? o : null;
|
|
48
48
|
}
|
|
49
|
-
var
|
|
49
|
+
var I = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
50
50
|
function S(e) {
|
|
51
51
|
{
|
|
52
|
-
for (var
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
for (var o = arguments.length, l = new Array(o > 1 ? o - 1 : 0), h = 1; h < o; h++)
|
|
53
|
+
l[h - 1] = arguments[h];
|
|
54
|
+
T("error", e, l);
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
|
-
function
|
|
57
|
+
function T(e, o, l) {
|
|
58
58
|
{
|
|
59
|
-
var h =
|
|
60
|
-
w !== "" && (
|
|
61
|
-
var j =
|
|
59
|
+
var h = I.ReactDebugCurrentFrame, w = h.getStackAddendum();
|
|
60
|
+
w !== "" && (o += "%s", l = l.concat([w]));
|
|
61
|
+
var j = l.map(function(m) {
|
|
62
62
|
return String(m);
|
|
63
63
|
});
|
|
64
|
-
j.unshift("Warning: " +
|
|
64
|
+
j.unshift("Warning: " + o), Function.prototype.apply.call(console[e], console, j);
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
|
-
var
|
|
67
|
+
var _ = !1, C = !1, $ = !1, G = !1, de = !1, H;
|
|
68
68
|
H = Symbol.for("react.module.reference");
|
|
69
69
|
function ur(e) {
|
|
70
|
-
return !!(typeof e == "string" || typeof e == "function" || e ===
|
|
70
|
+
return !!(typeof e == "string" || typeof e == "function" || e === c || e === p || de || e === u || e === s || e === d || G || e === R || _ || C || $ || typeof e == "object" && e !== null && (e.$$typeof === b || e.$$typeof === v || e.$$typeof === g || e.$$typeof === x || e.$$typeof === f || // This needs to include all possible module reference object
|
|
71
71
|
// types supported by any Flight configuration anywhere since
|
|
72
72
|
// we don't know which Flight build this will end up being used
|
|
73
73
|
// with.
|
|
74
74
|
e.$$typeof === H || e.getModuleId !== void 0));
|
|
75
75
|
}
|
|
76
|
-
function dr(e,
|
|
76
|
+
function dr(e, o, l) {
|
|
77
77
|
var h = e.displayName;
|
|
78
78
|
if (h)
|
|
79
79
|
return h;
|
|
80
|
-
var w =
|
|
81
|
-
return w !== "" ?
|
|
80
|
+
var w = o.displayName || o.name || "";
|
|
81
|
+
return w !== "" ? l + "(" + w + ")" : l;
|
|
82
82
|
}
|
|
83
|
-
function
|
|
83
|
+
function ke(e) {
|
|
84
84
|
return e.displayName || "Context";
|
|
85
85
|
}
|
|
86
86
|
function z(e) {
|
|
@@ -91,33 +91,33 @@ function Jr() {
|
|
|
91
91
|
if (typeof e == "string")
|
|
92
92
|
return e;
|
|
93
93
|
switch (e) {
|
|
94
|
-
case
|
|
94
|
+
case c:
|
|
95
95
|
return "Fragment";
|
|
96
|
-
case
|
|
96
|
+
case i:
|
|
97
97
|
return "Portal";
|
|
98
98
|
case p:
|
|
99
99
|
return "Profiler";
|
|
100
|
-
case
|
|
100
|
+
case u:
|
|
101
101
|
return "StrictMode";
|
|
102
|
-
case
|
|
102
|
+
case s:
|
|
103
103
|
return "Suspense";
|
|
104
|
-
case
|
|
104
|
+
case d:
|
|
105
105
|
return "SuspenseList";
|
|
106
106
|
}
|
|
107
107
|
if (typeof e == "object")
|
|
108
108
|
switch (e.$$typeof) {
|
|
109
|
-
case
|
|
110
|
-
var
|
|
111
|
-
return
|
|
109
|
+
case x:
|
|
110
|
+
var o = e;
|
|
111
|
+
return ke(o) + ".Consumer";
|
|
112
112
|
case g:
|
|
113
|
-
var
|
|
114
|
-
return
|
|
113
|
+
var l = e;
|
|
114
|
+
return ke(l._context) + ".Provider";
|
|
115
115
|
case f:
|
|
116
116
|
return dr(e, e.render, "ForwardRef");
|
|
117
|
-
case
|
|
117
|
+
case v:
|
|
118
118
|
var h = e.displayName || null;
|
|
119
119
|
return h !== null ? h : z(e.type) || "Memo";
|
|
120
|
-
case
|
|
120
|
+
case b: {
|
|
121
121
|
var w = e, j = w._payload, m = w._init;
|
|
122
122
|
try {
|
|
123
123
|
return z(m(j));
|
|
@@ -128,18 +128,18 @@ function Jr() {
|
|
|
128
128
|
}
|
|
129
129
|
return null;
|
|
130
130
|
}
|
|
131
|
-
var M = Object.assign, K = 0,
|
|
132
|
-
function
|
|
131
|
+
var M = Object.assign, K = 0, _e, Ee, Ie, Te, Pe, Oe, Ae;
|
|
132
|
+
function De() {
|
|
133
133
|
}
|
|
134
|
-
|
|
134
|
+
De.__reactDisabledLog = !0;
|
|
135
135
|
function fr() {
|
|
136
136
|
{
|
|
137
137
|
if (K === 0) {
|
|
138
|
-
|
|
138
|
+
_e = console.log, Ee = console.info, Ie = console.warn, Te = console.error, Pe = console.group, Oe = console.groupCollapsed, Ae = console.groupEnd;
|
|
139
139
|
var e = {
|
|
140
140
|
configurable: !0,
|
|
141
141
|
enumerable: !0,
|
|
142
|
-
value:
|
|
142
|
+
value: De,
|
|
143
143
|
writable: !0
|
|
144
144
|
};
|
|
145
145
|
Object.defineProperties(console, {
|
|
@@ -165,66 +165,66 @@ function Jr() {
|
|
|
165
165
|
};
|
|
166
166
|
Object.defineProperties(console, {
|
|
167
167
|
log: M({}, e, {
|
|
168
|
-
value:
|
|
168
|
+
value: _e
|
|
169
169
|
}),
|
|
170
170
|
info: M({}, e, {
|
|
171
|
-
value:
|
|
171
|
+
value: Ee
|
|
172
172
|
}),
|
|
173
173
|
warn: M({}, e, {
|
|
174
|
-
value:
|
|
174
|
+
value: Ie
|
|
175
175
|
}),
|
|
176
176
|
error: M({}, e, {
|
|
177
|
-
value:
|
|
177
|
+
value: Te
|
|
178
178
|
}),
|
|
179
179
|
group: M({}, e, {
|
|
180
|
-
value:
|
|
180
|
+
value: Pe
|
|
181
181
|
}),
|
|
182
182
|
groupCollapsed: M({}, e, {
|
|
183
|
-
value:
|
|
183
|
+
value: Oe
|
|
184
184
|
}),
|
|
185
185
|
groupEnd: M({}, e, {
|
|
186
|
-
value:
|
|
186
|
+
value: Ae
|
|
187
187
|
})
|
|
188
188
|
});
|
|
189
189
|
}
|
|
190
190
|
K < 0 && S("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
191
191
|
}
|
|
192
192
|
}
|
|
193
|
-
var
|
|
194
|
-
function ee(e,
|
|
193
|
+
var fe = I.ReactCurrentDispatcher, he;
|
|
194
|
+
function ee(e, o, l) {
|
|
195
195
|
{
|
|
196
|
-
if (
|
|
196
|
+
if (he === void 0)
|
|
197
197
|
try {
|
|
198
198
|
throw Error();
|
|
199
199
|
} catch (w) {
|
|
200
200
|
var h = w.stack.trim().match(/\n( *(at )?)/);
|
|
201
|
-
|
|
201
|
+
he = h && h[1] || "";
|
|
202
202
|
}
|
|
203
203
|
return `
|
|
204
|
-
` +
|
|
204
|
+
` + he + e;
|
|
205
205
|
}
|
|
206
206
|
}
|
|
207
|
-
var
|
|
207
|
+
var pe = !1, re;
|
|
208
208
|
{
|
|
209
209
|
var pr = typeof WeakMap == "function" ? WeakMap : Map;
|
|
210
210
|
re = new pr();
|
|
211
211
|
}
|
|
212
|
-
function
|
|
213
|
-
if (!e ||
|
|
212
|
+
function $e(e, o) {
|
|
213
|
+
if (!e || pe)
|
|
214
214
|
return "";
|
|
215
215
|
{
|
|
216
|
-
var
|
|
217
|
-
if (
|
|
218
|
-
return
|
|
216
|
+
var l = re.get(e);
|
|
217
|
+
if (l !== void 0)
|
|
218
|
+
return l;
|
|
219
219
|
}
|
|
220
220
|
var h;
|
|
221
|
-
|
|
221
|
+
pe = !0;
|
|
222
222
|
var w = Error.prepareStackTrace;
|
|
223
223
|
Error.prepareStackTrace = void 0;
|
|
224
224
|
var j;
|
|
225
|
-
j =
|
|
225
|
+
j = fe.current, fe.current = null, fr();
|
|
226
226
|
try {
|
|
227
|
-
if (
|
|
227
|
+
if (o) {
|
|
228
228
|
var m = function() {
|
|
229
229
|
throw Error();
|
|
230
230
|
};
|
|
@@ -257,227 +257,227 @@ function Jr() {
|
|
|
257
257
|
}
|
|
258
258
|
} catch (O) {
|
|
259
259
|
if (O && h && typeof O.stack == "string") {
|
|
260
|
-
for (var
|
|
260
|
+
for (var y = O.stack.split(`
|
|
261
261
|
`), P = h.stack.split(`
|
|
262
|
-
`),
|
|
263
|
-
|
|
264
|
-
for (;
|
|
265
|
-
if (
|
|
266
|
-
if (
|
|
262
|
+
`), k = y.length - 1, E = P.length - 1; k >= 1 && E >= 0 && y[k] !== P[E]; )
|
|
263
|
+
E--;
|
|
264
|
+
for (; k >= 1 && E >= 0; k--, E--)
|
|
265
|
+
if (y[k] !== P[E]) {
|
|
266
|
+
if (k !== 1 || E !== 1)
|
|
267
267
|
do
|
|
268
|
-
if (
|
|
269
|
-
var
|
|
270
|
-
` +
|
|
271
|
-
return e.displayName &&
|
|
268
|
+
if (k--, E--, E < 0 || y[k] !== P[E]) {
|
|
269
|
+
var D = `
|
|
270
|
+
` + y[k].replace(" at new ", " at ");
|
|
271
|
+
return e.displayName && D.includes("<anonymous>") && (D = D.replace("<anonymous>", e.displayName)), typeof e == "function" && re.set(e, D), D;
|
|
272
272
|
}
|
|
273
|
-
while (
|
|
273
|
+
while (k >= 1 && E >= 0);
|
|
274
274
|
break;
|
|
275
275
|
}
|
|
276
276
|
}
|
|
277
277
|
} finally {
|
|
278
|
-
|
|
278
|
+
pe = !1, fe.current = j, hr(), Error.prepareStackTrace = w;
|
|
279
279
|
}
|
|
280
|
-
var
|
|
281
|
-
return typeof e == "function" && re.set(e,
|
|
280
|
+
var q = e ? e.displayName || e.name : "", B = q ? ee(q) : "";
|
|
281
|
+
return typeof e == "function" && re.set(e, B), B;
|
|
282
282
|
}
|
|
283
|
-
function gr(e,
|
|
284
|
-
return
|
|
283
|
+
function gr(e, o, l) {
|
|
284
|
+
return $e(e, !1);
|
|
285
285
|
}
|
|
286
286
|
function vr(e) {
|
|
287
|
-
var
|
|
288
|
-
return !!(
|
|
287
|
+
var o = e.prototype;
|
|
288
|
+
return !!(o && o.isReactComponent);
|
|
289
289
|
}
|
|
290
|
-
function te(e,
|
|
290
|
+
function te(e, o, l) {
|
|
291
291
|
if (e == null)
|
|
292
292
|
return "";
|
|
293
293
|
if (typeof e == "function")
|
|
294
|
-
return
|
|
294
|
+
return $e(e, vr(e));
|
|
295
295
|
if (typeof e == "string")
|
|
296
296
|
return ee(e);
|
|
297
297
|
switch (e) {
|
|
298
|
-
case
|
|
298
|
+
case s:
|
|
299
299
|
return ee("Suspense");
|
|
300
|
-
case
|
|
300
|
+
case d:
|
|
301
301
|
return ee("SuspenseList");
|
|
302
302
|
}
|
|
303
303
|
if (typeof e == "object")
|
|
304
304
|
switch (e.$$typeof) {
|
|
305
305
|
case f:
|
|
306
306
|
return gr(e.render);
|
|
307
|
-
case
|
|
308
|
-
return te(e.type,
|
|
309
|
-
case
|
|
307
|
+
case v:
|
|
308
|
+
return te(e.type, o, l);
|
|
309
|
+
case b: {
|
|
310
310
|
var h = e, w = h._payload, j = h._init;
|
|
311
311
|
try {
|
|
312
|
-
return te(j(w),
|
|
312
|
+
return te(j(w), o, l);
|
|
313
313
|
} catch {
|
|
314
314
|
}
|
|
315
315
|
}
|
|
316
316
|
}
|
|
317
317
|
return "";
|
|
318
318
|
}
|
|
319
|
-
var J = Object.prototype.hasOwnProperty,
|
|
319
|
+
var J = Object.prototype.hasOwnProperty, We = {}, Fe = I.ReactDebugCurrentFrame;
|
|
320
320
|
function ne(e) {
|
|
321
321
|
if (e) {
|
|
322
|
-
var
|
|
323
|
-
|
|
322
|
+
var o = e._owner, l = te(e.type, e._source, o ? o.type : null);
|
|
323
|
+
Fe.setExtraStackFrame(l);
|
|
324
324
|
} else
|
|
325
|
-
|
|
325
|
+
Fe.setExtraStackFrame(null);
|
|
326
326
|
}
|
|
327
|
-
function
|
|
327
|
+
function yr(e, o, l, h, w) {
|
|
328
328
|
{
|
|
329
329
|
var j = Function.call.bind(J);
|
|
330
330
|
for (var m in e)
|
|
331
331
|
if (j(e, m)) {
|
|
332
|
-
var
|
|
332
|
+
var y = void 0;
|
|
333
333
|
try {
|
|
334
334
|
if (typeof e[m] != "function") {
|
|
335
|
-
var P = Error((h || "React class") + ": " +
|
|
335
|
+
var P = Error((h || "React class") + ": " + l + " type `" + m + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[m] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
336
336
|
throw P.name = "Invariant Violation", P;
|
|
337
337
|
}
|
|
338
|
-
|
|
339
|
-
} catch (
|
|
340
|
-
|
|
338
|
+
y = e[m](o, m, h, l, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
339
|
+
} catch (k) {
|
|
340
|
+
y = k;
|
|
341
341
|
}
|
|
342
|
-
|
|
342
|
+
y && !(y instanceof Error) && (ne(w), S("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", h || "React class", l, m, typeof y), ne(null)), y instanceof Error && !(y.message in We) && (We[y.message] = !0, ne(w), S("Failed %s type: %s", l, y.message), ne(null));
|
|
343
343
|
}
|
|
344
344
|
}
|
|
345
345
|
}
|
|
346
|
-
var
|
|
347
|
-
function
|
|
348
|
-
return
|
|
346
|
+
var mr = Array.isArray;
|
|
347
|
+
function ge(e) {
|
|
348
|
+
return mr(e);
|
|
349
349
|
}
|
|
350
350
|
function br(e) {
|
|
351
351
|
{
|
|
352
|
-
var
|
|
353
|
-
return
|
|
352
|
+
var o = typeof Symbol == "function" && Symbol.toStringTag, l = o && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
353
|
+
return l;
|
|
354
354
|
}
|
|
355
355
|
}
|
|
356
356
|
function xr(e) {
|
|
357
357
|
try {
|
|
358
|
-
return
|
|
358
|
+
return Le(e), !1;
|
|
359
359
|
} catch {
|
|
360
360
|
return !0;
|
|
361
361
|
}
|
|
362
362
|
}
|
|
363
|
-
function
|
|
363
|
+
function Le(e) {
|
|
364
364
|
return "" + e;
|
|
365
365
|
}
|
|
366
|
-
function
|
|
366
|
+
function ze(e) {
|
|
367
367
|
if (xr(e))
|
|
368
|
-
return S("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", br(e)),
|
|
368
|
+
return S("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", br(e)), Le(e);
|
|
369
369
|
}
|
|
370
|
-
var
|
|
370
|
+
var Ue = I.ReactCurrentOwner, wr = {
|
|
371
371
|
key: !0,
|
|
372
372
|
ref: !0,
|
|
373
373
|
__self: !0,
|
|
374
374
|
__source: !0
|
|
375
|
-
},
|
|
375
|
+
}, Me, Be;
|
|
376
376
|
function jr(e) {
|
|
377
377
|
if (J.call(e, "ref")) {
|
|
378
|
-
var
|
|
379
|
-
if (
|
|
378
|
+
var o = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
379
|
+
if (o && o.isReactWarning)
|
|
380
380
|
return !1;
|
|
381
381
|
}
|
|
382
382
|
return e.ref !== void 0;
|
|
383
383
|
}
|
|
384
384
|
function Sr(e) {
|
|
385
385
|
if (J.call(e, "key")) {
|
|
386
|
-
var
|
|
387
|
-
if (
|
|
386
|
+
var o = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
387
|
+
if (o && o.isReactWarning)
|
|
388
388
|
return !1;
|
|
389
389
|
}
|
|
390
390
|
return e.key !== void 0;
|
|
391
391
|
}
|
|
392
|
-
function Cr(e,
|
|
393
|
-
typeof e.ref == "string" &&
|
|
392
|
+
function Cr(e, o) {
|
|
393
|
+
typeof e.ref == "string" && Ue.current;
|
|
394
394
|
}
|
|
395
|
-
function Rr(e,
|
|
395
|
+
function Rr(e, o) {
|
|
396
396
|
{
|
|
397
|
-
var
|
|
398
|
-
|
|
397
|
+
var l = function() {
|
|
398
|
+
Me || (Me = !0, S("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", o));
|
|
399
399
|
};
|
|
400
|
-
|
|
401
|
-
get:
|
|
400
|
+
l.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
401
|
+
get: l,
|
|
402
402
|
configurable: !0
|
|
403
403
|
});
|
|
404
404
|
}
|
|
405
405
|
}
|
|
406
|
-
function kr(e,
|
|
406
|
+
function kr(e, o) {
|
|
407
407
|
{
|
|
408
|
-
var
|
|
409
|
-
|
|
408
|
+
var l = function() {
|
|
409
|
+
Be || (Be = !0, S("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", o));
|
|
410
410
|
};
|
|
411
|
-
|
|
412
|
-
get:
|
|
411
|
+
l.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
412
|
+
get: l,
|
|
413
413
|
configurable: !0
|
|
414
414
|
});
|
|
415
415
|
}
|
|
416
416
|
}
|
|
417
|
-
var _r = function(e,
|
|
418
|
-
var
|
|
417
|
+
var _r = function(e, o, l, h, w, j, m) {
|
|
418
|
+
var y = {
|
|
419
419
|
// This tag allows us to uniquely identify this as a React Element
|
|
420
|
-
$$typeof:
|
|
420
|
+
$$typeof: n,
|
|
421
421
|
// Built-in properties that belong on the element
|
|
422
422
|
type: e,
|
|
423
|
-
key:
|
|
424
|
-
ref:
|
|
423
|
+
key: o,
|
|
424
|
+
ref: l,
|
|
425
425
|
props: m,
|
|
426
426
|
// Record the component responsible for creating this element.
|
|
427
427
|
_owner: j
|
|
428
428
|
};
|
|
429
|
-
return
|
|
429
|
+
return y._store = {}, Object.defineProperty(y._store, "validated", {
|
|
430
430
|
configurable: !1,
|
|
431
431
|
enumerable: !1,
|
|
432
432
|
writable: !0,
|
|
433
433
|
value: !1
|
|
434
|
-
}), Object.defineProperty(
|
|
434
|
+
}), Object.defineProperty(y, "_self", {
|
|
435
435
|
configurable: !1,
|
|
436
436
|
enumerable: !1,
|
|
437
437
|
writable: !1,
|
|
438
438
|
value: h
|
|
439
|
-
}), Object.defineProperty(
|
|
439
|
+
}), Object.defineProperty(y, "_source", {
|
|
440
440
|
configurable: !1,
|
|
441
441
|
enumerable: !1,
|
|
442
442
|
writable: !1,
|
|
443
443
|
value: w
|
|
444
|
-
}), Object.freeze && (Object.freeze(
|
|
444
|
+
}), Object.freeze && (Object.freeze(y.props), Object.freeze(y)), y;
|
|
445
445
|
};
|
|
446
|
-
function Er(e,
|
|
446
|
+
function Er(e, o, l, h, w) {
|
|
447
447
|
{
|
|
448
|
-
var j, m = {},
|
|
449
|
-
|
|
450
|
-
for (j in
|
|
451
|
-
J.call(
|
|
448
|
+
var j, m = {}, y = null, P = null;
|
|
449
|
+
l !== void 0 && (ze(l), y = "" + l), Sr(o) && (ze(o.key), y = "" + o.key), jr(o) && (P = o.ref, Cr(o, w));
|
|
450
|
+
for (j in o)
|
|
451
|
+
J.call(o, j) && !wr.hasOwnProperty(j) && (m[j] = o[j]);
|
|
452
452
|
if (e && e.defaultProps) {
|
|
453
|
-
var
|
|
454
|
-
for (j in
|
|
455
|
-
m[j] === void 0 && (m[j] =
|
|
453
|
+
var k = e.defaultProps;
|
|
454
|
+
for (j in k)
|
|
455
|
+
m[j] === void 0 && (m[j] = k[j]);
|
|
456
456
|
}
|
|
457
|
-
if (
|
|
458
|
-
var
|
|
459
|
-
|
|
457
|
+
if (y || P) {
|
|
458
|
+
var E = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
459
|
+
y && Rr(m, E), P && kr(m, E);
|
|
460
460
|
}
|
|
461
|
-
return _r(e,
|
|
461
|
+
return _r(e, y, P, w, h, Ue.current, m);
|
|
462
462
|
}
|
|
463
463
|
}
|
|
464
|
-
var
|
|
465
|
-
function
|
|
464
|
+
var ve = I.ReactCurrentOwner, Ne = I.ReactDebugCurrentFrame;
|
|
465
|
+
function Y(e) {
|
|
466
466
|
if (e) {
|
|
467
|
-
var
|
|
468
|
-
|
|
467
|
+
var o = e._owner, l = te(e.type, e._source, o ? o.type : null);
|
|
468
|
+
Ne.setExtraStackFrame(l);
|
|
469
469
|
} else
|
|
470
|
-
|
|
470
|
+
Ne.setExtraStackFrame(null);
|
|
471
471
|
}
|
|
472
|
-
var
|
|
473
|
-
|
|
474
|
-
function
|
|
475
|
-
return typeof e == "object" && e !== null && e.$$typeof ===
|
|
472
|
+
var ye;
|
|
473
|
+
ye = !1;
|
|
474
|
+
function me(e) {
|
|
475
|
+
return typeof e == "object" && e !== null && e.$$typeof === n;
|
|
476
476
|
}
|
|
477
|
-
function
|
|
477
|
+
function Ye() {
|
|
478
478
|
{
|
|
479
|
-
if (
|
|
480
|
-
var e = z(
|
|
479
|
+
if (ve.current) {
|
|
480
|
+
var e = z(ve.current.type);
|
|
481
481
|
if (e)
|
|
482
482
|
return `
|
|
483
483
|
|
|
@@ -486,149 +486,149 @@ Check the render method of \`` + e + "`.";
|
|
|
486
486
|
return "";
|
|
487
487
|
}
|
|
488
488
|
}
|
|
489
|
-
function
|
|
489
|
+
function Ir(e) {
|
|
490
490
|
return "";
|
|
491
491
|
}
|
|
492
|
-
var
|
|
493
|
-
function
|
|
492
|
+
var qe = {};
|
|
493
|
+
function Tr(e) {
|
|
494
494
|
{
|
|
495
|
-
var
|
|
496
|
-
if (!
|
|
497
|
-
var
|
|
498
|
-
|
|
495
|
+
var o = Ye();
|
|
496
|
+
if (!o) {
|
|
497
|
+
var l = typeof e == "string" ? e : e.displayName || e.name;
|
|
498
|
+
l && (o = `
|
|
499
499
|
|
|
500
|
-
Check the top-level render call using <` +
|
|
500
|
+
Check the top-level render call using <` + l + ">.");
|
|
501
501
|
}
|
|
502
|
-
return
|
|
502
|
+
return o;
|
|
503
503
|
}
|
|
504
504
|
}
|
|
505
|
-
function
|
|
505
|
+
function Ve(e, o) {
|
|
506
506
|
{
|
|
507
507
|
if (!e._store || e._store.validated || e.key != null)
|
|
508
508
|
return;
|
|
509
509
|
e._store.validated = !0;
|
|
510
|
-
var
|
|
511
|
-
if (
|
|
510
|
+
var l = Tr(o);
|
|
511
|
+
if (qe[l])
|
|
512
512
|
return;
|
|
513
|
-
|
|
513
|
+
qe[l] = !0;
|
|
514
514
|
var h = "";
|
|
515
|
-
e && e._owner && e._owner !==
|
|
515
|
+
e && e._owner && e._owner !== ve.current && (h = " It was passed a child from " + z(e._owner.type) + "."), Y(e), S('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', l, h), Y(null);
|
|
516
516
|
}
|
|
517
517
|
}
|
|
518
|
-
function
|
|
518
|
+
function Ge(e, o) {
|
|
519
519
|
{
|
|
520
520
|
if (typeof e != "object")
|
|
521
521
|
return;
|
|
522
|
-
if (
|
|
523
|
-
for (var
|
|
524
|
-
var h = e[
|
|
525
|
-
|
|
522
|
+
if (ge(e))
|
|
523
|
+
for (var l = 0; l < e.length; l++) {
|
|
524
|
+
var h = e[l];
|
|
525
|
+
me(h) && Ve(h, o);
|
|
526
526
|
}
|
|
527
|
-
else if (
|
|
527
|
+
else if (me(e))
|
|
528
528
|
e._store && (e._store.validated = !0);
|
|
529
529
|
else if (e) {
|
|
530
|
-
var w =
|
|
530
|
+
var w = L(e);
|
|
531
531
|
if (typeof w == "function" && w !== e.entries)
|
|
532
532
|
for (var j = w.call(e), m; !(m = j.next()).done; )
|
|
533
|
-
|
|
533
|
+
me(m.value) && Ve(m.value, o);
|
|
534
534
|
}
|
|
535
535
|
}
|
|
536
536
|
}
|
|
537
537
|
function Pr(e) {
|
|
538
538
|
{
|
|
539
|
-
var
|
|
540
|
-
if (
|
|
539
|
+
var o = e.type;
|
|
540
|
+
if (o == null || typeof o == "string")
|
|
541
541
|
return;
|
|
542
|
-
var
|
|
543
|
-
if (typeof
|
|
544
|
-
|
|
545
|
-
else if (typeof
|
|
542
|
+
var l;
|
|
543
|
+
if (typeof o == "function")
|
|
544
|
+
l = o.propTypes;
|
|
545
|
+
else if (typeof o == "object" && (o.$$typeof === f || // Note: Memo only checks outer props here.
|
|
546
546
|
// Inner props are checked in the reconciler.
|
|
547
|
-
|
|
548
|
-
|
|
547
|
+
o.$$typeof === v))
|
|
548
|
+
l = o.propTypes;
|
|
549
549
|
else
|
|
550
550
|
return;
|
|
551
|
-
if (
|
|
552
|
-
var h = z(
|
|
553
|
-
|
|
554
|
-
} else if (
|
|
555
|
-
|
|
556
|
-
var w = z(
|
|
551
|
+
if (l) {
|
|
552
|
+
var h = z(o);
|
|
553
|
+
yr(l, e.props, "prop", h, e);
|
|
554
|
+
} else if (o.PropTypes !== void 0 && !ye) {
|
|
555
|
+
ye = !0;
|
|
556
|
+
var w = z(o);
|
|
557
557
|
S("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", w || "Unknown");
|
|
558
558
|
}
|
|
559
|
-
typeof
|
|
559
|
+
typeof o.getDefaultProps == "function" && !o.getDefaultProps.isReactClassApproved && S("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
560
560
|
}
|
|
561
561
|
}
|
|
562
562
|
function Or(e) {
|
|
563
563
|
{
|
|
564
|
-
for (var
|
|
565
|
-
var h =
|
|
564
|
+
for (var o = Object.keys(e.props), l = 0; l < o.length; l++) {
|
|
565
|
+
var h = o[l];
|
|
566
566
|
if (h !== "children" && h !== "key") {
|
|
567
|
-
|
|
567
|
+
Y(e), S("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", h), Y(null);
|
|
568
568
|
break;
|
|
569
569
|
}
|
|
570
570
|
}
|
|
571
|
-
e.ref !== null && (
|
|
571
|
+
e.ref !== null && (Y(e), S("Invalid attribute `ref` supplied to `React.Fragment`."), Y(null));
|
|
572
572
|
}
|
|
573
573
|
}
|
|
574
|
-
var
|
|
575
|
-
function
|
|
574
|
+
var He = {};
|
|
575
|
+
function Ke(e, o, l, h, w, j) {
|
|
576
576
|
{
|
|
577
577
|
var m = ur(e);
|
|
578
578
|
if (!m) {
|
|
579
|
-
var
|
|
580
|
-
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (
|
|
581
|
-
var P =
|
|
582
|
-
P ?
|
|
583
|
-
var
|
|
584
|
-
e === null ?
|
|
579
|
+
var y = "";
|
|
580
|
+
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (y += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
581
|
+
var P = Ir();
|
|
582
|
+
P ? y += P : y += Ye();
|
|
583
|
+
var k;
|
|
584
|
+
e === null ? k = "null" : ge(e) ? k = "array" : e !== void 0 && e.$$typeof === n ? (k = "<" + (z(e.type) || "Unknown") + " />", y = " Did you accidentally export a JSX literal instead of a component?") : k = typeof e, S("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", k, y);
|
|
585
585
|
}
|
|
586
|
-
var
|
|
587
|
-
if (
|
|
588
|
-
return
|
|
586
|
+
var E = Er(e, o, l, w, j);
|
|
587
|
+
if (E == null)
|
|
588
|
+
return E;
|
|
589
589
|
if (m) {
|
|
590
|
-
var
|
|
591
|
-
if (
|
|
590
|
+
var D = o.children;
|
|
591
|
+
if (D !== void 0)
|
|
592
592
|
if (h)
|
|
593
|
-
if (
|
|
594
|
-
for (var
|
|
595
|
-
|
|
596
|
-
Object.freeze && Object.freeze(
|
|
593
|
+
if (ge(D)) {
|
|
594
|
+
for (var q = 0; q < D.length; q++)
|
|
595
|
+
Ge(D[q], e);
|
|
596
|
+
Object.freeze && Object.freeze(D);
|
|
597
597
|
} else
|
|
598
598
|
S("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
599
599
|
else
|
|
600
|
-
|
|
600
|
+
Ge(D, e);
|
|
601
601
|
}
|
|
602
|
-
if (J.call(
|
|
603
|
-
var
|
|
604
|
-
return
|
|
605
|
-
}),
|
|
606
|
-
if (!
|
|
607
|
-
var
|
|
602
|
+
if (J.call(o, "key")) {
|
|
603
|
+
var B = z(e), O = Object.keys(o).filter(function(Lr) {
|
|
604
|
+
return Lr !== "key";
|
|
605
|
+
}), be = O.length > 0 ? "{key: someKey, " + O.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
606
|
+
if (!He[B + be]) {
|
|
607
|
+
var Fr = O.length > 0 ? "{" + O.join(": ..., ") + ": ...}" : "{}";
|
|
608
608
|
S(`A props object containing a "key" prop is being spread into JSX:
|
|
609
609
|
let props = %s;
|
|
610
610
|
<%s {...props} />
|
|
611
611
|
React keys must be passed directly to JSX without using spread:
|
|
612
612
|
let props = %s;
|
|
613
|
-
<%s key={someKey} {...props} />`,
|
|
613
|
+
<%s key={someKey} {...props} />`, be, B, Fr, B), He[B + be] = !0;
|
|
614
614
|
}
|
|
615
615
|
}
|
|
616
|
-
return e ===
|
|
616
|
+
return e === c ? Or(E) : Pr(E), E;
|
|
617
617
|
}
|
|
618
618
|
}
|
|
619
|
-
function
|
|
620
|
-
return
|
|
619
|
+
function Ar(e, o, l) {
|
|
620
|
+
return Ke(e, o, l, !0);
|
|
621
621
|
}
|
|
622
|
-
function
|
|
623
|
-
return
|
|
622
|
+
function Dr(e, o, l) {
|
|
623
|
+
return Ke(e, o, l, !1);
|
|
624
624
|
}
|
|
625
|
-
var
|
|
626
|
-
Q.Fragment =
|
|
625
|
+
var $r = Dr, Wr = Ar;
|
|
626
|
+
Q.Fragment = c, Q.jsx = $r, Q.jsxs = Wr;
|
|
627
627
|
}()), Q;
|
|
628
628
|
}
|
|
629
|
-
process.env.NODE_ENV === "production" ?
|
|
630
|
-
var r =
|
|
631
|
-
const
|
|
629
|
+
process.env.NODE_ENV === "production" ? we.exports = Kr() : we.exports = Jr();
|
|
630
|
+
var r = we.exports;
|
|
631
|
+
const ce = 100, ue = "http://localhost:1633", sr = "swarm-connect:bee-api-url", a = {
|
|
632
632
|
colors: {
|
|
633
633
|
primary: "#1a56db",
|
|
634
634
|
primaryHover: "#1e429f",
|
|
@@ -641,191 +641,301 @@ const ae = 100, we = "http://localhost:1633", a = {
|
|
|
641
641
|
border: "#e5e7eb",
|
|
642
642
|
text: "#111827",
|
|
643
643
|
muted: "#6b7280",
|
|
644
|
-
overlay: "rgba(0,0,0,0.5)"
|
|
644
|
+
overlay: "rgba(0,0,0,0.5)",
|
|
645
|
+
stepActive: "#1a56db"
|
|
645
646
|
}
|
|
646
647
|
};
|
|
647
|
-
function Xr(t =
|
|
648
|
-
const [
|
|
648
|
+
function Xr(t = ue) {
|
|
649
|
+
const [n, i] = U({
|
|
649
650
|
isRunning: !1,
|
|
650
651
|
isChecking: !1
|
|
651
|
-
}),
|
|
652
|
-
|
|
652
|
+
}), c = nr(async () => {
|
|
653
|
+
i({ isRunning: !1, isChecking: !0 });
|
|
653
654
|
try {
|
|
654
|
-
const
|
|
655
|
+
const u = await fetch(`${t}/health`, {
|
|
655
656
|
signal: AbortSignal.timeout(5e3)
|
|
656
657
|
});
|
|
657
|
-
if (
|
|
658
|
-
const p = await
|
|
659
|
-
|
|
658
|
+
if (u.ok) {
|
|
659
|
+
const p = await u.json();
|
|
660
|
+
i({ isRunning: !0, isChecking: !1, version: p.version });
|
|
660
661
|
} else
|
|
661
|
-
|
|
662
|
+
i({ isRunning: !1, isChecking: !1, error: `Node returned HTTP ${u.status}` });
|
|
662
663
|
} catch {
|
|
663
|
-
|
|
664
|
+
i({
|
|
664
665
|
isRunning: !1,
|
|
665
666
|
isChecking: !1,
|
|
666
667
|
error: `Cannot reach Bee node at ${t}`
|
|
667
668
|
});
|
|
668
669
|
}
|
|
669
670
|
}, [t]);
|
|
670
|
-
return { ...
|
|
671
|
+
return { ...n, check: c };
|
|
671
672
|
}
|
|
672
|
-
function Qr(t =
|
|
673
|
-
const [
|
|
674
|
-
|
|
673
|
+
function Qr(t = ue) {
|
|
674
|
+
const [n, i] = U([]), [c, u] = U(!1), [p, g] = U(), [x, f] = U(), s = nr(async () => {
|
|
675
|
+
u(!0), g(void 0);
|
|
675
676
|
try {
|
|
676
|
-
const
|
|
677
|
+
const d = await fetch(`${t}/stamps`, {
|
|
677
678
|
signal: AbortSignal.timeout(5e3)
|
|
678
679
|
});
|
|
679
|
-
if (
|
|
680
|
-
const
|
|
681
|
-
|
|
680
|
+
if (d.ok) {
|
|
681
|
+
const v = await d.json();
|
|
682
|
+
i(v.stamps ?? []);
|
|
682
683
|
} else
|
|
683
|
-
g(`HTTP ${
|
|
684
|
+
g(`HTTP ${d.status}`);
|
|
684
685
|
} catch {
|
|
685
686
|
g("Could not fetch postage stamps");
|
|
686
687
|
} finally {
|
|
687
|
-
|
|
688
|
+
u(!1);
|
|
688
689
|
}
|
|
689
690
|
}, [t]);
|
|
690
|
-
return { stamps:
|
|
691
|
+
return { stamps: n, isLoading: c, error: p, fetchStamps: s, selectedStampId: x, selectStamp: f };
|
|
692
|
+
}
|
|
693
|
+
function Zr() {
|
|
694
|
+
if (!(typeof window > "u"))
|
|
695
|
+
try {
|
|
696
|
+
return window.localStorage.getItem(sr) ?? void 0;
|
|
697
|
+
} catch {
|
|
698
|
+
return;
|
|
699
|
+
}
|
|
691
700
|
}
|
|
692
|
-
function
|
|
693
|
-
const
|
|
701
|
+
function et(t = {}) {
|
|
702
|
+
const [n, i] = U(
|
|
703
|
+
() => t.beeApiUrl ?? Zr() ?? ue
|
|
704
|
+
);
|
|
705
|
+
ae(() => {
|
|
706
|
+
if (!(typeof window > "u"))
|
|
707
|
+
try {
|
|
708
|
+
window.localStorage.setItem(sr, n);
|
|
709
|
+
} catch {
|
|
710
|
+
}
|
|
711
|
+
}, [n]);
|
|
712
|
+
const c = Xr(n), u = Qr(n), { address: p, isConnected: g } = or(), x = ir(), f = x === ce;
|
|
694
713
|
return {
|
|
695
|
-
beeNode:
|
|
696
|
-
stamps:
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
714
|
+
beeNode: c,
|
|
715
|
+
stamps: u,
|
|
716
|
+
beeApiUrl: n,
|
|
717
|
+
setBeeApiUrl: i,
|
|
718
|
+
isWalletConnected: g,
|
|
719
|
+
address: p,
|
|
720
|
+
isOnGnosis: f,
|
|
721
|
+
chainId: x,
|
|
722
|
+
isFullyConnected: c.isRunning && !!u.selectedStampId && g && f
|
|
702
723
|
};
|
|
703
724
|
}
|
|
704
|
-
function
|
|
705
|
-
return
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
725
|
+
function je({ step: t, done: n = !1, children: i }) {
|
|
726
|
+
return /* @__PURE__ */ r.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 8, marginBottom: 8 }, children: [
|
|
727
|
+
/* @__PURE__ */ r.jsx("span", { style: {
|
|
728
|
+
display: "inline-flex",
|
|
729
|
+
alignItems: "center",
|
|
730
|
+
justifyContent: "center",
|
|
731
|
+
width: 18,
|
|
732
|
+
height: 18,
|
|
733
|
+
borderRadius: "50%",
|
|
734
|
+
flexShrink: 0,
|
|
735
|
+
fontSize: 11,
|
|
736
|
+
fontWeight: 700,
|
|
737
|
+
lineHeight: 1,
|
|
738
|
+
color: "#fff",
|
|
739
|
+
background: n ? a.colors.success : a.colors.stepActive
|
|
740
|
+
}, children: n ? "✓" : t }),
|
|
741
|
+
/* @__PURE__ */ r.jsx("span", { style: {
|
|
742
|
+
fontSize: 11,
|
|
743
|
+
fontWeight: 700,
|
|
744
|
+
textTransform: "uppercase",
|
|
745
|
+
letterSpacing: "0.06em",
|
|
746
|
+
color: a.colors.muted
|
|
747
|
+
}, children: i })
|
|
748
|
+
] });
|
|
749
|
+
}
|
|
750
|
+
function rt({ beeApiUrl: t, setBeeApiUrl: n, beeNode: i, stamps: c }) {
|
|
751
|
+
return ae(() => {
|
|
752
|
+
i.check();
|
|
753
|
+
}, [t]), ae(() => {
|
|
754
|
+
i.isRunning && c.fetchStamps();
|
|
755
|
+
}, [i.isRunning]), /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
|
|
710
756
|
/* @__PURE__ */ r.jsxs("section", { children: [
|
|
711
|
-
/* @__PURE__ */ r.jsx(
|
|
712
|
-
/* @__PURE__ */ r.
|
|
757
|
+
/* @__PURE__ */ r.jsx(je, { step: 1, done: i.isRunning, children: "Bee Node" }),
|
|
758
|
+
/* @__PURE__ */ r.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 10 }, children: [
|
|
759
|
+
/* @__PURE__ */ r.jsx(
|
|
760
|
+
tt,
|
|
761
|
+
{
|
|
762
|
+
value: t,
|
|
763
|
+
disabled: i.isChecking,
|
|
764
|
+
onSubmit: n
|
|
765
|
+
}
|
|
766
|
+
),
|
|
767
|
+
/* @__PURE__ */ r.jsx(ot, { beeApiUrl: t, status: i, onRetry: i.check })
|
|
768
|
+
] })
|
|
713
769
|
] }),
|
|
714
|
-
|
|
715
|
-
/* @__PURE__ */ r.jsx(
|
|
716
|
-
/* @__PURE__ */ r.jsx(
|
|
770
|
+
/* @__PURE__ */ r.jsxs("section", { style: { opacity: i.isRunning ? 1 : 0.5 }, children: [
|
|
771
|
+
/* @__PURE__ */ r.jsx(je, { step: 2, done: !!c.selectedStampId, children: "Postage Stamp" }),
|
|
772
|
+
i.isRunning ? /* @__PURE__ */ r.jsx(it, { stamps: c }) : /* @__PURE__ */ r.jsx(nt, { children: "Connect a running Bee node to load postage stamps." })
|
|
717
773
|
] })
|
|
718
774
|
] });
|
|
719
775
|
}
|
|
720
|
-
function
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
776
|
+
function tt({ value: t, disabled: n, onSubmit: i }) {
|
|
777
|
+
const [c, u] = U(t);
|
|
778
|
+
ae(() => {
|
|
779
|
+
u(t);
|
|
780
|
+
}, [t]);
|
|
781
|
+
const p = c.trim().replace(/\/+$/, ""), g = p !== t && p.length > 0, x = () => {
|
|
782
|
+
g && i(p);
|
|
783
|
+
};
|
|
784
|
+
return /* @__PURE__ */ r.jsxs("div", { style: { display: "flex", gap: 6 }, children: [
|
|
785
|
+
/* @__PURE__ */ r.jsx(
|
|
786
|
+
"input",
|
|
787
|
+
{
|
|
788
|
+
type: "url",
|
|
789
|
+
value: c,
|
|
790
|
+
disabled: n,
|
|
791
|
+
onChange: (f) => u(f.target.value),
|
|
792
|
+
onKeyDown: (f) => {
|
|
793
|
+
f.key === "Enter" && x();
|
|
794
|
+
},
|
|
795
|
+
placeholder: "http://localhost:1633",
|
|
796
|
+
spellCheck: !1,
|
|
797
|
+
autoComplete: "off",
|
|
798
|
+
style: {
|
|
799
|
+
flex: 1,
|
|
800
|
+
minWidth: 0,
|
|
801
|
+
padding: "8px 10px",
|
|
802
|
+
fontSize: 13,
|
|
803
|
+
fontFamily: "monospace",
|
|
804
|
+
border: `1px solid ${a.colors.border}`,
|
|
805
|
+
borderRadius: 6,
|
|
806
|
+
color: a.colors.text,
|
|
807
|
+
outline: "none",
|
|
808
|
+
background: n ? "#f9fafb" : "#fff"
|
|
809
|
+
}
|
|
810
|
+
}
|
|
811
|
+
),
|
|
812
|
+
/* @__PURE__ */ r.jsx(
|
|
813
|
+
"button",
|
|
814
|
+
{
|
|
815
|
+
onClick: x,
|
|
816
|
+
disabled: n || !g,
|
|
817
|
+
style: {
|
|
818
|
+
...Ce,
|
|
819
|
+
alignSelf: "auto",
|
|
820
|
+
cursor: n || !g ? "default" : "pointer",
|
|
821
|
+
opacity: n || !g ? 0.5 : 1
|
|
822
|
+
},
|
|
823
|
+
children: "Connect"
|
|
824
|
+
}
|
|
825
|
+
)
|
|
826
|
+
] });
|
|
827
|
+
}
|
|
828
|
+
function nt({ children: t }) {
|
|
829
|
+
return /* @__PURE__ */ r.jsxs("div", { style: {
|
|
830
|
+
...N,
|
|
726
831
|
color: a.colors.muted,
|
|
727
|
-
|
|
728
|
-
|
|
832
|
+
fontSize: 13,
|
|
833
|
+
borderStyle: "dashed",
|
|
834
|
+
background: "#fafafa"
|
|
835
|
+
}, children: [
|
|
836
|
+
/* @__PURE__ */ r.jsx("span", { style: { fontSize: 13 }, children: "🔒" }),
|
|
837
|
+
/* @__PURE__ */ r.jsx("span", { children: t })
|
|
838
|
+
] });
|
|
729
839
|
}
|
|
730
|
-
function
|
|
731
|
-
return
|
|
732
|
-
/* @__PURE__ */ r.jsx(
|
|
840
|
+
function ot({ beeApiUrl: t, status: n, onRetry: i }) {
|
|
841
|
+
return n.isChecking ? /* @__PURE__ */ r.jsxs("div", { style: N, children: [
|
|
842
|
+
/* @__PURE__ */ r.jsx(ar, {}),
|
|
733
843
|
/* @__PURE__ */ r.jsxs("span", { style: { color: a.colors.muted, fontSize: 14 }, children: [
|
|
734
844
|
"Checking ",
|
|
735
845
|
t,
|
|
736
846
|
"…"
|
|
737
847
|
] })
|
|
738
|
-
] }) :
|
|
739
|
-
/* @__PURE__ */ r.jsx(
|
|
848
|
+
] }) : n.isRunning ? /* @__PURE__ */ r.jsxs("div", { style: { ...N, borderColor: a.colors.success, background: a.colors.successLight }, children: [
|
|
849
|
+
/* @__PURE__ */ r.jsx(rr, { color: a.colors.success }),
|
|
740
850
|
/* @__PURE__ */ r.jsxs("div", { children: [
|
|
741
851
|
/* @__PURE__ */ r.jsx("div", { style: { fontWeight: 600, color: a.colors.success, fontSize: 14 }, children: "Node running" }),
|
|
742
|
-
|
|
852
|
+
n.version && /* @__PURE__ */ r.jsxs("div", { style: { color: a.colors.muted, fontSize: 12 }, children: [
|
|
743
853
|
"v",
|
|
744
|
-
|
|
854
|
+
n.version
|
|
745
855
|
] })
|
|
746
856
|
] })
|
|
747
857
|
] }) : /* @__PURE__ */ r.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: [
|
|
748
|
-
/* @__PURE__ */ r.jsxs("div", { style: { ...
|
|
749
|
-
/* @__PURE__ */ r.jsx(
|
|
858
|
+
/* @__PURE__ */ r.jsxs("div", { style: { ...N, borderColor: a.colors.error, background: a.colors.errorLight }, children: [
|
|
859
|
+
/* @__PURE__ */ r.jsx(rr, { color: a.colors.error }),
|
|
750
860
|
/* @__PURE__ */ r.jsxs("div", { children: [
|
|
751
861
|
/* @__PURE__ */ r.jsx("div", { style: { fontWeight: 600, color: a.colors.error, fontSize: 14 }, children: "Node not reachable" }),
|
|
752
|
-
/* @__PURE__ */ r.jsx("div", { style: { color: a.colors.muted, fontSize: 12 }, children:
|
|
862
|
+
/* @__PURE__ */ r.jsx("div", { style: { color: a.colors.muted, fontSize: 12 }, children: n.error ?? `Cannot reach ${t}` })
|
|
753
863
|
] })
|
|
754
864
|
] }),
|
|
755
865
|
/* @__PURE__ */ r.jsxs("div", { style: { fontSize: 12, color: a.colors.muted }, children: [
|
|
756
866
|
"Start: ",
|
|
757
867
|
/* @__PURE__ */ r.jsx("code", { style: { background: "#f3f4f6", padding: "1px 5px", borderRadius: 3 }, children: "bee start" })
|
|
758
868
|
] }),
|
|
759
|
-
/* @__PURE__ */ r.jsx("button", { onClick:
|
|
869
|
+
/* @__PURE__ */ r.jsx("button", { onClick: i, style: Ce, children: "Retry" })
|
|
760
870
|
] });
|
|
761
871
|
}
|
|
762
|
-
function
|
|
763
|
-
return t.isLoading ? /* @__PURE__ */ r.jsxs("div", { style: { ...
|
|
764
|
-
/* @__PURE__ */ r.jsx(
|
|
872
|
+
function it({ stamps: t }) {
|
|
873
|
+
return t.isLoading ? /* @__PURE__ */ r.jsxs("div", { style: { ...N, gap: 10 }, children: [
|
|
874
|
+
/* @__PURE__ */ r.jsx(ar, {}),
|
|
765
875
|
/* @__PURE__ */ r.jsx("span", { style: { color: a.colors.muted, fontSize: 14 }, children: "Loading stamps…" })
|
|
766
876
|
] }) : t.error ? /* @__PURE__ */ r.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: [
|
|
767
|
-
/* @__PURE__ */ r.jsx("div", { style: { ...
|
|
768
|
-
/* @__PURE__ */ r.jsx("button", { onClick: t.fetchStamps, style:
|
|
769
|
-
] }) : t.stamps.length === 0 ? /* @__PURE__ */ r.jsxs("div", { style: { ...
|
|
877
|
+
/* @__PURE__ */ r.jsx("div", { style: { ...N, borderColor: a.colors.error, background: a.colors.errorLight }, children: /* @__PURE__ */ r.jsx("span", { style: { color: a.colors.error, fontSize: 13 }, children: t.error }) }),
|
|
878
|
+
/* @__PURE__ */ r.jsx("button", { onClick: t.fetchStamps, style: Ce, children: "Retry" })
|
|
879
|
+
] }) : t.stamps.length === 0 ? /* @__PURE__ */ r.jsxs("div", { style: { ...N, flexDirection: "column", alignItems: "flex-start", gap: 4 }, children: [
|
|
770
880
|
/* @__PURE__ */ r.jsx("div", { style: { fontSize: 14, color: a.colors.muted }, children: "No postage stamps found." }),
|
|
771
881
|
/* @__PURE__ */ r.jsx("div", { style: { fontSize: 12, color: a.colors.muted }, children: "Buy a stamp via the Bee API or Swarm Desktop to continue." })
|
|
772
|
-
] }) : /* @__PURE__ */ r.jsx("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: t.stamps.map((
|
|
773
|
-
|
|
882
|
+
] }) : /* @__PURE__ */ r.jsx("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: t.stamps.map((n) => /* @__PURE__ */ r.jsx(
|
|
883
|
+
st,
|
|
774
884
|
{
|
|
775
|
-
stamp:
|
|
776
|
-
selected: t.selectedStampId ===
|
|
777
|
-
onSelect: () => t.selectStamp(
|
|
885
|
+
stamp: n,
|
|
886
|
+
selected: t.selectedStampId === n.batchID,
|
|
887
|
+
onSelect: () => t.selectStamp(n.batchID)
|
|
778
888
|
},
|
|
779
|
-
|
|
889
|
+
n.batchID
|
|
780
890
|
)) });
|
|
781
891
|
}
|
|
782
|
-
function
|
|
783
|
-
const
|
|
892
|
+
function st({ stamp: t, selected: n, onSelect: i }) {
|
|
893
|
+
const c = Math.floor(t.batchTTL / 86400), u = `${t.batchID.slice(0, 8)}…${t.batchID.slice(-6)}`;
|
|
784
894
|
return /* @__PURE__ */ r.jsxs(
|
|
785
895
|
"button",
|
|
786
896
|
{
|
|
787
|
-
onClick:
|
|
897
|
+
onClick: i,
|
|
788
898
|
style: {
|
|
789
899
|
display: "flex",
|
|
790
900
|
alignItems: "center",
|
|
791
901
|
justifyContent: "space-between",
|
|
792
902
|
padding: "10px 14px",
|
|
793
|
-
border: `1.5px solid ${
|
|
903
|
+
border: `1.5px solid ${n ? a.colors.primary : a.colors.border}`,
|
|
794
904
|
borderRadius: 8,
|
|
795
905
|
cursor: "pointer",
|
|
796
|
-
background:
|
|
906
|
+
background: n ? "#eff6ff" : "#fff",
|
|
797
907
|
textAlign: "left",
|
|
798
908
|
width: "100%",
|
|
799
909
|
transition: "all 0.15s"
|
|
800
910
|
},
|
|
801
911
|
children: [
|
|
802
912
|
/* @__PURE__ */ r.jsxs("div", { children: [
|
|
803
|
-
/* @__PURE__ */ r.jsx("div", { style: { fontFamily: "monospace", fontSize: 12, color: a.colors.text }, children:
|
|
913
|
+
/* @__PURE__ */ r.jsx("div", { style: { fontFamily: "monospace", fontSize: 12, color: a.colors.text }, children: u }),
|
|
804
914
|
t.label && /* @__PURE__ */ r.jsx("div", { style: { fontSize: 12, color: a.colors.muted, marginTop: 2 }, children: t.label })
|
|
805
915
|
] }),
|
|
806
916
|
/* @__PURE__ */ r.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 8, flexShrink: 0 }, children: [
|
|
807
|
-
/* @__PURE__ */ r.jsx("span", { style: { fontSize: 11, color: a.colors.muted }, children:
|
|
808
|
-
t.usable ? /* @__PURE__ */ r.jsx(
|
|
917
|
+
/* @__PURE__ */ r.jsx("span", { style: { fontSize: 11, color: a.colors.muted }, children: c > 0 ? `${c}d` : "expiring" }),
|
|
918
|
+
t.usable ? /* @__PURE__ */ r.jsx(er, { bg: a.colors.successLight, color: a.colors.success, children: "usable" }) : /* @__PURE__ */ r.jsx(er, { bg: a.colors.errorLight, color: a.colors.error, children: "unusable" }),
|
|
809
919
|
/* @__PURE__ */ r.jsx("div", { style: {
|
|
810
920
|
width: 16,
|
|
811
921
|
height: 16,
|
|
812
922
|
borderRadius: "50%",
|
|
813
923
|
flexShrink: 0,
|
|
814
|
-
border: `2px solid ${
|
|
815
|
-
background:
|
|
924
|
+
border: `2px solid ${n ? a.colors.primary : a.colors.border}`,
|
|
925
|
+
background: n ? a.colors.primary : "transparent"
|
|
816
926
|
} })
|
|
817
927
|
] })
|
|
818
928
|
]
|
|
819
929
|
}
|
|
820
930
|
);
|
|
821
931
|
}
|
|
822
|
-
function
|
|
823
|
-
return /* @__PURE__ */ r.jsx("span", { style: { fontSize: 11, background:
|
|
932
|
+
function er({ children: t, bg: n, color: i }) {
|
|
933
|
+
return /* @__PURE__ */ r.jsx("span", { style: { fontSize: 11, background: n, color: i, borderRadius: 4, padding: "2px 6px" }, children: t });
|
|
824
934
|
}
|
|
825
|
-
function
|
|
935
|
+
function rr({ color: t }) {
|
|
826
936
|
return /* @__PURE__ */ r.jsx("span", { style: { fontSize: 10, color: t, lineHeight: 1 }, children: "●" });
|
|
827
937
|
}
|
|
828
|
-
function
|
|
938
|
+
function ar() {
|
|
829
939
|
return /* @__PURE__ */ r.jsx("div", { style: {
|
|
830
940
|
width: 15,
|
|
831
941
|
height: 15,
|
|
@@ -836,7 +946,7 @@ function sr() {
|
|
|
836
946
|
animation: "spin 0.7s linear infinite"
|
|
837
947
|
} });
|
|
838
948
|
}
|
|
839
|
-
const
|
|
949
|
+
const N = {
|
|
840
950
|
display: "flex",
|
|
841
951
|
alignItems: "center",
|
|
842
952
|
gap: 12,
|
|
@@ -844,7 +954,7 @@ const V = {
|
|
|
844
954
|
border: `1px solid ${a.colors.border}`,
|
|
845
955
|
borderRadius: 8,
|
|
846
956
|
background: "#fff"
|
|
847
|
-
},
|
|
957
|
+
}, Ce = {
|
|
848
958
|
background: "none",
|
|
849
959
|
border: `1px solid ${a.colors.border}`,
|
|
850
960
|
borderRadius: 6,
|
|
@@ -854,24 +964,24 @@ const V = {
|
|
|
854
964
|
color: a.colors.muted,
|
|
855
965
|
alignSelf: "flex-start"
|
|
856
966
|
};
|
|
857
|
-
function
|
|
858
|
-
const
|
|
967
|
+
function at(t) {
|
|
968
|
+
const n = {
|
|
859
969
|
formatters: void 0,
|
|
860
970
|
fees: void 0,
|
|
861
971
|
serializers: void 0,
|
|
862
972
|
...t
|
|
863
973
|
};
|
|
864
|
-
function
|
|
865
|
-
return (
|
|
866
|
-
const p = typeof
|
|
867
|
-
return Object.assign(g, { extend:
|
|
974
|
+
function i(c) {
|
|
975
|
+
return (u) => {
|
|
976
|
+
const p = typeof u == "function" ? u(c) : u, g = { ...c, ...p };
|
|
977
|
+
return Object.assign(g, { extend: i(g) });
|
|
868
978
|
};
|
|
869
979
|
}
|
|
870
|
-
return Object.assign(
|
|
871
|
-
extend:
|
|
980
|
+
return Object.assign(n, {
|
|
981
|
+
extend: i(n)
|
|
872
982
|
});
|
|
873
983
|
}
|
|
874
|
-
const
|
|
984
|
+
const Se = /* @__PURE__ */ at({
|
|
875
985
|
id: 100,
|
|
876
986
|
name: "Gnosis",
|
|
877
987
|
nativeCurrency: {
|
|
@@ -900,31 +1010,18 @@ const xe = /* @__PURE__ */ ot({
|
|
|
900
1010
|
}
|
|
901
1011
|
}
|
|
902
1012
|
});
|
|
903
|
-
function
|
|
904
|
-
const { address:
|
|
905
|
-
return /* @__PURE__ */ r.jsxs("
|
|
906
|
-
/* @__PURE__ */ r.
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
o && /* @__PURE__ */ r.jsxs("section", { children: [
|
|
911
|
-
/* @__PURE__ */ r.jsx(rr, { children: "Network" }),
|
|
912
|
-
/* @__PURE__ */ r.jsx(ct, { isOnGnosis: u, chainId: s })
|
|
1013
|
+
function ct({ swarmReady: t }) {
|
|
1014
|
+
const { address: n, isConnected: i } = or(), c = ir(), u = c === ce;
|
|
1015
|
+
return /* @__PURE__ */ r.jsxs("section", { style: { opacity: t ? 1 : 0.5 }, children: [
|
|
1016
|
+
/* @__PURE__ */ r.jsx(je, { step: 3, done: i && u, children: "Wallet" }),
|
|
1017
|
+
/* @__PURE__ */ r.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 12 }, children: [
|
|
1018
|
+
i ? /* @__PURE__ */ r.jsx(lt, { address: n }) : t ? /* @__PURE__ */ r.jsx(dt, {}) : /* @__PURE__ */ r.jsx(ut, {}),
|
|
1019
|
+
i && /* @__PURE__ */ r.jsx(ft, { isOnGnosis: u, chainId: c })
|
|
913
1020
|
] })
|
|
914
1021
|
] });
|
|
915
1022
|
}
|
|
916
|
-
function
|
|
917
|
-
|
|
918
|
-
fontSize: 11,
|
|
919
|
-
fontWeight: 700,
|
|
920
|
-
textTransform: "uppercase",
|
|
921
|
-
letterSpacing: "0.06em",
|
|
922
|
-
color: a.colors.muted,
|
|
923
|
-
marginBottom: 8
|
|
924
|
-
}, children: t });
|
|
925
|
-
}
|
|
926
|
-
function st({ address: t }) {
|
|
927
|
-
const { disconnect: o } = zr();
|
|
1023
|
+
function lt({ address: t }) {
|
|
1024
|
+
const { disconnect: n } = zr();
|
|
928
1025
|
return /* @__PURE__ */ r.jsxs("div", { style: {
|
|
929
1026
|
display: "flex",
|
|
930
1027
|
alignItems: "center",
|
|
@@ -941,7 +1038,7 @@ function st({ address: t }) {
|
|
|
941
1038
|
/* @__PURE__ */ r.jsx(
|
|
942
1039
|
"button",
|
|
943
1040
|
{
|
|
944
|
-
onClick: () =>
|
|
1041
|
+
onClick: () => n(),
|
|
945
1042
|
style: {
|
|
946
1043
|
background: "none",
|
|
947
1044
|
border: `1px solid ${a.colors.border}`,
|
|
@@ -956,14 +1053,28 @@ function st({ address: t }) {
|
|
|
956
1053
|
)
|
|
957
1054
|
] });
|
|
958
1055
|
}
|
|
959
|
-
function
|
|
960
|
-
|
|
1056
|
+
function ut() {
|
|
1057
|
+
return /* @__PURE__ */ r.jsxs("div", { style: {
|
|
1058
|
+
display: "flex",
|
|
1059
|
+
alignItems: "center",
|
|
1060
|
+
gap: 12,
|
|
1061
|
+
padding: "11px 14px",
|
|
1062
|
+
border: `1px dashed ${a.colors.border}`,
|
|
1063
|
+
borderRadius: 8,
|
|
1064
|
+
background: "#fafafa"
|
|
1065
|
+
}, children: [
|
|
1066
|
+
/* @__PURE__ */ r.jsx("span", { style: { fontSize: 13 }, children: "🔒" }),
|
|
1067
|
+
/* @__PURE__ */ r.jsx("span", { style: { fontSize: 13, color: a.colors.muted }, children: "Complete steps 1 and 2 — a running Bee node and a selected postage stamp — to connect your wallet." })
|
|
1068
|
+
] });
|
|
1069
|
+
}
|
|
1070
|
+
function dt() {
|
|
1071
|
+
const { connectors: t, connect: n, isPending: i, error: c } = Ur();
|
|
961
1072
|
return /* @__PURE__ */ r.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: [
|
|
962
|
-
t.map((
|
|
1073
|
+
t.map((u) => /* @__PURE__ */ r.jsxs(
|
|
963
1074
|
"button",
|
|
964
1075
|
{
|
|
965
|
-
onClick: () =>
|
|
966
|
-
disabled:
|
|
1076
|
+
onClick: () => n({ connector: u }),
|
|
1077
|
+
disabled: i,
|
|
967
1078
|
style: {
|
|
968
1079
|
display: "flex",
|
|
969
1080
|
alignItems: "center",
|
|
@@ -971,33 +1082,33 @@ function at() {
|
|
|
971
1082
|
padding: "11px 14px",
|
|
972
1083
|
border: `1.5px solid ${a.colors.border}`,
|
|
973
1084
|
borderRadius: 8,
|
|
974
|
-
cursor:
|
|
1085
|
+
cursor: i ? "not-allowed" : "pointer",
|
|
975
1086
|
background: "#fff",
|
|
976
1087
|
fontSize: 14,
|
|
977
1088
|
fontWeight: 500,
|
|
978
1089
|
color: a.colors.text,
|
|
979
|
-
opacity:
|
|
1090
|
+
opacity: i ? 0.6 : 1,
|
|
980
1091
|
transition: "border-color 0.15s",
|
|
981
1092
|
width: "100%"
|
|
982
1093
|
},
|
|
983
1094
|
onMouseOver: (p) => {
|
|
984
|
-
|
|
1095
|
+
i || (p.currentTarget.style.borderColor = a.colors.primary);
|
|
985
1096
|
},
|
|
986
1097
|
onMouseOut: (p) => {
|
|
987
1098
|
p.currentTarget.style.borderColor = a.colors.border;
|
|
988
1099
|
},
|
|
989
1100
|
children: [
|
|
990
|
-
|
|
991
|
-
|
|
1101
|
+
u.icon ? /* @__PURE__ */ r.jsx("img", { src: u.icon, width: 20, height: 20, alt: "", style: { borderRadius: 4 } }) : /* @__PURE__ */ r.jsx("span", { style: { width: 20, textAlign: "center", fontSize: 16 }, children: "🔗" }),
|
|
1102
|
+
u.name
|
|
992
1103
|
]
|
|
993
1104
|
},
|
|
994
|
-
|
|
1105
|
+
u.uid
|
|
995
1106
|
)),
|
|
996
|
-
|
|
1107
|
+
c && /* @__PURE__ */ r.jsx("div", { style: { fontSize: 12, color: a.colors.error, marginTop: 2 }, children: c.message })
|
|
997
1108
|
] });
|
|
998
1109
|
}
|
|
999
|
-
function
|
|
1000
|
-
const { switchChain:
|
|
1110
|
+
function ft({ isOnGnosis: t, chainId: n }) {
|
|
1111
|
+
const { switchChain: i, isPending: c, error: u } = Mr();
|
|
1001
1112
|
return t ? /* @__PURE__ */ r.jsxs("div", { style: {
|
|
1002
1113
|
display: "flex",
|
|
1003
1114
|
alignItems: "center",
|
|
@@ -1012,7 +1123,7 @@ function ct({ isOnGnosis: t, chainId: o }) {
|
|
|
1012
1123
|
/* @__PURE__ */ r.jsx("div", { style: { fontWeight: 600, color: a.colors.success, fontSize: 14 }, children: "Gnosis chain" }),
|
|
1013
1124
|
/* @__PURE__ */ r.jsxs("div", { style: { fontSize: 12, color: a.colors.muted }, children: [
|
|
1014
1125
|
"Chain ID ",
|
|
1015
|
-
|
|
1126
|
+
ce
|
|
1016
1127
|
] })
|
|
1017
1128
|
] })
|
|
1018
1129
|
] }) : /* @__PURE__ */ r.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: [
|
|
@@ -1030,9 +1141,9 @@ function ct({ isOnGnosis: t, chainId: o }) {
|
|
|
1030
1141
|
/* @__PURE__ */ r.jsx("div", { style: { fontWeight: 600, color: a.colors.warning, fontSize: 14 }, children: "Wrong network" }),
|
|
1031
1142
|
/* @__PURE__ */ r.jsxs("div", { style: { fontSize: 12, color: a.colors.muted }, children: [
|
|
1032
1143
|
"Chain ",
|
|
1033
|
-
|
|
1144
|
+
n ?? "—",
|
|
1034
1145
|
" active — Gnosis (",
|
|
1035
|
-
|
|
1146
|
+
ce,
|
|
1036
1147
|
") required"
|
|
1037
1148
|
] })
|
|
1038
1149
|
] })
|
|
@@ -1040,28 +1151,28 @@ function ct({ isOnGnosis: t, chainId: o }) {
|
|
|
1040
1151
|
/* @__PURE__ */ r.jsx(
|
|
1041
1152
|
"button",
|
|
1042
1153
|
{
|
|
1043
|
-
onClick: () =>
|
|
1044
|
-
disabled:
|
|
1154
|
+
onClick: () => i({ chainId: Se.id }),
|
|
1155
|
+
disabled: c,
|
|
1045
1156
|
style: {
|
|
1046
1157
|
background: a.colors.primary,
|
|
1047
1158
|
color: "#fff",
|
|
1048
1159
|
border: "none",
|
|
1049
1160
|
borderRadius: 6,
|
|
1050
1161
|
padding: "9px 20px",
|
|
1051
|
-
cursor:
|
|
1162
|
+
cursor: c ? "not-allowed" : "pointer",
|
|
1052
1163
|
fontSize: 14,
|
|
1053
1164
|
fontWeight: 500,
|
|
1054
|
-
opacity:
|
|
1165
|
+
opacity: c ? 0.7 : 1,
|
|
1055
1166
|
alignSelf: "flex-start"
|
|
1056
1167
|
},
|
|
1057
|
-
children:
|
|
1168
|
+
children: c ? "Switching…" : "Switch to Gnosis"
|
|
1058
1169
|
}
|
|
1059
1170
|
),
|
|
1060
|
-
|
|
1171
|
+
u && /* @__PURE__ */ r.jsx("div", { style: { fontSize: 12, color: a.colors.error }, children: u.message })
|
|
1061
1172
|
] });
|
|
1062
1173
|
}
|
|
1063
|
-
function
|
|
1064
|
-
const
|
|
1174
|
+
function ht({ onClose: t, beeNode: n, stamps: i, beeApiUrl: c, setBeeApiUrl: u }) {
|
|
1175
|
+
const p = n.isRunning && !!i.selectedStampId;
|
|
1065
1176
|
return /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
|
|
1066
1177
|
/* @__PURE__ */ r.jsx("style", { children: `
|
|
1067
1178
|
@keyframes spin { to { transform: rotate(360deg); } }
|
|
@@ -1125,117 +1236,117 @@ function lt({ onClose: t, beeNode: o, stamps: s, beeApiUrl: u }) {
|
|
|
1125
1236
|
}
|
|
1126
1237
|
)
|
|
1127
1238
|
] }),
|
|
1128
|
-
/* @__PURE__ */ r.
|
|
1239
|
+
/* @__PURE__ */ r.jsxs("div", { style: {
|
|
1240
|
+
padding: "20px",
|
|
1241
|
+
marginTop: 6,
|
|
1242
|
+
minHeight: 260,
|
|
1243
|
+
maxHeight: "64vh",
|
|
1244
|
+
overflowY: "auto",
|
|
1129
1245
|
display: "flex",
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
}, children: [
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
"button",
|
|
1246
|
+
flexDirection: "column",
|
|
1247
|
+
gap: 28
|
|
1248
|
+
}, children: [
|
|
1249
|
+
/* @__PURE__ */ r.jsx(
|
|
1250
|
+
rt,
|
|
1136
1251
|
{
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
fontWeight: b ? 600 : 400,
|
|
1145
|
-
color: b ? a.colors.primary : a.colors.muted,
|
|
1146
|
-
borderBottom: `2px solid ${b ? a.colors.primary : "transparent"}`,
|
|
1147
|
-
marginBottom: -1,
|
|
1148
|
-
transition: "all 0.15s"
|
|
1149
|
-
},
|
|
1150
|
-
children: g === "swarm" ? "🐝 Swarm" : "🦊 Wallet"
|
|
1151
|
-
},
|
|
1152
|
-
g
|
|
1153
|
-
);
|
|
1154
|
-
}) }),
|
|
1155
|
-
/* @__PURE__ */ r.jsxs("div", { style: { padding: "20px", minHeight: 260, maxHeight: "60vh", overflowY: "auto" }, children: [
|
|
1156
|
-
d === "swarm" && /* @__PURE__ */ r.jsx(et, { beeApiUrl: u, beeNode: o, stamps: s }),
|
|
1157
|
-
d === "wallet" && /* @__PURE__ */ r.jsx(it, {})
|
|
1252
|
+
beeApiUrl: c,
|
|
1253
|
+
setBeeApiUrl: u,
|
|
1254
|
+
beeNode: n,
|
|
1255
|
+
stamps: i
|
|
1256
|
+
}
|
|
1257
|
+
),
|
|
1258
|
+
/* @__PURE__ */ r.jsx(ct, { swarmReady: p })
|
|
1158
1259
|
] })
|
|
1159
1260
|
] })
|
|
1160
1261
|
] });
|
|
1161
1262
|
}
|
|
1162
|
-
function
|
|
1163
|
-
const [
|
|
1263
|
+
function Ct({ beeApiUrl: t = ue, label: n }) {
|
|
1264
|
+
const [i, c] = U(!1), {
|
|
1265
|
+
beeNode: u,
|
|
1266
|
+
stamps: p,
|
|
1267
|
+
beeApiUrl: g,
|
|
1268
|
+
setBeeApiUrl: x,
|
|
1269
|
+
isWalletConnected: f,
|
|
1270
|
+
address: s,
|
|
1271
|
+
isOnGnosis: d,
|
|
1272
|
+
isFullyConnected: v
|
|
1273
|
+
} = et({ beeApiUrl: t }), b = n ?? (v ? s ? `${s.slice(0, 6)}…${s.slice(-4)}` : "Connected" : "Connect to Swarm");
|
|
1164
1274
|
return /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
|
|
1165
1275
|
/* @__PURE__ */ r.jsxs(
|
|
1166
1276
|
"button",
|
|
1167
1277
|
{
|
|
1168
|
-
onClick: () =>
|
|
1278
|
+
onClick: () => c(!0),
|
|
1169
1279
|
style: {
|
|
1170
1280
|
display: "inline-flex",
|
|
1171
1281
|
alignItems: "center",
|
|
1172
1282
|
gap: 8,
|
|
1173
|
-
background:
|
|
1174
|
-
color:
|
|
1175
|
-
border:
|
|
1283
|
+
background: v ? a.colors.successLight : a.colors.primary,
|
|
1284
|
+
color: v ? a.colors.success : "#fff",
|
|
1285
|
+
border: v ? `1.5px solid ${a.colors.success}` : "none",
|
|
1176
1286
|
borderRadius: 8,
|
|
1177
1287
|
padding: "10px 18px",
|
|
1178
1288
|
cursor: "pointer",
|
|
1179
1289
|
fontSize: 15,
|
|
1180
1290
|
fontWeight: 600,
|
|
1181
|
-
boxShadow:
|
|
1291
|
+
boxShadow: v ? "none" : "0 2px 8px rgba(26,86,219,0.25)",
|
|
1182
1292
|
transition: "all 0.15s",
|
|
1183
1293
|
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif'
|
|
1184
1294
|
},
|
|
1185
|
-
onMouseOver: (
|
|
1186
|
-
|
|
1295
|
+
onMouseOver: (R) => {
|
|
1296
|
+
v || (R.currentTarget.style.background = a.colors.primaryHover);
|
|
1187
1297
|
},
|
|
1188
|
-
onMouseOut: (
|
|
1189
|
-
|
|
1298
|
+
onMouseOut: (R) => {
|
|
1299
|
+
R.currentTarget.style.background = v ? a.colors.successLight : a.colors.primary;
|
|
1190
1300
|
},
|
|
1191
1301
|
children: [
|
|
1192
|
-
!
|
|
1193
|
-
/* @__PURE__ */ r.jsx(ie, { ok:
|
|
1302
|
+
!v && /* @__PURE__ */ r.jsxs("span", { style: { display: "flex", gap: 4, alignItems: "center" }, children: [
|
|
1303
|
+
/* @__PURE__ */ r.jsx(ie, { ok: u.isRunning, checking: u.isChecking }),
|
|
1194
1304
|
/* @__PURE__ */ r.jsx(ie, { ok: !!p.selectedStampId }),
|
|
1195
|
-
/* @__PURE__ */ r.jsx(ie, { ok:
|
|
1196
|
-
/* @__PURE__ */ r.jsx(ie, { ok:
|
|
1305
|
+
/* @__PURE__ */ r.jsx(ie, { ok: f }),
|
|
1306
|
+
/* @__PURE__ */ r.jsx(ie, { ok: d })
|
|
1197
1307
|
] }),
|
|
1198
|
-
|
|
1308
|
+
b
|
|
1199
1309
|
]
|
|
1200
1310
|
}
|
|
1201
1311
|
),
|
|
1202
|
-
|
|
1203
|
-
|
|
1312
|
+
i && /* @__PURE__ */ r.jsx(
|
|
1313
|
+
ht,
|
|
1204
1314
|
{
|
|
1205
|
-
onClose: () =>
|
|
1206
|
-
beeNode:
|
|
1315
|
+
onClose: () => c(!1),
|
|
1316
|
+
beeNode: u,
|
|
1207
1317
|
stamps: p,
|
|
1208
|
-
beeApiUrl:
|
|
1318
|
+
beeApiUrl: g,
|
|
1319
|
+
setBeeApiUrl: x
|
|
1209
1320
|
}
|
|
1210
1321
|
)
|
|
1211
1322
|
] });
|
|
1212
1323
|
}
|
|
1213
|
-
function ie({ ok: t, checking:
|
|
1214
|
-
const
|
|
1324
|
+
function ie({ ok: t, checking: n }) {
|
|
1325
|
+
const i = n ? a.colors.warning : t ? a.colors.success : a.colors.error;
|
|
1215
1326
|
return /* @__PURE__ */ r.jsx("span", { style: {
|
|
1216
1327
|
display: "inline-block",
|
|
1217
1328
|
width: 7,
|
|
1218
1329
|
height: 7,
|
|
1219
1330
|
borderRadius: "50%",
|
|
1220
|
-
background:
|
|
1331
|
+
background: i
|
|
1221
1332
|
} });
|
|
1222
1333
|
}
|
|
1223
|
-
const
|
|
1224
|
-
var cr = function(t,
|
|
1225
|
-
if (
|
|
1226
|
-
if (typeof
|
|
1227
|
-
return
|
|
1228
|
-
},
|
|
1334
|
+
const pt = "2.22.1", gt = () => `@wagmi/core@${pt}`;
|
|
1335
|
+
var cr = function(t, n, i, c) {
|
|
1336
|
+
if (i === "a" && !c) throw new TypeError("Private accessor was defined without a getter");
|
|
1337
|
+
if (typeof n == "function" ? t !== n || !c : !n.has(t)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
1338
|
+
return i === "m" ? c : i === "a" ? c.call(t) : c ? c.value : n.get(t);
|
|
1339
|
+
}, le, lr;
|
|
1229
1340
|
class Z extends Error {
|
|
1230
1341
|
get docsBaseUrl() {
|
|
1231
1342
|
return "https://wagmi.sh/core";
|
|
1232
1343
|
}
|
|
1233
1344
|
get version() {
|
|
1234
|
-
return
|
|
1345
|
+
return gt();
|
|
1235
1346
|
}
|
|
1236
|
-
constructor(
|
|
1347
|
+
constructor(n, i = {}) {
|
|
1237
1348
|
var p;
|
|
1238
|
-
super(),
|
|
1349
|
+
super(), le.add(this), Object.defineProperty(this, "details", {
|
|
1239
1350
|
enumerable: !0,
|
|
1240
1351
|
configurable: !0,
|
|
1241
1352
|
writable: !0,
|
|
@@ -1261,27 +1372,27 @@ class Z extends Error {
|
|
|
1261
1372
|
writable: !0,
|
|
1262
1373
|
value: "WagmiCoreError"
|
|
1263
1374
|
});
|
|
1264
|
-
const
|
|
1375
|
+
const c = i.cause instanceof Z ? i.cause.details : (p = i.cause) != null && p.message ? i.cause.message : i.details, u = i.cause instanceof Z && i.cause.docsPath || i.docsPath;
|
|
1265
1376
|
this.message = [
|
|
1266
|
-
|
|
1377
|
+
n || "An error occurred.",
|
|
1267
1378
|
"",
|
|
1268
|
-
...
|
|
1269
|
-
...
|
|
1270
|
-
`Docs: ${this.docsBaseUrl}${
|
|
1379
|
+
...i.metaMessages ? [...i.metaMessages, ""] : [],
|
|
1380
|
+
...u ? [
|
|
1381
|
+
`Docs: ${this.docsBaseUrl}${u}.html${i.docsSlug ? `#${i.docsSlug}` : ""}`
|
|
1271
1382
|
] : [],
|
|
1272
|
-
...
|
|
1383
|
+
...c ? [`Details: ${c}`] : [],
|
|
1273
1384
|
`Version: ${this.version}`
|
|
1274
1385
|
].join(`
|
|
1275
|
-
`),
|
|
1386
|
+
`), i.cause && (this.cause = i.cause), this.details = c, this.docsPath = u, this.metaMessages = i.metaMessages, this.shortMessage = n;
|
|
1276
1387
|
}
|
|
1277
|
-
walk(
|
|
1278
|
-
return cr(this,
|
|
1388
|
+
walk(n) {
|
|
1389
|
+
return cr(this, le, "m", lr).call(this, this, n);
|
|
1279
1390
|
}
|
|
1280
1391
|
}
|
|
1281
|
-
|
|
1282
|
-
return
|
|
1392
|
+
le = /* @__PURE__ */ new WeakSet(), lr = function t(n, i) {
|
|
1393
|
+
return i != null && i(n) ? n : n.cause ? cr(this, le, "m", t).call(this, n.cause, i) : n;
|
|
1283
1394
|
};
|
|
1284
|
-
class
|
|
1395
|
+
class vt extends Z {
|
|
1285
1396
|
constructor() {
|
|
1286
1397
|
super("Chain not configured."), Object.defineProperty(this, "name", {
|
|
1287
1398
|
enumerable: !0,
|
|
@@ -1291,7 +1402,7 @@ class ft extends Z {
|
|
|
1291
1402
|
});
|
|
1292
1403
|
}
|
|
1293
1404
|
}
|
|
1294
|
-
class
|
|
1405
|
+
class V extends Z {
|
|
1295
1406
|
constructor() {
|
|
1296
1407
|
super("Provider not found."), Object.defineProperty(this, "name", {
|
|
1297
1408
|
enumerable: !0,
|
|
@@ -1301,18 +1412,18 @@ class q extends Z {
|
|
|
1301
1412
|
});
|
|
1302
1413
|
}
|
|
1303
1414
|
}
|
|
1304
|
-
|
|
1305
|
-
function
|
|
1306
|
-
const { shimDisconnect:
|
|
1307
|
-
function
|
|
1415
|
+
Re.type = "injected";
|
|
1416
|
+
function Re(t = {}) {
|
|
1417
|
+
const { shimDisconnect: n = !0, unstable_shimAsyncInject: i } = t;
|
|
1418
|
+
function c() {
|
|
1308
1419
|
const f = t.target;
|
|
1309
1420
|
if (typeof f == "function") {
|
|
1310
|
-
const
|
|
1311
|
-
if (
|
|
1312
|
-
return
|
|
1421
|
+
const s = f();
|
|
1422
|
+
if (s)
|
|
1423
|
+
return s;
|
|
1313
1424
|
}
|
|
1314
1425
|
return typeof f == "object" ? f : typeof f == "string" ? {
|
|
1315
|
-
...
|
|
1426
|
+
...yt[f] ?? {
|
|
1316
1427
|
id: f,
|
|
1317
1428
|
name: `${f[0].toUpperCase()}${f.slice(1)}`,
|
|
1318
1429
|
provider: `is${f[0].toUpperCase()}${f.slice(1)}`
|
|
@@ -1320,84 +1431,84 @@ function je(t = {}) {
|
|
|
1320
1431
|
} : {
|
|
1321
1432
|
id: "injected",
|
|
1322
1433
|
name: "Injected",
|
|
1323
|
-
provider(
|
|
1324
|
-
return
|
|
1434
|
+
provider(s) {
|
|
1435
|
+
return s == null ? void 0 : s.ethereum;
|
|
1325
1436
|
}
|
|
1326
1437
|
};
|
|
1327
1438
|
}
|
|
1328
|
-
let
|
|
1439
|
+
let u, p, g, x;
|
|
1329
1440
|
return (f) => ({
|
|
1330
1441
|
get icon() {
|
|
1331
|
-
return
|
|
1442
|
+
return c().icon;
|
|
1332
1443
|
},
|
|
1333
1444
|
get id() {
|
|
1334
|
-
return
|
|
1445
|
+
return c().id;
|
|
1335
1446
|
},
|
|
1336
1447
|
get name() {
|
|
1337
|
-
return
|
|
1448
|
+
return c().name;
|
|
1338
1449
|
},
|
|
1339
1450
|
/** @deprecated */
|
|
1340
1451
|
get supportsSimulation() {
|
|
1341
1452
|
return !0;
|
|
1342
1453
|
},
|
|
1343
|
-
type:
|
|
1454
|
+
type: Re.type,
|
|
1344
1455
|
async setup() {
|
|
1345
|
-
const
|
|
1346
|
-
|
|
1456
|
+
const s = await this.getProvider();
|
|
1457
|
+
s != null && s.on && t.target && (g || (g = this.onConnect.bind(this), s.on("connect", g)), u || (u = this.onAccountsChanged.bind(this), s.on("accountsChanged", u)));
|
|
1347
1458
|
},
|
|
1348
|
-
async connect({ chainId:
|
|
1349
|
-
var
|
|
1350
|
-
const
|
|
1351
|
-
if (!
|
|
1352
|
-
throw new
|
|
1353
|
-
let
|
|
1354
|
-
if (
|
|
1355
|
-
|
|
1356
|
-
else if (
|
|
1459
|
+
async connect({ chainId: s, isReconnecting: d, withCapabilities: v } = {}) {
|
|
1460
|
+
var A, W, L, I, S, T;
|
|
1461
|
+
const b = await this.getProvider();
|
|
1462
|
+
if (!b)
|
|
1463
|
+
throw new V();
|
|
1464
|
+
let R = [];
|
|
1465
|
+
if (d)
|
|
1466
|
+
R = await this.getAccounts().catch(() => []);
|
|
1467
|
+
else if (n)
|
|
1357
1468
|
try {
|
|
1358
|
-
|
|
1469
|
+
R = (I = (L = (W = (A = (await b.request({
|
|
1359
1470
|
method: "wallet_requestPermissions",
|
|
1360
1471
|
params: [{ eth_accounts: {} }]
|
|
1361
|
-
}))[0]) == null ? void 0 :
|
|
1362
|
-
} catch (
|
|
1363
|
-
const C =
|
|
1364
|
-
if (C.code ===
|
|
1365
|
-
throw new
|
|
1366
|
-
if (C.code ===
|
|
1472
|
+
}))[0]) == null ? void 0 : A.caveats) == null ? void 0 : W[0]) == null ? void 0 : L.value) == null ? void 0 : I.map((C) => oe(C)), R.length > 0 && (R = await this.getAccounts());
|
|
1473
|
+
} catch (_) {
|
|
1474
|
+
const C = _;
|
|
1475
|
+
if (C.code === F.code)
|
|
1476
|
+
throw new F(C);
|
|
1477
|
+
if (C.code === xe.code)
|
|
1367
1478
|
throw C;
|
|
1368
1479
|
}
|
|
1369
1480
|
try {
|
|
1370
|
-
!(
|
|
1481
|
+
!(R != null && R.length) && !d && (R = (await b.request({
|
|
1371
1482
|
method: "eth_requestAccounts"
|
|
1372
|
-
})).map((
|
|
1373
|
-
let
|
|
1374
|
-
if (
|
|
1375
|
-
const C = await this.switchChain({ chainId:
|
|
1376
|
-
if (
|
|
1377
|
-
throw
|
|
1378
|
-
return { id:
|
|
1483
|
+
})).map(($) => oe($))), g && (b.removeListener("connect", g), g = void 0), u || (u = this.onAccountsChanged.bind(this), b.on("accountsChanged", u)), p || (p = this.onChainChanged.bind(this), b.on("chainChanged", p)), x || (x = this.onDisconnect.bind(this), b.on("disconnect", x));
|
|
1484
|
+
let _ = await this.getChainId();
|
|
1485
|
+
if (s && _ !== s) {
|
|
1486
|
+
const C = await this.switchChain({ chainId: s }).catch(($) => {
|
|
1487
|
+
if ($.code === F.code)
|
|
1488
|
+
throw $;
|
|
1489
|
+
return { id: _ };
|
|
1379
1490
|
});
|
|
1380
|
-
|
|
1491
|
+
_ = (C == null ? void 0 : C.id) ?? _;
|
|
1381
1492
|
}
|
|
1382
|
-
return
|
|
1383
|
-
accounts:
|
|
1384
|
-
chainId:
|
|
1493
|
+
return n && await ((S = f.storage) == null ? void 0 : S.removeItem(`${this.id}.disconnected`)), t.target || await ((T = f.storage) == null ? void 0 : T.setItem("injected.connected", !0)), {
|
|
1494
|
+
accounts: v ? R.map((C) => ({ address: C, capabilities: {} })) : R,
|
|
1495
|
+
chainId: _
|
|
1385
1496
|
};
|
|
1386
|
-
} catch (
|
|
1387
|
-
const C =
|
|
1388
|
-
throw C.code ===
|
|
1497
|
+
} catch (_) {
|
|
1498
|
+
const C = _;
|
|
1499
|
+
throw C.code === F.code ? new F(C) : C.code === xe.code ? new xe(C) : C;
|
|
1389
1500
|
}
|
|
1390
1501
|
},
|
|
1391
1502
|
async disconnect() {
|
|
1392
|
-
var
|
|
1393
|
-
const
|
|
1394
|
-
if (!
|
|
1395
|
-
throw new
|
|
1396
|
-
p && (
|
|
1503
|
+
var d, v;
|
|
1504
|
+
const s = await this.getProvider();
|
|
1505
|
+
if (!s)
|
|
1506
|
+
throw new V();
|
|
1507
|
+
p && (s.removeListener("chainChanged", p), p = void 0), x && (s.removeListener("disconnect", x), x = void 0), g || (g = this.onConnect.bind(this), s.on("connect", g));
|
|
1397
1508
|
try {
|
|
1398
1509
|
await Hr(() => (
|
|
1399
1510
|
// TODO: Remove explicit type for viem@3
|
|
1400
|
-
|
|
1511
|
+
s.request({
|
|
1401
1512
|
// `'wallet_revokePermissions'` added in `viem@2.10.3`
|
|
1402
1513
|
method: "wallet_revokePermissions",
|
|
1403
1514
|
params: [{ eth_accounts: {} }]
|
|
@@ -1405,149 +1516,149 @@ function je(t = {}) {
|
|
|
1405
1516
|
), { timeout: 100 });
|
|
1406
1517
|
} catch {
|
|
1407
1518
|
}
|
|
1408
|
-
|
|
1519
|
+
n && await ((d = f.storage) == null ? void 0 : d.setItem(`${this.id}.disconnected`, !0)), t.target || await ((v = f.storage) == null ? void 0 : v.removeItem("injected.connected"));
|
|
1409
1520
|
},
|
|
1410
1521
|
async getAccounts() {
|
|
1411
|
-
const
|
|
1412
|
-
if (!
|
|
1413
|
-
throw new
|
|
1414
|
-
return (await
|
|
1522
|
+
const s = await this.getProvider();
|
|
1523
|
+
if (!s)
|
|
1524
|
+
throw new V();
|
|
1525
|
+
return (await s.request({ method: "eth_accounts" })).map((v) => oe(v));
|
|
1415
1526
|
},
|
|
1416
1527
|
async getChainId() {
|
|
1417
|
-
const
|
|
1418
|
-
if (!
|
|
1419
|
-
throw new
|
|
1420
|
-
const
|
|
1421
|
-
return Number(
|
|
1528
|
+
const s = await this.getProvider();
|
|
1529
|
+
if (!s)
|
|
1530
|
+
throw new V();
|
|
1531
|
+
const d = await s.request({ method: "eth_chainId" });
|
|
1532
|
+
return Number(d);
|
|
1422
1533
|
},
|
|
1423
1534
|
async getProvider() {
|
|
1424
1535
|
if (typeof window > "u")
|
|
1425
1536
|
return;
|
|
1426
|
-
let
|
|
1427
|
-
const
|
|
1428
|
-
return typeof
|
|
1429
|
-
}),
|
|
1537
|
+
let s;
|
|
1538
|
+
const d = c();
|
|
1539
|
+
return typeof d.provider == "function" ? s = d.provider(window) : typeof d.provider == "string" ? s = se(window, d.provider) : s = d.provider, s && !s.removeListener && ("off" in s && typeof s.off == "function" ? s.removeListener = s.off : s.removeListener = () => {
|
|
1540
|
+
}), s;
|
|
1430
1541
|
},
|
|
1431
1542
|
async isAuthorized() {
|
|
1432
|
-
var
|
|
1543
|
+
var s, d;
|
|
1433
1544
|
try {
|
|
1434
|
-
if (
|
|
1435
|
-
await ((
|
|
1545
|
+
if (n && // If shim exists in storage, connector is disconnected
|
|
1546
|
+
await ((s = f.storage) == null ? void 0 : s.getItem(`${this.id}.disconnected`)) || !t.target && !await ((d = f.storage) == null ? void 0 : d.getItem("injected.connected")))
|
|
1436
1547
|
return !1;
|
|
1437
1548
|
if (!await this.getProvider()) {
|
|
1438
|
-
if (
|
|
1439
|
-
const
|
|
1549
|
+
if (i !== void 0 && i !== !1) {
|
|
1550
|
+
const A = async () => (typeof window < "u" && window.removeEventListener("ethereum#initialized", A), !!await this.getProvider()), W = typeof i == "number" ? i : 1e3;
|
|
1440
1551
|
if (await Promise.race([
|
|
1441
1552
|
...typeof window < "u" ? [
|
|
1442
|
-
new Promise((
|
|
1553
|
+
new Promise((I) => window.addEventListener("ethereum#initialized", () => I(A()), { once: !0 }))
|
|
1443
1554
|
] : [],
|
|
1444
|
-
new Promise((
|
|
1555
|
+
new Promise((I) => setTimeout(() => I(A()), W))
|
|
1445
1556
|
]))
|
|
1446
1557
|
return !0;
|
|
1447
1558
|
}
|
|
1448
|
-
throw new
|
|
1559
|
+
throw new V();
|
|
1449
1560
|
}
|
|
1450
1561
|
return !!(await Gr(() => this.getAccounts())).length;
|
|
1451
1562
|
} catch {
|
|
1452
1563
|
return !1;
|
|
1453
1564
|
}
|
|
1454
1565
|
},
|
|
1455
|
-
async switchChain({ addEthereumChainParameter:
|
|
1456
|
-
var
|
|
1457
|
-
const
|
|
1458
|
-
if (!
|
|
1459
|
-
throw new
|
|
1460
|
-
const
|
|
1461
|
-
if (!
|
|
1462
|
-
throw new
|
|
1463
|
-
const
|
|
1464
|
-
const
|
|
1465
|
-
"chainId" in
|
|
1566
|
+
async switchChain({ addEthereumChainParameter: s, chainId: d }) {
|
|
1567
|
+
var A, W, L, I;
|
|
1568
|
+
const v = await this.getProvider();
|
|
1569
|
+
if (!v)
|
|
1570
|
+
throw new V();
|
|
1571
|
+
const b = f.chains.find((S) => S.id === d);
|
|
1572
|
+
if (!b)
|
|
1573
|
+
throw new Je(new vt());
|
|
1574
|
+
const R = new Promise((S) => {
|
|
1575
|
+
const T = (_) => {
|
|
1576
|
+
"chainId" in _ && _.chainId === d && (f.emitter.off("change", T), S());
|
|
1466
1577
|
};
|
|
1467
|
-
f.emitter.on("change",
|
|
1578
|
+
f.emitter.on("change", T);
|
|
1468
1579
|
});
|
|
1469
1580
|
try {
|
|
1470
1581
|
return await Promise.all([
|
|
1471
|
-
|
|
1582
|
+
v.request({
|
|
1472
1583
|
method: "wallet_switchEthereumChain",
|
|
1473
|
-
params: [{ chainId:
|
|
1584
|
+
params: [{ chainId: Xe(d) }]
|
|
1474
1585
|
}).then(async () => {
|
|
1475
|
-
await this.getChainId() ===
|
|
1586
|
+
await this.getChainId() === d && f.emitter.emit("change", { chainId: d });
|
|
1476
1587
|
}),
|
|
1477
|
-
|
|
1478
|
-
]),
|
|
1588
|
+
R
|
|
1589
|
+
]), b;
|
|
1479
1590
|
} catch (S) {
|
|
1480
|
-
const
|
|
1481
|
-
if (
|
|
1591
|
+
const T = S;
|
|
1592
|
+
if (T.code === 4902 || // Unwrapping for MetaMask Mobile
|
|
1482
1593
|
// https://github.com/MetaMask/metamask-mobile/issues/2944#issuecomment-976988719
|
|
1483
|
-
((W = (
|
|
1594
|
+
((W = (A = T == null ? void 0 : T.data) == null ? void 0 : A.originalError) == null ? void 0 : W.code) === 4902)
|
|
1484
1595
|
try {
|
|
1485
|
-
const { default:
|
|
1486
|
-
let
|
|
1487
|
-
|
|
1488
|
-
|
|
1596
|
+
const { default: _, ...C } = b.blockExplorers ?? {};
|
|
1597
|
+
let $;
|
|
1598
|
+
s != null && s.blockExplorerUrls ? $ = s.blockExplorerUrls : _ && ($ = [
|
|
1599
|
+
_.url,
|
|
1489
1600
|
...Object.values(C).map((H) => H.url)
|
|
1490
1601
|
]);
|
|
1491
1602
|
let G;
|
|
1492
|
-
(
|
|
1493
|
-
const
|
|
1494
|
-
blockExplorerUrls:
|
|
1495
|
-
chainId:
|
|
1496
|
-
chainName: (
|
|
1497
|
-
iconUrls:
|
|
1498
|
-
nativeCurrency: (
|
|
1603
|
+
(L = s == null ? void 0 : s.rpcUrls) != null && L.length ? G = s.rpcUrls : G = [((I = b.rpcUrls.default) == null ? void 0 : I.http[0]) ?? ""];
|
|
1604
|
+
const de = {
|
|
1605
|
+
blockExplorerUrls: $,
|
|
1606
|
+
chainId: Xe(d),
|
|
1607
|
+
chainName: (s == null ? void 0 : s.chainName) ?? b.name,
|
|
1608
|
+
iconUrls: s == null ? void 0 : s.iconUrls,
|
|
1609
|
+
nativeCurrency: (s == null ? void 0 : s.nativeCurrency) ?? b.nativeCurrency,
|
|
1499
1610
|
rpcUrls: G
|
|
1500
1611
|
};
|
|
1501
1612
|
return await Promise.all([
|
|
1502
|
-
|
|
1613
|
+
v.request({
|
|
1503
1614
|
method: "wallet_addEthereumChain",
|
|
1504
|
-
params: [
|
|
1615
|
+
params: [de]
|
|
1505
1616
|
}).then(async () => {
|
|
1506
|
-
if (await this.getChainId() ===
|
|
1507
|
-
f.emitter.emit("change", { chainId:
|
|
1617
|
+
if (await this.getChainId() === d)
|
|
1618
|
+
f.emitter.emit("change", { chainId: d });
|
|
1508
1619
|
else
|
|
1509
|
-
throw new
|
|
1620
|
+
throw new F(new Error("User rejected switch after adding network."));
|
|
1510
1621
|
}),
|
|
1511
|
-
|
|
1512
|
-
]),
|
|
1513
|
-
} catch (
|
|
1514
|
-
throw new
|
|
1622
|
+
R
|
|
1623
|
+
]), b;
|
|
1624
|
+
} catch (_) {
|
|
1625
|
+
throw new F(_);
|
|
1515
1626
|
}
|
|
1516
|
-
throw
|
|
1627
|
+
throw T.code === F.code ? new F(T) : new Je(T);
|
|
1517
1628
|
}
|
|
1518
1629
|
},
|
|
1519
|
-
async onAccountsChanged(
|
|
1520
|
-
var
|
|
1521
|
-
if (
|
|
1630
|
+
async onAccountsChanged(s) {
|
|
1631
|
+
var d;
|
|
1632
|
+
if (s.length === 0)
|
|
1522
1633
|
this.onDisconnect();
|
|
1523
1634
|
else if (f.emitter.listenerCount("connect")) {
|
|
1524
|
-
const
|
|
1525
|
-
this.onConnect({ chainId:
|
|
1635
|
+
const v = (await this.getChainId()).toString();
|
|
1636
|
+
this.onConnect({ chainId: v }), n && await ((d = f.storage) == null ? void 0 : d.removeItem(`${this.id}.disconnected`));
|
|
1526
1637
|
} else
|
|
1527
1638
|
f.emitter.emit("change", {
|
|
1528
|
-
accounts:
|
|
1639
|
+
accounts: s.map((v) => oe(v))
|
|
1529
1640
|
});
|
|
1530
1641
|
},
|
|
1531
|
-
onChainChanged(
|
|
1532
|
-
const
|
|
1533
|
-
f.emitter.emit("change", { chainId:
|
|
1642
|
+
onChainChanged(s) {
|
|
1643
|
+
const d = Number(s);
|
|
1644
|
+
f.emitter.emit("change", { chainId: d });
|
|
1534
1645
|
},
|
|
1535
|
-
async onConnect(
|
|
1536
|
-
const
|
|
1537
|
-
if (
|
|
1646
|
+
async onConnect(s) {
|
|
1647
|
+
const d = await this.getAccounts();
|
|
1648
|
+
if (d.length === 0)
|
|
1538
1649
|
return;
|
|
1539
|
-
const
|
|
1540
|
-
f.emitter.emit("connect", { accounts:
|
|
1541
|
-
const
|
|
1542
|
-
|
|
1650
|
+
const v = Number(s.chainId);
|
|
1651
|
+
f.emitter.emit("connect", { accounts: d, chainId: v });
|
|
1652
|
+
const b = await this.getProvider();
|
|
1653
|
+
b && (g && (b.removeListener("connect", g), g = void 0), u || (u = this.onAccountsChanged.bind(this), b.on("accountsChanged", u)), p || (p = this.onChainChanged.bind(this), b.on("chainChanged", p)), x || (x = this.onDisconnect.bind(this), b.on("disconnect", x)));
|
|
1543
1654
|
},
|
|
1544
|
-
async onDisconnect(
|
|
1545
|
-
const
|
|
1546
|
-
|
|
1655
|
+
async onDisconnect(s) {
|
|
1656
|
+
const d = await this.getProvider();
|
|
1657
|
+
s && s.code === 1013 && d && (await this.getAccounts()).length || (f.emitter.emit("disconnect"), d && (p && (d.removeListener("chainChanged", p), p = void 0), x && (d.removeListener("disconnect", x), x = void 0), g || (g = this.onConnect.bind(this), d.on("connect", g))));
|
|
1547
1658
|
}
|
|
1548
1659
|
});
|
|
1549
1660
|
}
|
|
1550
|
-
const
|
|
1661
|
+
const yt = {
|
|
1551
1662
|
coinbaseWallet: {
|
|
1552
1663
|
id: "coinbaseWallet",
|
|
1553
1664
|
name: "Coinbase Wallet",
|
|
@@ -1559,10 +1670,10 @@ const ht = {
|
|
|
1559
1670
|
id: "metaMask",
|
|
1560
1671
|
name: "MetaMask",
|
|
1561
1672
|
provider(t) {
|
|
1562
|
-
return se(t, (
|
|
1563
|
-
if (!
|
|
1673
|
+
return se(t, (n) => {
|
|
1674
|
+
if (!n.isMetaMask || n.isBraveWallet && !n._events && !n._state)
|
|
1564
1675
|
return !1;
|
|
1565
|
-
const
|
|
1676
|
+
const i = [
|
|
1566
1677
|
"isApexWallet",
|
|
1567
1678
|
"isAvalanche",
|
|
1568
1679
|
"isBitKeep",
|
|
@@ -1582,8 +1693,8 @@ const ht = {
|
|
|
1582
1693
|
"isUniswapWallet",
|
|
1583
1694
|
"isZerion"
|
|
1584
1695
|
];
|
|
1585
|
-
for (const
|
|
1586
|
-
if (
|
|
1696
|
+
for (const c of i)
|
|
1697
|
+
if (n[c])
|
|
1587
1698
|
return !1;
|
|
1588
1699
|
return !0;
|
|
1589
1700
|
});
|
|
@@ -1593,36 +1704,36 @@ const ht = {
|
|
|
1593
1704
|
id: "phantom",
|
|
1594
1705
|
name: "Phantom",
|
|
1595
1706
|
provider(t) {
|
|
1596
|
-
var
|
|
1597
|
-
return (
|
|
1707
|
+
var n, i;
|
|
1708
|
+
return (n = t == null ? void 0 : t.phantom) != null && n.ethereum ? (i = t.phantom) == null ? void 0 : i.ethereum : se(t, "isPhantom");
|
|
1598
1709
|
}
|
|
1599
1710
|
}
|
|
1600
1711
|
};
|
|
1601
|
-
function se(t,
|
|
1602
|
-
function
|
|
1603
|
-
return typeof
|
|
1712
|
+
function se(t, n) {
|
|
1713
|
+
function i(u) {
|
|
1714
|
+
return typeof n == "function" ? n(u) : typeof n == "string" ? u[n] : !0;
|
|
1604
1715
|
}
|
|
1605
|
-
const
|
|
1606
|
-
if (
|
|
1607
|
-
return
|
|
1608
|
-
if (
|
|
1609
|
-
return
|
|
1716
|
+
const c = t.ethereum;
|
|
1717
|
+
if (c != null && c.providers)
|
|
1718
|
+
return c.providers.find((u) => i(u));
|
|
1719
|
+
if (c && i(c))
|
|
1720
|
+
return c;
|
|
1610
1721
|
}
|
|
1611
|
-
const
|
|
1612
|
-
chains: [
|
|
1613
|
-
connectors: [
|
|
1722
|
+
const mt = new qr(), bt = Br({
|
|
1723
|
+
chains: [Se],
|
|
1724
|
+
connectors: [Re()],
|
|
1614
1725
|
transports: {
|
|
1615
|
-
[
|
|
1726
|
+
[Se.id]: Nr()
|
|
1616
1727
|
}
|
|
1617
1728
|
});
|
|
1618
|
-
function
|
|
1619
|
-
return /* @__PURE__ */ r.jsx(Yr, { config:
|
|
1729
|
+
function Rt({ children: t }) {
|
|
1730
|
+
return /* @__PURE__ */ r.jsx(Yr, { config: bt, children: /* @__PURE__ */ r.jsx(Vr, { client: mt, children: t }) });
|
|
1620
1731
|
}
|
|
1621
1732
|
export {
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1733
|
+
Ct as SwarmConnectButton,
|
|
1734
|
+
ht as SwarmConnectModal,
|
|
1735
|
+
Rt as SwarmConnectProvider,
|
|
1625
1736
|
Xr as useBeeNode,
|
|
1626
1737
|
Qr as usePostageStamps,
|
|
1627
|
-
|
|
1738
|
+
et as useSwarmConnect
|
|
1628
1739
|
};
|