@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.
@@ -9,7 +9,7 @@ import {
9
9
  unBindWalletApi,
10
10
  useUserInfo,
11
11
  verifyPohApi
12
- } from "./chunk-YG4MNAUD.mjs";
12
+ } from "./chunk-P4CC5TVY.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-N53ZMW5C.mjs.map
93
+ //# sourceMappingURL=chunk-3SFDSK7R.mjs.map
@@ -3387,24 +3387,35 @@ function useWallet() {
3387
3387
  const chainId = chain ? chain.id : await obj.getChainId();
3388
3388
  const _chain = chain || obj.chain;
3389
3389
  const transactionId = Date.now().toString() + Math.random().toString().slice(6);
3390
- const sendPrepareTransactionRequest = async () => {
3391
- const { chain: chain2, account, ...prepareTransactionRequest } = await obj.prepareTransactionRequest(transaction);
3392
- window.matchProvider.sendWalletMessage({
3393
- method: "prepareTransactionRequest",
3394
- data: {
3395
- prepareTransactionRequest,
3396
- transactionId
3390
+ let interval = setInterval(() => {
3391
+ const sendPrepareTransactionRequest = async () => {
3392
+ try {
3393
+ const {
3394
+ chain: chain2,
3395
+ account,
3396
+ ...prepareTransactionRequest
3397
+ // @ts-ignore
3398
+ } = await obj.prepareTransactionRequest(transaction);
3399
+ window.matchProvider.sendWalletMessage({
3400
+ method: "prepareTransactionRequest",
3401
+ data: {
3402
+ prepareTransactionRequest,
3403
+ transactionId
3404
+ }
3405
+ });
3406
+ } catch (error) {
3407
+ console.error(error);
3397
3408
  }
3398
- });
3399
- };
3400
- let interval = null;
3401
- const timer = setTimeout(() => {
3409
+ };
3402
3410
  sendPrepareTransactionRequest();
3403
- interval = setInterval(() => {
3404
- sendPrepareTransactionRequest();
3405
- }, 1e4);
3406
- }, 1500);
3411
+ }, 1e4);
3407
3412
  try {
3413
+ const {
3414
+ chain: chain2,
3415
+ account,
3416
+ ...prepareTransactionRequest
3417
+ // @ts-ignore
3418
+ } = await obj.prepareTransactionRequest(transaction);
3408
3419
  const { serializedTransaction } = await window.matchProvider.waitUntilWalletMessage({
3409
3420
  method: "sendTransaction",
3410
3421
  data: {
@@ -3417,7 +3428,8 @@ function useWallet() {
3417
3428
  id: chainId,
3418
3429
  name: _chain?.name,
3419
3430
  nativeCurrency: _chain?.nativeCurrency
3420
- }
3431
+ },
3432
+ prepareTransactionRequest
3421
3433
  }
3422
3434
  });
3423
3435
  openHashPanel();
@@ -3426,14 +3438,12 @@ function useWallet() {
3426
3438
  });
3427
3439
  openHashPanel({
3428
3440
  hash: txHash,
3429
- chain
3441
+ chain: _chain
3430
3442
  });
3431
- clearTimeout(timer);
3432
3443
  clearInterval(interval);
3433
3444
  resolve(txHash);
3434
3445
  } catch (error) {
3435
3446
  console.error("qwe-sign-error", error);
3436
- clearTimeout(timer);
3437
3447
  clearInterval(interval);
3438
3448
  reject(error);
3439
3449
  }
@@ -4659,4 +4669,4 @@ export {
4659
4669
  MatchProvider,
4660
4670
  useMatch
4661
4671
  };
4662
- //# sourceMappingURL=chunk-YG4MNAUD.mjs.map
4672
+ //# sourceMappingURL=chunk-P4CC5TVY.mjs.map