@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/index.mjs
CHANGED
|
@@ -4,9 +4,9 @@ import {
|
|
|
4
4
|
useMatchEvents,
|
|
5
5
|
useUserInfo,
|
|
6
6
|
useWallet
|
|
7
|
-
} from "../chunk-
|
|
8
|
-
import "../chunk-SQIJR7RA.mjs";
|
|
7
|
+
} from "../chunk-KOA6YG3K.mjs";
|
|
9
8
|
import "../chunk-DPXMCLYK.mjs";
|
|
9
|
+
import "../chunk-SQIJR7RA.mjs";
|
|
10
10
|
import "../chunk-J5LGTIGS.mjs";
|
|
11
11
|
export {
|
|
12
12
|
useCopyClipboard,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
2
2
|
import { UseQueryOptions } from '@tanstack/react-query/src/types';
|
|
3
|
-
import { v as PohZkpassParams,
|
|
3
|
+
import { v as PohZkpassParams, o as BindItemType, n as BindInfoType, u as PohItemType } from './types-BOCbo3U7.js';
|
|
4
4
|
|
|
5
5
|
interface MyResponseType<T> {
|
|
6
6
|
code: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { A as AuthParams, C as ChainType, E as EmbeddedWalletsParams, R as RecoveryType } from './mpc-CTbBWHld.mjs';
|
|
2
|
-
import { A as AnyObject,
|
|
2
|
+
import { A as AnyObject, n as BindInfoType, o as BindItemType, p as BindWalletParam, B as ButtonProps, C as CEXType, D as DeepPartial, q as DrawerProps, E as EmailModalProps, a as IEnvConfigType, r as IEnvName, s as ILoginWalletReq, I as IMatchEvents, j as ISocialLoginMethod, m as IconProps, b as InputProps, L as LocaleType, d as LoginBoxProps, l as LoginMethodType, i as LoginModalProps, h as LoginPanelProps, t as MessageType, M as ModalProps, c as ModalWithHeaderProps, O as OtherLoginMethodType, k as OverviewInfo, u as PohItemType, v as PohZkpassParams, f as PopoverPositionType, P as PopoverProps, g as PopoverTypeType, R as RecommendLoginMethodType, T as ThemeType, U as UserPopoverProps, W as WalletConfigType, w as WalletPanelProps, x as WalletReceiveMessageType, e as WalletType } from './types-BOCbo3U7.mjs';
|
|
3
3
|
|
|
4
4
|
declare const index_AnyObject: typeof AnyObject;
|
|
5
5
|
declare const index_AuthParams: typeof AuthParams;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { j as ISocialLoginMethod, k as OverviewInfo, C as CEXType, l as LoginMethodType, I as IMatchEvents } from './types-BOCbo3U7.js';
|
|
2
2
|
import * as viem from 'viem';
|
|
3
3
|
import { Account, WalletClientConfig, createWalletClient, SignableMessage, Hex, TransactionSerializable, DeployContractParameters, SendTransactionParameters, WriteContractParameters, Chain } from 'viem';
|
|
4
4
|
import { C as ChainType, R as RecoveryType } from './mpc-CTbBWHld.js';
|
|
@@ -87,6 +87,9 @@ type signTransactionType = (params: {
|
|
|
87
87
|
symbol: string;
|
|
88
88
|
decimals: number;
|
|
89
89
|
};
|
|
90
|
+
rpcUrls: {
|
|
91
|
+
[key: string]: any;
|
|
92
|
+
};
|
|
90
93
|
};
|
|
91
94
|
}) => Promise<`0x02${string}` | `0x01${string}` | `0x03${string}` | `0x04${string}` | viem.TransactionSerializedLegacy>;
|
|
92
95
|
type recoverAfterType = (params: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { E as EmailModalProps,
|
|
2
|
+
import { E as EmailModalProps, b as InputProps, B as ButtonProps, M as ModalProps, c as ModalWithHeaderProps, P as PopoverProps, d as LoginBoxProps, O as OtherLoginMethodType, R as RecommendLoginMethodType, e as WalletType, f as PopoverPositionType, g as PopoverTypeType, h as LoginPanelProps, i as LoginModalProps } from './types-BOCbo3U7.mjs';
|
|
3
3
|
import { ReactNode, PropsWithChildren } from 'react';
|
|
4
4
|
import { C as ChainType, R as RecoveryType } from './mpc-CTbBWHld.mjs';
|
|
5
5
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { j as ISocialLoginMethod, k as OverviewInfo, C as CEXType, l as LoginMethodType, I as IMatchEvents } from './types-BOCbo3U7.mjs';
|
|
2
2
|
import * as viem from 'viem';
|
|
3
3
|
import { Account, WalletClientConfig, createWalletClient, SignableMessage, Hex, TransactionSerializable, DeployContractParameters, SendTransactionParameters, WriteContractParameters, Chain } from 'viem';
|
|
4
4
|
import { C as ChainType, R as RecoveryType } from './mpc-CTbBWHld.mjs';
|
|
@@ -87,6 +87,9 @@ type signTransactionType = (params: {
|
|
|
87
87
|
symbol: string;
|
|
88
88
|
decimals: number;
|
|
89
89
|
};
|
|
90
|
+
rpcUrls: {
|
|
91
|
+
[key: string]: any;
|
|
92
|
+
};
|
|
90
93
|
};
|
|
91
94
|
}) => Promise<`0x02${string}` | `0x01${string}` | `0x03${string}` | `0x04${string}` | viem.TransactionSerializedLegacy>;
|
|
92
95
|
type recoverAfterType = (params: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
2
2
|
import { UseQueryOptions } from '@tanstack/react-query/src/types';
|
|
3
|
-
import { v as PohZkpassParams,
|
|
3
|
+
import { v as PohZkpassParams, o as BindItemType, n as BindInfoType, u as PohItemType } from './types-BOCbo3U7.mjs';
|
|
4
4
|
|
|
5
5
|
interface MyResponseType<T> {
|
|
6
6
|
code: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { A as AuthParams, C as ChainType, E as EmbeddedWalletsParams, R as RecoveryType } from './mpc-CTbBWHld.js';
|
|
2
|
-
import { A as AnyObject,
|
|
2
|
+
import { A as AnyObject, n as BindInfoType, o as BindItemType, p as BindWalletParam, B as ButtonProps, C as CEXType, D as DeepPartial, q as DrawerProps, E as EmailModalProps, a as IEnvConfigType, r as IEnvName, s as ILoginWalletReq, I as IMatchEvents, j as ISocialLoginMethod, m as IconProps, b as InputProps, L as LocaleType, d as LoginBoxProps, l as LoginMethodType, i as LoginModalProps, h as LoginPanelProps, t as MessageType, M as ModalProps, c as ModalWithHeaderProps, O as OtherLoginMethodType, k as OverviewInfo, u as PohItemType, v as PohZkpassParams, f as PopoverPositionType, P as PopoverProps, g as PopoverTypeType, R as RecommendLoginMethodType, T as ThemeType, U as UserPopoverProps, W as WalletConfigType, w as WalletPanelProps, x as WalletReceiveMessageType, e as WalletType } from './types-BOCbo3U7.js';
|
|
3
3
|
|
|
4
4
|
declare const index_AnyObject: typeof AnyObject;
|
|
5
5
|
declare const index_AuthParams: typeof AuthParams;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { E as EmailModalProps,
|
|
2
|
+
import { E as EmailModalProps, b as InputProps, B as ButtonProps, M as ModalProps, c as ModalWithHeaderProps, P as PopoverProps, d as LoginBoxProps, O as OtherLoginMethodType, R as RecommendLoginMethodType, e as WalletType, f as PopoverPositionType, g as PopoverTypeType, h as LoginPanelProps, i as LoginModalProps } from './types-BOCbo3U7.js';
|
|
3
3
|
import { ReactNode, PropsWithChildren } from 'react';
|
|
4
4
|
import { C as ChainType, R as RecoveryType } from './mpc-CTbBWHld.js';
|
|
5
5
|
|
package/dist/index.css
CHANGED
|
@@ -568,7 +568,7 @@ body {
|
|
|
568
568
|
border-color: var(--matchid-btn-hover-bg);
|
|
569
569
|
}
|
|
570
570
|
|
|
571
|
-
.matchid-btn:
|
|
571
|
+
.matchid-btn:focus {
|
|
572
572
|
background: var(--matchid-btn-active-bg);
|
|
573
573
|
color: var(--matchid-btn-active-color);
|
|
574
574
|
box-shadow: var(--matchid-shadow-middle);
|
|
@@ -576,7 +576,7 @@ body {
|
|
|
576
576
|
}
|
|
577
577
|
|
|
578
578
|
|
|
579
|
-
.matchid-btn-highlight, .matchid-btn-highlight:hover, .matchid-btn-highlight:
|
|
579
|
+
.matchid-btn-highlight, .matchid-btn-highlight:hover, .matchid-btn-highlight:focus, .matchid-btn-highlight:not(:disabled):hover {
|
|
580
580
|
background: var(--matchid-btn-highlight-bg);
|
|
581
581
|
color: var(--matchid-btn-highlight-color);
|
|
582
582
|
border: 0;
|
|
@@ -748,8 +748,8 @@ body {
|
|
|
748
748
|
border-color: var(--matchid-login-btn-hover-border-color);
|
|
749
749
|
}
|
|
750
750
|
|
|
751
|
-
.matchid-login-btn:
|
|
752
|
-
.matchid-login-btn:not(:disabled):
|
|
751
|
+
.matchid-login-btn:focus,
|
|
752
|
+
.matchid-login-btn:not(:disabled):focus {
|
|
753
753
|
box-shadow: var(--matchid-shadow-small);
|
|
754
754
|
background: var(--matchid-login-btn-active-bg-color);
|
|
755
755
|
color: var(--matchid-login-btn-active-text-color);
|
package/dist/index.d.mts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
|
-
import { I as IMatchEvents, a as IEnvConfigType, L as LocaleType, W as WalletConfigType } from './types-
|
|
3
|
-
export { i as Components } from './index-
|
|
4
|
-
export { i as Hooks } from './index-
|
|
5
|
-
export { i as Api } from './index-
|
|
2
|
+
import { I as IMatchEvents, a as IEnvConfigType, L as LocaleType, W as WalletConfigType } from './types-BOCbo3U7.mjs';
|
|
3
|
+
export { i as Components } from './index-ClL_1acF.mjs';
|
|
4
|
+
export { i as Hooks } from './index-Cq_k0drT.mjs';
|
|
5
|
+
export { i as Api } from './index-CvsdzdHl.mjs';
|
|
6
6
|
export { i as Chains } from './index-DXRGMAbv.mjs';
|
|
7
|
-
export { i as Types } from './index-
|
|
7
|
+
export { i as Types } from './index-BKSFphOk.mjs';
|
|
8
8
|
import 'react/jsx-runtime';
|
|
9
9
|
import './mpc-CTbBWHld.mjs';
|
|
10
10
|
import 'viem';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
|
-
import { I as IMatchEvents, a as IEnvConfigType, L as LocaleType, W as WalletConfigType } from './types-
|
|
3
|
-
export { i as Components } from './index-
|
|
4
|
-
export { i as Hooks } from './index-
|
|
5
|
-
export { i as Api } from './index-
|
|
2
|
+
import { I as IMatchEvents, a as IEnvConfigType, L as LocaleType, W as WalletConfigType } from './types-BOCbo3U7.js';
|
|
3
|
+
export { i as Components } from './index-Dz7yUGcs.js';
|
|
4
|
+
export { i as Hooks } from './index-BdUFRwfe.js';
|
|
5
|
+
export { i as Api } from './index-BIQSRprZ.js';
|
|
6
6
|
export { i as Chains } from './index-DXRGMAbv.js';
|
|
7
|
-
export { i as Types } from './index-
|
|
7
|
+
export { i as Types } from './index-D8yek3rk.js';
|
|
8
8
|
import 'react/jsx-runtime';
|
|
9
9
|
import './mpc-CTbBWHld.js';
|
|
10
10
|
import 'viem';
|
package/dist/index.js
CHANGED
|
@@ -1480,13 +1480,13 @@ var retryRequest = async (config) => {
|
|
|
1480
1480
|
try {
|
|
1481
1481
|
const endpoints = getEndpoints();
|
|
1482
1482
|
const token = getToken();
|
|
1483
|
-
|
|
1484
|
-
|
|
1483
|
+
retryInstance.defaults.baseURL = `${endpoints.back}`;
|
|
1484
|
+
retryInstance.defaults.headers.common["Appid"] = getAppid();
|
|
1485
1485
|
if (token) {
|
|
1486
|
-
|
|
1486
|
+
retryInstance.defaults.headers.common["Authorization"] = token;
|
|
1487
1487
|
}
|
|
1488
|
-
|
|
1489
|
-
const { data } = await
|
|
1488
|
+
retryInstance.defaults.headers.common["Accept-Language"] = getLocale();
|
|
1489
|
+
const { data } = await retryInstance.request(config);
|
|
1490
1490
|
matchlog_default.log("api", data);
|
|
1491
1491
|
if (data.code == 401001) {
|
|
1492
1492
|
localStore.getState().logout();
|
|
@@ -2279,7 +2279,8 @@ function useWallet() {
|
|
|
2279
2279
|
name: chain?.nativeCurrency?.name || "ETH",
|
|
2280
2280
|
symbol: chain?.nativeCurrency?.symbol || "ETH",
|
|
2281
2281
|
decimals: chain?.nativeCurrency?.decimals || 18
|
|
2282
|
-
}
|
|
2282
|
+
},
|
|
2283
|
+
rpcUrls: chain?.rpcUrls
|
|
2283
2284
|
}
|
|
2284
2285
|
});
|
|
2285
2286
|
},
|
|
@@ -2316,15 +2317,16 @@ function useWallet() {
|
|
|
2316
2317
|
const chainId = chain ? chain.id : await obj.getChainId();
|
|
2317
2318
|
const _chain = chain || obj.chain;
|
|
2318
2319
|
const transactionId = Date.now().toString() + Math.random().toString().slice(6);
|
|
2319
|
-
|
|
2320
|
-
|
|
2320
|
+
window.matchProvider.transactionMessageIntervalMap[transactionId] = {
|
|
2321
|
+
transaction,
|
|
2322
|
+
func: async () => {
|
|
2321
2323
|
try {
|
|
2322
2324
|
const {
|
|
2323
2325
|
chain: chain2,
|
|
2324
2326
|
account,
|
|
2325
2327
|
...prepareTransactionRequest
|
|
2326
2328
|
// @ts-ignore
|
|
2327
|
-
} = await obj.prepareTransactionRequest(transaction);
|
|
2329
|
+
} = await obj.prepareTransactionRequest(window.matchProvider.transactionMessageIntervalMap[transactionId].transaction);
|
|
2328
2330
|
window.matchProvider.sendWalletMessage({
|
|
2329
2331
|
method: "prepareTransactionRequest",
|
|
2330
2332
|
data: {
|
|
@@ -2335,9 +2337,11 @@ function useWallet() {
|
|
|
2335
2337
|
} catch (error) {
|
|
2336
2338
|
console.error(error);
|
|
2337
2339
|
}
|
|
2338
|
-
}
|
|
2339
|
-
|
|
2340
|
-
|
|
2340
|
+
},
|
|
2341
|
+
interval: setInterval(() => {
|
|
2342
|
+
window.matchProvider.transactionMessageIntervalMap[transactionId].func();
|
|
2343
|
+
}, 1e4)
|
|
2344
|
+
};
|
|
2341
2345
|
try {
|
|
2342
2346
|
const {
|
|
2343
2347
|
chain: chain2,
|
|
@@ -2356,7 +2360,8 @@ function useWallet() {
|
|
|
2356
2360
|
chain: {
|
|
2357
2361
|
id: chainId,
|
|
2358
2362
|
name: _chain?.name,
|
|
2359
|
-
nativeCurrency: _chain?.nativeCurrency
|
|
2363
|
+
nativeCurrency: _chain?.nativeCurrency,
|
|
2364
|
+
rpcUrls: _chain?.rpcUrls
|
|
2360
2365
|
},
|
|
2361
2366
|
prepareTransactionRequest
|
|
2362
2367
|
}
|
|
@@ -2369,11 +2374,13 @@ function useWallet() {
|
|
|
2369
2374
|
hash: txHash,
|
|
2370
2375
|
chain: _chain
|
|
2371
2376
|
});
|
|
2372
|
-
clearInterval(interval);
|
|
2377
|
+
clearInterval(window.matchProvider.transactionMessageIntervalMap[transactionId].interval);
|
|
2378
|
+
delete window.matchProvider.transactionMessageIntervalMap[transactionId];
|
|
2373
2379
|
resolve(txHash);
|
|
2374
2380
|
} catch (error) {
|
|
2375
2381
|
console.error("qwe-sign-error", error);
|
|
2376
|
-
clearInterval(interval);
|
|
2382
|
+
clearInterval(window.matchProvider.transactionMessageIntervalMap[transactionId].interval);
|
|
2383
|
+
delete window.matchProvider.transactionMessageIntervalMap[transactionId];
|
|
2377
2384
|
reject(error);
|
|
2378
2385
|
}
|
|
2379
2386
|
};
|
|
@@ -4736,6 +4743,7 @@ function HashPanel({
|
|
|
4736
4743
|
setStatus("pending");
|
|
4737
4744
|
return false;
|
|
4738
4745
|
}
|
|
4746
|
+
matchlog_default.log("getTransactionReceipt", receipt);
|
|
4739
4747
|
if (receipt.status === "success") {
|
|
4740
4748
|
setStatus("success");
|
|
4741
4749
|
return true;
|
|
@@ -4993,6 +5001,7 @@ function useWalletInit({
|
|
|
4993
5001
|
createIframe();
|
|
4994
5002
|
if (!window.matchProvider) {
|
|
4995
5003
|
window.matchProvider = {
|
|
5004
|
+
transactionMessageIntervalMap: {},
|
|
4996
5005
|
walletMessageMap: {},
|
|
4997
5006
|
walletMessageStack: [],
|
|
4998
5007
|
sendWalletMessage: ({
|
|
@@ -5095,6 +5104,15 @@ function useWalletInit({
|
|
|
5095
5104
|
}
|
|
5096
5105
|
return;
|
|
5097
5106
|
}
|
|
5107
|
+
if (messageId == "updateTransactionData") {
|
|
5108
|
+
const { data, rootData, transactionId } = res.data;
|
|
5109
|
+
if (window.matchProvider.transactionMessageIntervalMap[transactionId] && window.matchProvider.transactionMessageIntervalMap[transactionId].transaction.data == rootData) {
|
|
5110
|
+
window.matchProvider.transactionMessageIntervalMap[transactionId].transaction.data = data;
|
|
5111
|
+
const { func } = window.matchProvider.transactionMessageIntervalMap[transactionId];
|
|
5112
|
+
func();
|
|
5113
|
+
}
|
|
5114
|
+
return;
|
|
5115
|
+
}
|
|
5098
5116
|
if (messageId && window.matchProvider.walletMessageMap[messageId]) {
|
|
5099
5117
|
const { resolve, reject, timeout } = window.matchProvider.walletMessageMap[messageId];
|
|
5100
5118
|
clearTimeout(timeout);
|