@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
package/dist/hooks/api/index.mjs
CHANGED
|
@@ -2,8 +2,8 @@ import {
|
|
|
2
2
|
bind_exports,
|
|
3
3
|
poh_exports,
|
|
4
4
|
user_exports
|
|
5
|
-
} from "../../chunk-
|
|
6
|
-
import "../../chunk-
|
|
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";
|
package/dist/hooks/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { c as useCopyClipboard, d as useLayout, a as useMatchEvents, u as useUserInfo, b as useWallet } from '../index-
|
|
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';
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { c as useCopyClipboard, d as useLayout, a as useMatchEvents, u as useUserInfo, b as useWallet } from '../index-
|
|
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';
|
package/dist/hooks/index.js
CHANGED
|
@@ -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
|
-
|
|
909
|
-
const
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
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
|
-
|
|
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
|
}
|