@matchain/matchid-sdk-react 0.1.42-alpha.5 → 0.1.42-alpha.7

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.
@@ -387,7 +387,7 @@ var toBindWalletApi = ({
387
387
  };
388
388
 
389
389
  // src/MatchContext.tsx
390
- import { createContext, useContext } from "react";
390
+ import { createContext, useContext, useEffect as useEffect21 } from "react";
391
391
 
392
392
  // src/context/BusinessProvider.tsx
393
393
  import { useEffect as useEffect17 } from "react";
@@ -1880,7 +1880,10 @@ function WalletContent({
1880
1880
  try {
1881
1881
  setStatus("nonce");
1882
1882
  statusRef.current = "nonce";
1883
- const res = type == "bind" ? await getWalletInitApi({ address, type: "SOL" }) : await getWalletNonceApi({ address, type: "SOL" });
1883
+ const res = type == "bind" ? await getWalletInitApi({
1884
+ address,
1885
+ type: "SOL"
1886
+ }) : await getWalletNonceApi({ address, type: "SOL" });
1884
1887
  if (!isSuccess(res)) {
1885
1888
  throw new Error(res.message);
1886
1889
  }
@@ -1984,7 +1987,7 @@ var wallets = [
1984
1987
  new TrustWalletAdapter(),
1985
1988
  new XDEFIWalletAdapter()
1986
1989
  ];
1987
- function SOLModal({
1990
+ function SOLConnectModal({
1988
1991
  type = "login",
1989
1992
  onSuccess,
1990
1993
  ...props
@@ -1996,6 +1999,9 @@ function SOLModal({
1996
1999
  name: "SOL"
1997
2000
  }), children: /* @__PURE__ */ jsx21(ConnectionProvider, { endpoint: clusterApiUrl("devnet"), children: /* @__PURE__ */ jsx21(WalletProvider, { wallets, autoConnect: true, children: /* @__PURE__ */ jsx21(WalletModalProvider, { children: /* @__PURE__ */ jsx21(WalletContent, { onSuccess, type }) }) }) }) });
1998
2001
  }
2002
+ function SOLModal(props) {
2003
+ return props.isOpen && /* @__PURE__ */ jsx21(SOLConnectModal, { ...props });
2004
+ }
1999
2005
 
2000
2006
  // src/components/TRONModal/index.tsx
2001
2007
  import React5, { useEffect as useEffect11, useMemo as useMemo7, useState as useState15 } from "react";
@@ -2110,7 +2116,7 @@ var useTRONWallet = () => {
2110
2116
 
2111
2117
  // src/components/TRONModal/index.tsx
2112
2118
  import { jsx as jsx22, jsxs as jsxs17 } from "react/jsx-runtime";
2113
- function TRONModal({
2119
+ function TRONConnectModal({
2114
2120
  type = "login",
2115
2121
  onSuccess,
2116
2122
  ...props
@@ -2261,6 +2267,9 @@ function TRONModal({
2261
2267
  })
2262
2268
  ] }) }) });
2263
2269
  }
2270
+ function TRONModal(props) {
2271
+ return props.isOpen && /* @__PURE__ */ jsx22(TRONConnectModal, { ...props, type: "" });
2272
+ }
2264
2273
 
2265
2274
  // src/components/TONModal/index.tsx
2266
2275
  import React6, { useEffect as useEffect12, useState as useState16 } from "react";
@@ -2425,7 +2434,7 @@ function WalletContent2({
2425
2434
  }
2426
2435
  );
2427
2436
  }
2428
- function TONModal({
2437
+ function TONConnectModal({
2429
2438
  type = "login",
2430
2439
  onSuccess,
2431
2440
  ...props
@@ -2445,6 +2454,9 @@ function TONModal({
2445
2454
  }
2446
2455
  ) });
2447
2456
  }
2457
+ function TONModal(props) {
2458
+ return props.isOpen && /* @__PURE__ */ jsx23(TONConnectModal, { ...props });
2459
+ }
2448
2460
 
2449
2461
  // src/components/BTCModal/index.tsx
2450
2462
  import React7, { useEffect as useEffect14, useMemo as useMemo8, useState as useState18 } from "react";
@@ -2638,7 +2650,7 @@ var useBTCWallet = () => {
2638
2650
 
2639
2651
  // src/components/BTCModal/index.tsx
2640
2652
  import { jsx as jsx24, jsxs as jsxs18 } from "react/jsx-runtime";
2641
- function BTCModal({
2653
+ function BTCConnectModal({
2642
2654
  type = "login",
2643
2655
  onSuccess,
2644
2656
  ...props
@@ -2797,6 +2809,9 @@ function BTCModal({
2797
2809
  })
2798
2810
  ] }) }) });
2799
2811
  }
2812
+ function BTCModal(props) {
2813
+ return props.isOpen && /* @__PURE__ */ jsx24(BTCConnectModal, { ...props });
2814
+ }
2800
2815
 
2801
2816
  // src/components/CEXBindModal/index.tsx
2802
2817
  import { useEffect as useEffect15, useMemo as useMemo9, useState as useState19 } from "react";
@@ -4269,13 +4284,39 @@ var MatchProvider = ({
4269
4284
  type: "UserPasscode"
4270
4285
  }
4271
4286
  }) => {
4272
- const { loadOverview, login, endpoints: realEndPoints, locale: realLocale } = useInit({
4287
+ const { login, endpoints: realEndPoints, locale: realLocale } = useInit({
4273
4288
  theme,
4274
4289
  appid,
4275
4290
  events,
4276
4291
  endpoints,
4277
4292
  locale
4278
4293
  });
4294
+ matchlog_default.log("config", {
4295
+ appid,
4296
+ events,
4297
+ theme,
4298
+ endpoints,
4299
+ locale,
4300
+ wallet
4301
+ });
4302
+ useEffect21(() => {
4303
+ console.log("appid", appid);
4304
+ }, [appid]);
4305
+ useEffect21(() => {
4306
+ console.log("events", events);
4307
+ }, [events]);
4308
+ useEffect21(() => {
4309
+ console.log("theme", theme);
4310
+ }, [theme]);
4311
+ useEffect21(() => {
4312
+ console.log("endpoints", endpoints);
4313
+ }, [endpoints]);
4314
+ useEffect21(() => {
4315
+ console.log("locale", locale);
4316
+ }, [locale]);
4317
+ useEffect21(() => {
4318
+ console.log("wallet", wallet);
4319
+ }, [wallet]);
4279
4320
  useWalletInit({
4280
4321
  config: wallet
4281
4322
  });
@@ -4556,9 +4597,9 @@ function useUserInfo() {
4556
4597
  }
4557
4598
 
4558
4599
  // src/hooks/useMatchEvents.ts
4559
- import { useEffect as useEffect21 } from "react";
4600
+ import { useEffect as useEffect22 } from "react";
4560
4601
  function useMatchEvents(handlers) {
4561
- useEffect21(() => {
4602
+ useEffect22(() => {
4562
4603
  Object.entries(handlers).forEach(([event, handler2]) => {
4563
4604
  if (handler2) {
4564
4605
  eventManager_default.on(event, handler2);
@@ -4576,14 +4617,14 @@ function useMatchEvents(handlers) {
4576
4617
 
4577
4618
  // src/hooks/useCopyClipboard.ts
4578
4619
  import copy from "copy-to-clipboard";
4579
- import { useCallback, useEffect as useEffect22, useState as useState23 } from "react";
4620
+ import { useCallback, useEffect as useEffect23, useState as useState23 } from "react";
4580
4621
  function useCopyClipboard(timeout = 500) {
4581
4622
  const [isCopied, setIsCopied] = useState23(false);
4582
4623
  const staticCopy = useCallback((text) => {
4583
4624
  const didCopy = copy(text);
4584
4625
  setIsCopied(didCopy);
4585
4626
  }, []);
4586
- useEffect22(() => {
4627
+ useEffect23(() => {
4587
4628
  if (isCopied) {
4588
4629
  const hide = setTimeout(() => {
4589
4630
  setIsCopied(false);
@@ -4635,4 +4676,4 @@ export {
4635
4676
  MatchProvider,
4636
4677
  useMatch
4637
4678
  };
4638
- //# sourceMappingURL=chunk-GEM2V3W6.mjs.map
4679
+ //# sourceMappingURL=chunk-3IT55D2W.mjs.map