@meshsdk/react 1.7.27 → 1.7.29

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 CHANGED
@@ -3196,7 +3196,7 @@ function ConnectedButton() {
3196
3196
  }
3197
3197
  }, [connected, wallet]);
3198
3198
  return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(DropdownMenu, { children: [
3199
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(DropdownMenuTrigger, { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Button, { variant: "outline", className: "mesh-text-white", children: [
3199
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Button, { variant: "outline", className: "mesh-text-white", children: [
3200
3200
  address.slice(0, 6),
3201
3201
  "...",
3202
3202
  address.slice(-6)
@@ -3539,12 +3539,14 @@ var DAppPeerConnect = exportedCardanopeerconnect.DAppPeerConnect;
3539
3539
  // src/cardano-wallet/screen-p2p.tsx
3540
3540
  var import_jsx_runtime15 = require("react/jsx-runtime");
3541
3541
  function ScreenP2P({
3542
- cardanoPeerConnect
3542
+ cardanoPeerConnect,
3543
+ setOpen
3543
3544
  }) {
3544
3545
  const dAppConnect = (0, import_react12.useRef)(null);
3545
3546
  const qrCodeField = (0, import_react12.useRef)(null);
3546
3547
  const [address, setAddress] = (0, import_react12.useState)("");
3547
3548
  const [copied, setCopied] = (0, import_react12.useState)(false);
3549
+ const { connect } = useWallet();
3548
3550
  (0, import_react12.useEffect)(() => {
3549
3551
  if (cardanoPeerConnect) {
3550
3552
  if (dAppConnect.current === null) {
@@ -3554,20 +3556,22 @@ function ScreenP2P({
3554
3556
  url: cardanoPeerConnect.dAppInfo.url
3555
3557
  },
3556
3558
  announce: cardanoPeerConnect.announce,
3557
- onApiInject: (name, address2) => {
3558
- console.log("onApiInject", name, address2);
3559
+ onApiInject: async (name, address2) => {
3560
+ console.log(5, "onApiInject", name, address2);
3561
+ await connect(name);
3562
+ setOpen(false);
3559
3563
  },
3560
3564
  onApiEject: (name, address2) => {
3561
- console.log("onApiEject", name, address2);
3565
+ console.log(5, "onApiEject", name, address2);
3562
3566
  },
3563
3567
  onConnect: (address2, walletInfo) => {
3564
- console.log("Connected to wallet", address2, walletInfo);
3568
+ console.log(5, "Connected to wallet", address2, walletInfo);
3565
3569
  },
3566
3570
  onDisconnect: () => {
3567
- console.log("Disconnected from wallet");
3571
+ console.log(5, "Disconnected from wallet");
3568
3572
  },
3569
3573
  verifyConnection: (walletInfo, callback) => {
3570
- console.log("verifyConnection", walletInfo);
3574
+ console.log(5, "verifyConnection", walletInfo);
3571
3575
  callback(true, true);
3572
3576
  },
3573
3577
  useWalletDiscovery: true
@@ -3575,7 +3579,6 @@ function ScreenP2P({
3575
3579
  if (dAppConnect.current) {
3576
3580
  const address2 = dAppConnect.current.getAddress();
3577
3581
  setAddress(address2);
3578
- console.log("address", address2);
3579
3582
  if (qrCodeField.current !== null) {
3580
3583
  dAppConnect.current.generateQRCode(qrCodeField.current);
3581
3584
  }
@@ -3639,7 +3642,13 @@ var CardanoWallet = ({
3639
3642
  burnerWallet: burnerWallet != void 0
3640
3643
  }
3641
3644
  ),
3642
- screen == "p2p" && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ScreenP2P, { cardanoPeerConnect }),
3645
+ screen == "p2p" && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
3646
+ ScreenP2P,
3647
+ {
3648
+ cardanoPeerConnect,
3649
+ setOpen
3650
+ }
3651
+ ),
3643
3652
  screen == "burner" && burnerWallet && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
3644
3653
  ScreenBurner,
3645
3654
  {
package/dist/index.js CHANGED
@@ -3152,7 +3152,7 @@ function ConnectedButton() {
3152
3152
  }
3153
3153
  }, [connected, wallet]);
3154
3154
  return /* @__PURE__ */ jsxs3(DropdownMenu, { children: [
3155
- /* @__PURE__ */ jsx7(DropdownMenuTrigger, { children: /* @__PURE__ */ jsxs3(Button, { variant: "outline", className: "mesh-text-white", children: [
3155
+ /* @__PURE__ */ jsx7(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs3(Button, { variant: "outline", className: "mesh-text-white", children: [
3156
3156
  address.slice(0, 6),
3157
3157
  "...",
3158
3158
  address.slice(-6)
@@ -3495,12 +3495,14 @@ var DAppPeerConnect = exportedCardanopeerconnect.DAppPeerConnect;
3495
3495
  // src/cardano-wallet/screen-p2p.tsx
3496
3496
  import { jsx as jsx15, jsxs as jsxs10 } from "react/jsx-runtime";
3497
3497
  function ScreenP2P({
3498
- cardanoPeerConnect
3498
+ cardanoPeerConnect,
3499
+ setOpen
3499
3500
  }) {
3500
3501
  const dAppConnect = useRef2(null);
3501
3502
  const qrCodeField = useRef2(null);
3502
3503
  const [address, setAddress] = useState11("");
3503
3504
  const [copied, setCopied] = useState11(false);
3505
+ const { connect } = useWallet();
3504
3506
  useEffect9(() => {
3505
3507
  if (cardanoPeerConnect) {
3506
3508
  if (dAppConnect.current === null) {
@@ -3510,20 +3512,22 @@ function ScreenP2P({
3510
3512
  url: cardanoPeerConnect.dAppInfo.url
3511
3513
  },
3512
3514
  announce: cardanoPeerConnect.announce,
3513
- onApiInject: (name, address2) => {
3514
- console.log("onApiInject", name, address2);
3515
+ onApiInject: async (name, address2) => {
3516
+ console.log(5, "onApiInject", name, address2);
3517
+ await connect(name);
3518
+ setOpen(false);
3515
3519
  },
3516
3520
  onApiEject: (name, address2) => {
3517
- console.log("onApiEject", name, address2);
3521
+ console.log(5, "onApiEject", name, address2);
3518
3522
  },
3519
3523
  onConnect: (address2, walletInfo) => {
3520
- console.log("Connected to wallet", address2, walletInfo);
3524
+ console.log(5, "Connected to wallet", address2, walletInfo);
3521
3525
  },
3522
3526
  onDisconnect: () => {
3523
- console.log("Disconnected from wallet");
3527
+ console.log(5, "Disconnected from wallet");
3524
3528
  },
3525
3529
  verifyConnection: (walletInfo, callback) => {
3526
- console.log("verifyConnection", walletInfo);
3530
+ console.log(5, "verifyConnection", walletInfo);
3527
3531
  callback(true, true);
3528
3532
  },
3529
3533
  useWalletDiscovery: true
@@ -3531,7 +3535,6 @@ function ScreenP2P({
3531
3535
  if (dAppConnect.current) {
3532
3536
  const address2 = dAppConnect.current.getAddress();
3533
3537
  setAddress(address2);
3534
- console.log("address", address2);
3535
3538
  if (qrCodeField.current !== null) {
3536
3539
  dAppConnect.current.generateQRCode(qrCodeField.current);
3537
3540
  }
@@ -3595,7 +3598,13 @@ var CardanoWallet = ({
3595
3598
  burnerWallet: burnerWallet != void 0
3596
3599
  }
3597
3600
  ),
3598
- screen == "p2p" && /* @__PURE__ */ jsx16(ScreenP2P, { cardanoPeerConnect }),
3601
+ screen == "p2p" && /* @__PURE__ */ jsx16(
3602
+ ScreenP2P,
3603
+ {
3604
+ cardanoPeerConnect,
3605
+ setOpen
3606
+ }
3607
+ ),
3599
3608
  screen == "burner" && burnerWallet && /* @__PURE__ */ jsx16(
3600
3609
  ScreenBurner,
3601
3610
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meshsdk/react",
3
- "version": "1.7.27",
3
+ "version": "1.7.29",
4
4
  "description": "React component library - https://meshjs.dev/react",
5
5
  "main": "./dist/index.cjs",
6
6
  "browser": "./dist/index.js",
@@ -29,9 +29,9 @@
29
29
  },
30
30
  "dependencies": {
31
31
  "@fabianbormann/cardano-peer-connect": "^1.2.18",
32
- "@meshsdk/common": "1.7.27",
33
- "@meshsdk/transaction": "1.7.27",
34
- "@meshsdk/wallet": "1.7.27",
32
+ "@meshsdk/common": "1.7.29",
33
+ "@meshsdk/transaction": "1.7.29",
34
+ "@meshsdk/wallet": "1.7.29",
35
35
  "@radix-ui/react-dialog": "^1.1.2",
36
36
  "@radix-ui/react-dropdown-menu": "^2.1.2",
37
37
  "@radix-ui/react-icons": "^1.3.2",