@meshsdk/react 1.9.0-beta.2 → 1.9.0-beta.21
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/dist/index.cjs +178 -116
- package/dist/index.d.cts +4 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +158 -96
- package/package.json +7 -6
package/dist/index.cjs
CHANGED
|
@@ -23457,7 +23457,7 @@ __export(index_exports, {
|
|
|
23457
23457
|
module.exports = __toCommonJS(index_exports);
|
|
23458
23458
|
|
|
23459
23459
|
// src/cardano-wallet/index.tsx
|
|
23460
|
-
var
|
|
23460
|
+
var import_react14 = require("react");
|
|
23461
23461
|
|
|
23462
23462
|
// src/common/button.tsx
|
|
23463
23463
|
var React = __toESM(require("react"), 1);
|
|
@@ -24241,7 +24241,6 @@ function IconDownload() {
|
|
|
24241
24241
|
height: "24px",
|
|
24242
24242
|
strokeWidth: "1px"
|
|
24243
24243
|
},
|
|
24244
|
-
className: "hover:mesh-fill-white",
|
|
24245
24244
|
children: [
|
|
24246
24245
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
|
|
24247
24246
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("polyline", { points: "7 10 12 15 17 10" }),
|
|
@@ -24364,8 +24363,64 @@ function WalletIcon({
|
|
|
24364
24363
|
] });
|
|
24365
24364
|
}
|
|
24366
24365
|
|
|
24367
|
-
// src/cardano-wallet/
|
|
24366
|
+
// src/cardano-wallet/web3-services.tsx
|
|
24367
|
+
var import_react11 = require("react");
|
|
24368
|
+
var import_web3_sdk = require("@meshsdk/web3-sdk");
|
|
24369
|
+
|
|
24370
|
+
// src/common/icons/icon-discord.tsx
|
|
24368
24371
|
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
24372
|
+
function IconDiscord() {
|
|
24373
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
24374
|
+
"svg",
|
|
24375
|
+
{
|
|
24376
|
+
viewBox: "0 0 20 20",
|
|
24377
|
+
"aria-hidden": "true",
|
|
24378
|
+
style: {
|
|
24379
|
+
color: "#ffadff",
|
|
24380
|
+
width: "24px",
|
|
24381
|
+
height: "24px",
|
|
24382
|
+
strokeWidth: "1px",
|
|
24383
|
+
fill: "#5865F2"
|
|
24384
|
+
},
|
|
24385
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("path", { d: "M16.238 4.515a14.842 14.842 0 0 0-3.664-1.136.055.055 0 0 0-.059.027 10.35 10.35 0 0 0-.456.938 13.702 13.702 0 0 0-4.115 0 9.479 9.479 0 0 0-.464-.938.058.058 0 0 0-.058-.027c-1.266.218-2.497.6-3.664 1.136a.052.052 0 0 0-.024.02C1.4 8.023.76 11.424 1.074 14.782a.062.062 0 0 0 .024.042 14.923 14.923 0 0 0 4.494 2.272.058.058 0 0 0 .064-.02c.346-.473.654-.972.92-1.496a.057.057 0 0 0-.032-.08 9.83 9.83 0 0 1-1.404-.669.058.058 0 0 1-.029-.046.058.058 0 0 1 .023-.05c.094-.07.189-.144.279-.218a.056.056 0 0 1 .058-.008c2.946 1.345 6.135 1.345 9.046 0a.056.056 0 0 1 .059.007c.09.074.184.149.28.22a.058.058 0 0 1 .023.049.059.059 0 0 1-.028.046 9.224 9.224 0 0 1-1.405.669.058.058 0 0 0-.033.033.056.056 0 0 0 .002.047c.27.523.58 1.022.92 1.495a.056.056 0 0 0 .062.021 14.878 14.878 0 0 0 4.502-2.272.055.055 0 0 0 .016-.018.056.056 0 0 0 .008-.023c.375-3.883-.63-7.256-2.662-10.246a.046.046 0 0 0-.023-.021Zm-9.223 8.221c-.887 0-1.618-.814-1.618-1.814s.717-1.814 1.618-1.814c.908 0 1.632.821 1.618 1.814 0 1-.717 1.814-1.618 1.814Zm5.981 0c-.887 0-1.618-.814-1.618-1.814s.717-1.814 1.618-1.814c.908 0 1.632.821 1.618 1.814 0 1-.71 1.814-1.618 1.814Z" })
|
|
24386
|
+
}
|
|
24387
|
+
);
|
|
24388
|
+
}
|
|
24389
|
+
|
|
24390
|
+
// src/cardano-wallet/web3-services.tsx
|
|
24391
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
24392
|
+
function Web3Services({
|
|
24393
|
+
options,
|
|
24394
|
+
setOpen
|
|
24395
|
+
}) {
|
|
24396
|
+
const { setWallet } = useWallet();
|
|
24397
|
+
const [loading, setLoading] = (0, import_react11.useState)(false);
|
|
24398
|
+
async function loadWallet() {
|
|
24399
|
+
setLoading(true);
|
|
24400
|
+
const _options = {
|
|
24401
|
+
networkId: 0,
|
|
24402
|
+
fetcher: options.fetcher,
|
|
24403
|
+
submitter: options.submitter,
|
|
24404
|
+
appUrl: options.appUrl,
|
|
24405
|
+
projectId: options.projectId
|
|
24406
|
+
};
|
|
24407
|
+
const wallet = await import_web3_sdk.Web3Wallet.enable(_options);
|
|
24408
|
+
setWallet(wallet, "Mesh Web3 Services");
|
|
24409
|
+
setLoading(false);
|
|
24410
|
+
setOpen(false);
|
|
24411
|
+
}
|
|
24412
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
24413
|
+
WalletIcon,
|
|
24414
|
+
{
|
|
24415
|
+
iconReactNode: IconDiscord(),
|
|
24416
|
+
name: `Discord`,
|
|
24417
|
+
action: () => loadWallet()
|
|
24418
|
+
}
|
|
24419
|
+
);
|
|
24420
|
+
}
|
|
24421
|
+
|
|
24422
|
+
// src/cardano-wallet/screen-main.tsx
|
|
24423
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
24369
24424
|
function ScreenMain({
|
|
24370
24425
|
injectFn,
|
|
24371
24426
|
extensions,
|
|
@@ -24374,12 +24429,14 @@ function ScreenMain({
|
|
|
24374
24429
|
persist,
|
|
24375
24430
|
cardanoPeerConnect,
|
|
24376
24431
|
burnerWallet,
|
|
24377
|
-
webauthn
|
|
24432
|
+
webauthn,
|
|
24433
|
+
showDownload,
|
|
24434
|
+
web3Services
|
|
24378
24435
|
}) {
|
|
24379
24436
|
const wallets = useWalletList({ injectFn });
|
|
24380
24437
|
const { connect: connect2 } = useWallet();
|
|
24381
|
-
return /* @__PURE__ */ (0,
|
|
24382
|
-
wallets.map((wallet, index) => /* @__PURE__ */ (0,
|
|
24438
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "mesh-grid mesh-gap-4 mesh-py-4 mesh-grid-cols-5 mesh-place-items-center mesh-gap-y-8", children: [
|
|
24439
|
+
wallets.map((wallet, index) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
24383
24440
|
WalletIcon,
|
|
24384
24441
|
{
|
|
24385
24442
|
icon: wallet.icon,
|
|
@@ -24391,7 +24448,8 @@ function ScreenMain({
|
|
|
24391
24448
|
},
|
|
24392
24449
|
index
|
|
24393
24450
|
)),
|
|
24394
|
-
|
|
24451
|
+
web3Services && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Web3Services, { options: web3Services, setOpen }),
|
|
24452
|
+
webauthn && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
24395
24453
|
WalletIcon,
|
|
24396
24454
|
{
|
|
24397
24455
|
iconReactNode: IconFingerprint(),
|
|
@@ -24401,7 +24459,7 @@ function ScreenMain({
|
|
|
24401
24459
|
}
|
|
24402
24460
|
}
|
|
24403
24461
|
),
|
|
24404
|
-
cardanoPeerConnect && /* @__PURE__ */ (0,
|
|
24462
|
+
cardanoPeerConnect && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
24405
24463
|
WalletIcon,
|
|
24406
24464
|
{
|
|
24407
24465
|
iconReactNode: IconMonitorSmartphone(),
|
|
@@ -24411,7 +24469,7 @@ function ScreenMain({
|
|
|
24411
24469
|
}
|
|
24412
24470
|
}
|
|
24413
24471
|
),
|
|
24414
|
-
burnerWallet && /* @__PURE__ */ (0,
|
|
24472
|
+
burnerWallet && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
24415
24473
|
WalletIcon,
|
|
24416
24474
|
{
|
|
24417
24475
|
iconReactNode: IconBookDashed(),
|
|
@@ -24421,7 +24479,7 @@ function ScreenMain({
|
|
|
24421
24479
|
}
|
|
24422
24480
|
}
|
|
24423
24481
|
),
|
|
24424
|
-
/* @__PURE__ */ (0,
|
|
24482
|
+
showDownload && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
24425
24483
|
WalletIcon,
|
|
24426
24484
|
{
|
|
24427
24485
|
iconReactNode: IconDownload(),
|
|
@@ -24438,19 +24496,19 @@ function ScreenMain({
|
|
|
24438
24496
|
}
|
|
24439
24497
|
|
|
24440
24498
|
// src/cardano-wallet/screen-p2p.tsx
|
|
24441
|
-
var
|
|
24499
|
+
var import_react12 = require("react");
|
|
24442
24500
|
var import_cardano_peer_connect = __toESM(require_dist(), 1);
|
|
24443
|
-
var
|
|
24501
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
24444
24502
|
function ScreenP2P({
|
|
24445
24503
|
cardanoPeerConnect,
|
|
24446
24504
|
setOpen
|
|
24447
24505
|
}) {
|
|
24448
|
-
const dAppConnect = (0,
|
|
24449
|
-
const qrCodeField = (0,
|
|
24450
|
-
const [address, setAddress] = (0,
|
|
24451
|
-
const [copied, setCopied] = (0,
|
|
24506
|
+
const dAppConnect = (0, import_react12.useRef)(null);
|
|
24507
|
+
const qrCodeField = (0, import_react12.useRef)(null);
|
|
24508
|
+
const [address, setAddress] = (0, import_react12.useState)("");
|
|
24509
|
+
const [copied, setCopied] = (0, import_react12.useState)(false);
|
|
24452
24510
|
const { connect: connect2 } = useWallet();
|
|
24453
|
-
(0,
|
|
24511
|
+
(0, import_react12.useEffect)(() => {
|
|
24454
24512
|
if (cardanoPeerConnect) {
|
|
24455
24513
|
if (dAppConnect.current === null) {
|
|
24456
24514
|
dAppConnect.current = new import_cardano_peer_connect.DAppPeerConnect({
|
|
@@ -24484,9 +24542,9 @@ function ScreenP2P({
|
|
|
24484
24542
|
}
|
|
24485
24543
|
}
|
|
24486
24544
|
}, []);
|
|
24487
|
-
return /* @__PURE__ */ (0,
|
|
24488
|
-
/* @__PURE__ */ (0,
|
|
24489
|
-
/* @__PURE__ */ (0,
|
|
24545
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "mesh-flex mesh-flex-col mesh-items-center mesh-justify-center", children: [
|
|
24546
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { style: { marginTop: 16, marginBottom: 16 }, ref: qrCodeField }),
|
|
24547
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
24490
24548
|
Button,
|
|
24491
24549
|
{
|
|
24492
24550
|
variant: "outline",
|
|
@@ -24501,15 +24559,15 @@ function ScreenP2P({
|
|
|
24501
24559
|
}
|
|
24502
24560
|
|
|
24503
24561
|
// src/cardano-wallet/screen-webauthn.tsx
|
|
24504
|
-
var
|
|
24562
|
+
var import_react13 = require("react");
|
|
24505
24563
|
var import_wallet4 = require("@meshsdk/wallet");
|
|
24506
24564
|
|
|
24507
24565
|
// src/common/input.tsx
|
|
24508
24566
|
var React5 = __toESM(require("react"), 1);
|
|
24509
|
-
var
|
|
24567
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
24510
24568
|
var Input = React5.forwardRef(
|
|
24511
24569
|
({ className, type, ...props }, ref) => {
|
|
24512
|
-
return /* @__PURE__ */ (0,
|
|
24570
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
24513
24571
|
"input",
|
|
24514
24572
|
{
|
|
24515
24573
|
type,
|
|
@@ -24529,11 +24587,11 @@ Input.displayName = "Input";
|
|
|
24529
24587
|
var React6 = __toESM(require("react"), 1);
|
|
24530
24588
|
var LabelPrimitive = __toESM(require("@radix-ui/react-label"), 1);
|
|
24531
24589
|
var import_class_variance_authority2 = require("class-variance-authority");
|
|
24532
|
-
var
|
|
24590
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
24533
24591
|
var labelVariants = (0, import_class_variance_authority2.cva)(
|
|
24534
24592
|
"mesh-text-sm mesh-font-medium mesh-leading-none peer-disabled:mesh-cursor-not-allowed peer-disabled:mesh-opacity-70"
|
|
24535
24593
|
);
|
|
24536
|
-
var Label2 = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
24594
|
+
var Label2 = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
24537
24595
|
LabelPrimitive.Root,
|
|
24538
24596
|
{
|
|
24539
24597
|
ref,
|
|
@@ -24544,16 +24602,16 @@ var Label2 = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
|
24544
24602
|
Label2.displayName = LabelPrimitive.Root.displayName;
|
|
24545
24603
|
|
|
24546
24604
|
// src/cardano-wallet/screen-webauthn.tsx
|
|
24547
|
-
var
|
|
24605
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
24548
24606
|
function ScreenWebauthn({
|
|
24549
24607
|
url,
|
|
24550
24608
|
networkId,
|
|
24551
24609
|
provider,
|
|
24552
24610
|
setOpen
|
|
24553
24611
|
}) {
|
|
24554
|
-
const [loading, setLoading] = (0,
|
|
24555
|
-
const [userName, setUserName] = (0,
|
|
24556
|
-
const [password, setPassword] = (0,
|
|
24612
|
+
const [loading, setLoading] = (0, import_react13.useState)(false);
|
|
24613
|
+
const [userName, setUserName] = (0, import_react13.useState)("");
|
|
24614
|
+
const [password, setPassword] = (0, import_react13.useState)("");
|
|
24557
24615
|
const { setWallet } = useWallet();
|
|
24558
24616
|
function createWallet(root) {
|
|
24559
24617
|
setTimeout(() => {
|
|
@@ -24578,10 +24636,10 @@ function ScreenWebauthn({
|
|
|
24578
24636
|
createWallet(res.wallet.bech32PrivateKey);
|
|
24579
24637
|
}
|
|
24580
24638
|
}
|
|
24581
|
-
return /* @__PURE__ */ (0,
|
|
24582
|
-
/* @__PURE__ */ (0,
|
|
24583
|
-
/* @__PURE__ */ (0,
|
|
24584
|
-
/* @__PURE__ */ (0,
|
|
24639
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "mesh-flex mesh-flex-row mesh-flex-gap-4 mesh-items-center mesh-justify-center", children: loading ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_jsx_runtime20.Fragment, { children: "Connecting wallet..." }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_jsx_runtime20.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "mesh-flex mesh-flex-col mesh-gap-6 mesh-w-full mesh-mx-8", children: [
|
|
24640
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "mesh-grid mesh-gap-2", children: [
|
|
24641
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Label2, { htmlFor: "username", children: "Username" }),
|
|
24642
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
24585
24643
|
Input,
|
|
24586
24644
|
{
|
|
24587
24645
|
id: "username",
|
|
@@ -24591,11 +24649,11 @@ function ScreenWebauthn({
|
|
|
24591
24649
|
onChange: (e2) => setUserName(e2.target.value)
|
|
24592
24650
|
}
|
|
24593
24651
|
),
|
|
24594
|
-
/* @__PURE__ */ (0,
|
|
24652
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "mesh-text-gray-500 mesh-text-xs", children: "Unique to the application you are connecting." })
|
|
24595
24653
|
] }),
|
|
24596
|
-
/* @__PURE__ */ (0,
|
|
24597
|
-
/* @__PURE__ */ (0,
|
|
24598
|
-
/* @__PURE__ */ (0,
|
|
24654
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "mesh-grid mesh-gap-2", children: [
|
|
24655
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "mesh-flex mesh-items-center", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Label2, { htmlFor: "password", children: "Unique Code" }) }),
|
|
24656
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
24599
24657
|
Input,
|
|
24600
24658
|
{
|
|
24601
24659
|
id: "password",
|
|
@@ -24605,9 +24663,9 @@ function ScreenWebauthn({
|
|
|
24605
24663
|
onChange: (e2) => setPassword(e2.target.value)
|
|
24606
24664
|
}
|
|
24607
24665
|
),
|
|
24608
|
-
/* @__PURE__ */ (0,
|
|
24666
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "mesh-text-gray-500 mesh-text-xs", children: "Additional security to derive your wallet." })
|
|
24609
24667
|
] }),
|
|
24610
|
-
/* @__PURE__ */ (0,
|
|
24668
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
24611
24669
|
Button,
|
|
24612
24670
|
{
|
|
24613
24671
|
className: "mesh-w-full",
|
|
@@ -24620,7 +24678,7 @@ function ScreenWebauthn({
|
|
|
24620
24678
|
}
|
|
24621
24679
|
|
|
24622
24680
|
// src/cardano-wallet/index.tsx
|
|
24623
|
-
var
|
|
24681
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
24624
24682
|
var CardanoWallet = ({
|
|
24625
24683
|
label = "Connect Wallet",
|
|
24626
24684
|
onConnected = void 0,
|
|
@@ -24630,29 +24688,31 @@ var CardanoWallet = ({
|
|
|
24630
24688
|
injectFn = void 0,
|
|
24631
24689
|
cardanoPeerConnect = void 0,
|
|
24632
24690
|
burnerWallet = void 0,
|
|
24633
|
-
webauthn = void 0
|
|
24691
|
+
webauthn = void 0,
|
|
24692
|
+
showDownload = true,
|
|
24693
|
+
web3Services = void 0
|
|
24634
24694
|
}) => {
|
|
24635
|
-
const [open, setOpen] = (0,
|
|
24636
|
-
const [screen, setScreen] = (0,
|
|
24695
|
+
const [open, setOpen] = (0, import_react14.useState)(false);
|
|
24696
|
+
const [screen, setScreen] = (0, import_react14.useState)("main");
|
|
24637
24697
|
const { wallet, connected, setPersist } = useWallet();
|
|
24638
|
-
(0,
|
|
24698
|
+
(0, import_react14.useEffect)(() => {
|
|
24639
24699
|
setPersist(persist);
|
|
24640
24700
|
}, [persist]);
|
|
24641
|
-
(0,
|
|
24701
|
+
(0, import_react14.useEffect)(() => {
|
|
24642
24702
|
if (connected) {
|
|
24643
24703
|
if (onConnected) onConnected();
|
|
24644
24704
|
}
|
|
24645
24705
|
}, [connected, wallet]);
|
|
24646
|
-
return /* @__PURE__ */ (0,
|
|
24647
|
-
/* @__PURE__ */ (0,
|
|
24648
|
-
/* @__PURE__ */ (0,
|
|
24706
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Dialog, { open, onOpenChange: setOpen, children: [
|
|
24707
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: isDark ? "mesh-dark" : "", children: !connected ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DialogTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Button, { variant: "outline", className: isDark ? "mesh-dark" : "", children: label }) }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ConnectedButton, {}) }),
|
|
24708
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
24649
24709
|
DialogContent,
|
|
24650
24710
|
{
|
|
24651
24711
|
className: "sm:mesh-max-w-[425px] mesh-dark",
|
|
24652
24712
|
onOpenAutoFocus: (event) => event.preventDefault(),
|
|
24653
24713
|
children: [
|
|
24654
|
-
/* @__PURE__ */ (0,
|
|
24655
|
-
screen == "main" && /* @__PURE__ */ (0,
|
|
24714
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Header, { screen, setScreen }),
|
|
24715
|
+
screen == "main" && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
24656
24716
|
ScreenMain,
|
|
24657
24717
|
{
|
|
24658
24718
|
injectFn,
|
|
@@ -24662,17 +24722,19 @@ var CardanoWallet = ({
|
|
|
24662
24722
|
persist,
|
|
24663
24723
|
cardanoPeerConnect: cardanoPeerConnect != void 0,
|
|
24664
24724
|
burnerWallet: burnerWallet != void 0,
|
|
24665
|
-
webauthn: webauthn != void 0
|
|
24725
|
+
webauthn: webauthn != void 0,
|
|
24726
|
+
showDownload,
|
|
24727
|
+
web3Services
|
|
24666
24728
|
}
|
|
24667
24729
|
),
|
|
24668
|
-
screen == "p2p" && /* @__PURE__ */ (0,
|
|
24730
|
+
screen == "p2p" && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
24669
24731
|
ScreenP2P,
|
|
24670
24732
|
{
|
|
24671
24733
|
cardanoPeerConnect,
|
|
24672
24734
|
setOpen
|
|
24673
24735
|
}
|
|
24674
24736
|
),
|
|
24675
|
-
screen == "burner" && burnerWallet && /* @__PURE__ */ (0,
|
|
24737
|
+
screen == "burner" && burnerWallet && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
24676
24738
|
ScreenBurner,
|
|
24677
24739
|
{
|
|
24678
24740
|
networkId: burnerWallet.networkId,
|
|
@@ -24680,7 +24742,7 @@ var CardanoWallet = ({
|
|
|
24680
24742
|
setOpen
|
|
24681
24743
|
}
|
|
24682
24744
|
),
|
|
24683
|
-
screen == "webauthn" && webauthn && /* @__PURE__ */ (0,
|
|
24745
|
+
screen == "webauthn" && webauthn && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
24684
24746
|
ScreenWebauthn,
|
|
24685
24747
|
{
|
|
24686
24748
|
url: webauthn.url,
|
|
@@ -24689,7 +24751,7 @@ var CardanoWallet = ({
|
|
|
24689
24751
|
setOpen
|
|
24690
24752
|
}
|
|
24691
24753
|
),
|
|
24692
|
-
/* @__PURE__ */ (0,
|
|
24754
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Footer, {})
|
|
24693
24755
|
]
|
|
24694
24756
|
}
|
|
24695
24757
|
)
|
|
@@ -24699,25 +24761,25 @@ function Header({
|
|
|
24699
24761
|
screen,
|
|
24700
24762
|
setScreen
|
|
24701
24763
|
}) {
|
|
24702
|
-
return /* @__PURE__ */ (0,
|
|
24703
|
-
/* @__PURE__ */ (0,
|
|
24704
|
-
screen != "main" ? /* @__PURE__ */ (0,
|
|
24705
|
-
/* @__PURE__ */ (0,
|
|
24706
|
-
/* @__PURE__ */ (0,
|
|
24764
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(DialogHeader, { children: [
|
|
24765
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(DialogTitle, { className: "mesh-flex mesh-justify-between", children: [
|
|
24766
|
+
screen != "main" ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("button", { onClick: () => setScreen("main"), children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(IconChevronRight, {}) }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { style: { width: "24px" } }),
|
|
24767
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { children: screens[screen].title }),
|
|
24768
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { style: { width: "24px" } })
|
|
24707
24769
|
] }),
|
|
24708
|
-
/* @__PURE__ */ (0,
|
|
24770
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DialogDescription, { children: screens[screen].subtitle && screens[screen].subtitle })
|
|
24709
24771
|
] });
|
|
24710
24772
|
}
|
|
24711
24773
|
function Footer() {
|
|
24712
|
-
return /* @__PURE__ */ (0,
|
|
24774
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DialogFooter, { className: "mesh-justify-center mesh-text-sm", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
24713
24775
|
"a",
|
|
24714
24776
|
{
|
|
24715
24777
|
href: "https://meshjs.dev/",
|
|
24716
24778
|
target: "_blank",
|
|
24717
24779
|
className: "mesh-grow mesh-flex mesh-gap-1 mesh-items-center mesh-justify-center mesh-text-zinc-500 hover:mesh-text-white mesh-fill-zinc-500 hover:mesh-fill-white",
|
|
24718
24780
|
children: [
|
|
24719
|
-
/* @__PURE__ */ (0,
|
|
24720
|
-
/* @__PURE__ */ (0,
|
|
24781
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "", children: "Powered by" }),
|
|
24782
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
24721
24783
|
"svg",
|
|
24722
24784
|
{
|
|
24723
24785
|
width: 24,
|
|
@@ -24725,31 +24787,31 @@ function Footer() {
|
|
|
24725
24787
|
enableBackground: "new 0 0 300 200",
|
|
24726
24788
|
viewBox: "0 0 300 200",
|
|
24727
24789
|
xmlns: "http://www.w3.org/2000/svg",
|
|
24728
|
-
children: /* @__PURE__ */ (0,
|
|
24790
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("path", { d: "m289 127-45-60-45-60c-.9-1.3-2.4-2-4-2s-3.1.7-4 2l-37 49.3c-2 2.7-6 2.7-8 0l-37-49.3c-.9-1.3-2.4-2-4-2s-3.1.7-4 2l-45 60-45 60c-1.3 1.8-1.3 4.2 0 6l45 60c.9 1.3 2.4 2 4 2s3.1-.7 4-2l37-49.3c2-2.7 6-2.7 8 0l37 49.3c.9 1.3 2.4 2 4 2s3.1-.7 4-2l37-49.3c2-2.7 6-2.7 8 0l37 49.3c.9 1.3 2.4 2 4 2s3.1-.7 4-2l45-60c1.3-1.8 1.3-4.2 0-6zm-90-103.3 32.5 43.3c1.3 1.8 1.3 4.2 0 6l-32.5 43.3c-2 2.7-6 2.7-8 0l-32.5-43.3c-1.3-1.8-1.3-4.2 0-6l32.5-43.3c2-2.7 6-2.7 8 0zm-90 0 32.5 43.3c1.3 1.8 1.3 4.2 0 6l-32.5 43.3c-2 2.7-6 2.7-8 0l-32.5-43.3c-1.3-1.8-1.3-4.2 0-6l32.5-43.3c2-2.7 6-2.7 8 0zm-53 152.6-32.5-43.3c-1.3-1.8-1.3-4.2 0-6l32.5-43.3c2-2.7 6-2.7 8 0l32.5 43.3c1.3 1.8 1.3 4.2 0 6l-32.5 43.3c-2 2.7-6 2.7-8 0zm90 0-32.5-43.3c-1.3-1.8-1.3-4.2 0-6l32.5-43.3c2-2.7 6-2.7 8 0l32.5 43.3c1.3 1.8 1.3 4.2 0 6l-32.5 43.3c-2 2.7-6 2.7-8 0zm90 0-32.5-43.3c-1.3-1.8-1.3-4.2 0-6l32.5-43.3c2-2.7 6-2.7 8 0l32.5 43.3c1.3 1.8 1.3 4.2 0 6l-32.5 43.3c-2 2.7-6 2.7-8 0z" })
|
|
24729
24791
|
}
|
|
24730
24792
|
),
|
|
24731
|
-
/* @__PURE__ */ (0,
|
|
24793
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "", children: "Mesh SDK" })
|
|
24732
24794
|
]
|
|
24733
24795
|
}
|
|
24734
24796
|
) });
|
|
24735
24797
|
}
|
|
24736
24798
|
|
|
24737
24799
|
// src/mesh-badge/mesh-logo.tsx
|
|
24738
|
-
var
|
|
24739
|
-
var MeshLogo = () => /* @__PURE__ */ (0,
|
|
24800
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
24801
|
+
var MeshLogo = () => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
24740
24802
|
"svg",
|
|
24741
24803
|
{
|
|
24742
24804
|
className: "mesh-h-16 mesh-p-2",
|
|
24743
24805
|
fill: "currentColor",
|
|
24744
24806
|
viewBox: "0 0 300 200",
|
|
24745
24807
|
xmlns: "http://www.w3.org/2000/svg",
|
|
24746
|
-
children: /* @__PURE__ */ (0,
|
|
24808
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("path", { d: "m289 127-45-60-45-60c-.9-1.3-2.4-2-4-2s-3.1.7-4 2l-37 49.3c-2 2.7-6 2.7-8 0l-37-49.3c-.9-1.3-2.4-2-4-2s-3.1.7-4 2l-45 60-45 60c-1.3 1.8-1.3 4.2 0 6l45 60c.9 1.3 2.4 2 4 2s3.1-.7 4-2l37-49.3c2-2.7 6-2.7 8 0l37 49.3c.9 1.3 2.4 2 4 2s3.1-.7 4-2l37-49.3c2-2.7 6-2.7 8 0l37 49.3c.9 1.3 2.4 2 4 2s3.1-.7 4-2l45-60c1.3-1.8 1.3-4.2 0-6zm-90-103.3 32.5 43.3c1.3 1.8 1.3 4.2 0 6l-32.5 43.3c-2 2.7-6 2.7-8 0l-32.5-43.3c-1.3-1.8-1.3-4.2 0-6l32.5-43.3c2-2.7 6-2.7 8 0zm-90 0 32.5 43.3c1.3 1.8 1.3 4.2 0 6l-32.5 43.3c-2 2.7-6 2.7-8 0l-32.5-43.3c-1.3-1.8-1.3-4.2 0-6l32.5-43.3c2-2.7 6-2.7 8 0zm-53 152.6-32.5-43.3c-1.3-1.8-1.3-4.2 0-6l32.5-43.3c2-2.7 6-2.7 8 0l32.5 43.3c1.3 1.8 1.3 4.2 0 6l-32.5 43.3c-2 2.7-6 2.7-8 0zm90 0-32.5-43.3c-1.3-1.8-1.3-4.2 0-6l32.5-43.3c2-2.7 6-2.7 8 0l32.5 43.3c1.3 1.8 1.3 4.2 0 6l-32.5 43.3c-2 2.7-6 2.7-8 0zm90 0-32.5-43.3c-1.3-1.8-1.3-4.2 0-6l32.5-43.3c2-2.7 6-2.7 8 0l32.5 43.3c1.3 1.8 1.3 4.2 0 6l-32.5 43.3c-2 2.7-6 2.7-8 0z" })
|
|
24747
24809
|
}
|
|
24748
24810
|
);
|
|
24749
24811
|
|
|
24750
24812
|
// src/mesh-badge/index.tsx
|
|
24751
|
-
var
|
|
24752
|
-
var MeshBadge = ({ isDark = false }) => /* @__PURE__ */ (0,
|
|
24813
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
24814
|
+
var MeshBadge = ({ isDark = false }) => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
24753
24815
|
"a",
|
|
24754
24816
|
{
|
|
24755
24817
|
className: `mesh-flex mesh-max-w-fit mesh-flex-col mesh-items-center mesh-rounded-md mesh-border mesh-border-solid mesh-border-current mesh-p-1 mesh-text-xl mesh-font-semibold mesh-no-underline ${isDark ? `mesh-bg-neutral-950 mesh-text-neutral-50` : `mesh-bg-neutral-50 mesh-text-neutral-950`}`,
|
|
@@ -24761,21 +24823,21 @@ var MeshBadge = ({ isDark = false }) => /* @__PURE__ */ (0, import_jsx_runtime21
|
|
|
24761
24823
|
rel: "noopener noreferrer",
|
|
24762
24824
|
target: "_blank",
|
|
24763
24825
|
children: [
|
|
24764
|
-
/* @__PURE__ */ (0,
|
|
24826
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(MeshLogo, {}),
|
|
24765
24827
|
"Mesh"
|
|
24766
24828
|
]
|
|
24767
24829
|
}
|
|
24768
24830
|
);
|
|
24769
24831
|
|
|
24770
24832
|
// src/stake-button/index.tsx
|
|
24771
|
-
var
|
|
24833
|
+
var import_react16 = require("react");
|
|
24772
24834
|
var import_transaction = require("@meshsdk/transaction");
|
|
24773
24835
|
|
|
24774
24836
|
// src/cardano-wallet-dropdown/index.tsx
|
|
24775
|
-
var
|
|
24837
|
+
var import_react15 = require("react");
|
|
24776
24838
|
|
|
24777
24839
|
// src/common/button-dropdown.tsx
|
|
24778
|
-
var
|
|
24840
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
24779
24841
|
function ButtonDropdown({
|
|
24780
24842
|
children,
|
|
24781
24843
|
isDarkMode = false,
|
|
@@ -24784,7 +24846,7 @@ function ButtonDropdown({
|
|
|
24784
24846
|
onMouseEnter,
|
|
24785
24847
|
onMouseLeave
|
|
24786
24848
|
}) {
|
|
24787
|
-
return /* @__PURE__ */ (0,
|
|
24849
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
24788
24850
|
"button",
|
|
24789
24851
|
{
|
|
24790
24852
|
className: `mesh-mr-menu-list mesh-flex mesh-w-60 mesh-items-center mesh-justify-center mesh-rounded-t-md mesh-border mesh-px-4 mesh-py-2 mesh-text-lg mesh-font-normal mesh-shadow-sm ${isDarkMode ? `mesh-bg-neutral-950 mesh-text-neutral-50` : `mesh-bg-neutral-50 mesh-text-neutral-950`}`,
|
|
@@ -24797,21 +24859,21 @@ function ButtonDropdown({
|
|
|
24797
24859
|
}
|
|
24798
24860
|
|
|
24799
24861
|
// src/cardano-wallet-dropdown/menu-item.tsx
|
|
24800
|
-
var
|
|
24862
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
24801
24863
|
function MenuItem({
|
|
24802
24864
|
icon,
|
|
24803
24865
|
label,
|
|
24804
24866
|
action,
|
|
24805
24867
|
active
|
|
24806
24868
|
}) {
|
|
24807
|
-
return /* @__PURE__ */ (0,
|
|
24869
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
24808
24870
|
"div",
|
|
24809
24871
|
{
|
|
24810
24872
|
className: "mesh-flex mesh-cursor-pointer mesh-items-center mesh-px-4 mesh-py-2 mesh-opacity-80 hover:mesh-opacity-100 mesh-h-16",
|
|
24811
24873
|
onClick: action,
|
|
24812
24874
|
children: [
|
|
24813
|
-
icon && /* @__PURE__ */ (0,
|
|
24814
|
-
/* @__PURE__ */ (0,
|
|
24875
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("img", { className: "mesh-pr-2 mesh-m-1 mesh-h-8", src: icon }),
|
|
24876
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "mesh-mr-menu-item mesh-text-xl mesh-font-normal mesh-text-neutral-700 hover:mesh-text-black", children: label.split(" ").map((word) => {
|
|
24815
24877
|
return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase();
|
|
24816
24878
|
}).join(" ") })
|
|
24817
24879
|
]
|
|
@@ -24820,8 +24882,8 @@ function MenuItem({
|
|
|
24820
24882
|
}
|
|
24821
24883
|
|
|
24822
24884
|
// src/cardano-wallet-dropdown/chevron-down.tsx
|
|
24823
|
-
var
|
|
24824
|
-
var ChevronDown = () => /* @__PURE__ */ (0,
|
|
24885
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
24886
|
+
var ChevronDown = () => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
24825
24887
|
"svg",
|
|
24826
24888
|
{
|
|
24827
24889
|
className: "mesh-m-2 mesh-h-6",
|
|
@@ -24830,7 +24892,7 @@ var ChevronDown = () => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
|
24830
24892
|
viewBox: "0 0 24 24",
|
|
24831
24893
|
stroke: "currentColor",
|
|
24832
24894
|
xmlns: "http://www.w3.org/2000/svg",
|
|
24833
|
-
children: /* @__PURE__ */ (0,
|
|
24895
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
24834
24896
|
"path",
|
|
24835
24897
|
{
|
|
24836
24898
|
strokeLinecap: "round",
|
|
@@ -24843,7 +24905,7 @@ var ChevronDown = () => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
|
24843
24905
|
);
|
|
24844
24906
|
|
|
24845
24907
|
// src/cardano-wallet-dropdown/wallet-balance.tsx
|
|
24846
|
-
var
|
|
24908
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
24847
24909
|
var WalletBalance = ({
|
|
24848
24910
|
connected,
|
|
24849
24911
|
connecting,
|
|
@@ -24851,22 +24913,22 @@ var WalletBalance = ({
|
|
|
24851
24913
|
wallet
|
|
24852
24914
|
}) => {
|
|
24853
24915
|
const lovelace = useLovelace();
|
|
24854
|
-
return connected && lovelace && wallet?.icon ? /* @__PURE__ */ (0,
|
|
24855
|
-
/* @__PURE__ */ (0,
|
|
24916
|
+
return connected && lovelace && wallet?.icon ? /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_jsx_runtime27.Fragment, { children: [
|
|
24917
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("img", { className: "mesh-m-2 mesh-h-6", src: wallet.icon }),
|
|
24856
24918
|
"\u20B3",
|
|
24857
24919
|
" ",
|
|
24858
24920
|
parseInt((parseInt(lovelace, 10) / 1e6).toString(), 10),
|
|
24859
24921
|
".",
|
|
24860
|
-
/* @__PURE__ */ (0,
|
|
24861
|
-
] }) : connected && wallet?.icon ? /* @__PURE__ */ (0,
|
|
24922
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "mesh-text-xs", children: lovelace.substring(lovelace.length - 6) })
|
|
24923
|
+
] }) : connected && wallet?.icon ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_jsx_runtime27.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("img", { className: "mesh-m-2 mesh-h-6", src: wallet.icon }) }) : connecting ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_jsx_runtime27.Fragment, { children: "Connecting..." }) : /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_jsx_runtime27.Fragment, { children: [
|
|
24862
24924
|
label,
|
|
24863
24925
|
" ",
|
|
24864
|
-
/* @__PURE__ */ (0,
|
|
24926
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ChevronDown, {})
|
|
24865
24927
|
] });
|
|
24866
24928
|
};
|
|
24867
24929
|
|
|
24868
24930
|
// src/cardano-wallet-dropdown/index.tsx
|
|
24869
|
-
var
|
|
24931
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
24870
24932
|
var CardanoWallet2 = ({
|
|
24871
24933
|
label = "Connect Wallet",
|
|
24872
24934
|
onConnected = void 0,
|
|
@@ -24874,32 +24936,32 @@ var CardanoWallet2 = ({
|
|
|
24874
24936
|
extensions = [],
|
|
24875
24937
|
cardanoPeerConnect = void 0
|
|
24876
24938
|
}) => {
|
|
24877
|
-
const [isDarkMode, setIsDarkMode] = (0,
|
|
24878
|
-
const [hideMenuList, setHideMenuList] = (0,
|
|
24939
|
+
const [isDarkMode, setIsDarkMode] = (0, import_react15.useState)(false);
|
|
24940
|
+
const [hideMenuList, setHideMenuList] = (0, import_react15.useState)(true);
|
|
24879
24941
|
const { connect: connect2, connecting, connected, disconnect, name } = useWallet();
|
|
24880
24942
|
const wallets = useWalletList();
|
|
24881
|
-
(0,
|
|
24943
|
+
(0, import_react15.useEffect)(() => {
|
|
24882
24944
|
if (connected && onConnected) {
|
|
24883
24945
|
onConnected();
|
|
24884
24946
|
}
|
|
24885
24947
|
}, [connected]);
|
|
24886
|
-
(0,
|
|
24948
|
+
(0, import_react15.useEffect)(() => {
|
|
24887
24949
|
setIsDarkMode(isDark);
|
|
24888
24950
|
}, [isDark]);
|
|
24889
|
-
return /* @__PURE__ */ (0,
|
|
24951
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
24890
24952
|
"div",
|
|
24891
24953
|
{
|
|
24892
24954
|
onMouseEnter: () => setHideMenuList(false),
|
|
24893
24955
|
onMouseLeave: () => setHideMenuList(true),
|
|
24894
24956
|
style: { width: "min-content", zIndex: 50 },
|
|
24895
24957
|
children: [
|
|
24896
|
-
/* @__PURE__ */ (0,
|
|
24958
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
24897
24959
|
ButtonDropdown,
|
|
24898
24960
|
{
|
|
24899
24961
|
isDarkMode,
|
|
24900
24962
|
hideMenuList,
|
|
24901
24963
|
setHideMenuList,
|
|
24902
|
-
children: /* @__PURE__ */ (0,
|
|
24964
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
24903
24965
|
WalletBalance,
|
|
24904
24966
|
{
|
|
24905
24967
|
connected,
|
|
@@ -24910,12 +24972,12 @@ var CardanoWallet2 = ({
|
|
|
24910
24972
|
)
|
|
24911
24973
|
}
|
|
24912
24974
|
),
|
|
24913
|
-
/* @__PURE__ */ (0,
|
|
24975
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
24914
24976
|
"div",
|
|
24915
24977
|
{
|
|
24916
24978
|
className: `mesh-mr-menu-list mesh-absolute mesh-w-60 mesh-rounded-b-md mesh-border mesh-text-center mesh-shadow-sm mesh-backdrop-blur ${hideMenuList && "mesh-hidden"} ${isDarkMode ? `mesh-bg-neutral-950 mesh-text-neutral-50` : `mesh-bg-neutral-50 mesh-text-neutral-950`}`,
|
|
24917
24979
|
style: { zIndex: 50 },
|
|
24918
|
-
children: !connected && wallets.length > 0 ? /* @__PURE__ */ (0,
|
|
24980
|
+
children: !connected && wallets.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_jsx_runtime28.Fragment, { children: wallets.map((wallet, index) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
24919
24981
|
MenuItem,
|
|
24920
24982
|
{
|
|
24921
24983
|
icon: wallet.icon,
|
|
@@ -24927,7 +24989,7 @@ var CardanoWallet2 = ({
|
|
|
24927
24989
|
active: name === wallet.id
|
|
24928
24990
|
},
|
|
24929
24991
|
index
|
|
24930
|
-
)) }) : wallets.length === 0 ? /* @__PURE__ */ (0,
|
|
24992
|
+
)) }) : wallets.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { children: "No Wallet Found" }) : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_jsx_runtime28.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
24931
24993
|
MenuItem,
|
|
24932
24994
|
{
|
|
24933
24995
|
active: false,
|
|
@@ -24944,7 +25006,7 @@ var CardanoWallet2 = ({
|
|
|
24944
25006
|
};
|
|
24945
25007
|
|
|
24946
25008
|
// src/stake-button/index.tsx
|
|
24947
|
-
var
|
|
25009
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
24948
25010
|
var StakeButton = ({
|
|
24949
25011
|
label = "Stake your ADA",
|
|
24950
25012
|
isDark = false,
|
|
@@ -24952,19 +25014,19 @@ var StakeButton = ({
|
|
|
24952
25014
|
onCheck,
|
|
24953
25015
|
onDelegated = void 0
|
|
24954
25016
|
}) => {
|
|
24955
|
-
const [isDarkMode, setIsDarkMode] = (0,
|
|
25017
|
+
const [isDarkMode, setIsDarkMode] = (0, import_react16.useState)(false);
|
|
24956
25018
|
const { connected } = useWallet();
|
|
24957
|
-
(0,
|
|
25019
|
+
(0, import_react16.useEffect)(() => {
|
|
24958
25020
|
setIsDarkMode(isDark);
|
|
24959
25021
|
}, [isDark]);
|
|
24960
|
-
return /* @__PURE__ */ (0,
|
|
25022
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_jsx_runtime29.Fragment, { children: connected ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ButtonDropdown, { isDarkMode, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
24961
25023
|
Delegate,
|
|
24962
25024
|
{
|
|
24963
25025
|
poolId,
|
|
24964
25026
|
onCheck,
|
|
24965
25027
|
onDelegated
|
|
24966
25028
|
}
|
|
24967
|
-
) }) : /* @__PURE__ */ (0,
|
|
25029
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(CardanoWallet2, { label, isDark }) });
|
|
24968
25030
|
};
|
|
24969
25031
|
var Delegate = ({
|
|
24970
25032
|
poolId,
|
|
@@ -24973,11 +25035,11 @@ var Delegate = ({
|
|
|
24973
25035
|
}) => {
|
|
24974
25036
|
const { wallet } = useWallet();
|
|
24975
25037
|
const rewardAddress = useRewardAddress();
|
|
24976
|
-
const [_, setError] = (0,
|
|
24977
|
-
const [checking, setChecking] = (0,
|
|
24978
|
-
const [accountInfo, setAccountInfo] = (0,
|
|
24979
|
-
const [processing, setProcessing] = (0,
|
|
24980
|
-
const [done, setDone] = (0,
|
|
25038
|
+
const [_, setError] = (0, import_react16.useState)();
|
|
25039
|
+
const [checking, setChecking] = (0, import_react16.useState)(false);
|
|
25040
|
+
const [accountInfo, setAccountInfo] = (0, import_react16.useState)();
|
|
25041
|
+
const [processing, setProcessing] = (0, import_react16.useState)(false);
|
|
25042
|
+
const [done, setDone] = (0, import_react16.useState)(false);
|
|
24981
25043
|
const checkAccountStatus = async () => {
|
|
24982
25044
|
try {
|
|
24983
25045
|
setChecking(true);
|
|
@@ -25028,22 +25090,22 @@ var Delegate = ({
|
|
|
25028
25090
|
}
|
|
25029
25091
|
setProcessing(false);
|
|
25030
25092
|
};
|
|
25031
|
-
(0,
|
|
25093
|
+
(0, import_react16.useEffect)(() => {
|
|
25032
25094
|
checkAccountStatus();
|
|
25033
25095
|
}, [rewardAddress]);
|
|
25034
25096
|
if (checking) {
|
|
25035
|
-
return /* @__PURE__ */ (0,
|
|
25097
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { children: "Checking..." });
|
|
25036
25098
|
}
|
|
25037
25099
|
if (processing) {
|
|
25038
|
-
return /* @__PURE__ */ (0,
|
|
25100
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { children: "Loading..." });
|
|
25039
25101
|
}
|
|
25040
25102
|
if (done) {
|
|
25041
|
-
return /* @__PURE__ */ (0,
|
|
25103
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { children: "Stake Delegated" });
|
|
25042
25104
|
}
|
|
25043
25105
|
if (accountInfo?.active) {
|
|
25044
|
-
return accountInfo.poolId === poolId ? /* @__PURE__ */ (0,
|
|
25106
|
+
return accountInfo.poolId === poolId ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { children: "Stake Delegated" }) : /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { onClick: delegateStake, children: "Begin Staking" });
|
|
25045
25107
|
}
|
|
25046
|
-
return /* @__PURE__ */ (0,
|
|
25108
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { onClick: registerAddress, children: "Begin Staking" });
|
|
25047
25109
|
};
|
|
25048
25110
|
// Annotate the CommonJS export names for ESM import in node:
|
|
25049
25111
|
0 && (module.exports = {
|