@matchain/matchid-sdk-react 0.1.37-alpha.9 → 0.1.39

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.
@@ -1,4 +1,4 @@
1
- export { f as BTCModal, B as Button, E as EmailModal, F as Field, I as Input, L as LoginBox, b as LoginButton, d as LoginModal, c as LoginPanel, M as Modal, a as ModalWithHeader, e as PasswordModal, P as Popover, S as SOLModal, T as TRONModal, U as UsernameModal } from '../index-CV5LZa9w.mjs';
1
+ export { f as BTCModal, B as Button, E as EmailModal, F as Field, I as Input, L as LoginBox, b as LoginButton, d as LoginModal, c as LoginPanel, M as Modal, a as ModalWithHeader, e as PasswordModal, P as Popover, S as SOLModal, T as TRONModal, U as UsernameModal } from '../index-ClQl2MMF.mjs';
2
2
  import 'react/jsx-runtime';
3
3
  import '../types.d-IS3DBl3p.mjs';
4
4
  import 'react';
@@ -1,4 +1,4 @@
1
- export { f as BTCModal, B as Button, E as EmailModal, F as Field, I as Input, L as LoginBox, b as LoginButton, d as LoginModal, c as LoginPanel, M as Modal, a as ModalWithHeader, e as PasswordModal, P as Popover, S as SOLModal, T as TRONModal, U as UsernameModal } from '../index-yEwP0nd2.js';
1
+ export { f as BTCModal, B as Button, E as EmailModal, F as Field, I as Input, L as LoginBox, b as LoginButton, d as LoginModal, c as LoginPanel, M as Modal, a as ModalWithHeader, e as PasswordModal, P as Popover, S as SOLModal, T as TRONModal, U as UsernameModal } from '../index-CvCSpU8m.js';
2
2
  import 'react/jsx-runtime';
3
3
  import '../types.d-IS3DBl3p.js';
4
4
  import 'react';
@@ -1747,14 +1747,9 @@ function PasswordModal({
1747
1747
  return "";
1748
1748
  }, [rePassword, password]);
1749
1749
  (0, import_react6.useEffect)(() => {
1750
- if (isOpen && overview) {
1750
+ if (isOpen) {
1751
1751
  setPassword("");
1752
1752
  setRePassword("");
1753
- const did2 = overview.did.split(":")[2];
1754
- initWallet({
1755
- did: did2,
1756
- address: ""
1757
- });
1758
1753
  }
1759
1754
  }, [isOpen, overview]);
1760
1755
  const [isSubmitting, setIsSubmitting] = (0, import_react6.useState)(false);
@@ -1762,8 +1757,13 @@ function PasswordModal({
1762
1757
  if (isSubmitting) return;
1763
1758
  try {
1764
1759
  setIsSubmitting(true);
1760
+ const did2 = overview ? overview.did.split(":")[2] : "";
1761
+ await initWallet({
1762
+ did: did2,
1763
+ address: ""
1764
+ });
1765
1765
  const address = await generateWallet({
1766
- did: did.split(":")[2],
1766
+ did: did2.split(":")[2],
1767
1767
  userPasscode: password
1768
1768
  });
1769
1769
  await refreshOverview();
@@ -2273,7 +2273,7 @@ function Popover({
2273
2273
  gap = "20px"
2274
2274
  }) {
2275
2275
  const [active, setActive] = (0, import_react15.useState)(false);
2276
- return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
2276
+ return children && /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
2277
2277
  "div",
2278
2278
  {
2279
2279
  onClick: () => {
@@ -2343,9 +2343,12 @@ function LoginBox({
2343
2343
  ],
2344
2344
  methods = [
2345
2345
  "telegram",
2346
- "twitter"
2346
+ "twitter",
2347
+ "github",
2348
+ "linkedin",
2349
+ "discord"
2347
2350
  ],
2348
- walletMethods = ["evm", "sol"],
2351
+ walletMethods = ["evm", "sol", "btc", "tron"],
2349
2352
  inModal = false
2350
2353
  }) {
2351
2354
  const [emailOpen, setEmailOpen] = (0, import_react16.useState)(false);
@@ -2817,7 +2820,7 @@ function UsernameModal({
2817
2820
  }, onClick: onSubmit, size: "lg", block: true, highlight: true, children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_react_intl12.FormattedMessage, { id: "confirm" }) }),
2818
2821
  /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Button, { style: {
2819
2822
  marginTop: isDownMd ? "12px" : "24px"
2820
- }, onClick: props.onClose, size: "lg", block: true, children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_react_intl12.FormattedMessage, { id: "nextTime" }) })
2823
+ }, onClick: props.onClose, size: "lg", block: true, children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_react_intl12.FormattedMessage, { id: "cancel" }) })
2821
2824
  ] }) });
2822
2825
  }
2823
2826
 
@@ -3373,10 +3376,10 @@ var UnisatAdapter = class {
3373
3376
  window.unisat.disconnect();
3374
3377
  await this.checkChain();
3375
3378
  const accounts = await window.unisat.getAccounts();
3376
- console.log("accounts", accounts);
3379
+ matchlog_default.log("accounts", accounts);
3377
3380
  if (accounts.length === 0) {
3378
3381
  const accounts2 = await window.unisat.requestAccounts();
3379
- console.log("accounts", accounts2);
3382
+ matchlog_default.log("accounts", accounts2);
3380
3383
  if (!accounts2 || accounts2.length === 0) throw new Error("No accounts found in Unisat Wallet");
3381
3384
  return accounts2[0];
3382
3385
  }
@@ -3408,7 +3411,7 @@ var XverseAdapter = class {
3408
3411
  try {
3409
3412
  await (0, import_sats_connect.getCapabilities)({
3410
3413
  onFinish: (response) => {
3411
- console.log(response);
3414
+ matchlog_default.log(response);
3412
3415
  this.capabilities = new Set(response);
3413
3416
  resolve(true);
3414
3417
  },
@@ -3421,7 +3424,7 @@ var XverseAdapter = class {
3421
3424
  }
3422
3425
  });
3423
3426
  } catch (err) {
3424
- console.log(err);
3427
+ console.error(err);
3425
3428
  resolve(false);
3426
3429
  }
3427
3430
  });
@@ -3432,7 +3435,7 @@ var XverseAdapter = class {
3432
3435
  purposes: [import_sats_connect.AddressPurpose.Ordinals],
3433
3436
  message: "SATS Connect Demo"
3434
3437
  });
3435
- console.log("getAccounts ~ response:", response);
3438
+ matchlog_default.log("getAccounts ~ response:", response);
3436
3439
  if (response.status === "success") {
3437
3440
  const ordinalsAddressItem = response.result.find(
3438
3441
  (address) => address.purpose === import_sats_connect.AddressPurpose.Ordinals
@@ -3486,13 +3489,13 @@ var LeatherAdapter = class {
3486
3489
  async connect() {
3487
3490
  if (!await this.isInstalled()) throw new Error("Leather Wallet is not installed");
3488
3491
  const response = await window.LeatherProvider?.request("getAddresses");
3489
- console.log("Addresses:", response.result.addresses);
3492
+ matchlog_default.log("Addresses:", response.result.addresses);
3490
3493
  return response.result.addresses[0].address;
3491
3494
  }
3492
3495
  async signMessage(message) {
3493
3496
  if (!await this.isInstalled()) throw new Error("Hiro Wallet is not installed");
3494
3497
  const response = await window.LeatherProvider?.request("signMessage", { message });
3495
- console.log("response", response);
3498
+ matchlog_default.log("response", response);
3496
3499
  return response.result.signature;
3497
3500
  }
3498
3501
  };