@ffaerber/swarm-connect 0.1.0 → 0.2.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/SwarmConnectModal.d.ts +2 -1
- package/dist/components/tabs/SwarmTab.d.ts +2 -1
- package/dist/swarm-connect.js +556 -482
- 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
|
|
2
|
-
import { useAccount as
|
|
1
|
+
import nr, { useState as L, useCallback as or, useEffect as xe } from "react";
|
|
2
|
+
import { useAccount as ir, useChainId as sr, 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 Ke, numberToHex as Je, UserRejectedRequestError as F, withRetry as Gr, withTimeout as Hr, ResourceUnavailableRpcError as be } 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 Xe;
|
|
16
16
|
function Kr() {
|
|
17
|
-
if (
|
|
18
|
-
|
|
19
|
-
var t =
|
|
20
|
-
function g(
|
|
21
|
-
var
|
|
22
|
-
|
|
23
|
-
for (
|
|
24
|
-
if (
|
|
25
|
-
return { $$typeof: o, type:
|
|
17
|
+
if (Xe) return X;
|
|
18
|
+
Xe = 1;
|
|
19
|
+
var t = nr, o = Symbol.for("react.element"), i = Symbol.for("react.fragment"), l = Object.prototype.hasOwnProperty, f = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, p = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
20
|
+
function g(y, u, s) {
|
|
21
|
+
var d, v = {}, x = null, R = null;
|
|
22
|
+
s !== void 0 && (x = "" + s), u.key !== void 0 && (x = "" + u.key), u.ref !== void 0 && (R = u.ref);
|
|
23
|
+
for (d in u) l.call(u, d) && !p.hasOwnProperty(d) && (v[d] = u[d]);
|
|
24
|
+
if (y && y.defaultProps) for (d in u = y.defaultProps, u) v[d] === void 0 && (v[d] = u[d]);
|
|
25
|
+
return { $$typeof: o, type: y, key: x, ref: R, props: v, _owner: f.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,11 +36,11 @@ 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 Qe;
|
|
40
40
|
function Jr() {
|
|
41
|
-
return
|
|
42
|
-
var t =
|
|
43
|
-
function
|
|
41
|
+
return Qe || (Qe = 1, process.env.NODE_ENV !== "production" && function() {
|
|
42
|
+
var t = nr, o = Symbol.for("react.element"), i = Symbol.for("react.portal"), l = Symbol.for("react.fragment"), f = Symbol.for("react.strict_mode"), p = Symbol.for("react.profiler"), g = Symbol.for("react.provider"), y = Symbol.for("react.context"), u = Symbol.for("react.forward_ref"), s = Symbol.for("react.suspense"), d = Symbol.for("react.suspense_list"), v = Symbol.for("react.memo"), x = Symbol.for("react.lazy"), R = Symbol.for("react.offscreen"), D = Symbol.iterator, W = "@@iterator";
|
|
43
|
+
function z(e) {
|
|
44
44
|
if (e === null || typeof e != "object")
|
|
45
45
|
return null;
|
|
46
46
|
var n = D && e[D] || e[W];
|
|
@@ -58,16 +58,16 @@ function Jr() {
|
|
|
58
58
|
{
|
|
59
59
|
var h = T.ReactDebugCurrentFrame, w = h.getStackAddendum();
|
|
60
60
|
w !== "" && (n += "%s", c = c.concat([w]));
|
|
61
|
-
var j = c.map(function(
|
|
62
|
-
return String(
|
|
61
|
+
var j = c.map(function(b) {
|
|
62
|
+
return String(b);
|
|
63
63
|
});
|
|
64
64
|
j.unshift("Warning: " + n), Function.prototype.apply.call(console[e], console, j);
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
|
-
var
|
|
67
|
+
var _ = !1, C = !1, $ = !1, G = !1, ue = !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 === l || e === p || ue || e === f || e === s || e === d || G || e === R || _ || C || $ || typeof e == "object" && e !== null && (e.$$typeof === x || e.$$typeof === v || e.$$typeof === g || e.$$typeof === y || e.$$typeof === u || // 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.
|
|
@@ -80,10 +80,10 @@ function Jr() {
|
|
|
80
80
|
var w = n.displayName || n.name || "";
|
|
81
81
|
return w !== "" ? c + "(" + w + ")" : c;
|
|
82
82
|
}
|
|
83
|
-
function
|
|
83
|
+
function Re(e) {
|
|
84
84
|
return e.displayName || "Context";
|
|
85
85
|
}
|
|
86
|
-
function
|
|
86
|
+
function U(e) {
|
|
87
87
|
if (e == null)
|
|
88
88
|
return null;
|
|
89
89
|
if (typeof e.tag == "number" && S("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
|
@@ -91,36 +91,36 @@ function Jr() {
|
|
|
91
91
|
if (typeof e == "string")
|
|
92
92
|
return e;
|
|
93
93
|
switch (e) {
|
|
94
|
-
case
|
|
94
|
+
case l:
|
|
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 f:
|
|
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
|
|
109
|
+
case y:
|
|
110
110
|
var n = e;
|
|
111
|
-
return
|
|
111
|
+
return Re(n) + ".Consumer";
|
|
112
112
|
case g:
|
|
113
113
|
var c = e;
|
|
114
|
-
return
|
|
115
|
-
case
|
|
114
|
+
return Re(c._context) + ".Provider";
|
|
115
|
+
case u:
|
|
116
116
|
return dr(e, e.render, "ForwardRef");
|
|
117
|
-
case
|
|
117
|
+
case v:
|
|
118
118
|
var h = e.displayName || null;
|
|
119
|
-
return h !== null ? h :
|
|
119
|
+
return h !== null ? h : U(e.type) || "Memo";
|
|
120
120
|
case x: {
|
|
121
|
-
var w = e, j = w._payload,
|
|
121
|
+
var w = e, j = w._payload, b = w._init;
|
|
122
122
|
try {
|
|
123
|
-
return
|
|
123
|
+
return U(b(j));
|
|
124
124
|
} catch {
|
|
125
125
|
return null;
|
|
126
126
|
}
|
|
@@ -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, ke, _e, Ee, Te, Ie, Pe, Oe;
|
|
132
|
+
function De() {
|
|
133
133
|
}
|
|
134
|
-
|
|
134
|
+
De.__reactDisabledLog = !0;
|
|
135
135
|
function fr() {
|
|
136
136
|
{
|
|
137
137
|
if (K === 0) {
|
|
138
|
-
|
|
138
|
+
ke = console.log, _e = console.info, Ee = console.warn, Te = console.error, Ie = console.group, Pe = console.groupCollapsed, Oe = 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,52 +165,52 @@ function Jr() {
|
|
|
165
165
|
};
|
|
166
166
|
Object.defineProperties(console, {
|
|
167
167
|
log: M({}, e, {
|
|
168
|
-
value:
|
|
168
|
+
value: ke
|
|
169
169
|
}),
|
|
170
170
|
info: M({}, e, {
|
|
171
|
-
value:
|
|
171
|
+
value: _e
|
|
172
172
|
}),
|
|
173
173
|
warn: M({}, e, {
|
|
174
|
-
value:
|
|
174
|
+
value: Ee
|
|
175
175
|
}),
|
|
176
176
|
error: M({}, e, {
|
|
177
|
-
value:
|
|
177
|
+
value: Te
|
|
178
178
|
}),
|
|
179
179
|
group: M({}, e, {
|
|
180
|
-
value:
|
|
180
|
+
value: Ie
|
|
181
181
|
}),
|
|
182
182
|
groupCollapsed: M({}, e, {
|
|
183
|
-
value:
|
|
183
|
+
value: Pe
|
|
184
184
|
}),
|
|
185
185
|
groupEnd: M({}, e, {
|
|
186
|
-
value:
|
|
186
|
+
value: Oe
|
|
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
|
|
193
|
+
var de = T.ReactCurrentDispatcher, fe;
|
|
194
194
|
function ee(e, n, c) {
|
|
195
195
|
{
|
|
196
|
-
if (
|
|
196
|
+
if (fe === 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
|
+
fe = h && h[1] || "";
|
|
202
202
|
}
|
|
203
203
|
return `
|
|
204
|
-
` +
|
|
204
|
+
` + fe + e;
|
|
205
205
|
}
|
|
206
206
|
}
|
|
207
|
-
var
|
|
207
|
+
var he = !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 Ae(e, n) {
|
|
213
|
+
if (!e || he)
|
|
214
214
|
return "";
|
|
215
215
|
{
|
|
216
216
|
var c = re.get(e);
|
|
@@ -218,34 +218,34 @@ function Jr() {
|
|
|
218
218
|
return c;
|
|
219
219
|
}
|
|
220
220
|
var h;
|
|
221
|
-
|
|
221
|
+
he = !0;
|
|
222
222
|
var w = Error.prepareStackTrace;
|
|
223
223
|
Error.prepareStackTrace = void 0;
|
|
224
224
|
var j;
|
|
225
|
-
j =
|
|
225
|
+
j = de.current, de.current = null, fr();
|
|
226
226
|
try {
|
|
227
227
|
if (n) {
|
|
228
|
-
var
|
|
228
|
+
var b = function() {
|
|
229
229
|
throw Error();
|
|
230
230
|
};
|
|
231
|
-
if (Object.defineProperty(
|
|
231
|
+
if (Object.defineProperty(b.prototype, "props", {
|
|
232
232
|
set: function() {
|
|
233
233
|
throw Error();
|
|
234
234
|
}
|
|
235
235
|
}), typeof Reflect == "object" && Reflect.construct) {
|
|
236
236
|
try {
|
|
237
|
-
Reflect.construct(
|
|
237
|
+
Reflect.construct(b, []);
|
|
238
238
|
} catch (O) {
|
|
239
239
|
h = O;
|
|
240
240
|
}
|
|
241
|
-
Reflect.construct(e, [],
|
|
241
|
+
Reflect.construct(e, [], b);
|
|
242
242
|
} else {
|
|
243
243
|
try {
|
|
244
|
-
|
|
244
|
+
b.call();
|
|
245
245
|
} catch (O) {
|
|
246
246
|
h = O;
|
|
247
247
|
}
|
|
248
|
-
e.call(
|
|
248
|
+
e.call(b.prototype);
|
|
249
249
|
}
|
|
250
250
|
} else {
|
|
251
251
|
try {
|
|
@@ -257,31 +257,31 @@ function Jr() {
|
|
|
257
257
|
}
|
|
258
258
|
} catch (O) {
|
|
259
259
|
if (O && h && typeof O.stack == "string") {
|
|
260
|
-
for (var
|
|
260
|
+
for (var m = O.stack.split(`
|
|
261
261
|
`), P = h.stack.split(`
|
|
262
|
-
`),
|
|
263
|
-
|
|
264
|
-
for (;
|
|
265
|
-
if (
|
|
266
|
-
if (
|
|
262
|
+
`), k = m.length - 1, E = P.length - 1; k >= 1 && E >= 0 && m[k] !== P[E]; )
|
|
263
|
+
E--;
|
|
264
|
+
for (; k >= 1 && E >= 0; k--, E--)
|
|
265
|
+
if (m[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 || m[k] !== P[E]) {
|
|
269
|
+
var A = `
|
|
270
|
+
` + m[k].replace(" at new ", " at ");
|
|
271
|
+
return e.displayName && A.includes("<anonymous>") && (A = A.replace("<anonymous>", e.displayName)), typeof e == "function" && re.set(e, A), A;
|
|
272
272
|
}
|
|
273
|
-
while (
|
|
273
|
+
while (k >= 1 && E >= 0);
|
|
274
274
|
break;
|
|
275
275
|
}
|
|
276
276
|
}
|
|
277
277
|
} finally {
|
|
278
|
-
|
|
278
|
+
he = !1, de.current = j, hr(), Error.prepareStackTrace = w;
|
|
279
279
|
}
|
|
280
|
-
var Y = e ? e.displayName || e.name : "",
|
|
281
|
-
return typeof e == "function" && re.set(e,
|
|
280
|
+
var Y = e ? e.displayName || e.name : "", B = Y ? ee(Y) : "";
|
|
281
|
+
return typeof e == "function" && re.set(e, B), B;
|
|
282
282
|
}
|
|
283
283
|
function gr(e, n, c) {
|
|
284
|
-
return
|
|
284
|
+
return Ae(e, !1);
|
|
285
285
|
}
|
|
286
286
|
function vr(e) {
|
|
287
287
|
var n = e.prototype;
|
|
@@ -291,20 +291,20 @@ function Jr() {
|
|
|
291
291
|
if (e == null)
|
|
292
292
|
return "";
|
|
293
293
|
if (typeof e == "function")
|
|
294
|
-
return
|
|
294
|
+
return Ae(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
|
-
case
|
|
305
|
+
case u:
|
|
306
306
|
return gr(e.render);
|
|
307
|
-
case
|
|
307
|
+
case v:
|
|
308
308
|
return te(e.type, n, c);
|
|
309
309
|
case x: {
|
|
310
310
|
var h = e, w = h._payload, j = h._init;
|
|
@@ -316,35 +316,35 @@ function Jr() {
|
|
|
316
316
|
}
|
|
317
317
|
return "";
|
|
318
318
|
}
|
|
319
|
-
var J = Object.prototype.hasOwnProperty,
|
|
319
|
+
var J = Object.prototype.hasOwnProperty, $e = {}, We = T.ReactDebugCurrentFrame;
|
|
320
320
|
function ne(e) {
|
|
321
321
|
if (e) {
|
|
322
322
|
var n = e._owner, c = te(e.type, e._source, n ? n.type : null);
|
|
323
|
-
|
|
323
|
+
We.setExtraStackFrame(c);
|
|
324
324
|
} else
|
|
325
|
-
|
|
325
|
+
We.setExtraStackFrame(null);
|
|
326
326
|
}
|
|
327
327
|
function mr(e, n, c, h, w) {
|
|
328
328
|
{
|
|
329
329
|
var j = Function.call.bind(J);
|
|
330
|
-
for (var
|
|
331
|
-
if (j(e,
|
|
332
|
-
var
|
|
330
|
+
for (var b in e)
|
|
331
|
+
if (j(e, b)) {
|
|
332
|
+
var m = void 0;
|
|
333
333
|
try {
|
|
334
|
-
if (typeof e[
|
|
335
|
-
var P = Error((h || "React class") + ": " + c + " type `" +
|
|
334
|
+
if (typeof e[b] != "function") {
|
|
335
|
+
var P = Error((h || "React class") + ": " + c + " type `" + b + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[b] + "`.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
|
+
m = e[b](n, b, h, c, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
339
|
+
} catch (k) {
|
|
340
|
+
m = k;
|
|
341
341
|
}
|
|
342
|
-
|
|
342
|
+
m && !(m 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", c, b, typeof m), ne(null)), m instanceof Error && !(m.message in $e) && ($e[m.message] = !0, ne(w), S("Failed %s type: %s", c, m.message), ne(null));
|
|
343
343
|
}
|
|
344
344
|
}
|
|
345
345
|
}
|
|
346
346
|
var yr = Array.isArray;
|
|
347
|
-
function
|
|
347
|
+
function pe(e) {
|
|
348
348
|
return yr(e);
|
|
349
349
|
}
|
|
350
350
|
function br(e) {
|
|
@@ -355,24 +355,24 @@ function Jr() {
|
|
|
355
355
|
}
|
|
356
356
|
function xr(e) {
|
|
357
357
|
try {
|
|
358
|
-
return
|
|
358
|
+
return Fe(e), !1;
|
|
359
359
|
} catch {
|
|
360
360
|
return !0;
|
|
361
361
|
}
|
|
362
362
|
}
|
|
363
|
-
function
|
|
363
|
+
function Fe(e) {
|
|
364
364
|
return "" + e;
|
|
365
365
|
}
|
|
366
|
-
function
|
|
366
|
+
function Le(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)), Fe(e);
|
|
369
369
|
}
|
|
370
|
-
var
|
|
370
|
+
var ze = T.ReactCurrentOwner, wr = {
|
|
371
371
|
key: !0,
|
|
372
372
|
ref: !0,
|
|
373
373
|
__self: !0,
|
|
374
374
|
__source: !0
|
|
375
|
-
},
|
|
375
|
+
}, Ue, Me;
|
|
376
376
|
function jr(e) {
|
|
377
377
|
if (J.call(e, "ref")) {
|
|
378
378
|
var n = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
@@ -390,12 +390,12 @@ function Jr() {
|
|
|
390
390
|
return e.key !== void 0;
|
|
391
391
|
}
|
|
392
392
|
function Cr(e, n) {
|
|
393
|
-
typeof e.ref == "string" &&
|
|
393
|
+
typeof e.ref == "string" && ze.current;
|
|
394
394
|
}
|
|
395
395
|
function Rr(e, n) {
|
|
396
396
|
{
|
|
397
397
|
var c = function() {
|
|
398
|
-
|
|
398
|
+
Ue || (Ue = !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)", n));
|
|
399
399
|
};
|
|
400
400
|
c.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
401
401
|
get: c,
|
|
@@ -406,7 +406,7 @@ function Jr() {
|
|
|
406
406
|
function kr(e, n) {
|
|
407
407
|
{
|
|
408
408
|
var c = function() {
|
|
409
|
-
|
|
409
|
+
Me || (Me = !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)", n));
|
|
410
410
|
};
|
|
411
411
|
c.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
412
412
|
get: c,
|
|
@@ -414,70 +414,70 @@ function Jr() {
|
|
|
414
414
|
});
|
|
415
415
|
}
|
|
416
416
|
}
|
|
417
|
-
var _r = function(e, n, c, h, w, j,
|
|
418
|
-
var
|
|
417
|
+
var _r = function(e, n, c, h, w, j, b) {
|
|
418
|
+
var m = {
|
|
419
419
|
// This tag allows us to uniquely identify this as a React Element
|
|
420
420
|
$$typeof: o,
|
|
421
421
|
// Built-in properties that belong on the element
|
|
422
422
|
type: e,
|
|
423
423
|
key: n,
|
|
424
424
|
ref: c,
|
|
425
|
-
props:
|
|
425
|
+
props: b,
|
|
426
426
|
// Record the component responsible for creating this element.
|
|
427
427
|
_owner: j
|
|
428
428
|
};
|
|
429
|
-
return
|
|
429
|
+
return m._store = {}, Object.defineProperty(m._store, "validated", {
|
|
430
430
|
configurable: !1,
|
|
431
431
|
enumerable: !1,
|
|
432
432
|
writable: !0,
|
|
433
433
|
value: !1
|
|
434
|
-
}), Object.defineProperty(
|
|
434
|
+
}), Object.defineProperty(m, "_self", {
|
|
435
435
|
configurable: !1,
|
|
436
436
|
enumerable: !1,
|
|
437
437
|
writable: !1,
|
|
438
438
|
value: h
|
|
439
|
-
}), Object.defineProperty(
|
|
439
|
+
}), Object.defineProperty(m, "_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(m.props), Object.freeze(m)), m;
|
|
445
445
|
};
|
|
446
446
|
function Er(e, n, c, h, w) {
|
|
447
447
|
{
|
|
448
|
-
var j,
|
|
449
|
-
c !== void 0 && (
|
|
448
|
+
var j, b = {}, m = null, P = null;
|
|
449
|
+
c !== void 0 && (Le(c), m = "" + c), Sr(n) && (Le(n.key), m = "" + n.key), jr(n) && (P = n.ref, Cr(n, w));
|
|
450
450
|
for (j in n)
|
|
451
|
-
J.call(n, j) && !wr.hasOwnProperty(j) && (
|
|
451
|
+
J.call(n, j) && !wr.hasOwnProperty(j) && (b[j] = n[j]);
|
|
452
452
|
if (e && e.defaultProps) {
|
|
453
|
-
var
|
|
454
|
-
for (j in
|
|
455
|
-
|
|
453
|
+
var k = e.defaultProps;
|
|
454
|
+
for (j in k)
|
|
455
|
+
b[j] === void 0 && (b[j] = k[j]);
|
|
456
456
|
}
|
|
457
|
-
if (
|
|
458
|
-
var
|
|
459
|
-
|
|
457
|
+
if (m || P) {
|
|
458
|
+
var E = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
459
|
+
m && Rr(b, E), P && kr(b, E);
|
|
460
460
|
}
|
|
461
|
-
return _r(e,
|
|
461
|
+
return _r(e, m, P, w, h, ze.current, b);
|
|
462
462
|
}
|
|
463
463
|
}
|
|
464
|
-
var
|
|
464
|
+
var ge = T.ReactCurrentOwner, Be = T.ReactDebugCurrentFrame;
|
|
465
465
|
function N(e) {
|
|
466
466
|
if (e) {
|
|
467
467
|
var n = e._owner, c = te(e.type, e._source, n ? n.type : null);
|
|
468
|
-
|
|
468
|
+
Be.setExtraStackFrame(c);
|
|
469
469
|
} else
|
|
470
|
-
|
|
470
|
+
Be.setExtraStackFrame(null);
|
|
471
471
|
}
|
|
472
|
-
var
|
|
473
|
-
|
|
474
|
-
function
|
|
472
|
+
var ve;
|
|
473
|
+
ve = !1;
|
|
474
|
+
function me(e) {
|
|
475
475
|
return typeof e == "object" && e !== null && e.$$typeof === o;
|
|
476
476
|
}
|
|
477
|
-
function
|
|
477
|
+
function Ne() {
|
|
478
478
|
{
|
|
479
|
-
if (
|
|
480
|
-
var e =
|
|
479
|
+
if (ge.current) {
|
|
480
|
+
var e = U(ge.current.type);
|
|
481
481
|
if (e)
|
|
482
482
|
return `
|
|
483
483
|
|
|
@@ -489,10 +489,10 @@ Check the render method of \`` + e + "`.";
|
|
|
489
489
|
function Tr(e) {
|
|
490
490
|
return "";
|
|
491
491
|
}
|
|
492
|
-
var
|
|
492
|
+
var Ye = {};
|
|
493
493
|
function Ir(e) {
|
|
494
494
|
{
|
|
495
|
-
var n =
|
|
495
|
+
var n = Ne();
|
|
496
496
|
if (!n) {
|
|
497
497
|
var c = typeof e == "string" ? e : e.displayName || e.name;
|
|
498
498
|
c && (n = `
|
|
@@ -502,35 +502,35 @@ Check the top-level render call using <` + c + ">.");
|
|
|
502
502
|
return n;
|
|
503
503
|
}
|
|
504
504
|
}
|
|
505
|
-
function
|
|
505
|
+
function qe(e, n) {
|
|
506
506
|
{
|
|
507
507
|
if (!e._store || e._store.validated || e.key != null)
|
|
508
508
|
return;
|
|
509
509
|
e._store.validated = !0;
|
|
510
510
|
var c = Ir(n);
|
|
511
|
-
if (
|
|
511
|
+
if (Ye[c])
|
|
512
512
|
return;
|
|
513
|
-
|
|
513
|
+
Ye[c] = !0;
|
|
514
514
|
var h = "";
|
|
515
|
-
e && e._owner && e._owner !==
|
|
515
|
+
e && e._owner && e._owner !== ge.current && (h = " It was passed a child from " + U(e._owner.type) + "."), N(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.', c, h), N(null);
|
|
516
516
|
}
|
|
517
517
|
}
|
|
518
|
-
function
|
|
518
|
+
function Ve(e, n) {
|
|
519
519
|
{
|
|
520
520
|
if (typeof e != "object")
|
|
521
521
|
return;
|
|
522
|
-
if (
|
|
522
|
+
if (pe(e))
|
|
523
523
|
for (var c = 0; c < e.length; c++) {
|
|
524
524
|
var h = e[c];
|
|
525
|
-
|
|
525
|
+
me(h) && qe(h, n);
|
|
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 = z(e);
|
|
531
531
|
if (typeof w == "function" && w !== e.entries)
|
|
532
|
-
for (var j = w.call(e),
|
|
533
|
-
|
|
532
|
+
for (var j = w.call(e), b; !(b = j.next()).done; )
|
|
533
|
+
me(b.value) && qe(b.value, n);
|
|
534
534
|
}
|
|
535
535
|
}
|
|
536
536
|
}
|
|
@@ -542,18 +542,18 @@ Check the top-level render call using <` + c + ">.");
|
|
|
542
542
|
var c;
|
|
543
543
|
if (typeof n == "function")
|
|
544
544
|
c = n.propTypes;
|
|
545
|
-
else if (typeof n == "object" && (n.$$typeof ===
|
|
545
|
+
else if (typeof n == "object" && (n.$$typeof === u || // Note: Memo only checks outer props here.
|
|
546
546
|
// Inner props are checked in the reconciler.
|
|
547
|
-
n.$$typeof ===
|
|
547
|
+
n.$$typeof === v))
|
|
548
548
|
c = n.propTypes;
|
|
549
549
|
else
|
|
550
550
|
return;
|
|
551
551
|
if (c) {
|
|
552
|
-
var h =
|
|
552
|
+
var h = U(n);
|
|
553
553
|
mr(c, e.props, "prop", h, e);
|
|
554
|
-
} else if (n.PropTypes !== void 0 && !
|
|
555
|
-
|
|
556
|
-
var w =
|
|
554
|
+
} else if (n.PropTypes !== void 0 && !ve) {
|
|
555
|
+
ve = !0;
|
|
556
|
+
var w = U(n);
|
|
557
557
|
S("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", w || "Unknown");
|
|
558
558
|
}
|
|
559
559
|
typeof n.getDefaultProps == "function" && !n.getDefaultProps.isReactClassApproved && S("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
@@ -571,64 +571,64 @@ Check the top-level render call using <` + c + ">.");
|
|
|
571
571
|
e.ref !== null && (N(e), S("Invalid attribute `ref` supplied to `React.Fragment`."), N(null));
|
|
572
572
|
}
|
|
573
573
|
}
|
|
574
|
-
var
|
|
575
|
-
function
|
|
574
|
+
var Ge = {};
|
|
575
|
+
function He(e, n, c, h, w, j) {
|
|
576
576
|
{
|
|
577
|
-
var
|
|
578
|
-
if (!
|
|
579
|
-
var
|
|
580
|
-
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (
|
|
577
|
+
var b = ur(e);
|
|
578
|
+
if (!b) {
|
|
579
|
+
var m = "";
|
|
580
|
+
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (m += " 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
581
|
var P = Tr();
|
|
582
|
-
P ?
|
|
583
|
-
var
|
|
584
|
-
e === null ?
|
|
582
|
+
P ? m += P : m += Ne();
|
|
583
|
+
var k;
|
|
584
|
+
e === null ? k = "null" : pe(e) ? k = "array" : e !== void 0 && e.$$typeof === o ? (k = "<" + (U(e.type) || "Unknown") + " />", m = " 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, m);
|
|
585
585
|
}
|
|
586
|
-
var
|
|
587
|
-
if (
|
|
588
|
-
return
|
|
589
|
-
if (
|
|
590
|
-
var
|
|
591
|
-
if (
|
|
586
|
+
var E = Er(e, n, c, w, j);
|
|
587
|
+
if (E == null)
|
|
588
|
+
return E;
|
|
589
|
+
if (b) {
|
|
590
|
+
var A = n.children;
|
|
591
|
+
if (A !== void 0)
|
|
592
592
|
if (h)
|
|
593
|
-
if (
|
|
594
|
-
for (var Y = 0; Y <
|
|
595
|
-
|
|
596
|
-
Object.freeze && Object.freeze(
|
|
593
|
+
if (pe(A)) {
|
|
594
|
+
for (var Y = 0; Y < A.length; Y++)
|
|
595
|
+
Ve(A[Y], e);
|
|
596
|
+
Object.freeze && Object.freeze(A);
|
|
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
|
+
Ve(A, e);
|
|
601
601
|
}
|
|
602
602
|
if (J.call(n, "key")) {
|
|
603
|
-
var
|
|
604
|
-
return
|
|
605
|
-
}),
|
|
606
|
-
if (!
|
|
607
|
-
var
|
|
603
|
+
var B = U(e), O = Object.keys(n).filter(function(Lr) {
|
|
604
|
+
return Lr !== "key";
|
|
605
|
+
}), ye = O.length > 0 ? "{key: someKey, " + O.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
606
|
+
if (!Ge[B + ye]) {
|
|
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} />`, ye, B, Fr, B), Ge[B + ye] = !0;
|
|
614
614
|
}
|
|
615
615
|
}
|
|
616
|
-
return e ===
|
|
616
|
+
return e === l ? Or(E) : Pr(E), E;
|
|
617
617
|
}
|
|
618
618
|
}
|
|
619
619
|
function Dr(e, n, c) {
|
|
620
|
-
return
|
|
620
|
+
return He(e, n, c, !0);
|
|
621
621
|
}
|
|
622
|
-
function
|
|
623
|
-
return
|
|
622
|
+
function Ar(e, n, c) {
|
|
623
|
+
return He(e, n, c, !1);
|
|
624
624
|
}
|
|
625
|
-
var
|
|
626
|
-
Q.Fragment =
|
|
625
|
+
var $r = Ar, Wr = Dr;
|
|
626
|
+
Q.Fragment = l, Q.jsx = $r, Q.jsxs = Wr;
|
|
627
627
|
}()), Q;
|
|
628
628
|
}
|
|
629
|
-
process.env.NODE_ENV === "production" ?
|
|
630
|
-
var r =
|
|
631
|
-
const ae = 100,
|
|
629
|
+
process.env.NODE_ENV === "production" ? we.exports = Kr() : we.exports = Jr();
|
|
630
|
+
var r = we.exports;
|
|
631
|
+
const ae = 100, le = "http://localhost:1633", a = {
|
|
632
632
|
colors: {
|
|
633
633
|
primary: "#1a56db",
|
|
634
634
|
primaryHover: "#1e429f",
|
|
@@ -644,80 +644,144 @@ const ae = 100, we = "http://localhost:1633", a = {
|
|
|
644
644
|
overlay: "rgba(0,0,0,0.5)"
|
|
645
645
|
}
|
|
646
646
|
};
|
|
647
|
-
function Xr(t =
|
|
648
|
-
const [o,
|
|
647
|
+
function Xr(t = le) {
|
|
648
|
+
const [o, i] = L({
|
|
649
649
|
isRunning: !1,
|
|
650
650
|
isChecking: !1
|
|
651
|
-
}),
|
|
652
|
-
|
|
651
|
+
}), l = or(async () => {
|
|
652
|
+
i({ isRunning: !1, isChecking: !0 });
|
|
653
653
|
try {
|
|
654
|
-
const
|
|
654
|
+
const f = await fetch(`${t}/health`, {
|
|
655
655
|
signal: AbortSignal.timeout(5e3)
|
|
656
656
|
});
|
|
657
|
-
if (
|
|
658
|
-
const p = await
|
|
659
|
-
|
|
657
|
+
if (f.ok) {
|
|
658
|
+
const p = await f.json();
|
|
659
|
+
i({ isRunning: !0, isChecking: !1, version: p.version });
|
|
660
660
|
} else
|
|
661
|
-
|
|
661
|
+
i({ isRunning: !1, isChecking: !1, error: `Node returned HTTP ${f.status}` });
|
|
662
662
|
} catch {
|
|
663
|
-
|
|
663
|
+
i({
|
|
664
664
|
isRunning: !1,
|
|
665
665
|
isChecking: !1,
|
|
666
666
|
error: `Cannot reach Bee node at ${t}`
|
|
667
667
|
});
|
|
668
668
|
}
|
|
669
669
|
}, [t]);
|
|
670
|
-
return { ...o, check:
|
|
670
|
+
return { ...o, check: l };
|
|
671
671
|
}
|
|
672
|
-
function Qr(t =
|
|
673
|
-
const [o,
|
|
674
|
-
|
|
672
|
+
function Qr(t = le) {
|
|
673
|
+
const [o, i] = L([]), [l, f] = L(!1), [p, g] = L(), [y, u] = L(), s = or(async () => {
|
|
674
|
+
f(!0), g(void 0);
|
|
675
675
|
try {
|
|
676
|
-
const
|
|
676
|
+
const d = await fetch(`${t}/stamps`, {
|
|
677
677
|
signal: AbortSignal.timeout(5e3)
|
|
678
678
|
});
|
|
679
|
-
if (
|
|
680
|
-
const
|
|
681
|
-
|
|
679
|
+
if (d.ok) {
|
|
680
|
+
const v = await d.json();
|
|
681
|
+
i(v.stamps ?? []);
|
|
682
682
|
} else
|
|
683
|
-
g(`HTTP ${
|
|
683
|
+
g(`HTTP ${d.status}`);
|
|
684
684
|
} catch {
|
|
685
685
|
g("Could not fetch postage stamps");
|
|
686
686
|
} finally {
|
|
687
|
-
|
|
687
|
+
f(!1);
|
|
688
688
|
}
|
|
689
689
|
}, [t]);
|
|
690
|
-
return { stamps: o, isLoading:
|
|
690
|
+
return { stamps: o, isLoading: l, error: p, fetchStamps: s, selectedStampId: y, selectStamp: u };
|
|
691
691
|
}
|
|
692
692
|
function Zr(t = {}) {
|
|
693
|
-
const o =
|
|
693
|
+
const [o, i] = L(t.beeApiUrl ?? le), l = Xr(o), f = Qr(o), { address: p, isConnected: g } = ir(), y = sr(), u = y === ae;
|
|
694
694
|
return {
|
|
695
|
-
beeNode:
|
|
696
|
-
stamps:
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
695
|
+
beeNode: l,
|
|
696
|
+
stamps: f,
|
|
697
|
+
beeApiUrl: o,
|
|
698
|
+
setBeeApiUrl: i,
|
|
699
|
+
isWalletConnected: g,
|
|
700
|
+
address: p,
|
|
701
|
+
isOnGnosis: u,
|
|
702
|
+
chainId: y,
|
|
703
|
+
isFullyConnected: l.isRunning && !!f.selectedStampId && g && u
|
|
702
704
|
};
|
|
703
705
|
}
|
|
704
|
-
function et({ beeApiUrl: t,
|
|
705
|
-
return
|
|
706
|
-
|
|
707
|
-
}, []),
|
|
708
|
-
|
|
709
|
-
}, [
|
|
706
|
+
function et({ beeApiUrl: t, setBeeApiUrl: o, beeNode: i, stamps: l }) {
|
|
707
|
+
return xe(() => {
|
|
708
|
+
i.check();
|
|
709
|
+
}, [t]), xe(() => {
|
|
710
|
+
i.isRunning && l.fetchStamps();
|
|
711
|
+
}, [i.isRunning]), /* @__PURE__ */ r.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 24 }, children: [
|
|
710
712
|
/* @__PURE__ */ r.jsxs("section", { children: [
|
|
711
|
-
/* @__PURE__ */ r.jsx(
|
|
712
|
-
/* @__PURE__ */ r.
|
|
713
|
+
/* @__PURE__ */ r.jsx(Ze, { children: "Bee Node" }),
|
|
714
|
+
/* @__PURE__ */ r.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 10 }, children: [
|
|
715
|
+
/* @__PURE__ */ r.jsx(
|
|
716
|
+
rt,
|
|
717
|
+
{
|
|
718
|
+
value: t,
|
|
719
|
+
disabled: i.isChecking,
|
|
720
|
+
onSubmit: o
|
|
721
|
+
}
|
|
722
|
+
),
|
|
723
|
+
/* @__PURE__ */ r.jsx(tt, { beeApiUrl: t, status: i, onRetry: i.check })
|
|
724
|
+
] })
|
|
713
725
|
] }),
|
|
714
|
-
|
|
715
|
-
/* @__PURE__ */ r.jsx(
|
|
716
|
-
/* @__PURE__ */ r.jsx(
|
|
726
|
+
i.isRunning && /* @__PURE__ */ r.jsxs("section", { children: [
|
|
727
|
+
/* @__PURE__ */ r.jsx(Ze, { children: "Postage Stamp" }),
|
|
728
|
+
/* @__PURE__ */ r.jsx(nt, { stamps: l })
|
|
717
729
|
] })
|
|
718
730
|
] });
|
|
719
731
|
}
|
|
720
|
-
function
|
|
732
|
+
function rt({ value: t, disabled: o, onSubmit: i }) {
|
|
733
|
+
const [l, f] = L(t);
|
|
734
|
+
xe(() => {
|
|
735
|
+
f(t);
|
|
736
|
+
}, [t]);
|
|
737
|
+
const p = l.trim().replace(/\/+$/, ""), g = p !== t && p.length > 0, y = () => {
|
|
738
|
+
g && i(p);
|
|
739
|
+
};
|
|
740
|
+
return /* @__PURE__ */ r.jsxs("div", { style: { display: "flex", gap: 6 }, children: [
|
|
741
|
+
/* @__PURE__ */ r.jsx(
|
|
742
|
+
"input",
|
|
743
|
+
{
|
|
744
|
+
type: "url",
|
|
745
|
+
value: l,
|
|
746
|
+
disabled: o,
|
|
747
|
+
onChange: (u) => f(u.target.value),
|
|
748
|
+
onKeyDown: (u) => {
|
|
749
|
+
u.key === "Enter" && y();
|
|
750
|
+
},
|
|
751
|
+
placeholder: "http://localhost:1633",
|
|
752
|
+
spellCheck: !1,
|
|
753
|
+
autoComplete: "off",
|
|
754
|
+
style: {
|
|
755
|
+
flex: 1,
|
|
756
|
+
minWidth: 0,
|
|
757
|
+
padding: "8px 10px",
|
|
758
|
+
fontSize: 13,
|
|
759
|
+
fontFamily: "monospace",
|
|
760
|
+
border: `1px solid ${a.colors.border}`,
|
|
761
|
+
borderRadius: 6,
|
|
762
|
+
color: a.colors.text,
|
|
763
|
+
outline: "none",
|
|
764
|
+
background: o ? "#f9fafb" : "#fff"
|
|
765
|
+
}
|
|
766
|
+
}
|
|
767
|
+
),
|
|
768
|
+
/* @__PURE__ */ r.jsx(
|
|
769
|
+
"button",
|
|
770
|
+
{
|
|
771
|
+
onClick: y,
|
|
772
|
+
disabled: o || !g,
|
|
773
|
+
style: {
|
|
774
|
+
...Se,
|
|
775
|
+
alignSelf: "auto",
|
|
776
|
+
cursor: o || !g ? "default" : "pointer",
|
|
777
|
+
opacity: o || !g ? 0.5 : 1
|
|
778
|
+
},
|
|
779
|
+
children: "Connect"
|
|
780
|
+
}
|
|
781
|
+
)
|
|
782
|
+
] });
|
|
783
|
+
}
|
|
784
|
+
function Ze({ children: t }) {
|
|
721
785
|
return /* @__PURE__ */ r.jsx("div", { style: {
|
|
722
786
|
fontSize: 11,
|
|
723
787
|
fontWeight: 700,
|
|
@@ -727,16 +791,16 @@ function Qe({ children: t }) {
|
|
|
727
791
|
marginBottom: 8
|
|
728
792
|
}, children: t });
|
|
729
793
|
}
|
|
730
|
-
function
|
|
794
|
+
function tt({ beeApiUrl: t, status: o, onRetry: i }) {
|
|
731
795
|
return o.isChecking ? /* @__PURE__ */ r.jsxs("div", { style: V, children: [
|
|
732
|
-
/* @__PURE__ */ r.jsx(
|
|
796
|
+
/* @__PURE__ */ r.jsx(ar, {}),
|
|
733
797
|
/* @__PURE__ */ r.jsxs("span", { style: { color: a.colors.muted, fontSize: 14 }, children: [
|
|
734
798
|
"Checking ",
|
|
735
799
|
t,
|
|
736
800
|
"…"
|
|
737
801
|
] })
|
|
738
802
|
] }) : o.isRunning ? /* @__PURE__ */ r.jsxs("div", { style: { ...V, borderColor: a.colors.success, background: a.colors.successLight }, children: [
|
|
739
|
-
/* @__PURE__ */ r.jsx(
|
|
803
|
+
/* @__PURE__ */ r.jsx(rr, { color: a.colors.success }),
|
|
740
804
|
/* @__PURE__ */ r.jsxs("div", { children: [
|
|
741
805
|
/* @__PURE__ */ r.jsx("div", { style: { fontWeight: 600, color: a.colors.success, fontSize: 14 }, children: "Node running" }),
|
|
742
806
|
o.version && /* @__PURE__ */ r.jsxs("div", { style: { color: a.colors.muted, fontSize: 12 }, children: [
|
|
@@ -746,7 +810,7 @@ function rt({ beeApiUrl: t, status: o, onRetry: s }) {
|
|
|
746
810
|
] })
|
|
747
811
|
] }) : /* @__PURE__ */ r.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: [
|
|
748
812
|
/* @__PURE__ */ r.jsxs("div", { style: { ...V, borderColor: a.colors.error, background: a.colors.errorLight }, children: [
|
|
749
|
-
/* @__PURE__ */ r.jsx(
|
|
813
|
+
/* @__PURE__ */ r.jsx(rr, { color: a.colors.error }),
|
|
750
814
|
/* @__PURE__ */ r.jsxs("div", { children: [
|
|
751
815
|
/* @__PURE__ */ r.jsx("div", { style: { fontWeight: 600, color: a.colors.error, fontSize: 14 }, children: "Node not reachable" }),
|
|
752
816
|
/* @__PURE__ */ r.jsx("div", { style: { color: a.colors.muted, fontSize: 12 }, children: o.error ?? `Cannot reach ${t}` })
|
|
@@ -756,21 +820,21 @@ function rt({ beeApiUrl: t, status: o, onRetry: s }) {
|
|
|
756
820
|
"Start: ",
|
|
757
821
|
/* @__PURE__ */ r.jsx("code", { style: { background: "#f3f4f6", padding: "1px 5px", borderRadius: 3 }, children: "bee start" })
|
|
758
822
|
] }),
|
|
759
|
-
/* @__PURE__ */ r.jsx("button", { onClick:
|
|
823
|
+
/* @__PURE__ */ r.jsx("button", { onClick: i, style: Se, children: "Retry" })
|
|
760
824
|
] });
|
|
761
825
|
}
|
|
762
|
-
function
|
|
826
|
+
function nt({ stamps: t }) {
|
|
763
827
|
return t.isLoading ? /* @__PURE__ */ r.jsxs("div", { style: { ...V, gap: 10 }, children: [
|
|
764
|
-
/* @__PURE__ */ r.jsx(
|
|
828
|
+
/* @__PURE__ */ r.jsx(ar, {}),
|
|
765
829
|
/* @__PURE__ */ r.jsx("span", { style: { color: a.colors.muted, fontSize: 14 }, children: "Loading stamps…" })
|
|
766
830
|
] }) : t.error ? /* @__PURE__ */ r.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: [
|
|
767
831
|
/* @__PURE__ */ r.jsx("div", { style: { ...V, borderColor: a.colors.error, background: a.colors.errorLight }, children: /* @__PURE__ */ r.jsx("span", { style: { color: a.colors.error, fontSize: 13 }, children: t.error }) }),
|
|
768
|
-
/* @__PURE__ */ r.jsx("button", { onClick: t.fetchStamps, style:
|
|
832
|
+
/* @__PURE__ */ r.jsx("button", { onClick: t.fetchStamps, style: Se, children: "Retry" })
|
|
769
833
|
] }) : t.stamps.length === 0 ? /* @__PURE__ */ r.jsxs("div", { style: { ...V, flexDirection: "column", alignItems: "flex-start", gap: 4 }, children: [
|
|
770
834
|
/* @__PURE__ */ r.jsx("div", { style: { fontSize: 14, color: a.colors.muted }, children: "No postage stamps found." }),
|
|
771
835
|
/* @__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
836
|
] }) : /* @__PURE__ */ r.jsx("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: t.stamps.map((o) => /* @__PURE__ */ r.jsx(
|
|
773
|
-
|
|
837
|
+
ot,
|
|
774
838
|
{
|
|
775
839
|
stamp: o,
|
|
776
840
|
selected: t.selectedStampId === o.batchID,
|
|
@@ -779,12 +843,12 @@ function tt({ stamps: t }) {
|
|
|
779
843
|
o.batchID
|
|
780
844
|
)) });
|
|
781
845
|
}
|
|
782
|
-
function
|
|
783
|
-
const
|
|
846
|
+
function ot({ stamp: t, selected: o, onSelect: i }) {
|
|
847
|
+
const l = Math.floor(t.batchTTL / 86400), f = `${t.batchID.slice(0, 8)}…${t.batchID.slice(-6)}`;
|
|
784
848
|
return /* @__PURE__ */ r.jsxs(
|
|
785
849
|
"button",
|
|
786
850
|
{
|
|
787
|
-
onClick:
|
|
851
|
+
onClick: i,
|
|
788
852
|
style: {
|
|
789
853
|
display: "flex",
|
|
790
854
|
alignItems: "center",
|
|
@@ -800,12 +864,12 @@ function nt({ stamp: t, selected: o, onSelect: s }) {
|
|
|
800
864
|
},
|
|
801
865
|
children: [
|
|
802
866
|
/* @__PURE__ */ r.jsxs("div", { children: [
|
|
803
|
-
/* @__PURE__ */ r.jsx("div", { style: { fontFamily: "monospace", fontSize: 12, color: a.colors.text }, children:
|
|
867
|
+
/* @__PURE__ */ r.jsx("div", { style: { fontFamily: "monospace", fontSize: 12, color: a.colors.text }, children: f }),
|
|
804
868
|
t.label && /* @__PURE__ */ r.jsx("div", { style: { fontSize: 12, color: a.colors.muted, marginTop: 2 }, children: t.label })
|
|
805
869
|
] }),
|
|
806
870
|
/* @__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(
|
|
871
|
+
/* @__PURE__ */ r.jsx("span", { style: { fontSize: 11, color: a.colors.muted }, children: l > 0 ? `${l}d` : "expiring" }),
|
|
872
|
+
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
873
|
/* @__PURE__ */ r.jsx("div", { style: {
|
|
810
874
|
width: 16,
|
|
811
875
|
height: 16,
|
|
@@ -819,13 +883,13 @@ function nt({ stamp: t, selected: o, onSelect: s }) {
|
|
|
819
883
|
}
|
|
820
884
|
);
|
|
821
885
|
}
|
|
822
|
-
function
|
|
823
|
-
return /* @__PURE__ */ r.jsx("span", { style: { fontSize: 11, background: o, color:
|
|
886
|
+
function er({ children: t, bg: o, color: i }) {
|
|
887
|
+
return /* @__PURE__ */ r.jsx("span", { style: { fontSize: 11, background: o, color: i, borderRadius: 4, padding: "2px 6px" }, children: t });
|
|
824
888
|
}
|
|
825
|
-
function
|
|
889
|
+
function rr({ color: t }) {
|
|
826
890
|
return /* @__PURE__ */ r.jsx("span", { style: { fontSize: 10, color: t, lineHeight: 1 }, children: "●" });
|
|
827
891
|
}
|
|
828
|
-
function
|
|
892
|
+
function ar() {
|
|
829
893
|
return /* @__PURE__ */ r.jsx("div", { style: {
|
|
830
894
|
width: 15,
|
|
831
895
|
height: 15,
|
|
@@ -844,7 +908,7 @@ const V = {
|
|
|
844
908
|
border: `1px solid ${a.colors.border}`,
|
|
845
909
|
borderRadius: 8,
|
|
846
910
|
background: "#fff"
|
|
847
|
-
},
|
|
911
|
+
}, Se = {
|
|
848
912
|
background: "none",
|
|
849
913
|
border: `1px solid ${a.colors.border}`,
|
|
850
914
|
borderRadius: 6,
|
|
@@ -854,24 +918,24 @@ const V = {
|
|
|
854
918
|
color: a.colors.muted,
|
|
855
919
|
alignSelf: "flex-start"
|
|
856
920
|
};
|
|
857
|
-
function
|
|
921
|
+
function it(t) {
|
|
858
922
|
const o = {
|
|
859
923
|
formatters: void 0,
|
|
860
924
|
fees: void 0,
|
|
861
925
|
serializers: void 0,
|
|
862
926
|
...t
|
|
863
927
|
};
|
|
864
|
-
function
|
|
865
|
-
return (
|
|
866
|
-
const p = typeof
|
|
867
|
-
return Object.assign(g, { extend:
|
|
928
|
+
function i(l) {
|
|
929
|
+
return (f) => {
|
|
930
|
+
const p = typeof f == "function" ? f(l) : f, g = { ...l, ...p };
|
|
931
|
+
return Object.assign(g, { extend: i(g) });
|
|
868
932
|
};
|
|
869
933
|
}
|
|
870
934
|
return Object.assign(o, {
|
|
871
|
-
extend:
|
|
935
|
+
extend: i(o)
|
|
872
936
|
});
|
|
873
937
|
}
|
|
874
|
-
const
|
|
938
|
+
const je = /* @__PURE__ */ it({
|
|
875
939
|
id: 100,
|
|
876
940
|
name: "Gnosis",
|
|
877
941
|
nativeCurrency: {
|
|
@@ -900,20 +964,20 @@ const xe = /* @__PURE__ */ ot({
|
|
|
900
964
|
}
|
|
901
965
|
}
|
|
902
966
|
});
|
|
903
|
-
function
|
|
904
|
-
const { address: t, isConnected: o } =
|
|
967
|
+
function st() {
|
|
968
|
+
const { address: t, isConnected: o } = ir(), i = sr(), l = i === ae;
|
|
905
969
|
return /* @__PURE__ */ r.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 24 }, children: [
|
|
906
970
|
/* @__PURE__ */ r.jsxs("section", { children: [
|
|
907
|
-
/* @__PURE__ */ r.jsx(
|
|
908
|
-
o ? /* @__PURE__ */ r.jsx(
|
|
971
|
+
/* @__PURE__ */ r.jsx(tr, { children: "Wallet" }),
|
|
972
|
+
o ? /* @__PURE__ */ r.jsx(at, { address: t }) : /* @__PURE__ */ r.jsx(ct, {})
|
|
909
973
|
] }),
|
|
910
974
|
o && /* @__PURE__ */ r.jsxs("section", { children: [
|
|
911
|
-
/* @__PURE__ */ r.jsx(
|
|
912
|
-
/* @__PURE__ */ r.jsx(
|
|
975
|
+
/* @__PURE__ */ r.jsx(tr, { children: "Network" }),
|
|
976
|
+
/* @__PURE__ */ r.jsx(lt, { isOnGnosis: l, chainId: i })
|
|
913
977
|
] })
|
|
914
978
|
] });
|
|
915
979
|
}
|
|
916
|
-
function
|
|
980
|
+
function tr({ children: t }) {
|
|
917
981
|
return /* @__PURE__ */ r.jsx("div", { style: {
|
|
918
982
|
fontSize: 11,
|
|
919
983
|
fontWeight: 700,
|
|
@@ -923,7 +987,7 @@ function rr({ children: t }) {
|
|
|
923
987
|
marginBottom: 8
|
|
924
988
|
}, children: t });
|
|
925
989
|
}
|
|
926
|
-
function
|
|
990
|
+
function at({ address: t }) {
|
|
927
991
|
const { disconnect: o } = zr();
|
|
928
992
|
return /* @__PURE__ */ r.jsxs("div", { style: {
|
|
929
993
|
display: "flex",
|
|
@@ -956,14 +1020,14 @@ function st({ address: t }) {
|
|
|
956
1020
|
)
|
|
957
1021
|
] });
|
|
958
1022
|
}
|
|
959
|
-
function
|
|
960
|
-
const { connectors: t, connect: o, isPending:
|
|
1023
|
+
function ct() {
|
|
1024
|
+
const { connectors: t, connect: o, isPending: i, error: l } = Ur();
|
|
961
1025
|
return /* @__PURE__ */ r.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: [
|
|
962
|
-
t.map((
|
|
1026
|
+
t.map((f) => /* @__PURE__ */ r.jsxs(
|
|
963
1027
|
"button",
|
|
964
1028
|
{
|
|
965
|
-
onClick: () => o({ connector:
|
|
966
|
-
disabled:
|
|
1029
|
+
onClick: () => o({ connector: f }),
|
|
1030
|
+
disabled: i,
|
|
967
1031
|
style: {
|
|
968
1032
|
display: "flex",
|
|
969
1033
|
alignItems: "center",
|
|
@@ -971,33 +1035,33 @@ function at() {
|
|
|
971
1035
|
padding: "11px 14px",
|
|
972
1036
|
border: `1.5px solid ${a.colors.border}`,
|
|
973
1037
|
borderRadius: 8,
|
|
974
|
-
cursor:
|
|
1038
|
+
cursor: i ? "not-allowed" : "pointer",
|
|
975
1039
|
background: "#fff",
|
|
976
1040
|
fontSize: 14,
|
|
977
1041
|
fontWeight: 500,
|
|
978
1042
|
color: a.colors.text,
|
|
979
|
-
opacity:
|
|
1043
|
+
opacity: i ? 0.6 : 1,
|
|
980
1044
|
transition: "border-color 0.15s",
|
|
981
1045
|
width: "100%"
|
|
982
1046
|
},
|
|
983
1047
|
onMouseOver: (p) => {
|
|
984
|
-
|
|
1048
|
+
i || (p.currentTarget.style.borderColor = a.colors.primary);
|
|
985
1049
|
},
|
|
986
1050
|
onMouseOut: (p) => {
|
|
987
1051
|
p.currentTarget.style.borderColor = a.colors.border;
|
|
988
1052
|
},
|
|
989
1053
|
children: [
|
|
990
|
-
|
|
991
|
-
|
|
1054
|
+
f.icon ? /* @__PURE__ */ r.jsx("img", { src: f.icon, width: 20, height: 20, alt: "", style: { borderRadius: 4 } }) : /* @__PURE__ */ r.jsx("span", { style: { width: 20, textAlign: "center", fontSize: 16 }, children: "🔗" }),
|
|
1055
|
+
f.name
|
|
992
1056
|
]
|
|
993
1057
|
},
|
|
994
|
-
|
|
1058
|
+
f.uid
|
|
995
1059
|
)),
|
|
996
|
-
|
|
1060
|
+
l && /* @__PURE__ */ r.jsx("div", { style: { fontSize: 12, color: a.colors.error, marginTop: 2 }, children: l.message })
|
|
997
1061
|
] });
|
|
998
1062
|
}
|
|
999
|
-
function
|
|
1000
|
-
const { switchChain:
|
|
1063
|
+
function lt({ isOnGnosis: t, chainId: o }) {
|
|
1064
|
+
const { switchChain: i, isPending: l, error: f } = Mr();
|
|
1001
1065
|
return t ? /* @__PURE__ */ r.jsxs("div", { style: {
|
|
1002
1066
|
display: "flex",
|
|
1003
1067
|
alignItems: "center",
|
|
@@ -1040,28 +1104,28 @@ function ct({ isOnGnosis: t, chainId: o }) {
|
|
|
1040
1104
|
/* @__PURE__ */ r.jsx(
|
|
1041
1105
|
"button",
|
|
1042
1106
|
{
|
|
1043
|
-
onClick: () =>
|
|
1044
|
-
disabled:
|
|
1107
|
+
onClick: () => i({ chainId: je.id }),
|
|
1108
|
+
disabled: l,
|
|
1045
1109
|
style: {
|
|
1046
1110
|
background: a.colors.primary,
|
|
1047
1111
|
color: "#fff",
|
|
1048
1112
|
border: "none",
|
|
1049
1113
|
borderRadius: 6,
|
|
1050
1114
|
padding: "9px 20px",
|
|
1051
|
-
cursor:
|
|
1115
|
+
cursor: l ? "not-allowed" : "pointer",
|
|
1052
1116
|
fontSize: 14,
|
|
1053
1117
|
fontWeight: 500,
|
|
1054
|
-
opacity:
|
|
1118
|
+
opacity: l ? 0.7 : 1,
|
|
1055
1119
|
alignSelf: "flex-start"
|
|
1056
1120
|
},
|
|
1057
|
-
children:
|
|
1121
|
+
children: l ? "Switching…" : "Switch to Gnosis"
|
|
1058
1122
|
}
|
|
1059
1123
|
),
|
|
1060
|
-
|
|
1124
|
+
f && /* @__PURE__ */ r.jsx("div", { style: { fontSize: 12, color: a.colors.error }, children: f.message })
|
|
1061
1125
|
] });
|
|
1062
1126
|
}
|
|
1063
|
-
function
|
|
1064
|
-
const [
|
|
1127
|
+
function ut({ onClose: t, beeNode: o, stamps: i, beeApiUrl: l, setBeeApiUrl: f }) {
|
|
1128
|
+
const [p, g] = L("swarm");
|
|
1065
1129
|
return /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
|
|
1066
1130
|
/* @__PURE__ */ r.jsx("style", { children: `
|
|
1067
1131
|
@keyframes spin { to { transform: rotate(360deg); } }
|
|
@@ -1129,111 +1193,121 @@ function lt({ onClose: t, beeNode: o, stamps: s, beeApiUrl: u }) {
|
|
|
1129
1193
|
display: "flex",
|
|
1130
1194
|
margin: "14px 20px 0",
|
|
1131
1195
|
borderBottom: `1px solid ${a.colors.border}`
|
|
1132
|
-
}, children: ["swarm", "wallet"].map((
|
|
1133
|
-
const
|
|
1196
|
+
}, children: ["swarm", "wallet"].map((y) => {
|
|
1197
|
+
const u = p === y;
|
|
1134
1198
|
return /* @__PURE__ */ r.jsx(
|
|
1135
1199
|
"button",
|
|
1136
1200
|
{
|
|
1137
|
-
onClick: () =>
|
|
1201
|
+
onClick: () => g(y),
|
|
1138
1202
|
style: {
|
|
1139
1203
|
background: "none",
|
|
1140
1204
|
border: "none",
|
|
1141
1205
|
cursor: "pointer",
|
|
1142
1206
|
padding: "8px 18px 10px",
|
|
1143
1207
|
fontSize: 14,
|
|
1144
|
-
fontWeight:
|
|
1145
|
-
color:
|
|
1146
|
-
borderBottom: `2px solid ${
|
|
1208
|
+
fontWeight: u ? 600 : 400,
|
|
1209
|
+
color: u ? a.colors.primary : a.colors.muted,
|
|
1210
|
+
borderBottom: `2px solid ${u ? a.colors.primary : "transparent"}`,
|
|
1147
1211
|
marginBottom: -1,
|
|
1148
1212
|
transition: "all 0.15s"
|
|
1149
1213
|
},
|
|
1150
|
-
children:
|
|
1214
|
+
children: y === "swarm" ? "🐝 Swarm" : "🦊 Wallet"
|
|
1151
1215
|
},
|
|
1152
|
-
|
|
1216
|
+
y
|
|
1153
1217
|
);
|
|
1154
1218
|
}) }),
|
|
1155
1219
|
/* @__PURE__ */ r.jsxs("div", { style: { padding: "20px", minHeight: 260, maxHeight: "60vh", overflowY: "auto" }, children: [
|
|
1156
|
-
|
|
1157
|
-
|
|
1220
|
+
p === "swarm" && /* @__PURE__ */ r.jsx(et, { beeApiUrl: l, setBeeApiUrl: f, beeNode: o, stamps: i }),
|
|
1221
|
+
p === "wallet" && /* @__PURE__ */ r.jsx(st, {})
|
|
1158
1222
|
] })
|
|
1159
1223
|
] })
|
|
1160
1224
|
] });
|
|
1161
1225
|
}
|
|
1162
|
-
function
|
|
1163
|
-
const [
|
|
1226
|
+
function wt({ beeApiUrl: t = le, label: o }) {
|
|
1227
|
+
const [i, l] = L(!1), {
|
|
1228
|
+
beeNode: f,
|
|
1229
|
+
stamps: p,
|
|
1230
|
+
beeApiUrl: g,
|
|
1231
|
+
setBeeApiUrl: y,
|
|
1232
|
+
isWalletConnected: u,
|
|
1233
|
+
address: s,
|
|
1234
|
+
isOnGnosis: d,
|
|
1235
|
+
isFullyConnected: v
|
|
1236
|
+
} = Zr({ beeApiUrl: t }), x = o ?? (v ? s ? `${s.slice(0, 6)}…${s.slice(-4)}` : "Connected" : "Connect to Swarm");
|
|
1164
1237
|
return /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
|
|
1165
1238
|
/* @__PURE__ */ r.jsxs(
|
|
1166
1239
|
"button",
|
|
1167
1240
|
{
|
|
1168
|
-
onClick: () =>
|
|
1241
|
+
onClick: () => l(!0),
|
|
1169
1242
|
style: {
|
|
1170
1243
|
display: "inline-flex",
|
|
1171
1244
|
alignItems: "center",
|
|
1172
1245
|
gap: 8,
|
|
1173
|
-
background:
|
|
1174
|
-
color:
|
|
1175
|
-
border:
|
|
1246
|
+
background: v ? a.colors.successLight : a.colors.primary,
|
|
1247
|
+
color: v ? a.colors.success : "#fff",
|
|
1248
|
+
border: v ? `1.5px solid ${a.colors.success}` : "none",
|
|
1176
1249
|
borderRadius: 8,
|
|
1177
1250
|
padding: "10px 18px",
|
|
1178
1251
|
cursor: "pointer",
|
|
1179
1252
|
fontSize: 15,
|
|
1180
1253
|
fontWeight: 600,
|
|
1181
|
-
boxShadow:
|
|
1254
|
+
boxShadow: v ? "none" : "0 2px 8px rgba(26,86,219,0.25)",
|
|
1182
1255
|
transition: "all 0.15s",
|
|
1183
1256
|
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif'
|
|
1184
1257
|
},
|
|
1185
|
-
onMouseOver: (
|
|
1186
|
-
|
|
1258
|
+
onMouseOver: (R) => {
|
|
1259
|
+
v || (R.currentTarget.style.background = a.colors.primaryHover);
|
|
1187
1260
|
},
|
|
1188
|
-
onMouseOut: (
|
|
1189
|
-
|
|
1261
|
+
onMouseOut: (R) => {
|
|
1262
|
+
R.currentTarget.style.background = v ? a.colors.successLight : a.colors.primary;
|
|
1190
1263
|
},
|
|
1191
1264
|
children: [
|
|
1192
|
-
!
|
|
1193
|
-
/* @__PURE__ */ r.jsx(ie, { ok:
|
|
1265
|
+
!v && /* @__PURE__ */ r.jsxs("span", { style: { display: "flex", gap: 4, alignItems: "center" }, children: [
|
|
1266
|
+
/* @__PURE__ */ r.jsx(ie, { ok: f.isRunning, checking: f.isChecking }),
|
|
1194
1267
|
/* @__PURE__ */ r.jsx(ie, { ok: !!p.selectedStampId }),
|
|
1195
|
-
/* @__PURE__ */ r.jsx(ie, { ok:
|
|
1196
|
-
/* @__PURE__ */ r.jsx(ie, { ok:
|
|
1268
|
+
/* @__PURE__ */ r.jsx(ie, { ok: u }),
|
|
1269
|
+
/* @__PURE__ */ r.jsx(ie, { ok: d })
|
|
1197
1270
|
] }),
|
|
1198
|
-
|
|
1271
|
+
x
|
|
1199
1272
|
]
|
|
1200
1273
|
}
|
|
1201
1274
|
),
|
|
1202
|
-
|
|
1203
|
-
|
|
1275
|
+
i && /* @__PURE__ */ r.jsx(
|
|
1276
|
+
ut,
|
|
1204
1277
|
{
|
|
1205
|
-
onClose: () =>
|
|
1206
|
-
beeNode:
|
|
1278
|
+
onClose: () => l(!1),
|
|
1279
|
+
beeNode: f,
|
|
1207
1280
|
stamps: p,
|
|
1208
|
-
beeApiUrl:
|
|
1281
|
+
beeApiUrl: g,
|
|
1282
|
+
setBeeApiUrl: y
|
|
1209
1283
|
}
|
|
1210
1284
|
)
|
|
1211
1285
|
] });
|
|
1212
1286
|
}
|
|
1213
1287
|
function ie({ ok: t, checking: o }) {
|
|
1214
|
-
const
|
|
1288
|
+
const i = o ? a.colors.warning : t ? a.colors.success : a.colors.error;
|
|
1215
1289
|
return /* @__PURE__ */ r.jsx("span", { style: {
|
|
1216
1290
|
display: "inline-block",
|
|
1217
1291
|
width: 7,
|
|
1218
1292
|
height: 7,
|
|
1219
1293
|
borderRadius: "50%",
|
|
1220
|
-
background:
|
|
1294
|
+
background: i
|
|
1221
1295
|
} });
|
|
1222
1296
|
}
|
|
1223
|
-
const
|
|
1224
|
-
var cr = function(t, o,
|
|
1225
|
-
if (
|
|
1226
|
-
if (typeof o == "function" ? t !== o || !
|
|
1227
|
-
return
|
|
1297
|
+
const dt = "2.22.1", ft = () => `@wagmi/core@${dt}`;
|
|
1298
|
+
var cr = function(t, o, i, l) {
|
|
1299
|
+
if (i === "a" && !l) throw new TypeError("Private accessor was defined without a getter");
|
|
1300
|
+
if (typeof o == "function" ? t !== o || !l : !o.has(t)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
1301
|
+
return i === "m" ? l : i === "a" ? l.call(t) : l ? l.value : o.get(t);
|
|
1228
1302
|
}, ce, lr;
|
|
1229
1303
|
class Z extends Error {
|
|
1230
1304
|
get docsBaseUrl() {
|
|
1231
1305
|
return "https://wagmi.sh/core";
|
|
1232
1306
|
}
|
|
1233
1307
|
get version() {
|
|
1234
|
-
return
|
|
1308
|
+
return ft();
|
|
1235
1309
|
}
|
|
1236
|
-
constructor(o,
|
|
1310
|
+
constructor(o, i = {}) {
|
|
1237
1311
|
var p;
|
|
1238
1312
|
super(), ce.add(this), Object.defineProperty(this, "details", {
|
|
1239
1313
|
enumerable: !0,
|
|
@@ -1261,27 +1335,27 @@ class Z extends Error {
|
|
|
1261
1335
|
writable: !0,
|
|
1262
1336
|
value: "WagmiCoreError"
|
|
1263
1337
|
});
|
|
1264
|
-
const
|
|
1338
|
+
const l = i.cause instanceof Z ? i.cause.details : (p = i.cause) != null && p.message ? i.cause.message : i.details, f = i.cause instanceof Z && i.cause.docsPath || i.docsPath;
|
|
1265
1339
|
this.message = [
|
|
1266
1340
|
o || "An error occurred.",
|
|
1267
1341
|
"",
|
|
1268
|
-
...
|
|
1269
|
-
...
|
|
1270
|
-
`Docs: ${this.docsBaseUrl}${
|
|
1342
|
+
...i.metaMessages ? [...i.metaMessages, ""] : [],
|
|
1343
|
+
...f ? [
|
|
1344
|
+
`Docs: ${this.docsBaseUrl}${f}.html${i.docsSlug ? `#${i.docsSlug}` : ""}`
|
|
1271
1345
|
] : [],
|
|
1272
|
-
...
|
|
1346
|
+
...l ? [`Details: ${l}`] : [],
|
|
1273
1347
|
`Version: ${this.version}`
|
|
1274
1348
|
].join(`
|
|
1275
|
-
`),
|
|
1349
|
+
`), i.cause && (this.cause = i.cause), this.details = l, this.docsPath = f, this.metaMessages = i.metaMessages, this.shortMessage = o;
|
|
1276
1350
|
}
|
|
1277
1351
|
walk(o) {
|
|
1278
1352
|
return cr(this, ce, "m", lr).call(this, this, o);
|
|
1279
1353
|
}
|
|
1280
1354
|
}
|
|
1281
|
-
ce = /* @__PURE__ */ new WeakSet(), lr = function t(o,
|
|
1282
|
-
return
|
|
1355
|
+
ce = /* @__PURE__ */ new WeakSet(), lr = function t(o, i) {
|
|
1356
|
+
return i != null && i(o) ? o : o.cause ? cr(this, ce, "m", t).call(this, o.cause, i) : o;
|
|
1283
1357
|
};
|
|
1284
|
-
class
|
|
1358
|
+
class ht extends Z {
|
|
1285
1359
|
constructor() {
|
|
1286
1360
|
super("Chain not configured."), Object.defineProperty(this, "name", {
|
|
1287
1361
|
enumerable: !0,
|
|
@@ -1301,103 +1375,103 @@ class q extends Z {
|
|
|
1301
1375
|
});
|
|
1302
1376
|
}
|
|
1303
1377
|
}
|
|
1304
|
-
|
|
1305
|
-
function
|
|
1306
|
-
const { shimDisconnect: o = !0, unstable_shimAsyncInject:
|
|
1307
|
-
function
|
|
1308
|
-
const
|
|
1309
|
-
if (typeof
|
|
1310
|
-
const
|
|
1311
|
-
if (
|
|
1312
|
-
return
|
|
1378
|
+
Ce.type = "injected";
|
|
1379
|
+
function Ce(t = {}) {
|
|
1380
|
+
const { shimDisconnect: o = !0, unstable_shimAsyncInject: i } = t;
|
|
1381
|
+
function l() {
|
|
1382
|
+
const u = t.target;
|
|
1383
|
+
if (typeof u == "function") {
|
|
1384
|
+
const s = u();
|
|
1385
|
+
if (s)
|
|
1386
|
+
return s;
|
|
1313
1387
|
}
|
|
1314
|
-
return typeof
|
|
1315
|
-
...
|
|
1316
|
-
id:
|
|
1317
|
-
name: `${
|
|
1318
|
-
provider: `is${
|
|
1388
|
+
return typeof u == "object" ? u : typeof u == "string" ? {
|
|
1389
|
+
...pt[u] ?? {
|
|
1390
|
+
id: u,
|
|
1391
|
+
name: `${u[0].toUpperCase()}${u.slice(1)}`,
|
|
1392
|
+
provider: `is${u[0].toUpperCase()}${u.slice(1)}`
|
|
1319
1393
|
}
|
|
1320
1394
|
} : {
|
|
1321
1395
|
id: "injected",
|
|
1322
1396
|
name: "Injected",
|
|
1323
|
-
provider(
|
|
1324
|
-
return
|
|
1397
|
+
provider(s) {
|
|
1398
|
+
return s == null ? void 0 : s.ethereum;
|
|
1325
1399
|
}
|
|
1326
1400
|
};
|
|
1327
1401
|
}
|
|
1328
|
-
let
|
|
1329
|
-
return (
|
|
1402
|
+
let f, p, g, y;
|
|
1403
|
+
return (u) => ({
|
|
1330
1404
|
get icon() {
|
|
1331
|
-
return
|
|
1405
|
+
return l().icon;
|
|
1332
1406
|
},
|
|
1333
1407
|
get id() {
|
|
1334
|
-
return
|
|
1408
|
+
return l().id;
|
|
1335
1409
|
},
|
|
1336
1410
|
get name() {
|
|
1337
|
-
return
|
|
1411
|
+
return l().name;
|
|
1338
1412
|
},
|
|
1339
1413
|
/** @deprecated */
|
|
1340
1414
|
get supportsSimulation() {
|
|
1341
1415
|
return !0;
|
|
1342
1416
|
},
|
|
1343
|
-
type:
|
|
1417
|
+
type: Ce.type,
|
|
1344
1418
|
async setup() {
|
|
1345
|
-
const
|
|
1346
|
-
|
|
1419
|
+
const s = await this.getProvider();
|
|
1420
|
+
s != null && s.on && t.target && (g || (g = this.onConnect.bind(this), s.on("connect", g)), f || (f = this.onAccountsChanged.bind(this), s.on("accountsChanged", f)));
|
|
1347
1421
|
},
|
|
1348
|
-
async connect({ chainId:
|
|
1349
|
-
var D, W,
|
|
1422
|
+
async connect({ chainId: s, isReconnecting: d, withCapabilities: v } = {}) {
|
|
1423
|
+
var D, W, z, T, S, I;
|
|
1350
1424
|
const x = await this.getProvider();
|
|
1351
1425
|
if (!x)
|
|
1352
1426
|
throw new q();
|
|
1353
|
-
let
|
|
1354
|
-
if (
|
|
1355
|
-
|
|
1427
|
+
let R = [];
|
|
1428
|
+
if (d)
|
|
1429
|
+
R = await this.getAccounts().catch(() => []);
|
|
1356
1430
|
else if (o)
|
|
1357
1431
|
try {
|
|
1358
|
-
|
|
1432
|
+
R = (T = (z = (W = (D = (await x.request({
|
|
1359
1433
|
method: "wallet_requestPermissions",
|
|
1360
1434
|
params: [{ eth_accounts: {} }]
|
|
1361
|
-
}))[0]) == null ? void 0 : D.caveats) == null ? void 0 : W[0]) == null ? void 0 :
|
|
1362
|
-
} catch (
|
|
1363
|
-
const C =
|
|
1364
|
-
if (C.code ===
|
|
1365
|
-
throw new
|
|
1366
|
-
if (C.code ===
|
|
1435
|
+
}))[0]) == null ? void 0 : D.caveats) == null ? void 0 : W[0]) == null ? void 0 : z.value) == null ? void 0 : T.map((C) => oe(C)), R.length > 0 && (R = await this.getAccounts());
|
|
1436
|
+
} catch (_) {
|
|
1437
|
+
const C = _;
|
|
1438
|
+
if (C.code === F.code)
|
|
1439
|
+
throw new F(C);
|
|
1440
|
+
if (C.code === be.code)
|
|
1367
1441
|
throw C;
|
|
1368
1442
|
}
|
|
1369
1443
|
try {
|
|
1370
|
-
!(
|
|
1444
|
+
!(R != null && R.length) && !d && (R = (await x.request({
|
|
1371
1445
|
method: "eth_requestAccounts"
|
|
1372
|
-
})).map((
|
|
1373
|
-
let
|
|
1374
|
-
if (
|
|
1375
|
-
const C = await this.switchChain({ chainId:
|
|
1376
|
-
if (
|
|
1377
|
-
throw
|
|
1378
|
-
return { id:
|
|
1446
|
+
})).map(($) => oe($))), g && (x.removeListener("connect", g), g = void 0), f || (f = this.onAccountsChanged.bind(this), x.on("accountsChanged", f)), p || (p = this.onChainChanged.bind(this), x.on("chainChanged", p)), y || (y = this.onDisconnect.bind(this), x.on("disconnect", y));
|
|
1447
|
+
let _ = await this.getChainId();
|
|
1448
|
+
if (s && _ !== s) {
|
|
1449
|
+
const C = await this.switchChain({ chainId: s }).catch(($) => {
|
|
1450
|
+
if ($.code === F.code)
|
|
1451
|
+
throw $;
|
|
1452
|
+
return { id: _ };
|
|
1379
1453
|
});
|
|
1380
|
-
|
|
1454
|
+
_ = (C == null ? void 0 : C.id) ?? _;
|
|
1381
1455
|
}
|
|
1382
|
-
return o && await ((S =
|
|
1383
|
-
accounts:
|
|
1384
|
-
chainId:
|
|
1456
|
+
return o && await ((S = u.storage) == null ? void 0 : S.removeItem(`${this.id}.disconnected`)), t.target || await ((I = u.storage) == null ? void 0 : I.setItem("injected.connected", !0)), {
|
|
1457
|
+
accounts: v ? R.map((C) => ({ address: C, capabilities: {} })) : R,
|
|
1458
|
+
chainId: _
|
|
1385
1459
|
};
|
|
1386
|
-
} catch (
|
|
1387
|
-
const C =
|
|
1388
|
-
throw C.code ===
|
|
1460
|
+
} catch (_) {
|
|
1461
|
+
const C = _;
|
|
1462
|
+
throw C.code === F.code ? new F(C) : C.code === be.code ? new be(C) : C;
|
|
1389
1463
|
}
|
|
1390
1464
|
},
|
|
1391
1465
|
async disconnect() {
|
|
1392
|
-
var
|
|
1393
|
-
const
|
|
1394
|
-
if (!
|
|
1466
|
+
var d, v;
|
|
1467
|
+
const s = await this.getProvider();
|
|
1468
|
+
if (!s)
|
|
1395
1469
|
throw new q();
|
|
1396
|
-
p && (
|
|
1470
|
+
p && (s.removeListener("chainChanged", p), p = void 0), y && (s.removeListener("disconnect", y), y = void 0), g || (g = this.onConnect.bind(this), s.on("connect", g));
|
|
1397
1471
|
try {
|
|
1398
1472
|
await Hr(() => (
|
|
1399
1473
|
// TODO: Remove explicit type for viem@3
|
|
1400
|
-
|
|
1474
|
+
s.request({
|
|
1401
1475
|
// `'wallet_revokePermissions'` added in `viem@2.10.3`
|
|
1402
1476
|
method: "wallet_revokePermissions",
|
|
1403
1477
|
params: [{ eth_accounts: {} }]
|
|
@@ -1405,38 +1479,38 @@ function je(t = {}) {
|
|
|
1405
1479
|
), { timeout: 100 });
|
|
1406
1480
|
} catch {
|
|
1407
1481
|
}
|
|
1408
|
-
o && await ((
|
|
1482
|
+
o && await ((d = u.storage) == null ? void 0 : d.setItem(`${this.id}.disconnected`, !0)), t.target || await ((v = u.storage) == null ? void 0 : v.removeItem("injected.connected"));
|
|
1409
1483
|
},
|
|
1410
1484
|
async getAccounts() {
|
|
1411
|
-
const
|
|
1412
|
-
if (!
|
|
1485
|
+
const s = await this.getProvider();
|
|
1486
|
+
if (!s)
|
|
1413
1487
|
throw new q();
|
|
1414
|
-
return (await
|
|
1488
|
+
return (await s.request({ method: "eth_accounts" })).map((v) => oe(v));
|
|
1415
1489
|
},
|
|
1416
1490
|
async getChainId() {
|
|
1417
|
-
const
|
|
1418
|
-
if (!
|
|
1491
|
+
const s = await this.getProvider();
|
|
1492
|
+
if (!s)
|
|
1419
1493
|
throw new q();
|
|
1420
|
-
const
|
|
1421
|
-
return Number(
|
|
1494
|
+
const d = await s.request({ method: "eth_chainId" });
|
|
1495
|
+
return Number(d);
|
|
1422
1496
|
},
|
|
1423
1497
|
async getProvider() {
|
|
1424
1498
|
if (typeof window > "u")
|
|
1425
1499
|
return;
|
|
1426
|
-
let
|
|
1427
|
-
const
|
|
1428
|
-
return typeof
|
|
1429
|
-
}),
|
|
1500
|
+
let s;
|
|
1501
|
+
const d = l();
|
|
1502
|
+
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 = () => {
|
|
1503
|
+
}), s;
|
|
1430
1504
|
},
|
|
1431
1505
|
async isAuthorized() {
|
|
1432
|
-
var
|
|
1506
|
+
var s, d;
|
|
1433
1507
|
try {
|
|
1434
1508
|
if (o && // If shim exists in storage, connector is disconnected
|
|
1435
|
-
await ((
|
|
1509
|
+
await ((s = u.storage) == null ? void 0 : s.getItem(`${this.id}.disconnected`)) || !t.target && !await ((d = u.storage) == null ? void 0 : d.getItem("injected.connected")))
|
|
1436
1510
|
return !1;
|
|
1437
1511
|
if (!await this.getProvider()) {
|
|
1438
|
-
if (
|
|
1439
|
-
const D = async () => (typeof window < "u" && window.removeEventListener("ethereum#initialized", D), !!await this.getProvider()), W = typeof
|
|
1512
|
+
if (i !== void 0 && i !== !1) {
|
|
1513
|
+
const D = async () => (typeof window < "u" && window.removeEventListener("ethereum#initialized", D), !!await this.getProvider()), W = typeof i == "number" ? i : 1e3;
|
|
1440
1514
|
if (await Promise.race([
|
|
1441
1515
|
...typeof window < "u" ? [
|
|
1442
1516
|
new Promise((T) => window.addEventListener("ethereum#initialized", () => T(D()), { once: !0 }))
|
|
@@ -1452,29 +1526,29 @@ function je(t = {}) {
|
|
|
1452
1526
|
return !1;
|
|
1453
1527
|
}
|
|
1454
1528
|
},
|
|
1455
|
-
async switchChain({ addEthereumChainParameter:
|
|
1456
|
-
var D, W,
|
|
1457
|
-
const
|
|
1458
|
-
if (!
|
|
1529
|
+
async switchChain({ addEthereumChainParameter: s, chainId: d }) {
|
|
1530
|
+
var D, W, z, T;
|
|
1531
|
+
const v = await this.getProvider();
|
|
1532
|
+
if (!v)
|
|
1459
1533
|
throw new q();
|
|
1460
|
-
const x =
|
|
1534
|
+
const x = u.chains.find((S) => S.id === d);
|
|
1461
1535
|
if (!x)
|
|
1462
|
-
throw new
|
|
1463
|
-
const
|
|
1464
|
-
const I = (
|
|
1465
|
-
"chainId" in
|
|
1536
|
+
throw new Ke(new ht());
|
|
1537
|
+
const R = new Promise((S) => {
|
|
1538
|
+
const I = (_) => {
|
|
1539
|
+
"chainId" in _ && _.chainId === d && (u.emitter.off("change", I), S());
|
|
1466
1540
|
};
|
|
1467
|
-
|
|
1541
|
+
u.emitter.on("change", I);
|
|
1468
1542
|
});
|
|
1469
1543
|
try {
|
|
1470
1544
|
return await Promise.all([
|
|
1471
|
-
|
|
1545
|
+
v.request({
|
|
1472
1546
|
method: "wallet_switchEthereumChain",
|
|
1473
|
-
params: [{ chainId:
|
|
1547
|
+
params: [{ chainId: Je(d) }]
|
|
1474
1548
|
}).then(async () => {
|
|
1475
|
-
await this.getChainId() ===
|
|
1549
|
+
await this.getChainId() === d && u.emitter.emit("change", { chainId: d });
|
|
1476
1550
|
}),
|
|
1477
|
-
|
|
1551
|
+
R
|
|
1478
1552
|
]), x;
|
|
1479
1553
|
} catch (S) {
|
|
1480
1554
|
const I = S;
|
|
@@ -1482,72 +1556,72 @@ function je(t = {}) {
|
|
|
1482
1556
|
// https://github.com/MetaMask/metamask-mobile/issues/2944#issuecomment-976988719
|
|
1483
1557
|
((W = (D = I == null ? void 0 : I.data) == null ? void 0 : D.originalError) == null ? void 0 : W.code) === 4902)
|
|
1484
1558
|
try {
|
|
1485
|
-
const { default:
|
|
1486
|
-
let
|
|
1487
|
-
|
|
1488
|
-
|
|
1559
|
+
const { default: _, ...C } = x.blockExplorers ?? {};
|
|
1560
|
+
let $;
|
|
1561
|
+
s != null && s.blockExplorerUrls ? $ = s.blockExplorerUrls : _ && ($ = [
|
|
1562
|
+
_.url,
|
|
1489
1563
|
...Object.values(C).map((H) => H.url)
|
|
1490
1564
|
]);
|
|
1491
1565
|
let G;
|
|
1492
|
-
(
|
|
1493
|
-
const
|
|
1494
|
-
blockExplorerUrls:
|
|
1495
|
-
chainId:
|
|
1496
|
-
chainName: (
|
|
1497
|
-
iconUrls:
|
|
1498
|
-
nativeCurrency: (
|
|
1566
|
+
(z = s == null ? void 0 : s.rpcUrls) != null && z.length ? G = s.rpcUrls : G = [((T = x.rpcUrls.default) == null ? void 0 : T.http[0]) ?? ""];
|
|
1567
|
+
const ue = {
|
|
1568
|
+
blockExplorerUrls: $,
|
|
1569
|
+
chainId: Je(d),
|
|
1570
|
+
chainName: (s == null ? void 0 : s.chainName) ?? x.name,
|
|
1571
|
+
iconUrls: s == null ? void 0 : s.iconUrls,
|
|
1572
|
+
nativeCurrency: (s == null ? void 0 : s.nativeCurrency) ?? x.nativeCurrency,
|
|
1499
1573
|
rpcUrls: G
|
|
1500
1574
|
};
|
|
1501
1575
|
return await Promise.all([
|
|
1502
|
-
|
|
1576
|
+
v.request({
|
|
1503
1577
|
method: "wallet_addEthereumChain",
|
|
1504
|
-
params: [
|
|
1578
|
+
params: [ue]
|
|
1505
1579
|
}).then(async () => {
|
|
1506
|
-
if (await this.getChainId() ===
|
|
1507
|
-
|
|
1580
|
+
if (await this.getChainId() === d)
|
|
1581
|
+
u.emitter.emit("change", { chainId: d });
|
|
1508
1582
|
else
|
|
1509
|
-
throw new
|
|
1583
|
+
throw new F(new Error("User rejected switch after adding network."));
|
|
1510
1584
|
}),
|
|
1511
|
-
|
|
1585
|
+
R
|
|
1512
1586
|
]), x;
|
|
1513
|
-
} catch (
|
|
1514
|
-
throw new
|
|
1587
|
+
} catch (_) {
|
|
1588
|
+
throw new F(_);
|
|
1515
1589
|
}
|
|
1516
|
-
throw I.code ===
|
|
1590
|
+
throw I.code === F.code ? new F(I) : new Ke(I);
|
|
1517
1591
|
}
|
|
1518
1592
|
},
|
|
1519
|
-
async onAccountsChanged(
|
|
1520
|
-
var
|
|
1521
|
-
if (
|
|
1593
|
+
async onAccountsChanged(s) {
|
|
1594
|
+
var d;
|
|
1595
|
+
if (s.length === 0)
|
|
1522
1596
|
this.onDisconnect();
|
|
1523
|
-
else if (
|
|
1524
|
-
const
|
|
1525
|
-
this.onConnect({ chainId:
|
|
1597
|
+
else if (u.emitter.listenerCount("connect")) {
|
|
1598
|
+
const v = (await this.getChainId()).toString();
|
|
1599
|
+
this.onConnect({ chainId: v }), o && await ((d = u.storage) == null ? void 0 : d.removeItem(`${this.id}.disconnected`));
|
|
1526
1600
|
} else
|
|
1527
|
-
|
|
1528
|
-
accounts:
|
|
1601
|
+
u.emitter.emit("change", {
|
|
1602
|
+
accounts: s.map((v) => oe(v))
|
|
1529
1603
|
});
|
|
1530
1604
|
},
|
|
1531
|
-
onChainChanged(
|
|
1532
|
-
const
|
|
1533
|
-
|
|
1605
|
+
onChainChanged(s) {
|
|
1606
|
+
const d = Number(s);
|
|
1607
|
+
u.emitter.emit("change", { chainId: d });
|
|
1534
1608
|
},
|
|
1535
|
-
async onConnect(
|
|
1536
|
-
const
|
|
1537
|
-
if (
|
|
1609
|
+
async onConnect(s) {
|
|
1610
|
+
const d = await this.getAccounts();
|
|
1611
|
+
if (d.length === 0)
|
|
1538
1612
|
return;
|
|
1539
|
-
const
|
|
1540
|
-
|
|
1613
|
+
const v = Number(s.chainId);
|
|
1614
|
+
u.emitter.emit("connect", { accounts: d, chainId: v });
|
|
1541
1615
|
const x = await this.getProvider();
|
|
1542
|
-
x && (g && (x.removeListener("connect", g), g = void 0),
|
|
1616
|
+
x && (g && (x.removeListener("connect", g), g = void 0), f || (f = this.onAccountsChanged.bind(this), x.on("accountsChanged", f)), p || (p = this.onChainChanged.bind(this), x.on("chainChanged", p)), y || (y = this.onDisconnect.bind(this), x.on("disconnect", y)));
|
|
1543
1617
|
},
|
|
1544
|
-
async onDisconnect(
|
|
1545
|
-
const
|
|
1546
|
-
|
|
1618
|
+
async onDisconnect(s) {
|
|
1619
|
+
const d = await this.getProvider();
|
|
1620
|
+
s && s.code === 1013 && d && (await this.getAccounts()).length || (u.emitter.emit("disconnect"), d && (p && (d.removeListener("chainChanged", p), p = void 0), y && (d.removeListener("disconnect", y), y = void 0), g || (g = this.onConnect.bind(this), d.on("connect", g))));
|
|
1547
1621
|
}
|
|
1548
1622
|
});
|
|
1549
1623
|
}
|
|
1550
|
-
const
|
|
1624
|
+
const pt = {
|
|
1551
1625
|
coinbaseWallet: {
|
|
1552
1626
|
id: "coinbaseWallet",
|
|
1553
1627
|
name: "Coinbase Wallet",
|
|
@@ -1562,7 +1636,7 @@ const ht = {
|
|
|
1562
1636
|
return se(t, (o) => {
|
|
1563
1637
|
if (!o.isMetaMask || o.isBraveWallet && !o._events && !o._state)
|
|
1564
1638
|
return !1;
|
|
1565
|
-
const
|
|
1639
|
+
const i = [
|
|
1566
1640
|
"isApexWallet",
|
|
1567
1641
|
"isAvalanche",
|
|
1568
1642
|
"isBitKeep",
|
|
@@ -1582,8 +1656,8 @@ const ht = {
|
|
|
1582
1656
|
"isUniswapWallet",
|
|
1583
1657
|
"isZerion"
|
|
1584
1658
|
];
|
|
1585
|
-
for (const
|
|
1586
|
-
if (o[
|
|
1659
|
+
for (const l of i)
|
|
1660
|
+
if (o[l])
|
|
1587
1661
|
return !1;
|
|
1588
1662
|
return !0;
|
|
1589
1663
|
});
|
|
@@ -1593,35 +1667,35 @@ const ht = {
|
|
|
1593
1667
|
id: "phantom",
|
|
1594
1668
|
name: "Phantom",
|
|
1595
1669
|
provider(t) {
|
|
1596
|
-
var o,
|
|
1597
|
-
return (o = t == null ? void 0 : t.phantom) != null && o.ethereum ? (
|
|
1670
|
+
var o, i;
|
|
1671
|
+
return (o = t == null ? void 0 : t.phantom) != null && o.ethereum ? (i = t.phantom) == null ? void 0 : i.ethereum : se(t, "isPhantom");
|
|
1598
1672
|
}
|
|
1599
1673
|
}
|
|
1600
1674
|
};
|
|
1601
1675
|
function se(t, o) {
|
|
1602
|
-
function
|
|
1603
|
-
return typeof o == "function" ? o(
|
|
1676
|
+
function i(f) {
|
|
1677
|
+
return typeof o == "function" ? o(f) : typeof o == "string" ? f[o] : !0;
|
|
1604
1678
|
}
|
|
1605
|
-
const
|
|
1606
|
-
if (
|
|
1607
|
-
return
|
|
1608
|
-
if (
|
|
1609
|
-
return
|
|
1679
|
+
const l = t.ethereum;
|
|
1680
|
+
if (l != null && l.providers)
|
|
1681
|
+
return l.providers.find((f) => i(f));
|
|
1682
|
+
if (l && i(l))
|
|
1683
|
+
return l;
|
|
1610
1684
|
}
|
|
1611
|
-
const
|
|
1612
|
-
chains: [
|
|
1613
|
-
connectors: [
|
|
1685
|
+
const gt = new qr(), vt = Br({
|
|
1686
|
+
chains: [je],
|
|
1687
|
+
connectors: [Ce()],
|
|
1614
1688
|
transports: {
|
|
1615
|
-
[
|
|
1689
|
+
[je.id]: Nr()
|
|
1616
1690
|
}
|
|
1617
1691
|
});
|
|
1618
|
-
function
|
|
1619
|
-
return /* @__PURE__ */ r.jsx(Yr, { config:
|
|
1692
|
+
function jt({ children: t }) {
|
|
1693
|
+
return /* @__PURE__ */ r.jsx(Yr, { config: vt, children: /* @__PURE__ */ r.jsx(Vr, { client: gt, children: t }) });
|
|
1620
1694
|
}
|
|
1621
1695
|
export {
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1696
|
+
wt as SwarmConnectButton,
|
|
1697
|
+
ut as SwarmConnectModal,
|
|
1698
|
+
jt as SwarmConnectProvider,
|
|
1625
1699
|
Xr as useBeeNode,
|
|
1626
1700
|
Qr as usePostageStamps,
|
|
1627
1701
|
Zr as useSwarmConnect
|