@ffaerber/swarm-connect 0.4.0 → 0.5.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 +38 -18
- package/dist/components/SwarmConnectButton.d.ts +1 -1
- package/dist/components/SwarmConnectModal.d.ts +5 -4
- package/dist/components/steps.d.ts +1 -2
- package/dist/constants.d.ts +6 -3
- package/dist/hooks/useBeeNode.d.ts +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/swarm-connect.js +804 -775
- package/dist/swarm-connect.umd.cjs +12 -12
- package/dist/types.d.ts +24 -7
- package/package.json +1 -1
package/dist/swarm-connect.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { useAccount as
|
|
3
|
-
import { erc20Abi as
|
|
4
|
-
import { QueryClient as
|
|
5
|
-
var
|
|
1
|
+
import pt, { useState as F, useCallback as ce, useEffect as Q, useRef as Jt } from "react";
|
|
2
|
+
import { useAccount as we, useBalance as vt, useConnect as Xt, useDisconnect as gt, useSwitchChain as Qt, useSendTransaction as en, useWriteContract as tn, useWaitForTransactionReceipt as at, useReadContract as nn, createConfig as rn, http as an, WagmiProvider as on } from "wagmi";
|
|
3
|
+
import { erc20Abi as ot, parseEther as sn, parseUnits as cn, getAddress as me, SwitchChainError as it, numberToHex as st, UserRejectedRequestError as U, withRetry as ln, withTimeout as dn, ResourceUnavailableRpcError as Fe } from "viem";
|
|
4
|
+
import { QueryClient as un, QueryClientProvider as fn } from "@tanstack/react-query";
|
|
5
|
+
var Pe = { exports: {} }, ie = {};
|
|
6
6
|
/**
|
|
7
7
|
* @license React
|
|
8
8
|
* react-jsx-runtime.production.min.js
|
|
@@ -12,21 +12,21 @@ var Te = { exports: {} }, re = {};
|
|
|
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
|
|
16
|
-
function
|
|
17
|
-
if (
|
|
18
|
-
|
|
19
|
-
var n =
|
|
20
|
-
function p
|
|
21
|
-
var
|
|
22
|
-
o !== void 0 && (g = "" + o),
|
|
23
|
-
for (
|
|
24
|
-
if (
|
|
25
|
-
return { $$typeof: r, type:
|
|
15
|
+
var ct;
|
|
16
|
+
function hn() {
|
|
17
|
+
if (ct) return ie;
|
|
18
|
+
ct = 1;
|
|
19
|
+
var n = pt, r = Symbol.for("react.element"), a = Symbol.for("react.fragment"), i = Object.prototype.hasOwnProperty, s = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, d = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
20
|
+
function h(p, u, o) {
|
|
21
|
+
var l, v = {}, g = null, b = null;
|
|
22
|
+
o !== void 0 && (g = "" + o), u.key !== void 0 && (g = "" + u.key), u.ref !== void 0 && (b = u.ref);
|
|
23
|
+
for (l in u) i.call(u, l) && !d.hasOwnProperty(l) && (v[l] = u[l]);
|
|
24
|
+
if (p && p.defaultProps) for (l in u = p.defaultProps, u) v[l] === void 0 && (v[l] = u[l]);
|
|
25
|
+
return { $$typeof: r, type: p, key: g, ref: b, props: v, _owner: s.current };
|
|
26
26
|
}
|
|
27
|
-
return
|
|
27
|
+
return ie.Fragment = a, ie.jsx = h, ie.jsxs = h, ie;
|
|
28
28
|
}
|
|
29
|
-
var
|
|
29
|
+
var se = {};
|
|
30
30
|
/**
|
|
31
31
|
* @license React
|
|
32
32
|
* react-jsx-runtime.development.js
|
|
@@ -36,14 +36,14 @@ var ae = {};
|
|
|
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
|
|
40
|
-
function
|
|
41
|
-
return
|
|
42
|
-
var n =
|
|
43
|
-
function
|
|
39
|
+
var lt;
|
|
40
|
+
function pn() {
|
|
41
|
+
return lt || (lt = 1, process.env.NODE_ENV !== "production" && function() {
|
|
42
|
+
var n = pt, r = Symbol.for("react.element"), a = Symbol.for("react.portal"), i = Symbol.for("react.fragment"), s = Symbol.for("react.strict_mode"), d = Symbol.for("react.profiler"), h = Symbol.for("react.provider"), p = Symbol.for("react.context"), u = Symbol.for("react.forward_ref"), o = Symbol.for("react.suspense"), l = Symbol.for("react.suspense_list"), v = Symbol.for("react.memo"), g = Symbol.for("react.lazy"), b = Symbol.for("react.offscreen"), _ = Symbol.iterator, E = "@@iterator";
|
|
43
|
+
function O(e) {
|
|
44
44
|
if (e === null || typeof e != "object")
|
|
45
45
|
return null;
|
|
46
|
-
var c =
|
|
46
|
+
var c = _ && e[_] || e[E];
|
|
47
47
|
return typeof c == "function" ? c : null;
|
|
48
48
|
}
|
|
49
49
|
var S = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
@@ -58,32 +58,32 @@ function vn() {
|
|
|
58
58
|
{
|
|
59
59
|
var m = S.ReactDebugCurrentFrame, j = m.getStackAddendum();
|
|
60
60
|
j !== "" && (c += "%s", f = f.concat([j]));
|
|
61
|
-
var
|
|
61
|
+
var C = f.map(function(y) {
|
|
62
62
|
return String(y);
|
|
63
63
|
});
|
|
64
|
-
|
|
64
|
+
C.unshift("Warning: " + c), Function.prototype.apply.call(console[e], console, C);
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
|
-
var
|
|
68
|
-
|
|
69
|
-
function
|
|
70
|
-
return !!(typeof e == "string" || typeof e == "function" || e ===
|
|
67
|
+
var R = !1, k = !1, z = !1, Y = !1, Z = !1, W;
|
|
68
|
+
W = Symbol.for("react.module.reference");
|
|
69
|
+
function te(e) {
|
|
70
|
+
return !!(typeof e == "string" || typeof e == "function" || e === i || e === d || Z || e === s || e === o || e === l || Y || e === b || R || k || z || typeof e == "object" && e !== null && (e.$$typeof === g || e.$$typeof === v || e.$$typeof === h || e.$$typeof === p || 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.
|
|
74
|
-
e.$$typeof ===
|
|
74
|
+
e.$$typeof === W || e.getModuleId !== void 0));
|
|
75
75
|
}
|
|
76
|
-
function
|
|
76
|
+
function ne(e, c, f) {
|
|
77
77
|
var m = e.displayName;
|
|
78
78
|
if (m)
|
|
79
79
|
return m;
|
|
80
80
|
var j = c.displayName || c.name || "";
|
|
81
81
|
return j !== "" ? f + "(" + j + ")" : f;
|
|
82
82
|
}
|
|
83
|
-
function
|
|
83
|
+
function re(e) {
|
|
84
84
|
return e.displayName || "Context";
|
|
85
85
|
}
|
|
86
|
-
function
|
|
86
|
+
function B(e) {
|
|
87
87
|
if (e == null)
|
|
88
88
|
return null;
|
|
89
89
|
if (typeof e.tag == "number" && w("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 vn() {
|
|
|
91
91
|
if (typeof e == "string")
|
|
92
92
|
return e;
|
|
93
93
|
switch (e) {
|
|
94
|
-
case
|
|
94
|
+
case i:
|
|
95
95
|
return "Fragment";
|
|
96
96
|
case a:
|
|
97
97
|
return "Portal";
|
|
98
|
-
case
|
|
98
|
+
case d:
|
|
99
99
|
return "Profiler";
|
|
100
|
-
case
|
|
100
|
+
case s:
|
|
101
101
|
return "StrictMode";
|
|
102
102
|
case o:
|
|
103
103
|
return "Suspense";
|
|
104
|
-
case
|
|
104
|
+
case l:
|
|
105
105
|
return "SuspenseList";
|
|
106
106
|
}
|
|
107
107
|
if (typeof e == "object")
|
|
108
108
|
switch (e.$$typeof) {
|
|
109
|
-
case h:
|
|
110
|
-
var c = e;
|
|
111
|
-
return de(c) + ".Consumer";
|
|
112
109
|
case p:
|
|
110
|
+
var c = e;
|
|
111
|
+
return re(c) + ".Consumer";
|
|
112
|
+
case h:
|
|
113
113
|
var f = e;
|
|
114
|
-
return
|
|
115
|
-
case
|
|
116
|
-
return
|
|
114
|
+
return re(f._context) + ".Provider";
|
|
115
|
+
case u:
|
|
116
|
+
return ne(e, e.render, "ForwardRef");
|
|
117
117
|
case v:
|
|
118
118
|
var m = e.displayName || null;
|
|
119
|
-
return m !== null ? m :
|
|
119
|
+
return m !== null ? m : B(e.type) || "Memo";
|
|
120
120
|
case g: {
|
|
121
|
-
var j = e,
|
|
121
|
+
var j = e, C = j._payload, y = j._init;
|
|
122
122
|
try {
|
|
123
|
-
return
|
|
123
|
+
return B(y(C));
|
|
124
124
|
} catch {
|
|
125
125
|
return null;
|
|
126
126
|
}
|
|
@@ -128,18 +128,18 @@ function vn() {
|
|
|
128
128
|
}
|
|
129
129
|
return null;
|
|
130
130
|
}
|
|
131
|
-
var
|
|
132
|
-
function
|
|
131
|
+
var M = Object.assign, N = 0, fe, D, ae, Le, We, Be, Me;
|
|
132
|
+
function Ne() {
|
|
133
133
|
}
|
|
134
|
-
|
|
135
|
-
function
|
|
134
|
+
Ne.__reactDisabledLog = !0;
|
|
135
|
+
function St() {
|
|
136
136
|
{
|
|
137
|
-
if (
|
|
138
|
-
|
|
137
|
+
if (N === 0) {
|
|
138
|
+
fe = console.log, D = console.info, ae = console.warn, Le = console.error, We = console.group, Be = console.groupCollapsed, Me = console.groupEnd;
|
|
139
139
|
var e = {
|
|
140
140
|
configurable: !0,
|
|
141
141
|
enumerable: !0,
|
|
142
|
-
value:
|
|
142
|
+
value: Ne,
|
|
143
143
|
writable: !0
|
|
144
144
|
};
|
|
145
145
|
Object.defineProperties(console, {
|
|
@@ -152,77 +152,77 @@ function vn() {
|
|
|
152
152
|
groupEnd: e
|
|
153
153
|
});
|
|
154
154
|
}
|
|
155
|
-
|
|
155
|
+
N++;
|
|
156
156
|
}
|
|
157
157
|
}
|
|
158
|
-
function
|
|
158
|
+
function Ct() {
|
|
159
159
|
{
|
|
160
|
-
if (
|
|
160
|
+
if (N--, N === 0) {
|
|
161
161
|
var e = {
|
|
162
162
|
configurable: !0,
|
|
163
163
|
enumerable: !0,
|
|
164
164
|
writable: !0
|
|
165
165
|
};
|
|
166
166
|
Object.defineProperties(console, {
|
|
167
|
-
log:
|
|
168
|
-
value:
|
|
167
|
+
log: M({}, e, {
|
|
168
|
+
value: fe
|
|
169
|
+
}),
|
|
170
|
+
info: M({}, e, {
|
|
171
|
+
value: D
|
|
172
|
+
}),
|
|
173
|
+
warn: M({}, e, {
|
|
174
|
+
value: ae
|
|
169
175
|
}),
|
|
170
|
-
|
|
176
|
+
error: M({}, e, {
|
|
171
177
|
value: Le
|
|
172
178
|
}),
|
|
173
|
-
|
|
179
|
+
group: M({}, e, {
|
|
174
180
|
value: We
|
|
175
181
|
}),
|
|
176
|
-
|
|
182
|
+
groupCollapsed: M({}, e, {
|
|
177
183
|
value: Be
|
|
178
184
|
}),
|
|
179
|
-
|
|
185
|
+
groupEnd: M({}, e, {
|
|
180
186
|
value: Me
|
|
181
|
-
}),
|
|
182
|
-
groupCollapsed: z({}, e, {
|
|
183
|
-
value: Ne
|
|
184
|
-
}),
|
|
185
|
-
groupEnd: z({}, e, {
|
|
186
|
-
value: Ue
|
|
187
187
|
})
|
|
188
188
|
});
|
|
189
189
|
}
|
|
190
|
-
|
|
190
|
+
N < 0 && w("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
191
191
|
}
|
|
192
192
|
}
|
|
193
|
-
var
|
|
194
|
-
function
|
|
193
|
+
var je = S.ReactCurrentDispatcher, Se;
|
|
194
|
+
function he(e, c, f) {
|
|
195
195
|
{
|
|
196
|
-
if (
|
|
196
|
+
if (Se === void 0)
|
|
197
197
|
try {
|
|
198
198
|
throw Error();
|
|
199
199
|
} catch (j) {
|
|
200
200
|
var m = j.stack.trim().match(/\n( *(at )?)/);
|
|
201
|
-
|
|
201
|
+
Se = m && m[1] || "";
|
|
202
202
|
}
|
|
203
203
|
return `
|
|
204
|
-
` +
|
|
204
|
+
` + Se + e;
|
|
205
205
|
}
|
|
206
206
|
}
|
|
207
|
-
var
|
|
207
|
+
var Ce = !1, pe;
|
|
208
208
|
{
|
|
209
|
-
var
|
|
210
|
-
|
|
209
|
+
var Rt = typeof WeakMap == "function" ? WeakMap : Map;
|
|
210
|
+
pe = new Rt();
|
|
211
211
|
}
|
|
212
|
-
function
|
|
213
|
-
if (!e ||
|
|
212
|
+
function Ue(e, c) {
|
|
213
|
+
if (!e || Ce)
|
|
214
214
|
return "";
|
|
215
215
|
{
|
|
216
|
-
var f =
|
|
216
|
+
var f = pe.get(e);
|
|
217
217
|
if (f !== void 0)
|
|
218
218
|
return f;
|
|
219
219
|
}
|
|
220
220
|
var m;
|
|
221
|
-
|
|
221
|
+
Ce = !0;
|
|
222
222
|
var j = Error.prepareStackTrace;
|
|
223
223
|
Error.prepareStackTrace = void 0;
|
|
224
|
-
var
|
|
225
|
-
|
|
224
|
+
var C;
|
|
225
|
+
C = je.current, je.current = null, St();
|
|
226
226
|
try {
|
|
227
227
|
if (c) {
|
|
228
228
|
var y = function() {
|
|
@@ -258,144 +258,144 @@ function vn() {
|
|
|
258
258
|
} catch ($) {
|
|
259
259
|
if ($ && m && typeof $.stack == "string") {
|
|
260
260
|
for (var x = $.stack.split(`
|
|
261
|
-
`),
|
|
262
|
-
`),
|
|
261
|
+
`), A = m.stack.split(`
|
|
262
|
+
`), T = x.length - 1, P = A.length - 1; T >= 1 && P >= 0 && x[T] !== A[P]; )
|
|
263
263
|
P--;
|
|
264
|
-
for (;
|
|
265
|
-
if (x[
|
|
266
|
-
if (
|
|
264
|
+
for (; T >= 1 && P >= 0; T--, P--)
|
|
265
|
+
if (x[T] !== A[P]) {
|
|
266
|
+
if (T !== 1 || P !== 1)
|
|
267
267
|
do
|
|
268
|
-
if (
|
|
268
|
+
if (T--, P--, P < 0 || x[T] !== A[P]) {
|
|
269
269
|
var L = `
|
|
270
|
-
` + x[
|
|
271
|
-
return e.displayName && L.includes("<anonymous>") && (L = L.replace("<anonymous>", e.displayName)), typeof e == "function" &&
|
|
270
|
+
` + x[T].replace(" at new ", " at ");
|
|
271
|
+
return e.displayName && L.includes("<anonymous>") && (L = L.replace("<anonymous>", e.displayName)), typeof e == "function" && pe.set(e, L), L;
|
|
272
272
|
}
|
|
273
|
-
while (
|
|
273
|
+
while (T >= 1 && P >= 0);
|
|
274
274
|
break;
|
|
275
275
|
}
|
|
276
276
|
}
|
|
277
277
|
} finally {
|
|
278
|
-
|
|
278
|
+
Ce = !1, je.current = C, Ct(), Error.prepareStackTrace = j;
|
|
279
279
|
}
|
|
280
|
-
var
|
|
281
|
-
return typeof e == "function" &&
|
|
280
|
+
var J = e ? e.displayName || e.name : "", V = J ? he(J) : "";
|
|
281
|
+
return typeof e == "function" && pe.set(e, V), V;
|
|
282
282
|
}
|
|
283
|
-
function
|
|
284
|
-
return
|
|
283
|
+
function _t(e, c, f) {
|
|
284
|
+
return Ue(e, !1);
|
|
285
285
|
}
|
|
286
|
-
function
|
|
286
|
+
function Et(e) {
|
|
287
287
|
var c = e.prototype;
|
|
288
288
|
return !!(c && c.isReactComponent);
|
|
289
289
|
}
|
|
290
|
-
function
|
|
290
|
+
function ve(e, c, f) {
|
|
291
291
|
if (e == null)
|
|
292
292
|
return "";
|
|
293
293
|
if (typeof e == "function")
|
|
294
|
-
return
|
|
294
|
+
return Ue(e, Et(e));
|
|
295
295
|
if (typeof e == "string")
|
|
296
|
-
return
|
|
296
|
+
return he(e);
|
|
297
297
|
switch (e) {
|
|
298
298
|
case o:
|
|
299
|
-
return
|
|
300
|
-
case
|
|
301
|
-
return
|
|
299
|
+
return he("Suspense");
|
|
300
|
+
case l:
|
|
301
|
+
return he("SuspenseList");
|
|
302
302
|
}
|
|
303
303
|
if (typeof e == "object")
|
|
304
304
|
switch (e.$$typeof) {
|
|
305
|
-
case
|
|
306
|
-
return
|
|
305
|
+
case u:
|
|
306
|
+
return _t(e.render);
|
|
307
307
|
case v:
|
|
308
|
-
return
|
|
308
|
+
return ve(e.type, c, f);
|
|
309
309
|
case g: {
|
|
310
|
-
var m = e, j = m._payload,
|
|
310
|
+
var m = e, j = m._payload, C = m._init;
|
|
311
311
|
try {
|
|
312
|
-
return
|
|
312
|
+
return ve(C(j), c, f);
|
|
313
313
|
} catch {
|
|
314
314
|
}
|
|
315
315
|
}
|
|
316
316
|
}
|
|
317
317
|
return "";
|
|
318
318
|
}
|
|
319
|
-
var
|
|
320
|
-
function
|
|
319
|
+
var oe = Object.prototype.hasOwnProperty, qe = {}, Ye = S.ReactDebugCurrentFrame;
|
|
320
|
+
function ge(e) {
|
|
321
321
|
if (e) {
|
|
322
|
-
var c = e._owner, f =
|
|
323
|
-
|
|
322
|
+
var c = e._owner, f = ve(e.type, e._source, c ? c.type : null);
|
|
323
|
+
Ye.setExtraStackFrame(f);
|
|
324
324
|
} else
|
|
325
|
-
|
|
325
|
+
Ye.setExtraStackFrame(null);
|
|
326
326
|
}
|
|
327
|
-
function
|
|
327
|
+
function It(e, c, f, m, j) {
|
|
328
328
|
{
|
|
329
|
-
var
|
|
329
|
+
var C = Function.call.bind(oe);
|
|
330
330
|
for (var y in e)
|
|
331
|
-
if (
|
|
331
|
+
if (C(e, y)) {
|
|
332
332
|
var x = void 0;
|
|
333
333
|
try {
|
|
334
334
|
if (typeof e[y] != "function") {
|
|
335
|
-
var
|
|
336
|
-
throw
|
|
335
|
+
var A = Error((m || "React class") + ": " + f + " type `" + y + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[y] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
336
|
+
throw A.name = "Invariant Violation", A;
|
|
337
337
|
}
|
|
338
338
|
x = e[y](c, y, m, f, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
339
|
-
} catch (
|
|
340
|
-
x =
|
|
339
|
+
} catch (T) {
|
|
340
|
+
x = T;
|
|
341
341
|
}
|
|
342
|
-
x && !(x instanceof Error) && (
|
|
342
|
+
x && !(x instanceof Error) && (ge(j), w("%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).", m || "React class", f, y, typeof x), ge(null)), x instanceof Error && !(x.message in qe) && (qe[x.message] = !0, ge(j), w("Failed %s type: %s", f, x.message), ge(null));
|
|
343
343
|
}
|
|
344
344
|
}
|
|
345
345
|
}
|
|
346
|
-
var
|
|
347
|
-
function
|
|
348
|
-
return
|
|
346
|
+
var Tt = Array.isArray;
|
|
347
|
+
function Re(e) {
|
|
348
|
+
return Tt(e);
|
|
349
349
|
}
|
|
350
|
-
function
|
|
350
|
+
function Ft(e) {
|
|
351
351
|
{
|
|
352
352
|
var c = typeof Symbol == "function" && Symbol.toStringTag, f = c && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
353
353
|
return f;
|
|
354
354
|
}
|
|
355
355
|
}
|
|
356
|
-
function
|
|
356
|
+
function Pt(e) {
|
|
357
357
|
try {
|
|
358
|
-
return
|
|
358
|
+
return Ge(e), !1;
|
|
359
359
|
} catch {
|
|
360
360
|
return !0;
|
|
361
361
|
}
|
|
362
362
|
}
|
|
363
|
-
function
|
|
363
|
+
function Ge(e) {
|
|
364
364
|
return "" + e;
|
|
365
365
|
}
|
|
366
|
-
function
|
|
367
|
-
if (
|
|
368
|
-
return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",
|
|
366
|
+
function He(e) {
|
|
367
|
+
if (Pt(e))
|
|
368
|
+
return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Ft(e)), Ge(e);
|
|
369
369
|
}
|
|
370
|
-
var
|
|
370
|
+
var Ve = S.ReactCurrentOwner, Dt = {
|
|
371
371
|
key: !0,
|
|
372
372
|
ref: !0,
|
|
373
373
|
__self: !0,
|
|
374
374
|
__source: !0
|
|
375
|
-
},
|
|
375
|
+
}, Ze, Ke;
|
|
376
376
|
function Ot(e) {
|
|
377
|
-
if (
|
|
377
|
+
if (oe.call(e, "ref")) {
|
|
378
378
|
var c = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
379
379
|
if (c && c.isReactWarning)
|
|
380
380
|
return !1;
|
|
381
381
|
}
|
|
382
382
|
return e.ref !== void 0;
|
|
383
383
|
}
|
|
384
|
-
function
|
|
385
|
-
if (
|
|
384
|
+
function zt(e) {
|
|
385
|
+
if (oe.call(e, "key")) {
|
|
386
386
|
var c = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
387
387
|
if (c && c.isReactWarning)
|
|
388
388
|
return !1;
|
|
389
389
|
}
|
|
390
390
|
return e.key !== void 0;
|
|
391
391
|
}
|
|
392
|
-
function
|
|
393
|
-
typeof e.ref == "string" &&
|
|
392
|
+
function At(e, c) {
|
|
393
|
+
typeof e.ref == "string" && Ve.current;
|
|
394
394
|
}
|
|
395
|
-
function
|
|
395
|
+
function $t(e, c) {
|
|
396
396
|
{
|
|
397
397
|
var f = function() {
|
|
398
|
-
|
|
398
|
+
Ze || (Ze = !0, w("%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)", c));
|
|
399
399
|
};
|
|
400
400
|
f.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
401
401
|
get: f,
|
|
@@ -403,10 +403,10 @@ function vn() {
|
|
|
403
403
|
});
|
|
404
404
|
}
|
|
405
405
|
}
|
|
406
|
-
function
|
|
406
|
+
function Lt(e, c) {
|
|
407
407
|
{
|
|
408
408
|
var f = function() {
|
|
409
|
-
|
|
409
|
+
Ke || (Ke = !0, w("%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)", c));
|
|
410
410
|
};
|
|
411
411
|
f.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
412
412
|
get: f,
|
|
@@ -414,7 +414,7 @@ function vn() {
|
|
|
414
414
|
});
|
|
415
415
|
}
|
|
416
416
|
}
|
|
417
|
-
var
|
|
417
|
+
var Wt = function(e, c, f, m, j, C, y) {
|
|
418
418
|
var x = {
|
|
419
419
|
// This tag allows us to uniquely identify this as a React Element
|
|
420
420
|
$$typeof: r,
|
|
@@ -424,7 +424,7 @@ function vn() {
|
|
|
424
424
|
ref: f,
|
|
425
425
|
props: y,
|
|
426
426
|
// Record the component responsible for creating this element.
|
|
427
|
-
_owner:
|
|
427
|
+
_owner: C
|
|
428
428
|
};
|
|
429
429
|
return x._store = {}, Object.defineProperty(x._store, "validated", {
|
|
430
430
|
configurable: !1,
|
|
@@ -443,41 +443,41 @@ function vn() {
|
|
|
443
443
|
value: j
|
|
444
444
|
}), Object.freeze && (Object.freeze(x.props), Object.freeze(x)), x;
|
|
445
445
|
};
|
|
446
|
-
function
|
|
446
|
+
function Bt(e, c, f, m, j) {
|
|
447
447
|
{
|
|
448
|
-
var
|
|
449
|
-
f !== void 0 && (
|
|
450
|
-
for (
|
|
451
|
-
|
|
448
|
+
var C, y = {}, x = null, A = null;
|
|
449
|
+
f !== void 0 && (He(f), x = "" + f), zt(c) && (He(c.key), x = "" + c.key), Ot(c) && (A = c.ref, At(c, j));
|
|
450
|
+
for (C in c)
|
|
451
|
+
oe.call(c, C) && !Dt.hasOwnProperty(C) && (y[C] = c[C]);
|
|
452
452
|
if (e && e.defaultProps) {
|
|
453
|
-
var
|
|
454
|
-
for (
|
|
455
|
-
y[
|
|
453
|
+
var T = e.defaultProps;
|
|
454
|
+
for (C in T)
|
|
455
|
+
y[C] === void 0 && (y[C] = T[C]);
|
|
456
456
|
}
|
|
457
|
-
if (x ||
|
|
457
|
+
if (x || A) {
|
|
458
458
|
var P = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
459
|
-
x &&
|
|
459
|
+
x && $t(y, P), A && Lt(y, P);
|
|
460
460
|
}
|
|
461
|
-
return
|
|
461
|
+
return Wt(e, x, A, j, m, Ve.current, y);
|
|
462
462
|
}
|
|
463
463
|
}
|
|
464
|
-
var
|
|
465
|
-
function
|
|
464
|
+
var _e = S.ReactCurrentOwner, Je = S.ReactDebugCurrentFrame;
|
|
465
|
+
function K(e) {
|
|
466
466
|
if (e) {
|
|
467
|
-
var c = e._owner, f =
|
|
468
|
-
|
|
467
|
+
var c = e._owner, f = ve(e.type, e._source, c ? c.type : null);
|
|
468
|
+
Je.setExtraStackFrame(f);
|
|
469
469
|
} else
|
|
470
|
-
|
|
470
|
+
Je.setExtraStackFrame(null);
|
|
471
471
|
}
|
|
472
|
-
var
|
|
473
|
-
|
|
474
|
-
function
|
|
472
|
+
var Ee;
|
|
473
|
+
Ee = !1;
|
|
474
|
+
function Ie(e) {
|
|
475
475
|
return typeof e == "object" && e !== null && e.$$typeof === r;
|
|
476
476
|
}
|
|
477
|
-
function
|
|
477
|
+
function Xe() {
|
|
478
478
|
{
|
|
479
|
-
if (
|
|
480
|
-
var e =
|
|
479
|
+
if (_e.current) {
|
|
480
|
+
var e = B(_e.current.type);
|
|
481
481
|
if (e)
|
|
482
482
|
return `
|
|
483
483
|
|
|
@@ -486,13 +486,13 @@ Check the render method of \`` + e + "`.";
|
|
|
486
486
|
return "";
|
|
487
487
|
}
|
|
488
488
|
}
|
|
489
|
-
function
|
|
489
|
+
function Mt(e) {
|
|
490
490
|
return "";
|
|
491
491
|
}
|
|
492
|
-
var
|
|
493
|
-
function
|
|
492
|
+
var Qe = {};
|
|
493
|
+
function Nt(e) {
|
|
494
494
|
{
|
|
495
|
-
var c =
|
|
495
|
+
var c = Xe();
|
|
496
496
|
if (!c) {
|
|
497
497
|
var f = typeof e == "string" ? e : e.displayName || e.name;
|
|
498
498
|
f && (c = `
|
|
@@ -502,39 +502,39 @@ Check the top-level render call using <` + f + ">.");
|
|
|
502
502
|
return c;
|
|
503
503
|
}
|
|
504
504
|
}
|
|
505
|
-
function
|
|
505
|
+
function et(e, c) {
|
|
506
506
|
{
|
|
507
507
|
if (!e._store || e._store.validated || e.key != null)
|
|
508
508
|
return;
|
|
509
509
|
e._store.validated = !0;
|
|
510
|
-
var f =
|
|
511
|
-
if (
|
|
510
|
+
var f = Nt(c);
|
|
511
|
+
if (Qe[f])
|
|
512
512
|
return;
|
|
513
|
-
|
|
513
|
+
Qe[f] = !0;
|
|
514
514
|
var m = "";
|
|
515
|
-
e && e._owner && e._owner !==
|
|
515
|
+
e && e._owner && e._owner !== _e.current && (m = " It was passed a child from " + B(e._owner.type) + "."), K(e), w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', f, m), K(null);
|
|
516
516
|
}
|
|
517
517
|
}
|
|
518
|
-
function
|
|
518
|
+
function tt(e, c) {
|
|
519
519
|
{
|
|
520
520
|
if (typeof e != "object")
|
|
521
521
|
return;
|
|
522
|
-
if (
|
|
522
|
+
if (Re(e))
|
|
523
523
|
for (var f = 0; f < e.length; f++) {
|
|
524
524
|
var m = e[f];
|
|
525
|
-
|
|
525
|
+
Ie(m) && et(m, c);
|
|
526
526
|
}
|
|
527
|
-
else if (
|
|
527
|
+
else if (Ie(e))
|
|
528
528
|
e._store && (e._store.validated = !0);
|
|
529
529
|
else if (e) {
|
|
530
|
-
var j =
|
|
530
|
+
var j = O(e);
|
|
531
531
|
if (typeof j == "function" && j !== e.entries)
|
|
532
|
-
for (var
|
|
533
|
-
|
|
532
|
+
for (var C = j.call(e), y; !(y = C.next()).done; )
|
|
533
|
+
Ie(y.value) && et(y.value, c);
|
|
534
534
|
}
|
|
535
535
|
}
|
|
536
536
|
}
|
|
537
|
-
function
|
|
537
|
+
function Ut(e) {
|
|
538
538
|
{
|
|
539
539
|
var c = e.type;
|
|
540
540
|
if (c == null || typeof c == "string")
|
|
@@ -542,18 +542,18 @@ Check the top-level render call using <` + f + ">.");
|
|
|
542
542
|
var f;
|
|
543
543
|
if (typeof c == "function")
|
|
544
544
|
f = c.propTypes;
|
|
545
|
-
else if (typeof c == "object" && (c.$$typeof ===
|
|
545
|
+
else if (typeof c == "object" && (c.$$typeof === u || // Note: Memo only checks outer props here.
|
|
546
546
|
// Inner props are checked in the reconciler.
|
|
547
547
|
c.$$typeof === v))
|
|
548
548
|
f = c.propTypes;
|
|
549
549
|
else
|
|
550
550
|
return;
|
|
551
551
|
if (f) {
|
|
552
|
-
var m =
|
|
553
|
-
|
|
554
|
-
} else if (c.PropTypes !== void 0 && !
|
|
555
|
-
|
|
556
|
-
var j =
|
|
552
|
+
var m = B(c);
|
|
553
|
+
It(f, e.props, "prop", m, e);
|
|
554
|
+
} else if (c.PropTypes !== void 0 && !Ee) {
|
|
555
|
+
Ee = !0;
|
|
556
|
+
var j = B(c);
|
|
557
557
|
w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", j || "Unknown");
|
|
558
558
|
}
|
|
559
559
|
typeof c.getDefaultProps == "function" && !c.getDefaultProps.isReactClassApproved && w("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
@@ -564,86 +564,90 @@ Check the top-level render call using <` + f + ">.");
|
|
|
564
564
|
for (var c = Object.keys(e.props), f = 0; f < c.length; f++) {
|
|
565
565
|
var m = c[f];
|
|
566
566
|
if (m !== "children" && m !== "key") {
|
|
567
|
-
|
|
567
|
+
K(e), w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", m), K(null);
|
|
568
568
|
break;
|
|
569
569
|
}
|
|
570
570
|
}
|
|
571
|
-
e.ref !== null && (
|
|
571
|
+
e.ref !== null && (K(e), w("Invalid attribute `ref` supplied to `React.Fragment`."), K(null));
|
|
572
572
|
}
|
|
573
573
|
}
|
|
574
|
-
var
|
|
575
|
-
function
|
|
574
|
+
var nt = {};
|
|
575
|
+
function rt(e, c, f, m, j, C) {
|
|
576
576
|
{
|
|
577
|
-
var y =
|
|
577
|
+
var y = te(e);
|
|
578
578
|
if (!y) {
|
|
579
579
|
var x = "";
|
|
580
580
|
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (x += " 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
|
|
582
|
-
|
|
583
|
-
var
|
|
584
|
-
e === null ?
|
|
581
|
+
var A = Mt();
|
|
582
|
+
A ? x += A : x += Xe();
|
|
583
|
+
var T;
|
|
584
|
+
e === null ? T = "null" : Re(e) ? T = "array" : e !== void 0 && e.$$typeof === r ? (T = "<" + (B(e.type) || "Unknown") + " />", x = " Did you accidentally export a JSX literal instead of a component?") : T = typeof e, w("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", T, x);
|
|
585
585
|
}
|
|
586
|
-
var P =
|
|
586
|
+
var P = Bt(e, c, f, j, C);
|
|
587
587
|
if (P == null)
|
|
588
588
|
return P;
|
|
589
589
|
if (y) {
|
|
590
590
|
var L = c.children;
|
|
591
591
|
if (L !== void 0)
|
|
592
592
|
if (m)
|
|
593
|
-
if (
|
|
594
|
-
for (var
|
|
595
|
-
|
|
593
|
+
if (Re(L)) {
|
|
594
|
+
for (var J = 0; J < L.length; J++)
|
|
595
|
+
tt(L[J], e);
|
|
596
596
|
Object.freeze && Object.freeze(L);
|
|
597
597
|
} else
|
|
598
598
|
w("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
|
+
tt(L, e);
|
|
601
601
|
}
|
|
602
|
-
if (
|
|
603
|
-
var
|
|
604
|
-
return
|
|
605
|
-
}),
|
|
606
|
-
if (!
|
|
607
|
-
var
|
|
602
|
+
if (oe.call(c, "key")) {
|
|
603
|
+
var V = B(e), $ = Object.keys(c).filter(function(Kt) {
|
|
604
|
+
return Kt !== "key";
|
|
605
|
+
}), Te = $.length > 0 ? "{key: someKey, " + $.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
606
|
+
if (!nt[V + Te]) {
|
|
607
|
+
var Zt = $.length > 0 ? "{" + $.join(": ..., ") + ": ...}" : "{}";
|
|
608
608
|
w(`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} />`, Te, V, Zt, V), nt[V + Te] = !0;
|
|
614
614
|
}
|
|
615
615
|
}
|
|
616
|
-
return e ===
|
|
616
|
+
return e === i ? qt(P) : Ut(P), P;
|
|
617
617
|
}
|
|
618
618
|
}
|
|
619
|
-
function
|
|
620
|
-
return
|
|
619
|
+
function Yt(e, c, f) {
|
|
620
|
+
return rt(e, c, f, !0);
|
|
621
621
|
}
|
|
622
|
-
function
|
|
623
|
-
return
|
|
622
|
+
function Gt(e, c, f) {
|
|
623
|
+
return rt(e, c, f, !1);
|
|
624
624
|
}
|
|
625
|
-
var
|
|
626
|
-
|
|
627
|
-
}()),
|
|
625
|
+
var Ht = Gt, Vt = Yt;
|
|
626
|
+
se.Fragment = i, se.jsx = Ht, se.jsxs = Vt;
|
|
627
|
+
}()), se;
|
|
628
628
|
}
|
|
629
|
-
process.env.NODE_ENV === "production" ?
|
|
630
|
-
var t =
|
|
631
|
-
const
|
|
632
|
-
|
|
633
|
-
|
|
629
|
+
process.env.NODE_ENV === "production" ? Pe.exports = hn() : Pe.exports = pn();
|
|
630
|
+
var t = Pe.exports;
|
|
631
|
+
const G = 100, de = "http://localhost:1633", mt = "swarm-connect:bee-api-url", dt = "0xdBF3Ea6F5beE45c02255B2c26a16F300502F68da", De = 16, vn = "0.1", gn = "0.5", xt = {
|
|
632
|
+
xdai: !0,
|
|
633
|
+
xbzz: !1,
|
|
634
|
+
postageStamp: !0
|
|
635
|
+
};
|
|
636
|
+
function mn(n = de) {
|
|
637
|
+
const [r, a] = F({
|
|
634
638
|
isRunning: !1,
|
|
635
639
|
isChecking: !1
|
|
636
|
-
}),
|
|
640
|
+
}), i = ce(async () => {
|
|
637
641
|
a({ isRunning: !1, isChecking: !0 });
|
|
638
642
|
try {
|
|
639
|
-
const
|
|
643
|
+
const d = await fetch(`${n}/health`, {
|
|
640
644
|
signal: AbortSignal.timeout(5e3)
|
|
641
645
|
});
|
|
642
|
-
if (
|
|
643
|
-
const
|
|
644
|
-
a({ isRunning: !0, isChecking: !1, version:
|
|
646
|
+
if (d.ok) {
|
|
647
|
+
const h = await d.json();
|
|
648
|
+
a({ isRunning: !0, isChecking: !1, version: h.version });
|
|
645
649
|
} else
|
|
646
|
-
a({ isRunning: !1, isChecking: !1, error: `Node returned HTTP ${
|
|
650
|
+
a({ isRunning: !1, isChecking: !1, error: `Node returned HTTP ${d.status}` });
|
|
647
651
|
} catch {
|
|
648
652
|
a({
|
|
649
653
|
isRunning: !1,
|
|
@@ -651,92 +655,94 @@ function yn(n = se) {
|
|
|
651
655
|
error: `Cannot reach Bee node at ${n}`
|
|
652
656
|
});
|
|
653
657
|
}
|
|
654
|
-
}, [n])
|
|
655
|
-
|
|
658
|
+
}, [n]), s = ce(() => {
|
|
659
|
+
a({ isRunning: !1, isChecking: !1 });
|
|
660
|
+
}, []);
|
|
661
|
+
return { ...r, check: i, disconnect: s };
|
|
656
662
|
}
|
|
657
|
-
function
|
|
658
|
-
const [r, a] =
|
|
659
|
-
|
|
663
|
+
function xn(n = de) {
|
|
664
|
+
const [r, a] = F([]), [i, s] = F(!1), [d, h] = F(), [p, u] = F(), [o, l] = F(!1), [v, g] = F(), b = ce(async () => {
|
|
665
|
+
s(!0), h(void 0);
|
|
660
666
|
try {
|
|
661
|
-
const
|
|
667
|
+
const E = await fetch(`${n}/stamps`, {
|
|
662
668
|
signal: AbortSignal.timeout(5e3)
|
|
663
669
|
});
|
|
664
|
-
if (
|
|
665
|
-
const
|
|
666
|
-
a(
|
|
670
|
+
if (E.ok) {
|
|
671
|
+
const O = await E.json();
|
|
672
|
+
a(O.stamps ?? []);
|
|
667
673
|
} else
|
|
668
|
-
|
|
674
|
+
h(`HTTP ${E.status}`);
|
|
669
675
|
} catch {
|
|
670
|
-
|
|
676
|
+
h("Could not fetch postage stamps");
|
|
671
677
|
} finally {
|
|
672
|
-
|
|
678
|
+
s(!1);
|
|
673
679
|
}
|
|
674
|
-
}, [n]),
|
|
675
|
-
|
|
680
|
+
}, [n]), _ = ce(async ({ amount: E, depth: O, label: S }) => {
|
|
681
|
+
l(!0), g(void 0);
|
|
676
682
|
try {
|
|
677
|
-
const w = S ? `?label=${encodeURIComponent(S)}` : "", I = await fetch(`${n}/stamps/${
|
|
683
|
+
const w = S ? `?label=${encodeURIComponent(S)}` : "", I = await fetch(`${n}/stamps/${E}/${O}${w}`, {
|
|
678
684
|
method: "POST",
|
|
679
685
|
signal: AbortSignal.timeout(24e4)
|
|
680
686
|
});
|
|
681
687
|
if (!I.ok) {
|
|
682
688
|
let k = `HTTP ${I.status}`;
|
|
683
689
|
try {
|
|
684
|
-
const
|
|
685
|
-
|
|
690
|
+
const z = await I.json();
|
|
691
|
+
z.message && (k = z.message);
|
|
686
692
|
} catch {
|
|
687
693
|
}
|
|
688
694
|
g(k);
|
|
689
695
|
return;
|
|
690
696
|
}
|
|
691
|
-
const
|
|
692
|
-
return
|
|
697
|
+
const R = await I.json();
|
|
698
|
+
return u(R.batchID), b(), R.batchID;
|
|
693
699
|
} catch {
|
|
694
700
|
g("Stamp purchase failed — is the node wallet funded with xDAI and xBZZ?");
|
|
695
701
|
return;
|
|
696
702
|
} finally {
|
|
697
|
-
|
|
703
|
+
l(!1);
|
|
698
704
|
}
|
|
699
705
|
}, [n, b]);
|
|
700
706
|
return {
|
|
701
707
|
stamps: r,
|
|
702
|
-
isLoading:
|
|
703
|
-
error:
|
|
708
|
+
isLoading: i,
|
|
709
|
+
error: d,
|
|
704
710
|
fetchStamps: b,
|
|
705
|
-
selectedStampId:
|
|
706
|
-
selectStamp:
|
|
707
|
-
createStamp:
|
|
711
|
+
selectedStampId: p,
|
|
712
|
+
selectStamp: u,
|
|
713
|
+
createStamp: _,
|
|
708
714
|
isCreating: o,
|
|
709
715
|
createError: v
|
|
710
716
|
};
|
|
711
717
|
}
|
|
712
|
-
function
|
|
713
|
-
const [r, a] =
|
|
718
|
+
function bt(n = de) {
|
|
719
|
+
const [r, a] = F({
|
|
714
720
|
isLoading: !1
|
|
715
|
-
}),
|
|
716
|
-
a((
|
|
721
|
+
}), i = ce(async () => {
|
|
722
|
+
a((s) => ({ ...s, isLoading: !0, error: void 0 }));
|
|
717
723
|
try {
|
|
718
|
-
const [
|
|
724
|
+
const [s, d] = await Promise.all([
|
|
719
725
|
fetch(`${n}/addresses`, { signal: AbortSignal.timeout(5e3) }),
|
|
720
726
|
fetch(`${n}/wallet`, { signal: AbortSignal.timeout(5e3) })
|
|
721
727
|
]);
|
|
722
|
-
if (!
|
|
723
|
-
a((
|
|
724
|
-
...
|
|
728
|
+
if (!s.ok || !d.ok) {
|
|
729
|
+
a((l) => ({
|
|
730
|
+
...l,
|
|
725
731
|
isLoading: !1,
|
|
726
|
-
error: `Node returned HTTP ${
|
|
732
|
+
error: `Node returned HTTP ${s.ok ? d.status : s.status}`
|
|
727
733
|
}));
|
|
728
734
|
return;
|
|
729
735
|
}
|
|
730
|
-
const
|
|
736
|
+
const h = await s.json(), p = await d.json(), u = p.bzzBalance ?? p.bzz, o = p.nativeTokenBalance ?? p.xDai;
|
|
731
737
|
a({
|
|
732
|
-
address:
|
|
738
|
+
address: h.ethereum,
|
|
733
739
|
xdai: o !== void 0 ? Number(o) / 1e18 : void 0,
|
|
734
|
-
xbzz:
|
|
740
|
+
xbzz: u !== void 0 ? Number(u) / 10 ** De : void 0,
|
|
735
741
|
isLoading: !1
|
|
736
742
|
});
|
|
737
743
|
} catch {
|
|
738
|
-
a((
|
|
739
|
-
...
|
|
744
|
+
a((s) => ({
|
|
745
|
+
...s,
|
|
740
746
|
isLoading: !1,
|
|
741
747
|
error: `Cannot read node wallet at ${n}`
|
|
742
748
|
}));
|
|
@@ -745,49 +751,49 @@ function wt(n = se) {
|
|
|
745
751
|
return {
|
|
746
752
|
...r,
|
|
747
753
|
isFunded: (r.xdai ?? 0) > 0 && (r.xbzz ?? 0) > 0,
|
|
748
|
-
refresh:
|
|
754
|
+
refresh: i
|
|
749
755
|
};
|
|
750
756
|
}
|
|
751
|
-
function
|
|
757
|
+
function bn() {
|
|
752
758
|
if (!(typeof window > "u"))
|
|
753
759
|
try {
|
|
754
|
-
return window.localStorage.getItem(
|
|
760
|
+
return window.localStorage.getItem(mt) ?? void 0;
|
|
755
761
|
} catch {
|
|
756
762
|
return;
|
|
757
763
|
}
|
|
758
764
|
}
|
|
759
|
-
function
|
|
760
|
-
const [r, a] =
|
|
761
|
-
() => n.beeApiUrl ??
|
|
765
|
+
function yn(n = {}) {
|
|
766
|
+
const [r, a] = F(
|
|
767
|
+
() => n.beeApiUrl ?? bn() ?? de
|
|
762
768
|
);
|
|
763
769
|
Q(() => {
|
|
764
770
|
if (!(typeof window > "u"))
|
|
765
771
|
try {
|
|
766
|
-
window.localStorage.setItem(
|
|
772
|
+
window.localStorage.setItem(mt, r);
|
|
767
773
|
} catch {
|
|
768
774
|
}
|
|
769
775
|
}, [r]);
|
|
770
|
-
const
|
|
771
|
-
address:
|
|
772
|
-
chainId:
|
|
773
|
-
query: { enabled:
|
|
774
|
-
}), b = v ? Number(v.formatted) : void 0,
|
|
776
|
+
const i = { ...xt, ...n.requirements }, s = mn(r), d = xn(r), h = bt(r), { address: p, isConnected: u, chainId: o } = we(), l = u && o === G, { data: v, isLoading: g } = vt({
|
|
777
|
+
address: p,
|
|
778
|
+
chainId: G,
|
|
779
|
+
query: { enabled: u }
|
|
780
|
+
}), b = v ? Number(v.formatted) : void 0, _ = l && !!v && v.value > 0n;
|
|
775
781
|
return {
|
|
776
|
-
beeNode:
|
|
777
|
-
stamps:
|
|
782
|
+
beeNode: s,
|
|
783
|
+
stamps: d,
|
|
778
784
|
beeApiUrl: r,
|
|
779
785
|
setBeeApiUrl: a,
|
|
780
|
-
|
|
781
|
-
nodeWallet:
|
|
782
|
-
isWalletConnected:
|
|
783
|
-
address:
|
|
784
|
-
isOnGnosis:
|
|
786
|
+
requirements: i,
|
|
787
|
+
nodeWallet: h,
|
|
788
|
+
isWalletConnected: u,
|
|
789
|
+
address: p,
|
|
790
|
+
isOnGnosis: l,
|
|
785
791
|
chainId: o,
|
|
786
|
-
balance: { xdai: b, isLoading:
|
|
787
|
-
isFullyConnected:
|
|
792
|
+
balance: { xdai: b, isLoading: u && g, hasGas: _ },
|
|
793
|
+
isFullyConnected: u && l && s.isRunning && (!i.xdai || _) && (!i.xbzz || h.isFunded) && (!i.postageStamp || !!d.selectedStampId)
|
|
788
794
|
};
|
|
789
795
|
}
|
|
790
|
-
const
|
|
796
|
+
const wn = `
|
|
791
797
|
.swarm-connect {
|
|
792
798
|
--void:#060809; --bunker:#0b0f12; --surface:#121821; --raised:#18202b; --raised-2:#1e2833;
|
|
793
799
|
--line:rgba(255,255,255,0.07); --line-2:rgba(255,255,255,0.12); --line-orange:rgba(255,107,0,0.45);
|
|
@@ -811,14 +817,14 @@ const Sn = `
|
|
|
811
817
|
.sc-scroll::-webkit-scrollbar-thumb { background:var(--line-2); border-radius:8px; border:2px solid transparent; background-clip:padding-box; }
|
|
812
818
|
.sc-scroll::-webkit-scrollbar-track { background:transparent; }
|
|
813
819
|
`;
|
|
814
|
-
let
|
|
815
|
-
function
|
|
816
|
-
if (
|
|
817
|
-
|
|
820
|
+
let ut = !1;
|
|
821
|
+
function yt() {
|
|
822
|
+
if (ut || typeof document > "u") return;
|
|
823
|
+
ut = !0;
|
|
818
824
|
const n = document.createElement("style");
|
|
819
|
-
n.dataset.swarmConnect = "", n.textContent =
|
|
825
|
+
n.dataset.swarmConnect = "", n.textContent = wn, document.head.appendChild(n);
|
|
820
826
|
}
|
|
821
|
-
function
|
|
827
|
+
function kn({ size: n = 18, stroke: r = "var(--accent)", glow: a = !0, children: i }) {
|
|
822
828
|
return /* @__PURE__ */ t.jsx("span", { style: {
|
|
823
829
|
display: "inline-flex",
|
|
824
830
|
alignItems: "center",
|
|
@@ -835,11 +841,11 @@ function Cn({ size: n = 18, stroke: r = "var(--accent)", glow: a = !0, children:
|
|
|
835
841
|
strokeWidth: "1.4",
|
|
836
842
|
strokeLinecap: "round",
|
|
837
843
|
strokeLinejoin: "round",
|
|
838
|
-
children:
|
|
844
|
+
children: i
|
|
839
845
|
}
|
|
840
846
|
) });
|
|
841
847
|
}
|
|
842
|
-
function
|
|
848
|
+
function ke({ size: n = 15 }) {
|
|
843
849
|
return /* @__PURE__ */ t.jsx("span", { style: {
|
|
844
850
|
width: n,
|
|
845
851
|
height: n,
|
|
@@ -851,7 +857,7 @@ function ce({ size: n = 15 }) {
|
|
|
851
857
|
animation: "sc-spin .7s linear infinite"
|
|
852
858
|
} });
|
|
853
859
|
}
|
|
854
|
-
function
|
|
860
|
+
function ue({ children: n, tone: r }) {
|
|
855
861
|
const a = {
|
|
856
862
|
ok: { c: "var(--ok)", b: "var(--ok-line)", w: "var(--ok-wash)" },
|
|
857
863
|
bad: { c: "var(--bad)", b: "var(--bad-line)", w: "var(--bad-wash)" },
|
|
@@ -870,54 +876,54 @@ function le({ children: n, tone: r }) {
|
|
|
870
876
|
lineHeight: 1.3
|
|
871
877
|
}, children: n });
|
|
872
878
|
}
|
|
873
|
-
function
|
|
874
|
-
const
|
|
879
|
+
function H({ tone: n, title: r, sub: a, children: i }) {
|
|
880
|
+
const s = {
|
|
875
881
|
ok: { b: "var(--ok-line)", w: "var(--ok-wash)", d: "var(--ok)" },
|
|
876
882
|
bad: { b: "var(--bad-line)", w: "var(--bad-wash)", d: "var(--bad)" },
|
|
877
883
|
warn: { b: "var(--warn-line)", w: "var(--warn-wash)", d: "var(--warn)" },
|
|
878
884
|
flat: { b: "var(--line)", w: "var(--raised)", d: "var(--fg-muted)" }
|
|
879
|
-
}[n],
|
|
885
|
+
}[n], d = !!a && (a.startsWith("0x") || a.includes("localhost") || a.includes("http"));
|
|
880
886
|
return /* @__PURE__ */ t.jsxs("div", { style: {
|
|
881
887
|
display: "flex",
|
|
882
888
|
alignItems: "center",
|
|
883
889
|
gap: 12,
|
|
884
890
|
padding: "12px 14px",
|
|
885
|
-
border: `1px solid ${
|
|
891
|
+
border: `1px solid ${s.b}`,
|
|
886
892
|
borderRadius: 8,
|
|
887
|
-
background:
|
|
893
|
+
background: s.w
|
|
888
894
|
}, children: [
|
|
889
895
|
n !== "flat" && /* @__PURE__ */ t.jsx("span", { style: {
|
|
890
896
|
width: 8,
|
|
891
897
|
height: 8,
|
|
892
898
|
flexShrink: 0,
|
|
893
899
|
borderRadius: "50%",
|
|
894
|
-
background:
|
|
895
|
-
boxShadow: `0 0 8px ${
|
|
900
|
+
background: s.d,
|
|
901
|
+
boxShadow: `0 0 8px ${s.d}`,
|
|
896
902
|
animation: n === "warn" ? "sc-pulse-dot 1.6s var(--ease) infinite" : "none"
|
|
897
903
|
} }),
|
|
898
904
|
/* @__PURE__ */ t.jsxs("div", { style: { minWidth: 0 }, children: [
|
|
899
|
-
r && /* @__PURE__ */ t.jsx("div", { style: { fontWeight: 600, fontSize: 13.5, color: n === "flat" ? "var(--fg-soft)" :
|
|
900
|
-
a && /* @__PURE__ */ t.jsx("div", { style: { fontSize: 12, color: "var(--fg-muted)", marginTop: 2, fontFamily:
|
|
905
|
+
r && /* @__PURE__ */ t.jsx("div", { style: { fontWeight: 600, fontSize: 13.5, color: n === "flat" ? "var(--fg-soft)" : s.d }, children: r }),
|
|
906
|
+
a && /* @__PURE__ */ t.jsx("div", { style: { fontSize: 12, color: "var(--fg-muted)", marginTop: 2, fontFamily: d ? "var(--font-mono)" : "inherit", wordBreak: "break-all" }, children: a })
|
|
901
907
|
] }),
|
|
902
|
-
|
|
908
|
+
i && /* @__PURE__ */ t.jsx("div", { style: { marginLeft: "auto", flexShrink: 0 }, children: i })
|
|
903
909
|
] });
|
|
904
910
|
}
|
|
905
|
-
function
|
|
906
|
-
const [
|
|
911
|
+
function q({ children: n, onClick: r, disabled: a }) {
|
|
912
|
+
const [i, s] = F(!1);
|
|
907
913
|
return /* @__PURE__ */ t.jsx(
|
|
908
914
|
"button",
|
|
909
915
|
{
|
|
910
916
|
onClick: r,
|
|
911
917
|
disabled: a,
|
|
912
|
-
onMouseEnter: () =>
|
|
913
|
-
onMouseLeave: () =>
|
|
918
|
+
onMouseEnter: () => s(!0),
|
|
919
|
+
onMouseLeave: () => s(!1),
|
|
914
920
|
style: {
|
|
915
921
|
fontFamily: "var(--font-mono)",
|
|
916
922
|
fontSize: 12,
|
|
917
923
|
letterSpacing: ".04em",
|
|
918
924
|
background: "transparent",
|
|
919
|
-
border: `1px solid ${
|
|
920
|
-
color: a ? "var(--fg-faint)" :
|
|
925
|
+
border: `1px solid ${i && !a ? "var(--line-orange)" : "var(--line-2)"}`,
|
|
926
|
+
color: a ? "var(--fg-faint)" : i ? "var(--accent-bright)" : "var(--fg-soft)",
|
|
921
927
|
borderRadius: 4,
|
|
922
928
|
padding: "7px 14px",
|
|
923
929
|
cursor: a ? "default" : "pointer",
|
|
@@ -928,15 +934,15 @@ function H({ children: n, onClick: r, disabled: a }) {
|
|
|
928
934
|
}
|
|
929
935
|
);
|
|
930
936
|
}
|
|
931
|
-
function
|
|
932
|
-
const [
|
|
937
|
+
function wt({ children: n, onClick: r, pending: a, block: i, style: s }) {
|
|
938
|
+
const [d, h] = F(!1);
|
|
933
939
|
return /* @__PURE__ */ t.jsx(
|
|
934
940
|
"button",
|
|
935
941
|
{
|
|
936
942
|
onClick: r,
|
|
937
943
|
disabled: a,
|
|
938
|
-
onMouseEnter: () =>
|
|
939
|
-
onMouseLeave: () =>
|
|
944
|
+
onMouseEnter: () => h(!0),
|
|
945
|
+
onMouseLeave: () => h(!1),
|
|
940
946
|
style: {
|
|
941
947
|
display: "inline-flex",
|
|
942
948
|
alignItems: "center",
|
|
@@ -947,19 +953,19 @@ function Oe({ children: n, onClick: r, pending: a, block: s, style: i }) {
|
|
|
947
953
|
fontWeight: 600,
|
|
948
954
|
letterSpacing: ".06em",
|
|
949
955
|
textTransform: "uppercase",
|
|
950
|
-
width:
|
|
956
|
+
width: i ? "100%" : "auto",
|
|
951
957
|
background: "var(--accent)",
|
|
952
958
|
color: "var(--accent-ink)",
|
|
953
959
|
border: "none",
|
|
954
960
|
borderRadius: 4,
|
|
955
961
|
padding: "11px 20px",
|
|
956
962
|
cursor: a ? "default" : "pointer",
|
|
957
|
-
boxShadow:
|
|
958
|
-
transform:
|
|
963
|
+
boxShadow: d ? "0 0 24px var(--accent-glow)" : "0 0 14px var(--accent-glow)",
|
|
964
|
+
transform: d ? "translateY(-1px)" : "none",
|
|
959
965
|
transition: "all .15s var(--ease)",
|
|
960
966
|
opacity: a ? 0.8 : 1,
|
|
961
967
|
whiteSpace: "nowrap",
|
|
962
|
-
...
|
|
968
|
+
...s
|
|
963
969
|
},
|
|
964
970
|
children: n
|
|
965
971
|
}
|
|
@@ -975,15 +981,15 @@ function ee({ children: n }) {
|
|
|
975
981
|
borderRadius: 8,
|
|
976
982
|
background: "var(--bunker)"
|
|
977
983
|
}, children: [
|
|
978
|
-
/* @__PURE__ */ t.jsxs(
|
|
984
|
+
/* @__PURE__ */ t.jsxs(kn, { size: 15, stroke: "var(--fg-faint)", glow: !1, children: [
|
|
979
985
|
/* @__PURE__ */ t.jsx("rect", { x: "5", y: "11", width: "14", height: "9", rx: "1.5" }),
|
|
980
986
|
/* @__PURE__ */ t.jsx("path", { d: "M8 11V8a4 4 0 0 1 8 0v3" })
|
|
981
987
|
] }),
|
|
982
988
|
/* @__PURE__ */ t.jsx("span", { style: { fontSize: 12.5, color: "var(--fg-muted)" }, children: n })
|
|
983
989
|
] });
|
|
984
990
|
}
|
|
985
|
-
function
|
|
986
|
-
const
|
|
991
|
+
function jn({ step: n, state: r, children: a, hint: i }) {
|
|
992
|
+
const s = r === "done", d = r === "locked";
|
|
987
993
|
return /* @__PURE__ */ t.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 10, marginBottom: 12 }, children: [
|
|
988
994
|
/* @__PURE__ */ t.jsx("span", { style: {
|
|
989
995
|
display: "inline-flex",
|
|
@@ -996,24 +1002,24 @@ function J({ step: n, state: r, children: a, hint: s }) {
|
|
|
996
1002
|
fontSize: 11,
|
|
997
1003
|
fontWeight: 600,
|
|
998
1004
|
lineHeight: 1,
|
|
999
|
-
color:
|
|
1000
|
-
background:
|
|
1001
|
-
border:
|
|
1005
|
+
color: s ? "var(--ok)" : d ? "var(--fg-faint)" : "var(--accent-ink)",
|
|
1006
|
+
background: s ? "var(--ok-wash)" : d ? "transparent" : "var(--accent)",
|
|
1007
|
+
border: s ? "1px solid var(--ok-line)" : d ? "1px solid var(--line-2)" : "none",
|
|
1002
1008
|
clipPath: "polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%)",
|
|
1003
|
-
boxShadow: !
|
|
1004
|
-
}, children:
|
|
1009
|
+
boxShadow: !s && !d ? "0 0 14px var(--accent-glow)" : "none"
|
|
1010
|
+
}, children: s ? "✓" : n }),
|
|
1005
1011
|
/* @__PURE__ */ t.jsx("span", { style: {
|
|
1006
1012
|
fontFamily: "var(--font-mono)",
|
|
1007
1013
|
fontSize: 11,
|
|
1008
1014
|
fontWeight: 600,
|
|
1009
1015
|
textTransform: "uppercase",
|
|
1010
1016
|
letterSpacing: ".18em",
|
|
1011
|
-
color:
|
|
1017
|
+
color: d ? "var(--fg-faint)" : "var(--fg-soft)"
|
|
1012
1018
|
}, children: a }),
|
|
1013
|
-
|
|
1019
|
+
i && /* @__PURE__ */ t.jsx("span", { style: { marginLeft: "auto", fontFamily: "var(--font-mono)", fontSize: 10, letterSpacing: ".06em", color: "var(--fg-faint)" }, children: i })
|
|
1014
1020
|
] });
|
|
1015
1021
|
}
|
|
1016
|
-
function
|
|
1022
|
+
function Sn({ size: n = 30 }) {
|
|
1017
1023
|
return /* @__PURE__ */ t.jsx("span", { style: {
|
|
1018
1024
|
width: n,
|
|
1019
1025
|
height: n,
|
|
@@ -1043,7 +1049,7 @@ function Rn({ size: n = 30 }) {
|
|
|
1043
1049
|
}
|
|
1044
1050
|
) });
|
|
1045
1051
|
}
|
|
1046
|
-
function
|
|
1052
|
+
function Cn({ states: n }) {
|
|
1047
1053
|
return /* @__PURE__ */ t.jsx("span", { style: { display: "inline-flex", gap: 5 }, children: n.map((r, a) => /* @__PURE__ */ t.jsx("span", { style: {
|
|
1048
1054
|
width: 7,
|
|
1049
1055
|
height: 7,
|
|
@@ -1053,24 +1059,24 @@ function _n({ states: n }) {
|
|
|
1053
1059
|
transition: "all .2s"
|
|
1054
1060
|
} }, a)) });
|
|
1055
1061
|
}
|
|
1056
|
-
function
|
|
1062
|
+
function Rn(n) {
|
|
1057
1063
|
const r = {
|
|
1058
1064
|
formatters: void 0,
|
|
1059
1065
|
fees: void 0,
|
|
1060
1066
|
serializers: void 0,
|
|
1061
1067
|
...n
|
|
1062
1068
|
};
|
|
1063
|
-
function a(
|
|
1064
|
-
return (
|
|
1065
|
-
const
|
|
1066
|
-
return Object.assign(
|
|
1069
|
+
function a(i) {
|
|
1070
|
+
return (s) => {
|
|
1071
|
+
const d = typeof s == "function" ? s(i) : s, h = { ...i, ...d };
|
|
1072
|
+
return Object.assign(h, { extend: a(h) });
|
|
1067
1073
|
};
|
|
1068
1074
|
}
|
|
1069
1075
|
return Object.assign(r, {
|
|
1070
1076
|
extend: a(r)
|
|
1071
1077
|
});
|
|
1072
1078
|
}
|
|
1073
|
-
const
|
|
1079
|
+
const Oe = /* @__PURE__ */ Rn({
|
|
1074
1080
|
id: 100,
|
|
1075
1081
|
name: "Gnosis",
|
|
1076
1082
|
nativeCurrency: {
|
|
@@ -1099,19 +1105,19 @@ const Pe = /* @__PURE__ */ En({
|
|
|
1099
1105
|
}
|
|
1100
1106
|
}
|
|
1101
1107
|
});
|
|
1102
|
-
function
|
|
1108
|
+
function ze(n) {
|
|
1103
1109
|
if (n)
|
|
1104
1110
|
return n.shortMessage ?? n.message;
|
|
1105
1111
|
}
|
|
1106
|
-
function
|
|
1107
|
-
const [
|
|
1112
|
+
function _n({ name: n, icon: r, pending: a, disabled: i, onClick: s }) {
|
|
1113
|
+
const [d, h] = F(!1);
|
|
1108
1114
|
return /* @__PURE__ */ t.jsxs(
|
|
1109
1115
|
"button",
|
|
1110
1116
|
{
|
|
1111
|
-
onClick:
|
|
1112
|
-
disabled:
|
|
1113
|
-
onMouseEnter: () =>
|
|
1114
|
-
onMouseLeave: () =>
|
|
1117
|
+
onClick: s,
|
|
1118
|
+
disabled: i || a,
|
|
1119
|
+
onMouseEnter: () => h(!0),
|
|
1120
|
+
onMouseLeave: () => h(!1),
|
|
1115
1121
|
style: {
|
|
1116
1122
|
display: "flex",
|
|
1117
1123
|
alignItems: "center",
|
|
@@ -1120,10 +1126,10 @@ function In({ name: n, icon: r, pending: a, disabled: s, onClick: i }) {
|
|
|
1120
1126
|
textAlign: "left",
|
|
1121
1127
|
padding: "11px 13px",
|
|
1122
1128
|
borderRadius: 8,
|
|
1123
|
-
cursor:
|
|
1124
|
-
opacity:
|
|
1125
|
-
border: `1px solid ${
|
|
1126
|
-
background:
|
|
1129
|
+
cursor: i ? "default" : "pointer",
|
|
1130
|
+
opacity: i ? 0.45 : 1,
|
|
1131
|
+
border: `1px solid ${d && !i ? "var(--line-orange)" : "var(--line)"}`,
|
|
1132
|
+
background: d && !i ? "var(--raised-2)" : "var(--raised)",
|
|
1127
1133
|
transition: "all .15s var(--ease)"
|
|
1128
1134
|
},
|
|
1129
1135
|
children: [
|
|
@@ -1144,76 +1150,88 @@ function In({ name: n, icon: r, pending: a, disabled: s, onClick: i }) {
|
|
|
1144
1150
|
fontSize: 15
|
|
1145
1151
|
}, children: r ? /* @__PURE__ */ t.jsx("img", { src: r, width: 30, height: 30, alt: "", style: { borderRadius: 7 } }) : n.charAt(0) }),
|
|
1146
1152
|
/* @__PURE__ */ t.jsx("span", { style: { flex: 1, fontSize: 14, fontWeight: 500, color: "var(--fg)" }, children: n }),
|
|
1147
|
-
a ? /* @__PURE__ */ t.jsx(
|
|
1153
|
+
a ? /* @__PURE__ */ t.jsx(ke, { size: 14 }) : /* @__PURE__ */ t.jsx("span", { style: { fontFamily: "var(--font-mono)", fontSize: 16, color: d && !i ? "var(--accent)" : "var(--fg-faint)", transition: "color .15s" }, children: "→" })
|
|
1148
1154
|
]
|
|
1149
1155
|
}
|
|
1150
1156
|
);
|
|
1151
1157
|
}
|
|
1152
|
-
function
|
|
1153
|
-
const { connectors: a, connect:
|
|
1158
|
+
function En({ isConnected: n, address: r }) {
|
|
1159
|
+
const { connectors: a, connect: i, isPending: s, variables: d, error: h } = Xt(), { disconnect: p } = gt(), { connector: u } = we();
|
|
1154
1160
|
if (n)
|
|
1155
|
-
return /* @__PURE__ */ t.jsx(
|
|
1156
|
-
|
|
1161
|
+
return /* @__PURE__ */ t.jsx(
|
|
1162
|
+
H,
|
|
1163
|
+
{
|
|
1164
|
+
tone: "ok",
|
|
1165
|
+
title: `Wallet connected${u ? ` · ${u.name}` : ""}`,
|
|
1166
|
+
sub: r,
|
|
1167
|
+
children: /* @__PURE__ */ t.jsx(q, { onClick: () => p(), children: "disconnect" })
|
|
1168
|
+
}
|
|
1169
|
+
);
|
|
1170
|
+
const o = s && d != null && d.connector && "uid" in d.connector ? d.connector.uid : void 0;
|
|
1157
1171
|
return /* @__PURE__ */ t.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: [
|
|
1158
|
-
a.map((
|
|
1159
|
-
|
|
1172
|
+
a.map((l) => /* @__PURE__ */ t.jsx(
|
|
1173
|
+
_n,
|
|
1160
1174
|
{
|
|
1161
|
-
name:
|
|
1162
|
-
icon:
|
|
1163
|
-
pending:
|
|
1164
|
-
disabled:
|
|
1165
|
-
onClick: () =>
|
|
1175
|
+
name: l.name,
|
|
1176
|
+
icon: l.icon,
|
|
1177
|
+
pending: o === l.uid,
|
|
1178
|
+
disabled: s && o !== l.uid,
|
|
1179
|
+
onClick: () => i({ connector: l })
|
|
1166
1180
|
},
|
|
1167
|
-
|
|
1181
|
+
l.uid
|
|
1168
1182
|
)),
|
|
1169
|
-
|
|
1183
|
+
h && /* @__PURE__ */ t.jsx("div", { style: { fontSize: 12, color: "var(--bad)", fontFamily: "var(--font-mono)" }, children: h.message })
|
|
1170
1184
|
] });
|
|
1171
1185
|
}
|
|
1172
|
-
function
|
|
1173
|
-
const { switchChain:
|
|
1174
|
-
return n ? /* @__PURE__ */ t.jsx(ee, { children: "Connect a wallet to verify it is on the Gnosis chain." }) : r ? /* @__PURE__ */ t.jsx(
|
|
1175
|
-
/* @__PURE__ */ t.jsx(
|
|
1176
|
-
/* @__PURE__ */ t.jsx(
|
|
1186
|
+
function In({ locked: n, isOnGnosis: r, chainId: a }) {
|
|
1187
|
+
const { switchChain: i, isPending: s, error: d } = Qt();
|
|
1188
|
+
return n ? /* @__PURE__ */ t.jsx(ee, { children: "Connect a wallet to verify it is on the Gnosis chain." }) : r ? /* @__PURE__ */ t.jsx(H, { tone: "ok", title: "Gnosis chain", sub: `wallet reports chain id ${a}`, children: /* @__PURE__ */ t.jsx(ue, { tone: "ok", children: "synced" }) }) : /* @__PURE__ */ t.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 10 }, children: [
|
|
1189
|
+
/* @__PURE__ */ t.jsx(H, { tone: "warn", title: "Wrong network", sub: `chain ${a ?? "—"} active — Gnosis (${G}) required` }),
|
|
1190
|
+
/* @__PURE__ */ t.jsx(wt, { onClick: () => i({ chainId: Oe.id }), pending: s, block: !0, children: s ? "switching…" : "switch to Gnosis" }),
|
|
1191
|
+
d && /* @__PURE__ */ t.jsxs("div", { style: { fontSize: 12, color: "var(--bad)", fontFamily: "var(--font-mono)", lineHeight: 1.5 }, children: [
|
|
1192
|
+
"switch failed: ",
|
|
1193
|
+
ze(d)
|
|
1194
|
+
] })
|
|
1177
1195
|
] });
|
|
1178
1196
|
}
|
|
1179
|
-
function
|
|
1180
|
-
const
|
|
1197
|
+
function Ae({ symbol: n, role: r, amount: a, loading: i }) {
|
|
1198
|
+
const s = !i && a === 0, d = s ? "var(--warn)" : "var(--ok)", h = s ? "var(--warn-line)" : "var(--ok-line)", p = s ? "var(--warn-wash)" : "var(--ok-wash)";
|
|
1181
1199
|
return /* @__PURE__ */ t.jsxs("div", { style: {
|
|
1182
1200
|
display: "flex",
|
|
1183
1201
|
alignItems: "center",
|
|
1184
1202
|
gap: 12,
|
|
1185
1203
|
padding: "12px 14px",
|
|
1186
|
-
border: `1px solid ${
|
|
1204
|
+
border: `1px solid ${i ? "var(--line)" : h}`,
|
|
1187
1205
|
borderRadius: 8,
|
|
1188
|
-
background:
|
|
1206
|
+
background: i ? "var(--raised)" : p
|
|
1189
1207
|
}, children: [
|
|
1190
|
-
|
|
1208
|
+
i ? /* @__PURE__ */ t.jsx(ke, { size: 14 }) : /* @__PURE__ */ t.jsx("span", { style: { width: 8, height: 8, flexShrink: 0, borderRadius: "50%", background: d, boxShadow: `0 0 8px ${d}`, animation: s ? "sc-pulse-dot 1.6s var(--ease) infinite" : "none" } }),
|
|
1191
1209
|
/* @__PURE__ */ t.jsxs("div", { style: { minWidth: 0 }, children: [
|
|
1192
|
-
/* @__PURE__ */ t.jsx("div", { style: { fontWeight: 600, fontSize: 13.5, color:
|
|
1210
|
+
/* @__PURE__ */ t.jsx("div", { style: { fontWeight: 600, fontSize: 13.5, color: i ? "var(--fg-soft)" : d }, children: n }),
|
|
1193
1211
|
/* @__PURE__ */ t.jsx("div", { style: { fontSize: 12, color: "var(--fg-muted)", marginTop: 2 }, children: r })
|
|
1194
1212
|
] }),
|
|
1195
1213
|
/* @__PURE__ */ t.jsxs("div", { style: { marginLeft: "auto", display: "flex", alignItems: "center", gap: 10, flexShrink: 0 }, children: [
|
|
1196
|
-
!
|
|
1197
|
-
!
|
|
1214
|
+
!i && /* @__PURE__ */ t.jsx("span", { style: { fontFamily: "var(--font-mono)", fontSize: 13.5, fontWeight: 500, color: s ? "var(--warn)" : "var(--fg)" }, children: a.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 4 }) }),
|
|
1215
|
+
!i && /* @__PURE__ */ t.jsx(ue, { tone: s ? "warn" : "ok", children: s ? "empty" : "ok" })
|
|
1198
1216
|
] })
|
|
1199
1217
|
] });
|
|
1200
1218
|
}
|
|
1201
|
-
function
|
|
1219
|
+
function Tn({ locked: n, balance: r }) {
|
|
1202
1220
|
if (n) return /* @__PURE__ */ t.jsx(ee, { children: "Switch to the Gnosis chain to read your wallet's xDAI balance." });
|
|
1203
|
-
const a = r.xdai ?? 0,
|
|
1221
|
+
const a = r.xdai ?? 0, i = !r.isLoading && a === 0;
|
|
1204
1222
|
return /* @__PURE__ */ t.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: [
|
|
1205
|
-
/* @__PURE__ */ t.jsx(
|
|
1206
|
-
/* @__PURE__ */ t.jsx("div", { style:
|
|
1207
|
-
|
|
1223
|
+
/* @__PURE__ */ t.jsx(Ae, { symbol: "xDAI", role: "gas for transactions from this wallet", amount: a, loading: r.isLoading }),
|
|
1224
|
+
/* @__PURE__ */ t.jsx("div", { style: be, children: "Your connected wallet signs and pays gas for its own transactions — separate from the wallet running your Bee node." }),
|
|
1225
|
+
i && /* @__PURE__ */ t.jsx(wt, { onClick: () => window.open("https://www.gnosisfaucet.com", "_blank", "noopener"), block: !0, children: "get xDAI" })
|
|
1208
1226
|
] });
|
|
1209
1227
|
}
|
|
1210
|
-
function
|
|
1211
|
-
const [
|
|
1228
|
+
function Fn({ value: n, disabled: r, onSubmit: a }) {
|
|
1229
|
+
const [i, s] = F(n), [d, h] = F(!1);
|
|
1212
1230
|
Q(() => {
|
|
1213
|
-
|
|
1231
|
+
s(n);
|
|
1214
1232
|
}, [n]);
|
|
1215
|
-
const
|
|
1216
|
-
|
|
1233
|
+
const p = i.trim().replace(/\/+$/, ""), u = p !== n && p.length > 0, o = () => {
|
|
1234
|
+
u && a(p);
|
|
1217
1235
|
};
|
|
1218
1236
|
return /* @__PURE__ */ t.jsxs("div", { style: { display: "flex", gap: 8 }, children: [
|
|
1219
1237
|
/* @__PURE__ */ t.jsxs("div", { style: {
|
|
@@ -1224,9 +1242,9 @@ function Dn({ value: n, disabled: r, onSubmit: a }) {
|
|
|
1224
1242
|
gap: 8,
|
|
1225
1243
|
padding: "0 12px",
|
|
1226
1244
|
borderRadius: 6,
|
|
1227
|
-
border: `1px solid ${
|
|
1245
|
+
border: `1px solid ${d ? "var(--line-orange)" : "var(--line-2)"}`,
|
|
1228
1246
|
background: r ? "var(--bunker)" : "var(--surface)",
|
|
1229
|
-
boxShadow:
|
|
1247
|
+
boxShadow: d ? "0 0 0 3px var(--accent-wash)" : "none",
|
|
1230
1248
|
transition: "all .15s var(--ease)"
|
|
1231
1249
|
}, children: [
|
|
1232
1250
|
/* @__PURE__ */ t.jsx("span", { style: { fontFamily: "var(--font-mono)", fontSize: 12, color: "var(--accent)" }, children: ">" }),
|
|
@@ -1234,15 +1252,15 @@ function Dn({ value: n, disabled: r, onSubmit: a }) {
|
|
|
1234
1252
|
"input",
|
|
1235
1253
|
{
|
|
1236
1254
|
type: "url",
|
|
1237
|
-
value:
|
|
1255
|
+
value: i,
|
|
1238
1256
|
disabled: r,
|
|
1239
1257
|
spellCheck: !1,
|
|
1240
1258
|
autoComplete: "off",
|
|
1241
|
-
onFocus: () =>
|
|
1242
|
-
onBlur: () =>
|
|
1243
|
-
onChange: (
|
|
1244
|
-
onKeyDown: (
|
|
1245
|
-
|
|
1259
|
+
onFocus: () => h(!0),
|
|
1260
|
+
onBlur: () => h(!1),
|
|
1261
|
+
onChange: (l) => s(l.target.value),
|
|
1262
|
+
onKeyDown: (l) => {
|
|
1263
|
+
l.key === "Enter" && o();
|
|
1246
1264
|
},
|
|
1247
1265
|
placeholder: "http://localhost:1633",
|
|
1248
1266
|
style: {
|
|
@@ -1259,28 +1277,28 @@ function Dn({ value: n, disabled: r, onSubmit: a }) {
|
|
|
1259
1277
|
}
|
|
1260
1278
|
)
|
|
1261
1279
|
] }),
|
|
1262
|
-
/* @__PURE__ */ t.jsx(
|
|
1280
|
+
/* @__PURE__ */ t.jsx(q, { onClick: o, disabled: r || !u, children: "connect" })
|
|
1263
1281
|
] });
|
|
1264
1282
|
}
|
|
1265
|
-
function
|
|
1283
|
+
function Pn({ node: n, beeApiUrl: r }) {
|
|
1266
1284
|
return n.isChecking ? /* @__PURE__ */ t.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 12, padding: "12px 14px", border: "1px solid var(--line)", borderRadius: 8, background: "var(--raised)" }, children: [
|
|
1267
|
-
/* @__PURE__ */ t.jsx(
|
|
1285
|
+
/* @__PURE__ */ t.jsx(ke, {}),
|
|
1268
1286
|
/* @__PURE__ */ t.jsxs("span", { style: { color: "var(--fg-muted)", fontSize: 13, fontFamily: "var(--font-mono)" }, children: [
|
|
1269
1287
|
"probing ",
|
|
1270
1288
|
r,
|
|
1271
1289
|
"…"
|
|
1272
1290
|
] })
|
|
1273
|
-
] }) : n.isRunning ? /* @__PURE__ */ t.jsx(
|
|
1274
|
-
/* @__PURE__ */ t.jsx(
|
|
1291
|
+
] }) : n.isRunning ? /* @__PURE__ */ t.jsx(H, { tone: "ok", title: "Node online", sub: `bee ${n.version ?? "—"} · ${r}`, children: /* @__PURE__ */ t.jsx(ue, { tone: "ok", children: "health ok" }) }) : n.error ? /* @__PURE__ */ t.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 10 }, children: [
|
|
1292
|
+
/* @__PURE__ */ t.jsx(H, { tone: "bad", title: "Node unreachable", sub: n.error }),
|
|
1275
1293
|
/* @__PURE__ */ t.jsxs("div", { style: { fontSize: 12, color: "var(--fg-muted)", display: "flex", alignItems: "center", gap: 6, flexWrap: "wrap" }, children: [
|
|
1276
1294
|
/* @__PURE__ */ t.jsx("span", { children: "start one with" }),
|
|
1277
1295
|
/* @__PURE__ */ t.jsx("code", { style: { fontFamily: "var(--font-mono)", fontSize: 11.5, background: "var(--bunker)", border: "1px solid var(--line)", color: "var(--accent-bright)", padding: "2px 7px", borderRadius: 3 }, children: "bee start" }),
|
|
1278
|
-
/* @__PURE__ */ t.jsx(
|
|
1296
|
+
/* @__PURE__ */ t.jsx(q, { onClick: n.check, children: "retry" })
|
|
1279
1297
|
] })
|
|
1280
|
-
] });
|
|
1298
|
+
] }) : /* @__PURE__ */ t.jsx(H, { tone: "flat", title: "Node not connected", sub: r, children: /* @__PURE__ */ t.jsx(q, { onClick: n.check, children: "connect" }) });
|
|
1281
1299
|
}
|
|
1282
|
-
function
|
|
1283
|
-
const
|
|
1300
|
+
function ft({ symbol: n, value: r, onChange: a, onSend: i, pending: s, confirming: d, done: h, disabled: p }) {
|
|
1301
|
+
const u = s || d;
|
|
1284
1302
|
return /* @__PURE__ */ t.jsxs("div", { style: { display: "flex", gap: 8, alignItems: "center" }, children: [
|
|
1285
1303
|
/* @__PURE__ */ t.jsxs("div", { style: {
|
|
1286
1304
|
flex: 1,
|
|
@@ -1291,14 +1309,14 @@ function vt({ symbol: n, value: r, onChange: a, onSend: s, pending: i, confirmin
|
|
|
1291
1309
|
padding: "0 12px",
|
|
1292
1310
|
borderRadius: 6,
|
|
1293
1311
|
border: "1px solid var(--line-2)",
|
|
1294
|
-
background:
|
|
1312
|
+
background: u || p ? "var(--bunker)" : "var(--surface)"
|
|
1295
1313
|
}, children: [
|
|
1296
1314
|
/* @__PURE__ */ t.jsx(
|
|
1297
1315
|
"input",
|
|
1298
1316
|
{
|
|
1299
1317
|
inputMode: "decimal",
|
|
1300
1318
|
value: r,
|
|
1301
|
-
disabled:
|
|
1319
|
+
disabled: u || p,
|
|
1302
1320
|
spellCheck: !1,
|
|
1303
1321
|
onChange: (o) => a(o.target.value),
|
|
1304
1322
|
style: {
|
|
@@ -1316,65 +1334,65 @@ function vt({ symbol: n, value: r, onChange: a, onSend: s, pending: i, confirmin
|
|
|
1316
1334
|
),
|
|
1317
1335
|
/* @__PURE__ */ t.jsx("span", { style: { fontFamily: "var(--font-mono)", fontSize: 11, color: "var(--fg-muted)", flexShrink: 0 }, children: n })
|
|
1318
1336
|
] }),
|
|
1319
|
-
|
|
1337
|
+
h ? /* @__PURE__ */ t.jsx(ue, { tone: "ok", children: "sent" }) : /* @__PURE__ */ t.jsx(q, { onClick: i, disabled: u || p || !r.trim(), children: s ? "sign…" : d ? "mining…" : `send ${n.toLowerCase()}` })
|
|
1320
1338
|
] });
|
|
1321
1339
|
}
|
|
1322
|
-
function
|
|
1323
|
-
const [a,
|
|
1340
|
+
function Dn({ to: n, onSettled: r }) {
|
|
1341
|
+
const [a, i] = F(vn), [s, d] = F(gn), { address: h } = we(), p = en(), u = tn(), o = at({ hash: p.data }), l = at({ hash: u.data });
|
|
1324
1342
|
Q(() => {
|
|
1325
1343
|
o.isSuccess && r();
|
|
1326
1344
|
}, [o.isSuccess]), Q(() => {
|
|
1327
|
-
|
|
1328
|
-
}, [
|
|
1329
|
-
const v =
|
|
1330
|
-
abi:
|
|
1331
|
-
address:
|
|
1345
|
+
l.isSuccess && r();
|
|
1346
|
+
}, [l.isSuccess]);
|
|
1347
|
+
const v = nn({
|
|
1348
|
+
abi: ot,
|
|
1349
|
+
address: dt,
|
|
1332
1350
|
functionName: "balanceOf",
|
|
1333
|
-
args:
|
|
1334
|
-
chainId:
|
|
1335
|
-
query: { enabled: !!
|
|
1336
|
-
}), g = v.data !== void 0 ? Number(v.data) / 10 **
|
|
1337
|
-
const S =
|
|
1338
|
-
S !== void 0 &&
|
|
1339
|
-
},
|
|
1340
|
-
const S =
|
|
1341
|
-
S !== void 0 &&
|
|
1342
|
-
abi:
|
|
1343
|
-
address:
|
|
1351
|
+
args: h ? [h] : void 0,
|
|
1352
|
+
chainId: G,
|
|
1353
|
+
query: { enabled: !!h }
|
|
1354
|
+
}), g = v.data !== void 0 ? Number(v.data) / 10 ** De : void 0, b = (g ?? 0) > 0, _ = () => {
|
|
1355
|
+
const S = ht(() => sn(a.trim()));
|
|
1356
|
+
S !== void 0 && p.sendTransaction({ to: n, value: S, chainId: G });
|
|
1357
|
+
}, E = () => {
|
|
1358
|
+
const S = ht(() => cn(s.trim(), De));
|
|
1359
|
+
S !== void 0 && u.writeContract({
|
|
1360
|
+
abi: ot,
|
|
1361
|
+
address: dt,
|
|
1344
1362
|
functionName: "transfer",
|
|
1345
1363
|
args: [n, S],
|
|
1346
|
-
chainId:
|
|
1364
|
+
chainId: G
|
|
1347
1365
|
});
|
|
1348
|
-
},
|
|
1366
|
+
}, O = ze(p.error) ?? ze(u.error);
|
|
1349
1367
|
return /* @__PURE__ */ t.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: [
|
|
1350
|
-
/* @__PURE__ */ t.jsx("div", { style:
|
|
1368
|
+
/* @__PURE__ */ t.jsx("div", { style: be, children: "One-time top-up — sent from your connected wallet to the node wallet:" }),
|
|
1351
1369
|
/* @__PURE__ */ t.jsx(
|
|
1352
|
-
|
|
1370
|
+
ft,
|
|
1353
1371
|
{
|
|
1354
1372
|
symbol: "xDAI",
|
|
1355
1373
|
value: a,
|
|
1356
|
-
onChange:
|
|
1357
|
-
onSend:
|
|
1358
|
-
pending:
|
|
1359
|
-
confirming: o.isLoading && !!
|
|
1374
|
+
onChange: i,
|
|
1375
|
+
onSend: _,
|
|
1376
|
+
pending: p.isPending,
|
|
1377
|
+
confirming: o.isLoading && !!p.data,
|
|
1360
1378
|
done: o.isSuccess,
|
|
1361
1379
|
disabled: !1
|
|
1362
1380
|
}
|
|
1363
1381
|
),
|
|
1364
1382
|
/* @__PURE__ */ t.jsx(
|
|
1365
|
-
|
|
1383
|
+
ft,
|
|
1366
1384
|
{
|
|
1367
1385
|
symbol: "xBZZ",
|
|
1368
|
-
value:
|
|
1369
|
-
onChange:
|
|
1370
|
-
onSend:
|
|
1371
|
-
pending:
|
|
1372
|
-
confirming:
|
|
1373
|
-
done:
|
|
1386
|
+
value: s,
|
|
1387
|
+
onChange: d,
|
|
1388
|
+
onSend: E,
|
|
1389
|
+
pending: u.isPending,
|
|
1390
|
+
confirming: l.isLoading && !!u.data,
|
|
1391
|
+
done: l.isSuccess,
|
|
1374
1392
|
disabled: !b
|
|
1375
1393
|
}
|
|
1376
1394
|
),
|
|
1377
|
-
g !== void 0 && /* @__PURE__ */ t.jsxs("div", { style: { ...
|
|
1395
|
+
g !== void 0 && /* @__PURE__ */ t.jsxs("div", { style: { ...be, display: "flex", alignItems: "center", gap: 8, flexWrap: "wrap" }, children: [
|
|
1378
1396
|
/* @__PURE__ */ t.jsxs("span", { children: [
|
|
1379
1397
|
"your wallet holds",
|
|
1380
1398
|
" ",
|
|
@@ -1383,30 +1401,30 @@ function On({ to: n, onSettled: r }) {
|
|
|
1383
1401
|
" xBZZ"
|
|
1384
1402
|
] })
|
|
1385
1403
|
] }),
|
|
1386
|
-
!b && /* @__PURE__ */ t.jsx(
|
|
1404
|
+
!b && /* @__PURE__ */ t.jsx(q, { onClick: () => window.open("https://www.ethswarm.org/get-bzz", "_blank", "noopener"), children: "get xBZZ" })
|
|
1387
1405
|
] }),
|
|
1388
|
-
|
|
1406
|
+
O && /* @__PURE__ */ t.jsx("div", { style: { fontSize: 12, color: "var(--bad)", fontFamily: "var(--font-mono)" }, children: O })
|
|
1389
1407
|
] });
|
|
1390
1408
|
}
|
|
1391
|
-
function
|
|
1409
|
+
function ht(n) {
|
|
1392
1410
|
try {
|
|
1393
1411
|
return n();
|
|
1394
1412
|
} catch {
|
|
1395
1413
|
return;
|
|
1396
1414
|
}
|
|
1397
1415
|
}
|
|
1398
|
-
function
|
|
1416
|
+
function On({ locked: n, nodeWallet: r }) {
|
|
1399
1417
|
if (n) return /* @__PURE__ */ t.jsx(ee, { children: "Bring your Bee node online to read its wallet." });
|
|
1400
1418
|
if (r.error)
|
|
1401
1419
|
return /* @__PURE__ */ t.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 10 }, children: [
|
|
1402
|
-
/* @__PURE__ */ t.jsx(
|
|
1403
|
-
/* @__PURE__ */ t.jsx(
|
|
1420
|
+
/* @__PURE__ */ t.jsx(H, { tone: "bad", title: "Could not read node wallet", sub: r.error }),
|
|
1421
|
+
/* @__PURE__ */ t.jsx(q, { onClick: r.refresh, children: "retry" })
|
|
1404
1422
|
] });
|
|
1405
1423
|
const a = r.isLoading && r.xdai === void 0;
|
|
1406
1424
|
return /* @__PURE__ */ t.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: [
|
|
1407
|
-
/* @__PURE__ */ t.jsx(
|
|
1408
|
-
/* @__PURE__ */ t.jsx(
|
|
1409
|
-
/* @__PURE__ */ t.jsxs("div", { style:
|
|
1425
|
+
/* @__PURE__ */ t.jsx(Ae, { symbol: "xDAI", role: "gas for the node's own transactions", amount: r.xdai ?? 0, loading: a }),
|
|
1426
|
+
/* @__PURE__ */ t.jsx(Ae, { symbol: "xBZZ", role: "pays for postage stamps", amount: r.xbzz ?? 0, loading: a }),
|
|
1427
|
+
/* @__PURE__ */ t.jsxs("div", { style: be, children: [
|
|
1410
1428
|
"The Bee node has its own wallet",
|
|
1411
1429
|
r.address && /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
1412
1430
|
" ",
|
|
@@ -1419,17 +1437,17 @@ function $n({ locked: n, nodeWallet: r }) {
|
|
|
1419
1437
|
" ",
|
|
1420
1438
|
"— it buys and renews postage stamps on chain."
|
|
1421
1439
|
] }),
|
|
1422
|
-
!r.isFunded && r.address && /* @__PURE__ */ t.jsx(
|
|
1440
|
+
!r.isFunded && r.address && /* @__PURE__ */ t.jsx(Dn, { to: r.address, onSettled: r.refresh })
|
|
1423
1441
|
] });
|
|
1424
1442
|
}
|
|
1425
1443
|
function zn({ stamp: n, selected: r, onSelect: a }) {
|
|
1426
|
-
const [
|
|
1444
|
+
const [i, s] = F(!1), d = Math.floor(n.batchTTL / 86400), h = `${n.batchID.slice(0, 8)}…${n.batchID.slice(-6)}`, p = r || i;
|
|
1427
1445
|
return /* @__PURE__ */ t.jsxs(
|
|
1428
1446
|
"button",
|
|
1429
1447
|
{
|
|
1430
1448
|
onClick: a,
|
|
1431
|
-
onMouseEnter: () =>
|
|
1432
|
-
onMouseLeave: () =>
|
|
1449
|
+
onMouseEnter: () => s(!0),
|
|
1450
|
+
onMouseLeave: () => s(!1),
|
|
1433
1451
|
style: {
|
|
1434
1452
|
display: "flex",
|
|
1435
1453
|
alignItems: "center",
|
|
@@ -1439,7 +1457,7 @@ function zn({ stamp: n, selected: r, onSelect: a }) {
|
|
|
1439
1457
|
padding: "12px 14px",
|
|
1440
1458
|
borderRadius: 8,
|
|
1441
1459
|
cursor: "pointer",
|
|
1442
|
-
border: `1px solid ${r ? "var(--ok-line)" :
|
|
1460
|
+
border: `1px solid ${r ? "var(--ok-line)" : p ? "var(--line-2)" : "var(--line)"}`,
|
|
1443
1461
|
background: r ? "var(--ok-wash)" : "var(--raised)",
|
|
1444
1462
|
boxShadow: r ? "0 0 0 1px var(--ok-line), 0 0 18px var(--ok-wash)" : "none",
|
|
1445
1463
|
transition: "all .15s var(--ease)"
|
|
@@ -1455,7 +1473,7 @@ function zn({ stamp: n, selected: r, onSelect: a }) {
|
|
|
1455
1473
|
transition: "all .15s var(--ease)"
|
|
1456
1474
|
} }),
|
|
1457
1475
|
/* @__PURE__ */ t.jsxs("div", { style: { minWidth: 0, flex: 1 }, children: [
|
|
1458
|
-
/* @__PURE__ */ t.jsx("div", { style: { fontFamily: "var(--font-mono)", fontSize: 12.5, color: "var(--fg)" }, children:
|
|
1476
|
+
/* @__PURE__ */ t.jsx("div", { style: { fontFamily: "var(--font-mono)", fontSize: 12.5, color: "var(--fg)" }, children: h }),
|
|
1459
1477
|
/* @__PURE__ */ t.jsxs("div", { style: { fontSize: 11.5, color: "var(--fg-muted)", marginTop: 3, display: "flex", gap: 8 }, children: [
|
|
1460
1478
|
n.label && /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
1461
1479
|
/* @__PURE__ */ t.jsx("span", { children: n.label }),
|
|
@@ -1468,75 +1486,25 @@ function zn({ stamp: n, selected: r, onSelect: a }) {
|
|
|
1468
1486
|
] })
|
|
1469
1487
|
] }),
|
|
1470
1488
|
/* @__PURE__ */ t.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 8, flexShrink: 0 }, children: [
|
|
1471
|
-
/* @__PURE__ */ t.jsx("span", { style: { fontFamily: "var(--font-mono)", fontSize: 11, color:
|
|
1472
|
-
/* @__PURE__ */ t.jsx(
|
|
1489
|
+
/* @__PURE__ */ t.jsx("span", { style: { fontFamily: "var(--font-mono)", fontSize: 11, color: d > 30 ? "var(--fg-muted)" : "var(--warn)" }, children: d > 0 ? `${d}d ttl` : "expiring" }),
|
|
1490
|
+
/* @__PURE__ */ t.jsx(ue, { tone: n.usable ? "ok" : "bad", children: n.usable ? "usable" : "unusable" })
|
|
1473
1491
|
] })
|
|
1474
1492
|
]
|
|
1475
1493
|
}
|
|
1476
1494
|
);
|
|
1477
1495
|
}
|
|
1478
|
-
function
|
|
1479
|
-
return /* @__PURE__ */ t.jsxs("label", { style: { display: "flex", flexDirection: "column", gap: 4, flex: i ? `0 0 ${i}px` : 1, minWidth: 0 }, children: [
|
|
1480
|
-
/* @__PURE__ */ t.jsx("span", { style: { fontFamily: "var(--font-mono)", fontSize: 9.5, letterSpacing: ".1em", textTransform: "uppercase", color: "var(--fg-faint)" }, children: n }),
|
|
1481
|
-
/* @__PURE__ */ t.jsx(
|
|
1482
|
-
"input",
|
|
1483
|
-
{
|
|
1484
|
-
value: r,
|
|
1485
|
-
placeholder: s,
|
|
1486
|
-
spellCheck: !1,
|
|
1487
|
-
autoComplete: "off",
|
|
1488
|
-
onChange: (l) => a(l.target.value),
|
|
1489
|
-
style: {
|
|
1490
|
-
minWidth: 0,
|
|
1491
|
-
background: "var(--surface)",
|
|
1492
|
-
border: "1px solid var(--line-2)",
|
|
1493
|
-
borderRadius: 6,
|
|
1494
|
-
outline: "none",
|
|
1495
|
-
color: "var(--fg)",
|
|
1496
|
-
fontFamily: "var(--font-mono)",
|
|
1497
|
-
fontSize: 12,
|
|
1498
|
-
padding: "8px 10px"
|
|
1499
|
-
}
|
|
1500
|
-
}
|
|
1501
|
-
)
|
|
1502
|
-
] });
|
|
1503
|
-
}
|
|
1504
|
-
function Ln({ stamps: n }) {
|
|
1505
|
-
const [r, a] = T(""), [s, i] = T(String(xn)), [l, p] = T(bn);
|
|
1506
|
-
if (n.isCreating)
|
|
1507
|
-
return /* @__PURE__ */ t.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 12, padding: "12px 14px", border: "1px solid var(--line)", borderRadius: 8, background: "var(--raised)" }, children: [
|
|
1508
|
-
/* @__PURE__ */ t.jsx(ce, {}),
|
|
1509
|
-
/* @__PURE__ */ t.jsx("span", { style: { color: "var(--fg-muted)", fontSize: 13, fontFamily: "var(--font-mono)" }, children: "buying stamp — waiting for the on-chain batch…" })
|
|
1510
|
-
] });
|
|
1511
|
-
const h = Number(s), d = Number.isInteger(h) && h >= 17 && /^\d+$/.test(l.trim());
|
|
1512
|
-
return /* @__PURE__ */ t.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 8, padding: "12px 14px", border: "1px dashed var(--line-2)", borderRadius: 8, background: "var(--bunker)" }, children: [
|
|
1513
|
-
/* @__PURE__ */ t.jsxs("div", { style: { display: "flex", gap: 8 }, children: [
|
|
1514
|
-
/* @__PURE__ */ t.jsx(Ie, { label: "label", value: r, onChange: a, placeholder: "optional" }),
|
|
1515
|
-
/* @__PURE__ */ t.jsx(Ie, { label: "depth", value: s, onChange: i, width: 64 }),
|
|
1516
|
-
/* @__PURE__ */ t.jsx(Ie, { label: "amount (plur)", value: l, onChange: p, width: 120 })
|
|
1517
|
-
] }),
|
|
1518
|
-
/* @__PURE__ */ t.jsx("div", { style: oe, children: "Cost ≈ 2^depth × amount PLUR, paid in xBZZ from the node wallet. Higher amount → longer stamp lifetime." }),
|
|
1519
|
-
/* @__PURE__ */ t.jsx(
|
|
1520
|
-
Oe,
|
|
1521
|
-
{
|
|
1522
|
-
block: !0,
|
|
1523
|
-
onClick: () => d && n.createStamp({ amount: l.trim(), depth: h, label: r.trim() || void 0 }),
|
|
1524
|
-
style: d ? void 0 : { opacity: 0.5, cursor: "default" },
|
|
1525
|
-
children: "buy stamp"
|
|
1526
|
-
}
|
|
1527
|
-
),
|
|
1528
|
-
n.createError && /* @__PURE__ */ t.jsx("div", { style: { fontSize: 12, color: "var(--bad)", fontFamily: "var(--font-mono)" }, children: n.createError })
|
|
1529
|
-
] });
|
|
1530
|
-
}
|
|
1531
|
-
function Wn({ stamps: n, locked: r, lockedHint: a, canCreate: s }) {
|
|
1496
|
+
function An({ stamps: n, locked: r, lockedHint: a }) {
|
|
1532
1497
|
return r ? /* @__PURE__ */ t.jsx(ee, { children: a }) : n.isLoading ? /* @__PURE__ */ t.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 12, padding: "12px 14px", border: "1px solid var(--line)", borderRadius: 8, background: "var(--raised)" }, children: [
|
|
1533
|
-
/* @__PURE__ */ t.jsx(
|
|
1498
|
+
/* @__PURE__ */ t.jsx(ke, {}),
|
|
1534
1499
|
/* @__PURE__ */ t.jsx("span", { style: { color: "var(--fg-muted)", fontSize: 13, fontFamily: "var(--font-mono)" }, children: "reading /stamps…" })
|
|
1535
1500
|
] }) : n.error ? /* @__PURE__ */ t.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 10 }, children: [
|
|
1536
|
-
/* @__PURE__ */ t.jsx(
|
|
1537
|
-
/* @__PURE__ */ t.jsx(
|
|
1501
|
+
/* @__PURE__ */ t.jsx(H, { tone: "bad", title: "Could not read stamps", sub: n.error }),
|
|
1502
|
+
/* @__PURE__ */ t.jsx(q, { onClick: n.fetchStamps, children: "retry" })
|
|
1538
1503
|
] }) : /* @__PURE__ */ t.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: [
|
|
1539
|
-
n.stamps.length === 0 &&
|
|
1504
|
+
n.stamps.length === 0 && /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
1505
|
+
/* @__PURE__ */ t.jsx(ee, { children: "No postage stamps on this node yet — once the dApp buys one it will appear here." }),
|
|
1506
|
+
/* @__PURE__ */ t.jsx(q, { onClick: n.fetchStamps, children: "refresh" })
|
|
1507
|
+
] }),
|
|
1540
1508
|
n.stamps.map((i) => /* @__PURE__ */ t.jsx(
|
|
1541
1509
|
zn,
|
|
1542
1510
|
{
|
|
@@ -1545,44 +1513,98 @@ function Wn({ stamps: n, locked: r, lockedHint: a, canCreate: s }) {
|
|
|
1545
1513
|
onSelect: () => n.selectStamp(i.batchID)
|
|
1546
1514
|
},
|
|
1547
1515
|
i.batchID
|
|
1548
|
-
))
|
|
1549
|
-
s && /* @__PURE__ */ t.jsx(Ln, { stamps: n })
|
|
1516
|
+
))
|
|
1550
1517
|
] });
|
|
1551
1518
|
}
|
|
1552
|
-
const
|
|
1519
|
+
const be = {
|
|
1553
1520
|
fontSize: 11.5,
|
|
1554
1521
|
color: "var(--fg-faint)",
|
|
1555
1522
|
lineHeight: 1.5,
|
|
1556
1523
|
paddingLeft: 2
|
|
1557
1524
|
};
|
|
1558
|
-
function
|
|
1525
|
+
function $n({
|
|
1559
1526
|
onClose: n,
|
|
1560
1527
|
beeNode: r,
|
|
1561
1528
|
stamps: a,
|
|
1562
|
-
beeApiUrl:
|
|
1563
|
-
setBeeApiUrl:
|
|
1564
|
-
|
|
1565
|
-
nodeWallet:
|
|
1529
|
+
beeApiUrl: i,
|
|
1530
|
+
setBeeApiUrl: s,
|
|
1531
|
+
requirements: d,
|
|
1532
|
+
nodeWallet: h
|
|
1566
1533
|
}) {
|
|
1567
|
-
|
|
1568
|
-
const
|
|
1569
|
-
address:
|
|
1570
|
-
chainId:
|
|
1534
|
+
yt();
|
|
1535
|
+
const p = { ...xt, ...d }, { address: u, isConnected: o, chainId: l } = we(), v = o && l === G, { data: g, isLoading: b } = vt({
|
|
1536
|
+
address: u,
|
|
1537
|
+
chainId: G,
|
|
1571
1538
|
query: { enabled: o }
|
|
1572
|
-
}),
|
|
1539
|
+
}), _ = g ? Number(g.formatted) : void 0, E = v && !!g && g.value > 0n, O = { xdai: _, isLoading: o && b, hasGas: E }, S = bt(i), w = h ?? S, I = Jt(!1);
|
|
1573
1540
|
Q(() => {
|
|
1574
|
-
r.check();
|
|
1575
|
-
}, [
|
|
1576
|
-
r.isRunning && (a.fetchStamps(),
|
|
1541
|
+
!I.current && (I.current = !0, r.isRunning) || r.check();
|
|
1542
|
+
}, [i]), Q(() => {
|
|
1543
|
+
r.isRunning && (a.fetchStamps(), p.xbzz && w.refresh());
|
|
1577
1544
|
}, [r.isRunning]);
|
|
1578
|
-
const
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1545
|
+
const R = !p.xdai || E, k = !p.xbzz || w.isFunded, z = o ? "done" : "active", Y = o ? v ? "done" : "active" : "locked", Z = v ? E ? "done" : "active" : "locked", W = v && R ? r.isRunning ? "done" : "active" : "locked", te = W !== "done" ? "locked" : w.isFunded ? "done" : "active", ne = W === "done" && k ? a.selectedStampId ? "done" : "active" : "locked", re = o && v && r.isRunning && R && k && (!p.postageStamp || !!a.selectedStampId), { disconnect: B } = gt(), M = () => {
|
|
1546
|
+
B(), r.disconnect(), n();
|
|
1547
|
+
}, N = [
|
|
1548
|
+
{
|
|
1549
|
+
key: "wallet",
|
|
1550
|
+
title: "Wallet",
|
|
1551
|
+
state: z,
|
|
1552
|
+
hint: o ? "linked" : null,
|
|
1553
|
+
body: /* @__PURE__ */ t.jsx(En, { isConnected: o, address: u })
|
|
1554
|
+
},
|
|
1555
|
+
{
|
|
1556
|
+
key: "network",
|
|
1557
|
+
title: "Network chain",
|
|
1558
|
+
state: Y,
|
|
1559
|
+
hint: o ? v ? "gnosis" : "wrong net" : null,
|
|
1560
|
+
body: /* @__PURE__ */ t.jsx(In, { locked: Y === "locked", isOnGnosis: v, chainId: l })
|
|
1561
|
+
},
|
|
1562
|
+
...p.xdai ? [{
|
|
1563
|
+
key: "balance",
|
|
1564
|
+
title: "Balance",
|
|
1565
|
+
state: Z,
|
|
1566
|
+
hint: v ? E ? "funded" : "low" : null,
|
|
1567
|
+
body: /* @__PURE__ */ t.jsx(Tn, { locked: Z === "locked", balance: O })
|
|
1568
|
+
}] : [],
|
|
1569
|
+
{
|
|
1570
|
+
key: "node",
|
|
1571
|
+
title: "Bee node",
|
|
1572
|
+
state: W,
|
|
1573
|
+
hint: r.isRunning ? r.version : null,
|
|
1574
|
+
body: W === "locked" ? /* @__PURE__ */ t.jsx(ee, { children: p.xdai ? "Top up xDAI gas to unlock the Bee node connection." : "Switch to the Gnosis chain to unlock the Bee node connection." }) : /* @__PURE__ */ t.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 10 }, children: [
|
|
1575
|
+
/* @__PURE__ */ t.jsx(Fn, { value: i, disabled: r.isChecking, onSubmit: s }),
|
|
1576
|
+
/* @__PURE__ */ t.jsx(Pn, { node: r, beeApiUrl: i })
|
|
1577
|
+
] })
|
|
1578
|
+
},
|
|
1579
|
+
...p.xbzz ? [{
|
|
1580
|
+
key: "nodeWallet",
|
|
1581
|
+
title: "Node wallet",
|
|
1582
|
+
state: te,
|
|
1583
|
+
hint: te === "locked" ? null : w.isFunded ? "funded" : "top up",
|
|
1584
|
+
body: /* @__PURE__ */ t.jsx(On, { locked: te === "locked", nodeWallet: w })
|
|
1585
|
+
}] : [],
|
|
1586
|
+
...p.postageStamp ? [{
|
|
1587
|
+
key: "stamp",
|
|
1588
|
+
title: "Postage stamp",
|
|
1589
|
+
state: ne,
|
|
1590
|
+
hint: a.selectedStampId ? "1 selected" : ne !== "locked" ? `${a.stamps.length} found` : null,
|
|
1591
|
+
body: /* @__PURE__ */ t.jsx(
|
|
1592
|
+
An,
|
|
1593
|
+
{
|
|
1594
|
+
stamps: a,
|
|
1595
|
+
locked: ne === "locked",
|
|
1596
|
+
lockedHint: p.xbzz ? "Fund the node wallet to manage postage stamps." : "Bring a node online to load its postage stamps."
|
|
1597
|
+
}
|
|
1598
|
+
)
|
|
1599
|
+
}] : []
|
|
1600
|
+
], fe = N.map((D) => ({
|
|
1601
|
+
wallet: "wallet",
|
|
1602
|
+
network: "chain",
|
|
1603
|
+
balance: "gas",
|
|
1604
|
+
node: "node",
|
|
1605
|
+
nodeWallet: "fund",
|
|
1606
|
+
stamp: "stamp"
|
|
1607
|
+
})[D.key]).join(" · ");
|
|
1586
1608
|
return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
1587
1609
|
/* @__PURE__ */ t.jsx("div", { className: "swarm-connect", onClick: n, style: {
|
|
1588
1610
|
position: "fixed",
|
|
@@ -1613,12 +1635,12 @@ function Bn({
|
|
|
1613
1635
|
/* @__PURE__ */ t.jsx("div", { style: { position: "absolute", inset: 0, pointerEvents: "none", background: "radial-gradient(ellipse 60% 140% at 88% 0%, var(--accent-wash), transparent 70%)" } }),
|
|
1614
1636
|
/* @__PURE__ */ t.jsxs("div", { style: { position: "relative", display: "flex", alignItems: "center", justifyContent: "space-between" }, children: [
|
|
1615
1637
|
/* @__PURE__ */ t.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 11 }, children: [
|
|
1616
|
-
/* @__PURE__ */ t.jsx(
|
|
1638
|
+
/* @__PURE__ */ t.jsx(Sn, { size: 30 }),
|
|
1617
1639
|
/* @__PURE__ */ t.jsxs("div", { children: [
|
|
1618
1640
|
/* @__PURE__ */ t.jsx("div", { style: { fontFamily: "var(--font-display)", fontWeight: 600, fontSize: 16, color: "var(--fg)", lineHeight: 1.1 }, children: "Connect to Swarm" }),
|
|
1619
1641
|
/* @__PURE__ */ t.jsxs("div", { style: { fontFamily: "var(--font-mono)", fontSize: 10, letterSpacing: ".12em", color: "var(--fg-muted)", marginTop: 3 }, children: [
|
|
1620
1642
|
"// ",
|
|
1621
|
-
|
|
1643
|
+
re ? "ready" : fe
|
|
1622
1644
|
] })
|
|
1623
1645
|
] })
|
|
1624
1646
|
] }),
|
|
@@ -1642,99 +1664,106 @@ function Bn({
|
|
|
1642
1664
|
justifyContent: "center",
|
|
1643
1665
|
transition: "all .15s"
|
|
1644
1666
|
},
|
|
1645
|
-
onMouseEnter: (
|
|
1646
|
-
|
|
1667
|
+
onMouseEnter: (D) => {
|
|
1668
|
+
D.currentTarget.style.borderColor = "var(--line-orange)", D.currentTarget.style.color = "var(--accent-bright)";
|
|
1647
1669
|
},
|
|
1648
|
-
onMouseLeave: (
|
|
1649
|
-
|
|
1670
|
+
onMouseLeave: (D) => {
|
|
1671
|
+
D.currentTarget.style.borderColor = "var(--line)", D.currentTarget.style.color = "var(--fg-muted)";
|
|
1650
1672
|
},
|
|
1651
1673
|
children: "×"
|
|
1652
1674
|
}
|
|
1653
1675
|
)
|
|
1654
1676
|
] })
|
|
1655
1677
|
] }),
|
|
1656
|
-
/* @__PURE__ */ t.
|
|
1657
|
-
/* @__PURE__ */ t.
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
/* @__PURE__ */ t.jsxs("section", { style: { opacity: C === "locked" ? 0.55 : 1, transition: "opacity .3s var(--ease)" }, children: [
|
|
1662
|
-
/* @__PURE__ */ t.jsx(J, { step: 2, state: C, hint: o ? v ? "gnosis" : "wrong net" : null, children: "Network chain" }),
|
|
1663
|
-
/* @__PURE__ */ t.jsx(Fn, { locked: C === "locked", isOnGnosis: v, chainId: u })
|
|
1664
|
-
] }),
|
|
1665
|
-
/* @__PURE__ */ t.jsxs("section", { style: { opacity: k === "locked" ? 0.55 : 1, transition: "opacity .3s var(--ease)" }, children: [
|
|
1666
|
-
/* @__PURE__ */ t.jsx(J, { step: 3, state: k, hint: v ? _ ? "funded" : "low" : null, children: "Balance" }),
|
|
1667
|
-
/* @__PURE__ */ t.jsx(Pn, { locked: k === "locked", balance: A })
|
|
1668
|
-
] }),
|
|
1669
|
-
/* @__PURE__ */ t.jsxs("section", { style: { opacity: D === "locked" ? 0.55 : 1, transition: "opacity .3s var(--ease)" }, children: [
|
|
1670
|
-
/* @__PURE__ */ t.jsx(J, { step: 4, state: D, hint: r.isRunning ? r.version : null, children: "Bee node" }),
|
|
1671
|
-
D === "locked" ? /* @__PURE__ */ t.jsx(ee, { children: "Top up xDAI gas to unlock the Bee node connection." }) : /* @__PURE__ */ t.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 10 }, children: [
|
|
1672
|
-
/* @__PURE__ */ t.jsx(Dn, { value: s, disabled: r.isChecking, onSubmit: i }),
|
|
1673
|
-
/* @__PURE__ */ t.jsx(An, { node: r, beeApiUrl: s })
|
|
1674
|
-
] })
|
|
1675
|
-
] }),
|
|
1676
|
-
h && /* @__PURE__ */ t.jsxs("section", { style: { opacity: W === "locked" ? 0.55 : 1, transition: "opacity .3s var(--ease)" }, children: [
|
|
1677
|
-
/* @__PURE__ */ t.jsx(
|
|
1678
|
-
J,
|
|
1679
|
-
{
|
|
1680
|
-
step: 5,
|
|
1681
|
-
state: W,
|
|
1682
|
-
hint: W === "locked" ? null : w.isFunded ? "funded" : "top up",
|
|
1683
|
-
children: "Node wallet"
|
|
1684
|
-
}
|
|
1685
|
-
),
|
|
1686
|
-
/* @__PURE__ */ t.jsx($n, { locked: W === "locked", nodeWallet: w })
|
|
1687
|
-
] }),
|
|
1688
|
-
/* @__PURE__ */ t.jsxs("section", { style: { opacity: B === "locked" ? 0.55 : 1, transition: "opacity .3s var(--ease)" }, children: [
|
|
1689
|
-
/* @__PURE__ */ t.jsx(
|
|
1690
|
-
J,
|
|
1691
|
-
{
|
|
1692
|
-
step: be,
|
|
1693
|
-
state: B,
|
|
1694
|
-
hint: a.selectedStampId ? "1 selected" : V ? `${a.stamps.length} found` : null,
|
|
1695
|
-
children: "Postage stamp"
|
|
1696
|
-
}
|
|
1697
|
-
),
|
|
1698
|
-
/* @__PURE__ */ t.jsx(
|
|
1699
|
-
Wn,
|
|
1700
|
-
{
|
|
1701
|
-
stamps: a,
|
|
1702
|
-
locked: B === "locked",
|
|
1703
|
-
canCreate: h,
|
|
1704
|
-
lockedHint: h ? "Fund the node wallet to manage postage stamps." : "Bring a node online to load its postage stamps."
|
|
1705
|
-
}
|
|
1706
|
-
)
|
|
1707
|
-
] })
|
|
1708
|
-
] }),
|
|
1709
|
-
/* @__PURE__ */ t.jsxs("div", { style: {
|
|
1678
|
+
/* @__PURE__ */ t.jsx("div", { className: "sc-scroll", style: { padding: 20, display: "flex", flexDirection: "column", gap: 24, maxHeight: "62vh", overflowY: "auto" }, children: N.map((D, ae) => /* @__PURE__ */ t.jsxs("section", { style: ae === 0 ? { animation: "sc-step-in .3s var(--ease)" } : { opacity: D.state === "locked" ? 0.55 : 1, transition: "opacity .3s var(--ease)" }, children: [
|
|
1679
|
+
/* @__PURE__ */ t.jsx(jn, { step: ae + 1, state: D.state, hint: D.hint, children: D.title }),
|
|
1680
|
+
D.body
|
|
1681
|
+
] }, D.key)) }),
|
|
1682
|
+
re ? /* @__PURE__ */ t.jsx(Ln, { onDisconnect: M, onDone: n }) : /* @__PURE__ */ t.jsxs("div", { style: {
|
|
1710
1683
|
padding: "12px 20px",
|
|
1711
1684
|
borderTop: "1px solid var(--line)",
|
|
1712
1685
|
display: "flex",
|
|
1713
1686
|
alignItems: "center",
|
|
1714
1687
|
justifyContent: "space-between",
|
|
1715
|
-
background:
|
|
1688
|
+
background: "var(--bunker)",
|
|
1716
1689
|
transition: "background .3s"
|
|
1717
1690
|
}, children: [
|
|
1718
|
-
/* @__PURE__ */ t.jsx("span", { style: { fontFamily: "var(--font-mono)", fontSize: 11, letterSpacing: ".06em", color:
|
|
1719
|
-
|
|
1720
|
-
/* @__PURE__ */ t.jsx("span", { style: { width: 7, height: 7, borderRadius: "50%", background: "var(--ok)", boxShadow: "0 0 8px var(--ok)" } }),
|
|
1721
|
-
"done"
|
|
1722
|
-
] }) : /* @__PURE__ */ t.jsx(_n, { states: de })
|
|
1691
|
+
/* @__PURE__ */ t.jsx("span", { style: { fontFamily: "var(--font-mono)", fontSize: 11, letterSpacing: ".06em", color: "var(--fg-muted)" }, children: "// gated · each step unlocks the next" }),
|
|
1692
|
+
/* @__PURE__ */ t.jsx(Cn, { states: N.map((D) => D.state === "done") })
|
|
1723
1693
|
] })
|
|
1724
1694
|
] })
|
|
1725
1695
|
] });
|
|
1726
1696
|
}
|
|
1727
|
-
function
|
|
1728
|
-
|
|
1729
|
-
|
|
1697
|
+
function Ln({ onDisconnect: n, onDone: r }) {
|
|
1698
|
+
const [a, i] = F(!1), [s, d] = F(!1);
|
|
1699
|
+
return /* @__PURE__ */ t.jsxs("div", { style: { display: "flex", borderTop: "1px solid var(--line)" }, children: [
|
|
1700
|
+
/* @__PURE__ */ t.jsx(
|
|
1701
|
+
"button",
|
|
1702
|
+
{
|
|
1703
|
+
onClick: n,
|
|
1704
|
+
onMouseEnter: () => i(!0),
|
|
1705
|
+
onMouseLeave: () => i(!1),
|
|
1706
|
+
style: {
|
|
1707
|
+
flex: "1 1 50%",
|
|
1708
|
+
minWidth: 0,
|
|
1709
|
+
padding: "13px 20px",
|
|
1710
|
+
cursor: "pointer",
|
|
1711
|
+
background: a ? "var(--bad-wash)" : "var(--bunker)",
|
|
1712
|
+
border: "none",
|
|
1713
|
+
borderRight: "1px solid var(--line)",
|
|
1714
|
+
color: a ? "var(--bad)" : "var(--fg-muted)",
|
|
1715
|
+
fontFamily: "var(--font-mono)",
|
|
1716
|
+
fontSize: 11,
|
|
1717
|
+
fontWeight: 600,
|
|
1718
|
+
letterSpacing: ".1em",
|
|
1719
|
+
textTransform: "uppercase",
|
|
1720
|
+
transition: "all .15s var(--ease)",
|
|
1721
|
+
whiteSpace: "nowrap"
|
|
1722
|
+
},
|
|
1723
|
+
children: "disconnect"
|
|
1724
|
+
}
|
|
1725
|
+
),
|
|
1726
|
+
/* @__PURE__ */ t.jsx(
|
|
1727
|
+
"button",
|
|
1728
|
+
{
|
|
1729
|
+
onClick: r,
|
|
1730
|
+
onMouseEnter: () => d(!0),
|
|
1731
|
+
onMouseLeave: () => d(!1),
|
|
1732
|
+
style: {
|
|
1733
|
+
flex: "1 1 50%",
|
|
1734
|
+
minWidth: 0,
|
|
1735
|
+
padding: "13px 20px",
|
|
1736
|
+
cursor: "pointer",
|
|
1737
|
+
background: s ? "var(--ok-wash)" : "var(--bunker)",
|
|
1738
|
+
border: "none",
|
|
1739
|
+
color: "var(--ok)",
|
|
1740
|
+
fontFamily: "var(--font-mono)",
|
|
1741
|
+
fontSize: 11,
|
|
1742
|
+
fontWeight: 600,
|
|
1743
|
+
letterSpacing: ".1em",
|
|
1744
|
+
textTransform: "uppercase",
|
|
1745
|
+
transition: "all .15s var(--ease)",
|
|
1746
|
+
whiteSpace: "nowrap"
|
|
1747
|
+
},
|
|
1748
|
+
children: /* @__PURE__ */ t.jsxs("span", { style: { display: "inline-flex", alignItems: "center", gap: 7 }, children: [
|
|
1749
|
+
/* @__PURE__ */ t.jsx("span", { style: { width: 7, height: 7, borderRadius: "50%", background: "var(--ok)", boxShadow: "0 0 8px var(--ok)" } }),
|
|
1750
|
+
"connected"
|
|
1751
|
+
] })
|
|
1752
|
+
}
|
|
1753
|
+
)
|
|
1754
|
+
] });
|
|
1755
|
+
}
|
|
1756
|
+
function Kn({ beeApiUrl: n = de, requirements: r, label: a }) {
|
|
1757
|
+
yt();
|
|
1758
|
+
const [i, s] = F(!1), d = yn({ beeApiUrl: n, requirements: r }), { beeApiUrl: h, setBeeApiUrl: p, beeNode: u, stamps: o, nodeWallet: l, isFullyConnected: v, address: g } = d, [b, _] = F(!1), E = a ?? (v && g ? `${g.slice(0, 6)}…${g.slice(-4)}` : "Connect to Swarm");
|
|
1730
1759
|
return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
1731
1760
|
/* @__PURE__ */ t.jsxs(
|
|
1732
1761
|
"button",
|
|
1733
1762
|
{
|
|
1734
1763
|
className: "swarm-connect",
|
|
1735
|
-
onClick: () =>
|
|
1736
|
-
onMouseEnter: () =>
|
|
1737
|
-
onMouseLeave: () =>
|
|
1764
|
+
onClick: () => s(!0),
|
|
1765
|
+
onMouseEnter: () => _(!0),
|
|
1766
|
+
onMouseLeave: () => _(!1),
|
|
1738
1767
|
style: {
|
|
1739
1768
|
display: "inline-flex",
|
|
1740
1769
|
alignItems: "center",
|
|
@@ -1755,52 +1784,52 @@ function Xn({ beeApiUrl: n = se, stampMode: r, label: a }) {
|
|
|
1755
1784
|
whiteSpace: "nowrap"
|
|
1756
1785
|
},
|
|
1757
1786
|
children: [
|
|
1758
|
-
v ? /* @__PURE__ */ t.jsx("span", { style: { width: 8, height: 8, borderRadius: "50%", background: "var(--ok)", boxShadow: "0 0 8px var(--ok)" } }) : /* @__PURE__ */ t.jsx(
|
|
1759
|
-
|
|
1787
|
+
v ? /* @__PURE__ */ t.jsx("span", { style: { width: 8, height: 8, borderRadius: "50%", background: "var(--ok)", boxShadow: "0 0 8px var(--ok)" } }) : /* @__PURE__ */ t.jsx(Wn, { swarm: d }),
|
|
1788
|
+
E
|
|
1760
1789
|
]
|
|
1761
1790
|
}
|
|
1762
1791
|
),
|
|
1763
|
-
|
|
1764
|
-
|
|
1792
|
+
i && /* @__PURE__ */ t.jsx(
|
|
1793
|
+
$n,
|
|
1765
1794
|
{
|
|
1766
|
-
onClose: () =>
|
|
1767
|
-
beeNode:
|
|
1795
|
+
onClose: () => s(!1),
|
|
1796
|
+
beeNode: u,
|
|
1768
1797
|
stamps: o,
|
|
1769
|
-
beeApiUrl:
|
|
1770
|
-
setBeeApiUrl:
|
|
1771
|
-
|
|
1772
|
-
nodeWallet:
|
|
1798
|
+
beeApiUrl: h,
|
|
1799
|
+
setBeeApiUrl: p,
|
|
1800
|
+
requirements: d.requirements,
|
|
1801
|
+
nodeWallet: l
|
|
1773
1802
|
}
|
|
1774
1803
|
)
|
|
1775
1804
|
] });
|
|
1776
1805
|
}
|
|
1777
|
-
function
|
|
1778
|
-
const { beeNode: r, stamps: a, nodeWallet:
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1806
|
+
function Wn({ swarm: n }) {
|
|
1807
|
+
const { beeNode: r, stamps: a, nodeWallet: i, requirements: s, isWalletConnected: d, isOnGnosis: h, balance: p } = n, u = [
|
|
1808
|
+
d ? "ok" : "bad",
|
|
1809
|
+
h ? "ok" : "bad",
|
|
1810
|
+
...s.xdai ? [p.hasGas ? "ok" : h ? "warn" : "bad"] : [],
|
|
1782
1811
|
r.isChecking ? "warn" : r.isRunning ? "ok" : "bad",
|
|
1783
|
-
...
|
|
1784
|
-
a.selectedStampId ? "ok" : "bad"
|
|
1812
|
+
...s.xbzz ? [i.isFunded ? "ok" : "bad"] : [],
|
|
1813
|
+
...s.postageStamp ? [a.selectedStampId ? "ok" : "bad"] : []
|
|
1785
1814
|
], o = { ok: "var(--accent-ink)", bad: "rgba(26,14,2,.32)", warn: "#7a4a00" };
|
|
1786
|
-
return /* @__PURE__ */ t.jsx("span", { style: { display: "inline-flex", gap: 4, alignItems: "center" }, children:
|
|
1815
|
+
return /* @__PURE__ */ t.jsx("span", { style: { display: "inline-flex", gap: 4, alignItems: "center" }, children: u.map((l, v) => /* @__PURE__ */ t.jsx("span", { style: { width: 6, height: 6, borderRadius: "50%", background: o[l], animation: l === "warn" ? "sc-pulse-dot 1.4s var(--ease) infinite" : "none" } }, v)) });
|
|
1787
1816
|
}
|
|
1788
|
-
const
|
|
1789
|
-
var
|
|
1790
|
-
if (a === "a" && !
|
|
1791
|
-
if (typeof r == "function" ? n !== r || !
|
|
1792
|
-
return a === "m" ?
|
|
1793
|
-
},
|
|
1794
|
-
class
|
|
1817
|
+
const Bn = "2.22.1", Mn = () => `@wagmi/core@${Bn}`;
|
|
1818
|
+
var kt = function(n, r, a, i) {
|
|
1819
|
+
if (a === "a" && !i) throw new TypeError("Private accessor was defined without a getter");
|
|
1820
|
+
if (typeof r == "function" ? n !== r || !i : !r.has(n)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
1821
|
+
return a === "m" ? i : a === "a" ? i.call(n) : i ? i.value : r.get(n);
|
|
1822
|
+
}, ye, jt;
|
|
1823
|
+
class le extends Error {
|
|
1795
1824
|
get docsBaseUrl() {
|
|
1796
1825
|
return "https://wagmi.sh/core";
|
|
1797
1826
|
}
|
|
1798
1827
|
get version() {
|
|
1799
|
-
return
|
|
1828
|
+
return Mn();
|
|
1800
1829
|
}
|
|
1801
1830
|
constructor(r, a = {}) {
|
|
1802
|
-
var
|
|
1803
|
-
super(),
|
|
1831
|
+
var d;
|
|
1832
|
+
super(), ye.add(this), Object.defineProperty(this, "details", {
|
|
1804
1833
|
enumerable: !0,
|
|
1805
1834
|
configurable: !0,
|
|
1806
1835
|
writable: !0,
|
|
@@ -1826,27 +1855,27 @@ class ie extends Error {
|
|
|
1826
1855
|
writable: !0,
|
|
1827
1856
|
value: "WagmiCoreError"
|
|
1828
1857
|
});
|
|
1829
|
-
const
|
|
1858
|
+
const i = a.cause instanceof le ? a.cause.details : (d = a.cause) != null && d.message ? a.cause.message : a.details, s = a.cause instanceof le && a.cause.docsPath || a.docsPath;
|
|
1830
1859
|
this.message = [
|
|
1831
1860
|
r || "An error occurred.",
|
|
1832
1861
|
"",
|
|
1833
1862
|
...a.metaMessages ? [...a.metaMessages, ""] : [],
|
|
1834
|
-
...
|
|
1835
|
-
`Docs: ${this.docsBaseUrl}${
|
|
1863
|
+
...s ? [
|
|
1864
|
+
`Docs: ${this.docsBaseUrl}${s}.html${a.docsSlug ? `#${a.docsSlug}` : ""}`
|
|
1836
1865
|
] : [],
|
|
1837
|
-
...
|
|
1866
|
+
...i ? [`Details: ${i}`] : [],
|
|
1838
1867
|
`Version: ${this.version}`
|
|
1839
1868
|
].join(`
|
|
1840
|
-
`), a.cause && (this.cause = a.cause), this.details =
|
|
1869
|
+
`), a.cause && (this.cause = a.cause), this.details = i, this.docsPath = s, this.metaMessages = a.metaMessages, this.shortMessage = r;
|
|
1841
1870
|
}
|
|
1842
1871
|
walk(r) {
|
|
1843
|
-
return
|
|
1872
|
+
return kt(this, ye, "m", jt).call(this, this, r);
|
|
1844
1873
|
}
|
|
1845
1874
|
}
|
|
1846
|
-
|
|
1847
|
-
return a != null && a(r) ? r : r.cause ?
|
|
1875
|
+
ye = /* @__PURE__ */ new WeakSet(), jt = function n(r, a) {
|
|
1876
|
+
return a != null && a(r) ? r : r.cause ? kt(this, ye, "m", n).call(this, r.cause, a) : r;
|
|
1848
1877
|
};
|
|
1849
|
-
class
|
|
1878
|
+
class Nn extends le {
|
|
1850
1879
|
constructor() {
|
|
1851
1880
|
super("Chain not configured."), Object.defineProperty(this, "name", {
|
|
1852
1881
|
enumerable: !0,
|
|
@@ -1856,7 +1885,7 @@ class Yn extends ie {
|
|
|
1856
1885
|
});
|
|
1857
1886
|
}
|
|
1858
1887
|
}
|
|
1859
|
-
class X extends
|
|
1888
|
+
class X extends le {
|
|
1860
1889
|
constructor() {
|
|
1861
1890
|
super("Provider not found."), Object.defineProperty(this, "name", {
|
|
1862
1891
|
enumerable: !0,
|
|
@@ -1869,18 +1898,18 @@ class X extends ie {
|
|
|
1869
1898
|
$e.type = "injected";
|
|
1870
1899
|
function $e(n = {}) {
|
|
1871
1900
|
const { shimDisconnect: r = !0, unstable_shimAsyncInject: a } = n;
|
|
1872
|
-
function
|
|
1873
|
-
const
|
|
1874
|
-
if (typeof
|
|
1875
|
-
const o =
|
|
1901
|
+
function i() {
|
|
1902
|
+
const u = n.target;
|
|
1903
|
+
if (typeof u == "function") {
|
|
1904
|
+
const o = u();
|
|
1876
1905
|
if (o)
|
|
1877
1906
|
return o;
|
|
1878
1907
|
}
|
|
1879
|
-
return typeof
|
|
1880
|
-
...
|
|
1881
|
-
id:
|
|
1882
|
-
name: `${
|
|
1883
|
-
provider: `is${
|
|
1908
|
+
return typeof u == "object" ? u : typeof u == "string" ? {
|
|
1909
|
+
...Un[u] ?? {
|
|
1910
|
+
id: u,
|
|
1911
|
+
name: `${u[0].toUpperCase()}${u.slice(1)}`,
|
|
1912
|
+
provider: `is${u[0].toUpperCase()}${u.slice(1)}`
|
|
1884
1913
|
}
|
|
1885
1914
|
} : {
|
|
1886
1915
|
id: "injected",
|
|
@@ -1890,16 +1919,16 @@ function $e(n = {}) {
|
|
|
1890
1919
|
}
|
|
1891
1920
|
};
|
|
1892
1921
|
}
|
|
1893
|
-
let
|
|
1894
|
-
return (
|
|
1922
|
+
let s, d, h, p;
|
|
1923
|
+
return (u) => ({
|
|
1895
1924
|
get icon() {
|
|
1896
|
-
return
|
|
1925
|
+
return i().icon;
|
|
1897
1926
|
},
|
|
1898
1927
|
get id() {
|
|
1899
|
-
return
|
|
1928
|
+
return i().id;
|
|
1900
1929
|
},
|
|
1901
1930
|
get name() {
|
|
1902
|
-
return
|
|
1931
|
+
return i().name;
|
|
1903
1932
|
},
|
|
1904
1933
|
/** @deprecated */
|
|
1905
1934
|
get supportsSimulation() {
|
|
@@ -1908,59 +1937,59 @@ function $e(n = {}) {
|
|
|
1908
1937
|
type: $e.type,
|
|
1909
1938
|
async setup() {
|
|
1910
1939
|
const o = await this.getProvider();
|
|
1911
|
-
o != null && o.on && n.target && (
|
|
1940
|
+
o != null && o.on && n.target && (h || (h = this.onConnect.bind(this), o.on("connect", h)), s || (s = this.onAccountsChanged.bind(this), o.on("accountsChanged", s)));
|
|
1912
1941
|
},
|
|
1913
|
-
async connect({ chainId: o, isReconnecting:
|
|
1914
|
-
var
|
|
1942
|
+
async connect({ chainId: o, isReconnecting: l, withCapabilities: v } = {}) {
|
|
1943
|
+
var _, E, O, S, w, I;
|
|
1915
1944
|
const g = await this.getProvider();
|
|
1916
1945
|
if (!g)
|
|
1917
1946
|
throw new X();
|
|
1918
1947
|
let b = [];
|
|
1919
|
-
if (
|
|
1948
|
+
if (l)
|
|
1920
1949
|
b = await this.getAccounts().catch(() => []);
|
|
1921
1950
|
else if (r)
|
|
1922
1951
|
try {
|
|
1923
|
-
b = (S = (
|
|
1952
|
+
b = (S = (O = (E = (_ = (await g.request({
|
|
1924
1953
|
method: "wallet_requestPermissions",
|
|
1925
1954
|
params: [{ eth_accounts: {} }]
|
|
1926
|
-
}))[0]) == null ? void 0 :
|
|
1927
|
-
} catch (
|
|
1928
|
-
const k =
|
|
1929
|
-
if (k.code ===
|
|
1930
|
-
throw new
|
|
1931
|
-
if (k.code ===
|
|
1955
|
+
}))[0]) == null ? void 0 : _.caveats) == null ? void 0 : E[0]) == null ? void 0 : O.value) == null ? void 0 : S.map((k) => me(k)), b.length > 0 && (b = await this.getAccounts());
|
|
1956
|
+
} catch (R) {
|
|
1957
|
+
const k = R;
|
|
1958
|
+
if (k.code === U.code)
|
|
1959
|
+
throw new U(k);
|
|
1960
|
+
if (k.code === Fe.code)
|
|
1932
1961
|
throw k;
|
|
1933
1962
|
}
|
|
1934
1963
|
try {
|
|
1935
|
-
!(b != null && b.length) && !
|
|
1964
|
+
!(b != null && b.length) && !l && (b = (await g.request({
|
|
1936
1965
|
method: "eth_requestAccounts"
|
|
1937
|
-
})).map((
|
|
1938
|
-
let
|
|
1939
|
-
if (o &&
|
|
1940
|
-
const k = await this.switchChain({ chainId: o }).catch((
|
|
1941
|
-
if (
|
|
1942
|
-
throw
|
|
1943
|
-
return { id:
|
|
1966
|
+
})).map((z) => me(z))), h && (g.removeListener("connect", h), h = void 0), s || (s = this.onAccountsChanged.bind(this), g.on("accountsChanged", s)), d || (d = this.onChainChanged.bind(this), g.on("chainChanged", d)), p || (p = this.onDisconnect.bind(this), g.on("disconnect", p));
|
|
1967
|
+
let R = await this.getChainId();
|
|
1968
|
+
if (o && R !== o) {
|
|
1969
|
+
const k = await this.switchChain({ chainId: o }).catch((z) => {
|
|
1970
|
+
if (z.code === U.code)
|
|
1971
|
+
throw z;
|
|
1972
|
+
return { id: R };
|
|
1944
1973
|
});
|
|
1945
|
-
|
|
1974
|
+
R = (k == null ? void 0 : k.id) ?? R;
|
|
1946
1975
|
}
|
|
1947
|
-
return r && await ((w =
|
|
1976
|
+
return r && await ((w = u.storage) == null ? void 0 : w.removeItem(`${this.id}.disconnected`)), n.target || await ((I = u.storage) == null ? void 0 : I.setItem("injected.connected", !0)), {
|
|
1948
1977
|
accounts: v ? b.map((k) => ({ address: k, capabilities: {} })) : b,
|
|
1949
|
-
chainId:
|
|
1978
|
+
chainId: R
|
|
1950
1979
|
};
|
|
1951
|
-
} catch (
|
|
1952
|
-
const k =
|
|
1953
|
-
throw k.code ===
|
|
1980
|
+
} catch (R) {
|
|
1981
|
+
const k = R;
|
|
1982
|
+
throw k.code === U.code ? new U(k) : k.code === Fe.code ? new Fe(k) : k;
|
|
1954
1983
|
}
|
|
1955
1984
|
},
|
|
1956
1985
|
async disconnect() {
|
|
1957
|
-
var
|
|
1986
|
+
var l, v;
|
|
1958
1987
|
const o = await this.getProvider();
|
|
1959
1988
|
if (!o)
|
|
1960
1989
|
throw new X();
|
|
1961
|
-
|
|
1990
|
+
d && (o.removeListener("chainChanged", d), d = void 0), p && (o.removeListener("disconnect", p), p = void 0), h || (h = this.onConnect.bind(this), o.on("connect", h));
|
|
1962
1991
|
try {
|
|
1963
|
-
await
|
|
1992
|
+
await dn(() => (
|
|
1964
1993
|
// TODO: Remove explicit type for viem@3
|
|
1965
1994
|
o.request({
|
|
1966
1995
|
// `'wallet_revokePermissions'` added in `viem@2.10.3`
|
|
@@ -1970,74 +1999,74 @@ function $e(n = {}) {
|
|
|
1970
1999
|
), { timeout: 100 });
|
|
1971
2000
|
} catch {
|
|
1972
2001
|
}
|
|
1973
|
-
r && await ((
|
|
2002
|
+
r && await ((l = u.storage) == null ? void 0 : l.setItem(`${this.id}.disconnected`, !0)), n.target || await ((v = u.storage) == null ? void 0 : v.removeItem("injected.connected"));
|
|
1974
2003
|
},
|
|
1975
2004
|
async getAccounts() {
|
|
1976
2005
|
const o = await this.getProvider();
|
|
1977
2006
|
if (!o)
|
|
1978
2007
|
throw new X();
|
|
1979
|
-
return (await o.request({ method: "eth_accounts" })).map((v) =>
|
|
2008
|
+
return (await o.request({ method: "eth_accounts" })).map((v) => me(v));
|
|
1980
2009
|
},
|
|
1981
2010
|
async getChainId() {
|
|
1982
2011
|
const o = await this.getProvider();
|
|
1983
2012
|
if (!o)
|
|
1984
2013
|
throw new X();
|
|
1985
|
-
const
|
|
1986
|
-
return Number(
|
|
2014
|
+
const l = await o.request({ method: "eth_chainId" });
|
|
2015
|
+
return Number(l);
|
|
1987
2016
|
},
|
|
1988
2017
|
async getProvider() {
|
|
1989
2018
|
if (typeof window > "u")
|
|
1990
2019
|
return;
|
|
1991
2020
|
let o;
|
|
1992
|
-
const
|
|
1993
|
-
return typeof
|
|
2021
|
+
const l = i();
|
|
2022
|
+
return typeof l.provider == "function" ? o = l.provider(window) : typeof l.provider == "string" ? o = xe(window, l.provider) : o = l.provider, o && !o.removeListener && ("off" in o && typeof o.off == "function" ? o.removeListener = o.off : o.removeListener = () => {
|
|
1994
2023
|
}), o;
|
|
1995
2024
|
},
|
|
1996
2025
|
async isAuthorized() {
|
|
1997
|
-
var o,
|
|
2026
|
+
var o, l;
|
|
1998
2027
|
try {
|
|
1999
2028
|
if (r && // If shim exists in storage, connector is disconnected
|
|
2000
|
-
await ((o =
|
|
2029
|
+
await ((o = u.storage) == null ? void 0 : o.getItem(`${this.id}.disconnected`)) || !n.target && !await ((l = u.storage) == null ? void 0 : l.getItem("injected.connected")))
|
|
2001
2030
|
return !1;
|
|
2002
2031
|
if (!await this.getProvider()) {
|
|
2003
2032
|
if (a !== void 0 && a !== !1) {
|
|
2004
|
-
const
|
|
2033
|
+
const _ = async () => (typeof window < "u" && window.removeEventListener("ethereum#initialized", _), !!await this.getProvider()), E = typeof a == "number" ? a : 1e3;
|
|
2005
2034
|
if (await Promise.race([
|
|
2006
2035
|
...typeof window < "u" ? [
|
|
2007
|
-
new Promise((S) => window.addEventListener("ethereum#initialized", () => S(
|
|
2036
|
+
new Promise((S) => window.addEventListener("ethereum#initialized", () => S(_()), { once: !0 }))
|
|
2008
2037
|
] : [],
|
|
2009
|
-
new Promise((S) => setTimeout(() => S(
|
|
2038
|
+
new Promise((S) => setTimeout(() => S(_()), E))
|
|
2010
2039
|
]))
|
|
2011
2040
|
return !0;
|
|
2012
2041
|
}
|
|
2013
2042
|
throw new X();
|
|
2014
2043
|
}
|
|
2015
|
-
return !!(await
|
|
2044
|
+
return !!(await ln(() => this.getAccounts())).length;
|
|
2016
2045
|
} catch {
|
|
2017
2046
|
return !1;
|
|
2018
2047
|
}
|
|
2019
2048
|
},
|
|
2020
|
-
async switchChain({ addEthereumChainParameter: o, chainId:
|
|
2021
|
-
var
|
|
2049
|
+
async switchChain({ addEthereumChainParameter: o, chainId: l }) {
|
|
2050
|
+
var _, E, O, S;
|
|
2022
2051
|
const v = await this.getProvider();
|
|
2023
2052
|
if (!v)
|
|
2024
2053
|
throw new X();
|
|
2025
|
-
const g =
|
|
2054
|
+
const g = u.chains.find((w) => w.id === l);
|
|
2026
2055
|
if (!g)
|
|
2027
|
-
throw new
|
|
2056
|
+
throw new it(new Nn());
|
|
2028
2057
|
const b = new Promise((w) => {
|
|
2029
|
-
const I = (
|
|
2030
|
-
"chainId" in
|
|
2058
|
+
const I = (R) => {
|
|
2059
|
+
"chainId" in R && R.chainId === l && (u.emitter.off("change", I), w());
|
|
2031
2060
|
};
|
|
2032
|
-
|
|
2061
|
+
u.emitter.on("change", I);
|
|
2033
2062
|
});
|
|
2034
2063
|
try {
|
|
2035
2064
|
return await Promise.all([
|
|
2036
2065
|
v.request({
|
|
2037
2066
|
method: "wallet_switchEthereumChain",
|
|
2038
|
-
params: [{ chainId:
|
|
2067
|
+
params: [{ chainId: st(l) }]
|
|
2039
2068
|
}).then(async () => {
|
|
2040
|
-
await this.getChainId() ===
|
|
2069
|
+
await this.getChainId() === l && u.emitter.emit("change", { chainId: l });
|
|
2041
2070
|
}),
|
|
2042
2071
|
b
|
|
2043
2072
|
]), g;
|
|
@@ -2045,86 +2074,86 @@ function $e(n = {}) {
|
|
|
2045
2074
|
const I = w;
|
|
2046
2075
|
if (I.code === 4902 || // Unwrapping for MetaMask Mobile
|
|
2047
2076
|
// https://github.com/MetaMask/metamask-mobile/issues/2944#issuecomment-976988719
|
|
2048
|
-
((
|
|
2077
|
+
((E = (_ = I == null ? void 0 : I.data) == null ? void 0 : _.originalError) == null ? void 0 : E.code) === 4902)
|
|
2049
2078
|
try {
|
|
2050
|
-
const { default:
|
|
2051
|
-
let
|
|
2052
|
-
o != null && o.blockExplorerUrls ?
|
|
2053
|
-
|
|
2054
|
-
...Object.values(k).map((
|
|
2079
|
+
const { default: R, ...k } = g.blockExplorers ?? {};
|
|
2080
|
+
let z;
|
|
2081
|
+
o != null && o.blockExplorerUrls ? z = o.blockExplorerUrls : R && (z = [
|
|
2082
|
+
R.url,
|
|
2083
|
+
...Object.values(k).map((W) => W.url)
|
|
2055
2084
|
]);
|
|
2056
|
-
let
|
|
2057
|
-
(
|
|
2058
|
-
const
|
|
2059
|
-
blockExplorerUrls:
|
|
2060
|
-
chainId:
|
|
2085
|
+
let Y;
|
|
2086
|
+
(O = o == null ? void 0 : o.rpcUrls) != null && O.length ? Y = o.rpcUrls : Y = [((S = g.rpcUrls.default) == null ? void 0 : S.http[0]) ?? ""];
|
|
2087
|
+
const Z = {
|
|
2088
|
+
blockExplorerUrls: z,
|
|
2089
|
+
chainId: st(l),
|
|
2061
2090
|
chainName: (o == null ? void 0 : o.chainName) ?? g.name,
|
|
2062
2091
|
iconUrls: o == null ? void 0 : o.iconUrls,
|
|
2063
2092
|
nativeCurrency: (o == null ? void 0 : o.nativeCurrency) ?? g.nativeCurrency,
|
|
2064
|
-
rpcUrls:
|
|
2093
|
+
rpcUrls: Y
|
|
2065
2094
|
};
|
|
2066
2095
|
return await Promise.all([
|
|
2067
2096
|
v.request({
|
|
2068
2097
|
method: "wallet_addEthereumChain",
|
|
2069
|
-
params: [
|
|
2098
|
+
params: [Z]
|
|
2070
2099
|
}).then(async () => {
|
|
2071
|
-
if (await this.getChainId() ===
|
|
2072
|
-
|
|
2100
|
+
if (await this.getChainId() === l)
|
|
2101
|
+
u.emitter.emit("change", { chainId: l });
|
|
2073
2102
|
else
|
|
2074
|
-
throw new
|
|
2103
|
+
throw new U(new Error("User rejected switch after adding network."));
|
|
2075
2104
|
}),
|
|
2076
2105
|
b
|
|
2077
2106
|
]), g;
|
|
2078
|
-
} catch (
|
|
2079
|
-
throw new
|
|
2107
|
+
} catch (R) {
|
|
2108
|
+
throw new U(R);
|
|
2080
2109
|
}
|
|
2081
|
-
throw I.code ===
|
|
2110
|
+
throw I.code === U.code ? new U(I) : new it(I);
|
|
2082
2111
|
}
|
|
2083
2112
|
},
|
|
2084
2113
|
async onAccountsChanged(o) {
|
|
2085
|
-
var
|
|
2114
|
+
var l;
|
|
2086
2115
|
if (o.length === 0)
|
|
2087
2116
|
this.onDisconnect();
|
|
2088
|
-
else if (
|
|
2117
|
+
else if (u.emitter.listenerCount("connect")) {
|
|
2089
2118
|
const v = (await this.getChainId()).toString();
|
|
2090
|
-
this.onConnect({ chainId: v }), r && await ((
|
|
2119
|
+
this.onConnect({ chainId: v }), r && await ((l = u.storage) == null ? void 0 : l.removeItem(`${this.id}.disconnected`));
|
|
2091
2120
|
} else
|
|
2092
|
-
|
|
2093
|
-
accounts: o.map((v) =>
|
|
2121
|
+
u.emitter.emit("change", {
|
|
2122
|
+
accounts: o.map((v) => me(v))
|
|
2094
2123
|
});
|
|
2095
2124
|
},
|
|
2096
2125
|
onChainChanged(o) {
|
|
2097
|
-
const
|
|
2098
|
-
|
|
2126
|
+
const l = Number(o);
|
|
2127
|
+
u.emitter.emit("change", { chainId: l });
|
|
2099
2128
|
},
|
|
2100
2129
|
async onConnect(o) {
|
|
2101
|
-
const
|
|
2102
|
-
if (
|
|
2130
|
+
const l = await this.getAccounts();
|
|
2131
|
+
if (l.length === 0)
|
|
2103
2132
|
return;
|
|
2104
2133
|
const v = Number(o.chainId);
|
|
2105
|
-
|
|
2134
|
+
u.emitter.emit("connect", { accounts: l, chainId: v });
|
|
2106
2135
|
const g = await this.getProvider();
|
|
2107
|
-
g && (
|
|
2136
|
+
g && (h && (g.removeListener("connect", h), h = void 0), s || (s = this.onAccountsChanged.bind(this), g.on("accountsChanged", s)), d || (d = this.onChainChanged.bind(this), g.on("chainChanged", d)), p || (p = this.onDisconnect.bind(this), g.on("disconnect", p)));
|
|
2108
2137
|
},
|
|
2109
2138
|
async onDisconnect(o) {
|
|
2110
|
-
const
|
|
2111
|
-
o && o.code === 1013 &&
|
|
2139
|
+
const l = await this.getProvider();
|
|
2140
|
+
o && o.code === 1013 && l && (await this.getAccounts()).length || (u.emitter.emit("disconnect"), l && (d && (l.removeListener("chainChanged", d), d = void 0), p && (l.removeListener("disconnect", p), p = void 0), h || (h = this.onConnect.bind(this), l.on("connect", h))));
|
|
2112
2141
|
}
|
|
2113
2142
|
});
|
|
2114
2143
|
}
|
|
2115
|
-
const
|
|
2144
|
+
const Un = {
|
|
2116
2145
|
coinbaseWallet: {
|
|
2117
2146
|
id: "coinbaseWallet",
|
|
2118
2147
|
name: "Coinbase Wallet",
|
|
2119
2148
|
provider(n) {
|
|
2120
|
-
return n != null && n.coinbaseWalletExtension ? n.coinbaseWalletExtension :
|
|
2149
|
+
return n != null && n.coinbaseWalletExtension ? n.coinbaseWalletExtension : xe(n, "isCoinbaseWallet");
|
|
2121
2150
|
}
|
|
2122
2151
|
},
|
|
2123
2152
|
metaMask: {
|
|
2124
2153
|
id: "metaMask",
|
|
2125
2154
|
name: "MetaMask",
|
|
2126
2155
|
provider(n) {
|
|
2127
|
-
return
|
|
2156
|
+
return xe(n, (r) => {
|
|
2128
2157
|
if (!r.isMetaMask || r.isBraveWallet && !r._events && !r._state)
|
|
2129
2158
|
return !1;
|
|
2130
2159
|
const a = [
|
|
@@ -2147,8 +2176,8 @@ const qn = {
|
|
|
2147
2176
|
"isUniswapWallet",
|
|
2148
2177
|
"isZerion"
|
|
2149
2178
|
];
|
|
2150
|
-
for (const
|
|
2151
|
-
if (r[
|
|
2179
|
+
for (const i of a)
|
|
2180
|
+
if (r[i])
|
|
2152
2181
|
return !1;
|
|
2153
2182
|
return !0;
|
|
2154
2183
|
});
|
|
@@ -2159,36 +2188,36 @@ const qn = {
|
|
|
2159
2188
|
name: "Phantom",
|
|
2160
2189
|
provider(n) {
|
|
2161
2190
|
var r, a;
|
|
2162
|
-
return (r = n == null ? void 0 : n.phantom) != null && r.ethereum ? (a = n.phantom) == null ? void 0 : a.ethereum :
|
|
2191
|
+
return (r = n == null ? void 0 : n.phantom) != null && r.ethereum ? (a = n.phantom) == null ? void 0 : a.ethereum : xe(n, "isPhantom");
|
|
2163
2192
|
}
|
|
2164
2193
|
}
|
|
2165
2194
|
};
|
|
2166
|
-
function
|
|
2167
|
-
function a(
|
|
2168
|
-
return typeof r == "function" ? r(
|
|
2195
|
+
function xe(n, r) {
|
|
2196
|
+
function a(s) {
|
|
2197
|
+
return typeof r == "function" ? r(s) : typeof r == "string" ? s[r] : !0;
|
|
2169
2198
|
}
|
|
2170
|
-
const
|
|
2171
|
-
if (
|
|
2172
|
-
return
|
|
2173
|
-
if (
|
|
2174
|
-
return
|
|
2199
|
+
const i = n.ethereum;
|
|
2200
|
+
if (i != null && i.providers)
|
|
2201
|
+
return i.providers.find((s) => a(s));
|
|
2202
|
+
if (i && a(i))
|
|
2203
|
+
return i;
|
|
2175
2204
|
}
|
|
2176
|
-
const
|
|
2177
|
-
chains: [
|
|
2205
|
+
const qn = new un(), Yn = rn({
|
|
2206
|
+
chains: [Oe],
|
|
2178
2207
|
connectors: [$e()],
|
|
2179
2208
|
transports: {
|
|
2180
|
-
[
|
|
2209
|
+
[Oe.id]: an()
|
|
2181
2210
|
}
|
|
2182
2211
|
});
|
|
2183
|
-
function
|
|
2184
|
-
return /* @__PURE__ */ t.jsx(
|
|
2212
|
+
function Jn({ children: n }) {
|
|
2213
|
+
return /* @__PURE__ */ t.jsx(on, { config: Yn, children: /* @__PURE__ */ t.jsx(fn, { client: qn, children: n }) });
|
|
2185
2214
|
}
|
|
2186
2215
|
export {
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2216
|
+
Kn as SwarmConnectButton,
|
|
2217
|
+
$n as SwarmConnectModal,
|
|
2218
|
+
Jn as SwarmConnectProvider,
|
|
2219
|
+
mn as useBeeNode,
|
|
2220
|
+
bt as useNodeWallet,
|
|
2221
|
+
xn as usePostageStamps,
|
|
2222
|
+
yn as useSwarmConnect
|
|
2194
2223
|
};
|