@matchain/matchid-sdk-react 0.1.42-alpha.1 → 0.1.42-alpha.10
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-U5KWO2YJ.mjs → chunk-N53ZMW5C.mjs} +2 -2
- package/dist/chunk-SQIJR7RA.mjs +29 -0
- package/dist/chunk-SQIJR7RA.mjs.map +1 -0
- package/dist/chunk-YG4MNAUD.mjs +4662 -0
- package/dist/chunk-YG4MNAUD.mjs.map +1 -0
- package/dist/components/index.d.mts +3 -2
- package/dist/components/index.d.ts +3 -2
- package/dist/components/index.js +676 -453
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +4 -1
- package/dist/hooks/api/index.d.mts +2 -2
- package/dist/hooks/api/index.d.ts +2 -2
- package/dist/hooks/api/index.js +120 -76
- package/dist/hooks/api/index.js.map +1 -1
- package/dist/hooks/api/index.mjs +3 -2
- package/dist/hooks/index.d.mts +5 -2
- package/dist/hooks/index.d.ts +5 -2
- package/dist/hooks/index.js +328 -145
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +2 -1
- package/dist/index-BxS06a5O.d.ts +50 -0
- package/dist/{index-Dq9Swg8r.d.ts → index-Ca9nh_8s.d.ts} +1 -1
- package/dist/{index-COlsBC-b.d.mts → index-CmH9iRLd.d.mts} +25 -12
- package/dist/{index-C3KZYrtu.d.mts → index-DFZpfAfc.d.mts} +1 -1
- package/dist/index-DKMrpRJC.d.ts +137 -0
- package/dist/{index-fS75Swm8.d.ts → index-DY_ReBra.d.ts} +25 -12
- package/dist/index-q5XDobUF.d.mts +50 -0
- package/dist/index-sOVSnYF4.d.mts +137 -0
- package/dist/index.css +84 -4
- package/dist/index.d.mts +9 -4
- package/dist/index.d.ts +9 -4
- package/dist/index.js +1100 -614
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -2
- package/dist/mpc-CTbBWHld.d.mts +20 -0
- package/dist/mpc-CTbBWHld.d.ts +20 -0
- package/dist/types/index.d.mts +3 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.js +44 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/index.mjs +10 -0
- package/dist/types/index.mjs.map +1 -0
- package/dist/types-CVwZEgQ0.d.mts +244 -0
- package/dist/types-CVwZEgQ0.d.ts +244 -0
- package/example/package.json +1 -0
- package/example/src/App.tsx +56 -27
- package/example/src/components/ButtonGroup/index.tsx +10 -0
- package/example/src/components/Login/index.tsx +2 -2
- package/example/src/components/RoutePrivate/index.tsx +4 -3
- package/example/src/config/chains/index.ts +2 -0
- package/example/src/config/chains/matchMain.ts +27 -0
- package/example/src/config/chains/matchTest.ts +33 -0
- package/example/src/config/index.ts +6 -2
- package/example/src/pages/User/components/BindListModal.tsx +10 -0
- package/example/src/pages/User/components/PohListModal.tsx +10 -0
- package/example/src/pages/User/components/QueryDisplay.tsx +25 -0
- package/example/src/pages/{User.tsx → User/index.tsx} +55 -84
- package/example/src/pages/Wallet.tsx +133 -44
- package/example/src/store/useLocalStore.ts +45 -0
- package/package.json +7 -2
- package/dist/chunk-SBOIXOAW.mjs +0 -4197
- package/dist/chunk-SBOIXOAW.mjs.map +0 -1
- package/dist/index-BrdP6eg5.d.ts +0 -93
- package/dist/index-D7bNSBwl.d.mts +0 -93
- package/dist/types.d-CLO_WLka.d.mts +0 -176
- package/dist/types.d-CLO_WLka.d.ts +0 -176
- /package/dist/{chunk-U5KWO2YJ.mjs.map → chunk-N53ZMW5C.mjs.map} +0 -0
package/dist/index.mjs
CHANGED
|
@@ -3,13 +3,16 @@ import {
|
|
|
3
3
|
} from "./chunk-HYQ3T6WW.mjs";
|
|
4
4
|
import {
|
|
5
5
|
api_exports
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-N53ZMW5C.mjs";
|
|
7
7
|
import {
|
|
8
8
|
MatchProvider,
|
|
9
9
|
components_exports,
|
|
10
10
|
hooks_exports,
|
|
11
11
|
useMatch
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-YG4MNAUD.mjs";
|
|
13
|
+
import {
|
|
14
|
+
types_exports
|
|
15
|
+
} from "./chunk-SQIJR7RA.mjs";
|
|
13
16
|
import "./chunk-DPXMCLYK.mjs";
|
|
14
17
|
import "./chunk-J5LGTIGS.mjs";
|
|
15
18
|
export {
|
|
@@ -18,6 +21,7 @@ export {
|
|
|
18
21
|
components_exports as Components,
|
|
19
22
|
hooks_exports as Hooks,
|
|
20
23
|
MatchProvider,
|
|
24
|
+
types_exports as Types,
|
|
21
25
|
useMatch
|
|
22
26
|
};
|
|
23
27
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
interface AuthParams {
|
|
2
|
+
AppId: string;
|
|
3
|
+
AppClientId: string;
|
|
4
|
+
UserId: string;
|
|
5
|
+
AccessToken: string;
|
|
6
|
+
Address?: string;
|
|
7
|
+
}
|
|
8
|
+
interface EmbeddedWalletsParams {
|
|
9
|
+
Url: string;
|
|
10
|
+
}
|
|
11
|
+
declare enum ChainType {
|
|
12
|
+
Ethereum = "ethereum",
|
|
13
|
+
Solana = "solana"
|
|
14
|
+
}
|
|
15
|
+
declare enum RecoveryType {
|
|
16
|
+
Base = "base_generated_recovery_key",
|
|
17
|
+
UserPasscode = "user_passcode_recovery_key"
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export { type AuthParams as A, ChainType as C, type EmbeddedWalletsParams as E, RecoveryType as R };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
interface AuthParams {
|
|
2
|
+
AppId: string;
|
|
3
|
+
AppClientId: string;
|
|
4
|
+
UserId: string;
|
|
5
|
+
AccessToken: string;
|
|
6
|
+
Address?: string;
|
|
7
|
+
}
|
|
8
|
+
interface EmbeddedWalletsParams {
|
|
9
|
+
Url: string;
|
|
10
|
+
}
|
|
11
|
+
declare enum ChainType {
|
|
12
|
+
Ethereum = "ethereum",
|
|
13
|
+
Solana = "solana"
|
|
14
|
+
}
|
|
15
|
+
declare enum RecoveryType {
|
|
16
|
+
Base = "base_generated_recovery_key",
|
|
17
|
+
UserPasscode = "user_passcode_recovery_key"
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export { type AuthParams as A, ChainType as C, type EmbeddedWalletsParams as E, RecoveryType as R };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { A as AuthParams, C as ChainType, E as EmbeddedWalletsParams, R as RecoveryType } from '../mpc-CTbBWHld.mjs';
|
|
2
|
+
export { A as AnyObject, m as BindInfoType, n as BindItemType, o as BindWalletParam, B as ButtonProps, C as CEXType, D as DeepPartial, p as DrawerProps, E as EmailModalProps, a as IEnvConfigType, q as IEnvName, r as ILoginWalletReq, I as IMatchEvents, j as ISocialLoginMethod, s 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-CVwZEgQ0.mjs';
|
|
3
|
+
import 'react';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { A as AuthParams, C as ChainType, E as EmbeddedWalletsParams, R as RecoveryType } from '../mpc-CTbBWHld.js';
|
|
2
|
+
export { A as AnyObject, m as BindInfoType, n as BindItemType, o as BindWalletParam, B as ButtonProps, C as CEXType, D as DeepPartial, p as DrawerProps, E as EmailModalProps, a as IEnvConfigType, q as IEnvName, r as ILoginWalletReq, I as IMatchEvents, j as ISocialLoginMethod, s 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-CVwZEgQ0.js';
|
|
3
|
+
import 'react';
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/types/index.ts
|
|
21
|
+
var types_exports = {};
|
|
22
|
+
__export(types_exports, {
|
|
23
|
+
ChainType: () => ChainType,
|
|
24
|
+
RecoveryType: () => RecoveryType
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(types_exports);
|
|
27
|
+
|
|
28
|
+
// src/types/mpc.ts
|
|
29
|
+
var ChainType = /* @__PURE__ */ ((ChainType2) => {
|
|
30
|
+
ChainType2["Ethereum"] = "ethereum";
|
|
31
|
+
ChainType2["Solana"] = "solana";
|
|
32
|
+
return ChainType2;
|
|
33
|
+
})(ChainType || {});
|
|
34
|
+
var RecoveryType = /* @__PURE__ */ ((RecoveryType2) => {
|
|
35
|
+
RecoveryType2["Base"] = "base_generated_recovery_key";
|
|
36
|
+
RecoveryType2["UserPasscode"] = "user_passcode_recovery_key";
|
|
37
|
+
return RecoveryType2;
|
|
38
|
+
})(RecoveryType || {});
|
|
39
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
40
|
+
0 && (module.exports = {
|
|
41
|
+
ChainType,
|
|
42
|
+
RecoveryType
|
|
43
|
+
});
|
|
44
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/types/index.ts","../../src/types/mpc.ts"],"sourcesContent":["export * from \"./mpc\"\nexport * from \"./types\"","export interface AuthParams {\n AppId: string;\n AppClientId: string;\n UserId: string;\n AccessToken: string;\n Address?: string;\n}\n\nexport interface EmbeddedWalletsParams {\n Url: string;\n}\nexport enum ChainType {\n Ethereum = \"ethereum\",\n Solana = \"solana\"\n}\nexport enum RecoveryType {\n Base = \"base_generated_recovery_key\",\n UserPasscode = \"user_passcode_recovery_key\"\n}\n// export type ChainType = \"ethereum\" | \"solana\";\n// export type RecoveryType = \"base_generated_recovery_key\" | \"user_passcode_recovery_key\""],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACWO,IAAK,YAAL,kBAAKA,eAAL;AACH,EAAAA,WAAA,cAAW;AACX,EAAAA,WAAA,YAAS;AAFD,SAAAA;AAAA,GAAA;AAIL,IAAK,eAAL,kBAAKC,kBAAL;AACH,EAAAA,cAAA,UAAO;AACP,EAAAA,cAAA,kBAAe;AAFP,SAAAA;AAAA,GAAA;","names":["ChainType","RecoveryType"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
import { CSSProperties, PropsWithChildren, ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
type ISocialLoginMethod = 'google' | 'twitter' | 'discord' | 'github' | 'telegram' | 'linkedin' | 'facebook' | 'youtube';
|
|
4
|
+
type WalletType = 'evm' | 'sol' | 'tron' | 'btc' | 'ton';
|
|
5
|
+
type LoginMethodType = WalletType | 'email' | ISocialLoginMethod;
|
|
6
|
+
type CEXType = "Gate" | "Coinbase" | "Kucoin" | 'Bitget' | 'OKX' | 'Bybit' | 'Binance';
|
|
7
|
+
type OtherLoginMethodType = 'email' | ISocialLoginMethod;
|
|
8
|
+
type RecommendLoginMethodType = 'wallet' | 'email' | ISocialLoginMethod;
|
|
9
|
+
type IEnvName = 'main' | 'dev' | 'test';
|
|
10
|
+
type IEnvConfigType = {
|
|
11
|
+
endpoints: {
|
|
12
|
+
back: string;
|
|
13
|
+
auth: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
type ILoginWalletReq = {
|
|
17
|
+
domain: string;
|
|
18
|
+
statement: string;
|
|
19
|
+
address: string;
|
|
20
|
+
chainId: number;
|
|
21
|
+
version: string;
|
|
22
|
+
uri: string;
|
|
23
|
+
nonce: string;
|
|
24
|
+
issuedAt?: string;
|
|
25
|
+
};
|
|
26
|
+
type IMatchEvents = {
|
|
27
|
+
onLogin?: (data: {
|
|
28
|
+
mid?: string;
|
|
29
|
+
token: string;
|
|
30
|
+
did: string;
|
|
31
|
+
}) => void;
|
|
32
|
+
onLogout?: () => void;
|
|
33
|
+
onBind?: (data: {
|
|
34
|
+
type: string;
|
|
35
|
+
}) => void;
|
|
36
|
+
};
|
|
37
|
+
type BindWalletParam = {
|
|
38
|
+
type: string;
|
|
39
|
+
address: string;
|
|
40
|
+
signature: any;
|
|
41
|
+
message: string;
|
|
42
|
+
connector_type: string;
|
|
43
|
+
wallet_client_type: string;
|
|
44
|
+
};
|
|
45
|
+
type OverviewInfo = {
|
|
46
|
+
score: number;
|
|
47
|
+
total_assets: number;
|
|
48
|
+
wallets: number;
|
|
49
|
+
followers: number;
|
|
50
|
+
sbt: number;
|
|
51
|
+
is_kyc: boolean;
|
|
52
|
+
is_poh: boolean;
|
|
53
|
+
mid: string;
|
|
54
|
+
user_identity: string;
|
|
55
|
+
identities: {
|
|
56
|
+
[key: string]: string;
|
|
57
|
+
};
|
|
58
|
+
did: string;
|
|
59
|
+
address: string;
|
|
60
|
+
username?: string;
|
|
61
|
+
};
|
|
62
|
+
type AnyObject = {
|
|
63
|
+
[key: string]: any;
|
|
64
|
+
};
|
|
65
|
+
type ThemeType = {
|
|
66
|
+
modal: {
|
|
67
|
+
header: CSSProperties;
|
|
68
|
+
input: CSSProperties;
|
|
69
|
+
back: CSSProperties;
|
|
70
|
+
close: CSSProperties;
|
|
71
|
+
content: CSSProperties;
|
|
72
|
+
overlay: CSSProperties;
|
|
73
|
+
error: CSSProperties;
|
|
74
|
+
};
|
|
75
|
+
email: {
|
|
76
|
+
addressInput: CSSProperties;
|
|
77
|
+
address: CSSProperties;
|
|
78
|
+
codeBox: CSSProperties;
|
|
79
|
+
codeInput: CSSProperties;
|
|
80
|
+
codeButton: CSSProperties;
|
|
81
|
+
codeButtonDisabled: CSSProperties;
|
|
82
|
+
};
|
|
83
|
+
login: {
|
|
84
|
+
box: CSSProperties;
|
|
85
|
+
item: CSSProperties;
|
|
86
|
+
itemIcon: CSSProperties;
|
|
87
|
+
itemName: CSSProperties;
|
|
88
|
+
content: CSSProperties;
|
|
89
|
+
arrow: CSSProperties;
|
|
90
|
+
};
|
|
91
|
+
button: {
|
|
92
|
+
default: CSSProperties;
|
|
93
|
+
disabled: CSSProperties;
|
|
94
|
+
line: CSSProperties;
|
|
95
|
+
};
|
|
96
|
+
user: {
|
|
97
|
+
item: CSSProperties;
|
|
98
|
+
value: CSSProperties;
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
type DeepPartial<T> = {
|
|
102
|
+
[P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
|
|
103
|
+
};
|
|
104
|
+
type WalletReceiveMessageType = {
|
|
105
|
+
source: 'match-wallet';
|
|
106
|
+
method: string;
|
|
107
|
+
data: any;
|
|
108
|
+
status: 'success' | 'failed';
|
|
109
|
+
messageId: string;
|
|
110
|
+
version: number;
|
|
111
|
+
};
|
|
112
|
+
type MessageType = {
|
|
113
|
+
method: string;
|
|
114
|
+
data: any;
|
|
115
|
+
};
|
|
116
|
+
type IconProps = {
|
|
117
|
+
color?: string;
|
|
118
|
+
size?: number | string;
|
|
119
|
+
width?: number | string;
|
|
120
|
+
height?: number | string;
|
|
121
|
+
style?: CSSProperties;
|
|
122
|
+
className?: string;
|
|
123
|
+
onClick?: (e?: any) => void;
|
|
124
|
+
};
|
|
125
|
+
type ModalProps = PropsWithChildren & {
|
|
126
|
+
isOpen: boolean;
|
|
127
|
+
width?: number;
|
|
128
|
+
className?: string;
|
|
129
|
+
zIndex?: number;
|
|
130
|
+
};
|
|
131
|
+
type ModalWithHeaderProps = ModalProps & {
|
|
132
|
+
onBack?: () => void;
|
|
133
|
+
onClose?: () => void;
|
|
134
|
+
title?: ReactNode;
|
|
135
|
+
showClose?: boolean;
|
|
136
|
+
showBorder?: boolean;
|
|
137
|
+
};
|
|
138
|
+
type InputProps = {
|
|
139
|
+
placeholder?: string;
|
|
140
|
+
value?: string;
|
|
141
|
+
onChange?: (e?: any) => void;
|
|
142
|
+
disabled?: boolean;
|
|
143
|
+
readonly?: boolean;
|
|
144
|
+
type?: string;
|
|
145
|
+
maxLength?: number;
|
|
146
|
+
className?: string;
|
|
147
|
+
after?: React.ReactNode;
|
|
148
|
+
};
|
|
149
|
+
type LoginBoxProps = {
|
|
150
|
+
methods?: OtherLoginMethodType[];
|
|
151
|
+
inModal?: boolean;
|
|
152
|
+
recommendMethods?: RecommendLoginMethodType[];
|
|
153
|
+
walletMethods?: WalletType[];
|
|
154
|
+
};
|
|
155
|
+
type LoginPanelProps = {
|
|
156
|
+
header?: React.ReactNode;
|
|
157
|
+
onClose?: () => void;
|
|
158
|
+
} & LoginBoxProps;
|
|
159
|
+
type LoginModalProps = LoginPanelProps & ModalProps;
|
|
160
|
+
type EmailModalProps = ModalProps & {
|
|
161
|
+
onClose?: () => void;
|
|
162
|
+
onBack?: () => void;
|
|
163
|
+
onLogin?: () => void;
|
|
164
|
+
};
|
|
165
|
+
type ButtonProps = {
|
|
166
|
+
size?: 'sm' | 'df' | 'lg';
|
|
167
|
+
type?: "button" | "submit" | "reset";
|
|
168
|
+
rounded?: boolean;
|
|
169
|
+
block?: boolean;
|
|
170
|
+
disabled?: boolean;
|
|
171
|
+
loading?: boolean;
|
|
172
|
+
children?: React.ReactNode;
|
|
173
|
+
onClick?: () => void;
|
|
174
|
+
highlight?: boolean;
|
|
175
|
+
style?: CSSProperties;
|
|
176
|
+
className?: string;
|
|
177
|
+
};
|
|
178
|
+
type BindItemType = {
|
|
179
|
+
type: string;
|
|
180
|
+
type_sort: string;
|
|
181
|
+
platform_name: string;
|
|
182
|
+
platform_id: number;
|
|
183
|
+
platform_uid: string;
|
|
184
|
+
platform_nickname: string;
|
|
185
|
+
platform_status: number;
|
|
186
|
+
};
|
|
187
|
+
type PohItemType = {
|
|
188
|
+
user_id: number;
|
|
189
|
+
poh_market_id: number;
|
|
190
|
+
image_type: string;
|
|
191
|
+
category: string;
|
|
192
|
+
name: string;
|
|
193
|
+
app_id: string;
|
|
194
|
+
schema_id: string;
|
|
195
|
+
active: boolean;
|
|
196
|
+
};
|
|
197
|
+
type BindInfoType = {
|
|
198
|
+
progress_count: number;
|
|
199
|
+
progress_current: number;
|
|
200
|
+
total_assets: number;
|
|
201
|
+
wallet_count: number;
|
|
202
|
+
wallet_current: number;
|
|
203
|
+
cex_count: number;
|
|
204
|
+
cex_current: number;
|
|
205
|
+
social_count: number;
|
|
206
|
+
social_current: number;
|
|
207
|
+
others_count: number;
|
|
208
|
+
others_current: number;
|
|
209
|
+
};
|
|
210
|
+
type PohZkpassParams = {
|
|
211
|
+
taskId: string;
|
|
212
|
+
schemaId: string;
|
|
213
|
+
publicFields: any;
|
|
214
|
+
allocatorAddress: string;
|
|
215
|
+
publicFieldsHash: string;
|
|
216
|
+
allocatorSignature: string;
|
|
217
|
+
uHash: string;
|
|
218
|
+
validatorAddress: string;
|
|
219
|
+
validatorSignature: string;
|
|
220
|
+
};
|
|
221
|
+
type PopoverPositionType = "center" | "left" | "right";
|
|
222
|
+
type PopoverTypeType = "hover" | "click";
|
|
223
|
+
type PopoverProps = PropsWithChildren & {
|
|
224
|
+
position?: PopoverPositionType;
|
|
225
|
+
type?: PopoverTypeType;
|
|
226
|
+
content: ReactNode;
|
|
227
|
+
className?: string;
|
|
228
|
+
gap?: number | string;
|
|
229
|
+
};
|
|
230
|
+
type UserPopoverProps = Omit<PopoverProps, 'content'>;
|
|
231
|
+
type LocaleType = "en" | "zh" | "tw" | "fr" | "ja" | "ko" | "vi" | "es" | "pt";
|
|
232
|
+
type WalletConfigType = {
|
|
233
|
+
type: "Base" | "UserPasscode";
|
|
234
|
+
};
|
|
235
|
+
type DrawerProps = PropsWithChildren & {
|
|
236
|
+
showClose?: boolean;
|
|
237
|
+
onClose?: () => void;
|
|
238
|
+
isOpen: boolean;
|
|
239
|
+
};
|
|
240
|
+
type WalletPanelProps = DrawerProps & {
|
|
241
|
+
title?: React.ReactNode;
|
|
242
|
+
};
|
|
243
|
+
|
|
244
|
+
export type { AnyObject as A, ButtonProps as B, CEXType as C, DeepPartial as D, EmailModalProps as E, IMatchEvents as I, LocaleType as L, ModalProps as M, OtherLoginMethodType as O, PopoverProps as P, RecommendLoginMethodType as R, ThemeType as T, UserPopoverProps as U, WalletConfigType as W, IEnvConfigType as a, InputProps as b, ModalWithHeaderProps as c, LoginBoxProps as d, WalletType as e, PopoverPositionType as f, PopoverTypeType as g, LoginPanelProps as h, LoginModalProps as i, ISocialLoginMethod as j, OverviewInfo as k, LoginMethodType as l, BindInfoType as m, BindItemType as n, BindWalletParam as o, DrawerProps as p, IEnvName as q, ILoginWalletReq as r, IconProps as s, MessageType as t, PohItemType as u, PohZkpassParams as v, WalletPanelProps as w, WalletReceiveMessageType as x };
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
import { CSSProperties, PropsWithChildren, ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
type ISocialLoginMethod = 'google' | 'twitter' | 'discord' | 'github' | 'telegram' | 'linkedin' | 'facebook' | 'youtube';
|
|
4
|
+
type WalletType = 'evm' | 'sol' | 'tron' | 'btc' | 'ton';
|
|
5
|
+
type LoginMethodType = WalletType | 'email' | ISocialLoginMethod;
|
|
6
|
+
type CEXType = "Gate" | "Coinbase" | "Kucoin" | 'Bitget' | 'OKX' | 'Bybit' | 'Binance';
|
|
7
|
+
type OtherLoginMethodType = 'email' | ISocialLoginMethod;
|
|
8
|
+
type RecommendLoginMethodType = 'wallet' | 'email' | ISocialLoginMethod;
|
|
9
|
+
type IEnvName = 'main' | 'dev' | 'test';
|
|
10
|
+
type IEnvConfigType = {
|
|
11
|
+
endpoints: {
|
|
12
|
+
back: string;
|
|
13
|
+
auth: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
type ILoginWalletReq = {
|
|
17
|
+
domain: string;
|
|
18
|
+
statement: string;
|
|
19
|
+
address: string;
|
|
20
|
+
chainId: number;
|
|
21
|
+
version: string;
|
|
22
|
+
uri: string;
|
|
23
|
+
nonce: string;
|
|
24
|
+
issuedAt?: string;
|
|
25
|
+
};
|
|
26
|
+
type IMatchEvents = {
|
|
27
|
+
onLogin?: (data: {
|
|
28
|
+
mid?: string;
|
|
29
|
+
token: string;
|
|
30
|
+
did: string;
|
|
31
|
+
}) => void;
|
|
32
|
+
onLogout?: () => void;
|
|
33
|
+
onBind?: (data: {
|
|
34
|
+
type: string;
|
|
35
|
+
}) => void;
|
|
36
|
+
};
|
|
37
|
+
type BindWalletParam = {
|
|
38
|
+
type: string;
|
|
39
|
+
address: string;
|
|
40
|
+
signature: any;
|
|
41
|
+
message: string;
|
|
42
|
+
connector_type: string;
|
|
43
|
+
wallet_client_type: string;
|
|
44
|
+
};
|
|
45
|
+
type OverviewInfo = {
|
|
46
|
+
score: number;
|
|
47
|
+
total_assets: number;
|
|
48
|
+
wallets: number;
|
|
49
|
+
followers: number;
|
|
50
|
+
sbt: number;
|
|
51
|
+
is_kyc: boolean;
|
|
52
|
+
is_poh: boolean;
|
|
53
|
+
mid: string;
|
|
54
|
+
user_identity: string;
|
|
55
|
+
identities: {
|
|
56
|
+
[key: string]: string;
|
|
57
|
+
};
|
|
58
|
+
did: string;
|
|
59
|
+
address: string;
|
|
60
|
+
username?: string;
|
|
61
|
+
};
|
|
62
|
+
type AnyObject = {
|
|
63
|
+
[key: string]: any;
|
|
64
|
+
};
|
|
65
|
+
type ThemeType = {
|
|
66
|
+
modal: {
|
|
67
|
+
header: CSSProperties;
|
|
68
|
+
input: CSSProperties;
|
|
69
|
+
back: CSSProperties;
|
|
70
|
+
close: CSSProperties;
|
|
71
|
+
content: CSSProperties;
|
|
72
|
+
overlay: CSSProperties;
|
|
73
|
+
error: CSSProperties;
|
|
74
|
+
};
|
|
75
|
+
email: {
|
|
76
|
+
addressInput: CSSProperties;
|
|
77
|
+
address: CSSProperties;
|
|
78
|
+
codeBox: CSSProperties;
|
|
79
|
+
codeInput: CSSProperties;
|
|
80
|
+
codeButton: CSSProperties;
|
|
81
|
+
codeButtonDisabled: CSSProperties;
|
|
82
|
+
};
|
|
83
|
+
login: {
|
|
84
|
+
box: CSSProperties;
|
|
85
|
+
item: CSSProperties;
|
|
86
|
+
itemIcon: CSSProperties;
|
|
87
|
+
itemName: CSSProperties;
|
|
88
|
+
content: CSSProperties;
|
|
89
|
+
arrow: CSSProperties;
|
|
90
|
+
};
|
|
91
|
+
button: {
|
|
92
|
+
default: CSSProperties;
|
|
93
|
+
disabled: CSSProperties;
|
|
94
|
+
line: CSSProperties;
|
|
95
|
+
};
|
|
96
|
+
user: {
|
|
97
|
+
item: CSSProperties;
|
|
98
|
+
value: CSSProperties;
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
type DeepPartial<T> = {
|
|
102
|
+
[P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
|
|
103
|
+
};
|
|
104
|
+
type WalletReceiveMessageType = {
|
|
105
|
+
source: 'match-wallet';
|
|
106
|
+
method: string;
|
|
107
|
+
data: any;
|
|
108
|
+
status: 'success' | 'failed';
|
|
109
|
+
messageId: string;
|
|
110
|
+
version: number;
|
|
111
|
+
};
|
|
112
|
+
type MessageType = {
|
|
113
|
+
method: string;
|
|
114
|
+
data: any;
|
|
115
|
+
};
|
|
116
|
+
type IconProps = {
|
|
117
|
+
color?: string;
|
|
118
|
+
size?: number | string;
|
|
119
|
+
width?: number | string;
|
|
120
|
+
height?: number | string;
|
|
121
|
+
style?: CSSProperties;
|
|
122
|
+
className?: string;
|
|
123
|
+
onClick?: (e?: any) => void;
|
|
124
|
+
};
|
|
125
|
+
type ModalProps = PropsWithChildren & {
|
|
126
|
+
isOpen: boolean;
|
|
127
|
+
width?: number;
|
|
128
|
+
className?: string;
|
|
129
|
+
zIndex?: number;
|
|
130
|
+
};
|
|
131
|
+
type ModalWithHeaderProps = ModalProps & {
|
|
132
|
+
onBack?: () => void;
|
|
133
|
+
onClose?: () => void;
|
|
134
|
+
title?: ReactNode;
|
|
135
|
+
showClose?: boolean;
|
|
136
|
+
showBorder?: boolean;
|
|
137
|
+
};
|
|
138
|
+
type InputProps = {
|
|
139
|
+
placeholder?: string;
|
|
140
|
+
value?: string;
|
|
141
|
+
onChange?: (e?: any) => void;
|
|
142
|
+
disabled?: boolean;
|
|
143
|
+
readonly?: boolean;
|
|
144
|
+
type?: string;
|
|
145
|
+
maxLength?: number;
|
|
146
|
+
className?: string;
|
|
147
|
+
after?: React.ReactNode;
|
|
148
|
+
};
|
|
149
|
+
type LoginBoxProps = {
|
|
150
|
+
methods?: OtherLoginMethodType[];
|
|
151
|
+
inModal?: boolean;
|
|
152
|
+
recommendMethods?: RecommendLoginMethodType[];
|
|
153
|
+
walletMethods?: WalletType[];
|
|
154
|
+
};
|
|
155
|
+
type LoginPanelProps = {
|
|
156
|
+
header?: React.ReactNode;
|
|
157
|
+
onClose?: () => void;
|
|
158
|
+
} & LoginBoxProps;
|
|
159
|
+
type LoginModalProps = LoginPanelProps & ModalProps;
|
|
160
|
+
type EmailModalProps = ModalProps & {
|
|
161
|
+
onClose?: () => void;
|
|
162
|
+
onBack?: () => void;
|
|
163
|
+
onLogin?: () => void;
|
|
164
|
+
};
|
|
165
|
+
type ButtonProps = {
|
|
166
|
+
size?: 'sm' | 'df' | 'lg';
|
|
167
|
+
type?: "button" | "submit" | "reset";
|
|
168
|
+
rounded?: boolean;
|
|
169
|
+
block?: boolean;
|
|
170
|
+
disabled?: boolean;
|
|
171
|
+
loading?: boolean;
|
|
172
|
+
children?: React.ReactNode;
|
|
173
|
+
onClick?: () => void;
|
|
174
|
+
highlight?: boolean;
|
|
175
|
+
style?: CSSProperties;
|
|
176
|
+
className?: string;
|
|
177
|
+
};
|
|
178
|
+
type BindItemType = {
|
|
179
|
+
type: string;
|
|
180
|
+
type_sort: string;
|
|
181
|
+
platform_name: string;
|
|
182
|
+
platform_id: number;
|
|
183
|
+
platform_uid: string;
|
|
184
|
+
platform_nickname: string;
|
|
185
|
+
platform_status: number;
|
|
186
|
+
};
|
|
187
|
+
type PohItemType = {
|
|
188
|
+
user_id: number;
|
|
189
|
+
poh_market_id: number;
|
|
190
|
+
image_type: string;
|
|
191
|
+
category: string;
|
|
192
|
+
name: string;
|
|
193
|
+
app_id: string;
|
|
194
|
+
schema_id: string;
|
|
195
|
+
active: boolean;
|
|
196
|
+
};
|
|
197
|
+
type BindInfoType = {
|
|
198
|
+
progress_count: number;
|
|
199
|
+
progress_current: number;
|
|
200
|
+
total_assets: number;
|
|
201
|
+
wallet_count: number;
|
|
202
|
+
wallet_current: number;
|
|
203
|
+
cex_count: number;
|
|
204
|
+
cex_current: number;
|
|
205
|
+
social_count: number;
|
|
206
|
+
social_current: number;
|
|
207
|
+
others_count: number;
|
|
208
|
+
others_current: number;
|
|
209
|
+
};
|
|
210
|
+
type PohZkpassParams = {
|
|
211
|
+
taskId: string;
|
|
212
|
+
schemaId: string;
|
|
213
|
+
publicFields: any;
|
|
214
|
+
allocatorAddress: string;
|
|
215
|
+
publicFieldsHash: string;
|
|
216
|
+
allocatorSignature: string;
|
|
217
|
+
uHash: string;
|
|
218
|
+
validatorAddress: string;
|
|
219
|
+
validatorSignature: string;
|
|
220
|
+
};
|
|
221
|
+
type PopoverPositionType = "center" | "left" | "right";
|
|
222
|
+
type PopoverTypeType = "hover" | "click";
|
|
223
|
+
type PopoverProps = PropsWithChildren & {
|
|
224
|
+
position?: PopoverPositionType;
|
|
225
|
+
type?: PopoverTypeType;
|
|
226
|
+
content: ReactNode;
|
|
227
|
+
className?: string;
|
|
228
|
+
gap?: number | string;
|
|
229
|
+
};
|
|
230
|
+
type UserPopoverProps = Omit<PopoverProps, 'content'>;
|
|
231
|
+
type LocaleType = "en" | "zh" | "tw" | "fr" | "ja" | "ko" | "vi" | "es" | "pt";
|
|
232
|
+
type WalletConfigType = {
|
|
233
|
+
type: "Base" | "UserPasscode";
|
|
234
|
+
};
|
|
235
|
+
type DrawerProps = PropsWithChildren & {
|
|
236
|
+
showClose?: boolean;
|
|
237
|
+
onClose?: () => void;
|
|
238
|
+
isOpen: boolean;
|
|
239
|
+
};
|
|
240
|
+
type WalletPanelProps = DrawerProps & {
|
|
241
|
+
title?: React.ReactNode;
|
|
242
|
+
};
|
|
243
|
+
|
|
244
|
+
export type { AnyObject as A, ButtonProps as B, CEXType as C, DeepPartial as D, EmailModalProps as E, IMatchEvents as I, LocaleType as L, ModalProps as M, OtherLoginMethodType as O, PopoverProps as P, RecommendLoginMethodType as R, ThemeType as T, UserPopoverProps as U, WalletConfigType as W, IEnvConfigType as a, InputProps as b, ModalWithHeaderProps as c, LoginBoxProps as d, WalletType as e, PopoverPositionType as f, PopoverTypeType as g, LoginPanelProps as h, LoginModalProps as i, ISocialLoginMethod as j, OverviewInfo as k, LoginMethodType as l, BindInfoType as m, BindItemType as n, BindWalletParam as o, DrawerProps as p, IEnvName as q, ILoginWalletReq as r, IconProps as s, MessageType as t, PohItemType as u, PohZkpassParams as v, WalletPanelProps as w, WalletReceiveMessageType as x };
|
package/example/package.json
CHANGED
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
"react": "../node_modules/react",
|
|
18
18
|
"react-dom": "../node_modules/react-dom/profiling",
|
|
19
19
|
"axios": "../node_modules/axios",
|
|
20
|
+
"zustand": "../node_modules/zustand",
|
|
20
21
|
"react-router-dom": "../node_modules/react-router-dom",
|
|
21
22
|
"@types/react-router-dom": "../node_modules/@types/react-router-dom"
|
|
22
23
|
},
|