@matchain/matchid-sdk-react 0.1.44-alpha.3 → 0.1.44-alpha.5
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/assets/icon/index.d.mts +1 -1
- package/dist/assets/icon/index.d.ts +1 -1
- package/dist/{chunk-7PMDBILL.mjs → chunk-3HJGQPXY.mjs} +2 -2
- package/dist/{chunk-YYO4X2NB.mjs → chunk-KOA6YG3K.mjs} +34 -16
- package/dist/chunk-KOA6YG3K.mjs.map +1 -0
- package/dist/components/index.d.mts +2 -2
- package/dist/components/index.d.ts +2 -2
- package/dist/components/index.js +22 -15
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +2 -2
- package/dist/hooks/api/index.d.mts +2 -2
- package/dist/hooks/api/index.d.ts +2 -2
- package/dist/hooks/api/index.js +5 -5
- package/dist/hooks/api/index.js.map +1 -1
- package/dist/hooks/api/index.mjs +3 -3
- package/dist/hooks/index.d.mts +2 -2
- package/dist/hooks/index.d.ts +2 -2
- package/dist/hooks/index.js +22 -15
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +2 -2
- package/dist/{index-BQDL8XkC.d.ts → index-BIQSRprZ.d.ts} +1 -1
- package/dist/{index-DAj3aVo6.d.mts → index-BKSFphOk.d.mts} +1 -1
- package/dist/{index-ivTptZeo.d.ts → index-BdUFRwfe.d.ts} +4 -1
- package/dist/{index-C1NfMaCm.d.mts → index-ClL_1acF.d.mts} +1 -1
- package/dist/{index-DnK10Gz7.d.mts → index-Cq_k0drT.d.mts} +4 -1
- package/dist/{index-Rb-jdkzE.d.mts → index-CvsdzdHl.d.mts} +1 -1
- package/dist/{index-DzVjb4K-.d.ts → index-D8yek3rk.d.ts} +1 -1
- package/dist/{index-x432SkFJ.d.ts → index-Dz7yUGcs.d.ts} +1 -1
- package/dist/index.css +4 -4
- package/dist/index.d.mts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +33 -15
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -6
- package/dist/types/index.d.mts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/{types-E2MeOwmE.d.mts → types-BOCbo3U7.d.mts} +1 -1
- package/dist/{types-E2MeOwmE.d.ts → types-BOCbo3U7.d.ts} +1 -1
- package/example/src/config/chains/matchMain.ts +1 -1
- package/example/src/config/chains/matchTest.ts +1 -1
- package/example/src/pages/Wallet.tsx +122 -49
- package/package.json +1 -1
- package/dist/chunk-YYO4X2NB.mjs.map +0 -1
- /package/dist/{chunk-7PMDBILL.mjs.map → chunk-3HJGQPXY.mjs.map} +0 -0
package/dist/hooks/api/index.mjs
CHANGED
|
@@ -2,10 +2,10 @@ import {
|
|
|
2
2
|
bind_exports,
|
|
3
3
|
poh_exports,
|
|
4
4
|
user_exports
|
|
5
|
-
} from "../../chunk-
|
|
6
|
-
import "../../chunk-
|
|
7
|
-
import "../../chunk-SQIJR7RA.mjs";
|
|
5
|
+
} from "../../chunk-3HJGQPXY.mjs";
|
|
6
|
+
import "../../chunk-KOA6YG3K.mjs";
|
|
8
7
|
import "../../chunk-DPXMCLYK.mjs";
|
|
8
|
+
import "../../chunk-SQIJR7RA.mjs";
|
|
9
9
|
import "../../chunk-J5LGTIGS.mjs";
|
|
10
10
|
export {
|
|
11
11
|
bind_exports as bind,
|
package/dist/hooks/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { c as useCopyClipboard, d as useLayout, a as useMatchEvents, u as useUserInfo, b as useWallet } from '../index-
|
|
2
|
-
import '../types-
|
|
1
|
+
export { c as useCopyClipboard, d as useLayout, a as useMatchEvents, u as useUserInfo, b as useWallet } from '../index-Cq_k0drT.mjs';
|
|
2
|
+
import '../types-BOCbo3U7.mjs';
|
|
3
3
|
import 'react';
|
|
4
4
|
import 'viem';
|
|
5
5
|
import '../mpc-CTbBWHld.mjs';
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { c as useCopyClipboard, d as useLayout, a as useMatchEvents, u as useUserInfo, b as useWallet } from '../index-
|
|
2
|
-
import '../types-
|
|
1
|
+
export { c as useCopyClipboard, d as useLayout, a as useMatchEvents, u as useUserInfo, b as useWallet } from '../index-BdUFRwfe.js';
|
|
2
|
+
import '../types-BOCbo3U7.js';
|
|
3
3
|
import 'react';
|
|
4
4
|
import 'viem';
|
|
5
5
|
import '../mpc-CTbBWHld.js';
|
package/dist/hooks/index.js
CHANGED
|
@@ -224,13 +224,13 @@ var retryRequest = async (config) => {
|
|
|
224
224
|
try {
|
|
225
225
|
const endpoints = getEndpoints();
|
|
226
226
|
const token = getToken();
|
|
227
|
-
|
|
228
|
-
|
|
227
|
+
retryInstance.defaults.baseURL = `${endpoints.back}`;
|
|
228
|
+
retryInstance.defaults.headers.common["Appid"] = getAppid();
|
|
229
229
|
if (token) {
|
|
230
|
-
|
|
230
|
+
retryInstance.defaults.headers.common["Authorization"] = token;
|
|
231
231
|
}
|
|
232
|
-
|
|
233
|
-
const { data } = await
|
|
232
|
+
retryInstance.defaults.headers.common["Accept-Language"] = getLocale();
|
|
233
|
+
const { data } = await retryInstance.request(config);
|
|
234
234
|
matchlog_default.log("api", data);
|
|
235
235
|
if (data.code == 401001) {
|
|
236
236
|
localStore.getState().logout();
|
|
@@ -933,7 +933,8 @@ function useWallet() {
|
|
|
933
933
|
name: chain?.nativeCurrency?.name || "ETH",
|
|
934
934
|
symbol: chain?.nativeCurrency?.symbol || "ETH",
|
|
935
935
|
decimals: chain?.nativeCurrency?.decimals || 18
|
|
936
|
-
}
|
|
936
|
+
},
|
|
937
|
+
rpcUrls: chain?.rpcUrls
|
|
937
938
|
}
|
|
938
939
|
});
|
|
939
940
|
},
|
|
@@ -970,15 +971,16 @@ function useWallet() {
|
|
|
970
971
|
const chainId = chain ? chain.id : await obj.getChainId();
|
|
971
972
|
const _chain = chain || obj.chain;
|
|
972
973
|
const transactionId = Date.now().toString() + Math.random().toString().slice(6);
|
|
973
|
-
|
|
974
|
-
|
|
974
|
+
window.matchProvider.transactionMessageIntervalMap[transactionId] = {
|
|
975
|
+
transaction,
|
|
976
|
+
func: async () => {
|
|
975
977
|
try {
|
|
976
978
|
const {
|
|
977
979
|
chain: chain2,
|
|
978
980
|
account,
|
|
979
981
|
...prepareTransactionRequest
|
|
980
982
|
// @ts-ignore
|
|
981
|
-
} = await obj.prepareTransactionRequest(transaction);
|
|
983
|
+
} = await obj.prepareTransactionRequest(window.matchProvider.transactionMessageIntervalMap[transactionId].transaction);
|
|
982
984
|
window.matchProvider.sendWalletMessage({
|
|
983
985
|
method: "prepareTransactionRequest",
|
|
984
986
|
data: {
|
|
@@ -989,9 +991,11 @@ function useWallet() {
|
|
|
989
991
|
} catch (error) {
|
|
990
992
|
console.error(error);
|
|
991
993
|
}
|
|
992
|
-
}
|
|
993
|
-
|
|
994
|
-
|
|
994
|
+
},
|
|
995
|
+
interval: setInterval(() => {
|
|
996
|
+
window.matchProvider.transactionMessageIntervalMap[transactionId].func();
|
|
997
|
+
}, 1e4)
|
|
998
|
+
};
|
|
995
999
|
try {
|
|
996
1000
|
const {
|
|
997
1001
|
chain: chain2,
|
|
@@ -1010,7 +1014,8 @@ function useWallet() {
|
|
|
1010
1014
|
chain: {
|
|
1011
1015
|
id: chainId,
|
|
1012
1016
|
name: _chain?.name,
|
|
1013
|
-
nativeCurrency: _chain?.nativeCurrency
|
|
1017
|
+
nativeCurrency: _chain?.nativeCurrency,
|
|
1018
|
+
rpcUrls: _chain?.rpcUrls
|
|
1014
1019
|
},
|
|
1015
1020
|
prepareTransactionRequest
|
|
1016
1021
|
}
|
|
@@ -1023,11 +1028,13 @@ function useWallet() {
|
|
|
1023
1028
|
hash: txHash,
|
|
1024
1029
|
chain: _chain
|
|
1025
1030
|
});
|
|
1026
|
-
clearInterval(interval);
|
|
1031
|
+
clearInterval(window.matchProvider.transactionMessageIntervalMap[transactionId].interval);
|
|
1032
|
+
delete window.matchProvider.transactionMessageIntervalMap[transactionId];
|
|
1027
1033
|
resolve(txHash);
|
|
1028
1034
|
} catch (error) {
|
|
1029
1035
|
console.error("qwe-sign-error", error);
|
|
1030
|
-
clearInterval(interval);
|
|
1036
|
+
clearInterval(window.matchProvider.transactionMessageIntervalMap[transactionId].interval);
|
|
1037
|
+
delete window.matchProvider.transactionMessageIntervalMap[transactionId];
|
|
1031
1038
|
reject(error);
|
|
1032
1039
|
}
|
|
1033
1040
|
};
|