@matchain/matchid-sdk-react 0.1.56-alpha.16 → 0.1.56-alpha.18
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/api.d.mts +2 -2
- package/dist/api.d.ts +2 -2
- package/dist/api.js +152 -87
- package/dist/api.js.map +1 -1
- package/dist/api.mjs +4 -3
- package/dist/chains.mjs +2 -1
- package/dist/chunk-3CR66BEX.mjs +19 -0
- package/dist/chunk-3CR66BEX.mjs.map +1 -0
- package/dist/{chunk-FQ6PYZPD.mjs → chunk-7SUDHG7S.mjs} +1 -1
- package/dist/chunk-7SUDHG7S.mjs.map +1 -0
- package/dist/{chunk-O2D3TKRD.mjs → chunk-EUG3QRAG.mjs} +2 -2
- package/dist/{chunk-HYQ3T6WW.mjs → chunk-JX73EY6V.mjs} +2 -14
- package/dist/chunk-JX73EY6V.mjs.map +1 -0
- package/dist/{chunk-LADAY3IL.mjs → chunk-QMV4FDUH.mjs} +375 -352
- package/dist/chunk-QMV4FDUH.mjs.map +1 -0
- package/dist/components.d.mts +3 -3
- package/dist/components.d.ts +3 -3
- package/dist/components.js +473 -401
- package/dist/components.js.map +1 -1
- package/dist/components.mjs +3 -2
- package/dist/hooks.d.mts +2 -2
- package/dist/hooks.d.ts +2 -2
- package/dist/hooks.js +172 -109
- package/dist/hooks.js.map +1 -1
- package/dist/hooks.mjs +3 -2
- package/dist/icon.d.mts +2 -2
- package/dist/icon.d.ts +2 -2
- package/dist/icon.js.map +1 -1
- package/dist/icon.mjs +1 -1
- package/dist/{index-DCyE39bg.d.mts → index-84CqVi2I.d.mts} +1 -1
- package/dist/{index-BINNnZNA.d.ts → index-B70k4Jpk.d.ts} +1 -2
- package/dist/{index-BIVGhRja.d.mts → index-BJJ0Gb6v.d.mts} +1 -2
- package/dist/{index-BXhXRggh.d.ts → index-BNqdFiOo.d.ts} +1 -1
- package/dist/{index-DGsB7f2H.d.ts → index-BctnHnJp.d.ts} +1 -1
- package/dist/{index-DuCefmJ0.d.mts → index-BqI0PEIi.d.mts} +1 -1
- package/dist/{index-DZpXCByF.d.ts → index-C2hr7zlN.d.ts} +5 -3
- package/dist/{index-CqHlL6ue.d.mts → index-CTHpnEoB.d.mts} +5 -3
- package/dist/{index-De8efmdb.d.mts → index-Car1jFyN.d.mts} +1 -1
- package/dist/{index-CpJtux-G.d.ts → index-CcVHENNv.d.ts} +1 -1
- package/dist/{index-DQYg6bEA.d.ts → index-Cqdz_5bE.d.ts} +2 -2
- package/dist/{index-m2bn_W3Y.d.ts → index-CvzpMw3N.d.ts} +1 -1
- package/dist/{index-CzCkxwOm.d.mts → index-DkijpM5Q.d.mts} +1 -1
- package/dist/{index-BLjGmf9p.d.mts → index-DxHhOW24.d.mts} +2 -2
- package/dist/index.css +1 -1
- package/dist/index.d.mts +42 -38
- package/dist/index.d.ts +42 -38
- package/dist/index.js +256 -235
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -4
- package/dist/{types-C8FLH1yn.d.mts → types-BrVeC0c8.d.mts} +0 -1
- package/dist/{types-C8FLH1yn.d.ts → types-BrVeC0c8.d.ts} +0 -1
- package/dist/types.d.mts +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/ui.d.mts +3 -3
- package/dist/ui.d.ts +3 -3
- package/dist/ui.js +144 -75
- package/dist/ui.js.map +1 -1
- package/dist/ui.mjs +3 -2
- package/example/package-lock.json +2965 -0
- package/example/package.json +2 -1
- package/example/src/App.tsx +8 -3
- package/example/src/config/index.ts +2 -2
- package/example/src/pages/Home.tsx +15 -15
- package/example/src/pages/Wallet/index.tsx +2 -4
- package/example/src/store/useLocalStore.ts +19 -19
- package/example/yarn.lock +559 -548
- package/package.json +4 -9
- package/dist/chunk-FQ6PYZPD.mjs.map +0 -1
- package/dist/chunk-HYQ3T6WW.mjs.map +0 -1
- package/dist/chunk-LADAY3IL.mjs.map +0 -1
- /package/dist/{chunk-O2D3TKRD.mjs.map → chunk-EUG3QRAG.mjs.map} +0 -0
package/example/package.json
CHANGED
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@matchain/matchid-sdk-react": "../dist",
|
|
30
|
+
"@zerodev/webauthn-key": "5.3.3",
|
|
30
31
|
"crypto": "^1.0.1",
|
|
31
32
|
"crypto-js": "^4.2.0",
|
|
32
33
|
"eruda": "^3.4.1"
|
|
@@ -40,4 +41,4 @@
|
|
|
40
41
|
"tailwindcss": "^3.4.14",
|
|
41
42
|
"vite": "^5.4.10"
|
|
42
43
|
}
|
|
43
|
-
}
|
|
44
|
+
}
|
package/example/src/App.tsx
CHANGED
|
@@ -8,7 +8,7 @@ import "@matchain/matchid-sdk-react/index.css"
|
|
|
8
8
|
import Wallet from "@/pages/Wallet";
|
|
9
9
|
import { LocaleList } from "@/config";
|
|
10
10
|
import { LocaleType } from "@matchain/matchid-sdk-react/types";
|
|
11
|
-
import { useUserInfo } from "@matchain/matchid-sdk-react/hooks";
|
|
11
|
+
import { useMatchEvents, useUserInfo } from "@matchain/matchid-sdk-react/hooks";
|
|
12
12
|
import RoutePrivate from "@/components/RoutePrivate";
|
|
13
13
|
import useLocalStore from "@/store/useLocalStore";
|
|
14
14
|
import { LoginButton } from "@matchain/matchid-sdk-react/components";
|
|
@@ -64,7 +64,7 @@ function Nav() {
|
|
|
64
64
|
className={`text-2xl ${menu.onActive ? 'text-red-600' : 'text-gray-400'} ${menu.hidden ? 'hidden' : ''}`}>{menu.name}</Link>
|
|
65
65
|
})}
|
|
66
66
|
|
|
67
|
-
<LoginButton
|
|
67
|
+
<LoginButton recommendMethods={['wallet', "email"]} walletMethods={['evm']} methods={['google', 'kakao']} />
|
|
68
68
|
</nav>
|
|
69
69
|
|
|
70
70
|
</>
|
|
@@ -159,13 +159,18 @@ function RouterApp() {
|
|
|
159
159
|
function App() {
|
|
160
160
|
const { appid, locale, endpoints, walletType, backgroundColor, color } = useLocalStore()
|
|
161
161
|
|
|
162
|
+
useMatchEvents({
|
|
163
|
+
onBind() {
|
|
164
|
+
console.log("bind event");
|
|
165
|
+
},
|
|
166
|
+
});
|
|
162
167
|
return <div style={{
|
|
163
168
|
backgroundColor: backgroundColor,
|
|
164
169
|
color: color
|
|
165
170
|
}}>
|
|
166
171
|
<WagmiProvider config={wagmiConfig}>
|
|
167
172
|
<MatchProvider
|
|
168
|
-
appid=
|
|
173
|
+
appid={appid}
|
|
169
174
|
endpoints={endpoints}
|
|
170
175
|
locale={locale}
|
|
171
176
|
events={{
|
|
@@ -10,13 +10,13 @@ export const LoginMethod = [
|
|
|
10
10
|
'twitter',
|
|
11
11
|
'google',
|
|
12
12
|
'telegram',
|
|
13
|
-
'email',
|
|
14
13
|
'github',
|
|
15
14
|
'discord',
|
|
16
15
|
'linkedin',
|
|
17
16
|
'facebook',
|
|
18
17
|
"youtube",
|
|
19
|
-
"kakao"
|
|
18
|
+
"kakao",
|
|
19
|
+
"email"
|
|
20
20
|
]
|
|
21
21
|
export const LocaleList = [
|
|
22
22
|
"en", "zh", "tw", "fr", "ja", "ko", "vi", "es", "pt"
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import {useMatch} from "@matchain/matchid-sdk-react";
|
|
2
|
+
import {useMemo} from "react";
|
|
3
3
|
function DisplayConfig({
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}:
|
|
7
|
-
label:
|
|
8
|
-
value:
|
|
9
|
-
})
|
|
10
|
-
const RenderValue = useMemo(()
|
|
4
|
+
label,
|
|
5
|
+
value
|
|
6
|
+
}:{
|
|
7
|
+
label:string,
|
|
8
|
+
value:any
|
|
9
|
+
}){
|
|
10
|
+
const RenderValue = useMemo(()=>{
|
|
11
11
|
const type = typeof value;
|
|
12
|
-
if
|
|
12
|
+
if(type === "object"){
|
|
13
13
|
return JSON.stringify(value);
|
|
14
14
|
}
|
|
15
|
-
if
|
|
15
|
+
if(type==='function'){
|
|
16
16
|
return <span className={`text-green-500`}>function</span>
|
|
17
17
|
}
|
|
18
18
|
return value;
|
|
19
|
-
},
|
|
19
|
+
},[value])
|
|
20
20
|
|
|
21
21
|
return <div className={`grid grid-cols-12 gap-4`}>
|
|
22
22
|
<div className={`col-span-4 px-2`}>{label}</div>
|
|
23
23
|
<div className={`col-span-8 px-2 text-ellipsis`}>{RenderValue}</div>
|
|
24
24
|
</div>
|
|
25
25
|
}
|
|
26
|
-
export default function Home()
|
|
26
|
+
export default function Home(){
|
|
27
27
|
const config = useMatch();
|
|
28
28
|
const keyList = Object.keys(config) as Array<keyof typeof config>;
|
|
29
29
|
return <div className={``}>
|
|
30
30
|
{
|
|
31
|
-
keyList.map((key)
|
|
32
|
-
return <DisplayConfig key={key} label={key} value={config[key]}
|
|
31
|
+
keyList.map((key)=>{
|
|
32
|
+
return <DisplayConfig key={key} label={key} value={config[key]}/>
|
|
33
33
|
})
|
|
34
34
|
}
|
|
35
35
|
</div>
|
|
@@ -14,8 +14,6 @@ import { useQuery } from "@tanstack/react-query";
|
|
|
14
14
|
import {
|
|
15
15
|
mainnet,
|
|
16
16
|
arbitrum,
|
|
17
|
-
matchain,
|
|
18
|
-
matchainTestnet,
|
|
19
17
|
arbitrumGoerli,
|
|
20
18
|
arbitrumNova,
|
|
21
19
|
arbitrumSepolia,
|
|
@@ -50,8 +48,8 @@ const chainList = [
|
|
|
50
48
|
mainnet,
|
|
51
49
|
bsc,
|
|
52
50
|
bscTestnet,
|
|
53
|
-
|
|
54
|
-
|
|
51
|
+
MatchMain,
|
|
52
|
+
MatchTest,
|
|
55
53
|
arbitrum,
|
|
56
54
|
arbitrumGoerli,
|
|
57
55
|
arbitrumNova,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import {create} from 'zustand';
|
|
2
|
+
import {devtools, persist} from 'zustand/middleware';
|
|
3
|
+
import {LocaleType} from "@matchain/matchid-sdk-react/types";
|
|
4
4
|
|
|
5
5
|
interface StoreState {
|
|
6
6
|
appid: string
|
|
@@ -9,10 +9,10 @@ interface StoreState {
|
|
|
9
9
|
auth: string;
|
|
10
10
|
}
|
|
11
11
|
locale: LocaleType;
|
|
12
|
-
walletType:
|
|
12
|
+
walletType:"Base" | "UserPasscode";
|
|
13
13
|
setWalletType: (walletType: "Base" | "UserPasscode") => void;
|
|
14
|
-
color:
|
|
15
|
-
backgroundColor:
|
|
14
|
+
color:string,
|
|
15
|
+
backgroundColor:string,
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
setAppid: (appid: string) => void;
|
|
@@ -32,29 +32,29 @@ interface StoreState {
|
|
|
32
32
|
|
|
33
33
|
const persistedState = persist<StoreState>(
|
|
34
34
|
set => ({
|
|
35
|
-
appid: '
|
|
35
|
+
appid: '',
|
|
36
36
|
endpoints: {
|
|
37
|
-
back: "https://api
|
|
38
|
-
auth: "https://
|
|
37
|
+
back: "https://api.matchid.ai/",
|
|
38
|
+
auth: "https://auth.matchid.ai/"
|
|
39
39
|
},
|
|
40
40
|
locale: 'en',
|
|
41
|
-
setAppid: (appid: string) => set({
|
|
42
|
-
setEndpoints: (endpoints: StoreState['endpoints']) => set({
|
|
43
|
-
setLocale: (locale: LocaleType) => set({
|
|
41
|
+
setAppid: (appid: string) => set({appid: appid}),
|
|
42
|
+
setEndpoints: (endpoints: StoreState['endpoints']) => set({endpoints}),
|
|
43
|
+
setLocale: (locale: LocaleType) => set({locale}),
|
|
44
44
|
walletType: "UserPasscode",
|
|
45
|
-
setWalletType: (walletType: "Base" | "UserPasscode") => set({
|
|
45
|
+
setWalletType: (walletType: "Base" | "UserPasscode") => set({walletType}),
|
|
46
46
|
color: '#000000',
|
|
47
|
-
setColor: (color: string) => set({
|
|
47
|
+
setColor: (color: string) => set({color}),
|
|
48
48
|
backgroundColor: '#ffffff',
|
|
49
|
-
setBackgroundColor: (backgroundColor: string) => set({
|
|
49
|
+
setBackgroundColor: (backgroundColor: string) => set({backgroundColor}),
|
|
50
50
|
|
|
51
|
-
initChainId:
|
|
52
|
-
setInitChainId: (initChainId: number) => set({
|
|
51
|
+
initChainId:1,
|
|
52
|
+
setInitChainId: (initChainId: number) => set({initChainId}),
|
|
53
53
|
|
|
54
54
|
erc20Address: '',
|
|
55
|
-
setErc20Address: (erc20Address: string) => set({
|
|
55
|
+
setErc20Address: (erc20Address: string) => set({erc20Address})
|
|
56
56
|
}),
|
|
57
|
-
{
|
|
57
|
+
{name: 'match-example-local'}
|
|
58
58
|
);
|
|
59
59
|
|
|
60
60
|
const useLocalStore = create(devtools(persistedState));
|