@matchain/matchid-sdk-react 0.1.44-alpha.2 → 0.1.44-alpha.3

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.
Files changed (40) hide show
  1. package/dist/assets/icon/index.d.mts +1 -1
  2. package/dist/assets/icon/index.d.ts +1 -1
  3. package/dist/{chunk-Z3USECNP.mjs → chunk-7PMDBILL.mjs} +2 -2
  4. package/dist/{chunk-7P4NHPH5.mjs → chunk-YYO4X2NB.mjs} +56 -10
  5. package/dist/chunk-YYO4X2NB.mjs.map +1 -0
  6. package/dist/components/index.d.mts +2 -2
  7. package/dist/components/index.d.ts +2 -2
  8. package/dist/components/index.js +52 -6
  9. package/dist/components/index.js.map +1 -1
  10. package/dist/components/index.mjs +1 -1
  11. package/dist/hooks/api/index.d.mts +2 -2
  12. package/dist/hooks/api/index.d.ts +2 -2
  13. package/dist/hooks/api/index.js +52 -6
  14. package/dist/hooks/api/index.js.map +1 -1
  15. package/dist/hooks/api/index.mjs +2 -2
  16. package/dist/hooks/index.d.mts +2 -2
  17. package/dist/hooks/index.d.ts +2 -2
  18. package/dist/hooks/index.js +50 -4
  19. package/dist/hooks/index.js.map +1 -1
  20. package/dist/hooks/index.mjs +1 -1
  21. package/dist/{index-Ca9nh_8s.d.ts → index-BQDL8XkC.d.ts} +1 -1
  22. package/dist/{index-DlhAHm_s.d.mts → index-C1NfMaCm.d.mts} +1 -1
  23. package/dist/{index-q5XDobUF.d.mts → index-DAj3aVo6.d.mts} +1 -1
  24. package/dist/{index-Bluim2ZP.d.mts → index-DnK10Gz7.d.mts} +1 -1
  25. package/dist/{index-BxS06a5O.d.ts → index-DzVjb4K-.d.ts} +1 -1
  26. package/dist/{index-DFZpfAfc.d.mts → index-Rb-jdkzE.d.mts} +1 -1
  27. package/dist/{index-EqksEEto.d.ts → index-ivTptZeo.d.ts} +1 -1
  28. package/dist/{index-CLvQH5gM.d.ts → index-x432SkFJ.d.ts} +1 -1
  29. package/dist/index.d.mts +5 -5
  30. package/dist/index.d.ts +5 -5
  31. package/dist/index.js +55 -9
  32. package/dist/index.js.map +1 -1
  33. package/dist/index.mjs +5 -5
  34. package/dist/types/index.d.mts +1 -1
  35. package/dist/types/index.d.ts +1 -1
  36. package/dist/{types-CVwZEgQ0.d.mts → types-E2MeOwmE.d.mts} +1 -1
  37. package/dist/{types-CVwZEgQ0.d.ts → types-E2MeOwmE.d.ts} +1 -1
  38. package/package.json +2 -1
  39. package/dist/chunk-7P4NHPH5.mjs.map +0 -1
  40. /package/dist/{chunk-Z3USECNP.mjs.map → chunk-7PMDBILL.mjs.map} +0 -0
@@ -4,7 +4,7 @@ import {
4
4
  useMatchEvents,
5
5
  useUserInfo,
6
6
  useWallet
7
- } from "../chunk-7P4NHPH5.mjs";
7
+ } from "../chunk-YYO4X2NB.mjs";
8
8
  import "../chunk-SQIJR7RA.mjs";
9
9
  import "../chunk-DPXMCLYK.mjs";
10
10
  import "../chunk-J5LGTIGS.mjs";
@@ -1,6 +1,6 @@
1
1
  import * as _tanstack_react_query from '@tanstack/react-query';
2
2
  import { UseQueryOptions } from '@tanstack/react-query/src/types';
3
- import { v as PohZkpassParams, n as BindItemType, m as BindInfoType, u as PohItemType } from './types-CVwZEgQ0.js';
3
+ import { v as PohZkpassParams, n as BindItemType, m as BindInfoType, u as PohItemType } from './types-E2MeOwmE.js';
4
4
 
5
5
  interface MyResponseType<T> {
6
6
  code: number;
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { E as EmailModalProps, b as InputProps, B as ButtonProps, M as ModalProps, c as ModalWithHeaderProps, P as PopoverProps, d as LoginBoxProps, O as OtherLoginMethodType, R as RecommendLoginMethodType, e as WalletType, f as PopoverPositionType, g as PopoverTypeType, h as LoginPanelProps, i as LoginModalProps } from './types-CVwZEgQ0.mjs';
2
+ import { E as EmailModalProps, d as InputProps, B as ButtonProps, M as ModalProps, e as ModalWithHeaderProps, P as PopoverProps, f as LoginBoxProps, g as OtherLoginMethodType, R as RecommendLoginMethodType, h as WalletType, i as PopoverPositionType, j as PopoverTypeType, k as LoginPanelProps, l as LoginModalProps } from './types-E2MeOwmE.mjs';
3
3
  import { ReactNode, PropsWithChildren } from 'react';
4
4
  import { C as ChainType, R as RecoveryType } from './mpc-CTbBWHld.mjs';
5
5
 
@@ -1,5 +1,5 @@
1
1
  import { A as AuthParams, C as ChainType, E as EmbeddedWalletsParams, R as RecoveryType } from './mpc-CTbBWHld.mjs';
2
- import { A as AnyObject, m as BindInfoType, n as BindItemType, o as BindWalletParam, B as ButtonProps, C as CEXType, D as DeepPartial, p as DrawerProps, E as EmailModalProps, a as IEnvConfigType, q as IEnvName, r as ILoginWalletReq, I as IMatchEvents, j as ISocialLoginMethod, s as IconProps, b as InputProps, L as LocaleType, d as LoginBoxProps, l as LoginMethodType, i as LoginModalProps, h as LoginPanelProps, t as MessageType, M as ModalProps, c as ModalWithHeaderProps, O as OtherLoginMethodType, k as OverviewInfo, u as PohItemType, v as PohZkpassParams, f as PopoverPositionType, P as PopoverProps, g as PopoverTypeType, R as RecommendLoginMethodType, T as ThemeType, U as UserPopoverProps, W as WalletConfigType, w as WalletPanelProps, x as WalletReceiveMessageType, e as WalletType } from './types-CVwZEgQ0.mjs';
2
+ import { A as AnyObject, m as BindInfoType, n as BindItemType, o as BindWalletParam, B as ButtonProps, C as CEXType, D as DeepPartial, p as DrawerProps, E as EmailModalProps, a as IEnvConfigType, q as IEnvName, r as ILoginWalletReq, I as IMatchEvents, b as ISocialLoginMethod, s as IconProps, d as InputProps, L as LocaleType, f as LoginBoxProps, c as LoginMethodType, l as LoginModalProps, k as LoginPanelProps, t as MessageType, M as ModalProps, e as ModalWithHeaderProps, g as OtherLoginMethodType, O as OverviewInfo, u as PohItemType, v as PohZkpassParams, i as PopoverPositionType, P as PopoverProps, j as PopoverTypeType, R as RecommendLoginMethodType, T as ThemeType, U as UserPopoverProps, W as WalletConfigType, w as WalletPanelProps, x as WalletReceiveMessageType, h as WalletType } from './types-E2MeOwmE.mjs';
3
3
 
4
4
  declare const index_AnyObject: typeof AnyObject;
5
5
  declare const index_AuthParams: typeof AuthParams;
@@ -1,4 +1,4 @@
1
- import { j as ISocialLoginMethod, k as OverviewInfo, C as CEXType, l as LoginMethodType, I as IMatchEvents } from './types-CVwZEgQ0.mjs';
1
+ import { b as ISocialLoginMethod, O as OverviewInfo, C as CEXType, c as LoginMethodType, I as IMatchEvents } from './types-E2MeOwmE.mjs';
2
2
  import * as viem from 'viem';
3
3
  import { Account, WalletClientConfig, createWalletClient, SignableMessage, Hex, TransactionSerializable, DeployContractParameters, SendTransactionParameters, WriteContractParameters, Chain } from 'viem';
4
4
  import { C as ChainType, R as RecoveryType } from './mpc-CTbBWHld.mjs';
@@ -1,5 +1,5 @@
1
1
  import { A as AuthParams, C as ChainType, E as EmbeddedWalletsParams, R as RecoveryType } from './mpc-CTbBWHld.js';
2
- import { A as AnyObject, m as BindInfoType, n as BindItemType, o as BindWalletParam, B as ButtonProps, C as CEXType, D as DeepPartial, p as DrawerProps, E as EmailModalProps, a as IEnvConfigType, q as IEnvName, r as ILoginWalletReq, I as IMatchEvents, j as ISocialLoginMethod, s as IconProps, b as InputProps, L as LocaleType, d as LoginBoxProps, l as LoginMethodType, i as LoginModalProps, h as LoginPanelProps, t as MessageType, M as ModalProps, c as ModalWithHeaderProps, O as OtherLoginMethodType, k as OverviewInfo, u as PohItemType, v as PohZkpassParams, f as PopoverPositionType, P as PopoverProps, g as PopoverTypeType, R as RecommendLoginMethodType, T as ThemeType, U as UserPopoverProps, W as WalletConfigType, w as WalletPanelProps, x as WalletReceiveMessageType, e as WalletType } from './types-CVwZEgQ0.js';
2
+ import { A as AnyObject, m as BindInfoType, n as BindItemType, o as BindWalletParam, B as ButtonProps, C as CEXType, D as DeepPartial, p as DrawerProps, E as EmailModalProps, a as IEnvConfigType, q as IEnvName, r as ILoginWalletReq, I as IMatchEvents, b as ISocialLoginMethod, s as IconProps, d as InputProps, L as LocaleType, f as LoginBoxProps, c as LoginMethodType, l as LoginModalProps, k as LoginPanelProps, t as MessageType, M as ModalProps, e as ModalWithHeaderProps, g as OtherLoginMethodType, O as OverviewInfo, u as PohItemType, v as PohZkpassParams, i as PopoverPositionType, P as PopoverProps, j as PopoverTypeType, R as RecommendLoginMethodType, T as ThemeType, U as UserPopoverProps, W as WalletConfigType, w as WalletPanelProps, x as WalletReceiveMessageType, h as WalletType } from './types-E2MeOwmE.js';
3
3
 
4
4
  declare const index_AnyObject: typeof AnyObject;
5
5
  declare const index_AuthParams: typeof AuthParams;
@@ -1,6 +1,6 @@
1
1
  import * as _tanstack_react_query from '@tanstack/react-query';
2
2
  import { UseQueryOptions } from '@tanstack/react-query/src/types';
3
- import { v as PohZkpassParams, n as BindItemType, m as BindInfoType, u as PohItemType } from './types-CVwZEgQ0.mjs';
3
+ import { v as PohZkpassParams, n as BindItemType, m as BindInfoType, u as PohItemType } from './types-E2MeOwmE.mjs';
4
4
 
5
5
  interface MyResponseType<T> {
6
6
  code: number;
@@ -1,4 +1,4 @@
1
- import { j as ISocialLoginMethod, k as OverviewInfo, C as CEXType, l as LoginMethodType, I as IMatchEvents } from './types-CVwZEgQ0.js';
1
+ import { b as ISocialLoginMethod, O as OverviewInfo, C as CEXType, c as LoginMethodType, I as IMatchEvents } from './types-E2MeOwmE.js';
2
2
  import * as viem from 'viem';
3
3
  import { Account, WalletClientConfig, createWalletClient, SignableMessage, Hex, TransactionSerializable, DeployContractParameters, SendTransactionParameters, WriteContractParameters, Chain } from 'viem';
4
4
  import { C as ChainType, R as RecoveryType } from './mpc-CTbBWHld.js';
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { E as EmailModalProps, b as InputProps, B as ButtonProps, M as ModalProps, c as ModalWithHeaderProps, P as PopoverProps, d as LoginBoxProps, O as OtherLoginMethodType, R as RecommendLoginMethodType, e as WalletType, f as PopoverPositionType, g as PopoverTypeType, h as LoginPanelProps, i as LoginModalProps } from './types-CVwZEgQ0.js';
2
+ import { E as EmailModalProps, d as InputProps, B as ButtonProps, M as ModalProps, e as ModalWithHeaderProps, P as PopoverProps, f as LoginBoxProps, g as OtherLoginMethodType, R as RecommendLoginMethodType, h as WalletType, i as PopoverPositionType, j as PopoverTypeType, k as LoginPanelProps, l as LoginModalProps } from './types-E2MeOwmE.js';
3
3
  import { ReactNode, PropsWithChildren } from 'react';
4
4
  import { C as ChainType, R as RecoveryType } from './mpc-CTbBWHld.js';
5
5
 
package/dist/index.d.mts CHANGED
@@ -1,10 +1,10 @@
1
1
  import React, { ReactNode } from 'react';
2
- import { I as IMatchEvents, a as IEnvConfigType, L as LocaleType, W as WalletConfigType } from './types-CVwZEgQ0.mjs';
3
- export { i as Components } from './index-DlhAHm_s.mjs';
4
- export { i as Hooks } from './index-Bluim2ZP.mjs';
5
- export { i as Api } from './index-DFZpfAfc.mjs';
2
+ import { I as IMatchEvents, a as IEnvConfigType, L as LocaleType, W as WalletConfigType } from './types-E2MeOwmE.mjs';
3
+ export { i as Components } from './index-C1NfMaCm.mjs';
4
+ export { i as Hooks } from './index-DnK10Gz7.mjs';
5
+ export { i as Api } from './index-Rb-jdkzE.mjs';
6
6
  export { i as Chains } from './index-DXRGMAbv.mjs';
7
- export { i as Types } from './index-q5XDobUF.mjs';
7
+ export { i as Types } from './index-DAj3aVo6.mjs';
8
8
  import 'react/jsx-runtime';
9
9
  import './mpc-CTbBWHld.mjs';
10
10
  import 'viem';
package/dist/index.d.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  import React, { ReactNode } from 'react';
2
- import { I as IMatchEvents, a as IEnvConfigType, L as LocaleType, W as WalletConfigType } from './types-CVwZEgQ0.js';
3
- export { i as Components } from './index-CLvQH5gM.js';
4
- export { i as Hooks } from './index-EqksEEto.js';
5
- export { i as Api } from './index-Ca9nh_8s.js';
2
+ import { I as IMatchEvents, a as IEnvConfigType, L as LocaleType, W as WalletConfigType } from './types-E2MeOwmE.js';
3
+ export { i as Components } from './index-x432SkFJ.js';
4
+ export { i as Hooks } from './index-ivTptZeo.js';
5
+ export { i as Api } from './index-BQDL8XkC.js';
6
6
  export { i as Chains } from './index-DXRGMAbv.js';
7
- export { i as Types } from './index-BxS06a5O.js';
7
+ export { i as Types } from './index-DzVjb4K-.js';
8
8
  import 'react/jsx-runtime';
9
9
  import './mpc-CTbBWHld.js';
10
10
  import 'viem';
package/dist/index.js CHANGED
@@ -1420,6 +1420,7 @@ var matchlog = new Proxy(console, handler);
1420
1420
  var matchlog_default = matchlog;
1421
1421
 
1422
1422
  // src/api/request.ts
1423
+ var import_axios_retry = __toESM(require("axios-retry"));
1423
1424
  var SUCCESS_CODE = 0;
1424
1425
  var isSuccess = (res) => {
1425
1426
  return res.code === SUCCESS_CODE;
@@ -1461,6 +1462,51 @@ var request = async (config) => {
1461
1462
  };
1462
1463
  }
1463
1464
  };
1465
+ var retryInstance = import_axios.default.create({
1466
+ timeout: 6e4,
1467
+ validateStatus(status) {
1468
+ return status >= 200 && status <= 500;
1469
+ }
1470
+ });
1471
+ (0, import_axios_retry.default)(retryInstance, {
1472
+ retries: 3,
1473
+ retryDelay: (retryCount) => retryCount * 1e3,
1474
+ shouldResetTimeout: true,
1475
+ retryCondition: (error) => {
1476
+ return error.response.status >= 500 && error.response.status < 600 || error.code === "ECONNABORTED";
1477
+ }
1478
+ });
1479
+ var retryRequest = async (config) => {
1480
+ try {
1481
+ const endpoints = getEndpoints();
1482
+ const token = getToken();
1483
+ instance.defaults.baseURL = `${endpoints.back}`;
1484
+ instance.defaults.headers.common["Appid"] = getAppid();
1485
+ if (token) {
1486
+ instance.defaults.headers.common["Authorization"] = token;
1487
+ }
1488
+ instance.defaults.headers.common["Accept-Language"] = getLocale();
1489
+ const { data } = await instance.request(config);
1490
+ matchlog_default.log("api", data);
1491
+ if (data.code == 401001) {
1492
+ localStore.getState().logout();
1493
+ throw new Error("Your session has expired, please log in again");
1494
+ }
1495
+ return data;
1496
+ } catch (err) {
1497
+ console.error("qwe-err", err);
1498
+ const message = "Request Error";
1499
+ console.error(message);
1500
+ return {
1501
+ code: -1,
1502
+ data: null,
1503
+ message,
1504
+ success: false,
1505
+ fail: true,
1506
+ result: null
1507
+ };
1508
+ }
1509
+ };
1464
1510
  var request_default = request;
1465
1511
 
1466
1512
  // src/api/index.ts
@@ -1479,13 +1525,13 @@ var verifyEmailCodeApi = ({ email, verification_key, verification_code }) => {
1479
1525
  });
1480
1526
  };
1481
1527
  var getOverviewInfoApi = () => {
1482
- return request_default({
1528
+ return retryRequest({
1483
1529
  url: `/api/v1/user/overview`,
1484
1530
  method: "GET"
1485
1531
  });
1486
1532
  };
1487
1533
  var toLogoutApi = () => {
1488
- return request_default({
1534
+ return retryRequest({
1489
1535
  url: `/api/v1/user/logout`,
1490
1536
  method: "POST"
1491
1537
  });
@@ -1498,19 +1544,19 @@ var setUserNameApi = (data) => {
1498
1544
  });
1499
1545
  };
1500
1546
  var getBindListApi = () => {
1501
- return request_default({
1547
+ return retryRequest({
1502
1548
  url: `/api/v1/bind/list`,
1503
1549
  method: "GET"
1504
1550
  });
1505
1551
  };
1506
1552
  var getPohListApi = () => {
1507
- return request_default({
1553
+ return retryRequest({
1508
1554
  url: `/api/v1/poh/list`,
1509
1555
  method: "GET"
1510
1556
  });
1511
1557
  };
1512
1558
  var getBindInfoApi = () => {
1513
- return request_default({
1559
+ return retryRequest({
1514
1560
  url: `/api/v1/bind`,
1515
1561
  method: "GET"
1516
1562
  });
@@ -1577,13 +1623,13 @@ var mintPassportNftApi = () => {
1577
1623
  });
1578
1624
  };
1579
1625
  var getAuthInfoApi = () => {
1580
- return request_default({
1626
+ return retryRequest({
1581
1627
  url: `/api/v1/user/auth`,
1582
1628
  method: "GET"
1583
1629
  });
1584
1630
  };
1585
1631
  var getWalletNonceApi = (data) => {
1586
- return request_default({
1632
+ return retryRequest({
1587
1633
  url: `/api/v1/login/wallet/init`,
1588
1634
  method: "POST",
1589
1635
  data
@@ -1604,7 +1650,7 @@ var loginByWalletApi = ({
1604
1650
  });
1605
1651
  };
1606
1652
  var getWalletInitApi = (data) => {
1607
- return request_default({
1653
+ return retryRequest({
1608
1654
  url: `/api/v1/wallet/init`,
1609
1655
  method: "POST",
1610
1656
  data
@@ -2243,7 +2289,7 @@ function useWallet() {
2243
2289
  }) : void 0;
2244
2290
  }, [address]);
2245
2291
  (0, import_react6.useEffect)(() => {
2246
- console.log("qwe-evmAccount", evmAccount);
2292
+ matchlog_default.log("qwe-evmAccount", evmAccount);
2247
2293
  }, [evmAccount]);
2248
2294
  return {
2249
2295
  walletReady,