@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
@@ -2,10 +2,10 @@ import {
2
2
  bind_exports,
3
3
  poh_exports,
4
4
  user_exports
5
- } from "../../chunk-7PMDBILL.mjs";
6
- import "../../chunk-YYO4X2NB.mjs";
7
- import "../../chunk-SQIJR7RA.mjs";
5
+ } from "../../chunk-3HJGQPXY.mjs";
6
+ import "../../chunk-KOA6YG3K.mjs";
8
7
  import "../../chunk-DPXMCLYK.mjs";
8
+ import "../../chunk-SQIJR7RA.mjs";
9
9
  import "../../chunk-J5LGTIGS.mjs";
10
10
  export {
11
11
  bind_exports as bind,
@@ -1,5 +1,5 @@
1
- export { c as useCopyClipboard, d as useLayout, a as useMatchEvents, u as useUserInfo, b as useWallet } from '../index-DnK10Gz7.mjs';
2
- import '../types-E2MeOwmE.mjs';
1
+ export { c as useCopyClipboard, d as useLayout, a as useMatchEvents, u as useUserInfo, b as useWallet } from '../index-Cq_k0drT.mjs';
2
+ import '../types-BOCbo3U7.mjs';
3
3
  import 'react';
4
4
  import 'viem';
5
5
  import '../mpc-CTbBWHld.mjs';
@@ -1,5 +1,5 @@
1
- export { c as useCopyClipboard, d as useLayout, a as useMatchEvents, u as useUserInfo, b as useWallet } from '../index-ivTptZeo.js';
2
- import '../types-E2MeOwmE.js';
1
+ export { c as useCopyClipboard, d as useLayout, a as useMatchEvents, u as useUserInfo, b as useWallet } from '../index-BdUFRwfe.js';
2
+ import '../types-BOCbo3U7.js';
3
3
  import 'react';
4
4
  import 'viem';
5
5
  import '../mpc-CTbBWHld.js';
@@ -224,13 +224,13 @@ var retryRequest = async (config) => {
224
224
  try {
225
225
  const endpoints = getEndpoints();
226
226
  const token = getToken();
227
- instance.defaults.baseURL = `${endpoints.back}`;
228
- instance.defaults.headers.common["Appid"] = getAppid();
227
+ retryInstance.defaults.baseURL = `${endpoints.back}`;
228
+ retryInstance.defaults.headers.common["Appid"] = getAppid();
229
229
  if (token) {
230
- instance.defaults.headers.common["Authorization"] = token;
230
+ retryInstance.defaults.headers.common["Authorization"] = token;
231
231
  }
232
- instance.defaults.headers.common["Accept-Language"] = getLocale();
233
- const { data } = await instance.request(config);
232
+ retryInstance.defaults.headers.common["Accept-Language"] = getLocale();
233
+ const { data } = await retryInstance.request(config);
234
234
  matchlog_default.log("api", data);
235
235
  if (data.code == 401001) {
236
236
  localStore.getState().logout();
@@ -933,7 +933,8 @@ function useWallet() {
933
933
  name: chain?.nativeCurrency?.name || "ETH",
934
934
  symbol: chain?.nativeCurrency?.symbol || "ETH",
935
935
  decimals: chain?.nativeCurrency?.decimals || 18
936
- }
936
+ },
937
+ rpcUrls: chain?.rpcUrls
937
938
  }
938
939
  });
939
940
  },
@@ -970,15 +971,16 @@ function useWallet() {
970
971
  const chainId = chain ? chain.id : await obj.getChainId();
971
972
  const _chain = chain || obj.chain;
972
973
  const transactionId = Date.now().toString() + Math.random().toString().slice(6);
973
- let interval = setInterval(() => {
974
- const sendPrepareTransactionRequest = async () => {
974
+ window.matchProvider.transactionMessageIntervalMap[transactionId] = {
975
+ transaction,
976
+ func: async () => {
975
977
  try {
976
978
  const {
977
979
  chain: chain2,
978
980
  account,
979
981
  ...prepareTransactionRequest
980
982
  // @ts-ignore
981
- } = await obj.prepareTransactionRequest(transaction);
983
+ } = await obj.prepareTransactionRequest(window.matchProvider.transactionMessageIntervalMap[transactionId].transaction);
982
984
  window.matchProvider.sendWalletMessage({
983
985
  method: "prepareTransactionRequest",
984
986
  data: {
@@ -989,9 +991,11 @@ function useWallet() {
989
991
  } catch (error) {
990
992
  console.error(error);
991
993
  }
992
- };
993
- sendPrepareTransactionRequest();
994
- }, 1e4);
994
+ },
995
+ interval: setInterval(() => {
996
+ window.matchProvider.transactionMessageIntervalMap[transactionId].func();
997
+ }, 1e4)
998
+ };
995
999
  try {
996
1000
  const {
997
1001
  chain: chain2,
@@ -1010,7 +1014,8 @@ function useWallet() {
1010
1014
  chain: {
1011
1015
  id: chainId,
1012
1016
  name: _chain?.name,
1013
- nativeCurrency: _chain?.nativeCurrency
1017
+ nativeCurrency: _chain?.nativeCurrency,
1018
+ rpcUrls: _chain?.rpcUrls
1014
1019
  },
1015
1020
  prepareTransactionRequest
1016
1021
  }
@@ -1023,11 +1028,13 @@ function useWallet() {
1023
1028
  hash: txHash,
1024
1029
  chain: _chain
1025
1030
  });
1026
- clearInterval(interval);
1031
+ clearInterval(window.matchProvider.transactionMessageIntervalMap[transactionId].interval);
1032
+ delete window.matchProvider.transactionMessageIntervalMap[transactionId];
1027
1033
  resolve(txHash);
1028
1034
  } catch (error) {
1029
1035
  console.error("qwe-sign-error", error);
1030
- clearInterval(interval);
1036
+ clearInterval(window.matchProvider.transactionMessageIntervalMap[transactionId].interval);
1037
+ delete window.matchProvider.transactionMessageIntervalMap[transactionId];
1031
1038
  reject(error);
1032
1039
  }
1033
1040
  };