@matchain/matchid-sdk-react 0.1.53-alpha.9 → 0.1.55-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/assets/icon/index.d.mts +5 -0
- package/dist/assets/icon/index.d.ts +5 -0
- package/dist/{chunk-X5HGL3ZX.mjs → chunk-36M5ROJI.mjs} +7238 -241
- package/dist/chunk-36M5ROJI.mjs.map +1 -0
- package/dist/chunk-N7NX7Q7M.mjs +97 -0
- package/dist/chunk-N7NX7Q7M.mjs.map +1 -0
- package/dist/components/index.d.mts +6 -0
- package/dist/components/index.d.ts +6 -0
- package/dist/components/index.js +324 -658
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +9 -15
- package/dist/config/chains/index.d.mts +2 -0
- package/dist/config/chains/index.d.ts +2 -0
- package/dist/hooks/api/index.d.mts +6 -0
- package/dist/hooks/api/index.d.ts +6 -0
- package/dist/hooks/api/index.js +443 -598
- package/dist/hooks/api/index.js.map +1 -1
- package/dist/hooks/api/index.mjs +6 -7
- package/dist/hooks/index.d.mts +11 -0
- package/dist/hooks/index.d.ts +11 -0
- package/dist/hooks/index.js +350 -357
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +3 -5
- package/dist/index-6-oVBXRP.d.mts +66 -0
- package/dist/index-CBQXIlWu.d.mts +38 -0
- package/dist/index-CMH6Jesl.d.ts +66 -0
- package/dist/index-CNH7a3bx.d.ts +111 -0
- package/dist/index-CPPDmmz8.d.ts +3327 -0
- package/dist/index-CqKohtvj.d.mts +3327 -0
- package/dist/index-D0Psl8Ue.d.mts +203 -0
- package/dist/index-DXRGMAbv.d.mts +83 -0
- package/dist/index-DXRGMAbv.d.ts +83 -0
- package/dist/index-DbQn4z1l.d.ts +203 -0
- package/dist/index-Es7yJi7T.d.ts +79 -0
- package/dist/index-G15A08DI.d.mts +132 -0
- package/dist/index-MsSYZS38.d.mts +79 -0
- package/dist/index-Y5WRoqzn.d.ts +132 -0
- package/dist/index-a_Qt7NXk.d.mts +111 -0
- package/dist/index-agAVLGF5.d.ts +38 -0
- package/dist/index.css +44 -57
- package/dist/index.d.mts +787 -0
- package/dist/index.d.ts +787 -0
- package/dist/index.js +3881 -4043
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -10
- package/dist/request-B0CyrGFT.d.mts +15 -0
- package/dist/request-B0CyrGFT.d.ts +15 -0
- package/dist/types/index.d.mts +3 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types-CXzZS0eM.d.mts +424 -0
- package/dist/types-CXzZS0eM.d.ts +424 -0
- package/dist/ui/index.d.mts +7 -0
- package/dist/ui/index.d.ts +7 -0
- package/dist/ui/index.js +920 -160
- package/dist/ui/index.js.map +1 -1
- package/dist/ui/index.mjs +6 -1
- package/dist/utils/index.d.mts +28 -0
- package/dist/utils/index.d.ts +28 -0
- package/example/package.json +1 -0
- package/example/src/App.tsx +23 -27
- package/example/src/pages/Wallet/index.tsx +1 -1
- package/package.json +1 -1
- package/dist/chunk-NCVBLRAJ.mjs +0 -7275
- package/dist/chunk-NCVBLRAJ.mjs.map +0 -1
- package/dist/chunk-X5HGL3ZX.mjs.map +0 -1
- package/example/src/pages/Contact/index.tsx +0 -90
package/dist/ui/index.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AlphaAvatar,
|
|
3
3
|
Button,
|
|
4
|
+
ConfirmModal,
|
|
4
5
|
Drawer,
|
|
5
6
|
Field,
|
|
6
7
|
HashPanel_default,
|
|
@@ -14,12 +15,16 @@ import {
|
|
|
14
15
|
Skeleton_default,
|
|
15
16
|
Switch,
|
|
16
17
|
Tabs
|
|
17
|
-
} from "../chunk-
|
|
18
|
+
} from "../chunk-36M5ROJI.mjs";
|
|
19
|
+
import "../chunk-UA6XHZHX.mjs";
|
|
20
|
+
import "../chunk-IZOOVZAD.mjs";
|
|
18
21
|
import "../chunk-FKXS2XRG.mjs";
|
|
22
|
+
import "../chunk-JX73EY6V.mjs";
|
|
19
23
|
import "../chunk-J5LGTIGS.mjs";
|
|
20
24
|
export {
|
|
21
25
|
AlphaAvatar,
|
|
22
26
|
Button,
|
|
27
|
+
ConfirmModal,
|
|
23
28
|
Drawer,
|
|
24
29
|
Field,
|
|
25
30
|
HashPanel_default as HashPanel,
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
declare const getVersion: () => string;
|
|
2
|
+
declare function encodeBase64(input: string): string;
|
|
3
|
+
declare function decodeBase64(input: string): string;
|
|
4
|
+
declare const isValidEmail: (email: string) => boolean;
|
|
5
|
+
declare const isValidUsername: (username: string) => boolean;
|
|
6
|
+
declare const deepMerge: (target: any, source: any) => any;
|
|
7
|
+
declare function truncateAddress(address: string, startLen?: number, endLen?: number): string;
|
|
8
|
+
declare function firstUpperCase(str: string): string;
|
|
9
|
+
declare function getAppClientId(): string;
|
|
10
|
+
interface NumberFormatterProps {
|
|
11
|
+
value: number | string | undefined;
|
|
12
|
+
prefix?: string;
|
|
13
|
+
suffix?: string;
|
|
14
|
+
separator?: boolean;
|
|
15
|
+
fixNum?: number;
|
|
16
|
+
tFixNum?: number;
|
|
17
|
+
intClassName?: string;
|
|
18
|
+
decimalClassName?: string;
|
|
19
|
+
prefixClassName?: string;
|
|
20
|
+
className?: string;
|
|
21
|
+
}
|
|
22
|
+
declare const NumberFormatter: React.FC<NumberFormatterProps>;
|
|
23
|
+
declare function formatAddress(address: string, pre?: number, after?: number): string;
|
|
24
|
+
declare const formatDate: (value: any, formatString?: string) => string;
|
|
25
|
+
declare const isInTgApp: () => boolean;
|
|
26
|
+
declare function bytesToBase64(bytes: Uint8Array): string;
|
|
27
|
+
|
|
28
|
+
export { NumberFormatter, bytesToBase64, decodeBase64, deepMerge, encodeBase64, firstUpperCase, formatAddress, formatDate, getAppClientId, getVersion, isInTgApp, isValidEmail, isValidUsername, truncateAddress };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
declare const getVersion: () => string;
|
|
2
|
+
declare function encodeBase64(input: string): string;
|
|
3
|
+
declare function decodeBase64(input: string): string;
|
|
4
|
+
declare const isValidEmail: (email: string) => boolean;
|
|
5
|
+
declare const isValidUsername: (username: string) => boolean;
|
|
6
|
+
declare const deepMerge: (target: any, source: any) => any;
|
|
7
|
+
declare function truncateAddress(address: string, startLen?: number, endLen?: number): string;
|
|
8
|
+
declare function firstUpperCase(str: string): string;
|
|
9
|
+
declare function getAppClientId(): string;
|
|
10
|
+
interface NumberFormatterProps {
|
|
11
|
+
value: number | string | undefined;
|
|
12
|
+
prefix?: string;
|
|
13
|
+
suffix?: string;
|
|
14
|
+
separator?: boolean;
|
|
15
|
+
fixNum?: number;
|
|
16
|
+
tFixNum?: number;
|
|
17
|
+
intClassName?: string;
|
|
18
|
+
decimalClassName?: string;
|
|
19
|
+
prefixClassName?: string;
|
|
20
|
+
className?: string;
|
|
21
|
+
}
|
|
22
|
+
declare const NumberFormatter: React.FC<NumberFormatterProps>;
|
|
23
|
+
declare function formatAddress(address: string, pre?: number, after?: number): string;
|
|
24
|
+
declare const formatDate: (value: any, formatString?: string) => string;
|
|
25
|
+
declare const isInTgApp: () => boolean;
|
|
26
|
+
declare function bytesToBase64(bytes: Uint8Array): string;
|
|
27
|
+
|
|
28
|
+
export { NumberFormatter, bytesToBase64, decodeBase64, deepMerge, encodeBase64, firstUpperCase, formatAddress, formatDate, getAppClientId, getVersion, isInTgApp, isValidEmail, isValidUsername, truncateAddress };
|
package/example/package.json
CHANGED
package/example/src/App.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, {useEffect, useMemo, useState} from "react";
|
|
2
|
-
import {MatchProvider} from "@matchain/matchid-sdk-react";
|
|
2
|
+
import {MatchProvider, wagmiConfig} from "@matchain/matchid-sdk-react";
|
|
3
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'
|
|
@@ -14,7 +14,7 @@ import useLocalStore from "@/store/useLocalStore";
|
|
|
14
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
|
|
17
|
+
import {WagmiProvider} from "wagmi";
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
function Nav() {
|
|
@@ -53,12 +53,6 @@ function Nav() {
|
|
|
53
53
|
onActive: location.pathname === '/wallet',
|
|
54
54
|
hidden: !isLogin
|
|
55
55
|
},
|
|
56
|
-
{
|
|
57
|
-
name: 'Contact',
|
|
58
|
-
url: '/contact',
|
|
59
|
-
onActive: location.pathname === '/contact',
|
|
60
|
-
hidden: !isLogin
|
|
61
|
-
}
|
|
62
56
|
]
|
|
63
57
|
return list
|
|
64
58
|
}, [location.pathname, isLogin])
|
|
@@ -149,7 +143,6 @@ function RouterApp() {
|
|
|
149
143
|
<Route element={<RoutePrivate/>}>
|
|
150
144
|
<Route path="/user" element={<User/>}/>
|
|
151
145
|
<Route path="/wallet" element={<Wallet/>}/>
|
|
152
|
-
<Route path="/contact" element={<Contact/>}/>
|
|
153
146
|
</Route>
|
|
154
147
|
</Routes>
|
|
155
148
|
</div>
|
|
@@ -162,24 +155,27 @@ function App() {
|
|
|
162
155
|
return <div style={{
|
|
163
156
|
backgroundColor: backgroundColor,
|
|
164
157
|
color: color
|
|
165
|
-
}}
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
158
|
+
}}>
|
|
159
|
+
<WagmiProvider config={wagmiConfig}>
|
|
160
|
+
<MatchProvider
|
|
161
|
+
appid={appid}
|
|
162
|
+
endpoints={endpoints}
|
|
163
|
+
locale={locale}
|
|
164
|
+
events={{
|
|
165
|
+
onLogin: (data) => {
|
|
166
|
+
console.log('events.onLogin', data)
|
|
167
|
+
},
|
|
168
|
+
onLogout: () => {
|
|
169
|
+
console.log('events.onLogout')
|
|
170
|
+
}
|
|
171
|
+
}}
|
|
172
|
+
wallet={{
|
|
173
|
+
type: walletType
|
|
174
|
+
}}
|
|
175
|
+
>
|
|
176
|
+
<RouterApp/>
|
|
177
|
+
</MatchProvider>
|
|
178
|
+
</WagmiProvider>
|
|
183
179
|
</div>;
|
|
184
180
|
}
|
|
185
181
|
|
|
@@ -432,7 +432,7 @@ function ERC20() {
|
|
|
432
432
|
return <div className="mt-[20px]">
|
|
433
433
|
<ButtonGroup title={"ERC20"}></ButtonGroup>
|
|
434
434
|
<ButtonGroup title={"Contract Address"}>
|
|
435
|
-
<input className="border px-[8px]" type={'text'} placeholder={'
|
|
435
|
+
<input className="border px-[8px]" type={'text'} placeholder={'contract'} value={erc20Address}
|
|
436
436
|
onChange={(e) => setErc20Address(e.target.value)}/>
|
|
437
437
|
</ButtonGroup>
|
|
438
438
|
<ButtonGroup title={"Info"}>
|