@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.
@@ -4,7 +4,7 @@ import {
4
4
  useMatchEvents,
5
5
  useUserInfo,
6
6
  useWallet
7
- } from "../chunk-JULH2ML5.mjs";
7
+ } from "../chunk-RVAWFV2B.mjs";
8
8
  import "../chunk-6PWH7WZI.mjs";
9
9
  import "../chunk-J5LGTIGS.mjs";
10
10
  export {
@@ -18,7 +18,7 @@ declare function Button({ size, disabled, loading, children, onClick, highlight,
18
18
  declare function Modal({ children, isOpen, width, zIndex, className }: ModalProps): react_jsx_runtime.JSX.Element;
19
19
  declare function ModalWithHeader({ children, onBack, onClose, title, showBorder, showClose, ...props }: ModalWithHeaderProps): react_jsx_runtime.JSX.Element;
20
20
 
21
- declare function Popover({ children, content, position, type, className, gap }: PopoverProps): react_jsx_runtime.JSX.Element;
21
+ declare function Popover({ children, content, position, type, className, gap }: PopoverProps): false | "" | 0 | react_jsx_runtime.JSX.Element | null | undefined;
22
22
 
23
23
  declare function LoginBox({ recommendMethods, methods, walletMethods, inModal }: LoginBoxProps): react_jsx_runtime.JSX.Element;
24
24
 
@@ -18,7 +18,7 @@ declare function Button({ size, disabled, loading, children, onClick, highlight,
18
18
  declare function Modal({ children, isOpen, width, zIndex, className }: ModalProps): react_jsx_runtime.JSX.Element;
19
19
  declare function ModalWithHeader({ children, onBack, onClose, title, showBorder, showClose, ...props }: ModalWithHeaderProps): react_jsx_runtime.JSX.Element;
20
20
 
21
- declare function Popover({ children, content, position, type, className, gap }: PopoverProps): react_jsx_runtime.JSX.Element;
21
+ declare function Popover({ children, content, position, type, className, gap }: PopoverProps): false | "" | 0 | react_jsx_runtime.JSX.Element | null | undefined;
22
22
 
23
23
  declare function LoginBox({ recommendMethods, methods, walletMethods, inModal }: LoginBoxProps): react_jsx_runtime.JSX.Element;
24
24
 
@@ -28,8 +28,8 @@ declare const chooseIdentityApi: ({ identity }: {
28
28
  }) => Promise<MyResponseType<any>>;
29
29
  declare const mintPassportNftApi: () => Promise<MyResponseType<any>>;
30
30
 
31
- declare function useBindList(options?: Omit<UseQueryOptions<BindItemType[]>, 'queryKey' | 'queryFn'>): _tanstack_react_query.UseQueryResult<BindItemType[], Error>;
32
- declare function useBindInfo(options?: Omit<UseQueryOptions<BindInfoType>, 'queryKey' | 'queryFn'>): _tanstack_react_query.UseQueryResult<BindInfoType, Error>;
31
+ declare function useBindList(options?: Partial<Omit<UseQueryOptions<BindItemType[]>, 'queryKey' | 'queryFn'>>): _tanstack_react_query.UseQueryResult<BindItemType[], Error>;
32
+ declare function useBindInfo(options?: Partial<Omit<UseQueryOptions<BindInfoType>, 'queryKey' | 'queryFn'>>): _tanstack_react_query.UseQueryResult<BindInfoType, Error>;
33
33
 
34
34
  declare const bind_bindCexApi: typeof bindCexApi;
35
35
  declare const bind_unBindApi: typeof unBindApi;
@@ -40,7 +40,7 @@ declare namespace bind {
40
40
  export { bind_bindCexApi as bindCexApi, bind_unBindApi as unBindApi, bind_unBindWalletApi as unBindWalletApi, bind_useBindInfo as useBindInfo, bind_useBindList as useBindList };
41
41
  }
42
42
 
43
- declare function usePohList(options?: Omit<UseQueryOptions<PohItemType[]>, 'queryKey' | 'queryFn'>): _tanstack_react_query.UseQueryResult<PohItemType[], Error>;
43
+ declare function usePohList(options?: Partial<Omit<UseQueryOptions<PohItemType[]>, 'queryKey' | 'queryFn'>>): _tanstack_react_query.UseQueryResult<PohItemType[], Error>;
44
44
 
45
45
  declare const poh_usePohList: typeof usePohList;
46
46
  declare const poh_verifyPohApi: typeof verifyPohApi;
@@ -28,8 +28,8 @@ declare const chooseIdentityApi: ({ identity }: {
28
28
  }) => Promise<MyResponseType<any>>;
29
29
  declare const mintPassportNftApi: () => Promise<MyResponseType<any>>;
30
30
 
31
- declare function useBindList(options?: Omit<UseQueryOptions<BindItemType[]>, 'queryKey' | 'queryFn'>): _tanstack_react_query.UseQueryResult<BindItemType[], Error>;
32
- declare function useBindInfo(options?: Omit<UseQueryOptions<BindInfoType>, 'queryKey' | 'queryFn'>): _tanstack_react_query.UseQueryResult<BindInfoType, Error>;
31
+ declare function useBindList(options?: Partial<Omit<UseQueryOptions<BindItemType[]>, 'queryKey' | 'queryFn'>>): _tanstack_react_query.UseQueryResult<BindItemType[], Error>;
32
+ declare function useBindInfo(options?: Partial<Omit<UseQueryOptions<BindInfoType>, 'queryKey' | 'queryFn'>>): _tanstack_react_query.UseQueryResult<BindInfoType, Error>;
33
33
 
34
34
  declare const bind_bindCexApi: typeof bindCexApi;
35
35
  declare const bind_unBindApi: typeof unBindApi;
@@ -40,7 +40,7 @@ declare namespace bind {
40
40
  export { bind_bindCexApi as bindCexApi, bind_unBindApi as unBindApi, bind_unBindWalletApi as unBindWalletApi, bind_useBindInfo as useBindInfo, bind_useBindList as useBindList };
41
41
  }
42
42
 
43
- declare function usePohList(options?: Omit<UseQueryOptions<PohItemType[]>, 'queryKey' | 'queryFn'>): _tanstack_react_query.UseQueryResult<PohItemType[], Error>;
43
+ declare function usePohList(options?: Partial<Omit<UseQueryOptions<PohItemType[]>, 'queryKey' | 'queryFn'>>): _tanstack_react_query.UseQueryResult<PohItemType[], Error>;
44
44
 
45
45
  declare const poh_usePohList: typeof usePohList;
46
46
  declare const poh_verifyPohApi: typeof verifyPohApi;
package/dist/index.d.mts CHANGED
@@ -1,8 +1,8 @@
1
1
  import React, { ReactNode } from 'react';
2
2
  import { I as IMatchEvents, a as IEnvConfigType, L as LocaleType } from './types.d-IS3DBl3p.mjs';
3
- export { i as Components } from './index-CV5LZa9w.mjs';
3
+ export { i as Components } from './index-ClQl2MMF.mjs';
4
4
  export { i as Hooks } from './index-Dm5o2w2J.mjs';
5
- export { i as Api } from './index-DqWn6VEO.mjs';
5
+ export { i as Api } from './index-mEK7Lcps.mjs';
6
6
  export { i as Chains } from './index-DXRGMAbv.mjs';
7
7
  import 'react/jsx-runtime';
8
8
  import 'viem';
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import React, { ReactNode } from 'react';
2
2
  import { I as IMatchEvents, a as IEnvConfigType, L as LocaleType } from './types.d-IS3DBl3p.js';
3
- export { i as Components } from './index-yEwP0nd2.js';
3
+ export { i as Components } from './index-CvCSpU8m.js';
4
4
  export { i as Hooks } from './index-BPveUnst.js';
5
- export { i as Api } from './index-BKdqrCum.js';
5
+ export { i as Api } from './index-DlrDrTMk.js';
6
6
  export { i as Chains } from './index-DXRGMAbv.js';
7
7
  import 'react/jsx-runtime';
8
8
  import 'viem';
package/dist/index.js CHANGED
@@ -2037,14 +2037,9 @@ function PasswordModal({
2037
2037
  return "";
2038
2038
  }, [rePassword, password]);
2039
2039
  (0, import_react6.useEffect)(() => {
2040
- if (isOpen && overview) {
2040
+ if (isOpen) {
2041
2041
  setPassword("");
2042
2042
  setRePassword("");
2043
- const did2 = overview.did.split(":")[2];
2044
- initWallet({
2045
- did: did2,
2046
- address: ""
2047
- });
2048
2043
  }
2049
2044
  }, [isOpen, overview]);
2050
2045
  const [isSubmitting, setIsSubmitting] = (0, import_react6.useState)(false);
@@ -2052,8 +2047,13 @@ function PasswordModal({
2052
2047
  if (isSubmitting) return;
2053
2048
  try {
2054
2049
  setIsSubmitting(true);
2050
+ const did2 = overview ? overview.did.split(":")[2] : "";
2051
+ await initWallet({
2052
+ did: did2,
2053
+ address: ""
2054
+ });
2055
2055
  const address = await generateWallet({
2056
- did: did.split(":")[2],
2056
+ did: did2.split(":")[2],
2057
2057
  userPasscode: password
2058
2058
  });
2059
2059
  await refreshOverview();
@@ -2139,11 +2139,6 @@ function RecoveryModal({
2139
2139
  (0, import_react7.useEffect)(() => {
2140
2140
  if (isOpen && overview) {
2141
2141
  setPassword("");
2142
- const did = overview.did.split(":")[2];
2143
- initWallet({
2144
- did,
2145
- address: overview.address
2146
- });
2147
2142
  }
2148
2143
  }, [isOpen, overview]);
2149
2144
  const [isSubmitting, setIsSubmitting] = (0, import_react7.useState)(false);
@@ -2151,6 +2146,11 @@ function RecoveryModal({
2151
2146
  if (isSubmitting) return;
2152
2147
  try {
2153
2148
  setIsSubmitting(true);
2149
+ const did = overview ? overview.did.split(":")[2] : "";
2150
+ await initWallet({
2151
+ did,
2152
+ address: overview?.address || ""
2153
+ });
2154
2154
  await recoveryWallet("ethereum", "user_passcode_recovery_key", password);
2155
2155
  await refreshOverview();
2156
2156
  onSuccess && onSuccess();
@@ -2432,7 +2432,7 @@ function Popover({
2432
2432
  gap = "20px"
2433
2433
  }) {
2434
2434
  const [active, setActive] = (0, import_react11.useState)(false);
2435
- return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
2435
+ return children && /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
2436
2436
  "div",
2437
2437
  {
2438
2438
  onClick: () => {
@@ -2502,9 +2502,12 @@ function LoginBox({
2502
2502
  ],
2503
2503
  methods = [
2504
2504
  "telegram",
2505
- "twitter"
2505
+ "twitter",
2506
+ "github",
2507
+ "linkedin",
2508
+ "discord"
2506
2509
  ],
2507
- walletMethods = ["evm", "sol"],
2510
+ walletMethods = ["evm", "sol", "btc", "tron"],
2508
2511
  inModal = false
2509
2512
  }) {
2510
2513
  const [emailOpen, setEmailOpen] = (0, import_react12.useState)(false);
@@ -2976,7 +2979,7 @@ function UsernameModal({
2976
2979
  }, onClick: onSubmit, size: "lg", block: true, highlight: true, children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_react_intl10.FormattedMessage, { id: "confirm" }) }),
2977
2980
  /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Button, { style: {
2978
2981
  marginTop: isDownMd ? "12px" : "24px"
2979
- }, onClick: props.onClose, size: "lg", block: true, children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_react_intl10.FormattedMessage, { id: "nextTime" }) })
2982
+ }, onClick: props.onClose, size: "lg", block: true, children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_react_intl10.FormattedMessage, { id: "cancel" }) })
2980
2983
  ] }) });
2981
2984
  }
2982
2985
 
@@ -3532,10 +3535,10 @@ var UnisatAdapter = class {
3532
3535
  window.unisat.disconnect();
3533
3536
  await this.checkChain();
3534
3537
  const accounts = await window.unisat.getAccounts();
3535
- console.log("accounts", accounts);
3538
+ matchlog_default.log("accounts", accounts);
3536
3539
  if (accounts.length === 0) {
3537
3540
  const accounts2 = await window.unisat.requestAccounts();
3538
- console.log("accounts", accounts2);
3541
+ matchlog_default.log("accounts", accounts2);
3539
3542
  if (!accounts2 || accounts2.length === 0) throw new Error("No accounts found in Unisat Wallet");
3540
3543
  return accounts2[0];
3541
3544
  }
@@ -3567,7 +3570,7 @@ var XverseAdapter = class {
3567
3570
  try {
3568
3571
  await (0, import_sats_connect.getCapabilities)({
3569
3572
  onFinish: (response) => {
3570
- console.log(response);
3573
+ matchlog_default.log(response);
3571
3574
  this.capabilities = new Set(response);
3572
3575
  resolve(true);
3573
3576
  },
@@ -3580,7 +3583,7 @@ var XverseAdapter = class {
3580
3583
  }
3581
3584
  });
3582
3585
  } catch (err) {
3583
- console.log(err);
3586
+ console.error(err);
3584
3587
  resolve(false);
3585
3588
  }
3586
3589
  });
@@ -3591,7 +3594,7 @@ var XverseAdapter = class {
3591
3594
  purposes: [import_sats_connect.AddressPurpose.Ordinals],
3592
3595
  message: "SATS Connect Demo"
3593
3596
  });
3594
- console.log("getAccounts ~ response:", response);
3597
+ matchlog_default.log("getAccounts ~ response:", response);
3595
3598
  if (response.status === "success") {
3596
3599
  const ordinalsAddressItem = response.result.find(
3597
3600
  (address) => address.purpose === import_sats_connect.AddressPurpose.Ordinals
@@ -3645,13 +3648,13 @@ var LeatherAdapter = class {
3645
3648
  async connect() {
3646
3649
  if (!await this.isInstalled()) throw new Error("Leather Wallet is not installed");
3647
3650
  const response = await window.LeatherProvider?.request("getAddresses");
3648
- console.log("Addresses:", response.result.addresses);
3651
+ matchlog_default.log("Addresses:", response.result.addresses);
3649
3652
  return response.result.addresses[0].address;
3650
3653
  }
3651
3654
  async signMessage(message) {
3652
3655
  if (!await this.isInstalled()) throw new Error("Hiro Wallet is not installed");
3653
3656
  const response = await window.LeatherProvider?.request("signMessage", { message });
3654
- console.log("response", response);
3657
+ matchlog_default.log("response", response);
3655
3658
  return response.result.signature;
3656
3659
  }
3657
3660
  };
@@ -4336,7 +4339,8 @@ var en_default = {
4336
4339
  CEXBindTips3: "3. Only one API can be bound to the same exchange at the same time.",
4337
4340
  CEXBindApiKey: "API Key",
4338
4341
  CEXBindApiSecretKey: "API Secret Key",
4339
- CEXBindApiPassphrase: "API Passphrase"
4342
+ CEXBindApiPassphrase: "API Passphrase",
4343
+ cancel: "Cancel"
4340
4344
  };
4341
4345
 
4342
4346
  // src/i18n/zh.json
@@ -4386,7 +4390,8 @@ var zh_default = {
4386
4390
  CEXBindTips3: "3. \u540C\u4E00\u65F6\u95F4\u53EA\u80FD\u7ED1\u5B9A\u4E00\u4E2A API \u5230\u76F8\u540C\u7684\u4EA4\u6613\u6240\u3002",
4387
4391
  CEXBindApiKey: "API \u5BC6\u94A5",
4388
4392
  CEXBindApiSecretKey: "API \u79D8\u94A5",
4389
- CEXBindApiPassphrase: "API \u5BC6\u7801\u77ED\u8BED"
4393
+ CEXBindApiPassphrase: "API \u5BC6\u7801\u77ED\u8BED",
4394
+ cancel: "\u53D6\u6D88"
4390
4395
  };
4391
4396
 
4392
4397
  // src/i18n/tw.json
@@ -4436,7 +4441,8 @@ var tw_default = {
4436
4441
  CEXBindTips3: "3. \u540C\u4E00\u6642\u9593\u53EA\u80FD\u7D81\u5B9A\u4E00\u500B API \u5230\u76F8\u540C\u7684\u4EA4\u6613\u6240\u3002",
4437
4442
  CEXBindApiKey: "API \u91D1\u9470",
4438
4443
  CEXBindApiSecretKey: "API \u5BC6\u9470",
4439
- CEXBindApiPassphrase: "API \u5BC6\u78BC\u77ED\u8A9E"
4444
+ CEXBindApiPassphrase: "API \u5BC6\u78BC\u77ED\u8A9E",
4445
+ cancel: "\u53D6\u6D88"
4440
4446
  };
4441
4447
 
4442
4448
  // src/i18n/fr.json
@@ -4486,7 +4492,8 @@ var fr_default = {
4486
4492
  CEXBindTips3: "3. Une seule API peut \xEAtre li\xE9e au m\xEAme \xE9change \xE0 la fois.",
4487
4493
  CEXBindApiKey: "Cl\xE9 API",
4488
4494
  CEXBindApiSecretKey: "Cl\xE9 Secr\xE8te API",
4489
- CEXBindApiPassphrase: "Phrase secr\xE8te API"
4495
+ CEXBindApiPassphrase: "Phrase secr\xE8te API",
4496
+ cancel: "Annuler"
4490
4497
  };
4491
4498
 
4492
4499
  // src/i18n/ja.json
@@ -4536,7 +4543,8 @@ var ja_default = {
4536
4543
  CEXBindTips3: "3. \u540C\u3058\u53D6\u5F15\u6240\u306B\u540C\u6642\u306B\u30D0\u30A4\u30F3\u30C9\u3067\u304D\u308B API \u306F1\u3064\u3060\u3051\u3067\u3059\u3002",
4537
4544
  CEXBindApiKey: "API \u30AD\u30FC",
4538
4545
  CEXBindApiSecretKey: "API \u30B7\u30FC\u30AF\u30EC\u30C3\u30C8\u30AD\u30FC",
4539
- CEXBindApiPassphrase: "API \u30D1\u30B9\u30D5\u30EC\u30FC\u30BA"
4546
+ CEXBindApiPassphrase: "API \u30D1\u30B9\u30D5\u30EC\u30FC\u30BA",
4547
+ cancel: "\u30AD\u30E3\u30F3\u30BB\u30EB"
4540
4548
  };
4541
4549
 
4542
4550
  // src/i18n/ko.json
@@ -4586,7 +4594,8 @@ var ko_default = {
4586
4594
  CEXBindTips3: "3. \uB3D9\uC77C\uD55C \uAC70\uB798\uC18C\uC5D0 \uB3D9\uC2DC\uC5D0 \uC5F0\uACB0\uD560 \uC218 \uC788\uB294 API\uB294 \uD558\uB098\uBFD0\uC785\uB2C8\uB2E4.",
4587
4595
  CEXBindApiKey: "API \uD0A4",
4588
4596
  CEXBindApiSecretKey: "API \uBE44\uBC00 \uD0A4",
4589
- CEXBindApiPassphrase: "API \uC554\uD638 \uAD6C\uBB38"
4597
+ CEXBindApiPassphrase: "API \uC554\uD638 \uAD6C\uBB38",
4598
+ cancel: "\uCDE8\uC18C"
4590
4599
  };
4591
4600
 
4592
4601
  // src/i18n/vi.json
@@ -4636,7 +4645,8 @@ var vi_default = {
4636
4645
  CEXBindTips3: "3. Ch\u1EC9 c\xF3 th\u1EC3 li\xEAn k\u1EBFt m\u1ED9t API v\u1EDBi c\xF9ng m\u1ED9t s\xE0n giao d\u1ECBch t\u1EA1i m\u1ED9t th\u1EDDi \u0111i\u1EC3m.",
4637
4646
  CEXBindApiKey: "Kh\xF3a API",
4638
4647
  CEXBindApiSecretKey: "Kh\xF3a b\xED m\u1EADt API",
4639
- CEXBindApiPassphrase: "C\u1EE5m m\u1EADt kh\u1EA9u API"
4648
+ CEXBindApiPassphrase: "C\u1EE5m m\u1EADt kh\u1EA9u API",
4649
+ cancel: "H\u1EE7y"
4640
4650
  };
4641
4651
 
4642
4652
  // src/i18n/es.json
@@ -4686,7 +4696,8 @@ var es_default = {
4686
4696
  CEXBindTips3: "3. Solo se puede vincular una API al mismo intercambio a la vez.",
4687
4697
  CEXBindApiKey: "Clave API",
4688
4698
  CEXBindApiSecretKey: "Clave Secreta API",
4689
- CEXBindApiPassphrase: "Frase de contrase\xF1a API"
4699
+ CEXBindApiPassphrase: "Frase de contrase\xF1a API",
4700
+ cancel: "Cancelar"
4690
4701
  };
4691
4702
 
4692
4703
  // src/i18n/pt.json
@@ -4736,7 +4747,8 @@ var pt_default = {
4736
4747
  CEXBindTips3: "3. Apenas uma API pode ser vinculada ao mesmo c\xE2mbio ao mesmo tempo.",
4737
4748
  CEXBindApiKey: "Chave API",
4738
4749
  CEXBindApiSecretKey: "Chave Secreta API",
4739
- CEXBindApiPassphrase: "Senha de API"
4750
+ CEXBindApiPassphrase: "Senha de API",
4751
+ cancel: "Cancelar"
4740
4752
  };
4741
4753
 
4742
4754
  // src/i18n/index.ts