@matchain/matchid-sdk-react 0.1.44-alpha.4 → 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 (42) 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-24AMOG53.mjs → chunk-3HJGQPXY.mjs} +2 -2
  4. package/dist/{chunk-RAX4G26O.mjs → chunk-KOA6YG3K.mjs} +29 -11
  5. package/dist/{chunk-RAX4G26O.mjs.map → chunk-KOA6YG3K.mjs.map} +1 -1
  6. package/dist/components/index.d.mts +2 -2
  7. package/dist/components/index.d.ts +2 -2
  8. package/dist/components/index.js +17 -10
  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.map +1 -1
  14. package/dist/hooks/api/index.mjs +3 -3
  15. package/dist/hooks/index.d.mts +2 -2
  16. package/dist/hooks/index.d.ts +2 -2
  17. package/dist/hooks/index.js +17 -10
  18. package/dist/hooks/index.js.map +1 -1
  19. package/dist/hooks/index.mjs +2 -2
  20. package/dist/{index-BQDL8XkC.d.ts → index-BIQSRprZ.d.ts} +1 -1
  21. package/dist/{index-DAj3aVo6.d.mts → index-BKSFphOk.d.mts} +1 -1
  22. package/dist/{index-ivTptZeo.d.ts → index-BdUFRwfe.d.ts} +4 -1
  23. package/dist/{index-C1NfMaCm.d.mts → index-ClL_1acF.d.mts} +1 -1
  24. package/dist/{index-DnK10Gz7.d.mts → index-Cq_k0drT.d.mts} +4 -1
  25. package/dist/{index-Rb-jdkzE.d.mts → index-CvsdzdHl.d.mts} +1 -1
  26. package/dist/{index-DzVjb4K-.d.ts → index-D8yek3rk.d.ts} +1 -1
  27. package/dist/{index-x432SkFJ.d.ts → index-Dz7yUGcs.d.ts} +1 -1
  28. package/dist/index.css +4 -4
  29. package/dist/index.d.mts +5 -5
  30. package/dist/index.d.ts +5 -5
  31. package/dist/index.js +28 -10
  32. package/dist/index.js.map +1 -1
  33. package/dist/index.mjs +6 -6
  34. package/dist/types/index.d.mts +1 -1
  35. package/dist/types/index.d.ts +1 -1
  36. package/dist/{types-E2MeOwmE.d.mts → types-BOCbo3U7.d.mts} +1 -1
  37. package/dist/{types-E2MeOwmE.d.ts → types-BOCbo3U7.d.ts} +1 -1
  38. package/example/src/config/chains/matchMain.ts +1 -1
  39. package/example/src/config/chains/matchTest.ts +1 -1
  40. package/example/src/pages/Wallet.tsx +122 -49
  41. package/package.json +1 -1
  42. /package/dist/{chunk-24AMOG53.mjs.map → chunk-3HJGQPXY.mjs.map} +0 -0
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import React, { CSSProperties } from 'react';
3
- import { s as IconProps$1 } from '../../types-E2MeOwmE.mjs';
3
+ import { m as IconProps$1 } from '../../types-BOCbo3U7.mjs';
4
4
 
5
5
  declare function BackIcon({ color, size, className, style }: {
6
6
  color?: string;
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import React, { CSSProperties } from 'react';
3
- import { s as IconProps$1 } from '../../types-E2MeOwmE.js';
3
+ import { m as IconProps$1 } from '../../types-BOCbo3U7.js';
4
4
 
5
5
  declare function BackIcon({ color, size, className, style }: {
6
6
  color?: string;
@@ -9,7 +9,7 @@ import {
9
9
  unBindWalletApi,
10
10
  useUserInfo,
11
11
  verifyPohApi
12
- } from "./chunk-RAX4G26O.mjs";
12
+ } from "./chunk-KOA6YG3K.mjs";
13
13
  import {
14
14
  __export
15
15
  } from "./chunk-J5LGTIGS.mjs";
@@ -90,4 +90,4 @@ export {
90
90
  user_exports,
91
91
  api_exports
92
92
  };
93
- //# sourceMappingURL=chunk-24AMOG53.mjs.map
93
+ //# sourceMappingURL=chunk-3HJGQPXY.mjs.map
@@ -3134,6 +3134,7 @@ function HashPanel({
3134
3134
  setStatus("pending");
3135
3135
  return false;
3136
3136
  }
3137
+ matchlog_default.log("getTransactionReceipt", receipt);
3137
3138
  if (receipt.status === "success") {
3138
3139
  setStatus("success");
3139
3140
  return true;
@@ -3472,7 +3473,8 @@ function useWallet() {
3472
3473
  name: chain?.nativeCurrency?.name || "ETH",
3473
3474
  symbol: chain?.nativeCurrency?.symbol || "ETH",
3474
3475
  decimals: chain?.nativeCurrency?.decimals || 18
3475
- }
3476
+ },
3477
+ rpcUrls: chain?.rpcUrls
3476
3478
  }
3477
3479
  });
3478
3480
  },
@@ -3509,15 +3511,16 @@ function useWallet() {
3509
3511
  const chainId = chain ? chain.id : await obj.getChainId();
3510
3512
  const _chain = chain || obj.chain;
3511
3513
  const transactionId = Date.now().toString() + Math.random().toString().slice(6);
3512
- let interval = setInterval(() => {
3513
- const sendPrepareTransactionRequest = async () => {
3514
+ window.matchProvider.transactionMessageIntervalMap[transactionId] = {
3515
+ transaction,
3516
+ func: async () => {
3514
3517
  try {
3515
3518
  const {
3516
3519
  chain: chain2,
3517
3520
  account,
3518
3521
  ...prepareTransactionRequest
3519
3522
  // @ts-ignore
3520
- } = await obj.prepareTransactionRequest(transaction);
3523
+ } = await obj.prepareTransactionRequest(window.matchProvider.transactionMessageIntervalMap[transactionId].transaction);
3521
3524
  window.matchProvider.sendWalletMessage({
3522
3525
  method: "prepareTransactionRequest",
3523
3526
  data: {
@@ -3528,9 +3531,11 @@ function useWallet() {
3528
3531
  } catch (error) {
3529
3532
  console.error(error);
3530
3533
  }
3531
- };
3532
- sendPrepareTransactionRequest();
3533
- }, 1e4);
3534
+ },
3535
+ interval: setInterval(() => {
3536
+ window.matchProvider.transactionMessageIntervalMap[transactionId].func();
3537
+ }, 1e4)
3538
+ };
3534
3539
  try {
3535
3540
  const {
3536
3541
  chain: chain2,
@@ -3549,7 +3554,8 @@ function useWallet() {
3549
3554
  chain: {
3550
3555
  id: chainId,
3551
3556
  name: _chain?.name,
3552
- nativeCurrency: _chain?.nativeCurrency
3557
+ nativeCurrency: _chain?.nativeCurrency,
3558
+ rpcUrls: _chain?.rpcUrls
3553
3559
  },
3554
3560
  prepareTransactionRequest
3555
3561
  }
@@ -3562,11 +3568,13 @@ function useWallet() {
3562
3568
  hash: txHash,
3563
3569
  chain: _chain
3564
3570
  });
3565
- clearInterval(interval);
3571
+ clearInterval(window.matchProvider.transactionMessageIntervalMap[transactionId].interval);
3572
+ delete window.matchProvider.transactionMessageIntervalMap[transactionId];
3566
3573
  resolve(txHash);
3567
3574
  } catch (error) {
3568
3575
  console.error("qwe-sign-error", error);
3569
- clearInterval(interval);
3576
+ clearInterval(window.matchProvider.transactionMessageIntervalMap[transactionId].interval);
3577
+ delete window.matchProvider.transactionMessageIntervalMap[transactionId];
3570
3578
  reject(error);
3571
3579
  }
3572
3580
  };
@@ -3679,6 +3687,7 @@ function useWalletInit({
3679
3687
  createIframe();
3680
3688
  if (!window.matchProvider) {
3681
3689
  window.matchProvider = {
3690
+ transactionMessageIntervalMap: {},
3682
3691
  walletMessageMap: {},
3683
3692
  walletMessageStack: [],
3684
3693
  sendWalletMessage: ({
@@ -3781,6 +3790,15 @@ function useWalletInit({
3781
3790
  }
3782
3791
  return;
3783
3792
  }
3793
+ if (messageId == "updateTransactionData") {
3794
+ const { data, rootData, transactionId } = res.data;
3795
+ if (window.matchProvider.transactionMessageIntervalMap[transactionId] && window.matchProvider.transactionMessageIntervalMap[transactionId].transaction.data == rootData) {
3796
+ window.matchProvider.transactionMessageIntervalMap[transactionId].transaction.data = data;
3797
+ const { func } = window.matchProvider.transactionMessageIntervalMap[transactionId];
3798
+ func();
3799
+ }
3800
+ return;
3801
+ }
3784
3802
  if (messageId && window.matchProvider.walletMessageMap[messageId]) {
3785
3803
  const { resolve, reject, timeout } = window.matchProvider.walletMessageMap[messageId];
3786
3804
  clearTimeout(timeout);
@@ -4800,4 +4818,4 @@ export {
4800
4818
  MatchProvider,
4801
4819
  useMatch
4802
4820
  };
4803
- //# sourceMappingURL=chunk-RAX4G26O.mjs.map
4821
+ //# sourceMappingURL=chunk-KOA6YG3K.mjs.map