@web3jskit/walletkit 0.0.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.
- package/README.md +1 -0
- package/dist/package.json +42 -0
- package/dist/src/assets/svg/dataBase.d.ts +6 -0
- package/dist/src/assets/svg/dataBase.js +7 -0
- package/dist/src/assets/svg/dataBase.js.map +1 -0
- package/dist/src/assets/svg/metaMaskWallet.d.ts +1 -0
- package/dist/src/assets/svg/metaMaskWallet.js +35 -0
- package/dist/src/assets/svg/metaMaskWallet.js.map +1 -0
- package/dist/src/components/ConnectButton/ConnectedInfo.d.ts +1 -0
- package/dist/src/components/ConnectButton/ConnectedInfo.js +12 -0
- package/dist/src/components/ConnectButton/ConnectedInfo.js.map +1 -0
- package/dist/src/components/ConnectButton/index.d.ts +8 -0
- package/dist/src/components/ConnectButton/index.js +15 -0
- package/dist/src/components/ConnectButton/index.js.map +1 -0
- package/dist/src/components/Connecting/index.d.ts +5 -0
- package/dist/src/components/Connecting/index.js +10 -0
- package/dist/src/components/Connecting/index.js.map +1 -0
- package/dist/src/components/Connecting/style.d.ts +2 -0
- package/dist/src/components/Connecting/style.js +52 -0
- package/dist/src/components/Connecting/style.js.map +1 -0
- package/dist/src/components/GetWallet/index.d.ts +6 -0
- package/dist/src/components/GetWallet/index.js +38 -0
- package/dist/src/components/GetWallet/index.js.map +1 -0
- package/dist/src/components/GetWallet/style.d.ts +2 -0
- package/dist/src/components/GetWallet/style.js +115 -0
- package/dist/src/components/GetWallet/style.js.map +1 -0
- package/dist/src/components/Header/ModalHeader.d.ts +7 -0
- package/dist/src/components/Header/ModalHeader.js +10 -0
- package/dist/src/components/Header/ModalHeader.js.map +1 -0
- package/dist/src/components/Header/style.d.ts +2 -0
- package/dist/src/components/Header/style.js +73 -0
- package/dist/src/components/Header/style.js.map +1 -0
- package/dist/src/components/Icon/index.d.ts +23 -0
- package/dist/src/components/Icon/index.js +47 -0
- package/dist/src/components/Icon/index.js.map +1 -0
- package/dist/src/components/Introduce/index.d.ts +5 -0
- package/dist/src/components/Introduce/index.js +9 -0
- package/dist/src/components/Introduce/index.js.map +1 -0
- package/dist/src/components/Introduce/style.d.ts +2 -0
- package/dist/src/components/Introduce/style.js +72 -0
- package/dist/src/components/Introduce/style.js.map +1 -0
- package/dist/src/components/Modal/ConnectModal.d.ts +8 -0
- package/dist/src/components/Modal/ConnectModal.js +82 -0
- package/dist/src/components/Modal/ConnectModal.js.map +1 -0
- package/dist/src/components/Modal/WalletInfoModal.d.ts +5 -0
- package/dist/src/components/Modal/WalletInfoModal.js +40 -0
- package/dist/src/components/Modal/WalletInfoModal.js.map +1 -0
- package/dist/src/components/Modal/index.d.ts +12 -0
- package/dist/src/components/Modal/index.js +53 -0
- package/dist/src/components/Modal/index.js.map +1 -0
- package/dist/src/components/Modal/style.d.ts +5 -0
- package/dist/src/components/Modal/style.js +156 -0
- package/dist/src/components/Modal/style.js.map +1 -0
- package/dist/src/components/SVGs/backArrowSvg.d.ts +2 -0
- package/dist/src/components/SVGs/backArrowSvg.js +4 -0
- package/dist/src/components/SVGs/backArrowSvg.js.map +1 -0
- package/dist/src/components/SVGs/closeSvg.d.ts +2 -0
- package/dist/src/components/SVGs/closeSvg.js +4 -0
- package/dist/src/components/SVGs/closeSvg.js.map +1 -0
- package/dist/src/components/SVGs/copiedSvg.d.ts +2 -0
- package/dist/src/components/SVGs/copiedSvg.js +4 -0
- package/dist/src/components/SVGs/copiedSvg.js.map +1 -0
- package/dist/src/components/SVGs/copySvg.d.ts +2 -0
- package/dist/src/components/SVGs/copySvg.js +4 -0
- package/dist/src/components/SVGs/copySvg.js.map +1 -0
- package/dist/src/components/SVGs/exitSvg.d.ts +2 -0
- package/dist/src/components/SVGs/exitSvg.js +4 -0
- package/dist/src/components/SVGs/exitSvg.js.map +1 -0
- package/dist/src/components/SVGs/metamaskQrCode.d.ts +2 -0
- package/dist/src/components/SVGs/metamaskQrCode.js +4 -0
- package/dist/src/components/SVGs/metamaskQrCode.js.map +1 -0
- package/dist/src/components/SVGs/spinSvg.d.ts +4 -0
- package/dist/src/components/SVGs/spinSvg.js +4 -0
- package/dist/src/components/SVGs/spinSvg.js.map +1 -0
- package/dist/src/components/Text/index.d.ts +18 -0
- package/dist/src/components/Text/index.js +23 -0
- package/dist/src/components/Text/index.js.map +1 -0
- package/dist/src/components/WalletKitProvider/ChainProvider.d.ts +9 -0
- package/dist/src/components/WalletKitProvider/ChainProvider.js +21 -0
- package/dist/src/components/WalletKitProvider/ChainProvider.js.map +1 -0
- package/dist/src/components/WalletKitProvider/I18nProvider.d.ts +13 -0
- package/dist/src/components/WalletKitProvider/I18nProvider.js +41 -0
- package/dist/src/components/WalletKitProvider/I18nProvider.js.map +1 -0
- package/dist/src/components/WalletKitProvider/ThemeProvider.d.ts +8 -0
- package/dist/src/components/WalletKitProvider/ThemeProvider.js +12 -0
- package/dist/src/components/WalletKitProvider/ThemeProvider.js.map +1 -0
- package/dist/src/components/WalletKitProvider/index.d.ts +11 -0
- package/dist/src/components/WalletKitProvider/index.js +14 -0
- package/dist/src/components/WalletKitProvider/index.js.map +1 -0
- package/dist/src/components/WalletList/index.d.ts +7 -0
- package/dist/src/components/WalletList/index.js +9 -0
- package/dist/src/components/WalletList/index.js.map +1 -0
- package/dist/src/components/WalletList/style.d.ts +2 -0
- package/dist/src/components/WalletList/style.js +101 -0
- package/dist/src/components/WalletList/style.js.map +1 -0
- package/dist/src/components/WalletTriggerButton/index.d.ts +10 -0
- package/dist/src/components/WalletTriggerButton/index.js +27 -0
- package/dist/src/components/WalletTriggerButton/index.js.map +1 -0
- package/dist/src/components/WalletTriggerButton/style.d.ts +2 -0
- package/dist/src/components/WalletTriggerButton/style.js +50 -0
- package/dist/src/components/WalletTriggerButton/style.js.map +1 -0
- package/dist/src/hooks/useWalletKit.d.ts +6 -0
- package/dist/src/hooks/useWalletKit.js +20 -0
- package/dist/src/hooks/useWalletKit.js.map +1 -0
- package/dist/src/index.d.ts +8 -0
- package/dist/src/index.js +9 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/locals/i18n.d.ts +2 -0
- package/dist/src/locals/i18n.js +17 -0
- package/dist/src/locals/i18n.js.map +1 -0
- package/dist/src/locals/languages/en.json +27 -0
- package/dist/src/locals/languages/zh.json +27 -0
- package/dist/src/locals/resources.d.ts +60 -0
- package/dist/src/locals/resources.js +11 -0
- package/dist/src/locals/resources.js.map +1 -0
- package/dist/src/stores/SlotsWalletStore.d.ts +18 -0
- package/dist/src/stores/SlotsWalletStore.js +33 -0
- package/dist/src/stores/SlotsWalletStore.js.map +1 -0
- package/dist/src/stores/index.d.ts +34 -0
- package/dist/src/stores/index.js +41 -0
- package/dist/src/stores/index.js.map +1 -0
- package/dist/src/styled/index.d.ts +17 -0
- package/dist/src/styled/index.js +76 -0
- package/dist/src/styled/index.js.map +1 -0
- package/dist/src/test/getwalletprovider.test.d.ts +1 -0
- package/dist/src/test/getwalletprovider.test.js +10 -0
- package/dist/src/test/getwalletprovider.test.js.map +1 -0
- package/dist/src/test/setup.d.ts +1 -0
- package/dist/src/test/setup.js +7 -0
- package/dist/src/test/setup.js.map +1 -0
- package/dist/src/theme/index.d.ts +53 -0
- package/dist/src/theme/index.js +92 -0
- package/dist/src/theme/index.js.map +1 -0
- package/dist/src/types/configType.d.ts +2 -0
- package/dist/src/types/configType.js +2 -0
- package/dist/src/types/configType.js.map +1 -0
- package/dist/src/types/slotsType.d.ts +23 -0
- package/dist/src/types/slotsType.js +2 -0
- package/dist/src/types/slotsType.js.map +1 -0
- package/dist/src/utils/formatter.d.ts +1 -0
- package/dist/src/utils/formatter.js +6 -0
- package/dist/src/utils/formatter.js.map +1 -0
- package/dist/src/utils/generateAvatar.d.ts +4 -0
- package/dist/src/utils/generateAvatar.js +32 -0
- package/dist/src/utils/generateAvatar.js.map +1 -0
- package/dist/src/wallets/GelWallet/index.d.ts +0 -0
- package/dist/src/wallets/GelWallet/index.js +2 -0
- package/dist/src/wallets/GelWallet/index.js.map +1 -0
- package/dist/src/wallets/SlotsWallets/index.d.ts +3 -0
- package/dist/src/wallets/SlotsWallets/index.js +26 -0
- package/dist/src/wallets/SlotsWallets/index.js.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/package.json +42 -0
- package/src/assets/svg/dataBase.ts +17 -0
- package/src/assets/svg/metaMaskWallet.ts +35 -0
- package/src/components/ConnectButton/ConnectedInfo.tsx +17 -0
- package/src/components/ConnectButton/index.tsx +41 -0
- package/src/components/Connecting/index.tsx +26 -0
- package/src/components/Connecting/style.ts +53 -0
- package/src/components/GetWallet/index.tsx +88 -0
- package/src/components/GetWallet/style.ts +116 -0
- package/src/components/Header/ModalHeader.tsx +24 -0
- package/src/components/Header/style.ts +74 -0
- package/src/components/Icon/index.tsx +120 -0
- package/src/components/Introduce/index.tsx +30 -0
- package/src/components/Introduce/style.ts +73 -0
- package/src/components/Modal/ConnectModal.tsx +131 -0
- package/src/components/Modal/WalletInfoModal.tsx +82 -0
- package/src/components/Modal/index.tsx +80 -0
- package/src/components/Modal/style.ts +160 -0
- package/src/components/SVGs/backArrowSvg.tsx +10 -0
- package/src/components/SVGs/closeSvg.tsx +11 -0
- package/src/components/SVGs/copiedSvg.tsx +11 -0
- package/src/components/SVGs/copySvg.tsx +11 -0
- package/src/components/SVGs/exitSvg.tsx +11 -0
- package/src/components/SVGs/metamaskQrCode.tsx +393 -0
- package/src/components/SVGs/spinSvg.tsx +10 -0
- package/src/components/Text/index.tsx +59 -0
- package/src/components/WalletKitProvider/ChainProvider.tsx +34 -0
- package/src/components/WalletKitProvider/I18nProvider.tsx +52 -0
- package/src/components/WalletKitProvider/ThemeProvider.tsx +16 -0
- package/src/components/WalletKitProvider/index.tsx +40 -0
- package/src/components/WalletList/index.tsx +35 -0
- package/src/components/WalletList/style.ts +101 -0
- package/src/components/WalletTriggerButton/index.tsx +50 -0
- package/src/components/WalletTriggerButton/style.ts +51 -0
- package/src/default.d.ts +18 -0
- package/src/hooks/useWalletKit.ts +38 -0
- package/src/index.ts +8 -0
- package/src/locals/i18n.ts +19 -0
- package/src/locals/languages/en.json +27 -0
- package/src/locals/languages/zh.json +27 -0
- package/src/locals/resources.ts +11 -0
- package/src/stores/SlotsWalletStore.ts +48 -0
- package/src/stores/index.ts +74 -0
- package/src/styled/index.ts +79 -0
- package/src/test/getwalletprovider.test.ts +9 -0
- package/src/test/setup.ts +7 -0
- package/src/theme/index.ts +93 -0
- package/src/theme/styled.d.ts +30 -0
- package/src/types/configType.ts +2 -0
- package/src/types/slotsType.ts +23 -0
- package/src/utils/formatter.ts +4 -0
- package/src/utils/generateAvatar.ts +35 -0
- package/src/wallets/GelWallet/index.ts +0 -0
- package/src/wallets/SlotsWallets/index.ts +30 -0
- package/tsconfig.build.json +4 -0
- package/tsconfig.json +55 -0
- package/vitest.config.ts +10 -0
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { styled } from 'styled-components';
|
|
2
|
+
const WalletListContainer = styled.div `
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
font-family: Manrope;
|
|
6
|
+
color: ${({ theme }) => theme.textColor1};
|
|
7
|
+
height: 100%;
|
|
8
|
+
|
|
9
|
+
.walletList {
|
|
10
|
+
display: flex;
|
|
11
|
+
flex-direction: column;
|
|
12
|
+
padding: 10px 20px 0;
|
|
13
|
+
gap: 20px;
|
|
14
|
+
flex: 1;
|
|
15
|
+
|
|
16
|
+
.walletItem {
|
|
17
|
+
display: flex;
|
|
18
|
+
align-items: center;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
img {
|
|
22
|
+
width: 28px;
|
|
23
|
+
height: 28px;
|
|
24
|
+
flex-shrink: 0;
|
|
25
|
+
margin-right: 10px;
|
|
26
|
+
border-radius: 6px;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.name {
|
|
30
|
+
font-size: 14px;
|
|
31
|
+
font-weight: 700;
|
|
32
|
+
line-height: 14px;
|
|
33
|
+
color: ${({ theme }) => theme.textColor};
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.description {
|
|
37
|
+
margin-top: 10px;
|
|
38
|
+
font-size: 12px;
|
|
39
|
+
font-weight: 500;
|
|
40
|
+
line-height: 14px;
|
|
41
|
+
color: ${({ theme }) => theme.textColor3};
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.button {
|
|
45
|
+
display: inline-block;
|
|
46
|
+
margin-left: auto;
|
|
47
|
+
padding: 11px 16px;
|
|
48
|
+
color: ${({ theme }) => theme.buttonColor};
|
|
49
|
+
background: ${({ theme }) => theme.buttonBg};
|
|
50
|
+
font-size: 14px;
|
|
51
|
+
font-weight: 700;
|
|
52
|
+
line-height: 14px;
|
|
53
|
+
text-align: center;
|
|
54
|
+
border-radius: 8px;
|
|
55
|
+
box-sizing: border-box;
|
|
56
|
+
cursor: pointer;
|
|
57
|
+
height: 36px;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.question {
|
|
62
|
+
margin-left: 42px;
|
|
63
|
+
margin-bottom: 10px;
|
|
64
|
+
font-size: 16px;
|
|
65
|
+
font-weight: 700;
|
|
66
|
+
line-height: 16px;
|
|
67
|
+
color: ${({ theme }) => theme.textColor4};
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.answer {
|
|
71
|
+
margin-left: 42px;
|
|
72
|
+
margin-bottom: 47px;
|
|
73
|
+
font-size: 16px;
|
|
74
|
+
font-weight: 400;
|
|
75
|
+
line-height: 16px;
|
|
76
|
+
color: ${({ theme }) => theme.textColor4};
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
@media (max-width: 768px) {
|
|
80
|
+
.walletList {
|
|
81
|
+
padding: 10px 28px 0;
|
|
82
|
+
min-height: 237px;
|
|
83
|
+
max-height: 237px;
|
|
84
|
+
overflow: auto;
|
|
85
|
+
|
|
86
|
+
.button {
|
|
87
|
+
font-size: 12px;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.question {
|
|
92
|
+
margin: 10px 25px;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.answer {
|
|
96
|
+
margin: 0 25px 75px;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
`;
|
|
100
|
+
export default WalletListContainer;
|
|
101
|
+
//# sourceMappingURL=style.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style.js","sourceRoot":"","sources":["../../../../src/components/WalletList/style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,MAAM,mBAAmB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;UAI5B,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;YA2B7B,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC,SAAS;;;;;;;;YAQ9B,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC,UAAU;;;;;;;YAO/B,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC,WAAW;iBAC3B,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ;;;;;;;;;;;;;;;;;;WAkBnC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC,UAAU;;;;;;;;;WAS/B,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC,UAAU;;;;;;;;;;;;;;;;;;;;;;;CAuBzC,CAAC;AACF,eAAe,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ISlotsConnector } from '../../types/slotsType';
|
|
3
|
+
export interface IWalletTriggerButton {
|
|
4
|
+
connector: any;
|
|
5
|
+
}
|
|
6
|
+
export interface IWalletSlotTriggerButton {
|
|
7
|
+
slotsConnector: ISlotsConnector;
|
|
8
|
+
}
|
|
9
|
+
export declare const WalletTriggerButton: React.FC<IWalletTriggerButton>;
|
|
10
|
+
export declare const WalletSlotTriggerButton: React.FC<IWalletSlotTriggerButton>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React, { useMemo } from 'react';
|
|
3
|
+
import Text from '../Text';
|
|
4
|
+
import { FlexBox } from '../../styled';
|
|
5
|
+
import Icon from '../Icon';
|
|
6
|
+
import useSlotsWalletStore from '../../stores/SlotsWalletStore';
|
|
7
|
+
import WalletItem from './style';
|
|
8
|
+
import { useWalletKit } from '../../hooks/useWalletKit';
|
|
9
|
+
export const WalletTriggerButton = ({ connector }) => {
|
|
10
|
+
const { connectStatus } = useWalletKit();
|
|
11
|
+
const disabled = useMemo(() => {
|
|
12
|
+
return connectStatus === 'connected' || connectStatus === 'connecting';
|
|
13
|
+
}, [connectStatus]);
|
|
14
|
+
const handleConnect = async () => {
|
|
15
|
+
if (disabled)
|
|
16
|
+
return;
|
|
17
|
+
console.log('connector', connector);
|
|
18
|
+
await connector.connect();
|
|
19
|
+
};
|
|
20
|
+
return (_jsx(WalletItem, { onClick: handleConnect, className: disabled ? 'disabled' : '', children: _jsxs(FlexBox, { className: 'gap-10', children: [_jsx(Icon, { src: connector.icon || '' }), _jsx(Text, { text: connector.name })] }) }));
|
|
21
|
+
};
|
|
22
|
+
export const WalletSlotTriggerButton = ({ slotsConnector }) => {
|
|
23
|
+
const useAddConnector = useSlotsWalletStore((state) => state.addConnector);
|
|
24
|
+
useAddConnector(slotsConnector);
|
|
25
|
+
return (_jsx(WalletItem, { children: _jsxs(FlexBox, { className: 'gap-10', children: [_jsx(Icon, { src: slotsConnector.walletIcon }), _jsx(Text, { text: slotsConnector.walletName })] }) }));
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/WalletTriggerButton/index.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,mBAAmB,MAAM,+BAA+B,CAAC;AAEhE,OAAO,UAAU,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AASxD,MAAM,CAAC,MAAM,mBAAmB,GAAmC,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE;IACpF,MAAM,EAAE,aAAa,EAAE,GAAG,YAAY,EAAE,CAAC;IAEzC,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,EAAE;QAC7B,OAAO,aAAa,KAAK,WAAW,IAAI,aAAa,KAAK,YAAY,CAAC;IACxE,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC;IAEpB,MAAM,aAAa,GAAG,KAAK,IAAI,EAAE;QAChC,IAAI,QAAQ;YAAE,OAAO;QACrB,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;QACpC,MAAM,SAAS,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC,CAAC;IACF,OAAO,CACN,KAAC,UAAU,IAAC,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,YACxE,MAAC,OAAO,IAAC,SAAS,EAAE,QAAQ,aAC3B,KAAC,IAAI,IAAC,GAAG,EAAE,SAAS,CAAC,IAAI,IAAI,EAAE,GAAI,EACnC,KAAC,IAAI,IAAC,IAAI,EAAE,SAAS,CAAC,IAAI,GAAI,IACrB,GACE,CACb,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAuC,CAAC,EAAE,cAAc,EAAE,EAAE,EAAE;IACjG,MAAM,eAAe,GAAG,mBAAmB,CAAC,CAAC,KAAU,EAAE,EAAE,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;IAChF,eAAe,CAAC,cAAc,CAAC,CAAC;IAChC,OAAO,CACN,KAAC,UAAU,cACV,MAAC,OAAO,IAAC,SAAS,EAAE,QAAQ,aAC3B,KAAC,IAAI,IAAC,GAAG,EAAE,cAAc,CAAC,UAAU,GAAI,EACxC,KAAC,IAAI,IAAC,IAAI,EAAE,cAAc,CAAC,UAAU,GAAI,IAChC,GACE,CACb,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { styled } from 'styled-components';
|
|
2
|
+
const WalletItem = styled.div `
|
|
3
|
+
display: flex;
|
|
4
|
+
padding: 12px;
|
|
5
|
+
border-radius: 12px;
|
|
6
|
+
cursor: pointer;
|
|
7
|
+
flex-shrink: 0;
|
|
8
|
+
box-sizing: border-box;
|
|
9
|
+
user-select: none;
|
|
10
|
+
|
|
11
|
+
img {
|
|
12
|
+
border-radius: 6px;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
&:hover {
|
|
16
|
+
background: ${({ theme }) => theme.itemHoverBg};
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
&.disabled {
|
|
20
|
+
pointer-events: none;
|
|
21
|
+
background: none;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@media (max-width: 768px) {
|
|
25
|
+
width: 86px;
|
|
26
|
+
justify-content: center;
|
|
27
|
+
|
|
28
|
+
> div {
|
|
29
|
+
box-sizing: border-box;
|
|
30
|
+
flex-direction: column;
|
|
31
|
+
align-items: center;
|
|
32
|
+
|
|
33
|
+
img {
|
|
34
|
+
width: 36px;
|
|
35
|
+
height: 36px;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
> div {
|
|
39
|
+
line-height: 14px;
|
|
40
|
+
text-align: center;
|
|
41
|
+
|
|
42
|
+
span {
|
|
43
|
+
font-size: 12px;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
`;
|
|
49
|
+
export default WalletItem;
|
|
50
|
+
//# sourceMappingURL=style.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style.js","sourceRoot":"","sources":["../../../../src/components/WalletTriggerButton/style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,MAAM,UAAU,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;gBAcb,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgC/C,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type WalletHelperState } from '@web3jskit/wallethelper';
|
|
2
|
+
import { AppModal, type WalletKitState } from '../stores';
|
|
3
|
+
type WalletKit = WalletHelperState & WalletKitState;
|
|
4
|
+
export declare const useWalletKit: () => WalletKit;
|
|
5
|
+
export declare const getWalletKit: () => WalletKit;
|
|
6
|
+
export { AppModal };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { walletHelperStore } from '@web3jskit/wallethelper';
|
|
2
|
+
import { walletKitStore, AppModal } from '../stores';
|
|
3
|
+
export const useWalletKit = () => {
|
|
4
|
+
const walletHelperStates = walletHelperStore((states) => states);
|
|
5
|
+
const walletKitStates = walletKitStore((states) => states);
|
|
6
|
+
return {
|
|
7
|
+
...walletHelperStates,
|
|
8
|
+
...walletKitStates
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export const getWalletKit = () => {
|
|
12
|
+
const walletHelperStates = walletHelperStore.getState();
|
|
13
|
+
const walletKitStates = walletKitStore.getState();
|
|
14
|
+
return {
|
|
15
|
+
...walletHelperStates,
|
|
16
|
+
...walletKitStates
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export { AppModal };
|
|
20
|
+
//# sourceMappingURL=useWalletKit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useWalletKit.js","sourceRoot":"","sources":["../../../src/hooks/useWalletKit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAA0B,MAAM,yBAAyB,CAAC;AACpF,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAuB,MAAM,WAAW,CAAC;AAK1E,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,EAAE;IAChC,MAAM,kBAAkB,GAAG,iBAAiB,CAAC,CAAC,MAAW,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC;IAEtE,MAAM,eAAe,GAAG,cAAc,CAAC,CAAC,MAAW,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC;IAIhE,OAAO;QACN,GAAG,kBAAkB;QAGrB,GAAG,eAAe;KACL,CAAC;AAChB,CAAC,CAAC;AAGF,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,EAAE;IAChC,MAAM,kBAAkB,GAAG,iBAAiB,CAAC,QAAQ,EAAE,CAAC;IAExD,MAAM,eAAe,GAAG,cAAc,CAAC,QAAQ,EAAE,CAAC;IAIlD,OAAO;QACN,GAAG,kBAAkB;QAGrB,GAAG,eAAe;KACL,CAAC;AAChB,CAAC,CAAC;AAEF,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './components/WalletKitProvider';
|
|
2
|
+
export * from './components/ConnectButton';
|
|
3
|
+
export * from './types/configType';
|
|
4
|
+
export * from './types/slotsType';
|
|
5
|
+
export { createSlots } from './wallets/SlotsWallets/index';
|
|
6
|
+
export { WalletSlotTriggerButton } from './components/WalletTriggerButton/index';
|
|
7
|
+
export { useWalletKit, getWalletKit } from './hooks/useWalletKit';
|
|
8
|
+
export { AppModal } from './stores';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './components/WalletKitProvider';
|
|
2
|
+
export * from './components/ConnectButton';
|
|
3
|
+
export * from './types/configType';
|
|
4
|
+
export * from './types/slotsType';
|
|
5
|
+
export { createSlots } from './wallets/SlotsWallets/index';
|
|
6
|
+
export { WalletSlotTriggerButton } from './components/WalletTriggerButton/index';
|
|
7
|
+
export { useWalletKit, getWalletKit } from './hooks/useWalletKit';
|
|
8
|
+
export { AppModal } from './stores';
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC;AAC/C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import i18n from 'i18next';
|
|
2
|
+
import { initReactI18next } from 'react-i18next';
|
|
3
|
+
import { resources } from './resources';
|
|
4
|
+
i18n.use(initReactI18next).init({
|
|
5
|
+
resources,
|
|
6
|
+
react: {
|
|
7
|
+
useSuspense: true
|
|
8
|
+
},
|
|
9
|
+
fallbackLng: 'en',
|
|
10
|
+
preload: ['zh-CN', 'en', 'zh', 'en-US'],
|
|
11
|
+
keySeparator: false,
|
|
12
|
+
interpolation: {
|
|
13
|
+
escapeValue: false
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
export default i18n;
|
|
17
|
+
//# sourceMappingURL=i18n.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i18n.js","sourceRoot":"","sources":["../../../src/locals/i18n.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC,IAAI,CAAC;IAC/B,SAAS;IACT,KAAK,EAAE;QACN,WAAW,EAAE,IAAI;KACjB;IACD,WAAW,EAAE,IAAI;IACjB,OAAO,EAAE,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC;IACvC,YAAY,EAAE,KAAK;IACnB,aAAa,EAAE;QACd,WAAW,EAAE,KAAK;KAClB;CACD,CAAC,CAAC;AAEH,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "wallet",
|
|
3
|
+
"connectWallet": "Connect Wallet",
|
|
4
|
+
"introduceQuestion": "What is a wallet?",
|
|
5
|
+
"introduceAnswer": "Your Digital Asset Home",
|
|
6
|
+
"introduceDetail": "Wallets are used to send, receive, store, and display digital assets such as Ethereum and NFTs.",
|
|
7
|
+
"getWallet": "Get Wallet",
|
|
8
|
+
"learnMore": "Learn More",
|
|
9
|
+
"getWalletTitle": "Get a wallet",
|
|
10
|
+
"getWalletTips": "Mobile Wallet and Expansion,",
|
|
11
|
+
"getWalletQuestion": "Isn't that what you're looking for?",
|
|
12
|
+
"getWalletAnswer": "Select a wallet on the left to start using different wallet providers.",
|
|
13
|
+
"forChrome": "for Chrome",
|
|
14
|
+
"chromeDescription": "Access your wallet directly from your favorite web browser.",
|
|
15
|
+
"addToChrome": "Add to Chrome",
|
|
16
|
+
"forMobile": "for Mobile",
|
|
17
|
+
"mobileDescription": "Explore the world of Ethereum with a mobile wallet.",
|
|
18
|
+
"getMobileApp": "Get the App",
|
|
19
|
+
"getAppTip": "Scan with your phone to download for iOS or Android",
|
|
20
|
+
"get": "Get",
|
|
21
|
+
"continue": "Continue",
|
|
22
|
+
"opening": "Opening",
|
|
23
|
+
"confirmConnection": "Confirm connection in extension",
|
|
24
|
+
"copyAddress": "Copy Address",
|
|
25
|
+
"copied": "Copied!",
|
|
26
|
+
"disConnect": "Disconnect"
|
|
27
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "钱包",
|
|
3
|
+
"connectWallet": "连接钱包",
|
|
4
|
+
"introduceQuestion": "什么是钱包?",
|
|
5
|
+
"introduceAnswer": "您的数字资产之家",
|
|
6
|
+
"introduceDetail": "钱包用于发送、接收、存储和展示数字资产,例如以太坊和 NFT。",
|
|
7
|
+
"getWallet": "获取钱包",
|
|
8
|
+
"learnMore": "了解更多",
|
|
9
|
+
"getWalletTitle": "获取钱包",
|
|
10
|
+
"getWalletTips": "移动钱包和扩展程序",
|
|
11
|
+
"getWalletQuestion": "不是你要找的吗?",
|
|
12
|
+
"getWalletAnswer": "在左侧选择一个钱包以开始使用不同的钱包提供商。",
|
|
13
|
+
"forChrome": "为 Chrome",
|
|
14
|
+
"chromeDescription": "从您最喜欢的网络浏览器直接访问您的钱包。",
|
|
15
|
+
"addToChrome": "添加到 Chrome",
|
|
16
|
+
"forMobile": "用于移动",
|
|
17
|
+
"mobileDescription": "使用移动钱包探索以太坊的世界。",
|
|
18
|
+
"getMobileApp": "获取应用",
|
|
19
|
+
"getAppTip": "用手机扫描下载 iOS 或 Android",
|
|
20
|
+
"get": "获取",
|
|
21
|
+
"continue": "继续",
|
|
22
|
+
"opening": "打开",
|
|
23
|
+
"confirmConnection": "在扩展程序中确认连接",
|
|
24
|
+
"copyAddress": "复制地址",
|
|
25
|
+
"copied": "已复制!",
|
|
26
|
+
"disConnect": "断开连接"
|
|
27
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
export declare const resources: {
|
|
2
|
+
en: {
|
|
3
|
+
translation: {
|
|
4
|
+
title: string;
|
|
5
|
+
connectWallet: string;
|
|
6
|
+
introduceQuestion: string;
|
|
7
|
+
introduceAnswer: string;
|
|
8
|
+
introduceDetail: string;
|
|
9
|
+
getWallet: string;
|
|
10
|
+
learnMore: string;
|
|
11
|
+
getWalletTitle: string;
|
|
12
|
+
getWalletTips: string;
|
|
13
|
+
getWalletQuestion: string;
|
|
14
|
+
getWalletAnswer: string;
|
|
15
|
+
forChrome: string;
|
|
16
|
+
chromeDescription: string;
|
|
17
|
+
addToChrome: string;
|
|
18
|
+
forMobile: string;
|
|
19
|
+
mobileDescription: string;
|
|
20
|
+
getMobileApp: string;
|
|
21
|
+
getAppTip: string;
|
|
22
|
+
get: string;
|
|
23
|
+
continue: string;
|
|
24
|
+
opening: string;
|
|
25
|
+
confirmConnection: string;
|
|
26
|
+
copyAddress: string;
|
|
27
|
+
copied: string;
|
|
28
|
+
disConnect: string;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
zh: {
|
|
32
|
+
translation: {
|
|
33
|
+
title: string;
|
|
34
|
+
connectWallet: string;
|
|
35
|
+
introduceQuestion: string;
|
|
36
|
+
introduceAnswer: string;
|
|
37
|
+
introduceDetail: string;
|
|
38
|
+
getWallet: string;
|
|
39
|
+
learnMore: string;
|
|
40
|
+
getWalletTitle: string;
|
|
41
|
+
getWalletTips: string;
|
|
42
|
+
getWalletQuestion: string;
|
|
43
|
+
getWalletAnswer: string;
|
|
44
|
+
forChrome: string;
|
|
45
|
+
chromeDescription: string;
|
|
46
|
+
addToChrome: string;
|
|
47
|
+
forMobile: string;
|
|
48
|
+
mobileDescription: string;
|
|
49
|
+
getMobileApp: string;
|
|
50
|
+
getAppTip: string;
|
|
51
|
+
get: string;
|
|
52
|
+
continue: string;
|
|
53
|
+
opening: string;
|
|
54
|
+
confirmConnection: string;
|
|
55
|
+
copyAddress: string;
|
|
56
|
+
copied: string;
|
|
57
|
+
disConnect: string;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resources.js","sourceRoot":"","sources":["../../../src/locals/resources.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACrC,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAErC,MAAM,CAAC,MAAM,SAAS,GAAG;IACxB,EAAE,EAAE;QACH,WAAW,EAAE,EAAE;KACf;IACD,EAAE,EAAE;QACH,WAAW,EAAE,EAAE;KACf;CACD,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ISlotsConnector } from '../types/slotsType';
|
|
2
|
+
export interface ISlotsWallets {
|
|
3
|
+
walletConnectors: {
|
|
4
|
+
[key: string]: ISlotsConnector;
|
|
5
|
+
};
|
|
6
|
+
}
|
|
7
|
+
declare const useSlotsWalletStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<ISlotsWallets>, "persist"> & {
|
|
8
|
+
persist: {
|
|
9
|
+
setOptions: (options: Partial<import("zustand/middleware").PersistOptions<ISlotsWallets, unknown>>) => void;
|
|
10
|
+
clearStorage: () => void;
|
|
11
|
+
rehydrate: () => Promise<void> | void;
|
|
12
|
+
hasHydrated: () => boolean;
|
|
13
|
+
onHydrate: (fn: (state: ISlotsWallets) => void) => () => void;
|
|
14
|
+
onFinishHydration: (fn: (state: ISlotsWallets) => void) => () => void;
|
|
15
|
+
getOptions: () => Partial<import("zustand/middleware").PersistOptions<ISlotsWallets, unknown>>;
|
|
16
|
+
};
|
|
17
|
+
}>;
|
|
18
|
+
export default useSlotsWalletStore;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { create } from 'zustand';
|
|
2
|
+
import { persist, createJSONStorage } from 'zustand/middleware';
|
|
3
|
+
const useSlotsWalletStore = create(persist((set, get) => ({
|
|
4
|
+
walletConnectors: {},
|
|
5
|
+
addConnector({ walletName, walletIcon, connector, uuid, connectorNamespace }) {
|
|
6
|
+
return set(state => {
|
|
7
|
+
return {
|
|
8
|
+
walletConnectors: {
|
|
9
|
+
...state.walletConnectors,
|
|
10
|
+
[uuid]: { walletName, walletIcon, connector, uuid, connectorNamespace }
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
});
|
|
14
|
+
},
|
|
15
|
+
removeConnector(uuid) {
|
|
16
|
+
return set(state => {
|
|
17
|
+
if (get().walletConnectors[uuid]) {
|
|
18
|
+
return {
|
|
19
|
+
walletConnectors: Object.fromEntries(Object.entries(state.walletConnectors).filter(([k]) => k !== uuid))
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
return { walletConnectors: { ...state.walletConnectors } };
|
|
23
|
+
});
|
|
24
|
+
},
|
|
25
|
+
clearConnectors() {
|
|
26
|
+
return set(() => ({ walletConnectors: {} }));
|
|
27
|
+
}
|
|
28
|
+
}), {
|
|
29
|
+
name: 'WALLET_KIT_SLOTS',
|
|
30
|
+
storage: createJSONStorage(() => localStorage)
|
|
31
|
+
}));
|
|
32
|
+
export default useSlotsWalletStore;
|
|
33
|
+
//# sourceMappingURL=SlotsWalletStore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SlotsWalletStore.js","sourceRoot":"","sources":["../../../src/stores/SlotsWalletStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAShE,MAAM,mBAAmB,GAAG,MAAM,CACjC,OAAO,CACN,CAAC,GAAG,EAAE,GAAwB,EAAE,EAAE,CAAC,CAAC;IACnC,gBAAgB,EAAE,EAAE;IACpB,YAAY,CAAC,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,IAAI,EAAE,kBAAkB,EAAmB;QAC5F,OAAO,GAAG,CAAC,KAAK,CAAC,EAAE;YAClB,OAAO;gBACN,gBAAgB,EAAE;oBACjB,GAAG,KAAK,CAAC,gBAAgB;oBACzB,CAAC,IAAI,CAAC,EAAE,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,IAAI,EAAE,kBAAkB,EAAE;iBACvE;aACD,CAAC;QACH,CAAC,CAAC,CAAC;IACJ,CAAC;IAED,eAAe,CAAC,IAAY;QAC3B,OAAO,GAAG,CAAC,KAAK,CAAC,EAAE;YAClB,IAAI,GAAG,EAAE,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC;gBAClC,OAAO;oBACN,gBAAgB,EAAE,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC;iBACxG,CAAC;YACH,CAAC;YACD,OAAO,EAAE,gBAAgB,EAAE,EAAE,GAAG,KAAK,CAAC,gBAAgB,EAAE,EAAE,CAAC;QAC5D,CAAC,CAAC,CAAC;IACJ,CAAC;IAED,eAAe;QACd,OAAO,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,gBAAgB,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;IAC9C,CAAC;CACD,CAAC,EACF;IACC,IAAI,EAAE,kBAAkB;IACxB,OAAO,EAAE,iBAAiB,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC;CAC9C,CACD,CACD,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { Locals, Theme } from '../types/configType';
|
|
2
|
+
export declare enum AppModal {
|
|
3
|
+
ConnectModal = 0,
|
|
4
|
+
InfoModal = 1
|
|
5
|
+
}
|
|
6
|
+
type Avatar = {
|
|
7
|
+
text: string;
|
|
8
|
+
bg: string;
|
|
9
|
+
};
|
|
10
|
+
export interface WalletKitState {
|
|
11
|
+
chains: Array<any>;
|
|
12
|
+
setChains: (chains: Array<any>) => void;
|
|
13
|
+
language: Locals | null;
|
|
14
|
+
setLanguage: (language: Locals) => void;
|
|
15
|
+
theme: Theme | null;
|
|
16
|
+
toggleTheme: (theme: Theme) => void;
|
|
17
|
+
modalType: AppModal | null;
|
|
18
|
+
openModal: (modal: AppModal) => void;
|
|
19
|
+
closeModal: () => void;
|
|
20
|
+
avatar: Avatar | null;
|
|
21
|
+
setAvatar: (avatar: Avatar) => void;
|
|
22
|
+
}
|
|
23
|
+
export declare const walletKitStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<WalletKitState>, "persist"> & {
|
|
24
|
+
persist: {
|
|
25
|
+
setOptions: (options: Partial<import("zustand/middleware").PersistOptions<WalletKitState, unknown>>) => void;
|
|
26
|
+
clearStorage: () => void;
|
|
27
|
+
rehydrate: () => Promise<void> | void;
|
|
28
|
+
hasHydrated: () => boolean;
|
|
29
|
+
onHydrate: (fn: (state: WalletKitState) => void) => () => void;
|
|
30
|
+
onFinishHydration: (fn: (state: WalletKitState) => void) => () => void;
|
|
31
|
+
getOptions: () => Partial<import("zustand/middleware").PersistOptions<WalletKitState, unknown>>;
|
|
32
|
+
};
|
|
33
|
+
}>;
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { create } from 'zustand';
|
|
2
|
+
import { persist, createJSONStorage } from 'zustand/middleware';
|
|
3
|
+
export var AppModal;
|
|
4
|
+
(function (AppModal) {
|
|
5
|
+
AppModal[AppModal["ConnectModal"] = 0] = "ConnectModal";
|
|
6
|
+
AppModal[AppModal["InfoModal"] = 1] = "InfoModal";
|
|
7
|
+
})(AppModal || (AppModal = {}));
|
|
8
|
+
export const walletKitStore = create()(persist(set => ({
|
|
9
|
+
chains: [],
|
|
10
|
+
setChains(chains) {
|
|
11
|
+
return set(() => ({ chains }));
|
|
12
|
+
},
|
|
13
|
+
language: null,
|
|
14
|
+
setLanguage(language) {
|
|
15
|
+
return set(() => ({ language }));
|
|
16
|
+
},
|
|
17
|
+
theme: null,
|
|
18
|
+
toggleTheme(theme) {
|
|
19
|
+
return set(() => ({ theme: theme === 'darkMode' ? 'lightMode' : 'darkMode' }));
|
|
20
|
+
},
|
|
21
|
+
modalType: null,
|
|
22
|
+
openModal(modal) {
|
|
23
|
+
return set(() => ({ modalType: modal }));
|
|
24
|
+
},
|
|
25
|
+
closeModal() {
|
|
26
|
+
return set(() => ({ modalType: null }));
|
|
27
|
+
},
|
|
28
|
+
avatar: null,
|
|
29
|
+
setAvatar(avatar) {
|
|
30
|
+
return set(() => ({ avatar }));
|
|
31
|
+
}
|
|
32
|
+
}), {
|
|
33
|
+
name: 'WALLET_KIT_STORE',
|
|
34
|
+
storage: createJSONStorage(() => localStorage),
|
|
35
|
+
onRehydrateStorage: () => state => {
|
|
36
|
+
if (state) {
|
|
37
|
+
state.closeModal();
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}));
|
|
41
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/stores/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAGhE,MAAM,CAAN,IAAY,QAGX;AAHD,WAAY,QAAQ;IACnB,uDAAY,CAAA;IACZ,iDAAS,CAAA;AACV,CAAC,EAHW,QAAQ,KAAR,QAAQ,QAGnB;AAyBD,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,EAAkB,CACrD,OAAO,CACN,GAAG,CAAC,EAAE,CAAC,CAAC;IACP,MAAM,EAAE,EAAE;IACV,SAAS,CAAC,MAAkB;QAC3B,OAAO,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;IAChC,CAAC;IAED,QAAQ,EAAE,IAAI;IACd,WAAW,CAAC,QAAgB;QAC3B,OAAO,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC;IAClC,CAAC;IAED,KAAK,EAAE,IAAI;IACX,WAAW,CAAC,KAAY;QACvB,OAAO,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,KAAK,UAAU,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;IAChF,CAAC;IAED,SAAS,EAAE,IAAI;IACf,SAAS,CAAC,KAAe;QACxB,OAAO,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;IAC1C,CAAC;IACD,UAAU;QACT,OAAO,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IACzC,CAAC;IAED,MAAM,EAAE,IAAI;IACZ,SAAS,CAAC,MAAc;QACvB,OAAO,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;IAChC,CAAC;CACD,CAAC,EACF;IACC,IAAI,EAAE,kBAAkB;IACxB,OAAO,EAAE,iBAAiB,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC;IAC9C,kBAAkB,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,EAAE;QACjC,IAAI,KAAK,EAAE,CAAC;YACX,KAAK,CAAC,UAAU,EAAE,CAAC;QACpB,CAAC;IACF,CAAC;CACD,CACD,CACD,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const FlexBox: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
2
|
+
export declare const FlexCenter: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
3
|
+
export declare const FlexAICenter: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
4
|
+
export declare const FlexJCCenter: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
5
|
+
export declare const FlexJCSpaceBetween: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
6
|
+
export declare const FlexJCEnd: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
7
|
+
export declare const FlexJCStart: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
8
|
+
export declare const FlexWrap: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
9
|
+
export declare const FlexCol: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
10
|
+
export declare const FlexColAIEnd: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
11
|
+
export declare const FlexColJCEnd: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
12
|
+
export declare const FlexCenterCol: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
13
|
+
export declare const FlexJCCenterCol: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
14
|
+
export declare const FlexJCSBCol: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
15
|
+
export declare const FlexJCSBCenter: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
16
|
+
export declare const FlexAICenterCol: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
17
|
+
export declare const SlotWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|