@matchain/matchid-sdk-react 0.1.42-alpha.10 → 0.1.42-alpha.12

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.
@@ -2,8 +2,8 @@ import {
2
2
  bind_exports,
3
3
  poh_exports,
4
4
  user_exports
5
- } from "../../chunk-N53ZMW5C.mjs";
6
- import "../../chunk-YG4MNAUD.mjs";
5
+ } from "../../chunk-3SFDSK7R.mjs";
6
+ import "../../chunk-P4CC5TVY.mjs";
7
7
  import "../../chunk-SQIJR7RA.mjs";
8
8
  import "../../chunk-DPXMCLYK.mjs";
9
9
  import "../../chunk-J5LGTIGS.mjs";
@@ -1,4 +1,4 @@
1
- export { c as useCopyClipboard, d as useLayout, a as useMatchEvents, u as useUserInfo, b as useWallet } from '../index-sOVSnYF4.mjs';
1
+ export { c as useCopyClipboard, d as useLayout, a as useMatchEvents, u as useUserInfo, b as useWallet } from '../index-B2B4VJ-u.mjs';
2
2
  import '../types-CVwZEgQ0.mjs';
3
3
  import 'react';
4
4
  import 'viem';
@@ -1,4 +1,4 @@
1
- export { c as useCopyClipboard, d as useLayout, a as useMatchEvents, u as useUserInfo, b as useWallet } from '../index-DKMrpRJC.js';
1
+ export { c as useCopyClipboard, d as useLayout, a as useMatchEvents, u as useUserInfo, b as useWallet } from '../index-Bhnio7tx.js';
2
2
  import '../types-CVwZEgQ0.js';
3
3
  import 'react';
4
4
  import 'viem';
@@ -905,24 +905,35 @@ function useWallet() {
905
905
  const chainId = chain ? chain.id : await obj.getChainId();
906
906
  const _chain = chain || obj.chain;
907
907
  const transactionId = Date.now().toString() + Math.random().toString().slice(6);
908
- const sendPrepareTransactionRequest = async () => {
909
- const { chain: chain2, account, ...prepareTransactionRequest } = await obj.prepareTransactionRequest(transaction);
910
- window.matchProvider.sendWalletMessage({
911
- method: "prepareTransactionRequest",
912
- data: {
913
- prepareTransactionRequest,
914
- transactionId
908
+ let interval = setInterval(() => {
909
+ const sendPrepareTransactionRequest = async () => {
910
+ try {
911
+ const {
912
+ chain: chain2,
913
+ account,
914
+ ...prepareTransactionRequest
915
+ // @ts-ignore
916
+ } = await obj.prepareTransactionRequest(transaction);
917
+ window.matchProvider.sendWalletMessage({
918
+ method: "prepareTransactionRequest",
919
+ data: {
920
+ prepareTransactionRequest,
921
+ transactionId
922
+ }
923
+ });
924
+ } catch (error) {
925
+ console.error(error);
915
926
  }
916
- });
917
- };
918
- let interval = null;
919
- const timer = setTimeout(() => {
927
+ };
920
928
  sendPrepareTransactionRequest();
921
- interval = setInterval(() => {
922
- sendPrepareTransactionRequest();
923
- }, 1e4);
924
- }, 1500);
929
+ }, 1e4);
925
930
  try {
931
+ const {
932
+ chain: chain2,
933
+ account,
934
+ ...prepareTransactionRequest
935
+ // @ts-ignore
936
+ } = await obj.prepareTransactionRequest(transaction);
926
937
  const { serializedTransaction } = await window.matchProvider.waitUntilWalletMessage({
927
938
  method: "sendTransaction",
928
939
  data: {
@@ -935,7 +946,8 @@ function useWallet() {
935
946
  id: chainId,
936
947
  name: _chain?.name,
937
948
  nativeCurrency: _chain?.nativeCurrency
938
- }
949
+ },
950
+ prepareTransactionRequest
939
951
  }
940
952
  });
941
953
  openHashPanel();
@@ -944,14 +956,12 @@ function useWallet() {
944
956
  });
945
957
  openHashPanel({
946
958
  hash: txHash,
947
- chain
959
+ chain: _chain
948
960
  });
949
- clearTimeout(timer);
950
961
  clearInterval(interval);
951
962
  resolve(txHash);
952
963
  } catch (error) {
953
964
  console.error("qwe-sign-error", error);
954
- clearTimeout(timer);
955
965
  clearInterval(interval);
956
966
  reject(error);
957
967
  }