@matchain/matchid-sdk-react 0.1.42-alpha.16 → 0.1.42-alpha.2
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-WCS3X2LC.mjs → chunk-2YN5Y3SM.mjs} +2 -2
- package/dist/chunk-PZPEWHBV.mjs +4251 -0
- package/dist/chunk-PZPEWHBV.mjs.map +1 -0
- package/dist/components/index.d.mts +2 -3
- package/dist/components/index.d.ts +2 -3
- package/dist/components/index.js +486 -770
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +3 -8
- package/dist/hooks/api/index.d.mts +2 -2
- package/dist/hooks/api/index.d.ts +2 -2
- package/dist/hooks/api/index.js +78 -137
- package/dist/hooks/api/index.js.map +1 -1
- package/dist/hooks/api/index.mjs +2 -3
- package/dist/hooks/index.d.mts +2 -5
- package/dist/hooks/index.d.ts +2 -5
- package/dist/hooks/index.js +158 -362
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +1 -2
- package/dist/index-B4YpKSY3.d.ts +94 -0
- package/dist/{index-CLvQH5gM.d.ts → index-CxY3u9Rv.d.ts} +12 -32
- package/dist/{index-DlhAHm_s.d.mts → index-DCReY5T2.d.mts} +12 -32
- package/dist/{index-Ca9nh_8s.d.ts → index-DbjibQ5d.d.mts} +1 -1
- package/dist/{index-DFZpfAfc.d.mts → index-GcpJCj6O.d.ts} +1 -1
- package/dist/index-_k6h9w0P.d.mts +94 -0
- package/dist/index.css +4 -84
- package/dist/index.d.mts +5 -9
- package/dist/index.d.ts +5 -9
- package/dist/index.js +669 -1183
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -6
- package/dist/types.d-DwF-Pkvh.d.mts +179 -0
- package/dist/types.d-DwF-Pkvh.d.ts +179 -0
- package/example/package.json +0 -1
- package/example/src/App.tsx +28 -54
- package/example/src/components/Login/index.tsx +2 -2
- package/example/src/components/RoutePrivate/index.tsx +3 -4
- package/example/src/config/index.ts +2 -7
- package/example/src/pages/{User/index.tsx → User.tsx} +84 -55
- package/example/src/pages/Wallet.tsx +43 -258
- package/example/tsconfig.json +0 -1
- package/package.json +2 -7
- package/dist/chunk-SQIJR7RA.mjs +0 -29
- package/dist/chunk-SQIJR7RA.mjs.map +0 -1
- package/dist/chunk-UCIEZ3XI.mjs +0 -4747
- package/dist/chunk-UCIEZ3XI.mjs.map +0 -1
- package/dist/index-Bluim2ZP.d.mts +0 -143
- package/dist/index-BxS06a5O.d.ts +0 -50
- package/dist/index-EqksEEto.d.ts +0 -143
- package/dist/index-q5XDobUF.d.mts +0 -50
- package/dist/mpc-CTbBWHld.d.mts +0 -20
- package/dist/mpc-CTbBWHld.d.ts +0 -20
- package/dist/types/index.d.mts +0 -3
- package/dist/types/index.d.ts +0 -3
- package/dist/types/index.js +0 -44
- package/dist/types/index.js.map +0 -1
- package/dist/types/index.mjs +0 -10
- package/dist/types/index.mjs.map +0 -1
- package/dist/types-CVwZEgQ0.d.mts +0 -244
- package/dist/types-CVwZEgQ0.d.ts +0 -244
- package/example/src/abi/erc20.json +0 -222
- package/example/src/components/ButtonGroup/index.tsx +0 -10
- package/example/src/config/chains/index.ts +0 -2
- package/example/src/config/chains/matchMain.ts +0 -27
- package/example/src/config/chains/matchTest.ts +0 -33
- package/example/src/pages/User/components/BindListModal.tsx +0 -10
- package/example/src/pages/User/components/PohListModal.tsx +0 -10
- package/example/src/pages/User/components/QueryDisplay.tsx +0 -25
- package/example/src/store/useLocalStore.ts +0 -51
- /package/dist/{chunk-WCS3X2LC.mjs.map → chunk-2YN5Y3SM.mjs.map} +0 -0
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import {defineChain} from "viem";
|
|
2
|
-
|
|
3
|
-
export const matchMain = /*#__PURE__*/ defineChain({
|
|
4
|
-
id: 698,
|
|
5
|
-
name: "Matchain",
|
|
6
|
-
nativeCurrency: { name: "Match Coin", symbol: "BNB", decimals: 18 },
|
|
7
|
-
rpcUrls: {
|
|
8
|
-
default: {
|
|
9
|
-
http: ["https://rpc.matchain.io"],
|
|
10
|
-
},
|
|
11
|
-
},
|
|
12
|
-
blockExplorers: {
|
|
13
|
-
default: {
|
|
14
|
-
name: "Matchscan",
|
|
15
|
-
url: "https://matchscan.io/",
|
|
16
|
-
apiUrl: "https://matchscan.io/api",
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
iconUrl: "https://matchscan.io/static/identicon_logos/blockies.png",
|
|
20
|
-
contracts: {
|
|
21
|
-
multicall3: {
|
|
22
|
-
address: "0xca11bde05977b3631167028862be2a173976ca11",
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
// testnet: true,
|
|
26
|
-
});
|
|
27
|
-
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { defineChain } from "viem"
|
|
3
|
-
|
|
4
|
-
export const matchTest = /*#__PURE__*/ defineChain({
|
|
5
|
-
id: 699,
|
|
6
|
-
name: "MatchTest",
|
|
7
|
-
nativeCurrency: { name: "Match Coin", symbol: "BNB", decimals: 18 },
|
|
8
|
-
rpcUrls: {
|
|
9
|
-
default: {
|
|
10
|
-
http: ["https://testnet-rpc.matchain.io"],
|
|
11
|
-
},
|
|
12
|
-
},
|
|
13
|
-
blockExplorers: {
|
|
14
|
-
default: {
|
|
15
|
-
name: "Matchscan",
|
|
16
|
-
url: "https://testnet.matchscan.io/",
|
|
17
|
-
apiUrl: "https://testnet.matchscan.io/api",
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
iconUrl: "https://testnet.matchscan.io/static/identicon_logos/blockies.png",
|
|
21
|
-
contracts: {
|
|
22
|
-
multicall3: {
|
|
23
|
-
address: "0xca11bde05977b3631167028862be2a173976ca11",
|
|
24
|
-
blockCreated: 751532,
|
|
25
|
-
},
|
|
26
|
-
ensRegistry: { address: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e" },
|
|
27
|
-
ensUniversalResolver: {
|
|
28
|
-
address: "0xc8Af999e38273D658BE1b921b88A9Ddf005769cC",
|
|
29
|
-
blockCreated: 5_317_080,
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
// testnet: true,
|
|
33
|
-
});
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ModalWithHeader } from '@matchain/matchid-sdk-react/components';
|
|
2
|
-
import React from "react";
|
|
3
|
-
import QueryDisplay from "@/pages/User/components/QueryDisplay";
|
|
4
|
-
import {Api} from "@matchain/matchid-sdk-react/index";
|
|
5
|
-
export default function BindListModal({isOpen, onClose}: {isOpen: boolean, onClose: () => void}) {
|
|
6
|
-
const bindListQuery = Api.bind.useBindList()
|
|
7
|
-
return <ModalWithHeader isOpen={isOpen} onClose={onClose} title={"BindListQuery"}>
|
|
8
|
-
<QueryDisplay query={bindListQuery} />
|
|
9
|
-
</ModalWithHeader>
|
|
10
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ModalWithHeader } from '@matchain/matchid-sdk-react/components';
|
|
2
|
-
import React from "react";
|
|
3
|
-
import QueryDisplay from "@/pages/User/components/QueryDisplay";
|
|
4
|
-
import {Api} from "@matchain/matchid-sdk-react/index";
|
|
5
|
-
export default function PohListModal({isOpen, onClose}: {isOpen: boolean, onClose: () => void}) {
|
|
6
|
-
const pohListQuery = Api.poh.usePohList()
|
|
7
|
-
return <ModalWithHeader isOpen={isOpen} onClose={onClose} title={"PohListQuery"}>
|
|
8
|
-
<QueryDisplay query={pohListQuery} />
|
|
9
|
-
</ModalWithHeader>
|
|
10
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import {Button} from "@matchain/matchid-sdk-react/components";
|
|
2
|
-
import React from "react";
|
|
3
|
-
|
|
4
|
-
export default function QueryDisplay(
|
|
5
|
-
{
|
|
6
|
-
query
|
|
7
|
-
}: {
|
|
8
|
-
query: any
|
|
9
|
-
}
|
|
10
|
-
) {
|
|
11
|
-
const keys = Object.keys(query)
|
|
12
|
-
return <div className={`max-h-[60vw] overflow-scroll`}>
|
|
13
|
-
{keys.map((key) => {
|
|
14
|
-
return <div key={key} className={`flex gap-[12px]`}>
|
|
15
|
-
<div className={"w-[110px] break-all"}>{key}</div>
|
|
16
|
-
<div className={`flex-1 flex-wrap break-all`}>{
|
|
17
|
-
typeof query[key] === 'function' ? <Button size="sm" onClick={() => {
|
|
18
|
-
query[key]()
|
|
19
|
-
}}>Run</Button> :
|
|
20
|
-
JSON.stringify(query[key])}</div>
|
|
21
|
-
</div>
|
|
22
|
-
})}
|
|
23
|
-
</div>
|
|
24
|
-
|
|
25
|
-
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import {create} from 'zustand';
|
|
2
|
-
import {devtools, persist} from 'zustand/middleware';
|
|
3
|
-
import {LocaleType} from "@matchain/matchid-sdk-react/types";
|
|
4
|
-
|
|
5
|
-
interface StoreState {
|
|
6
|
-
appid: string
|
|
7
|
-
endpoints: {
|
|
8
|
-
back: string;
|
|
9
|
-
auth: string;
|
|
10
|
-
}
|
|
11
|
-
locale: LocaleType;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
setAppid: (appid: string) => void;
|
|
15
|
-
setEndpoints: (endpoints: StoreState['endpoints']) => void
|
|
16
|
-
setLocale: (locale: LocaleType) => void
|
|
17
|
-
|
|
18
|
-
initChainId: number;
|
|
19
|
-
setInitChainId: (initChainId: number) => void
|
|
20
|
-
|
|
21
|
-
erc20Address: string;
|
|
22
|
-
setErc20Address: (erc20Address: string) => void;
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
const persistedState = persist<StoreState>(
|
|
27
|
-
set => ({
|
|
28
|
-
appid: '',
|
|
29
|
-
endpoints: {
|
|
30
|
-
back: "https://api.matchid.ai/",
|
|
31
|
-
auth: "https://auth.matchid.ai/"
|
|
32
|
-
},
|
|
33
|
-
locale: 'en',
|
|
34
|
-
setAppid: (appid: string) => set({appid: appid}),
|
|
35
|
-
setEndpoints: (endpoints: StoreState['endpoints']) => set({endpoints}),
|
|
36
|
-
setLocale: (locale: LocaleType) => set({locale}),
|
|
37
|
-
|
|
38
|
-
initChainId:1,
|
|
39
|
-
setInitChainId: (initChainId: number) => set({initChainId}),
|
|
40
|
-
|
|
41
|
-
erc20Address: '',
|
|
42
|
-
setErc20Address: (erc20Address: string) => set({erc20Address})
|
|
43
|
-
}),
|
|
44
|
-
{name: 'match-example-local'}
|
|
45
|
-
);
|
|
46
|
-
|
|
47
|
-
const useLocalStore = create(devtools(persistedState));
|
|
48
|
-
|
|
49
|
-
export const localStore = useLocalStore;
|
|
50
|
-
|
|
51
|
-
export default useLocalStore;
|
|
File without changes
|