@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/components/index.js
CHANGED
|
@@ -1895,24 +1895,35 @@ function useWallet() {
|
|
|
1895
1895
|
const chainId = chain ? chain.id : await obj.getChainId();
|
|
1896
1896
|
const _chain = chain || obj.chain;
|
|
1897
1897
|
const transactionId = Date.now().toString() + Math.random().toString().slice(6);
|
|
1898
|
-
|
|
1899
|
-
const
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1898
|
+
let interval = setInterval(() => {
|
|
1899
|
+
const sendPrepareTransactionRequest = async () => {
|
|
1900
|
+
try {
|
|
1901
|
+
const {
|
|
1902
|
+
chain: chain2,
|
|
1903
|
+
account,
|
|
1904
|
+
...prepareTransactionRequest
|
|
1905
|
+
// @ts-ignore
|
|
1906
|
+
} = await obj.prepareTransactionRequest(transaction);
|
|
1907
|
+
window.matchProvider.sendWalletMessage({
|
|
1908
|
+
method: "prepareTransactionRequest",
|
|
1909
|
+
data: {
|
|
1910
|
+
prepareTransactionRequest,
|
|
1911
|
+
transactionId
|
|
1912
|
+
}
|
|
1913
|
+
});
|
|
1914
|
+
} catch (error) {
|
|
1915
|
+
console.error(error);
|
|
1905
1916
|
}
|
|
1906
|
-
}
|
|
1907
|
-
};
|
|
1908
|
-
let interval = null;
|
|
1909
|
-
const timer = setTimeout(() => {
|
|
1917
|
+
};
|
|
1910
1918
|
sendPrepareTransactionRequest();
|
|
1911
|
-
|
|
1912
|
-
sendPrepareTransactionRequest();
|
|
1913
|
-
}, 1e4);
|
|
1914
|
-
}, 1500);
|
|
1919
|
+
}, 1e4);
|
|
1915
1920
|
try {
|
|
1921
|
+
const {
|
|
1922
|
+
chain: chain2,
|
|
1923
|
+
account,
|
|
1924
|
+
...prepareTransactionRequest
|
|
1925
|
+
// @ts-ignore
|
|
1926
|
+
} = await obj.prepareTransactionRequest(transaction);
|
|
1916
1927
|
const { serializedTransaction } = await window.matchProvider.waitUntilWalletMessage({
|
|
1917
1928
|
method: "sendTransaction",
|
|
1918
1929
|
data: {
|
|
@@ -1925,7 +1936,8 @@ function useWallet() {
|
|
|
1925
1936
|
id: chainId,
|
|
1926
1937
|
name: _chain?.name,
|
|
1927
1938
|
nativeCurrency: _chain?.nativeCurrency
|
|
1928
|
-
}
|
|
1939
|
+
},
|
|
1940
|
+
prepareTransactionRequest
|
|
1929
1941
|
}
|
|
1930
1942
|
});
|
|
1931
1943
|
openHashPanel();
|
|
@@ -1934,14 +1946,12 @@ function useWallet() {
|
|
|
1934
1946
|
});
|
|
1935
1947
|
openHashPanel({
|
|
1936
1948
|
hash: txHash,
|
|
1937
|
-
chain
|
|
1949
|
+
chain: _chain
|
|
1938
1950
|
});
|
|
1939
|
-
clearTimeout(timer);
|
|
1940
1951
|
clearInterval(interval);
|
|
1941
1952
|
resolve(txHash);
|
|
1942
1953
|
} catch (error) {
|
|
1943
1954
|
console.error("qwe-sign-error", error);
|
|
1944
|
-
clearTimeout(timer);
|
|
1945
1955
|
clearInterval(interval);
|
|
1946
1956
|
reject(error);
|
|
1947
1957
|
}
|