@matchain/matchid-sdk-react 0.1.56-alpha.9 → 0.1.57-alpha.1

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.
Files changed (42) hide show
  1. package/dist/api.js +44 -3
  2. package/dist/api.js.map +1 -1
  3. package/dist/api.mjs +3 -3
  4. package/dist/{chunk-LOZCAT7A.mjs → chunk-6RNCNC65.mjs} +288 -218
  5. package/dist/chunk-6RNCNC65.mjs.map +1 -0
  6. package/dist/{chunk-FQ6PYZPD.mjs → chunk-7SUDHG7S.mjs} +1 -1
  7. package/dist/chunk-7SUDHG7S.mjs.map +1 -0
  8. package/dist/{chunk-JCMQBWWW.mjs → chunk-EAZNOQRK.mjs} +2 -2
  9. package/dist/components.d.mts +1 -1
  10. package/dist/components.d.ts +1 -1
  11. package/dist/components.js +311 -263
  12. package/dist/components.js.map +1 -1
  13. package/dist/components.mjs +2 -2
  14. package/dist/hooks.d.mts +1 -1
  15. package/dist/hooks.d.ts +1 -1
  16. package/dist/hooks.js +81 -42
  17. package/dist/hooks.js.map +1 -1
  18. package/dist/hooks.mjs +2 -2
  19. package/dist/icon.js.map +1 -1
  20. package/dist/icon.mjs +1 -1
  21. package/dist/{index-DwmrgZa2.d.ts → index-B70k4Jpk.d.ts} +4 -0
  22. package/dist/{index-D2E53ZMV.d.mts → index-BJJ0Gb6v.d.mts} +4 -0
  23. package/dist/{index-qmC4zt6V.d.ts → index-C2hr7zlN.d.ts} +3 -1
  24. package/dist/{index-DVlulZhE.d.mts → index-CTHpnEoB.d.mts} +3 -1
  25. package/dist/index.d.mts +2 -2
  26. package/dist/index.d.ts +2 -2
  27. package/dist/index.js +92 -22
  28. package/dist/index.js.map +1 -1
  29. package/dist/index.mjs +3 -3
  30. package/dist/ui.js +81 -70
  31. package/dist/ui.js.map +1 -1
  32. package/dist/ui.mjs +2 -2
  33. package/example/package-lock.json +2965 -0
  34. package/example/package.json +2 -1
  35. package/example/src/App.tsx +65 -60
  36. package/example/src/config/index.ts +8 -6
  37. package/example/src/pages/Wallet/index.tsx +2 -4
  38. package/example/yarn.lock +27 -2251
  39. package/package.json +3 -6
  40. package/dist/chunk-FQ6PYZPD.mjs.map +0 -1
  41. package/dist/chunk-LOZCAT7A.mjs.map +0 -1
  42. /package/dist/{chunk-JCMQBWWW.mjs.map → chunk-EAZNOQRK.mjs.map} +0 -0
@@ -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
+ }
@@ -1,25 +1,25 @@
1
- import React, {useEffect, useMemo, useState} from "react";
2
- import {MatchProvider, wagmiConfig} from "@matchain/matchid-sdk-react";
3
- import {BrowserRouter as Router, Routes, Route, Link, useLocation} from 'react-router-dom';
1
+ import React, { useEffect, useMemo, useState } from "react";
2
+ import { MatchProvider, wagmiConfig } from "@matchain/matchid-sdk-react";
3
+ import { BrowserRouter as Router, Routes, Route, Link, useLocation } from 'react-router-dom';
4
4
  import Home from "./pages/Home";
5
5
  import './app.css'
6
6
  import User from "./pages/User";
7
7
  import "@matchain/matchid-sdk-react/index.css"
8
8
  import Wallet from "@/pages/Wallet";
9
- import {LocaleList} from "@/config";
10
- import {LocaleType} from "@matchain/matchid-sdk-react/types";
11
- import {useUserInfo} from "@matchain/matchid-sdk-react/hooks";
9
+ import { LocaleList } from "@/config";
10
+ import { LocaleType } from "@matchain/matchid-sdk-react/types";
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
- import {LoginButton} from "@matchain/matchid-sdk-react/components";
14
+ import { LoginButton } from "@matchain/matchid-sdk-react/components";
15
15
  import UI from "@/pages/UI";
16
16
  import TgApp from "@/pages/TgApp";
17
- import {WagmiProvider} from "wagmi";
17
+ import { WagmiProvider } from "wagmi";
18
18
  import useStore from "@/store/useStore";
19
19
 
20
20
 
21
21
  function Nav() {
22
- const {isLogin} = useUserInfo()
22
+ const { isLogin } = useUserInfo()
23
23
  const location = useLocation()
24
24
  const menus = useMemo(() => {
25
25
  const list: {
@@ -28,43 +28,43 @@ function Nav() {
28
28
  onActive: boolean
29
29
  hidden?: boolean
30
30
  }[] = [
31
- {
32
- name: 'Home',
33
- url: '/',
34
- onActive: location.pathname === '/'
35
- },
36
- {
37
- name: 'UI',
38
- url: '/ui',
39
- onActive: location.pathname === '/ui'
40
- },
41
- {
42
- name: 'TgApp',
43
- url: '/tgapp',
44
- onActive: location.pathname === '/tgapp'
45
- },
46
- {
47
- name: 'User',
48
- url: '/user',
49
- onActive: location.pathname === '/user'
50
- },
51
- {
52
- name: 'Wallet',
53
- url: '/wallet',
54
- onActive: location.pathname === '/wallet',
55
- hidden: !isLogin
56
- },
57
- ]
31
+ {
32
+ name: 'Home',
33
+ url: '/',
34
+ onActive: location.pathname === '/'
35
+ },
36
+ {
37
+ name: 'UI',
38
+ url: '/ui',
39
+ onActive: location.pathname === '/ui'
40
+ },
41
+ {
42
+ name: 'TgApp',
43
+ url: '/tgapp',
44
+ onActive: location.pathname === '/tgapp'
45
+ },
46
+ {
47
+ name: 'User',
48
+ url: '/user',
49
+ onActive: location.pathname === '/user'
50
+ },
51
+ {
52
+ name: 'Wallet',
53
+ url: '/wallet',
54
+ onActive: location.pathname === '/wallet',
55
+ hidden: !isLogin
56
+ },
57
+ ]
58
58
  return list
59
59
  }, [location.pathname, isLogin])
60
60
  return <>
61
61
  <nav className={`text-2xl mb-5 p-2 text-red-600 flex gap-10 flex-wrap`}>
62
62
  {menus.map((menu) => {
63
63
  return <Link key={menu.url} to={menu.url}
64
- className={`text-2xl ${menu.onActive ? 'text-red-600' : 'text-gray-400'} ${menu.hidden ? 'hidden' : ''}`}>{menu.name}</Link>
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
  </>
@@ -85,44 +85,44 @@ function RouterApp() {
85
85
  color,
86
86
  setColor
87
87
  } = useLocalStore()
88
- const {appSecret,setAppSecret} = useStore()
88
+ const { appSecret, setAppSecret } = useStore()
89
89
 
90
90
  return <Router>
91
91
  <div className={`mb-2 p-2 flex gap-2 flex-col`}>
92
92
  <div>
93
93
  <label>BackgroundColor:</label>
94
94
  <input value={backgroundColor} placeholder={"BackgroundColor"} className={"border-solid border"}
95
- onChange={(ele) => {
96
- setBackgroundColor(ele.target.value)
97
- }}/></div>
95
+ onChange={(ele) => {
96
+ setBackgroundColor(ele.target.value)
97
+ }} /></div>
98
98
  <div>
99
99
  <label>Color:</label>
100
100
  <input value={color} placeholder={"Color"} className={"border-solid border"} onChange={(ele) => {
101
101
  setColor(ele.target.value)
102
- }}/></div>
102
+ }} /></div>
103
103
  <div>
104
104
  <label>Appid:</label>
105
105
  <input value={appid} placeholder={"Appid"} className={"border-solid border"} onChange={(ele) => {
106
106
  setAppid(ele.target.value)
107
- }}/></div>
107
+ }} /></div>
108
108
  <div>
109
109
  <label>AppSecret:</label>
110
110
  <input value={appSecret} placeholder={"AppSecret"} className={"border-solid border"} onChange={(ele) => {
111
111
  setAppSecret(ele.target.value)
112
- }}/></div>
112
+ }} /></div>
113
113
  <div>
114
114
  <label>AuthEndpoint:</label>
115
115
  <input value={endpoints?.auth || ''} placeholder={"Auth Endpoint"} className={"border-solid border"}
116
- onChange={(ele) => {
117
- setEndpoints({...endpoints, auth: ele.target.value})
118
- }}/>
116
+ onChange={(ele) => {
117
+ setEndpoints({ ...endpoints, auth: ele.target.value })
118
+ }} />
119
119
  </div>
120
120
  <div>
121
121
  <label>BackEndpoint:</label>
122
122
  <input value={endpoints?.back || ''} placeholder={"Back Endpoint"} className={"border-solid border"}
123
- onChange={(ele) => {
124
- setEndpoints({...endpoints, back: ele.target.value})
125
- }}/>
123
+ onChange={(ele) => {
124
+ setEndpoints({ ...endpoints, back: ele.target.value })
125
+ }} />
126
126
  </div>
127
127
  <div>
128
128
  <label>Locale:</label>
@@ -141,15 +141,15 @@ function RouterApp() {
141
141
  </select>
142
142
  </div>
143
143
  </div>
144
- <Nav/>
144
+ <Nav />
145
145
  <div className={`p-4`}>
146
146
  <Routes>
147
- <Route path="/" element={<Home/>}/>
148
- <Route path="/ui" element={<UI/>}/>
149
- <Route path="/tgapp" element={<TgApp/>}/>
150
- <Route element={<RoutePrivate/>}>
151
- <Route path="/user" element={<User/>}/>
152
- <Route path="/wallet" element={<Wallet/>}/>
147
+ <Route path="/" element={<Home />} />
148
+ <Route path="/ui" element={<UI />} />
149
+ <Route path="/tgapp" element={<TgApp />} />
150
+ <Route element={<RoutePrivate />}>
151
+ <Route path="/user" element={<User />} />
152
+ <Route path="/wallet" element={<Wallet />} />
153
153
  </Route>
154
154
  </Routes>
155
155
  </div>
@@ -157,8 +157,13 @@ function RouterApp() {
157
157
  }
158
158
 
159
159
  function App() {
160
- const {appid, locale, endpoints, walletType, backgroundColor, color} = useLocalStore()
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
@@ -180,7 +185,7 @@ function App() {
180
185
  type: walletType
181
186
  }}
182
187
  >
183
- <RouterApp/>
188
+ <RouterApp />
184
189
  </MatchProvider>
185
190
  </WagmiProvider>
186
191
  </div>;
@@ -1,4 +1,4 @@
1
- import {LoginMethodType, WalletType,RecommendLoginMethodType,OtherLoginMethodType} from "@matchain/matchid-sdk-react/types";
1
+ import { LoginMethodType, WalletType, RecommendLoginMethodType, OtherLoginMethodType } from "@matchain/matchid-sdk-react/types";
2
2
 
3
3
  export const LoginMethod = [
4
4
  "wallet",
@@ -14,7 +14,9 @@ export const LoginMethod = [
14
14
  'discord',
15
15
  'linkedin',
16
16
  'facebook',
17
- "youtube"
17
+ "youtube",
18
+ "kakao",
19
+ "email"
18
20
  ]
19
21
  export const LocaleList = [
20
22
  "en", "zh", "tw", "fr", "ja", "ko", "vi", "es", "pt"
@@ -23,12 +25,12 @@ export const LocaleList = [
23
25
  export const CEXList = [
24
26
  "Gate", "Coinbase", "Kucoin", 'Bitget', 'OKX', 'Bybit', 'Binance']
25
27
 
26
- export const WalletList:WalletType[] = [
27
- 'btc', 'sol', 'evm', 'tron',"ton"
28
+ export const WalletList: WalletType[] = [
29
+ 'btc', 'sol', 'evm', 'tron', "ton"
28
30
  ]
29
- export const LoginMethodList : OtherLoginMethodType[] = ['twitter' , 'discord', 'github', 'telegram' ,'linkedin' , 'facebook' ,'youtube']
31
+ export const LoginMethodList: OtherLoginMethodType[] = ['twitter', 'discord', 'github', 'telegram', 'linkedin', 'facebook', 'youtube']
30
32
 
31
- export const RecommendLoginMethodList:RecommendLoginMethodType[] = ["wallet","email","google"]
33
+ export const RecommendLoginMethodList: RecommendLoginMethodType[] = ["wallet", "email", "google"]
32
34
 
33
35
  export const LOGIN_METHOD_MAP = {
34
36
  email: 'Email',
@@ -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
- matchain,
54
- matchainTestnet,
51
+ MatchMain,
52
+ MatchTest,
55
53
  arbitrum,
56
54
  arbitrumGoerli,
57
55
  arbitrumNova,