@cookill/wallet-adapter 2.5.1 → 2.5.3
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 +110 -176
- package/dist/ErrorBoundary.cjs +20 -40
- package/dist/ErrorBoundary.cjs.map +1 -1
- package/dist/ErrorBoundary.js +6 -6
- package/dist/ErrorBoundary.js.map +1 -1
- package/dist/LoadingStates.cjs +32 -54
- package/dist/LoadingStates.cjs.map +1 -1
- package/dist/LoadingStates.js +5 -7
- package/dist/LoadingStates.js.map +1 -1
- package/dist/index.cjs +17 -48
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -14
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +225 -244
- package/dist/react.cjs.map +1 -1
- package/dist/react.js +136 -133
- package/dist/react.js.map +1 -1
- package/dist/standard.cjs +14 -42
- package/dist/standard.cjs.map +1 -1
- package/dist/standard.d.cts +1 -1
- package/dist/standard.d.ts +1 -1
- package/dist/standard.js +3 -11
- package/dist/standard.js.map +1 -1
- package/package.json +3 -4
package/dist/react.cjs
CHANGED
|
@@ -1,66 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React2 = require('react');
|
|
4
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
+
|
|
6
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
7
|
+
|
|
8
|
+
var React2__default = /*#__PURE__*/_interopDefault(React2);
|
|
29
9
|
|
|
30
10
|
// src/react.tsx
|
|
31
|
-
var react_exports = {};
|
|
32
|
-
__export(react_exports, {
|
|
33
|
-
ApprovalPending: () => ApprovalPending,
|
|
34
|
-
ConnectButton: () => ConnectButton,
|
|
35
|
-
ConnectionStatus: () => ConnectionStatus,
|
|
36
|
-
LoadingSpinner: () => LoadingSpinner,
|
|
37
|
-
NETWORKS: () => NETWORKS,
|
|
38
|
-
SafeWalletProvider: () => SafeWalletProvider,
|
|
39
|
-
WalletErrorBoundary: () => WalletErrorBoundary,
|
|
40
|
-
WalletModal: () => WalletModal,
|
|
41
|
-
WalletProvider: () => WalletProvider,
|
|
42
|
-
formatAddress: () => formatAddress,
|
|
43
|
-
formatBalance: () => formatBalance,
|
|
44
|
-
getRialoProvider: () => getRialoProvider,
|
|
45
|
-
isRialoInstalled: () => isRialoInstalled,
|
|
46
|
-
isValidAddress: () => isValidAddress,
|
|
47
|
-
useAccounts: () => useAccounts,
|
|
48
|
-
useActiveAccount: () => useActiveAccount,
|
|
49
|
-
useBalance: () => useBalance,
|
|
50
|
-
useChainId: () => useChainId,
|
|
51
|
-
useConnectWallet: () => useConnectWallet,
|
|
52
|
-
useDisconnectWallet: () => useDisconnectWallet,
|
|
53
|
-
useIsConnected: () => useIsConnected,
|
|
54
|
-
useNetwork: () => useNetwork,
|
|
55
|
-
useSendTransaction: () => useSendTransaction,
|
|
56
|
-
useSignMessage: () => useSignMessage,
|
|
57
|
-
useSignTransaction: () => useSignTransaction,
|
|
58
|
-
useSwitchNetwork: () => useSwitchNetwork,
|
|
59
|
-
useWallet: () => useWallet,
|
|
60
|
-
withWalletErrorBoundary: () => withWalletErrorBoundary
|
|
61
|
-
});
|
|
62
|
-
module.exports = __toCommonJS(react_exports);
|
|
63
|
-
var import_react2 = __toESM(require("react"), 1);
|
|
64
11
|
|
|
65
12
|
// src/index.ts
|
|
66
13
|
var NETWORKS = {
|
|
@@ -156,11 +103,7 @@ function isValidAddress(address) {
|
|
|
156
103
|
if (address.length < 32 || address.length > 50) return false;
|
|
157
104
|
return /^[1-9A-HJ-NP-Za-km-z]+$/.test(address);
|
|
158
105
|
}
|
|
159
|
-
|
|
160
|
-
// src/ErrorBoundary.tsx
|
|
161
|
-
var import_react = require("react");
|
|
162
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
163
|
-
var WalletErrorBoundary = class extends import_react.Component {
|
|
106
|
+
var WalletErrorBoundary = class extends React2.Component {
|
|
164
107
|
constructor() {
|
|
165
108
|
super(...arguments);
|
|
166
109
|
this.state = {
|
|
@@ -183,7 +126,7 @@ var WalletErrorBoundary = class extends import_react.Component {
|
|
|
183
126
|
if (this.props.fallback) {
|
|
184
127
|
return this.props.fallback;
|
|
185
128
|
}
|
|
186
|
-
return /* @__PURE__ */
|
|
129
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
187
130
|
"div",
|
|
188
131
|
{
|
|
189
132
|
style: {
|
|
@@ -194,7 +137,7 @@ var WalletErrorBoundary = class extends import_react.Component {
|
|
|
194
137
|
textAlign: "center"
|
|
195
138
|
},
|
|
196
139
|
children: [
|
|
197
|
-
/* @__PURE__ */
|
|
140
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
198
141
|
"div",
|
|
199
142
|
{
|
|
200
143
|
style: {
|
|
@@ -207,7 +150,7 @@ var WalletErrorBoundary = class extends import_react.Component {
|
|
|
207
150
|
alignItems: "center",
|
|
208
151
|
justifyContent: "center"
|
|
209
152
|
},
|
|
210
|
-
children: /* @__PURE__ */
|
|
153
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
211
154
|
"svg",
|
|
212
155
|
{
|
|
213
156
|
width: "24",
|
|
@@ -219,17 +162,17 @@ var WalletErrorBoundary = class extends import_react.Component {
|
|
|
219
162
|
strokeLinecap: "round",
|
|
220
163
|
strokeLinejoin: "round",
|
|
221
164
|
children: [
|
|
222
|
-
/* @__PURE__ */
|
|
223
|
-
/* @__PURE__ */
|
|
224
|
-
/* @__PURE__ */
|
|
165
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "12", r: "10" }),
|
|
166
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "12", y1: "8", x2: "12", y2: "12" }),
|
|
167
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "12", y1: "16", x2: "12.01", y2: "16" })
|
|
225
168
|
]
|
|
226
169
|
}
|
|
227
170
|
)
|
|
228
171
|
}
|
|
229
172
|
),
|
|
230
|
-
/* @__PURE__ */
|
|
231
|
-
/* @__PURE__ */
|
|
232
|
-
/* @__PURE__ */
|
|
173
|
+
/* @__PURE__ */ jsxRuntime.jsx("h3", { style: { margin: "0 0 8px", fontSize: "16px", fontWeight: 600, color: "#991b1b" }, children: "Wallet Connection Error" }),
|
|
174
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { style: { margin: "0 0 16px", fontSize: "14px", color: "#b91c1c" }, children: this.state.error?.message || "Something went wrong" }),
|
|
175
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
233
176
|
"button",
|
|
234
177
|
{
|
|
235
178
|
onClick: this.handleRetry,
|
|
@@ -253,9 +196,6 @@ var WalletErrorBoundary = class extends import_react.Component {
|
|
|
253
196
|
return this.props.children;
|
|
254
197
|
}
|
|
255
198
|
};
|
|
256
|
-
|
|
257
|
-
// src/LoadingStates.tsx
|
|
258
|
-
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
259
199
|
function LoadingSpinner({ size = "md", color = "#6EB9A8", className = "" }) {
|
|
260
200
|
const sizes = {
|
|
261
201
|
sm: { container: 20, stroke: 2 },
|
|
@@ -265,7 +205,7 @@ function LoadingSpinner({ size = "md", color = "#6EB9A8", className = "" }) {
|
|
|
265
205
|
const { container, stroke } = sizes[size];
|
|
266
206
|
const radius = (container - stroke) / 2;
|
|
267
207
|
const circumference = radius * 2 * Math.PI;
|
|
268
|
-
return /* @__PURE__ */
|
|
208
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
269
209
|
"svg",
|
|
270
210
|
{
|
|
271
211
|
width: container,
|
|
@@ -274,13 +214,13 @@ function LoadingSpinner({ size = "md", color = "#6EB9A8", className = "" }) {
|
|
|
274
214
|
className,
|
|
275
215
|
style: { animation: "wallet-spin 1s linear infinite" },
|
|
276
216
|
children: [
|
|
277
|
-
/* @__PURE__ */
|
|
217
|
+
/* @__PURE__ */ jsxRuntime.jsx("style", { children: `
|
|
278
218
|
@keyframes wallet-spin {
|
|
279
219
|
from { transform: rotate(0deg); }
|
|
280
220
|
to { transform: rotate(360deg); }
|
|
281
221
|
}
|
|
282
222
|
` }),
|
|
283
|
-
/* @__PURE__ */
|
|
223
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
284
224
|
"circle",
|
|
285
225
|
{
|
|
286
226
|
cx: container / 2,
|
|
@@ -292,7 +232,7 @@ function LoadingSpinner({ size = "md", color = "#6EB9A8", className = "" }) {
|
|
|
292
232
|
strokeOpacity: 0.2
|
|
293
233
|
}
|
|
294
234
|
),
|
|
295
|
-
/* @__PURE__ */
|
|
235
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
296
236
|
"circle",
|
|
297
237
|
{
|
|
298
238
|
cx: container / 2,
|
|
@@ -316,7 +256,7 @@ function ApprovalPending({
|
|
|
316
256
|
walletName = "Sheep Wallet",
|
|
317
257
|
onCancel
|
|
318
258
|
}) {
|
|
319
|
-
return /* @__PURE__ */
|
|
259
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
320
260
|
"div",
|
|
321
261
|
{
|
|
322
262
|
style: {
|
|
@@ -327,7 +267,7 @@ function ApprovalPending({
|
|
|
327
267
|
border: "1px solid #e2e8f0"
|
|
328
268
|
},
|
|
329
269
|
children: [
|
|
330
|
-
/* @__PURE__ */
|
|
270
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
331
271
|
"div",
|
|
332
272
|
{
|
|
333
273
|
style: {
|
|
@@ -342,8 +282,8 @@ function ApprovalPending({
|
|
|
342
282
|
position: "relative"
|
|
343
283
|
},
|
|
344
284
|
children: [
|
|
345
|
-
/* @__PURE__ */
|
|
346
|
-
/* @__PURE__ */
|
|
285
|
+
/* @__PURE__ */ jsxRuntime.jsx(LoadingSpinner, { size: "lg" }),
|
|
286
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
347
287
|
"div",
|
|
348
288
|
{
|
|
349
289
|
style: {
|
|
@@ -359,7 +299,7 @@ function ApprovalPending({
|
|
|
359
299
|
]
|
|
360
300
|
}
|
|
361
301
|
),
|
|
362
|
-
/* @__PURE__ */
|
|
302
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
363
303
|
"h3",
|
|
364
304
|
{
|
|
365
305
|
style: {
|
|
@@ -371,7 +311,7 @@ function ApprovalPending({
|
|
|
371
311
|
children: title
|
|
372
312
|
}
|
|
373
313
|
),
|
|
374
|
-
/* @__PURE__ */
|
|
314
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
375
315
|
"p",
|
|
376
316
|
{
|
|
377
317
|
style: {
|
|
@@ -382,7 +322,7 @@ function ApprovalPending({
|
|
|
382
322
|
children: message
|
|
383
323
|
}
|
|
384
324
|
),
|
|
385
|
-
/* @__PURE__ */
|
|
325
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
386
326
|
"p",
|
|
387
327
|
{
|
|
388
328
|
style: {
|
|
@@ -397,7 +337,7 @@ function ApprovalPending({
|
|
|
397
337
|
]
|
|
398
338
|
}
|
|
399
339
|
),
|
|
400
|
-
onCancel && /* @__PURE__ */
|
|
340
|
+
onCancel && /* @__PURE__ */ jsxRuntime.jsx(
|
|
401
341
|
"button",
|
|
402
342
|
{
|
|
403
343
|
onClick: onCancel,
|
|
@@ -456,7 +396,7 @@ function ConnectionStatus({ status, message, onRetry }) {
|
|
|
456
396
|
}
|
|
457
397
|
};
|
|
458
398
|
const config = statusConfig[status];
|
|
459
|
-
return /* @__PURE__ */
|
|
399
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
460
400
|
"div",
|
|
461
401
|
{
|
|
462
402
|
style: {
|
|
@@ -467,7 +407,7 @@ function ConnectionStatus({ status, message, onRetry }) {
|
|
|
467
407
|
textAlign: "center"
|
|
468
408
|
},
|
|
469
409
|
children: [
|
|
470
|
-
/* @__PURE__ */
|
|
410
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
471
411
|
"div",
|
|
472
412
|
{
|
|
473
413
|
style: {
|
|
@@ -480,15 +420,15 @@ function ConnectionStatus({ status, message, onRetry }) {
|
|
|
480
420
|
alignItems: "center",
|
|
481
421
|
justifyContent: "center"
|
|
482
422
|
},
|
|
483
|
-
children: status === "success" ? /* @__PURE__ */
|
|
484
|
-
/* @__PURE__ */
|
|
485
|
-
/* @__PURE__ */
|
|
486
|
-
] }) : /* @__PURE__ */
|
|
423
|
+
children: status === "success" ? /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: config.color, strokeWidth: "2", children: /* @__PURE__ */ jsxRuntime.jsx("polyline", { points: "20,6 9,17 4,12" }) }) : status === "error" ? /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: config.color, strokeWidth: "2", children: [
|
|
424
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
425
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
426
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsx(LoadingSpinner, { size: "sm", color: config.color })
|
|
487
427
|
}
|
|
488
428
|
),
|
|
489
|
-
/* @__PURE__ */
|
|
490
|
-
/* @__PURE__ */
|
|
491
|
-
status === "error" && onRetry && /* @__PURE__ */
|
|
429
|
+
/* @__PURE__ */ jsxRuntime.jsx("h4", { style: { margin: "0 0 4px", fontSize: "14px", fontWeight: 600, color: config.color }, children: config.title }),
|
|
430
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { style: { margin: 0, fontSize: "12px", color: "#64748b" }, children: message || config.defaultMessage }),
|
|
431
|
+
status === "error" && onRetry && /* @__PURE__ */ jsxRuntime.jsx(
|
|
492
432
|
"button",
|
|
493
433
|
{
|
|
494
434
|
onClick: onRetry,
|
|
@@ -510,19 +450,25 @@ function ConnectionStatus({ status, message, onRetry }) {
|
|
|
510
450
|
}
|
|
511
451
|
);
|
|
512
452
|
}
|
|
513
|
-
|
|
514
|
-
// src/react.tsx
|
|
515
|
-
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
516
|
-
var SHEEP_WALLET_ICON = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHZpZXdCb3g9IjAgMCAzMiAzMiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cmVjdCB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHJ4PSI4IiBmaWxsPSIjMUExQTFBIi8+PGNpcmNsZSBjeD0iMTYiIGN5PSIxNCIgcj0iOCIgZmlsbD0iI0ZGRjhGMCIvPjxjaXJjbGUgY3g9IjEyIiBjeT0iMTAiIHI9IjQiIGZpbGw9IiNGRkY4RjAiLz48Y2lyY2xlIGN4PSIyMCIgY3k9IjEwIiByPSI0IiBmaWxsPSIjRkZGOEYwIi8+PGNpcmNsZSBjeD0iMTMiIGN5PSIxMyIgcj0iMS41IiBmaWxsPSIjMzMzIi8+PGNpcmNsZSBjeD0iMTkiIGN5PSIxMyIgcj0iMS41IiBmaWxsPSIjMzMzIi8+PGVsbGlwc2UgY3g9IjE2IiBjeT0iMTciIHJ4PSIyIiByeT0iMS41IiBmaWxsPSIjRkZDMENCIi8+PHBhdGggZD0iTTE0IDI0QzE0IDIyLjkgMTQuOSAyMiAxNiAyMkMxNy4xIDIyIDE4IDIyLjkgMTggMjRWMjZIMTRWMjRaIiBmaWxsPSIjNkVCOUE4Ii8+PC9zdmc+";
|
|
517
453
|
var DEFAULT_WALLETS = [
|
|
518
454
|
{
|
|
519
455
|
id: "sheep-wallet",
|
|
520
456
|
name: "Sheep Wallet",
|
|
521
|
-
icon:
|
|
457
|
+
icon: "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHZpZXdCb3g9IjAgMCAzMiAzMiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cmVjdCB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHJ4PSI4IiBmaWxsPSIjMDExQjI5Ii8+PHRleHQgeD0iNTAlIiB5PSI1NSUiIGRvbWluYW50LWJhc2VsaW5lPSJtaWRkbGUiIHRleHQtYW5jaG9yPSJtaWRkbGUiIGZvbnQtZmFtaWx5PSJzYW5zLXNlcmlmIiBmb250LXdlaWdodD0iYm9sZCIgZm9udC1zaXplPSIxNiIgZmlsbD0iIzZFQjlBOCI+Uzwvc2VsZj48L3N2Zz4=",
|
|
522
458
|
downloadUrl: "https://rialo.io/wallet"
|
|
523
459
|
}
|
|
524
460
|
];
|
|
525
|
-
var
|
|
461
|
+
var CONNECT_TIMEOUT_MS = 2e4;
|
|
462
|
+
function withTimeout(promise, ms, message) {
|
|
463
|
+
let timeoutId;
|
|
464
|
+
const timeout = new Promise((_, reject) => {
|
|
465
|
+
timeoutId = setTimeout(() => reject(new Error(message)), ms);
|
|
466
|
+
});
|
|
467
|
+
return Promise.race([promise, timeout]).finally(() => {
|
|
468
|
+
if (timeoutId) clearTimeout(timeoutId);
|
|
469
|
+
});
|
|
470
|
+
}
|
|
471
|
+
var WalletContext = React2.createContext(null);
|
|
526
472
|
function WalletProvider({
|
|
527
473
|
children,
|
|
528
474
|
network: initialNetwork = "devnet",
|
|
@@ -533,26 +479,27 @@ function WalletProvider({
|
|
|
533
479
|
onError,
|
|
534
480
|
onNetworkChange
|
|
535
481
|
}) {
|
|
536
|
-
const [connected, setConnected] =
|
|
537
|
-
const [connecting, setConnecting] =
|
|
538
|
-
const [accounts, setAccounts] =
|
|
539
|
-
const [network, setNetwork] =
|
|
540
|
-
const [balance, setBalance] =
|
|
541
|
-
const [selectedWallet, setSelectedWallet] =
|
|
542
|
-
const [isModalOpen, setIsModalOpen] =
|
|
543
|
-
const [provider, setProvider] =
|
|
544
|
-
const [error, setError] =
|
|
545
|
-
const
|
|
482
|
+
const [connected, setConnected] = React2.useState(false);
|
|
483
|
+
const [connecting, setConnecting] = React2.useState(false);
|
|
484
|
+
const [accounts, setAccounts] = React2.useState([]);
|
|
485
|
+
const [network, setNetwork] = React2.useState(initialNetwork);
|
|
486
|
+
const [balance, setBalance] = React2.useState(null);
|
|
487
|
+
const [selectedWallet, setSelectedWallet] = React2.useState(null);
|
|
488
|
+
const [isModalOpen, setIsModalOpen] = React2.useState(false);
|
|
489
|
+
const [provider, setProvider] = React2.useState();
|
|
490
|
+
const [error, setError] = React2.useState(null);
|
|
491
|
+
const connectPromiseRef = React2.useRef(null);
|
|
492
|
+
const chainId = React2.useMemo(() => `rialo:${network}`, [network]);
|
|
546
493
|
const activeAccount = accounts[0] || null;
|
|
547
494
|
const isInstalled = isRialoInstalled();
|
|
548
|
-
const wallets =
|
|
495
|
+
const wallets = React2.useMemo(() => {
|
|
549
496
|
const installed = isRialoInstalled();
|
|
550
497
|
return [...DEFAULT_WALLETS, ...customWallets].map((w) => ({
|
|
551
498
|
...w,
|
|
552
499
|
installed: w.id === "sheep-wallet" ? installed : false
|
|
553
500
|
}));
|
|
554
501
|
}, [customWallets]);
|
|
555
|
-
|
|
502
|
+
React2.useEffect(() => {
|
|
556
503
|
const init = async () => {
|
|
557
504
|
const p = await waitForRialoProvider(3e3);
|
|
558
505
|
setProvider(p);
|
|
@@ -562,7 +509,7 @@ function WalletProvider({
|
|
|
562
509
|
};
|
|
563
510
|
init();
|
|
564
511
|
}, [wallets]);
|
|
565
|
-
const refreshBalance =
|
|
512
|
+
const refreshBalance = React2.useCallback(async () => {
|
|
566
513
|
if (!provider || !activeAccount) return;
|
|
567
514
|
try {
|
|
568
515
|
const result = await provider.getBalance(activeAccount.address);
|
|
@@ -572,24 +519,42 @@ function WalletProvider({
|
|
|
572
519
|
console.error("Balance fetch error:", e);
|
|
573
520
|
}
|
|
574
521
|
}, [provider, activeAccount]);
|
|
575
|
-
|
|
522
|
+
React2.useEffect(() => {
|
|
576
523
|
if (connected && activeAccount && provider) {
|
|
577
524
|
refreshBalance();
|
|
578
525
|
const interval = setInterval(refreshBalance, 3e4);
|
|
579
526
|
return () => clearInterval(interval);
|
|
580
527
|
}
|
|
581
528
|
}, [connected, activeAccount, provider, refreshBalance]);
|
|
582
|
-
|
|
583
|
-
if (autoConnect
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
529
|
+
React2.useEffect(() => {
|
|
530
|
+
if (!autoConnect || !provider || connected || connecting) return;
|
|
531
|
+
let cancelled = false;
|
|
532
|
+
provider.isConnected().then(async (isConn) => {
|
|
533
|
+
if (!isConn || cancelled) return;
|
|
534
|
+
try {
|
|
535
|
+
const rawAccounts = await withTimeout(provider.getAccounts(), 5e3, "Auto-connect timed out");
|
|
536
|
+
const normalized = (rawAccounts || []).map((acc) => {
|
|
537
|
+
if (typeof acc === "string") return { address: acc, publicKey: acc };
|
|
538
|
+
return { address: acc.address, publicKey: acc.publicKey || acc.address };
|
|
539
|
+
});
|
|
540
|
+
if (cancelled) return;
|
|
541
|
+
setAccounts(normalized);
|
|
542
|
+
setConnected(true);
|
|
543
|
+
try {
|
|
544
|
+
const net = await provider.getNetwork();
|
|
545
|
+
if (!cancelled) setNetwork(net);
|
|
546
|
+
} catch {
|
|
587
547
|
}
|
|
588
|
-
|
|
589
|
-
}
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
548
|
+
onConnect?.(normalized);
|
|
549
|
+
} catch {
|
|
550
|
+
}
|
|
551
|
+
}).catch(() => {
|
|
552
|
+
});
|
|
553
|
+
return () => {
|
|
554
|
+
cancelled = true;
|
|
555
|
+
};
|
|
556
|
+
}, [provider, autoConnect, connected, connecting, onConnect]);
|
|
557
|
+
React2.useEffect(() => {
|
|
593
558
|
if (!provider) return;
|
|
594
559
|
const cleanupFns = [];
|
|
595
560
|
cleanupFns.push(
|
|
@@ -638,48 +603,65 @@ function WalletProvider({
|
|
|
638
603
|
cleanupFns.forEach((fn) => fn?.());
|
|
639
604
|
};
|
|
640
605
|
}, [provider, onDisconnect, onNetworkChange]);
|
|
641
|
-
const handleConnect =
|
|
642
|
-
if (
|
|
643
|
-
|
|
644
|
-
setError(err);
|
|
645
|
-
onError?.(err);
|
|
646
|
-
throw err;
|
|
606
|
+
const handleConnect = React2.useCallback(async () => {
|
|
607
|
+
if (connectPromiseRef.current) {
|
|
608
|
+
return connectPromiseRef.current;
|
|
647
609
|
}
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
return {
|
|
659
|
-
address: acc.address,
|
|
660
|
-
publicKey: acc.publicKey || acc.address
|
|
661
|
-
};
|
|
662
|
-
});
|
|
663
|
-
setAccounts(walletAccounts);
|
|
664
|
-
setConnected(true);
|
|
665
|
-
setIsModalOpen(false);
|
|
610
|
+
const run = (async () => {
|
|
611
|
+
if (!provider) {
|
|
612
|
+
const err = new Error("Rialo Wallet not installed");
|
|
613
|
+
setError(err);
|
|
614
|
+
onError?.(err);
|
|
615
|
+
throw err;
|
|
616
|
+
}
|
|
617
|
+
setIsModalOpen(true);
|
|
618
|
+
setConnecting(true);
|
|
619
|
+
setError(null);
|
|
666
620
|
try {
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
621
|
+
console.log("[Adapter] Calling provider.connect()...");
|
|
622
|
+
const result = await withTimeout(
|
|
623
|
+
provider.connect(),
|
|
624
|
+
CONNECT_TIMEOUT_MS,
|
|
625
|
+
"Connect timed out. Please open Sheep Wallet extension and approve the request."
|
|
626
|
+
);
|
|
627
|
+
console.log("[Adapter] Connect result:", result);
|
|
628
|
+
const walletAccounts = result.map((acc) => {
|
|
629
|
+
if (typeof acc === "string") {
|
|
630
|
+
return { address: acc, publicKey: acc };
|
|
631
|
+
}
|
|
632
|
+
return {
|
|
633
|
+
address: acc.address,
|
|
634
|
+
publicKey: acc.publicKey || acc.address
|
|
635
|
+
};
|
|
636
|
+
});
|
|
637
|
+
setAccounts(walletAccounts);
|
|
638
|
+
setConnected(true);
|
|
639
|
+
setIsModalOpen(false);
|
|
640
|
+
try {
|
|
641
|
+
const net = await withTimeout(provider.getNetwork(), 5e3, "Network request timed out");
|
|
642
|
+
setNetwork(net);
|
|
643
|
+
} catch {
|
|
644
|
+
}
|
|
645
|
+
onConnect?.(walletAccounts);
|
|
646
|
+
return walletAccounts;
|
|
647
|
+
} catch (e) {
|
|
648
|
+
const err = e;
|
|
649
|
+
setError(err);
|
|
650
|
+
onError?.(err);
|
|
651
|
+
setIsModalOpen(true);
|
|
652
|
+
throw err;
|
|
653
|
+
} finally {
|
|
654
|
+
setConnecting(false);
|
|
670
655
|
}
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
setError(err);
|
|
676
|
-
onError?.(err);
|
|
677
|
-
throw err;
|
|
656
|
+
})();
|
|
657
|
+
connectPromiseRef.current = run;
|
|
658
|
+
try {
|
|
659
|
+
return await run;
|
|
678
660
|
} finally {
|
|
679
|
-
|
|
661
|
+
connectPromiseRef.current = null;
|
|
680
662
|
}
|
|
681
663
|
}, [provider, onConnect, onError]);
|
|
682
|
-
const handleDisconnect =
|
|
664
|
+
const handleDisconnect = React2.useCallback(async () => {
|
|
683
665
|
try {
|
|
684
666
|
if (provider) {
|
|
685
667
|
await provider.disconnect();
|
|
@@ -691,7 +673,7 @@ function WalletProvider({
|
|
|
691
673
|
setBalance(null);
|
|
692
674
|
onDisconnect?.();
|
|
693
675
|
}, [provider, onDisconnect]);
|
|
694
|
-
const selectWallet =
|
|
676
|
+
const selectWallet = React2.useCallback((walletId) => {
|
|
695
677
|
const wallet = wallets.find((w) => w.id === walletId);
|
|
696
678
|
if (wallet) {
|
|
697
679
|
setSelectedWallet(wallet);
|
|
@@ -702,40 +684,40 @@ function WalletProvider({
|
|
|
702
684
|
}
|
|
703
685
|
}
|
|
704
686
|
}, [wallets, handleConnect]);
|
|
705
|
-
const handleSwitchNetwork =
|
|
687
|
+
const handleSwitchNetwork = React2.useCallback(async (newNetwork) => {
|
|
706
688
|
if (provider) {
|
|
707
689
|
await provider.switchNetwork(newNetwork);
|
|
708
690
|
}
|
|
709
691
|
setNetwork(newNetwork);
|
|
710
692
|
onNetworkChange?.(newNetwork);
|
|
711
693
|
}, [provider, onNetworkChange]);
|
|
712
|
-
const handleSignMessage =
|
|
694
|
+
const handleSignMessage = React2.useCallback(async (message) => {
|
|
713
695
|
if (!provider || !connected) {
|
|
714
696
|
throw new Error("Wallet not connected");
|
|
715
697
|
}
|
|
716
698
|
return provider.signMessage(message);
|
|
717
699
|
}, [provider, connected]);
|
|
718
|
-
const handleSignTransaction =
|
|
700
|
+
const handleSignTransaction = React2.useCallback(async (tx) => {
|
|
719
701
|
if (!provider || !connected) {
|
|
720
702
|
throw new Error("Wallet not connected");
|
|
721
703
|
}
|
|
722
704
|
const result = await provider.signTransaction(tx);
|
|
723
705
|
return result.signature;
|
|
724
706
|
}, [provider, connected]);
|
|
725
|
-
const handleSendTransaction =
|
|
707
|
+
const handleSendTransaction = React2.useCallback(async (tx) => {
|
|
726
708
|
if (!provider || !connected) {
|
|
727
709
|
throw new Error("Wallet not connected");
|
|
728
710
|
}
|
|
729
711
|
return provider.sendTransaction(tx);
|
|
730
712
|
}, [provider, connected]);
|
|
731
|
-
const handleSignAndSendTransaction =
|
|
713
|
+
const handleSignAndSendTransaction = React2.useCallback(async (tx) => {
|
|
732
714
|
if (!provider || !connected) {
|
|
733
715
|
throw new Error("Wallet not connected");
|
|
734
716
|
}
|
|
735
717
|
return provider.signAndSendTransaction(tx);
|
|
736
718
|
}, [provider, connected]);
|
|
737
|
-
const openModal =
|
|
738
|
-
const closeModal =
|
|
719
|
+
const openModal = React2.useCallback(() => setIsModalOpen(true), []);
|
|
720
|
+
const closeModal = React2.useCallback(() => setIsModalOpen(false), []);
|
|
739
721
|
const value = {
|
|
740
722
|
connected,
|
|
741
723
|
connecting,
|
|
@@ -761,13 +743,13 @@ function WalletProvider({
|
|
|
761
743
|
openModal,
|
|
762
744
|
closeModal
|
|
763
745
|
};
|
|
764
|
-
return /* @__PURE__ */
|
|
746
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(WalletContext.Provider, { value, children: [
|
|
765
747
|
children,
|
|
766
|
-
/* @__PURE__ */
|
|
748
|
+
/* @__PURE__ */ jsxRuntime.jsx(WalletModal, {})
|
|
767
749
|
] });
|
|
768
750
|
}
|
|
769
751
|
function useWallet() {
|
|
770
|
-
const context =
|
|
752
|
+
const context = React2.useContext(WalletContext);
|
|
771
753
|
if (!context) {
|
|
772
754
|
throw new Error("useWallet must be used within WalletProvider");
|
|
773
755
|
}
|
|
@@ -807,9 +789,9 @@ function useChainId() {
|
|
|
807
789
|
}
|
|
808
790
|
function useSwitchNetwork() {
|
|
809
791
|
const { switchNetwork, network } = useWallet();
|
|
810
|
-
const [switching, setSwitching] =
|
|
811
|
-
const [error, setError] =
|
|
812
|
-
const doSwitch =
|
|
792
|
+
const [switching, setSwitching] = React2.useState(false);
|
|
793
|
+
const [error, setError] = React2.useState(null);
|
|
794
|
+
const doSwitch = React2.useCallback(async (newNetwork) => {
|
|
813
795
|
setSwitching(true);
|
|
814
796
|
setError(null);
|
|
815
797
|
try {
|
|
@@ -825,7 +807,7 @@ function useSwitchNetwork() {
|
|
|
825
807
|
}
|
|
826
808
|
function useConnectWallet() {
|
|
827
809
|
const { connect, connecting, openModal, isInstalled, error } = useWallet();
|
|
828
|
-
const handleConnect =
|
|
810
|
+
const handleConnect = React2.useCallback(() => {
|
|
829
811
|
openModal();
|
|
830
812
|
}, [openModal]);
|
|
831
813
|
return {
|
|
@@ -843,10 +825,10 @@ function useDisconnectWallet() {
|
|
|
843
825
|
}
|
|
844
826
|
function useSignMessage() {
|
|
845
827
|
const { signMessage, connected, activeAccount } = useWallet();
|
|
846
|
-
const [signing, setSigning] =
|
|
847
|
-
const [signature, setSignature] =
|
|
848
|
-
const [error, setError] =
|
|
849
|
-
const sign =
|
|
828
|
+
const [signing, setSigning] = React2.useState(false);
|
|
829
|
+
const [signature, setSignature] = React2.useState(null);
|
|
830
|
+
const [error, setError] = React2.useState(null);
|
|
831
|
+
const sign = React2.useCallback(async (message) => {
|
|
850
832
|
if (!connected) {
|
|
851
833
|
setError(new Error("Wallet not connected"));
|
|
852
834
|
return null;
|
|
@@ -868,10 +850,10 @@ function useSignMessage() {
|
|
|
868
850
|
}
|
|
869
851
|
function useSendTransaction() {
|
|
870
852
|
const { signAndSendTransaction, connected } = useWallet();
|
|
871
|
-
const [sending, setSending] =
|
|
872
|
-
const [txHash, setTxHash] =
|
|
873
|
-
const [error, setError] =
|
|
874
|
-
const send =
|
|
853
|
+
const [sending, setSending] = React2.useState(false);
|
|
854
|
+
const [txHash, setTxHash] = React2.useState(null);
|
|
855
|
+
const [error, setError] = React2.useState(null);
|
|
856
|
+
const send = React2.useCallback(async (tx) => {
|
|
875
857
|
if (!connected) {
|
|
876
858
|
setError(new Error("Wallet not connected"));
|
|
877
859
|
return null;
|
|
@@ -896,10 +878,10 @@ function useSendTransaction() {
|
|
|
896
878
|
}
|
|
897
879
|
function useSignTransaction() {
|
|
898
880
|
const { signTransaction, connected } = useWallet();
|
|
899
|
-
const [signing, setSigning] =
|
|
900
|
-
const [signature, setSignature] =
|
|
901
|
-
const [error, setError] =
|
|
902
|
-
const sign =
|
|
881
|
+
const [signing, setSigning] = React2.useState(false);
|
|
882
|
+
const [signature, setSignature] = React2.useState(null);
|
|
883
|
+
const [error, setError] = React2.useState(null);
|
|
884
|
+
const sign = React2.useCallback(async (tx) => {
|
|
903
885
|
if (!connected) {
|
|
904
886
|
setError(new Error("Wallet not connected"));
|
|
905
887
|
return null;
|
|
@@ -939,7 +921,7 @@ function ConnectButton({
|
|
|
939
921
|
...style
|
|
940
922
|
};
|
|
941
923
|
if (connecting) {
|
|
942
|
-
return /* @__PURE__ */
|
|
924
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
943
925
|
"button",
|
|
944
926
|
{
|
|
945
927
|
disabled: true,
|
|
@@ -950,7 +932,7 @@ function ConnectButton({
|
|
|
950
932
|
);
|
|
951
933
|
}
|
|
952
934
|
if (connected && activeAccount) {
|
|
953
|
-
return /* @__PURE__ */
|
|
935
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
954
936
|
"button",
|
|
955
937
|
{
|
|
956
938
|
onClick: () => disconnect(),
|
|
@@ -961,7 +943,7 @@ function ConnectButton({
|
|
|
961
943
|
color: "white"
|
|
962
944
|
},
|
|
963
945
|
children: [
|
|
964
|
-
showBalance && balance && /* @__PURE__ */
|
|
946
|
+
showBalance && balance && /* @__PURE__ */ jsxRuntime.jsxs("span", { style: { marginRight: 8 }, children: [
|
|
965
947
|
formatBalance(balance),
|
|
966
948
|
" RLO"
|
|
967
949
|
] }),
|
|
@@ -970,7 +952,7 @@ function ConnectButton({
|
|
|
970
952
|
}
|
|
971
953
|
);
|
|
972
954
|
}
|
|
973
|
-
return /* @__PURE__ */
|
|
955
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
974
956
|
"button",
|
|
975
957
|
{
|
|
976
958
|
onClick: openModal,
|
|
@@ -986,15 +968,15 @@ function ConnectButton({
|
|
|
986
968
|
}
|
|
987
969
|
var walletModalOwnerToken = null;
|
|
988
970
|
function WalletModal({ title = "Connect Wallet", className = "" }) {
|
|
989
|
-
const ownerRef =
|
|
990
|
-
const [isOwner] =
|
|
971
|
+
const ownerRef = React2__default.default.useRef({});
|
|
972
|
+
const [isOwner] = React2.useState(() => {
|
|
991
973
|
if (!walletModalOwnerToken) {
|
|
992
974
|
walletModalOwnerToken = ownerRef.current;
|
|
993
975
|
return true;
|
|
994
976
|
}
|
|
995
977
|
return walletModalOwnerToken === ownerRef.current;
|
|
996
978
|
});
|
|
997
|
-
|
|
979
|
+
React2.useEffect(() => {
|
|
998
980
|
return () => {
|
|
999
981
|
if (isOwner && walletModalOwnerToken === ownerRef.current) {
|
|
1000
982
|
walletModalOwnerToken = null;
|
|
@@ -1004,7 +986,7 @@ function WalletModal({ title = "Connect Wallet", className = "" }) {
|
|
|
1004
986
|
if (!isOwner) return null;
|
|
1005
987
|
const { isModalOpen, closeModal, wallets, selectWallet, connecting } = useWallet();
|
|
1006
988
|
if (!isModalOpen) return null;
|
|
1007
|
-
return /* @__PURE__ */
|
|
989
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1008
990
|
"div",
|
|
1009
991
|
{
|
|
1010
992
|
className,
|
|
@@ -1018,7 +1000,7 @@ function WalletModal({ title = "Connect Wallet", className = "" }) {
|
|
|
1018
1000
|
backgroundColor: "rgba(0, 0, 0, 0.5)"
|
|
1019
1001
|
},
|
|
1020
1002
|
onClick: closeModal,
|
|
1021
|
-
children: /* @__PURE__ */
|
|
1003
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1022
1004
|
"div",
|
|
1023
1005
|
{
|
|
1024
1006
|
style: {
|
|
@@ -1032,9 +1014,9 @@ function WalletModal({ title = "Connect Wallet", className = "" }) {
|
|
|
1032
1014
|
},
|
|
1033
1015
|
onClick: (e) => e.stopPropagation(),
|
|
1034
1016
|
children: [
|
|
1035
|
-
/* @__PURE__ */
|
|
1036
|
-
/* @__PURE__ */
|
|
1037
|
-
/* @__PURE__ */
|
|
1017
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: "20px" }, children: [
|
|
1018
|
+
/* @__PURE__ */ jsxRuntime.jsx("h2", { style: { margin: 0, fontSize: "18px", fontWeight: 600 }, children: title }),
|
|
1019
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1038
1020
|
"button",
|
|
1039
1021
|
{
|
|
1040
1022
|
onClick: closeModal,
|
|
@@ -1043,7 +1025,7 @@ function WalletModal({ title = "Connect Wallet", className = "" }) {
|
|
|
1043
1025
|
}
|
|
1044
1026
|
)
|
|
1045
1027
|
] }),
|
|
1046
|
-
/* @__PURE__ */
|
|
1028
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { display: "flex", flexDirection: "column", gap: "12px" }, children: wallets.map((wallet) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1047
1029
|
"button",
|
|
1048
1030
|
{
|
|
1049
1031
|
onClick: () => selectWallet(wallet.id),
|
|
@@ -1061,17 +1043,17 @@ function WalletModal({ title = "Connect Wallet", className = "" }) {
|
|
|
1061
1043
|
transition: "all 0.2s ease"
|
|
1062
1044
|
},
|
|
1063
1045
|
children: [
|
|
1064
|
-
/* @__PURE__ */
|
|
1065
|
-
/* @__PURE__ */
|
|
1066
|
-
/* @__PURE__ */
|
|
1067
|
-
/* @__PURE__ */
|
|
1046
|
+
/* @__PURE__ */ jsxRuntime.jsx("img", { src: wallet.icon, alt: wallet.name, style: { width: 40, height: 40, borderRadius: 8 } }),
|
|
1047
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { textAlign: "left", flex: 1 }, children: [
|
|
1048
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontWeight: 500 }, children: wallet.name }),
|
|
1049
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: "12px", color: "#666" }, children: wallet.installed ? "Detected" : "Not installed" })
|
|
1068
1050
|
] }),
|
|
1069
|
-
!wallet.installed && /* @__PURE__ */
|
|
1051
|
+
!wallet.installed && /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: "12px", color: "#6EB9A8" }, children: "Install \u2192" })
|
|
1070
1052
|
]
|
|
1071
1053
|
},
|
|
1072
1054
|
wallet.id
|
|
1073
1055
|
)) }),
|
|
1074
|
-
/* @__PURE__ */
|
|
1056
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { marginTop: "20px", textAlign: "center", fontSize: "12px", color: "#999" }, children: "Powered by CookilLabs" })
|
|
1075
1057
|
]
|
|
1076
1058
|
}
|
|
1077
1059
|
)
|
|
@@ -1080,42 +1062,41 @@ function WalletModal({ title = "Connect Wallet", className = "" }) {
|
|
|
1080
1062
|
}
|
|
1081
1063
|
function withWalletErrorBoundary(WrappedComponent, fallback) {
|
|
1082
1064
|
return function WithErrorBoundary(props) {
|
|
1083
|
-
return /* @__PURE__ */
|
|
1065
|
+
return /* @__PURE__ */ jsxRuntime.jsx(WalletErrorBoundary, { fallback, children: /* @__PURE__ */ jsxRuntime.jsx(WrappedComponent, { ...props }) });
|
|
1084
1066
|
};
|
|
1085
1067
|
}
|
|
1086
1068
|
function SafeWalletProvider(props) {
|
|
1087
1069
|
const { errorFallback, ...providerProps } = props;
|
|
1088
|
-
return /* @__PURE__ */
|
|
1070
|
+
return /* @__PURE__ */ jsxRuntime.jsx(WalletErrorBoundary, { fallback: errorFallback, children: /* @__PURE__ */ jsxRuntime.jsx(WalletProvider, { ...providerProps }) });
|
|
1089
1071
|
}
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
});
|
|
1072
|
+
|
|
1073
|
+
exports.ApprovalPending = ApprovalPending;
|
|
1074
|
+
exports.ConnectButton = ConnectButton;
|
|
1075
|
+
exports.ConnectionStatus = ConnectionStatus;
|
|
1076
|
+
exports.LoadingSpinner = LoadingSpinner;
|
|
1077
|
+
exports.NETWORKS = NETWORKS;
|
|
1078
|
+
exports.SafeWalletProvider = SafeWalletProvider;
|
|
1079
|
+
exports.WalletErrorBoundary = WalletErrorBoundary;
|
|
1080
|
+
exports.WalletModal = WalletModal;
|
|
1081
|
+
exports.WalletProvider = WalletProvider;
|
|
1082
|
+
exports.formatAddress = formatAddress;
|
|
1083
|
+
exports.formatBalance = formatBalance;
|
|
1084
|
+
exports.getRialoProvider = getRialoProvider;
|
|
1085
|
+
exports.isRialoInstalled = isRialoInstalled;
|
|
1086
|
+
exports.isValidAddress = isValidAddress;
|
|
1087
|
+
exports.useAccounts = useAccounts;
|
|
1088
|
+
exports.useActiveAccount = useActiveAccount;
|
|
1089
|
+
exports.useBalance = useBalance;
|
|
1090
|
+
exports.useChainId = useChainId;
|
|
1091
|
+
exports.useConnectWallet = useConnectWallet;
|
|
1092
|
+
exports.useDisconnectWallet = useDisconnectWallet;
|
|
1093
|
+
exports.useIsConnected = useIsConnected;
|
|
1094
|
+
exports.useNetwork = useNetwork;
|
|
1095
|
+
exports.useSendTransaction = useSendTransaction;
|
|
1096
|
+
exports.useSignMessage = useSignMessage;
|
|
1097
|
+
exports.useSignTransaction = useSignTransaction;
|
|
1098
|
+
exports.useSwitchNetwork = useSwitchNetwork;
|
|
1099
|
+
exports.useWallet = useWallet;
|
|
1100
|
+
exports.withWalletErrorBoundary = withWalletErrorBoundary;
|
|
1101
|
+
//# sourceMappingURL=react.cjs.map
|
|
1121
1102
|
//# sourceMappingURL=react.cjs.map
|