@web3jskit/walletkit 0.1.4 → 0.1.6

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 (168) hide show
  1. package/README.md +131 -152
  2. package/package.json +2 -2
  3. package/dist/package.json +0 -46
  4. package/dist/src/assets/svg/dataBase.d.ts +0 -4
  5. package/dist/src/assets/svg/dataBase.js +0 -5
  6. package/dist/src/assets/svg/dataBase.js.map +0 -1
  7. package/dist/src/assets/svg/metaMaskWallet.d.ts +0 -1
  8. package/dist/src/assets/svg/metaMaskWallet.js +0 -35
  9. package/dist/src/assets/svg/metaMaskWallet.js.map +0 -1
  10. package/dist/src/components/ConnectButton/ConnectedInfo.d.ts +0 -1
  11. package/dist/src/components/ConnectButton/ConnectedInfo.js +0 -13
  12. package/dist/src/components/ConnectButton/ConnectedInfo.js.map +0 -1
  13. package/dist/src/components/ConnectButton/index.d.ts +0 -8
  14. package/dist/src/components/ConnectButton/index.js +0 -16
  15. package/dist/src/components/ConnectButton/index.js.map +0 -1
  16. package/dist/src/components/Connecting/index.d.ts +0 -6
  17. package/dist/src/components/Connecting/index.js +0 -11
  18. package/dist/src/components/Connecting/index.js.map +0 -1
  19. package/dist/src/components/Connecting/style.d.ts +0 -2
  20. package/dist/src/components/Connecting/style.js +0 -52
  21. package/dist/src/components/Connecting/style.js.map +0 -1
  22. package/dist/src/components/GetWallet/index.d.ts +0 -7
  23. package/dist/src/components/GetWallet/index.js +0 -21
  24. package/dist/src/components/GetWallet/index.js.map +0 -1
  25. package/dist/src/components/GetWallet/style.d.ts +0 -2
  26. package/dist/src/components/GetWallet/style.js +0 -117
  27. package/dist/src/components/GetWallet/style.js.map +0 -1
  28. package/dist/src/components/Header/ModalHeader.d.ts +0 -8
  29. package/dist/src/components/Header/ModalHeader.js +0 -9
  30. package/dist/src/components/Header/ModalHeader.js.map +0 -1
  31. package/dist/src/components/Header/style.d.ts +0 -2
  32. package/dist/src/components/Header/style.js +0 -73
  33. package/dist/src/components/Header/style.js.map +0 -1
  34. package/dist/src/components/Icon/index.d.ts +0 -23
  35. package/dist/src/components/Icon/index.js +0 -48
  36. package/dist/src/components/Icon/index.js.map +0 -1
  37. package/dist/src/components/Introduce/index.d.ts +0 -6
  38. package/dist/src/components/Introduce/index.js +0 -10
  39. package/dist/src/components/Introduce/index.js.map +0 -1
  40. package/dist/src/components/Introduce/style.d.ts +0 -2
  41. package/dist/src/components/Introduce/style.js +0 -72
  42. package/dist/src/components/Introduce/style.js.map +0 -1
  43. package/dist/src/components/Modal/ConnectModal.d.ts +0 -7
  44. package/dist/src/components/Modal/ConnectModal.js +0 -114
  45. package/dist/src/components/Modal/ConnectModal.js.map +0 -1
  46. package/dist/src/components/Modal/WalletInfoModal.d.ts +0 -1
  47. package/dist/src/components/Modal/WalletInfoModal.js +0 -46
  48. package/dist/src/components/Modal/WalletInfoModal.js.map +0 -1
  49. package/dist/src/components/Modal/index.d.ts +0 -13
  50. package/dist/src/components/Modal/index.js +0 -52
  51. package/dist/src/components/Modal/index.js.map +0 -1
  52. package/dist/src/components/Modal/style.d.ts +0 -5
  53. package/dist/src/components/Modal/style.js +0 -186
  54. package/dist/src/components/Modal/style.js.map +0 -1
  55. package/dist/src/components/SVGs/backArrowSvg.d.ts +0 -2
  56. package/dist/src/components/SVGs/backArrowSvg.js +0 -4
  57. package/dist/src/components/SVGs/backArrowSvg.js.map +0 -1
  58. package/dist/src/components/SVGs/closeSvg.d.ts +0 -2
  59. package/dist/src/components/SVGs/closeSvg.js +0 -4
  60. package/dist/src/components/SVGs/closeSvg.js.map +0 -1
  61. package/dist/src/components/SVGs/copiedSvg.d.ts +0 -2
  62. package/dist/src/components/SVGs/copiedSvg.js +0 -4
  63. package/dist/src/components/SVGs/copiedSvg.js.map +0 -1
  64. package/dist/src/components/SVGs/copySvg.d.ts +0 -2
  65. package/dist/src/components/SVGs/copySvg.js +0 -4
  66. package/dist/src/components/SVGs/copySvg.js.map +0 -1
  67. package/dist/src/components/SVGs/exitSvg.d.ts +0 -2
  68. package/dist/src/components/SVGs/exitSvg.js +0 -4
  69. package/dist/src/components/SVGs/exitSvg.js.map +0 -1
  70. package/dist/src/components/SVGs/metamaskQrCode.d.ts +0 -2
  71. package/dist/src/components/SVGs/metamaskQrCode.js +0 -4
  72. package/dist/src/components/SVGs/metamaskQrCode.js.map +0 -1
  73. package/dist/src/components/SVGs/spinSvg.d.ts +0 -4
  74. package/dist/src/components/SVGs/spinSvg.js +0 -4
  75. package/dist/src/components/SVGs/spinSvg.js.map +0 -1
  76. package/dist/src/components/Text/index.d.ts +0 -18
  77. package/dist/src/components/Text/index.js +0 -32
  78. package/dist/src/components/Text/index.js.map +0 -1
  79. package/dist/src/components/WalletKitProvider/ChainProvider.d.ts +0 -12
  80. package/dist/src/components/WalletKitProvider/ChainProvider.js +0 -56
  81. package/dist/src/components/WalletKitProvider/ChainProvider.js.map +0 -1
  82. package/dist/src/components/WalletKitProvider/I18nProvider.d.ts +0 -13
  83. package/dist/src/components/WalletKitProvider/I18nProvider.js +0 -42
  84. package/dist/src/components/WalletKitProvider/I18nProvider.js.map +0 -1
  85. package/dist/src/components/WalletKitProvider/ThemeProvider.d.ts +0 -8
  86. package/dist/src/components/WalletKitProvider/ThemeProvider.js +0 -13
  87. package/dist/src/components/WalletKitProvider/ThemeProvider.js.map +0 -1
  88. package/dist/src/components/WalletKitProvider/index.d.ts +0 -16
  89. package/dist/src/components/WalletKitProvider/index.js +0 -14
  90. package/dist/src/components/WalletKitProvider/index.js.map +0 -1
  91. package/dist/src/components/WalletList/index.d.ts +0 -8
  92. package/dist/src/components/WalletList/index.js +0 -16
  93. package/dist/src/components/WalletList/index.js.map +0 -1
  94. package/dist/src/components/WalletList/style.d.ts +0 -2
  95. package/dist/src/components/WalletList/style.js +0 -102
  96. package/dist/src/components/WalletList/style.js.map +0 -1
  97. package/dist/src/components/WalletTriggerButton/index.d.ts +0 -11
  98. package/dist/src/components/WalletTriggerButton/index.js +0 -28
  99. package/dist/src/components/WalletTriggerButton/index.js.map +0 -1
  100. package/dist/src/components/WalletTriggerButton/style.d.ts +0 -2
  101. package/dist/src/components/WalletTriggerButton/style.js +0 -52
  102. package/dist/src/components/WalletTriggerButton/style.js.map +0 -1
  103. package/dist/src/errors/index.d.ts +0 -2
  104. package/dist/src/errors/index.js +0 -6
  105. package/dist/src/errors/index.js.map +0 -1
  106. package/dist/src/hooks/useWalletKit.d.ts +0 -70
  107. package/dist/src/hooks/useWalletKit.js +0 -38
  108. package/dist/src/hooks/useWalletKit.js.map +0 -1
  109. package/dist/src/index.d.ts +0 -8
  110. package/dist/src/index.js +0 -9
  111. package/dist/src/index.js.map +0 -1
  112. package/dist/src/locals/i18n.d.ts +0 -2
  113. package/dist/src/locals/i18n.js +0 -17
  114. package/dist/src/locals/i18n.js.map +0 -1
  115. package/dist/src/locals/languages/en.json +0 -30
  116. package/dist/src/locals/languages/zh.json +0 -30
  117. package/dist/src/locals/resources.d.ts +0 -66
  118. package/dist/src/locals/resources.js +0 -11
  119. package/dist/src/locals/resources.js.map +0 -1
  120. package/dist/src/modals/connectModal/index.d.ts +0 -0
  121. package/dist/src/modals/connectModal/index.js +0 -2
  122. package/dist/src/modals/connectModal/index.js.map +0 -1
  123. package/dist/src/stores/SlotsWalletStore.d.ts +0 -18
  124. package/dist/src/stores/SlotsWalletStore.js +0 -33
  125. package/dist/src/stores/SlotsWalletStore.js.map +0 -1
  126. package/dist/src/stores/index.d.ts +0 -27
  127. package/dist/src/stores/index.js +0 -25
  128. package/dist/src/stores/index.js.map +0 -1
  129. package/dist/src/stores/modalStore.d.ts +0 -17
  130. package/dist/src/stores/modalStore.js +0 -41
  131. package/dist/src/stores/modalStore.js.map +0 -1
  132. package/dist/src/styled/index.d.ts +0 -17
  133. package/dist/src/styled/index.js +0 -76
  134. package/dist/src/styled/index.js.map +0 -1
  135. package/dist/src/test/getwalletprovider.test.d.ts +0 -1
  136. package/dist/src/test/getwalletprovider.test.js +0 -10
  137. package/dist/src/test/getwalletprovider.test.js.map +0 -1
  138. package/dist/src/test/setup.d.ts +0 -1
  139. package/dist/src/test/setup.js +0 -7
  140. package/dist/src/test/setup.js.map +0 -1
  141. package/dist/src/theme/index.d.ts +0 -53
  142. package/dist/src/theme/index.js +0 -92
  143. package/dist/src/theme/index.js.map +0 -1
  144. package/dist/src/types/configType.d.ts +0 -2
  145. package/dist/src/types/configType.js +0 -2
  146. package/dist/src/types/configType.js.map +0 -1
  147. package/dist/src/types/error.d.ts +0 -7
  148. package/dist/src/types/error.js +0 -5
  149. package/dist/src/types/error.js.map +0 -1
  150. package/dist/src/types/slotsType.d.ts +0 -23
  151. package/dist/src/types/slotsType.js +0 -2
  152. package/dist/src/types/slotsType.js.map +0 -1
  153. package/dist/src/types/store.d.ts +0 -2
  154. package/dist/src/types/store.js +0 -2
  155. package/dist/src/types/store.js.map +0 -1
  156. package/dist/src/utils/formatter.d.ts +0 -1
  157. package/dist/src/utils/formatter.js +0 -6
  158. package/dist/src/utils/formatter.js.map +0 -1
  159. package/dist/src/utils/generateAvatar.d.ts +0 -4
  160. package/dist/src/utils/generateAvatar.js +0 -32
  161. package/dist/src/utils/generateAvatar.js.map +0 -1
  162. package/dist/src/wallets/GelWallet/index.d.ts +0 -0
  163. package/dist/src/wallets/GelWallet/index.js +0 -2
  164. package/dist/src/wallets/GelWallet/index.js.map +0 -1
  165. package/dist/src/wallets/SlotsWallets/index.d.ts +0 -3
  166. package/dist/src/wallets/SlotsWallets/index.js +0 -26
  167. package/dist/src/wallets/SlotsWallets/index.js.map +0 -1
  168. package/dist/tsconfig.build.tsbuildinfo +0 -1
@@ -1,32 +0,0 @@
1
- 'use client';
2
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
- import React from 'react';
4
- import { styled } from 'styled-components';
5
- const TextStyled = styled.div `
6
- display: flex;
7
- align-items: center;
8
-
9
- .text {
10
- max-width: 120px;
11
- color: ${({ theme }) => theme.textColor2};
12
- font-family: 'Manrope';
13
- white-space: nowrap;
14
- overflow: hidden;
15
- text-overflow: ellipsis;
16
-
17
- @media (max-width: 768px) {
18
- white-space: wrap;
19
- }
20
- }
21
- `;
22
- export const Text = ({ prefix, suffix, className = '', text, size, weight, color, padding = '', margin = '' }) => {
23
- return (_jsxs(TextStyled, { className: className, style: {
24
- fontSize: size ? size + 'px' : '16px',
25
- fontWeight: weight || 700,
26
- color,
27
- padding,
28
- margin
29
- }, children: [prefix ? _jsx("span", { children: prefix }) : _jsx(_Fragment, {}), _jsx("span", { className: "text", dangerouslySetInnerHTML: { __html: text } }), suffix ? _jsx("span", { children: suffix }) : _jsx(_Fragment, {})] }));
30
- };
31
- export default Text;
32
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/Text/index.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AACb,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAkB3C,MAAM,UAAU,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;WAMlB,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC,UAAU;;;;;;;;;;CAUzC,CAAC;AAEF,MAAM,CAAC,MAAM,IAAI,GAAsB,CAAC,EACvC,MAAM,EACN,MAAM,EACN,SAAS,GAAG,EAAE,EACd,IAAI,EACJ,IAAI,EACJ,MAAM,EACN,KAAK,EACL,OAAO,GAAG,EAAE,EACZ,MAAM,GAAG,EAAE,EACX,EAAE,EAAE;IACJ,OAAO,CACN,MAAC,UAAU,IACV,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE;YACN,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,MAAM;YACrC,UAAU,EAAE,MAAM,IAAI,GAAG;YACzB,KAAK;YACL,OAAO;YACP,MAAM;SACN,aAEA,MAAM,CAAC,CAAC,CAAC,yBAAO,MAAM,GAAQ,CAAC,CAAC,CAAC,mBAAK,EACvC,eAAM,SAAS,EAAC,MAAM,EAAC,uBAAuB,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,GAAI,EACnE,MAAM,CAAC,CAAC,CAAC,yBAAO,MAAM,GAAQ,CAAC,CAAC,CAAC,mBAAK,IAC3B,CACb,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -1,12 +0,0 @@
1
- import { type ReactNode } from 'react';
2
- import { ChainType } from '@web3jskit/type';
3
- import { SupportWallet } from '@web3jskit/wallethelper';
4
- interface IChainProvider {
5
- children: ReactNode;
6
- defaultChainType?: ChainType;
7
- defaultChainId?: number;
8
- reconnect?: boolean;
9
- supportWallets?: SupportWallet[];
10
- }
11
- export declare function ChainProvider({ children, defaultChainType, defaultChainId, reconnect, supportWallets }: IChainProvider): import("react/jsx-runtime").JSX.Element;
12
- export {};
@@ -1,56 +0,0 @@
1
- 'use client';
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import { createContext, useEffect, useMemo } from 'react';
4
- import { ChainType } from '@web3jskit/type';
5
- import { useWalletKit } from '../../hooks/useWalletKit';
6
- import { createConnector, SupportWallet, SupportedNetworks, ConnectStatus } from '@web3jskit/wallethelper';
7
- const ChainContext = createContext({
8
- defaultChainType: ChainType.EVM,
9
- defaultChainId: 1,
10
- supportWallets: []
11
- });
12
- export function ChainProvider({ children, defaultChainType, defaultChainId, reconnect, supportWallets }) {
13
- const { connectStatus, currentChainType, currentConnectorName, setChainType, setCurrentConnector, setCurrentNetwork, setProvider, setSupportWallets } = useWalletKit();
14
- const getConnectors = async (chainType = ChainType.EVM) => {
15
- const connectors = await createConnector(chainType, supportWallets || []);
16
- return connectors;
17
- };
18
- const reconnectConnectors = async (chainType = ChainType.EVM) => {
19
- const connectors = await getConnectors(chainType);
20
- const curConnect = connectors.find((connector) => connector.name === currentConnectorName);
21
- if (curConnect) {
22
- setCurrentConnector(curConnect);
23
- setProvider(curConnect.provider);
24
- curConnect.reconnection();
25
- }
26
- };
27
- useEffect(() => {
28
- setSupportWallets(supportWallets || []);
29
- }, []);
30
- useEffect(() => {
31
- if (connectStatus !== ConnectStatus.Connected) {
32
- if (defaultChainType) {
33
- setChainType(defaultChainType);
34
- getConnectors(defaultChainType);
35
- }
36
- if (defaultChainId) {
37
- const network = SupportedNetworks.find(item => item.chainId === defaultChainId);
38
- if (network) {
39
- setCurrentNetwork(network);
40
- }
41
- }
42
- }
43
- else {
44
- reconnect && reconnectConnectors(currentChainType);
45
- }
46
- }, [defaultChainType, defaultChainId, reconnect]);
47
- const chainValue = useMemo(() => {
48
- return {
49
- defaultChainType,
50
- defaultChainId,
51
- supportWallets
52
- };
53
- }, [defaultChainType, defaultChainId, supportWallets]);
54
- return _jsx(ChainContext.Provider, { value: chainValue, children: children });
55
- }
56
- //# sourceMappingURL=ChainProvider.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ChainProvider.js","sourceRoot":"","sources":["../../../../src/components/WalletKitProvider/ChainProvider.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AACb,OAAO,EAAE,aAAa,EAAkB,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC1E,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EACN,eAAe,EACf,aAAa,EACb,iBAAiB,EACjB,aAAa,EAEb,MAAM,yBAAyB,CAAC;AAgBjC,MAAM,YAAY,GAAG,aAAa,CAAoB;IACrD,gBAAgB,EAAE,SAAS,CAAC,GAAG;IAC/B,cAAc,EAAE,CAAC;IACjB,cAAc,EAAE,EAAE;CAClB,CAAC,CAAC;AAEH,MAAM,UAAU,aAAa,CAAC,EAC7B,QAAQ,EACR,gBAAgB,EAChB,cAAc,EACd,SAAS,EACT,cAAc,EACE;IAChB,MAAM,EACL,aAAa,EACb,gB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AC;gBAChF,IAAI,OAAO,EAAE,CAAC;oBACb,iBAAiB,CAAC,OAAO,CAAC,CAAC;gBAC5B,CAAC;YACF,CAAC;QACF,CAAC;aAAM,CAAC;YACP,SAAS,IAAI,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;QACpD,CAAC;IACF,CAAC,EAAE,CAAC,gBAAgB,EAAE,cAAc,EAAE,SAAS,CAAC,CAAC,CAAC;IAElD,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,EAAE;QAC/B,OAAO;YACN,gBAAgB;YAChB,cAAc;YACd,cAAc;SACd,CAAC;IACH,CAAC,EAAE,CAAC,gBAAgB,EAAE,cAAc,EAAE,cAAc,CAAC,CAAC,CAAC;IAEvD,OAAO,KAAC,YAAY,CAAC,QAAQ,IAAC,KAAK,EAAE,UAAU,YAAG,QAAQ,GAAyB,CAAC;AACrF,CAAC"}
@@ -1,13 +0,0 @@
1
- import { type ReactNode } from 'react';
2
- import { type Locals } from '../../types/configType';
3
- import i18n from '../../locals/i18n';
4
- interface I18nProviderProps {
5
- children: ReactNode;
6
- language?: Locals;
7
- }
8
- export declare const detectedBrowserLocale: () => string | undefined;
9
- export declare const I18nContext: import("react").Context<{
10
- i18n: typeof i18n;
11
- }>;
12
- export declare const I18nProvider: ({ children, language }: I18nProviderProps) => import("react/jsx-runtime").JSX.Element;
13
- export {};
@@ -1,42 +0,0 @@
1
- 'use client';
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import { createContext, useEffect, useMemo, useState } from 'react';
4
- import {} from '../../types/configType';
5
- import i18n from '../../locals/i18n';
6
- export const detectedBrowserLocale = () => {
7
- if (typeof window !== 'undefined' && typeof navigator !== 'undefined') {
8
- if (navigator.languages?.length) {
9
- return navigator.languages[0];
10
- }
11
- if (navigator.language) {
12
- return navigator.language;
13
- }
14
- }
15
- return '';
16
- };
17
- export const I18nContext = createContext({ i18n });
18
- export const I18nProvider = ({ children, language }) => {
19
- const [updateCount, setUpdateCount] = useState(0);
20
- const browserLocale = useMemo(() => {
21
- return detectedBrowserLocale();
22
- }, []);
23
- useEffect(() => {
24
- i18n.on('languageChanged', () => {
25
- setUpdateCount(count => count + 1);
26
- });
27
- }, []);
28
- useEffect(() => {
29
- if (language && language !== i18n.language) {
30
- i18n.changeLanguage(language);
31
- }
32
- else if (!language && browserLocale && browserLocale !== i18n.language) {
33
- i18n.changeLanguage(browserLocale);
34
- }
35
- }, [language, browserLocale]);
36
- const memoizedValue = useMemo(() => {
37
- const t = (key, options) => i18n.t(key, options);
38
- return { t, i18n };
39
- }, [updateCount]);
40
- return _jsx(I18nContext.Provider, { value: memoizedValue, children: children });
41
- };
42
- //# sourceMappingURL=I18nProvider.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"I18nProvider.js","sourceRoot":"","sources":["../../../../src/components/WalletKitProvider/I18nProvider.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AACb,OAAO,EAAE,aAAa,EAAkB,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACpF,OAAO,EAAe,MAAM,wBAAwB,CAAC;AACrD,OAAO,IAAI,MAAM,mBAAmB,CAAC;AAOrC,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,EAAE;IACzC,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,SAAS,KAAK,WAAW,EAAE,CAAC;QACvE,IAAI,SAAS,CAAC,SAAS,EAAE,MAAM,EAAE,CAAC;YACjC,OAAO,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;QAC/B,CAAC;QAED,IAAI,SAAS,CAAC,QAAQ,EAAE,CAAC;YACxB,OAAO,SAAS,CAAC,QAAQ,CAAC;QAC3B,CAAC;IACF,CAAC;IACD,OAAO,EAAE,CAAC;AACX,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAwB,EAAE,IAAI,EAAE,CAAC,CAAC;AAE1E,MAAM,CAAC,MAAM,YAAY,GAAG,CAA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
- import { type ReactNode } from 'react';
2
- import { type Theme } from '../../types/configType';
3
- interface IWalletKitThemeProvider {
4
- theme?: Theme;
5
- children: ReactNode;
6
- }
7
- export declare function WalletKitThemeProvider({ theme, children }: IWalletKitThemeProvider): import("react/jsx-runtime").JSX.Element;
8
- export {};
@@ -1,13 +0,0 @@
1
- 'use client';
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import { ThemeProvider } from 'styled-components';
4
- import { useMemo } from 'react';
5
- import {} from '../../types/configType';
6
- import { themeStyle } from '../../theme';
7
- export function WalletKitThemeProvider({ theme, children }) {
8
- const themeObject = useMemo(() => {
9
- return themeStyle[theme || 'lightMode'];
10
- }, [theme]);
11
- return _jsx(ThemeProvider, { theme: themeObject, children: children });
12
- }
13
- //# sourceMappingURL=ThemeProvider.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ThemeProvider.js","sourceRoot":"","sources":["../../../../src/components/WalletKitProvider/ThemeProvider.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AACb,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAkB,OAAO,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO,EAAc,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAOzC,MAAM,UAAU,sBAAsB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAA2B;IAClF,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,EAAE;QAChC,OAAO,UAAU,CAAC,KAAK,IAAI,WAAW,CAAC,CAAC;IACzC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IACZ,OAAO,KAAC,aAAa,IAAC,KAAK,EAAE,WAAW,YAAG,QAAQ,GAAiB,CAAC;AACtE,CAAC"}
@@ -1,16 +0,0 @@
1
- import { type ReactNode } from 'react';
2
- import type { Locals, Theme } from '../../types/configType';
3
- import { ChainType } from '@web3jskit/type';
4
- import type { SupportWallet } from '@web3jskit/wallethelper';
5
- interface IWalletKitProvider {
6
- children: ReactNode;
7
- language?: Locals;
8
- defaultChainType?: ChainType;
9
- defaultChainId?: number;
10
- reconnect?: boolean;
11
- theme?: Theme;
12
- connectButtonSlots?: ReactNode[];
13
- supportWallets?: SupportWallet[];
14
- }
15
- export declare function WalletKitProvider({ children, language, defaultChainType, defaultChainId, reconnect, theme, connectButtonSlots, supportWallets }: IWalletKitProvider): import("react/jsx-runtime").JSX.Element;
16
- export {};
@@ -1,14 +0,0 @@
1
- 'use client';
2
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
- import {} from 'react';
4
- import { ChainProvider } from './ChainProvider';
5
- import { ConnectModal } from '../Modal/ConnectModal';
6
- import { I18nProvider } from './I18nProvider';
7
- import { WalletKitThemeProvider } from './ThemeProvider';
8
- import { ThemedGlobalStyle } from '../../theme';
9
- import { WalletInfoModal } from '../Modal/WalletInfoModal';
10
- import { ChainType } from '@web3jskit/type';
11
- export function WalletKitProvider({ children, language, defaultChainType = ChainType.EVM, defaultChainId = 1, reconnect = true, theme, connectButtonSlots, supportWallets }) {
12
- return (_jsx(_Fragment, { children: _jsx(ChainProvider, { reconnect: reconnect, defaultChainType: defaultChainType, defaultChainId: defaultChainId, supportWallets: supportWallets, children: _jsx(I18nProvider, { language: language, children: _jsxs(WalletKitThemeProvider, { theme: theme, children: [_jsx(ThemedGlobalStyle, {}), _jsx(ConnectModal, { slots: connectButtonSlots }), _jsx(WalletInfoModal, {}), _jsx("div", { children: children })] }) }) }) }));
13
- }
14
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/WalletKitProvider/index.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AACb,OAAO,EAAkB,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAc5C,MAAM,UAAU,iBAAiB,CAAC,EACjC,QAAQ,EACR,QAAQ,EACR,gBAAgB,GAAG,SAAS,CAAC,GAAG,EAChC,cAAc,GAAG,CAAC,EAClB,SAAS,GAAG,IAAI,EAChB,KAAK,EACL,kBAAkB,EAClB,cAAc,EACM;IAMpB,OAAO,CACN,4BACC,KAAC,aAAa,IACb,SAAS,EAAE,SAAS,EACpB,gBAAgB,EAAE,gBAAgB,EAClC,cAAc,EAAE,cAAc,EAC9B,cAAc,EAAE,cAAc,YAE9B,KAAC,YAAY,IAAC,QAAQ,EAAE,QAAQ,YAC/B,MAAC,sBAAsB,IAAC,KAAK,EAAE,KAAK,aACnC,KAAC,iBAAiB,KAAG,EACrB,KAAC,YAAY,IAAC,KAAK,EAAE,kBAAkB,GAAI,EAC3C,KAAC,eAAe,KAAG,EACnB,wBAAM,QAAQ,GAAO,IACG,GACX,GACA,GACd,CACH,CAAC;AACH,CAAC"}
@@ -1,8 +0,0 @@
1
- interface WalletListProps {
2
- list?: any[];
3
- onBack?: () => void;
4
- onGetWallet?: (wallet: any) => void;
5
- onClose: () => void;
6
- }
7
- export declare function WalletList({ list, onBack, onGetWallet }: WalletListProps): import("react/jsx-runtime").JSX.Element;
8
- export {};
@@ -1,16 +0,0 @@
1
- 'use client';
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { useTranslation } from 'react-i18next';
4
- import ModalHeader from '../Header/ModalHeader';
5
- import WalletListContainer from './style';
6
- import { useMemo } from 'react';
7
- export function WalletList({ list, onBack, onGetWallet }) {
8
- const { t } = useTranslation();
9
- const randomList = useMemo(() => {
10
- const randomList = list?.sort(() => Math.random() - 0.5).slice(0, 3);
11
- return randomList;
12
- }, [list]);
13
- const handleCancel = () => { };
14
- return (_jsxs(WalletListContainer, { children: [_jsx(ModalHeader, { onClose: handleCancel, title: t('getWalletTitle'), onBack: onBack }), _jsx("div", { className: "walletList", children: randomList?.map((item, index) => (_jsxs("div", { className: "walletItem", children: [_jsx("img", { src: item.icon, alt: item.name }), _jsxs("div", { children: [_jsx("div", { className: "name", children: item.name.replaceAll('_', ' ') }), item.name !== 'GelWallet' && _jsx("div", { className: "description", children: t('getWalletTips') })] }), _jsx("div", { className: "button", onClick: () => onGetWallet?.(item), children: t('getWallet') })] }, index + item.name))) }), _jsx("div", { className: "question", children: t('getWalletQuestion') }), _jsx("div", { className: "answer", children: t('getWalletAnswer') })] }));
15
- }
16
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/WalletList/index.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AACb,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,WAAW,MAAM,uBAAuB,CAAC;AAChD,OAAO,mBAAmB,MAAM,SAAS,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAShC,MAAM,UAAU,UAAU,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAmB;IACxE,MAAM,EAAE,CAAC,EAAE,GAAG,cAAc,EAAE,CAAC;IAG/B,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,EAAE;QAC/B,MAAM,UAAU,GAAG,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACrE,OAAO,UAAU,CAAC;IACnB,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;IACX,MAAM,YAAY,GAAG,GAAG,EAAE,GAAE,CAAC,CAAC;IAC9B,OAAO,CACN,MAAC,mBAAmB,eACnB,KAAC,WAAW,IAAC,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC,CAAC,gBAAgB,CAAC,EAAE,MAAM,EAAE,MAAM,GAAI,EAClF,cAAK,SAAS,EAAC,YAAY,YACzB,UAAU,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CACjC,eAAK,SAAS,EAAC,YAAY,aAC1B,cAAK,GAAG,EAAE,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,CAAC,IAAI,GAAI,EACvC,0BACC,cAAK,SAAS,EAAC,MAAM,YAAE,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,GAAO,EAC3D,IAAI,CAAC,IAAI,KAAK,WAAW,IAAI,cAAK,SAAS,EAAC,aAAa,YAAE,CAAC,CAAC,eAAe,CAAC,GAAO,IAChF,EACN,cAAK,SAAS,EAAC,QAAQ,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,IAAI,CAAC,YACxD,CAAC,CAAC,WAAW,CAAC,GACV,KAR0B,KAAK,GAAG,IAAI,CAAC,IAAI,CAS5C,CACN,CAAC,GACG,EACN,cAAK,SAAS,EAAC,UAAU,YAAE,CAAC,CAAC,mBAAmB,CAAC,GAAO,EACxD,cAAK,SAAS,EAAC,QAAQ,YAAE,CAAC,CAAC,iBAAiB,CAAC,GAAO,IAC/B,CACtB,CAAC;AACH,CAAC"}
@@ -1,2 +0,0 @@
1
- declare const WalletListContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
2
- export default WalletListContainer;
@@ -1,102 +0,0 @@
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;
13
- gap: 20px;
14
- flex: 1;
15
- overflow: auto;
16
-
17
- .walletItem {
18
- display: flex;
19
- align-items: center;
20
- }
21
-
22
- img {
23
- width: 28px;
24
- height: 28px;
25
- flex-shrink: 0;
26
- margin-right: 10px;
27
- border-radius: 6px;
28
- }
29
-
30
- .name {
31
- font-size: 14px;
32
- font-weight: 700;
33
- line-height: 14px;
34
- color: ${({ theme }) => theme.textColor};
35
- }
36
-
37
- .description {
38
- margin-top: 10px;
39
- font-size: 12px;
40
- font-weight: 500;
41
- line-height: 14px;
42
- color: ${({ theme }) => theme.textColor3};
43
- }
44
-
45
- .button {
46
- display: inline-block;
47
- margin-left: auto;
48
- padding: 11px 16px;
49
- color: ${({ theme }) => theme.buttonColor};
50
- background: ${({ theme }) => theme.buttonBg};
51
- font-size: 14px;
52
- font-weight: 700;
53
- line-height: 14px;
54
- text-align: center;
55
- border-radius: 8px;
56
- box-sizing: border-box;
57
- cursor: pointer;
58
- height: 36px;
59
- }
60
- }
61
-
62
- .question {
63
- margin-left: 42px;
64
- margin-bottom: 10px;
65
- font-size: 16px;
66
- font-weight: 700;
67
- line-height: 16px;
68
- color: ${({ theme }) => theme.textColor4};
69
- }
70
-
71
- .answer {
72
- margin-left: 42px;
73
- margin-bottom: 47px;
74
- font-size: 16px;
75
- font-weight: 400;
76
- line-height: 16px;
77
- color: ${({ theme }) => theme.textColor4};
78
- }
79
-
80
- @media (max-width: 768px) {
81
- .walletList {
82
- padding: 10px 28px 0;
83
- min-height: 237px;
84
- max-height: 237px;
85
- overflow: auto;
86
-
87
- .button {
88
- font-size: 12px;
89
- }
90
- }
91
-
92
- .question {
93
- margin: 10px 25px;
94
- }
95
-
96
- .answer {
97
- margin: 0 25px 75px;
98
- }
99
- }
100
- `;
101
- export default WalletListContainer;
102
- //# sourceMappingURL=style.js.map
@@ -1 +0,0 @@
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;YA4B7B,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"}
@@ -1,11 +0,0 @@
1
- import React from 'react';
2
- import type { ISlotsConnector } from '../../types/slotsType';
3
- export interface IWalletTriggerButton {
4
- connector: any;
5
- onConnect: (address: string) => void;
6
- }
7
- export interface IWalletSlotTriggerButton {
8
- slotsConnector: ISlotsConnector;
9
- }
10
- export declare const WalletTriggerButton: React.FC<IWalletTriggerButton>;
11
- export declare const WalletSlotTriggerButton: React.FC<IWalletSlotTriggerButton>;
@@ -1,28 +0,0 @@
1
- 'use client';
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import React, { useMemo } from 'react';
4
- import Text from '../Text';
5
- import { FlexBox } from '../../styled';
6
- import Icon from '../Icon';
7
- import useSlotsWalletStore from '../../stores/SlotsWalletStore';
8
- import WalletItem from './style';
9
- import { useWalletKit } from '../../hooks/useWalletKit';
10
- export const WalletTriggerButton = ({ connector, onConnect }) => {
11
- const { connectStatus, currentChainType, currentConnector } = useWalletKit();
12
- const disabled = useMemo(() => {
13
- return currentConnector?.chainType === currentChainType && connectStatus === 'connected';
14
- }, [connectStatus, currentConnector, currentChainType]);
15
- const handleConnect = async () => {
16
- if (disabled)
17
- return;
18
- const address = await connector.connect();
19
- typeof onConnect === 'function' && onConnect(address);
20
- };
21
- 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?.replaceAll('_', ' ') || '' })] }) }));
22
- };
23
- export const WalletSlotTriggerButton = ({ slotsConnector }) => {
24
- const useAddConnector = useSlotsWalletStore((state) => state.addConnector);
25
- useAddConnector(slotsConnector);
26
- return (_jsx(WalletItem, { children: _jsxs(FlexBox, { className: 'gap-10', children: [_jsx(Icon, { src: slotsConnector.walletIcon }), _jsx(Text, { text: slotsConnector.walletName })] }) }));
27
- };
28
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/WalletTriggerButton/index.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AACb,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,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AAO,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"}
@@ -1,2 +0,0 @@
1
- declare const WalletItem: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
2
- export default WalletItem;
@@ -1,52 +0,0 @@
1
- import { styled } from 'styled-components';
2
- const WalletItem = styled.div `
3
- display: flex;
4
- padding: 4px 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
- width: 28px;
13
- height: 28px;
14
- border-radius: 6px;
15
- }
16
-
17
- &:hover {
18
- background: ${({ theme }) => theme.itemHoverBg};
19
- }
20
-
21
- &.disabled {
22
- pointer-events: none;
23
- background: none;
24
- }
25
-
26
- @media (max-width: 768px) {
27
- width: 86px;
28
- justify-content: center;
29
-
30
- > div {
31
- box-sizing: border-box;
32
- flex-direction: column;
33
- align-items: center;
34
-
35
- img {
36
- width: 36px;
37
- height: 36px;
38
- }
39
-
40
- > div {
41
- line-height: 14px;
42
- text-align: center;
43
-
44
- span {
45
- font-size: 12px;
46
- }
47
- }
48
- }
49
- }
50
- `;
51
- export default WalletItem;
52
- //# sourceMappingURL=style.js.map
@@ -1 +0,0 @@
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;;;;;;;;;;;;;;;;gBAgBb,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgC/C,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -1,2 +0,0 @@
1
- import { type ErrorMessage } from '../types/error';
2
- export declare const UserRejectError: ErrorMessage;
@@ -1,6 +0,0 @@
1
- import { ErrorCode } from '../types/error';
2
- export const UserRejectError = {
3
- code: ErrorCode.UserReject,
4
- message: 'User reject'
5
- };
6
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/errors/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAqB,MAAM,gBAAgB,CAAC;AAE9D,MAAM,CAAC,MAAM,eAAe,GAAiB;IAC5C,IAAI,EAAE,SAAS,CAAC,UAAU;IAC1B,OAAO,EAAE,aAAa;CACtB,CAAC"}
@@ -1,70 +0,0 @@
1
- import { type WalletHelperState } from '@web3jskit/wallethelper';
2
- import { type WalletKitState } from '../stores';
3
- import type { Connector } from '@web3jskit/wallethelper/dist/src/core/types/connector';
4
- type WalletKitStoreState = WalletHelperState & WalletKitState;
5
- type WalletKit = WalletKitStoreState & {
6
- connect: () => Promise<Connector>;
7
- showWalletInfo: () => void;
8
- closeWalletInfo: () => void;
9
- };
10
- export declare const useWalletKit: () => {
11
- connect: () => Promise<unknown>;
12
- showWalletInfo: () => void;
13
- closeWalletInfo: () => void;
14
- isConnecting: {
15
- icon: string;
16
- name: string;
17
- } | boolean;
18
- supportWallets: import("@web3jskit/wallethelper").SupportWallet[];
19
- setSupportWallets: (wallets: import("@web3jskit/wallethelper").SupportWallet[]) => void;
20
- connectors: Connector[];
21
- getConnectors: () => any[];
22
- currentConnector: Connector | null;
23
- currentConnectorName: string;
24
- getCurrentConnector: () => Connector | null;
25
- setCurrentConnector: (connector: Connector) => void;
26
- provider: any;
27
- getProvider: () => Promise<any>;
28
- setProvider: (provider: any) => void;
29
- currentChainType: import("@web3jskit/type").ChainType;
30
- getCurrentChainType: () => import("@web3jskit/type").ChainType;
31
- setChainType: (chainType: import("@web3jskit/type").ChainType) => void;
32
- currentNetworkId: number;
33
- currentNetwork: import("@web3jskit/wallethelper").NetworkInfo | null;
34
- getCurrentNetwork: () => import("@web3jskit/wallethelper").NetworkInfo | null;
35
- setCurrentNetwork: (network: import("@web3jskit/wallethelper").NetworkInfo) => void;
36
- connectStatus: import("@web3jskit/wallethelper").ConnectStatus;
37
- getConnectStatus: () => import("@web3jskit/wallethelper").ConnectStatus;
38
- setConnectStatus: (status: import("@web3jskit/wallethelper").ConnectStatus) => void;
39
- walletAddress: string;
40
- getWalletAddress: () => string;
41
- setWalletAddress: (address: string) => void;
42
- getConnectorProxy: () => any;
43
- disconnect: () => Promise<void>;
44
- signMessage: (message: string) => Promise<any>;
45
- signTransaction: (transaction: import("@web3jskit/wallethelper/dist/src/core/types/connector").ITransactionOptions) => Promise<any>;
46
- sendTransaction: (transaction: import("@web3jskit/wallethelper/dist/src/core/types/connector").ITransactionOptions) => Promise<any>;
47
- waitForTransactionReceipt: (hash: string, timeout?: number) => Promise<any>;
48
- readContract: (params: import("@web3jskit/wallethelper/dist/src/core/types/connector").IContractOptions) => Promise<any>;
49
- writeContract: (params: import("@web3jskit/wallethelper/dist/src/core/types/connector").IContractOptions) => Promise<any>;
50
- multipleRequest: (requests: {
51
- method: string;
52
- params?: any[];
53
- }[]) => Promise<any[]>;
54
- chains: Array<any>;
55
- setChains: (chains: Array<any>) => void;
56
- language: import("..").Locals;
57
- setLanguage: (language: import("..").Locals) => void;
58
- theme: import("..").Theme;
59
- toggleTheme: () => void;
60
- avatar: {
61
- text: string;
62
- bg: string;
63
- } | null;
64
- setAvatar: (avatar: {
65
- text: string;
66
- bg: string;
67
- }) => void;
68
- };
69
- export declare const getWalletKit: () => WalletKit;
70
- export {};
@@ -1,38 +0,0 @@
1
- import { walletHelperStore } from '@web3jskit/wallethelper';
2
- import { walletKitStore } from '../stores';
3
- import { useModalStore } from '../stores/modalStore';
4
- const enhancedWalletKit = (walletKit) => {
5
- const { connect, showWalletInfoModal, closeWalletInfoModal } = useModalStore.getState();
6
- const showWalletInfo = () => {
7
- if (walletKit.currentConnector) {
8
- showWalletInfoModal();
9
- }
10
- };
11
- const closeWalletInfo = () => {
12
- closeWalletInfoModal();
13
- };
14
- return {
15
- ...walletKit,
16
- connect,
17
- showWalletInfo,
18
- closeWalletInfo
19
- };
20
- };
21
- export const useWalletKit = () => {
22
- const walletHelperStates = walletHelperStore((states) => states);
23
- const walletKitStates = walletKitStore((states) => states);
24
- return enhancedWalletKit({
25
- ...walletHelperStates,
26
- ...walletKitStates
27
- });
28
- };
29
- export const getWalletKit = () => {
30
- const walletHelperStates = walletHelperStore.getState();
31
- const walletKitStates = walletKitStore.getState();
32
- const exportStates = enhancedWalletKit({
33
- ...walletHelperStates,
34
- ...walletKitStates
35
- });
36
- return exportStates;
37
- };
38
- //# sourceMappingURL=useWalletKit.js.map
@@ -1 +0,0 @@
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,EAAuB,MAAM,WAAW,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAWrD,MAAM,iBAAiB,GAAG,CAAC,SAA8B,EAAE,EAAE;IAC5D,MAAM,EAAE,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,GAAG,aAAa,CAAC,QAAQ,EAAE,CAAC;IACxF,MAAM,cAAc,GAAG,GAAG,EAAE;QAC3B,IAAI,SAAS,CAAC,gBAAgB,EAAE,CAAC;YAChC,mBAAmB,EAAE,CAAC;QACvB,CAAC;IACF,CAAC,CAAC;IACF,MAAM,eAAe,GAAG,GAAG,EAAE;QAC5B,oBAAoB,EAAE,CAAC;IACxB,CAAC,CAAC;IACF,OAAO;QACN,GAAG,SAAS;QACZ,OAAO;QACP,cAAc;QACd,eAAe;KACf,CAAC;AACH,CAAC,CAAC;AAGF,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;IAEhE,OAAO,iBAAiB,CAAC;QACxB,GAAG,kBAAkB;QAErB,GAAG,eAAe;KACL,CAAC,CAAC;AACjB,CAAC,CAAC;AAGF,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,EAAE;IAChC,MAAM,kBAAkB,GAAG,iBAAiB,CAAC,QAAQ,EAAE,CAAC;IACxD,MAAM,eAAe,GAAG,cAAc,CAAC,QAAQ,EAAE,CAAC;IAElD,MAAM,YAAY,GAAG,iBAAiB,CAAC;QACtC,GAAG,kBAAkB;QACrB,GAAG,eAAe;KACL,CAAC,CAAC;IAEhB,OAAO,YAAyB,CAAC;AAClC,CAAC,CAAC"}
@@ -1,8 +0,0 @@
1
- export { SupportWallet, SupportedNetworks } from '@web3jskit/wallethelper';
2
- export * from './components/WalletKitProvider';
3
- export * from './components/ConnectButton';
4
- export * from './types/configType';
5
- export * from './types/slotsType';
6
- export { createSlots } from './wallets/SlotsWallets/index';
7
- export { WalletSlotTriggerButton } from './components/WalletTriggerButton/index';
8
- export { useWalletKit, getWalletKit } from './hooks/useWalletKit';