@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.
- package/dist/{chunk-N53ZMW5C.mjs → chunk-3SFDSK7R.mjs} +2 -2
- package/dist/{chunk-YG4MNAUD.mjs → chunk-P4CC5TVY.mjs} +30 -20
- package/dist/{chunk-YG4MNAUD.mjs.map → chunk-P4CC5TVY.mjs.map} +1 -1
- package/dist/components/index.js +29 -19
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +1 -1
- package/dist/hooks/api/index.js.map +1 -1
- package/dist/hooks/api/index.mjs +2 -2
- package/dist/hooks/index.d.mts +1 -1
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/index.js +29 -19
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +1 -1
- package/dist/{index-sOVSnYF4.d.mts → index-B2B4VJ-u.d.mts} +4 -2
- package/dist/{index-DKMrpRJC.d.ts → index-Bhnio7tx.d.ts} +4 -2
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +29 -19
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/example/src/abi/erc20.json +222 -0
- package/example/src/pages/Wallet.tsx +135 -9
- package/example/src/store/useLocalStore.ts +7 -1
- package/example/tsconfig.json +1 -0
- package/package.json +1 -1
- /package/dist/{chunk-N53ZMW5C.mjs.map → chunk-3SFDSK7R.mjs.map} +0 -0
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
unBindWalletApi,
|
|
10
10
|
useUserInfo,
|
|
11
11
|
verifyPohApi
|
|
12
|
-
} from "./chunk-
|
|
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-
|
|
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
|
-
|
|
3391
|
-
const
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
|
|
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
|
-
|
|
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-
|
|
4672
|
+
//# sourceMappingURL=chunk-P4CC5TVY.mjs.map
|