@matchain/matchid-sdk-react 0.1.41 → 0.1.42-alpha.0
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-RYZFW6P6.mjs → chunk-OVZZIJZP.mjs} +44 -3
- package/dist/chunk-OVZZIJZP.mjs.map +1 -0
- package/dist/{chunk-B2HVAJPQ.mjs → chunk-ZP4OU66T.mjs} +2 -2
- package/dist/components/index.js +43 -2
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +1 -1
- package/dist/hooks/api/index.js +43 -2
- 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 +43 -2
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +1 -1
- package/dist/{index-DoF5jRoi.d.ts → index-Blx4Nrwm.d.ts} +18 -0
- package/dist/{index-fl6SNIZC.d.mts → index-C1uG-2K1.d.mts} +18 -0
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +43 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -5
- package/example/src/config/index.ts +19 -1
- package/example/src/pages/User.tsx +27 -3
- package/package.json +1 -1
- package/dist/chunk-RYZFW6P6.mjs.map +0 -1
- /package/dist/{chunk-B2HVAJPQ.mjs.map → chunk-ZP4OU66T.mjs.map} +0 -0
package/dist/index.mjs
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
chains_exports
|
|
3
|
-
} from "./chunk-HYQ3T6WW.mjs";
|
|
4
1
|
import {
|
|
5
2
|
api_exports
|
|
6
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ZP4OU66T.mjs";
|
|
7
4
|
import {
|
|
8
5
|
MatchProvider,
|
|
9
6
|
components_exports,
|
|
10
7
|
hooks_exports,
|
|
11
8
|
useMatch
|
|
12
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-OVZZIJZP.mjs";
|
|
13
10
|
import "./chunk-DPXMCLYK.mjs";
|
|
11
|
+
import {
|
|
12
|
+
chains_exports
|
|
13
|
+
} from "./chunk-HYQ3T6WW.mjs";
|
|
14
14
|
import "./chunk-J5LGTIGS.mjs";
|
|
15
15
|
export {
|
|
16
16
|
api_exports as Api,
|
|
@@ -22,4 +22,22 @@ export const LocaleList = [
|
|
|
22
22
|
export const CEXList = [
|
|
23
23
|
"Gate", "Coinbase", "Kucoin", 'Bitget', 'OKX', 'Bybit', 'Binance']
|
|
24
24
|
|
|
25
|
-
export const WalletMethod:WalletType[] = ["evm","sol","btc","tron","ton"]
|
|
25
|
+
export const WalletMethod:WalletType[] = ["evm","sol","btc","tron","ton"]
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
export const LOGIN_METHOD_MAP = {
|
|
29
|
+
email: 'Email',
|
|
30
|
+
evm: "EVM",
|
|
31
|
+
sol: "SOL",
|
|
32
|
+
btc: "BTC",
|
|
33
|
+
ton: "TON",
|
|
34
|
+
tron: "TRON",
|
|
35
|
+
google: "Google",
|
|
36
|
+
facebook: "Facebook",
|
|
37
|
+
x: "X",
|
|
38
|
+
telegram: "Telegram",
|
|
39
|
+
github: "Github",
|
|
40
|
+
discord: "Discord",
|
|
41
|
+
linkedin: "LinkedIn",
|
|
42
|
+
youtube: "Youtube",
|
|
43
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {Hooks, Components, Api} from "@matchain/matchid-sdk-react"
|
|
2
2
|
import React from "react";
|
|
3
3
|
import RoutePrivate from "../components/RoutePrivate";
|
|
4
|
-
import {CEXList, LoginMethod, WalletMethod} from "@/config";
|
|
4
|
+
import {CEXList, LOGIN_METHOD_MAP, LoginMethod, WalletMethod} from "@/config";
|
|
5
5
|
import {CEXType, LoginMethodType} from "../../../src/types/types";
|
|
6
6
|
|
|
7
7
|
const {useMatchEvents, useUserInfo, useWallet} = Hooks
|
|
@@ -51,7 +51,8 @@ function LoginContent() {
|
|
|
51
51
|
address,
|
|
52
52
|
bind,
|
|
53
53
|
auth,
|
|
54
|
-
bindCex
|
|
54
|
+
bindCex,
|
|
55
|
+
getAuthInfo
|
|
55
56
|
} = useUserInfo();
|
|
56
57
|
const [usernameOpen, setUsernameOpen] = React.useState(false)
|
|
57
58
|
const [passwordOpen, setPasswordOpen] = React.useState(false)
|
|
@@ -69,6 +70,15 @@ function LoginContent() {
|
|
|
69
70
|
}
|
|
70
71
|
}
|
|
71
72
|
|
|
73
|
+
const onGetInfo = async (method: string) => {
|
|
74
|
+
try {
|
|
75
|
+
const res = await getAuthInfo(method)
|
|
76
|
+
console.log('getAuthInfo', res)
|
|
77
|
+
} catch (e) {
|
|
78
|
+
console.error('getAuthInfo', e)
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
72
82
|
return <div className={`flex flex-col gap-[10px]`}>
|
|
73
83
|
<h1 className={`text-2xl`}>You are already logged in</h1>
|
|
74
84
|
<div className={`text-ellipsis break-words`}>token:{token}</div>
|
|
@@ -98,14 +108,28 @@ function LoginContent() {
|
|
|
98
108
|
}}/>
|
|
99
109
|
</div>
|
|
100
110
|
<div className={`flex gap-[20px] flex-wrap`}>
|
|
111
|
+
<div>
|
|
112
|
+
Bind
|
|
113
|
+
</div>
|
|
101
114
|
{
|
|
102
115
|
LoginMethod.map((method) => {
|
|
103
116
|
return <button key={method} className={`bg-gray-300 p-1 capitalize rounded`}
|
|
104
|
-
onClick={() => bind(method as LoginMethodType)}>
|
|
117
|
+
onClick={() => bind(method as LoginMethodType)}>{method}
|
|
105
118
|
</button>
|
|
106
119
|
})
|
|
107
120
|
}
|
|
108
121
|
</div>
|
|
122
|
+
<div className={`flex gap-[20px] flex-wrap`}>
|
|
123
|
+
<div>
|
|
124
|
+
GetAuthInfo
|
|
125
|
+
</div>
|
|
126
|
+
{
|
|
127
|
+
Object.keys(LOGIN_METHOD_MAP).map((method:string ) => {
|
|
128
|
+
return <button key={method} className={`bg-gray-300 p-1 rounded`}
|
|
129
|
+
onClick={async() => onGetInfo(LOGIN_METHOD_MAP[method as keyof typeof LOGIN_METHOD_MAP])}>{method}</button>
|
|
130
|
+
})
|
|
131
|
+
}
|
|
132
|
+
</div>
|
|
109
133
|
<div className={`flex gap-[20px] flex-wrap`}>
|
|
110
134
|
{
|
|
111
135
|
CEXList.map((method) => {
|