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

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 (44) 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-7PMDBILL.mjs → chunk-3HJGQPXY.mjs} +2 -2
  4. package/dist/{chunk-YYO4X2NB.mjs → chunk-KOA6YG3K.mjs} +34 -16
  5. package/dist/chunk-KOA6YG3K.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 +22 -15
  9. package/dist/components/index.js.map +1 -1
  10. package/dist/components/index.mjs +2 -2
  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 +5 -5
  14. package/dist/hooks/api/index.js.map +1 -1
  15. package/dist/hooks/api/index.mjs +3 -3
  16. package/dist/hooks/index.d.mts +2 -2
  17. package/dist/hooks/index.d.ts +2 -2
  18. package/dist/hooks/index.js +22 -15
  19. package/dist/hooks/index.js.map +1 -1
  20. package/dist/hooks/index.mjs +2 -2
  21. package/dist/{index-BQDL8XkC.d.ts → index-BIQSRprZ.d.ts} +1 -1
  22. package/dist/{index-DAj3aVo6.d.mts → index-BKSFphOk.d.mts} +1 -1
  23. package/dist/{index-ivTptZeo.d.ts → index-BdUFRwfe.d.ts} +4 -1
  24. package/dist/{index-C1NfMaCm.d.mts → index-ClL_1acF.d.mts} +1 -1
  25. package/dist/{index-DnK10Gz7.d.mts → index-Cq_k0drT.d.mts} +4 -1
  26. package/dist/{index-Rb-jdkzE.d.mts → index-CvsdzdHl.d.mts} +1 -1
  27. package/dist/{index-DzVjb4K-.d.ts → index-D8yek3rk.d.ts} +1 -1
  28. package/dist/{index-x432SkFJ.d.ts → index-Dz7yUGcs.d.ts} +1 -1
  29. package/dist/index.css +4 -4
  30. package/dist/index.d.mts +5 -5
  31. package/dist/index.d.ts +5 -5
  32. package/dist/index.js +33 -15
  33. package/dist/index.js.map +1 -1
  34. package/dist/index.mjs +6 -6
  35. package/dist/types/index.d.mts +1 -1
  36. package/dist/types/index.d.ts +1 -1
  37. package/dist/{types-E2MeOwmE.d.mts → types-BOCbo3U7.d.mts} +1 -1
  38. package/dist/{types-E2MeOwmE.d.ts → types-BOCbo3U7.d.ts} +1 -1
  39. package/example/src/config/chains/matchMain.ts +1 -1
  40. package/example/src/config/chains/matchTest.ts +1 -1
  41. package/example/src/pages/Wallet.tsx +122 -49
  42. package/package.json +1 -1
  43. package/dist/chunk-YYO4X2NB.mjs.map +0 -1
  44. /package/dist/{chunk-7PMDBILL.mjs.map → chunk-3HJGQPXY.mjs.map} +0 -0
@@ -4,9 +4,9 @@ import {
4
4
  useMatchEvents,
5
5
  useUserInfo,
6
6
  useWallet
7
- } from "../chunk-YYO4X2NB.mjs";
8
- import "../chunk-SQIJR7RA.mjs";
7
+ } from "../chunk-KOA6YG3K.mjs";
9
8
  import "../chunk-DPXMCLYK.mjs";
9
+ import "../chunk-SQIJR7RA.mjs";
10
10
  import "../chunk-J5LGTIGS.mjs";
11
11
  export {
12
12
  useCopyClipboard,
@@ -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-E2MeOwmE.js';
3
+ import { v as PohZkpassParams, o as BindItemType, n as BindInfoType, u as PohItemType } from './types-BOCbo3U7.js';
4
4
 
5
5
  interface MyResponseType<T> {
6
6
  code: number;
@@ -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, 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';
2
+ import { A as AnyObject, n as BindInfoType, o as BindItemType, p as BindWalletParam, B as ButtonProps, C as CEXType, D as DeepPartial, q as DrawerProps, E as EmailModalProps, a as IEnvConfigType, r as IEnvName, s as ILoginWalletReq, I as IMatchEvents, j as ISocialLoginMethod, m 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-BOCbo3U7.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 { b as ISocialLoginMethod, O as OverviewInfo, C as CEXType, c as LoginMethodType, I as IMatchEvents } from './types-E2MeOwmE.js';
1
+ import { j as ISocialLoginMethod, k as OverviewInfo, C as CEXType, l as LoginMethodType, I as IMatchEvents } from './types-BOCbo3U7.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';
@@ -87,6 +87,9 @@ type signTransactionType = (params: {
87
87
  symbol: string;
88
88
  decimals: number;
89
89
  };
90
+ rpcUrls: {
91
+ [key: string]: any;
92
+ };
90
93
  };
91
94
  }) => Promise<`0x02${string}` | `0x01${string}` | `0x03${string}` | `0x04${string}` | viem.TransactionSerializedLegacy>;
92
95
  type recoverAfterType = (params: {
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
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';
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-BOCbo3U7.mjs';
3
3
  import { ReactNode, PropsWithChildren } from 'react';
4
4
  import { C as ChainType, R as RecoveryType } from './mpc-CTbBWHld.mjs';
5
5
 
@@ -1,4 +1,4 @@
1
- import { b as ISocialLoginMethod, O as OverviewInfo, C as CEXType, c as LoginMethodType, I as IMatchEvents } from './types-E2MeOwmE.mjs';
1
+ import { j as ISocialLoginMethod, k as OverviewInfo, C as CEXType, l as LoginMethodType, I as IMatchEvents } from './types-BOCbo3U7.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';
@@ -87,6 +87,9 @@ type signTransactionType = (params: {
87
87
  symbol: string;
88
88
  decimals: number;
89
89
  };
90
+ rpcUrls: {
91
+ [key: string]: any;
92
+ };
90
93
  };
91
94
  }) => Promise<`0x02${string}` | `0x01${string}` | `0x03${string}` | `0x04${string}` | viem.TransactionSerializedLegacy>;
92
95
  type recoverAfterType = (params: {
@@ -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-E2MeOwmE.mjs';
3
+ import { v as PohZkpassParams, o as BindItemType, n as BindInfoType, u as PohItemType } from './types-BOCbo3U7.mjs';
4
4
 
5
5
  interface MyResponseType<T> {
6
6
  code: number;
@@ -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, 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';
2
+ import { A as AnyObject, n as BindInfoType, o as BindItemType, p as BindWalletParam, B as ButtonProps, C as CEXType, D as DeepPartial, q as DrawerProps, E as EmailModalProps, a as IEnvConfigType, r as IEnvName, s as ILoginWalletReq, I as IMatchEvents, j as ISocialLoginMethod, m 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-BOCbo3U7.js';
3
3
 
4
4
  declare const index_AnyObject: typeof AnyObject;
5
5
  declare const index_AuthParams: typeof AuthParams;
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
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';
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-BOCbo3U7.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.css CHANGED
@@ -568,7 +568,7 @@ body {
568
568
  border-color: var(--matchid-btn-hover-bg);
569
569
  }
570
570
 
571
- .matchid-btn:active {
571
+ .matchid-btn:focus {
572
572
  background: var(--matchid-btn-active-bg);
573
573
  color: var(--matchid-btn-active-color);
574
574
  box-shadow: var(--matchid-shadow-middle);
@@ -576,7 +576,7 @@ body {
576
576
  }
577
577
 
578
578
 
579
- .matchid-btn-highlight, .matchid-btn-highlight:hover, .matchid-btn-highlight:active, .matchid-btn-highlight:not(:disabled):hover {
579
+ .matchid-btn-highlight, .matchid-btn-highlight:hover, .matchid-btn-highlight:focus, .matchid-btn-highlight:not(:disabled):hover {
580
580
  background: var(--matchid-btn-highlight-bg);
581
581
  color: var(--matchid-btn-highlight-color);
582
582
  border: 0;
@@ -748,8 +748,8 @@ body {
748
748
  border-color: var(--matchid-login-btn-hover-border-color);
749
749
  }
750
750
 
751
- .matchid-login-btn:active,
752
- .matchid-login-btn:not(:disabled):active {
751
+ .matchid-login-btn:focus,
752
+ .matchid-login-btn:not(:disabled):focus {
753
753
  box-shadow: var(--matchid-shadow-small);
754
754
  background: var(--matchid-login-btn-active-bg-color);
755
755
  color: var(--matchid-login-btn-active-text-color);
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-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';
2
+ import { I as IMatchEvents, a as IEnvConfigType, L as LocaleType, W as WalletConfigType } from './types-BOCbo3U7.mjs';
3
+ export { i as Components } from './index-ClL_1acF.mjs';
4
+ export { i as Hooks } from './index-Cq_k0drT.mjs';
5
+ export { i as Api } from './index-CvsdzdHl.mjs';
6
6
  export { i as Chains } from './index-DXRGMAbv.mjs';
7
- export { i as Types } from './index-DAj3aVo6.mjs';
7
+ export { i as Types } from './index-BKSFphOk.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-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';
2
+ import { I as IMatchEvents, a as IEnvConfigType, L as LocaleType, W as WalletConfigType } from './types-BOCbo3U7.js';
3
+ export { i as Components } from './index-Dz7yUGcs.js';
4
+ export { i as Hooks } from './index-BdUFRwfe.js';
5
+ export { i as Api } from './index-BIQSRprZ.js';
6
6
  export { i as Chains } from './index-DXRGMAbv.js';
7
- export { i as Types } from './index-DzVjb4K-.js';
7
+ export { i as Types } from './index-D8yek3rk.js';
8
8
  import 'react/jsx-runtime';
9
9
  import './mpc-CTbBWHld.js';
10
10
  import 'viem';
package/dist/index.js CHANGED
@@ -1480,13 +1480,13 @@ var retryRequest = async (config) => {
1480
1480
  try {
1481
1481
  const endpoints = getEndpoints();
1482
1482
  const token = getToken();
1483
- instance.defaults.baseURL = `${endpoints.back}`;
1484
- instance.defaults.headers.common["Appid"] = getAppid();
1483
+ retryInstance.defaults.baseURL = `${endpoints.back}`;
1484
+ retryInstance.defaults.headers.common["Appid"] = getAppid();
1485
1485
  if (token) {
1486
- instance.defaults.headers.common["Authorization"] = token;
1486
+ retryInstance.defaults.headers.common["Authorization"] = token;
1487
1487
  }
1488
- instance.defaults.headers.common["Accept-Language"] = getLocale();
1489
- const { data } = await instance.request(config);
1488
+ retryInstance.defaults.headers.common["Accept-Language"] = getLocale();
1489
+ const { data } = await retryInstance.request(config);
1490
1490
  matchlog_default.log("api", data);
1491
1491
  if (data.code == 401001) {
1492
1492
  localStore.getState().logout();
@@ -2279,7 +2279,8 @@ function useWallet() {
2279
2279
  name: chain?.nativeCurrency?.name || "ETH",
2280
2280
  symbol: chain?.nativeCurrency?.symbol || "ETH",
2281
2281
  decimals: chain?.nativeCurrency?.decimals || 18
2282
- }
2282
+ },
2283
+ rpcUrls: chain?.rpcUrls
2283
2284
  }
2284
2285
  });
2285
2286
  },
@@ -2316,15 +2317,16 @@ function useWallet() {
2316
2317
  const chainId = chain ? chain.id : await obj.getChainId();
2317
2318
  const _chain = chain || obj.chain;
2318
2319
  const transactionId = Date.now().toString() + Math.random().toString().slice(6);
2319
- let interval = setInterval(() => {
2320
- const sendPrepareTransactionRequest = async () => {
2320
+ window.matchProvider.transactionMessageIntervalMap[transactionId] = {
2321
+ transaction,
2322
+ func: async () => {
2321
2323
  try {
2322
2324
  const {
2323
2325
  chain: chain2,
2324
2326
  account,
2325
2327
  ...prepareTransactionRequest
2326
2328
  // @ts-ignore
2327
- } = await obj.prepareTransactionRequest(transaction);
2329
+ } = await obj.prepareTransactionRequest(window.matchProvider.transactionMessageIntervalMap[transactionId].transaction);
2328
2330
  window.matchProvider.sendWalletMessage({
2329
2331
  method: "prepareTransactionRequest",
2330
2332
  data: {
@@ -2335,9 +2337,11 @@ function useWallet() {
2335
2337
  } catch (error) {
2336
2338
  console.error(error);
2337
2339
  }
2338
- };
2339
- sendPrepareTransactionRequest();
2340
- }, 1e4);
2340
+ },
2341
+ interval: setInterval(() => {
2342
+ window.matchProvider.transactionMessageIntervalMap[transactionId].func();
2343
+ }, 1e4)
2344
+ };
2341
2345
  try {
2342
2346
  const {
2343
2347
  chain: chain2,
@@ -2356,7 +2360,8 @@ function useWallet() {
2356
2360
  chain: {
2357
2361
  id: chainId,
2358
2362
  name: _chain?.name,
2359
- nativeCurrency: _chain?.nativeCurrency
2363
+ nativeCurrency: _chain?.nativeCurrency,
2364
+ rpcUrls: _chain?.rpcUrls
2360
2365
  },
2361
2366
  prepareTransactionRequest
2362
2367
  }
@@ -2369,11 +2374,13 @@ function useWallet() {
2369
2374
  hash: txHash,
2370
2375
  chain: _chain
2371
2376
  });
2372
- clearInterval(interval);
2377
+ clearInterval(window.matchProvider.transactionMessageIntervalMap[transactionId].interval);
2378
+ delete window.matchProvider.transactionMessageIntervalMap[transactionId];
2373
2379
  resolve(txHash);
2374
2380
  } catch (error) {
2375
2381
  console.error("qwe-sign-error", error);
2376
- clearInterval(interval);
2382
+ clearInterval(window.matchProvider.transactionMessageIntervalMap[transactionId].interval);
2383
+ delete window.matchProvider.transactionMessageIntervalMap[transactionId];
2377
2384
  reject(error);
2378
2385
  }
2379
2386
  };
@@ -4736,6 +4743,7 @@ function HashPanel({
4736
4743
  setStatus("pending");
4737
4744
  return false;
4738
4745
  }
4746
+ matchlog_default.log("getTransactionReceipt", receipt);
4739
4747
  if (receipt.status === "success") {
4740
4748
  setStatus("success");
4741
4749
  return true;
@@ -4993,6 +5001,7 @@ function useWalletInit({
4993
5001
  createIframe();
4994
5002
  if (!window.matchProvider) {
4995
5003
  window.matchProvider = {
5004
+ transactionMessageIntervalMap: {},
4996
5005
  walletMessageMap: {},
4997
5006
  walletMessageStack: [],
4998
5007
  sendWalletMessage: ({
@@ -5095,6 +5104,15 @@ function useWalletInit({
5095
5104
  }
5096
5105
  return;
5097
5106
  }
5107
+ if (messageId == "updateTransactionData") {
5108
+ const { data, rootData, transactionId } = res.data;
5109
+ if (window.matchProvider.transactionMessageIntervalMap[transactionId] && window.matchProvider.transactionMessageIntervalMap[transactionId].transaction.data == rootData) {
5110
+ window.matchProvider.transactionMessageIntervalMap[transactionId].transaction.data = data;
5111
+ const { func } = window.matchProvider.transactionMessageIntervalMap[transactionId];
5112
+ func();
5113
+ }
5114
+ return;
5115
+ }
5098
5116
  if (messageId && window.matchProvider.walletMessageMap[messageId]) {
5099
5117
  const { resolve, reject, timeout } = window.matchProvider.walletMessageMap[messageId];
5100
5118
  clearTimeout(timeout);