@ffaerber/swarm-connect 0.3.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 +91 -20
- package/dist/components/SwarmConnectButton.d.ts +1 -1
- package/dist/components/SwarmConnectModal.d.ts +7 -2
- package/dist/components/atoms.d.ts +53 -0
- package/dist/components/steps.d.ts +34 -0
- package/dist/constants.d.ts +12 -19
- package/dist/hooks/useBeeNode.d.ts +1 -0
- package/dist/hooks/useNodeWallet.d.ts +7 -0
- package/dist/index.d.ts +2 -1
- package/dist/swarm-connect.js +1570 -1086
- package/dist/swarm-connect.umd.cjs +34 -17
- package/dist/theme.d.ts +11 -0
- package/dist/types.d.ts +59 -0
- package/package.json +5 -2
- package/dist/components/StepLabel.d.ts +0 -8
- package/dist/components/tabs/SwarmTab.d.ts +0 -11
- package/dist/components/tabs/WalletTab.d.ts +0 -3
package/dist/swarm-connect.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { useAccount as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
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 we = { exports: {} }, X = {};
|
|
|
12
12
|
* This source code is licensed under the MIT license found in the
|
|
13
13
|
* LICENSE file in the root directory of this source tree.
|
|
14
14
|
*/
|
|
15
|
-
var
|
|
16
|
-
function
|
|
17
|
-
if (
|
|
18
|
-
|
|
19
|
-
var
|
|
20
|
-
function
|
|
21
|
-
var
|
|
22
|
-
|
|
23
|
-
for (
|
|
24
|
-
if (
|
|
25
|
-
return { $$typeof:
|
|
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,91 +36,91 @@ var Q = {};
|
|
|
36
36
|
* This source code is licensed under the MIT license found in the
|
|
37
37
|
* LICENSE file in the root directory of this source tree.
|
|
38
38
|
*/
|
|
39
|
-
var
|
|
40
|
-
function
|
|
41
|
-
return
|
|
42
|
-
var
|
|
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
|
|
47
|
-
return typeof
|
|
46
|
+
var c = _ && e[_] || e[E];
|
|
47
|
+
return typeof c == "function" ? c : null;
|
|
48
48
|
}
|
|
49
|
-
var
|
|
50
|
-
function
|
|
49
|
+
var S = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
50
|
+
function w(e) {
|
|
51
51
|
{
|
|
52
|
-
for (var
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
for (var c = arguments.length, f = new Array(c > 1 ? c - 1 : 0), m = 1; m < c; m++)
|
|
53
|
+
f[m - 1] = arguments[m];
|
|
54
|
+
I("error", e, f);
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
|
-
function
|
|
57
|
+
function I(e, c, f) {
|
|
58
58
|
{
|
|
59
|
-
var
|
|
60
|
-
|
|
61
|
-
var
|
|
62
|
-
return String(
|
|
59
|
+
var m = S.ReactDebugCurrentFrame, j = m.getStackAddendum();
|
|
60
|
+
j !== "" && (c += "%s", f = f.concat([j]));
|
|
61
|
+
var C = f.map(function(y) {
|
|
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
|
|
77
|
-
var
|
|
78
|
-
if (
|
|
79
|
-
return
|
|
80
|
-
var
|
|
81
|
-
return
|
|
76
|
+
function ne(e, c, f) {
|
|
77
|
+
var m = e.displayName;
|
|
78
|
+
if (m)
|
|
79
|
+
return m;
|
|
80
|
+
var j = c.displayName || c.name || "";
|
|
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
|
-
if (typeof e.tag == "number" &&
|
|
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")
|
|
90
90
|
return e.displayName || e.name || null;
|
|
91
91
|
if (typeof e == "string")
|
|
92
92
|
return e;
|
|
93
93
|
switch (e) {
|
|
94
|
-
case c:
|
|
95
|
-
return "Fragment";
|
|
96
94
|
case i:
|
|
95
|
+
return "Fragment";
|
|
96
|
+
case a:
|
|
97
97
|
return "Portal";
|
|
98
|
-
case
|
|
98
|
+
case d:
|
|
99
99
|
return "Profiler";
|
|
100
|
-
case u:
|
|
101
|
-
return "StrictMode";
|
|
102
100
|
case s:
|
|
101
|
+
return "StrictMode";
|
|
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
|
|
110
|
-
var
|
|
111
|
-
return
|
|
112
|
-
case
|
|
113
|
-
var
|
|
114
|
-
return
|
|
115
|
-
case
|
|
116
|
-
return
|
|
109
|
+
case p:
|
|
110
|
+
var c = e;
|
|
111
|
+
return re(c) + ".Consumer";
|
|
112
|
+
case h:
|
|
113
|
+
var f = e;
|
|
114
|
+
return re(f._context) + ".Provider";
|
|
115
|
+
case u:
|
|
116
|
+
return ne(e, e.render, "ForwardRef");
|
|
117
117
|
case v:
|
|
118
|
-
var
|
|
119
|
-
return
|
|
120
|
-
case
|
|
121
|
-
var
|
|
118
|
+
var m = e.displayName || null;
|
|
119
|
+
return m !== null ? m : B(e.type) || "Memo";
|
|
120
|
+
case g: {
|
|
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 Jr() {
|
|
|
128
128
|
}
|
|
129
129
|
return null;
|
|
130
130
|
}
|
|
131
|
-
var M = Object.assign,
|
|
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,12 +152,12 @@ function Jr() {
|
|
|
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,
|
|
@@ -165,319 +165,319 @@ function Jr() {
|
|
|
165
165
|
};
|
|
166
166
|
Object.defineProperties(console, {
|
|
167
167
|
log: M({}, e, {
|
|
168
|
-
value:
|
|
168
|
+
value: fe
|
|
169
169
|
}),
|
|
170
170
|
info: M({}, e, {
|
|
171
|
-
value:
|
|
171
|
+
value: D
|
|
172
172
|
}),
|
|
173
173
|
warn: M({}, e, {
|
|
174
|
-
value:
|
|
174
|
+
value: ae
|
|
175
175
|
}),
|
|
176
176
|
error: M({}, e, {
|
|
177
|
-
value:
|
|
177
|
+
value: Le
|
|
178
178
|
}),
|
|
179
179
|
group: M({}, e, {
|
|
180
|
-
value:
|
|
180
|
+
value: We
|
|
181
181
|
}),
|
|
182
182
|
groupCollapsed: M({}, e, {
|
|
183
|
-
value:
|
|
183
|
+
value: Be
|
|
184
184
|
}),
|
|
185
185
|
groupEnd: M({}, e, {
|
|
186
|
-
value:
|
|
186
|
+
value: Me
|
|
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
|
-
} catch (
|
|
200
|
-
var
|
|
201
|
-
|
|
199
|
+
} catch (j) {
|
|
200
|
+
var m = j.stack.trim().match(/\n( *(at )?)/);
|
|
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
|
|
217
|
-
if (
|
|
218
|
-
return
|
|
216
|
+
var f = pe.get(e);
|
|
217
|
+
if (f !== void 0)
|
|
218
|
+
return f;
|
|
219
219
|
}
|
|
220
|
-
var
|
|
221
|
-
|
|
222
|
-
var
|
|
220
|
+
var m;
|
|
221
|
+
Ce = !0;
|
|
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
|
-
if (
|
|
228
|
-
var
|
|
227
|
+
if (c) {
|
|
228
|
+
var y = function() {
|
|
229
229
|
throw Error();
|
|
230
230
|
};
|
|
231
|
-
if (Object.defineProperty(
|
|
231
|
+
if (Object.defineProperty(y.prototype, "props", {
|
|
232
232
|
set: function() {
|
|
233
233
|
throw Error();
|
|
234
234
|
}
|
|
235
235
|
}), typeof Reflect == "object" && Reflect.construct) {
|
|
236
236
|
try {
|
|
237
|
-
Reflect.construct(
|
|
238
|
-
} catch (
|
|
239
|
-
|
|
237
|
+
Reflect.construct(y, []);
|
|
238
|
+
} catch ($) {
|
|
239
|
+
m = $;
|
|
240
240
|
}
|
|
241
|
-
Reflect.construct(e, [],
|
|
241
|
+
Reflect.construct(e, [], y);
|
|
242
242
|
} else {
|
|
243
243
|
try {
|
|
244
|
-
|
|
245
|
-
} catch (
|
|
246
|
-
|
|
244
|
+
y.call();
|
|
245
|
+
} catch ($) {
|
|
246
|
+
m = $;
|
|
247
247
|
}
|
|
248
|
-
e.call(
|
|
248
|
+
e.call(y.prototype);
|
|
249
249
|
}
|
|
250
250
|
} else {
|
|
251
251
|
try {
|
|
252
252
|
throw Error();
|
|
253
|
-
} catch (
|
|
254
|
-
|
|
253
|
+
} catch ($) {
|
|
254
|
+
m = $;
|
|
255
255
|
}
|
|
256
256
|
e();
|
|
257
257
|
}
|
|
258
|
-
} catch (
|
|
259
|
-
if (
|
|
260
|
-
for (var
|
|
261
|
-
`),
|
|
262
|
-
`),
|
|
263
|
-
|
|
264
|
-
for (;
|
|
265
|
-
if (
|
|
266
|
-
if (
|
|
258
|
+
} catch ($) {
|
|
259
|
+
if ($ && m && typeof $.stack == "string") {
|
|
260
|
+
for (var x = $.stack.split(`
|
|
261
|
+
`), A = m.stack.split(`
|
|
262
|
+
`), T = x.length - 1, P = A.length - 1; T >= 1 && P >= 0 && x[T] !== A[P]; )
|
|
263
|
+
P--;
|
|
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 (
|
|
269
|
-
var
|
|
270
|
-
` +
|
|
271
|
-
return e.displayName &&
|
|
268
|
+
if (T--, P--, P < 0 || x[T] !== A[P]) {
|
|
269
|
+
var L = `
|
|
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
|
|
287
|
-
var
|
|
288
|
-
return !!(
|
|
286
|
+
function Et(e) {
|
|
287
|
+
var c = e.prototype;
|
|
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
|
-
case
|
|
299
|
-
return
|
|
300
|
-
case
|
|
301
|
-
return
|
|
298
|
+
case o:
|
|
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
|
|
309
|
-
case
|
|
310
|
-
var
|
|
308
|
+
return ve(e.type, c, f);
|
|
309
|
+
case g: {
|
|
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
|
|
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
|
|
330
|
-
for (var
|
|
331
|
-
if (
|
|
332
|
-
var
|
|
329
|
+
var C = Function.call.bind(oe);
|
|
330
|
+
for (var y in e)
|
|
331
|
+
if (C(e, y)) {
|
|
332
|
+
var x = void 0;
|
|
333
333
|
try {
|
|
334
|
-
if (typeof e[
|
|
335
|
-
var
|
|
336
|
-
throw
|
|
334
|
+
if (typeof e[y] != "function") {
|
|
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
|
-
|
|
339
|
-
} catch (
|
|
340
|
-
|
|
338
|
+
x = e[y](c, y, m, f, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
339
|
+
} catch (T) {
|
|
340
|
+
x = T;
|
|
341
341
|
}
|
|
342
|
-
|
|
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
|
-
var
|
|
353
|
-
return
|
|
352
|
+
var c = typeof Symbol == "function" && Symbol.toStringTag, f = c && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
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
|
|
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
|
-
},
|
|
376
|
-
function
|
|
377
|
-
if (
|
|
378
|
-
var
|
|
379
|
-
if (
|
|
375
|
+
}, Ze, Ke;
|
|
376
|
+
function Ot(e) {
|
|
377
|
+
if (oe.call(e, "ref")) {
|
|
378
|
+
var c = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
379
|
+
if (c && c.isReactWarning)
|
|
380
380
|
return !1;
|
|
381
381
|
}
|
|
382
382
|
return e.ref !== void 0;
|
|
383
383
|
}
|
|
384
|
-
function
|
|
385
|
-
if (
|
|
386
|
-
var
|
|
387
|
-
if (
|
|
384
|
+
function zt(e) {
|
|
385
|
+
if (oe.call(e, "key")) {
|
|
386
|
+
var c = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
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
|
-
var
|
|
398
|
-
|
|
397
|
+
var f = function() {
|
|
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
|
-
|
|
401
|
-
get:
|
|
400
|
+
f.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
401
|
+
get: f,
|
|
402
402
|
configurable: !0
|
|
403
403
|
});
|
|
404
404
|
}
|
|
405
405
|
}
|
|
406
|
-
function
|
|
406
|
+
function Lt(e, c) {
|
|
407
407
|
{
|
|
408
|
-
var
|
|
409
|
-
|
|
408
|
+
var f = function() {
|
|
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
|
-
|
|
412
|
-
get:
|
|
411
|
+
f.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
412
|
+
get: f,
|
|
413
413
|
configurable: !0
|
|
414
414
|
});
|
|
415
415
|
}
|
|
416
416
|
}
|
|
417
|
-
var
|
|
418
|
-
var
|
|
417
|
+
var Wt = function(e, c, f, m, j, C, y) {
|
|
418
|
+
var x = {
|
|
419
419
|
// This tag allows us to uniquely identify this as a React Element
|
|
420
|
-
$$typeof:
|
|
420
|
+
$$typeof: r,
|
|
421
421
|
// Built-in properties that belong on the element
|
|
422
422
|
type: e,
|
|
423
|
-
key:
|
|
424
|
-
ref:
|
|
425
|
-
props:
|
|
423
|
+
key: c,
|
|
424
|
+
ref: f,
|
|
425
|
+
props: y,
|
|
426
426
|
// Record the component responsible for creating this element.
|
|
427
|
-
_owner:
|
|
427
|
+
_owner: C
|
|
428
428
|
};
|
|
429
|
-
return
|
|
429
|
+
return x._store = {}, Object.defineProperty(x._store, "validated", {
|
|
430
430
|
configurable: !1,
|
|
431
431
|
enumerable: !1,
|
|
432
432
|
writable: !0,
|
|
433
433
|
value: !1
|
|
434
|
-
}), Object.defineProperty(
|
|
434
|
+
}), Object.defineProperty(x, "_self", {
|
|
435
435
|
configurable: !1,
|
|
436
436
|
enumerable: !1,
|
|
437
437
|
writable: !1,
|
|
438
|
-
value:
|
|
439
|
-
}), Object.defineProperty(
|
|
438
|
+
value: m
|
|
439
|
+
}), Object.defineProperty(x, "_source", {
|
|
440
440
|
configurable: !1,
|
|
441
441
|
enumerable: !1,
|
|
442
442
|
writable: !1,
|
|
443
|
-
value:
|
|
444
|
-
}), Object.freeze && (Object.freeze(
|
|
443
|
+
value: j
|
|
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
|
-
|
|
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
|
-
|
|
453
|
+
var T = e.defaultProps;
|
|
454
|
+
for (C in T)
|
|
455
|
+
y[C] === void 0 && (y[C] = T[C]);
|
|
456
456
|
}
|
|
457
|
-
if (
|
|
458
|
-
var
|
|
459
|
-
|
|
457
|
+
if (x || A) {
|
|
458
|
+
var P = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
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
|
|
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
|
|
475
|
-
return typeof e == "object" && e !== null && e.$$typeof ===
|
|
472
|
+
var Ee;
|
|
473
|
+
Ee = !1;
|
|
474
|
+
function Ie(e) {
|
|
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,502 +486,597 @@ 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
|
|
496
|
-
if (!
|
|
497
|
-
var
|
|
498
|
-
|
|
495
|
+
var c = Xe();
|
|
496
|
+
if (!c) {
|
|
497
|
+
var f = typeof e == "string" ? e : e.displayName || e.name;
|
|
498
|
+
f && (c = `
|
|
499
499
|
|
|
500
|
-
Check the top-level render call using <` +
|
|
500
|
+
Check the top-level render call using <` + f + ">.");
|
|
501
501
|
}
|
|
502
|
-
return
|
|
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
|
|
511
|
-
if (
|
|
510
|
+
var f = Nt(c);
|
|
511
|
+
if (Qe[f])
|
|
512
512
|
return;
|
|
513
|
-
|
|
514
|
-
var
|
|
515
|
-
e && e._owner && e._owner !==
|
|
513
|
+
Qe[f] = !0;
|
|
514
|
+
var m = "";
|
|
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 (
|
|
523
|
-
for (var
|
|
524
|
-
var
|
|
525
|
-
|
|
522
|
+
if (Re(e))
|
|
523
|
+
for (var f = 0; f < e.length; f++) {
|
|
524
|
+
var m = e[f];
|
|
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
|
|
531
|
-
if (typeof
|
|
532
|
-
for (var
|
|
533
|
-
|
|
530
|
+
var j = O(e);
|
|
531
|
+
if (typeof j == "function" && j !== e.entries)
|
|
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
|
-
var
|
|
540
|
-
if (
|
|
539
|
+
var c = e.type;
|
|
540
|
+
if (c == null || typeof c == "string")
|
|
541
541
|
return;
|
|
542
|
-
var
|
|
543
|
-
if (typeof
|
|
544
|
-
|
|
545
|
-
else if (typeof
|
|
542
|
+
var f;
|
|
543
|
+
if (typeof c == "function")
|
|
544
|
+
f = c.propTypes;
|
|
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
|
-
|
|
548
|
-
|
|
547
|
+
c.$$typeof === v))
|
|
548
|
+
f = c.propTypes;
|
|
549
549
|
else
|
|
550
550
|
return;
|
|
551
|
-
if (
|
|
552
|
-
var
|
|
553
|
-
|
|
554
|
-
} else if (
|
|
555
|
-
|
|
556
|
-
var
|
|
557
|
-
|
|
551
|
+
if (f) {
|
|
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
|
+
w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", j || "Unknown");
|
|
558
558
|
}
|
|
559
|
-
typeof
|
|
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.");
|
|
560
560
|
}
|
|
561
561
|
}
|
|
562
|
-
function
|
|
562
|
+
function qt(e) {
|
|
563
563
|
{
|
|
564
|
-
for (var
|
|
565
|
-
var
|
|
566
|
-
if (
|
|
567
|
-
|
|
564
|
+
for (var c = Object.keys(e.props), f = 0; f < c.length; f++) {
|
|
565
|
+
var m = c[f];
|
|
566
|
+
if (m !== "children" && m !== "key") {
|
|
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
|
|
578
|
-
if (!
|
|
579
|
-
var
|
|
580
|
-
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (
|
|
581
|
-
var
|
|
582
|
-
|
|
583
|
-
var
|
|
584
|
-
e === null ?
|
|
577
|
+
var y = te(e);
|
|
578
|
+
if (!y) {
|
|
579
|
+
var x = "";
|
|
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 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
|
|
587
|
-
if (
|
|
588
|
-
return
|
|
589
|
-
if (
|
|
590
|
-
var
|
|
591
|
-
if (
|
|
592
|
-
if (
|
|
593
|
-
if (
|
|
594
|
-
for (var
|
|
595
|
-
|
|
596
|
-
Object.freeze && Object.freeze(
|
|
586
|
+
var P = Bt(e, c, f, j, C);
|
|
587
|
+
if (P == null)
|
|
588
|
+
return P;
|
|
589
|
+
if (y) {
|
|
590
|
+
var L = c.children;
|
|
591
|
+
if (L !== void 0)
|
|
592
|
+
if (m)
|
|
593
|
+
if (Re(L)) {
|
|
594
|
+
for (var J = 0; J < L.length; J++)
|
|
595
|
+
tt(L[J], e);
|
|
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
|
|
608
|
-
|
|
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
|
+
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
|
|
631
|
-
const
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
success: "#0e9f6e",
|
|
636
|
-
successLight: "#f0fdf4",
|
|
637
|
-
error: "#f05252",
|
|
638
|
-
errorLight: "#fff5f5",
|
|
639
|
-
warning: "#ff8a4c",
|
|
640
|
-
warningLight: "#fffbf5",
|
|
641
|
-
border: "#e5e7eb",
|
|
642
|
-
text: "#111827",
|
|
643
|
-
muted: "#6b7280",
|
|
644
|
-
overlay: "rgba(0,0,0,0.5)",
|
|
645
|
-
stepActive: "#1a56db"
|
|
646
|
-
}
|
|
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
|
|
647
635
|
};
|
|
648
|
-
function
|
|
649
|
-
const [
|
|
636
|
+
function mn(n = de) {
|
|
637
|
+
const [r, a] = F({
|
|
650
638
|
isRunning: !1,
|
|
651
639
|
isChecking: !1
|
|
652
|
-
}),
|
|
653
|
-
|
|
640
|
+
}), i = ce(async () => {
|
|
641
|
+
a({ isRunning: !1, isChecking: !0 });
|
|
654
642
|
try {
|
|
655
|
-
const
|
|
643
|
+
const d = await fetch(`${n}/health`, {
|
|
656
644
|
signal: AbortSignal.timeout(5e3)
|
|
657
645
|
});
|
|
658
|
-
if (
|
|
659
|
-
const
|
|
660
|
-
|
|
646
|
+
if (d.ok) {
|
|
647
|
+
const h = await d.json();
|
|
648
|
+
a({ isRunning: !0, isChecking: !1, version: h.version });
|
|
661
649
|
} else
|
|
662
|
-
|
|
650
|
+
a({ isRunning: !1, isChecking: !1, error: `Node returned HTTP ${d.status}` });
|
|
663
651
|
} catch {
|
|
664
|
-
|
|
652
|
+
a({
|
|
665
653
|
isRunning: !1,
|
|
666
654
|
isChecking: !1,
|
|
667
|
-
error: `Cannot reach Bee node at ${
|
|
655
|
+
error: `Cannot reach Bee node at ${n}`
|
|
668
656
|
});
|
|
669
657
|
}
|
|
670
|
-
}, [
|
|
671
|
-
|
|
658
|
+
}, [n]), s = ce(() => {
|
|
659
|
+
a({ isRunning: !1, isChecking: !1 });
|
|
660
|
+
}, []);
|
|
661
|
+
return { ...r, check: i, disconnect: s };
|
|
672
662
|
}
|
|
673
|
-
function
|
|
674
|
-
const [
|
|
675
|
-
|
|
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);
|
|
676
666
|
try {
|
|
677
|
-
const
|
|
667
|
+
const E = await fetch(`${n}/stamps`, {
|
|
678
668
|
signal: AbortSignal.timeout(5e3)
|
|
679
669
|
});
|
|
680
|
-
if (
|
|
681
|
-
const
|
|
682
|
-
|
|
670
|
+
if (E.ok) {
|
|
671
|
+
const O = await E.json();
|
|
672
|
+
a(O.stamps ?? []);
|
|
683
673
|
} else
|
|
684
|
-
|
|
674
|
+
h(`HTTP ${E.status}`);
|
|
685
675
|
} catch {
|
|
686
|
-
|
|
676
|
+
h("Could not fetch postage stamps");
|
|
687
677
|
} finally {
|
|
688
|
-
|
|
678
|
+
s(!1);
|
|
689
679
|
}
|
|
690
|
-
}, [
|
|
691
|
-
|
|
680
|
+
}, [n]), _ = ce(async ({ amount: E, depth: O, label: S }) => {
|
|
681
|
+
l(!0), g(void 0);
|
|
682
|
+
try {
|
|
683
|
+
const w = S ? `?label=${encodeURIComponent(S)}` : "", I = await fetch(`${n}/stamps/${E}/${O}${w}`, {
|
|
684
|
+
method: "POST",
|
|
685
|
+
signal: AbortSignal.timeout(24e4)
|
|
686
|
+
});
|
|
687
|
+
if (!I.ok) {
|
|
688
|
+
let k = `HTTP ${I.status}`;
|
|
689
|
+
try {
|
|
690
|
+
const z = await I.json();
|
|
691
|
+
z.message && (k = z.message);
|
|
692
|
+
} catch {
|
|
693
|
+
}
|
|
694
|
+
g(k);
|
|
695
|
+
return;
|
|
696
|
+
}
|
|
697
|
+
const R = await I.json();
|
|
698
|
+
return u(R.batchID), b(), R.batchID;
|
|
699
|
+
} catch {
|
|
700
|
+
g("Stamp purchase failed — is the node wallet funded with xDAI and xBZZ?");
|
|
701
|
+
return;
|
|
702
|
+
} finally {
|
|
703
|
+
l(!1);
|
|
704
|
+
}
|
|
705
|
+
}, [n, b]);
|
|
706
|
+
return {
|
|
707
|
+
stamps: r,
|
|
708
|
+
isLoading: i,
|
|
709
|
+
error: d,
|
|
710
|
+
fetchStamps: b,
|
|
711
|
+
selectedStampId: p,
|
|
712
|
+
selectStamp: u,
|
|
713
|
+
createStamp: _,
|
|
714
|
+
isCreating: o,
|
|
715
|
+
createError: v
|
|
716
|
+
};
|
|
692
717
|
}
|
|
693
|
-
function
|
|
718
|
+
function bt(n = de) {
|
|
719
|
+
const [r, a] = F({
|
|
720
|
+
isLoading: !1
|
|
721
|
+
}), i = ce(async () => {
|
|
722
|
+
a((s) => ({ ...s, isLoading: !0, error: void 0 }));
|
|
723
|
+
try {
|
|
724
|
+
const [s, d] = await Promise.all([
|
|
725
|
+
fetch(`${n}/addresses`, { signal: AbortSignal.timeout(5e3) }),
|
|
726
|
+
fetch(`${n}/wallet`, { signal: AbortSignal.timeout(5e3) })
|
|
727
|
+
]);
|
|
728
|
+
if (!s.ok || !d.ok) {
|
|
729
|
+
a((l) => ({
|
|
730
|
+
...l,
|
|
731
|
+
isLoading: !1,
|
|
732
|
+
error: `Node returned HTTP ${s.ok ? d.status : s.status}`
|
|
733
|
+
}));
|
|
734
|
+
return;
|
|
735
|
+
}
|
|
736
|
+
const h = await s.json(), p = await d.json(), u = p.bzzBalance ?? p.bzz, o = p.nativeTokenBalance ?? p.xDai;
|
|
737
|
+
a({
|
|
738
|
+
address: h.ethereum,
|
|
739
|
+
xdai: o !== void 0 ? Number(o) / 1e18 : void 0,
|
|
740
|
+
xbzz: u !== void 0 ? Number(u) / 10 ** De : void 0,
|
|
741
|
+
isLoading: !1
|
|
742
|
+
});
|
|
743
|
+
} catch {
|
|
744
|
+
a((s) => ({
|
|
745
|
+
...s,
|
|
746
|
+
isLoading: !1,
|
|
747
|
+
error: `Cannot read node wallet at ${n}`
|
|
748
|
+
}));
|
|
749
|
+
}
|
|
750
|
+
}, [n]);
|
|
751
|
+
return {
|
|
752
|
+
...r,
|
|
753
|
+
isFunded: (r.xdai ?? 0) > 0 && (r.xbzz ?? 0) > 0,
|
|
754
|
+
refresh: i
|
|
755
|
+
};
|
|
756
|
+
}
|
|
757
|
+
function bn() {
|
|
694
758
|
if (!(typeof window > "u"))
|
|
695
759
|
try {
|
|
696
|
-
return window.localStorage.getItem(
|
|
760
|
+
return window.localStorage.getItem(mt) ?? void 0;
|
|
697
761
|
} catch {
|
|
698
762
|
return;
|
|
699
763
|
}
|
|
700
764
|
}
|
|
701
|
-
function
|
|
702
|
-
const [
|
|
703
|
-
() =>
|
|
765
|
+
function yn(n = {}) {
|
|
766
|
+
const [r, a] = F(
|
|
767
|
+
() => n.beeApiUrl ?? bn() ?? de
|
|
704
768
|
);
|
|
705
|
-
|
|
769
|
+
Q(() => {
|
|
706
770
|
if (!(typeof window > "u"))
|
|
707
771
|
try {
|
|
708
|
-
window.localStorage.setItem(
|
|
772
|
+
window.localStorage.setItem(mt, r);
|
|
709
773
|
} catch {
|
|
710
774
|
}
|
|
711
|
-
}, [
|
|
712
|
-
const
|
|
775
|
+
}, [r]);
|
|
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;
|
|
713
781
|
return {
|
|
714
|
-
beeNode:
|
|
715
|
-
stamps:
|
|
716
|
-
beeApiUrl:
|
|
717
|
-
setBeeApiUrl:
|
|
718
|
-
|
|
782
|
+
beeNode: s,
|
|
783
|
+
stamps: d,
|
|
784
|
+
beeApiUrl: r,
|
|
785
|
+
setBeeApiUrl: a,
|
|
786
|
+
requirements: i,
|
|
787
|
+
nodeWallet: h,
|
|
788
|
+
isWalletConnected: u,
|
|
719
789
|
address: p,
|
|
720
|
-
isOnGnosis:
|
|
721
|
-
chainId:
|
|
722
|
-
|
|
790
|
+
isOnGnosis: l,
|
|
791
|
+
chainId: o,
|
|
792
|
+
balance: { xdai: b, isLoading: u && g, hasGas: _ },
|
|
793
|
+
isFullyConnected: u && l && s.isRunning && (!i.xdai || _) && (!i.xbzz || h.isFunded) && (!i.postageStamp || !!d.selectedStampId)
|
|
723
794
|
};
|
|
724
795
|
}
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
background: n ? a.colors.success : a.colors.stepActive
|
|
740
|
-
}, children: n ? "✓" : t }),
|
|
741
|
-
/* @__PURE__ */ r.jsx("span", { style: {
|
|
742
|
-
fontSize: 11,
|
|
743
|
-
fontWeight: 700,
|
|
744
|
-
textTransform: "uppercase",
|
|
745
|
-
letterSpacing: "0.06em",
|
|
746
|
-
color: a.colors.muted
|
|
747
|
-
}, children: i })
|
|
748
|
-
] });
|
|
796
|
+
const wn = `
|
|
797
|
+
.swarm-connect {
|
|
798
|
+
--void:#060809; --bunker:#0b0f12; --surface:#121821; --raised:#18202b; --raised-2:#1e2833;
|
|
799
|
+
--line:rgba(255,255,255,0.07); --line-2:rgba(255,255,255,0.12); --line-orange:rgba(255,107,0,0.45);
|
|
800
|
+
--fg:#f3f5f7; --fg-soft:#c3cad3; --fg-muted:#7d8794; --fg-faint:#565f6b;
|
|
801
|
+
--accent:#ff6b00; --accent-bright:#ff8a33; --accent-deep:#d65500; --accent-ink:#1a0e02;
|
|
802
|
+
--accent-glow:rgba(255,107,0,0.40); --accent-wash:rgba(255,107,0,0.10);
|
|
803
|
+
--ok:#36c46a; --ok-wash:rgba(54,196,106,0.12); --ok-line:rgba(54,196,106,0.40);
|
|
804
|
+
--bad:#ff5640; --bad-wash:rgba(255,86,64,0.12); --bad-line:rgba(255,86,64,0.38);
|
|
805
|
+
--warn:#f0a83a; --warn-wash:rgba(240,168,58,0.12); --warn-line:rgba(240,168,58,0.40);
|
|
806
|
+
--font-display:'Space Grotesk',system-ui,sans-serif;
|
|
807
|
+
--font-body:'Inter',system-ui,sans-serif;
|
|
808
|
+
--font-mono:'JetBrains Mono',ui-monospace,SFMono-Regular,Menlo,monospace;
|
|
809
|
+
--ease:cubic-bezier(0.22,0.61,0.36,1);
|
|
749
810
|
}
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
}
|
|
766
|
-
),
|
|
767
|
-
/* @__PURE__ */ r.jsx(ot, { beeApiUrl: t, status: i, onRetry: i.check })
|
|
768
|
-
] })
|
|
769
|
-
] }),
|
|
770
|
-
/* @__PURE__ */ r.jsxs("section", { style: { opacity: i.isRunning ? 1 : 0.5 }, children: [
|
|
771
|
-
/* @__PURE__ */ r.jsx(je, { step: 2, done: !!c.selectedStampId, children: "Postage Stamp" }),
|
|
772
|
-
i.isRunning ? /* @__PURE__ */ r.jsx(it, { stamps: c }) : /* @__PURE__ */ r.jsx(nt, { children: "Connect a running Bee node to load postage stamps." })
|
|
773
|
-
] })
|
|
774
|
-
] });
|
|
811
|
+
@keyframes sc-spin { to { transform: rotate(360deg); } }
|
|
812
|
+
@keyframes sc-pulse-dot { 0%,100% { opacity:1; transform:scale(1); } 50% { opacity:.4; transform:scale(.82); } }
|
|
813
|
+
@keyframes sc-modal-in { from { opacity:0; transform:translate(-50%, calc(-50% + 10px)) scale(.985); } to { opacity:1; transform:translate(-50%,-50%) scale(1); } }
|
|
814
|
+
@keyframes sc-backdrop-in { from { opacity:0; } to { opacity:1; } }
|
|
815
|
+
@keyframes sc-step-in { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:translateY(0); } }
|
|
816
|
+
.sc-scroll::-webkit-scrollbar { width:8px; }
|
|
817
|
+
.sc-scroll::-webkit-scrollbar-thumb { background:var(--line-2); border-radius:8px; border:2px solid transparent; background-clip:padding-box; }
|
|
818
|
+
.sc-scroll::-webkit-scrollbar-track { background:transparent; }
|
|
819
|
+
`;
|
|
820
|
+
let ut = !1;
|
|
821
|
+
function yt() {
|
|
822
|
+
if (ut || typeof document > "u") return;
|
|
823
|
+
ut = !0;
|
|
824
|
+
const n = document.createElement("style");
|
|
825
|
+
n.dataset.swarmConnect = "", n.textContent = wn, document.head.appendChild(n);
|
|
775
826
|
}
|
|
776
|
-
function
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
spellCheck: !1,
|
|
797
|
-
autoComplete: "off",
|
|
798
|
-
style: {
|
|
799
|
-
flex: 1,
|
|
800
|
-
minWidth: 0,
|
|
801
|
-
padding: "8px 10px",
|
|
802
|
-
fontSize: 13,
|
|
803
|
-
fontFamily: "monospace",
|
|
804
|
-
border: `1px solid ${a.colors.border}`,
|
|
805
|
-
borderRadius: 6,
|
|
806
|
-
color: a.colors.text,
|
|
807
|
-
outline: "none",
|
|
808
|
-
background: n ? "#f9fafb" : "#fff"
|
|
809
|
-
}
|
|
810
|
-
}
|
|
811
|
-
),
|
|
812
|
-
/* @__PURE__ */ r.jsx(
|
|
813
|
-
"button",
|
|
814
|
-
{
|
|
815
|
-
onClick: x,
|
|
816
|
-
disabled: n || !g,
|
|
817
|
-
style: {
|
|
818
|
-
...Ce,
|
|
819
|
-
alignSelf: "auto",
|
|
820
|
-
cursor: n || !g ? "default" : "pointer",
|
|
821
|
-
opacity: n || !g ? 0.5 : 1
|
|
822
|
-
},
|
|
823
|
-
children: "Connect"
|
|
824
|
-
}
|
|
825
|
-
)
|
|
826
|
-
] });
|
|
827
|
+
function kn({ size: n = 18, stroke: r = "var(--accent)", glow: a = !0, children: i }) {
|
|
828
|
+
return /* @__PURE__ */ t.jsx("span", { style: {
|
|
829
|
+
display: "inline-flex",
|
|
830
|
+
alignItems: "center",
|
|
831
|
+
justifyContent: "center",
|
|
832
|
+
filter: a ? "drop-shadow(0 0 6px var(--accent-glow))" : "none"
|
|
833
|
+
}, children: /* @__PURE__ */ t.jsx(
|
|
834
|
+
"svg",
|
|
835
|
+
{
|
|
836
|
+
width: n,
|
|
837
|
+
height: n,
|
|
838
|
+
viewBox: "0 0 24 24",
|
|
839
|
+
fill: "none",
|
|
840
|
+
stroke: r,
|
|
841
|
+
strokeWidth: "1.4",
|
|
842
|
+
strokeLinecap: "round",
|
|
843
|
+
strokeLinejoin: "round",
|
|
844
|
+
children: i
|
|
845
|
+
}
|
|
846
|
+
) });
|
|
827
847
|
}
|
|
828
|
-
function
|
|
829
|
-
return /* @__PURE__ */
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
848
|
+
function ke({ size: n = 15 }) {
|
|
849
|
+
return /* @__PURE__ */ t.jsx("span", { style: {
|
|
850
|
+
width: n,
|
|
851
|
+
height: n,
|
|
852
|
+
flexShrink: 0,
|
|
853
|
+
display: "inline-block",
|
|
854
|
+
border: "2px solid rgba(255,255,255,.12)",
|
|
855
|
+
borderTopColor: "var(--accent)",
|
|
856
|
+
borderRadius: "50%",
|
|
857
|
+
animation: "sc-spin .7s linear infinite"
|
|
858
|
+
} });
|
|
839
859
|
}
|
|
840
|
-
function
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
860
|
+
function ue({ children: n, tone: r }) {
|
|
861
|
+
const a = {
|
|
862
|
+
ok: { c: "var(--ok)", b: "var(--ok-line)", w: "var(--ok-wash)" },
|
|
863
|
+
bad: { c: "var(--bad)", b: "var(--bad-line)", w: "var(--bad-wash)" },
|
|
864
|
+
warn: { c: "var(--warn)", b: "var(--warn-line)", w: "var(--warn-wash)" }
|
|
865
|
+
}[r];
|
|
866
|
+
return /* @__PURE__ */ t.jsx("span", { style: {
|
|
867
|
+
fontFamily: "var(--font-mono)",
|
|
868
|
+
fontSize: 10,
|
|
869
|
+
letterSpacing: ".04em",
|
|
870
|
+
textTransform: "uppercase",
|
|
871
|
+
color: a.c,
|
|
872
|
+
background: a.w,
|
|
873
|
+
border: `1px solid ${a.b}`,
|
|
874
|
+
borderRadius: 3,
|
|
875
|
+
padding: "2px 6px",
|
|
876
|
+
lineHeight: 1.3
|
|
877
|
+
}, children: n });
|
|
878
|
+
}
|
|
879
|
+
function H({ tone: n, title: r, sub: a, children: i }) {
|
|
880
|
+
const s = {
|
|
881
|
+
ok: { b: "var(--ok-line)", w: "var(--ok-wash)", d: "var(--ok)" },
|
|
882
|
+
bad: { b: "var(--bad-line)", w: "var(--bad-wash)", d: "var(--bad)" },
|
|
883
|
+
warn: { b: "var(--warn-line)", w: "var(--warn-wash)", d: "var(--warn)" },
|
|
884
|
+
flat: { b: "var(--line)", w: "var(--raised)", d: "var(--fg-muted)" }
|
|
885
|
+
}[n], d = !!a && (a.startsWith("0x") || a.includes("localhost") || a.includes("http"));
|
|
886
|
+
return /* @__PURE__ */ t.jsxs("div", { style: {
|
|
887
|
+
display: "flex",
|
|
888
|
+
alignItems: "center",
|
|
889
|
+
gap: 12,
|
|
890
|
+
padding: "12px 14px",
|
|
891
|
+
border: `1px solid ${s.b}`,
|
|
892
|
+
borderRadius: 8,
|
|
893
|
+
background: s.w
|
|
894
|
+
}, children: [
|
|
895
|
+
n !== "flat" && /* @__PURE__ */ t.jsx("span", { style: {
|
|
896
|
+
width: 8,
|
|
897
|
+
height: 8,
|
|
898
|
+
flexShrink: 0,
|
|
899
|
+
borderRadius: "50%",
|
|
900
|
+
background: s.d,
|
|
901
|
+
boxShadow: `0 0 8px ${s.d}`,
|
|
902
|
+
animation: n === "warn" ? "sc-pulse-dot 1.6s var(--ease) infinite" : "none"
|
|
903
|
+
} }),
|
|
904
|
+
/* @__PURE__ */ t.jsxs("div", { style: { minWidth: 0 }, children: [
|
|
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 })
|
|
868
907
|
] }),
|
|
869
|
-
/* @__PURE__ */
|
|
908
|
+
i && /* @__PURE__ */ t.jsx("div", { style: { marginLeft: "auto", flexShrink: 0 }, children: i })
|
|
870
909
|
] });
|
|
871
910
|
}
|
|
872
|
-
function
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
] }) : t.error ? /* @__PURE__ */ r.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: [
|
|
877
|
-
/* @__PURE__ */ r.jsx("div", { style: { ...N, borderColor: a.colors.error, background: a.colors.errorLight }, children: /* @__PURE__ */ r.jsx("span", { style: { color: a.colors.error, fontSize: 13 }, children: t.error }) }),
|
|
878
|
-
/* @__PURE__ */ r.jsx("button", { onClick: t.fetchStamps, style: Ce, children: "Retry" })
|
|
879
|
-
] }) : t.stamps.length === 0 ? /* @__PURE__ */ r.jsxs("div", { style: { ...N, flexDirection: "column", alignItems: "flex-start", gap: 4 }, children: [
|
|
880
|
-
/* @__PURE__ */ r.jsx("div", { style: { fontSize: 14, color: a.colors.muted }, children: "No postage stamps found." }),
|
|
881
|
-
/* @__PURE__ */ r.jsx("div", { style: { fontSize: 12, color: a.colors.muted }, children: "Buy a stamp via the Bee API or Swarm Desktop to continue." })
|
|
882
|
-
] }) : /* @__PURE__ */ r.jsx("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: t.stamps.map((n) => /* @__PURE__ */ r.jsx(
|
|
883
|
-
st,
|
|
911
|
+
function q({ children: n, onClick: r, disabled: a }) {
|
|
912
|
+
const [i, s] = F(!1);
|
|
913
|
+
return /* @__PURE__ */ t.jsx(
|
|
914
|
+
"button",
|
|
884
915
|
{
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
916
|
+
onClick: r,
|
|
917
|
+
disabled: a,
|
|
918
|
+
onMouseEnter: () => s(!0),
|
|
919
|
+
onMouseLeave: () => s(!1),
|
|
920
|
+
style: {
|
|
921
|
+
fontFamily: "var(--font-mono)",
|
|
922
|
+
fontSize: 12,
|
|
923
|
+
letterSpacing: ".04em",
|
|
924
|
+
background: "transparent",
|
|
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)",
|
|
927
|
+
borderRadius: 4,
|
|
928
|
+
padding: "7px 14px",
|
|
929
|
+
cursor: a ? "default" : "pointer",
|
|
930
|
+
transition: "all .15s var(--ease)",
|
|
931
|
+
opacity: a ? 0.5 : 1
|
|
932
|
+
},
|
|
933
|
+
children: n
|
|
934
|
+
}
|
|
935
|
+
);
|
|
891
936
|
}
|
|
892
|
-
function
|
|
893
|
-
const
|
|
894
|
-
return /* @__PURE__ */
|
|
937
|
+
function wt({ children: n, onClick: r, pending: a, block: i, style: s }) {
|
|
938
|
+
const [d, h] = F(!1);
|
|
939
|
+
return /* @__PURE__ */ t.jsx(
|
|
895
940
|
"button",
|
|
896
941
|
{
|
|
897
|
-
onClick:
|
|
942
|
+
onClick: r,
|
|
943
|
+
disabled: a,
|
|
944
|
+
onMouseEnter: () => h(!0),
|
|
945
|
+
onMouseLeave: () => h(!1),
|
|
898
946
|
style: {
|
|
899
|
-
display: "flex",
|
|
947
|
+
display: "inline-flex",
|
|
900
948
|
alignItems: "center",
|
|
901
|
-
justifyContent: "
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
width: "100%",
|
|
909
|
-
|
|
949
|
+
justifyContent: "center",
|
|
950
|
+
gap: 8,
|
|
951
|
+
fontFamily: "var(--font-mono)",
|
|
952
|
+
fontSize: 13,
|
|
953
|
+
fontWeight: 600,
|
|
954
|
+
letterSpacing: ".06em",
|
|
955
|
+
textTransform: "uppercase",
|
|
956
|
+
width: i ? "100%" : "auto",
|
|
957
|
+
background: "var(--accent)",
|
|
958
|
+
color: "var(--accent-ink)",
|
|
959
|
+
border: "none",
|
|
960
|
+
borderRadius: 4,
|
|
961
|
+
padding: "11px 20px",
|
|
962
|
+
cursor: a ? "default" : "pointer",
|
|
963
|
+
boxShadow: d ? "0 0 24px var(--accent-glow)" : "0 0 14px var(--accent-glow)",
|
|
964
|
+
transform: d ? "translateY(-1px)" : "none",
|
|
965
|
+
transition: "all .15s var(--ease)",
|
|
966
|
+
opacity: a ? 0.8 : 1,
|
|
967
|
+
whiteSpace: "nowrap",
|
|
968
|
+
...s
|
|
910
969
|
},
|
|
911
|
-
children:
|
|
912
|
-
/* @__PURE__ */ r.jsxs("div", { children: [
|
|
913
|
-
/* @__PURE__ */ r.jsx("div", { style: { fontFamily: "monospace", fontSize: 12, color: a.colors.text }, children: u }),
|
|
914
|
-
t.label && /* @__PURE__ */ r.jsx("div", { style: { fontSize: 12, color: a.colors.muted, marginTop: 2 }, children: t.label })
|
|
915
|
-
] }),
|
|
916
|
-
/* @__PURE__ */ r.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 8, flexShrink: 0 }, children: [
|
|
917
|
-
/* @__PURE__ */ r.jsx("span", { style: { fontSize: 11, color: a.colors.muted }, children: c > 0 ? `${c}d` : "expiring" }),
|
|
918
|
-
t.usable ? /* @__PURE__ */ r.jsx(er, { bg: a.colors.successLight, color: a.colors.success, children: "usable" }) : /* @__PURE__ */ r.jsx(er, { bg: a.colors.errorLight, color: a.colors.error, children: "unusable" }),
|
|
919
|
-
/* @__PURE__ */ r.jsx("div", { style: {
|
|
920
|
-
width: 16,
|
|
921
|
-
height: 16,
|
|
922
|
-
borderRadius: "50%",
|
|
923
|
-
flexShrink: 0,
|
|
924
|
-
border: `2px solid ${n ? a.colors.primary : a.colors.border}`,
|
|
925
|
-
background: n ? a.colors.primary : "transparent"
|
|
926
|
-
} })
|
|
927
|
-
] })
|
|
928
|
-
]
|
|
970
|
+
children: n
|
|
929
971
|
}
|
|
930
972
|
);
|
|
931
973
|
}
|
|
932
|
-
function
|
|
933
|
-
return /* @__PURE__ */
|
|
974
|
+
function ee({ children: n }) {
|
|
975
|
+
return /* @__PURE__ */ t.jsxs("div", { style: {
|
|
976
|
+
display: "flex",
|
|
977
|
+
alignItems: "center",
|
|
978
|
+
gap: 10,
|
|
979
|
+
padding: "12px 14px",
|
|
980
|
+
border: "1px dashed var(--line-2)",
|
|
981
|
+
borderRadius: 8,
|
|
982
|
+
background: "var(--bunker)"
|
|
983
|
+
}, children: [
|
|
984
|
+
/* @__PURE__ */ t.jsxs(kn, { size: 15, stroke: "var(--fg-faint)", glow: !1, children: [
|
|
985
|
+
/* @__PURE__ */ t.jsx("rect", { x: "5", y: "11", width: "14", height: "9", rx: "1.5" }),
|
|
986
|
+
/* @__PURE__ */ t.jsx("path", { d: "M8 11V8a4 4 0 0 1 8 0v3" })
|
|
987
|
+
] }),
|
|
988
|
+
/* @__PURE__ */ t.jsx("span", { style: { fontSize: 12.5, color: "var(--fg-muted)" }, children: n })
|
|
989
|
+
] });
|
|
934
990
|
}
|
|
935
|
-
function
|
|
936
|
-
|
|
991
|
+
function jn({ step: n, state: r, children: a, hint: i }) {
|
|
992
|
+
const s = r === "done", d = r === "locked";
|
|
993
|
+
return /* @__PURE__ */ t.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 10, marginBottom: 12 }, children: [
|
|
994
|
+
/* @__PURE__ */ t.jsx("span", { style: {
|
|
995
|
+
display: "inline-flex",
|
|
996
|
+
alignItems: "center",
|
|
997
|
+
justifyContent: "center",
|
|
998
|
+
width: 22,
|
|
999
|
+
height: 22,
|
|
1000
|
+
flexShrink: 0,
|
|
1001
|
+
fontFamily: "var(--font-mono)",
|
|
1002
|
+
fontSize: 11,
|
|
1003
|
+
fontWeight: 600,
|
|
1004
|
+
lineHeight: 1,
|
|
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",
|
|
1008
|
+
clipPath: "polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%)",
|
|
1009
|
+
boxShadow: !s && !d ? "0 0 14px var(--accent-glow)" : "none"
|
|
1010
|
+
}, children: s ? "✓" : n }),
|
|
1011
|
+
/* @__PURE__ */ t.jsx("span", { style: {
|
|
1012
|
+
fontFamily: "var(--font-mono)",
|
|
1013
|
+
fontSize: 11,
|
|
1014
|
+
fontWeight: 600,
|
|
1015
|
+
textTransform: "uppercase",
|
|
1016
|
+
letterSpacing: ".18em",
|
|
1017
|
+
color: d ? "var(--fg-faint)" : "var(--fg-soft)"
|
|
1018
|
+
}, children: a }),
|
|
1019
|
+
i && /* @__PURE__ */ t.jsx("span", { style: { marginLeft: "auto", fontFamily: "var(--font-mono)", fontSize: 10, letterSpacing: ".06em", color: "var(--fg-faint)" }, children: i })
|
|
1020
|
+
] });
|
|
937
1021
|
}
|
|
938
|
-
function
|
|
939
|
-
return /* @__PURE__ */
|
|
940
|
-
width:
|
|
941
|
-
height:
|
|
1022
|
+
function Sn({ size: n = 30 }) {
|
|
1023
|
+
return /* @__PURE__ */ t.jsx("span", { style: {
|
|
1024
|
+
width: n,
|
|
1025
|
+
height: n,
|
|
942
1026
|
flexShrink: 0,
|
|
943
|
-
|
|
944
|
-
|
|
1027
|
+
display: "inline-flex",
|
|
1028
|
+
alignItems: "center",
|
|
1029
|
+
justifyContent: "center",
|
|
1030
|
+
background: "var(--accent)",
|
|
1031
|
+
color: "var(--accent-ink)",
|
|
1032
|
+
clipPath: "polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%)",
|
|
1033
|
+
boxShadow: "0 0 18px var(--accent-glow)"
|
|
1034
|
+
}, children: /* @__PURE__ */ t.jsxs(
|
|
1035
|
+
"svg",
|
|
1036
|
+
{
|
|
1037
|
+
width: n * 0.56,
|
|
1038
|
+
height: n * 0.56,
|
|
1039
|
+
viewBox: "0 0 24 24",
|
|
1040
|
+
fill: "none",
|
|
1041
|
+
stroke: "var(--accent-ink)",
|
|
1042
|
+
strokeWidth: "1.8",
|
|
1043
|
+
strokeLinecap: "round",
|
|
1044
|
+
strokeLinejoin: "round",
|
|
1045
|
+
children: [
|
|
1046
|
+
/* @__PURE__ */ t.jsx("ellipse", { cx: "12", cy: "14", rx: "5", ry: "6.5" }),
|
|
1047
|
+
/* @__PURE__ */ t.jsx("path", { d: "M7 12h10M7 16h10M12 7.5V4M12 4l-2.5-1.5M12 4l2.5-1.5" })
|
|
1048
|
+
]
|
|
1049
|
+
}
|
|
1050
|
+
) });
|
|
1051
|
+
}
|
|
1052
|
+
function Cn({ states: n }) {
|
|
1053
|
+
return /* @__PURE__ */ t.jsx("span", { style: { display: "inline-flex", gap: 5 }, children: n.map((r, a) => /* @__PURE__ */ t.jsx("span", { style: {
|
|
1054
|
+
width: 7,
|
|
1055
|
+
height: 7,
|
|
945
1056
|
borderRadius: "50%",
|
|
946
|
-
|
|
947
|
-
|
|
1057
|
+
background: r ? "var(--ok)" : "var(--line-2)",
|
|
1058
|
+
boxShadow: r ? "0 0 8px var(--ok)" : "none",
|
|
1059
|
+
transition: "all .2s"
|
|
1060
|
+
} }, a)) });
|
|
948
1061
|
}
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
alignItems: "center",
|
|
952
|
-
gap: 12,
|
|
953
|
-
padding: "11px 14px",
|
|
954
|
-
border: `1px solid ${a.colors.border}`,
|
|
955
|
-
borderRadius: 8,
|
|
956
|
-
background: "#fff"
|
|
957
|
-
}, Ce = {
|
|
958
|
-
background: "none",
|
|
959
|
-
border: `1px solid ${a.colors.border}`,
|
|
960
|
-
borderRadius: 6,
|
|
961
|
-
padding: "5px 14px",
|
|
962
|
-
cursor: "pointer",
|
|
963
|
-
fontSize: 13,
|
|
964
|
-
color: a.colors.muted,
|
|
965
|
-
alignSelf: "flex-start"
|
|
966
|
-
};
|
|
967
|
-
function at(t) {
|
|
968
|
-
const n = {
|
|
1062
|
+
function Rn(n) {
|
|
1063
|
+
const r = {
|
|
969
1064
|
formatters: void 0,
|
|
970
1065
|
fees: void 0,
|
|
971
1066
|
serializers: void 0,
|
|
972
|
-
...
|
|
1067
|
+
...n
|
|
973
1068
|
};
|
|
974
|
-
function i
|
|
975
|
-
return (
|
|
976
|
-
const
|
|
977
|
-
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) });
|
|
978
1073
|
};
|
|
979
1074
|
}
|
|
980
|
-
return Object.assign(
|
|
981
|
-
extend:
|
|
1075
|
+
return Object.assign(r, {
|
|
1076
|
+
extend: a(r)
|
|
982
1077
|
});
|
|
983
1078
|
}
|
|
984
|
-
const
|
|
1079
|
+
const Oe = /* @__PURE__ */ Rn({
|
|
985
1080
|
id: 100,
|
|
986
1081
|
name: "Gnosis",
|
|
987
1082
|
nativeCurrency: {
|
|
@@ -1010,343 +1105,731 @@ const Se = /* @__PURE__ */ at({
|
|
|
1010
1105
|
}
|
|
1011
1106
|
}
|
|
1012
1107
|
});
|
|
1013
|
-
function
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
/* @__PURE__ */ r.jsx(je, { step: 3, done: i && u, children: "Wallet" }),
|
|
1017
|
-
/* @__PURE__ */ r.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 12 }, children: [
|
|
1018
|
-
i ? /* @__PURE__ */ r.jsx(lt, { address: n }) : t ? /* @__PURE__ */ r.jsx(dt, {}) : /* @__PURE__ */ r.jsx(ut, {}),
|
|
1019
|
-
i && /* @__PURE__ */ r.jsx(ft, { isOnGnosis: u, chainId: c })
|
|
1020
|
-
] })
|
|
1021
|
-
] });
|
|
1108
|
+
function ze(n) {
|
|
1109
|
+
if (n)
|
|
1110
|
+
return n.shortMessage ?? n.message;
|
|
1022
1111
|
}
|
|
1023
|
-
function
|
|
1024
|
-
const
|
|
1025
|
-
return /* @__PURE__ */
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1112
|
+
function _n({ name: n, icon: r, pending: a, disabled: i, onClick: s }) {
|
|
1113
|
+
const [d, h] = F(!1);
|
|
1114
|
+
return /* @__PURE__ */ t.jsxs(
|
|
1115
|
+
"button",
|
|
1116
|
+
{
|
|
1117
|
+
onClick: s,
|
|
1118
|
+
disabled: i || a,
|
|
1119
|
+
onMouseEnter: () => h(!0),
|
|
1120
|
+
onMouseLeave: () => h(!1),
|
|
1121
|
+
style: {
|
|
1122
|
+
display: "flex",
|
|
1123
|
+
alignItems: "center",
|
|
1124
|
+
gap: 12,
|
|
1125
|
+
width: "100%",
|
|
1126
|
+
textAlign: "left",
|
|
1127
|
+
padding: "11px 13px",
|
|
1128
|
+
borderRadius: 8,
|
|
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)",
|
|
1133
|
+
transition: "all .15s var(--ease)"
|
|
1134
|
+
},
|
|
1135
|
+
children: [
|
|
1136
|
+
/* @__PURE__ */ t.jsx("span", { style: {
|
|
1137
|
+
width: 30,
|
|
1138
|
+
height: 30,
|
|
1139
|
+
flexShrink: 0,
|
|
1140
|
+
borderRadius: 7,
|
|
1141
|
+
display: "inline-flex",
|
|
1142
|
+
alignItems: "center",
|
|
1143
|
+
justifyContent: "center",
|
|
1144
|
+
background: "var(--bunker)",
|
|
1145
|
+
border: "1px solid var(--line-2)",
|
|
1146
|
+
color: "var(--accent-bright)",
|
|
1147
|
+
overflow: "hidden",
|
|
1148
|
+
fontFamily: "var(--font-display)",
|
|
1149
|
+
fontWeight: 700,
|
|
1150
|
+
fontSize: 15
|
|
1151
|
+
}, children: r ? /* @__PURE__ */ t.jsx("img", { src: r, width: 30, height: 30, alt: "", style: { borderRadius: 7 } }) : n.charAt(0) }),
|
|
1152
|
+
/* @__PURE__ */ t.jsx("span", { style: { flex: 1, fontSize: 14, fontWeight: 500, color: "var(--fg)" }, children: n }),
|
|
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: "→" })
|
|
1154
|
+
]
|
|
1155
|
+
}
|
|
1156
|
+
);
|
|
1157
|
+
}
|
|
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();
|
|
1160
|
+
if (n)
|
|
1161
|
+
return /* @__PURE__ */ t.jsx(
|
|
1162
|
+
H,
|
|
1040
1163
|
{
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
borderRadius: 6,
|
|
1046
|
-
padding: "5px 12px",
|
|
1047
|
-
cursor: "pointer",
|
|
1048
|
-
fontSize: 12,
|
|
1049
|
-
color: a.colors.muted
|
|
1050
|
-
},
|
|
1051
|
-
children: "Disconnect"
|
|
1164
|
+
tone: "ok",
|
|
1165
|
+
title: `Wallet connected${u ? ` · ${u.name}` : ""}`,
|
|
1166
|
+
sub: r,
|
|
1167
|
+
children: /* @__PURE__ */ t.jsx(q, { onClick: () => p(), children: "disconnect" })
|
|
1052
1168
|
}
|
|
1053
|
-
)
|
|
1169
|
+
);
|
|
1170
|
+
const o = s && d != null && d.connector && "uid" in d.connector ? d.connector.uid : void 0;
|
|
1171
|
+
return /* @__PURE__ */ t.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: [
|
|
1172
|
+
a.map((l) => /* @__PURE__ */ t.jsx(
|
|
1173
|
+
_n,
|
|
1174
|
+
{
|
|
1175
|
+
name: l.name,
|
|
1176
|
+
icon: l.icon,
|
|
1177
|
+
pending: o === l.uid,
|
|
1178
|
+
disabled: s && o !== l.uid,
|
|
1179
|
+
onClick: () => i({ connector: l })
|
|
1180
|
+
},
|
|
1181
|
+
l.uid
|
|
1182
|
+
)),
|
|
1183
|
+
h && /* @__PURE__ */ t.jsx("div", { style: { fontSize: 12, color: "var(--bad)", fontFamily: "var(--font-mono)" }, children: h.message })
|
|
1054
1184
|
] });
|
|
1055
1185
|
}
|
|
1056
|
-
function
|
|
1057
|
-
|
|
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
|
+
] })
|
|
1195
|
+
] });
|
|
1196
|
+
}
|
|
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)";
|
|
1199
|
+
return /* @__PURE__ */ t.jsxs("div", { style: {
|
|
1058
1200
|
display: "flex",
|
|
1059
1201
|
alignItems: "center",
|
|
1060
1202
|
gap: 12,
|
|
1061
|
-
padding: "
|
|
1062
|
-
border: `1px
|
|
1203
|
+
padding: "12px 14px",
|
|
1204
|
+
border: `1px solid ${i ? "var(--line)" : h}`,
|
|
1063
1205
|
borderRadius: 8,
|
|
1064
|
-
background: "
|
|
1206
|
+
background: i ? "var(--raised)" : p
|
|
1065
1207
|
}, children: [
|
|
1066
|
-
/* @__PURE__ */
|
|
1067
|
-
/* @__PURE__ */
|
|
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" } }),
|
|
1209
|
+
/* @__PURE__ */ t.jsxs("div", { style: { minWidth: 0 }, children: [
|
|
1210
|
+
/* @__PURE__ */ t.jsx("div", { style: { fontWeight: 600, fontSize: 13.5, color: i ? "var(--fg-soft)" : d }, children: n }),
|
|
1211
|
+
/* @__PURE__ */ t.jsx("div", { style: { fontSize: 12, color: "var(--fg-muted)", marginTop: 2 }, children: r })
|
|
1212
|
+
] }),
|
|
1213
|
+
/* @__PURE__ */ t.jsxs("div", { style: { marginLeft: "auto", display: "flex", alignItems: "center", gap: 10, flexShrink: 0 }, children: [
|
|
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" })
|
|
1216
|
+
] })
|
|
1068
1217
|
] });
|
|
1069
1218
|
}
|
|
1070
|
-
function
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
disabled: i,
|
|
1078
|
-
style: {
|
|
1079
|
-
display: "flex",
|
|
1080
|
-
alignItems: "center",
|
|
1081
|
-
gap: 10,
|
|
1082
|
-
padding: "11px 14px",
|
|
1083
|
-
border: `1.5px solid ${a.colors.border}`,
|
|
1084
|
-
borderRadius: 8,
|
|
1085
|
-
cursor: i ? "not-allowed" : "pointer",
|
|
1086
|
-
background: "#fff",
|
|
1087
|
-
fontSize: 14,
|
|
1088
|
-
fontWeight: 500,
|
|
1089
|
-
color: a.colors.text,
|
|
1090
|
-
opacity: i ? 0.6 : 1,
|
|
1091
|
-
transition: "border-color 0.15s",
|
|
1092
|
-
width: "100%"
|
|
1093
|
-
},
|
|
1094
|
-
onMouseOver: (p) => {
|
|
1095
|
-
i || (p.currentTarget.style.borderColor = a.colors.primary);
|
|
1096
|
-
},
|
|
1097
|
-
onMouseOut: (p) => {
|
|
1098
|
-
p.currentTarget.style.borderColor = a.colors.border;
|
|
1099
|
-
},
|
|
1100
|
-
children: [
|
|
1101
|
-
u.icon ? /* @__PURE__ */ r.jsx("img", { src: u.icon, width: 20, height: 20, alt: "", style: { borderRadius: 4 } }) : /* @__PURE__ */ r.jsx("span", { style: { width: 20, textAlign: "center", fontSize: 16 }, children: "🔗" }),
|
|
1102
|
-
u.name
|
|
1103
|
-
]
|
|
1104
|
-
},
|
|
1105
|
-
u.uid
|
|
1106
|
-
)),
|
|
1107
|
-
c && /* @__PURE__ */ r.jsx("div", { style: { fontSize: 12, color: a.colors.error, marginTop: 2 }, children: c.message })
|
|
1219
|
+
function Tn({ locked: n, balance: r }) {
|
|
1220
|
+
if (n) return /* @__PURE__ */ t.jsx(ee, { children: "Switch to the Gnosis chain to read your wallet's xDAI balance." });
|
|
1221
|
+
const a = r.xdai ?? 0, i = !r.isLoading && a === 0;
|
|
1222
|
+
return /* @__PURE__ */ t.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: [
|
|
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" })
|
|
1108
1226
|
] });
|
|
1109
1227
|
}
|
|
1110
|
-
function
|
|
1111
|
-
const
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1228
|
+
function Fn({ value: n, disabled: r, onSubmit: a }) {
|
|
1229
|
+
const [i, s] = F(n), [d, h] = F(!1);
|
|
1230
|
+
Q(() => {
|
|
1231
|
+
s(n);
|
|
1232
|
+
}, [n]);
|
|
1233
|
+
const p = i.trim().replace(/\/+$/, ""), u = p !== n && p.length > 0, o = () => {
|
|
1234
|
+
u && a(p);
|
|
1235
|
+
};
|
|
1236
|
+
return /* @__PURE__ */ t.jsxs("div", { style: { display: "flex", gap: 8 }, children: [
|
|
1237
|
+
/* @__PURE__ */ t.jsxs("div", { style: {
|
|
1238
|
+
flex: 1,
|
|
1239
|
+
minWidth: 0,
|
|
1240
|
+
display: "flex",
|
|
1241
|
+
alignItems: "center",
|
|
1242
|
+
gap: 8,
|
|
1243
|
+
padding: "0 12px",
|
|
1244
|
+
borderRadius: 6,
|
|
1245
|
+
border: `1px solid ${d ? "var(--line-orange)" : "var(--line-2)"}`,
|
|
1246
|
+
background: r ? "var(--bunker)" : "var(--surface)",
|
|
1247
|
+
boxShadow: d ? "0 0 0 3px var(--accent-wash)" : "none",
|
|
1248
|
+
transition: "all .15s var(--ease)"
|
|
1249
|
+
}, children: [
|
|
1250
|
+
/* @__PURE__ */ t.jsx("span", { style: { fontFamily: "var(--font-mono)", fontSize: 12, color: "var(--accent)" }, children: ">" }),
|
|
1251
|
+
/* @__PURE__ */ t.jsx(
|
|
1252
|
+
"input",
|
|
1253
|
+
{
|
|
1254
|
+
type: "url",
|
|
1255
|
+
value: i,
|
|
1256
|
+
disabled: r,
|
|
1257
|
+
spellCheck: !1,
|
|
1258
|
+
autoComplete: "off",
|
|
1259
|
+
onFocus: () => h(!0),
|
|
1260
|
+
onBlur: () => h(!1),
|
|
1261
|
+
onChange: (l) => s(l.target.value),
|
|
1262
|
+
onKeyDown: (l) => {
|
|
1263
|
+
l.key === "Enter" && o();
|
|
1264
|
+
},
|
|
1265
|
+
placeholder: "http://localhost:1633",
|
|
1266
|
+
style: {
|
|
1267
|
+
flex: 1,
|
|
1268
|
+
minWidth: 0,
|
|
1269
|
+
background: "transparent",
|
|
1270
|
+
border: "none",
|
|
1271
|
+
outline: "none",
|
|
1272
|
+
color: "var(--fg)",
|
|
1273
|
+
fontFamily: "var(--font-mono)",
|
|
1274
|
+
fontSize: 12.5,
|
|
1275
|
+
padding: "9px 0"
|
|
1276
|
+
}
|
|
1277
|
+
}
|
|
1278
|
+
)
|
|
1279
|
+
] }),
|
|
1280
|
+
/* @__PURE__ */ t.jsx(q, { onClick: o, disabled: r || !u, children: "connect" })
|
|
1281
|
+
] });
|
|
1282
|
+
}
|
|
1283
|
+
function Pn({ node: n, beeApiUrl: r }) {
|
|
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: [
|
|
1285
|
+
/* @__PURE__ */ t.jsx(ke, {}),
|
|
1286
|
+
/* @__PURE__ */ t.jsxs("span", { style: { color: "var(--fg-muted)", fontSize: 13, fontFamily: "var(--font-mono)" }, children: [
|
|
1287
|
+
"probing ",
|
|
1288
|
+
r,
|
|
1289
|
+
"…"
|
|
1290
|
+
] })
|
|
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 }),
|
|
1293
|
+
/* @__PURE__ */ t.jsxs("div", { style: { fontSize: 12, color: "var(--fg-muted)", display: "flex", alignItems: "center", gap: 6, flexWrap: "wrap" }, children: [
|
|
1294
|
+
/* @__PURE__ */ t.jsx("span", { children: "start one with" }),
|
|
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" }),
|
|
1296
|
+
/* @__PURE__ */ t.jsx(q, { onClick: n.check, children: "retry" })
|
|
1128
1297
|
] })
|
|
1129
|
-
] }) : /* @__PURE__ */
|
|
1130
|
-
|
|
1298
|
+
] }) : /* @__PURE__ */ t.jsx(H, { tone: "flat", title: "Node not connected", sub: r, children: /* @__PURE__ */ t.jsx(q, { onClick: n.check, children: "connect" }) });
|
|
1299
|
+
}
|
|
1300
|
+
function ft({ symbol: n, value: r, onChange: a, onSend: i, pending: s, confirming: d, done: h, disabled: p }) {
|
|
1301
|
+
const u = s || d;
|
|
1302
|
+
return /* @__PURE__ */ t.jsxs("div", { style: { display: "flex", gap: 8, alignItems: "center" }, children: [
|
|
1303
|
+
/* @__PURE__ */ t.jsxs("div", { style: {
|
|
1304
|
+
flex: 1,
|
|
1305
|
+
minWidth: 0,
|
|
1131
1306
|
display: "flex",
|
|
1132
1307
|
alignItems: "center",
|
|
1133
|
-
gap:
|
|
1134
|
-
padding: "
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
background:
|
|
1308
|
+
gap: 8,
|
|
1309
|
+
padding: "0 12px",
|
|
1310
|
+
borderRadius: 6,
|
|
1311
|
+
border: "1px solid var(--line-2)",
|
|
1312
|
+
background: u || p ? "var(--bunker)" : "var(--surface)"
|
|
1138
1313
|
}, children: [
|
|
1139
|
-
/* @__PURE__ */
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1314
|
+
/* @__PURE__ */ t.jsx(
|
|
1315
|
+
"input",
|
|
1316
|
+
{
|
|
1317
|
+
inputMode: "decimal",
|
|
1318
|
+
value: r,
|
|
1319
|
+
disabled: u || p,
|
|
1320
|
+
spellCheck: !1,
|
|
1321
|
+
onChange: (o) => a(o.target.value),
|
|
1322
|
+
style: {
|
|
1323
|
+
flex: 1,
|
|
1324
|
+
minWidth: 0,
|
|
1325
|
+
background: "transparent",
|
|
1326
|
+
border: "none",
|
|
1327
|
+
outline: "none",
|
|
1328
|
+
color: "var(--fg)",
|
|
1329
|
+
fontFamily: "var(--font-mono)",
|
|
1330
|
+
fontSize: 12.5,
|
|
1331
|
+
padding: "8px 0"
|
|
1332
|
+
}
|
|
1333
|
+
}
|
|
1334
|
+
),
|
|
1335
|
+
/* @__PURE__ */ t.jsx("span", { style: { fontFamily: "var(--font-mono)", fontSize: 11, color: "var(--fg-muted)", flexShrink: 0 }, children: n })
|
|
1150
1336
|
] }),
|
|
1151
|
-
/* @__PURE__ */
|
|
1152
|
-
|
|
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()}` })
|
|
1338
|
+
] });
|
|
1339
|
+
}
|
|
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 });
|
|
1342
|
+
Q(() => {
|
|
1343
|
+
o.isSuccess && r();
|
|
1344
|
+
}, [o.isSuccess]), Q(() => {
|
|
1345
|
+
l.isSuccess && r();
|
|
1346
|
+
}, [l.isSuccess]);
|
|
1347
|
+
const v = nn({
|
|
1348
|
+
abi: ot,
|
|
1349
|
+
address: dt,
|
|
1350
|
+
functionName: "balanceOf",
|
|
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,
|
|
1362
|
+
functionName: "transfer",
|
|
1363
|
+
args: [n, S],
|
|
1364
|
+
chainId: G
|
|
1365
|
+
});
|
|
1366
|
+
}, O = ze(p.error) ?? ze(u.error);
|
|
1367
|
+
return /* @__PURE__ */ t.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: [
|
|
1368
|
+
/* @__PURE__ */ t.jsx("div", { style: be, children: "One-time top-up — sent from your connected wallet to the node wallet:" }),
|
|
1369
|
+
/* @__PURE__ */ t.jsx(
|
|
1370
|
+
ft,
|
|
1153
1371
|
{
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
cursor: c ? "not-allowed" : "pointer",
|
|
1163
|
-
fontSize: 14,
|
|
1164
|
-
fontWeight: 500,
|
|
1165
|
-
opacity: c ? 0.7 : 1,
|
|
1166
|
-
alignSelf: "flex-start"
|
|
1167
|
-
},
|
|
1168
|
-
children: c ? "Switching…" : "Switch to Gnosis"
|
|
1372
|
+
symbol: "xDAI",
|
|
1373
|
+
value: a,
|
|
1374
|
+
onChange: i,
|
|
1375
|
+
onSend: _,
|
|
1376
|
+
pending: p.isPending,
|
|
1377
|
+
confirming: o.isLoading && !!p.data,
|
|
1378
|
+
done: o.isSuccess,
|
|
1379
|
+
disabled: !1
|
|
1169
1380
|
}
|
|
1170
1381
|
),
|
|
1171
|
-
|
|
1382
|
+
/* @__PURE__ */ t.jsx(
|
|
1383
|
+
ft,
|
|
1384
|
+
{
|
|
1385
|
+
symbol: "xBZZ",
|
|
1386
|
+
value: s,
|
|
1387
|
+
onChange: d,
|
|
1388
|
+
onSend: E,
|
|
1389
|
+
pending: u.isPending,
|
|
1390
|
+
confirming: l.isLoading && !!u.data,
|
|
1391
|
+
done: l.isSuccess,
|
|
1392
|
+
disabled: !b
|
|
1393
|
+
}
|
|
1394
|
+
),
|
|
1395
|
+
g !== void 0 && /* @__PURE__ */ t.jsxs("div", { style: { ...be, display: "flex", alignItems: "center", gap: 8, flexWrap: "wrap" }, children: [
|
|
1396
|
+
/* @__PURE__ */ t.jsxs("span", { children: [
|
|
1397
|
+
"your wallet holds",
|
|
1398
|
+
" ",
|
|
1399
|
+
/* @__PURE__ */ t.jsxs("span", { style: { fontFamily: "var(--font-mono)", color: b ? "var(--fg-soft)" : "var(--warn)" }, children: [
|
|
1400
|
+
g.toLocaleString("en-US", { maximumFractionDigits: 4 }),
|
|
1401
|
+
" xBZZ"
|
|
1402
|
+
] })
|
|
1403
|
+
] }),
|
|
1404
|
+
!b && /* @__PURE__ */ t.jsx(q, { onClick: () => window.open("https://www.ethswarm.org/get-bzz", "_blank", "noopener"), children: "get xBZZ" })
|
|
1405
|
+
] }),
|
|
1406
|
+
O && /* @__PURE__ */ t.jsx("div", { style: { fontSize: 12, color: "var(--bad)", fontFamily: "var(--font-mono)" }, children: O })
|
|
1172
1407
|
] });
|
|
1173
1408
|
}
|
|
1174
|
-
function ht(
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
/* @__PURE__ */
|
|
1185
|
-
"
|
|
1409
|
+
function ht(n) {
|
|
1410
|
+
try {
|
|
1411
|
+
return n();
|
|
1412
|
+
} catch {
|
|
1413
|
+
return;
|
|
1414
|
+
}
|
|
1415
|
+
}
|
|
1416
|
+
function On({ locked: n, nodeWallet: r }) {
|
|
1417
|
+
if (n) return /* @__PURE__ */ t.jsx(ee, { children: "Bring your Bee node online to read its wallet." });
|
|
1418
|
+
if (r.error)
|
|
1419
|
+
return /* @__PURE__ */ t.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 10 }, children: [
|
|
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" })
|
|
1422
|
+
] });
|
|
1423
|
+
const a = r.isLoading && r.xdai === void 0;
|
|
1424
|
+
return /* @__PURE__ */ t.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: [
|
|
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: [
|
|
1428
|
+
"The Bee node has its own wallet",
|
|
1429
|
+
r.address && /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
1430
|
+
" ",
|
|
1431
|
+
/* @__PURE__ */ t.jsxs("span", { style: { fontFamily: "var(--font-mono)", color: "var(--fg-soft)" }, children: [
|
|
1432
|
+
r.address.slice(0, 8),
|
|
1433
|
+
"…",
|
|
1434
|
+
r.address.slice(-6)
|
|
1435
|
+
] })
|
|
1436
|
+
] }),
|
|
1437
|
+
" ",
|
|
1438
|
+
"— it buys and renews postage stamps on chain."
|
|
1439
|
+
] }),
|
|
1440
|
+
!r.isFunded && r.address && /* @__PURE__ */ t.jsx(Dn, { to: r.address, onSettled: r.refresh })
|
|
1441
|
+
] });
|
|
1442
|
+
}
|
|
1443
|
+
function zn({ stamp: n, selected: r, onSelect: a }) {
|
|
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;
|
|
1445
|
+
return /* @__PURE__ */ t.jsxs(
|
|
1446
|
+
"button",
|
|
1447
|
+
{
|
|
1448
|
+
onClick: a,
|
|
1449
|
+
onMouseEnter: () => s(!0),
|
|
1450
|
+
onMouseLeave: () => s(!1),
|
|
1451
|
+
style: {
|
|
1452
|
+
display: "flex",
|
|
1453
|
+
alignItems: "center",
|
|
1454
|
+
gap: 12,
|
|
1455
|
+
width: "100%",
|
|
1456
|
+
textAlign: "left",
|
|
1457
|
+
padding: "12px 14px",
|
|
1458
|
+
borderRadius: 8,
|
|
1459
|
+
cursor: "pointer",
|
|
1460
|
+
border: `1px solid ${r ? "var(--ok-line)" : p ? "var(--line-2)" : "var(--line)"}`,
|
|
1461
|
+
background: r ? "var(--ok-wash)" : "var(--raised)",
|
|
1462
|
+
boxShadow: r ? "0 0 0 1px var(--ok-line), 0 0 18px var(--ok-wash)" : "none",
|
|
1463
|
+
transition: "all .15s var(--ease)"
|
|
1464
|
+
},
|
|
1465
|
+
children: [
|
|
1466
|
+
/* @__PURE__ */ t.jsx("span", { style: {
|
|
1467
|
+
width: 8,
|
|
1468
|
+
height: 8,
|
|
1469
|
+
flexShrink: 0,
|
|
1470
|
+
borderRadius: "50%",
|
|
1471
|
+
background: r ? "var(--ok)" : "var(--line-2)",
|
|
1472
|
+
boxShadow: r ? "0 0 8px var(--ok)" : "none",
|
|
1473
|
+
transition: "all .15s var(--ease)"
|
|
1474
|
+
} }),
|
|
1475
|
+
/* @__PURE__ */ t.jsxs("div", { style: { minWidth: 0, flex: 1 }, children: [
|
|
1476
|
+
/* @__PURE__ */ t.jsx("div", { style: { fontFamily: "var(--font-mono)", fontSize: 12.5, color: "var(--fg)" }, children: h }),
|
|
1477
|
+
/* @__PURE__ */ t.jsxs("div", { style: { fontSize: 11.5, color: "var(--fg-muted)", marginTop: 3, display: "flex", gap: 8 }, children: [
|
|
1478
|
+
n.label && /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
1479
|
+
/* @__PURE__ */ t.jsx("span", { children: n.label }),
|
|
1480
|
+
/* @__PURE__ */ t.jsx("span", { style: { color: "var(--fg-faint)" }, children: "·" })
|
|
1481
|
+
] }),
|
|
1482
|
+
/* @__PURE__ */ t.jsxs("span", { children: [
|
|
1483
|
+
"depth ",
|
|
1484
|
+
n.depth
|
|
1485
|
+
] })
|
|
1486
|
+
] })
|
|
1487
|
+
] }),
|
|
1488
|
+
/* @__PURE__ */ t.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 8, flexShrink: 0 }, children: [
|
|
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" })
|
|
1491
|
+
] })
|
|
1492
|
+
]
|
|
1493
|
+
}
|
|
1494
|
+
);
|
|
1495
|
+
}
|
|
1496
|
+
function An({ stamps: n, locked: r, lockedHint: a }) {
|
|
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: [
|
|
1498
|
+
/* @__PURE__ */ t.jsx(ke, {}),
|
|
1499
|
+
/* @__PURE__ */ t.jsx("span", { style: { color: "var(--fg-muted)", fontSize: 13, fontFamily: "var(--font-mono)" }, children: "reading /stamps…" })
|
|
1500
|
+
] }) : n.error ? /* @__PURE__ */ t.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 10 }, children: [
|
|
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" })
|
|
1503
|
+
] }) : /* @__PURE__ */ t.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: [
|
|
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
|
+
] }),
|
|
1508
|
+
n.stamps.map((i) => /* @__PURE__ */ t.jsx(
|
|
1509
|
+
zn,
|
|
1186
1510
|
{
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1511
|
+
stamp: i,
|
|
1512
|
+
selected: n.selectedStampId === i.batchID,
|
|
1513
|
+
onSelect: () => n.selectStamp(i.batchID)
|
|
1514
|
+
},
|
|
1515
|
+
i.batchID
|
|
1516
|
+
))
|
|
1517
|
+
] });
|
|
1518
|
+
}
|
|
1519
|
+
const be = {
|
|
1520
|
+
fontSize: 11.5,
|
|
1521
|
+
color: "var(--fg-faint)",
|
|
1522
|
+
lineHeight: 1.5,
|
|
1523
|
+
paddingLeft: 2
|
|
1524
|
+
};
|
|
1525
|
+
function $n({
|
|
1526
|
+
onClose: n,
|
|
1527
|
+
beeNode: r,
|
|
1528
|
+
stamps: a,
|
|
1529
|
+
beeApiUrl: i,
|
|
1530
|
+
setBeeApiUrl: s,
|
|
1531
|
+
requirements: d,
|
|
1532
|
+
nodeWallet: h
|
|
1533
|
+
}) {
|
|
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,
|
|
1538
|
+
query: { enabled: o }
|
|
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);
|
|
1540
|
+
Q(() => {
|
|
1541
|
+
!I.current && (I.current = !0, r.isRunning) || r.check();
|
|
1542
|
+
}, [i]), Q(() => {
|
|
1543
|
+
r.isRunning && (a.fetchStamps(), p.xbzz && w.refresh());
|
|
1544
|
+
}, [r.isRunning]);
|
|
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."
|
|
1193
1597
|
}
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
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(" · ");
|
|
1608
|
+
return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
1609
|
+
/* @__PURE__ */ t.jsx("div", { className: "swarm-connect", onClick: n, style: {
|
|
1610
|
+
position: "fixed",
|
|
1611
|
+
inset: 0,
|
|
1612
|
+
zIndex: 9998,
|
|
1613
|
+
background: "rgba(4,6,8,0.72)",
|
|
1614
|
+
backdropFilter: "blur(6px)",
|
|
1615
|
+
WebkitBackdropFilter: "blur(6px)",
|
|
1616
|
+
animation: "sc-backdrop-in .2s var(--ease)"
|
|
1617
|
+
} }),
|
|
1618
|
+
/* @__PURE__ */ t.jsxs("div", { className: "swarm-connect", role: "dialog", "aria-label": "Connect to Swarm", style: {
|
|
1197
1619
|
position: "fixed",
|
|
1198
1620
|
top: "50%",
|
|
1199
1621
|
left: "50%",
|
|
1622
|
+
transform: "translate(-50%, -50%)",
|
|
1200
1623
|
zIndex: 9999,
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1624
|
+
width: 440,
|
|
1625
|
+
maxWidth: "calc(100vw - 28px)",
|
|
1626
|
+
background: "var(--surface)",
|
|
1627
|
+
borderRadius: 14,
|
|
1628
|
+
border: "1px solid var(--line-2)",
|
|
1629
|
+
boxShadow: "0 32px 80px rgba(0,0,0,.6), 0 0 0 1px rgba(255,107,0,.08), 0 0 60px rgba(255,107,0,.08)",
|
|
1207
1630
|
overflow: "hidden",
|
|
1208
|
-
|
|
1631
|
+
animation: "sc-modal-in .26s var(--ease) forwards",
|
|
1632
|
+
fontFamily: "var(--font-body)"
|
|
1209
1633
|
}, children: [
|
|
1210
|
-
/* @__PURE__ */
|
|
1211
|
-
|
|
1212
|
-
display: "flex",
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
"
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1634
|
+
/* @__PURE__ */ t.jsxs("div", { style: { position: "relative", padding: "18px 20px 16px", borderBottom: "1px solid var(--line)", overflow: "hidden" }, children: [
|
|
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%)" } }),
|
|
1636
|
+
/* @__PURE__ */ t.jsxs("div", { style: { position: "relative", display: "flex", alignItems: "center", justifyContent: "space-between" }, children: [
|
|
1637
|
+
/* @__PURE__ */ t.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 11 }, children: [
|
|
1638
|
+
/* @__PURE__ */ t.jsx(Sn, { size: 30 }),
|
|
1639
|
+
/* @__PURE__ */ t.jsxs("div", { children: [
|
|
1640
|
+
/* @__PURE__ */ t.jsx("div", { style: { fontFamily: "var(--font-display)", fontWeight: 600, fontSize: 16, color: "var(--fg)", lineHeight: 1.1 }, children: "Connect to Swarm" }),
|
|
1641
|
+
/* @__PURE__ */ t.jsxs("div", { style: { fontFamily: "var(--font-mono)", fontSize: 10, letterSpacing: ".12em", color: "var(--fg-muted)", marginTop: 3 }, children: [
|
|
1642
|
+
"// ",
|
|
1643
|
+
re ? "ready" : fe
|
|
1644
|
+
] })
|
|
1645
|
+
] })
|
|
1646
|
+
] }),
|
|
1647
|
+
/* @__PURE__ */ t.jsx(
|
|
1648
|
+
"button",
|
|
1649
|
+
{
|
|
1650
|
+
onClick: n,
|
|
1651
|
+
"aria-label": "Close",
|
|
1652
|
+
style: {
|
|
1653
|
+
background: "transparent",
|
|
1654
|
+
border: "1px solid var(--line)",
|
|
1655
|
+
color: "var(--fg-muted)",
|
|
1656
|
+
width: 30,
|
|
1657
|
+
height: 30,
|
|
1658
|
+
borderRadius: 6,
|
|
1659
|
+
cursor: "pointer",
|
|
1660
|
+
fontSize: 18,
|
|
1661
|
+
lineHeight: 1,
|
|
1662
|
+
display: "inline-flex",
|
|
1663
|
+
alignItems: "center",
|
|
1664
|
+
justifyContent: "center",
|
|
1665
|
+
transition: "all .15s"
|
|
1666
|
+
},
|
|
1667
|
+
onMouseEnter: (D) => {
|
|
1668
|
+
D.currentTarget.style.borderColor = "var(--line-orange)", D.currentTarget.style.color = "var(--accent-bright)";
|
|
1669
|
+
},
|
|
1670
|
+
onMouseLeave: (D) => {
|
|
1671
|
+
D.currentTarget.style.borderColor = "var(--line)", D.currentTarget.style.color = "var(--fg-muted)";
|
|
1672
|
+
},
|
|
1673
|
+
children: "×"
|
|
1674
|
+
}
|
|
1675
|
+
)
|
|
1676
|
+
] })
|
|
1238
1677
|
] }),
|
|
1239
|
-
/* @__PURE__ */
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
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: {
|
|
1683
|
+
padding: "12px 20px",
|
|
1684
|
+
borderTop: "1px solid var(--line)",
|
|
1245
1685
|
display: "flex",
|
|
1246
|
-
|
|
1247
|
-
|
|
1686
|
+
alignItems: "center",
|
|
1687
|
+
justifyContent: "space-between",
|
|
1688
|
+
background: "var(--bunker)",
|
|
1689
|
+
transition: "background .3s"
|
|
1248
1690
|
}, children: [
|
|
1249
|
-
/* @__PURE__ */
|
|
1250
|
-
|
|
1251
|
-
{
|
|
1252
|
-
beeApiUrl: c,
|
|
1253
|
-
setBeeApiUrl: u,
|
|
1254
|
-
beeNode: n,
|
|
1255
|
-
stamps: i
|
|
1256
|
-
}
|
|
1257
|
-
),
|
|
1258
|
-
/* @__PURE__ */ r.jsx(ct, { swarmReady: p })
|
|
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") })
|
|
1259
1693
|
] })
|
|
1260
1694
|
] })
|
|
1261
1695
|
] });
|
|
1262
1696
|
}
|
|
1263
|
-
function
|
|
1264
|
-
const [
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
beeApiUrl: g,
|
|
1268
|
-
setBeeApiUrl: x,
|
|
1269
|
-
isWalletConnected: f,
|
|
1270
|
-
address: s,
|
|
1271
|
-
isOnGnosis: d,
|
|
1272
|
-
isFullyConnected: v
|
|
1273
|
-
} = et({ beeApiUrl: t }), b = n ?? (v ? s ? `${s.slice(0, 6)}…${s.slice(-4)}` : "Connected" : "Connect to Swarm");
|
|
1274
|
-
return /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
|
|
1275
|
-
/* @__PURE__ */ r.jsxs(
|
|
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(
|
|
1276
1701
|
"button",
|
|
1277
1702
|
{
|
|
1278
|
-
onClick:
|
|
1703
|
+
onClick: n,
|
|
1704
|
+
onMouseEnter: () => i(!0),
|
|
1705
|
+
onMouseLeave: () => i(!1),
|
|
1279
1706
|
style: {
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
background: v ? a.colors.successLight : a.colors.primary,
|
|
1284
|
-
color: v ? a.colors.success : "#fff",
|
|
1285
|
-
border: v ? `1.5px solid ${a.colors.success}` : "none",
|
|
1286
|
-
borderRadius: 8,
|
|
1287
|
-
padding: "10px 18px",
|
|
1707
|
+
flex: "1 1 50%",
|
|
1708
|
+
minWidth: 0,
|
|
1709
|
+
padding: "13px 20px",
|
|
1288
1710
|
cursor: "pointer",
|
|
1289
|
-
|
|
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,
|
|
1290
1717
|
fontWeight: 600,
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1718
|
+
letterSpacing: ".1em",
|
|
1719
|
+
textTransform: "uppercase",
|
|
1720
|
+
transition: "all .15s var(--ease)",
|
|
1721
|
+
whiteSpace: "nowrap"
|
|
1294
1722
|
},
|
|
1295
|
-
|
|
1296
|
-
|
|
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"
|
|
1297
1747
|
},
|
|
1298
|
-
|
|
1299
|
-
|
|
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");
|
|
1759
|
+
return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
1760
|
+
/* @__PURE__ */ t.jsxs(
|
|
1761
|
+
"button",
|
|
1762
|
+
{
|
|
1763
|
+
className: "swarm-connect",
|
|
1764
|
+
onClick: () => s(!0),
|
|
1765
|
+
onMouseEnter: () => _(!0),
|
|
1766
|
+
onMouseLeave: () => _(!1),
|
|
1767
|
+
style: {
|
|
1768
|
+
display: "inline-flex",
|
|
1769
|
+
alignItems: "center",
|
|
1770
|
+
gap: 10,
|
|
1771
|
+
fontFamily: "var(--font-mono)",
|
|
1772
|
+
fontSize: 13,
|
|
1773
|
+
fontWeight: 600,
|
|
1774
|
+
letterSpacing: ".04em",
|
|
1775
|
+
padding: "10px 16px",
|
|
1776
|
+
borderRadius: 6,
|
|
1777
|
+
cursor: "pointer",
|
|
1778
|
+
background: v ? "var(--ok-wash)" : "var(--accent)",
|
|
1779
|
+
color: v ? "var(--ok)" : "var(--accent-ink)",
|
|
1780
|
+
border: `1px solid ${v ? "var(--ok-line)" : "transparent"}`,
|
|
1781
|
+
boxShadow: v ? "none" : b ? "0 0 26px var(--accent-glow)" : "0 0 14px var(--accent-glow)",
|
|
1782
|
+
transform: b && !v ? "translateY(-1px)" : "none",
|
|
1783
|
+
transition: "all .15s var(--ease)",
|
|
1784
|
+
whiteSpace: "nowrap"
|
|
1300
1785
|
},
|
|
1301
1786
|
children: [
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
/* @__PURE__ */ r.jsx(ie, { ok: !!p.selectedStampId }),
|
|
1305
|
-
/* @__PURE__ */ r.jsx(ie, { ok: f }),
|
|
1306
|
-
/* @__PURE__ */ r.jsx(ie, { ok: d })
|
|
1307
|
-
] }),
|
|
1308
|
-
b
|
|
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
|
|
1309
1789
|
]
|
|
1310
1790
|
}
|
|
1311
1791
|
),
|
|
1312
|
-
i && /* @__PURE__ */
|
|
1313
|
-
|
|
1792
|
+
i && /* @__PURE__ */ t.jsx(
|
|
1793
|
+
$n,
|
|
1314
1794
|
{
|
|
1315
|
-
onClose: () =>
|
|
1795
|
+
onClose: () => s(!1),
|
|
1316
1796
|
beeNode: u,
|
|
1317
|
-
stamps:
|
|
1318
|
-
beeApiUrl:
|
|
1319
|
-
setBeeApiUrl:
|
|
1797
|
+
stamps: o,
|
|
1798
|
+
beeApiUrl: h,
|
|
1799
|
+
setBeeApiUrl: p,
|
|
1800
|
+
requirements: d.requirements,
|
|
1801
|
+
nodeWallet: l
|
|
1320
1802
|
}
|
|
1321
1803
|
)
|
|
1322
1804
|
] });
|
|
1323
1805
|
}
|
|
1324
|
-
function
|
|
1325
|
-
const
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
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"] : [],
|
|
1811
|
+
r.isChecking ? "warn" : r.isRunning ? "ok" : "bad",
|
|
1812
|
+
...s.xbzz ? [i.isFunded ? "ok" : "bad"] : [],
|
|
1813
|
+
...s.postageStamp ? [a.selectedStampId ? "ok" : "bad"] : []
|
|
1814
|
+
], o = { ok: "var(--accent-ink)", bad: "rgba(26,14,2,.32)", warn: "#7a4a00" };
|
|
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)) });
|
|
1333
1816
|
}
|
|
1334
|
-
const
|
|
1335
|
-
var
|
|
1336
|
-
if (
|
|
1337
|
-
if (typeof
|
|
1338
|
-
return
|
|
1339
|
-
},
|
|
1340
|
-
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 {
|
|
1341
1824
|
get docsBaseUrl() {
|
|
1342
1825
|
return "https://wagmi.sh/core";
|
|
1343
1826
|
}
|
|
1344
1827
|
get version() {
|
|
1345
|
-
return
|
|
1828
|
+
return Mn();
|
|
1346
1829
|
}
|
|
1347
|
-
constructor(
|
|
1348
|
-
var
|
|
1349
|
-
super(),
|
|
1830
|
+
constructor(r, a = {}) {
|
|
1831
|
+
var d;
|
|
1832
|
+
super(), ye.add(this), Object.defineProperty(this, "details", {
|
|
1350
1833
|
enumerable: !0,
|
|
1351
1834
|
configurable: !0,
|
|
1352
1835
|
writable: !0,
|
|
@@ -1372,27 +1855,27 @@ class Z extends Error {
|
|
|
1372
1855
|
writable: !0,
|
|
1373
1856
|
value: "WagmiCoreError"
|
|
1374
1857
|
});
|
|
1375
|
-
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;
|
|
1376
1859
|
this.message = [
|
|
1377
|
-
|
|
1860
|
+
r || "An error occurred.",
|
|
1378
1861
|
"",
|
|
1379
|
-
...
|
|
1380
|
-
...
|
|
1381
|
-
`Docs: ${this.docsBaseUrl}${
|
|
1862
|
+
...a.metaMessages ? [...a.metaMessages, ""] : [],
|
|
1863
|
+
...s ? [
|
|
1864
|
+
`Docs: ${this.docsBaseUrl}${s}.html${a.docsSlug ? `#${a.docsSlug}` : ""}`
|
|
1382
1865
|
] : [],
|
|
1383
|
-
...
|
|
1866
|
+
...i ? [`Details: ${i}`] : [],
|
|
1384
1867
|
`Version: ${this.version}`
|
|
1385
1868
|
].join(`
|
|
1386
|
-
`),
|
|
1869
|
+
`), a.cause && (this.cause = a.cause), this.details = i, this.docsPath = s, this.metaMessages = a.metaMessages, this.shortMessage = r;
|
|
1387
1870
|
}
|
|
1388
|
-
walk(
|
|
1389
|
-
return
|
|
1871
|
+
walk(r) {
|
|
1872
|
+
return kt(this, ye, "m", jt).call(this, this, r);
|
|
1390
1873
|
}
|
|
1391
1874
|
}
|
|
1392
|
-
|
|
1393
|
-
return
|
|
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;
|
|
1394
1877
|
};
|
|
1395
|
-
class
|
|
1878
|
+
class Nn extends le {
|
|
1396
1879
|
constructor() {
|
|
1397
1880
|
super("Chain not configured."), Object.defineProperty(this, "name", {
|
|
1398
1881
|
enumerable: !0,
|
|
@@ -1402,7 +1885,7 @@ class vt extends Z {
|
|
|
1402
1885
|
});
|
|
1403
1886
|
}
|
|
1404
1887
|
}
|
|
1405
|
-
class
|
|
1888
|
+
class X extends le {
|
|
1406
1889
|
constructor() {
|
|
1407
1890
|
super("Provider not found."), Object.defineProperty(this, "name", {
|
|
1408
1891
|
enumerable: !0,
|
|
@@ -1412,103 +1895,103 @@ class V extends Z {
|
|
|
1412
1895
|
});
|
|
1413
1896
|
}
|
|
1414
1897
|
}
|
|
1415
|
-
|
|
1416
|
-
function
|
|
1417
|
-
const { shimDisconnect:
|
|
1418
|
-
function
|
|
1419
|
-
const
|
|
1420
|
-
if (typeof
|
|
1421
|
-
const
|
|
1422
|
-
if (
|
|
1423
|
-
return
|
|
1898
|
+
$e.type = "injected";
|
|
1899
|
+
function $e(n = {}) {
|
|
1900
|
+
const { shimDisconnect: r = !0, unstable_shimAsyncInject: a } = n;
|
|
1901
|
+
function i() {
|
|
1902
|
+
const u = n.target;
|
|
1903
|
+
if (typeof u == "function") {
|
|
1904
|
+
const o = u();
|
|
1905
|
+
if (o)
|
|
1906
|
+
return o;
|
|
1424
1907
|
}
|
|
1425
|
-
return typeof
|
|
1426
|
-
...
|
|
1427
|
-
id:
|
|
1428
|
-
name: `${
|
|
1429
|
-
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)}`
|
|
1430
1913
|
}
|
|
1431
1914
|
} : {
|
|
1432
1915
|
id: "injected",
|
|
1433
1916
|
name: "Injected",
|
|
1434
|
-
provider(
|
|
1435
|
-
return
|
|
1917
|
+
provider(o) {
|
|
1918
|
+
return o == null ? void 0 : o.ethereum;
|
|
1436
1919
|
}
|
|
1437
1920
|
};
|
|
1438
1921
|
}
|
|
1439
|
-
let
|
|
1440
|
-
return (
|
|
1922
|
+
let s, d, h, p;
|
|
1923
|
+
return (u) => ({
|
|
1441
1924
|
get icon() {
|
|
1442
|
-
return
|
|
1925
|
+
return i().icon;
|
|
1443
1926
|
},
|
|
1444
1927
|
get id() {
|
|
1445
|
-
return
|
|
1928
|
+
return i().id;
|
|
1446
1929
|
},
|
|
1447
1930
|
get name() {
|
|
1448
|
-
return
|
|
1931
|
+
return i().name;
|
|
1449
1932
|
},
|
|
1450
1933
|
/** @deprecated */
|
|
1451
1934
|
get supportsSimulation() {
|
|
1452
1935
|
return !0;
|
|
1453
1936
|
},
|
|
1454
|
-
type:
|
|
1937
|
+
type: $e.type,
|
|
1455
1938
|
async setup() {
|
|
1456
|
-
const
|
|
1457
|
-
|
|
1939
|
+
const o = await this.getProvider();
|
|
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)));
|
|
1458
1941
|
},
|
|
1459
|
-
async connect({ chainId:
|
|
1460
|
-
var
|
|
1461
|
-
const
|
|
1462
|
-
if (!
|
|
1463
|
-
throw new
|
|
1464
|
-
let
|
|
1465
|
-
if (
|
|
1466
|
-
|
|
1467
|
-
else if (
|
|
1942
|
+
async connect({ chainId: o, isReconnecting: l, withCapabilities: v } = {}) {
|
|
1943
|
+
var _, E, O, S, w, I;
|
|
1944
|
+
const g = await this.getProvider();
|
|
1945
|
+
if (!g)
|
|
1946
|
+
throw new X();
|
|
1947
|
+
let b = [];
|
|
1948
|
+
if (l)
|
|
1949
|
+
b = await this.getAccounts().catch(() => []);
|
|
1950
|
+
else if (r)
|
|
1468
1951
|
try {
|
|
1469
|
-
|
|
1952
|
+
b = (S = (O = (E = (_ = (await g.request({
|
|
1470
1953
|
method: "wallet_requestPermissions",
|
|
1471
1954
|
params: [{ eth_accounts: {} }]
|
|
1472
|
-
}))[0]) == null ? void 0 :
|
|
1473
|
-
} catch (
|
|
1474
|
-
const
|
|
1475
|
-
if (
|
|
1476
|
-
throw new
|
|
1477
|
-
if (
|
|
1478
|
-
throw
|
|
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)
|
|
1961
|
+
throw k;
|
|
1479
1962
|
}
|
|
1480
1963
|
try {
|
|
1481
|
-
!(
|
|
1964
|
+
!(b != null && b.length) && !l && (b = (await g.request({
|
|
1482
1965
|
method: "eth_requestAccounts"
|
|
1483
|
-
})).map((
|
|
1484
|
-
let
|
|
1485
|
-
if (
|
|
1486
|
-
const
|
|
1487
|
-
if (
|
|
1488
|
-
throw
|
|
1489
|
-
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 };
|
|
1490
1973
|
});
|
|
1491
|
-
|
|
1974
|
+
R = (k == null ? void 0 : k.id) ?? R;
|
|
1492
1975
|
}
|
|
1493
|
-
return
|
|
1494
|
-
accounts: v ?
|
|
1495
|
-
chainId:
|
|
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)), {
|
|
1977
|
+
accounts: v ? b.map((k) => ({ address: k, capabilities: {} })) : b,
|
|
1978
|
+
chainId: R
|
|
1496
1979
|
};
|
|
1497
|
-
} catch (
|
|
1498
|
-
const
|
|
1499
|
-
throw
|
|
1980
|
+
} catch (R) {
|
|
1981
|
+
const k = R;
|
|
1982
|
+
throw k.code === U.code ? new U(k) : k.code === Fe.code ? new Fe(k) : k;
|
|
1500
1983
|
}
|
|
1501
1984
|
},
|
|
1502
1985
|
async disconnect() {
|
|
1503
|
-
var
|
|
1504
|
-
const
|
|
1505
|
-
if (!
|
|
1506
|
-
throw new
|
|
1507
|
-
|
|
1986
|
+
var l, v;
|
|
1987
|
+
const o = await this.getProvider();
|
|
1988
|
+
if (!o)
|
|
1989
|
+
throw new X();
|
|
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));
|
|
1508
1991
|
try {
|
|
1509
|
-
await
|
|
1992
|
+
await dn(() => (
|
|
1510
1993
|
// TODO: Remove explicit type for viem@3
|
|
1511
|
-
|
|
1994
|
+
o.request({
|
|
1512
1995
|
// `'wallet_revokePermissions'` added in `viem@2.10.3`
|
|
1513
1996
|
method: "wallet_revokePermissions",
|
|
1514
1997
|
params: [{ eth_accounts: {} }]
|
|
@@ -1516,164 +1999,164 @@ function Re(t = {}) {
|
|
|
1516
1999
|
), { timeout: 100 });
|
|
1517
2000
|
} catch {
|
|
1518
2001
|
}
|
|
1519
|
-
|
|
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"));
|
|
1520
2003
|
},
|
|
1521
2004
|
async getAccounts() {
|
|
1522
|
-
const
|
|
1523
|
-
if (!
|
|
1524
|
-
throw new
|
|
1525
|
-
return (await
|
|
2005
|
+
const o = await this.getProvider();
|
|
2006
|
+
if (!o)
|
|
2007
|
+
throw new X();
|
|
2008
|
+
return (await o.request({ method: "eth_accounts" })).map((v) => me(v));
|
|
1526
2009
|
},
|
|
1527
2010
|
async getChainId() {
|
|
1528
|
-
const
|
|
1529
|
-
if (!
|
|
1530
|
-
throw new
|
|
1531
|
-
const
|
|
1532
|
-
return Number(
|
|
2011
|
+
const o = await this.getProvider();
|
|
2012
|
+
if (!o)
|
|
2013
|
+
throw new X();
|
|
2014
|
+
const l = await o.request({ method: "eth_chainId" });
|
|
2015
|
+
return Number(l);
|
|
1533
2016
|
},
|
|
1534
2017
|
async getProvider() {
|
|
1535
2018
|
if (typeof window > "u")
|
|
1536
2019
|
return;
|
|
1537
|
-
let
|
|
1538
|
-
const
|
|
1539
|
-
return typeof
|
|
1540
|
-
}),
|
|
2020
|
+
let o;
|
|
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 = () => {
|
|
2023
|
+
}), o;
|
|
1541
2024
|
},
|
|
1542
2025
|
async isAuthorized() {
|
|
1543
|
-
var
|
|
2026
|
+
var o, l;
|
|
1544
2027
|
try {
|
|
1545
|
-
if (
|
|
1546
|
-
await ((
|
|
2028
|
+
if (r && // If shim exists in storage, connector is disconnected
|
|
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")))
|
|
1547
2030
|
return !1;
|
|
1548
2031
|
if (!await this.getProvider()) {
|
|
1549
|
-
if (
|
|
1550
|
-
const
|
|
2032
|
+
if (a !== void 0 && a !== !1) {
|
|
2033
|
+
const _ = async () => (typeof window < "u" && window.removeEventListener("ethereum#initialized", _), !!await this.getProvider()), E = typeof a == "number" ? a : 1e3;
|
|
1551
2034
|
if (await Promise.race([
|
|
1552
2035
|
...typeof window < "u" ? [
|
|
1553
|
-
new Promise((
|
|
2036
|
+
new Promise((S) => window.addEventListener("ethereum#initialized", () => S(_()), { once: !0 }))
|
|
1554
2037
|
] : [],
|
|
1555
|
-
new Promise((
|
|
2038
|
+
new Promise((S) => setTimeout(() => S(_()), E))
|
|
1556
2039
|
]))
|
|
1557
2040
|
return !0;
|
|
1558
2041
|
}
|
|
1559
|
-
throw new
|
|
2042
|
+
throw new X();
|
|
1560
2043
|
}
|
|
1561
|
-
return !!(await
|
|
2044
|
+
return !!(await ln(() => this.getAccounts())).length;
|
|
1562
2045
|
} catch {
|
|
1563
2046
|
return !1;
|
|
1564
2047
|
}
|
|
1565
2048
|
},
|
|
1566
|
-
async switchChain({ addEthereumChainParameter:
|
|
1567
|
-
var
|
|
2049
|
+
async switchChain({ addEthereumChainParameter: o, chainId: l }) {
|
|
2050
|
+
var _, E, O, S;
|
|
1568
2051
|
const v = await this.getProvider();
|
|
1569
2052
|
if (!v)
|
|
1570
|
-
throw new
|
|
1571
|
-
const
|
|
1572
|
-
if (!
|
|
1573
|
-
throw new
|
|
1574
|
-
const
|
|
1575
|
-
const
|
|
1576
|
-
"chainId" in
|
|
2053
|
+
throw new X();
|
|
2054
|
+
const g = u.chains.find((w) => w.id === l);
|
|
2055
|
+
if (!g)
|
|
2056
|
+
throw new it(new Nn());
|
|
2057
|
+
const b = new Promise((w) => {
|
|
2058
|
+
const I = (R) => {
|
|
2059
|
+
"chainId" in R && R.chainId === l && (u.emitter.off("change", I), w());
|
|
1577
2060
|
};
|
|
1578
|
-
|
|
2061
|
+
u.emitter.on("change", I);
|
|
1579
2062
|
});
|
|
1580
2063
|
try {
|
|
1581
2064
|
return await Promise.all([
|
|
1582
2065
|
v.request({
|
|
1583
2066
|
method: "wallet_switchEthereumChain",
|
|
1584
|
-
params: [{ chainId:
|
|
2067
|
+
params: [{ chainId: st(l) }]
|
|
1585
2068
|
}).then(async () => {
|
|
1586
|
-
await this.getChainId() ===
|
|
2069
|
+
await this.getChainId() === l && u.emitter.emit("change", { chainId: l });
|
|
1587
2070
|
}),
|
|
1588
|
-
|
|
1589
|
-
]),
|
|
1590
|
-
} catch (
|
|
1591
|
-
const
|
|
1592
|
-
if (
|
|
2071
|
+
b
|
|
2072
|
+
]), g;
|
|
2073
|
+
} catch (w) {
|
|
2074
|
+
const I = w;
|
|
2075
|
+
if (I.code === 4902 || // Unwrapping for MetaMask Mobile
|
|
1593
2076
|
// https://github.com/MetaMask/metamask-mobile/issues/2944#issuecomment-976988719
|
|
1594
|
-
((
|
|
2077
|
+
((E = (_ = I == null ? void 0 : I.data) == null ? void 0 : _.originalError) == null ? void 0 : E.code) === 4902)
|
|
1595
2078
|
try {
|
|
1596
|
-
const { default:
|
|
1597
|
-
let
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
...Object.values(
|
|
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)
|
|
1601
2084
|
]);
|
|
1602
|
-
let
|
|
1603
|
-
(
|
|
1604
|
-
const
|
|
1605
|
-
blockExplorerUrls:
|
|
1606
|
-
chainId:
|
|
1607
|
-
chainName: (
|
|
1608
|
-
iconUrls:
|
|
1609
|
-
nativeCurrency: (
|
|
1610
|
-
rpcUrls:
|
|
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),
|
|
2090
|
+
chainName: (o == null ? void 0 : o.chainName) ?? g.name,
|
|
2091
|
+
iconUrls: o == null ? void 0 : o.iconUrls,
|
|
2092
|
+
nativeCurrency: (o == null ? void 0 : o.nativeCurrency) ?? g.nativeCurrency,
|
|
2093
|
+
rpcUrls: Y
|
|
1611
2094
|
};
|
|
1612
2095
|
return await Promise.all([
|
|
1613
2096
|
v.request({
|
|
1614
2097
|
method: "wallet_addEthereumChain",
|
|
1615
|
-
params: [
|
|
2098
|
+
params: [Z]
|
|
1616
2099
|
}).then(async () => {
|
|
1617
|
-
if (await this.getChainId() ===
|
|
1618
|
-
|
|
2100
|
+
if (await this.getChainId() === l)
|
|
2101
|
+
u.emitter.emit("change", { chainId: l });
|
|
1619
2102
|
else
|
|
1620
|
-
throw new
|
|
2103
|
+
throw new U(new Error("User rejected switch after adding network."));
|
|
1621
2104
|
}),
|
|
1622
|
-
|
|
1623
|
-
]),
|
|
1624
|
-
} catch (
|
|
1625
|
-
throw new
|
|
2105
|
+
b
|
|
2106
|
+
]), g;
|
|
2107
|
+
} catch (R) {
|
|
2108
|
+
throw new U(R);
|
|
1626
2109
|
}
|
|
1627
|
-
throw
|
|
2110
|
+
throw I.code === U.code ? new U(I) : new it(I);
|
|
1628
2111
|
}
|
|
1629
2112
|
},
|
|
1630
|
-
async onAccountsChanged(
|
|
1631
|
-
var
|
|
1632
|
-
if (
|
|
2113
|
+
async onAccountsChanged(o) {
|
|
2114
|
+
var l;
|
|
2115
|
+
if (o.length === 0)
|
|
1633
2116
|
this.onDisconnect();
|
|
1634
|
-
else if (
|
|
2117
|
+
else if (u.emitter.listenerCount("connect")) {
|
|
1635
2118
|
const v = (await this.getChainId()).toString();
|
|
1636
|
-
this.onConnect({ chainId: v }),
|
|
2119
|
+
this.onConnect({ chainId: v }), r && await ((l = u.storage) == null ? void 0 : l.removeItem(`${this.id}.disconnected`));
|
|
1637
2120
|
} else
|
|
1638
|
-
|
|
1639
|
-
accounts:
|
|
2121
|
+
u.emitter.emit("change", {
|
|
2122
|
+
accounts: o.map((v) => me(v))
|
|
1640
2123
|
});
|
|
1641
2124
|
},
|
|
1642
|
-
onChainChanged(
|
|
1643
|
-
const
|
|
1644
|
-
|
|
2125
|
+
onChainChanged(o) {
|
|
2126
|
+
const l = Number(o);
|
|
2127
|
+
u.emitter.emit("change", { chainId: l });
|
|
1645
2128
|
},
|
|
1646
|
-
async onConnect(
|
|
1647
|
-
const
|
|
1648
|
-
if (
|
|
2129
|
+
async onConnect(o) {
|
|
2130
|
+
const l = await this.getAccounts();
|
|
2131
|
+
if (l.length === 0)
|
|
1649
2132
|
return;
|
|
1650
|
-
const v = Number(
|
|
1651
|
-
|
|
1652
|
-
const
|
|
1653
|
-
|
|
2133
|
+
const v = Number(o.chainId);
|
|
2134
|
+
u.emitter.emit("connect", { accounts: l, chainId: v });
|
|
2135
|
+
const g = await this.getProvider();
|
|
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)));
|
|
1654
2137
|
},
|
|
1655
|
-
async onDisconnect(
|
|
1656
|
-
const
|
|
1657
|
-
|
|
2138
|
+
async onDisconnect(o) {
|
|
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))));
|
|
1658
2141
|
}
|
|
1659
2142
|
});
|
|
1660
2143
|
}
|
|
1661
|
-
const
|
|
2144
|
+
const Un = {
|
|
1662
2145
|
coinbaseWallet: {
|
|
1663
2146
|
id: "coinbaseWallet",
|
|
1664
2147
|
name: "Coinbase Wallet",
|
|
1665
|
-
provider(
|
|
1666
|
-
return
|
|
2148
|
+
provider(n) {
|
|
2149
|
+
return n != null && n.coinbaseWalletExtension ? n.coinbaseWalletExtension : xe(n, "isCoinbaseWallet");
|
|
1667
2150
|
}
|
|
1668
2151
|
},
|
|
1669
2152
|
metaMask: {
|
|
1670
2153
|
id: "metaMask",
|
|
1671
2154
|
name: "MetaMask",
|
|
1672
|
-
provider(
|
|
1673
|
-
return
|
|
1674
|
-
if (!
|
|
2155
|
+
provider(n) {
|
|
2156
|
+
return xe(n, (r) => {
|
|
2157
|
+
if (!r.isMetaMask || r.isBraveWallet && !r._events && !r._state)
|
|
1675
2158
|
return !1;
|
|
1676
|
-
const
|
|
2159
|
+
const a = [
|
|
1677
2160
|
"isApexWallet",
|
|
1678
2161
|
"isAvalanche",
|
|
1679
2162
|
"isBitKeep",
|
|
@@ -1693,8 +2176,8 @@ const yt = {
|
|
|
1693
2176
|
"isUniswapWallet",
|
|
1694
2177
|
"isZerion"
|
|
1695
2178
|
];
|
|
1696
|
-
for (const
|
|
1697
|
-
if (
|
|
2179
|
+
for (const i of a)
|
|
2180
|
+
if (r[i])
|
|
1698
2181
|
return !1;
|
|
1699
2182
|
return !0;
|
|
1700
2183
|
});
|
|
@@ -1703,37 +2186,38 @@ const yt = {
|
|
|
1703
2186
|
phantom: {
|
|
1704
2187
|
id: "phantom",
|
|
1705
2188
|
name: "Phantom",
|
|
1706
|
-
provider(
|
|
1707
|
-
var
|
|
1708
|
-
return (
|
|
2189
|
+
provider(n) {
|
|
2190
|
+
var r, a;
|
|
2191
|
+
return (r = n == null ? void 0 : n.phantom) != null && r.ethereum ? (a = n.phantom) == null ? void 0 : a.ethereum : xe(n, "isPhantom");
|
|
1709
2192
|
}
|
|
1710
2193
|
}
|
|
1711
2194
|
};
|
|
1712
|
-
function
|
|
1713
|
-
function
|
|
1714
|
-
return typeof
|
|
2195
|
+
function xe(n, r) {
|
|
2196
|
+
function a(s) {
|
|
2197
|
+
return typeof r == "function" ? r(s) : typeof r == "string" ? s[r] : !0;
|
|
1715
2198
|
}
|
|
1716
|
-
const
|
|
1717
|
-
if (
|
|
1718
|
-
return
|
|
1719
|
-
if (
|
|
1720
|
-
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;
|
|
1721
2204
|
}
|
|
1722
|
-
const
|
|
1723
|
-
chains: [
|
|
1724
|
-
connectors: [
|
|
2205
|
+
const qn = new un(), Yn = rn({
|
|
2206
|
+
chains: [Oe],
|
|
2207
|
+
connectors: [$e()],
|
|
1725
2208
|
transports: {
|
|
1726
|
-
[
|
|
2209
|
+
[Oe.id]: an()
|
|
1727
2210
|
}
|
|
1728
2211
|
});
|
|
1729
|
-
function
|
|
1730
|
-
return /* @__PURE__ */
|
|
2212
|
+
function Jn({ children: n }) {
|
|
2213
|
+
return /* @__PURE__ */ t.jsx(on, { config: Yn, children: /* @__PURE__ */ t.jsx(fn, { client: qn, children: n }) });
|
|
1731
2214
|
}
|
|
1732
2215
|
export {
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
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
|
|
1739
2223
|
};
|