@openfort/react 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.
Files changed (192) hide show
  1. package/README.md +139 -0
  2. package/build/assets/ScanIconWithLogos.d.ts +5 -0
  3. package/build/assets/browsers.d.ts +10 -0
  4. package/build/assets/chains.d.ts +61 -0
  5. package/build/assets/icons.d.ts +51 -0
  6. package/build/assets/logos.d.ts +202 -0
  7. package/build/assets/wallet.d.ts +4 -0
  8. package/build/assets/wave.d.ts +2 -0
  9. package/build/components/BalanceButton/index.d.ts +9 -0
  10. package/build/components/Common/Alert/index.d.ts +6 -0
  11. package/build/components/Common/Alert/styles.d.ts +4 -0
  12. package/build/components/Common/Alert/types.d.ts +5 -0
  13. package/build/components/Common/Avatar/index.d.ts +16 -0
  14. package/build/components/Common/Avatar/styles.d.ts +8 -0
  15. package/build/components/Common/BrowserIcon/index.d.ts +4 -0
  16. package/build/components/Common/BrowserIcon/styles.d.ts +1 -0
  17. package/build/components/Common/BrowserIcon/types.d.ts +3 -0
  18. package/build/components/Common/Button/index.d.ts +4 -0
  19. package/build/components/Common/Button/styles.d.ts +16 -0
  20. package/build/components/Common/Button/types.d.ts +16 -0
  21. package/build/components/Common/Chain/index.d.ts +8 -0
  22. package/build/components/Common/Chain/styles.d.ts +9 -0
  23. package/build/components/Common/ChainSelect/index.d.ts +3 -0
  24. package/build/components/Common/ChainSelectDropdown/index.d.ts +9 -0
  25. package/build/components/Common/ChainSelectDropdown/styles.d.ts +4 -0
  26. package/build/components/Common/ChainSelectList/index.d.ts +4 -0
  27. package/build/components/Common/ChainSelectList/styles.d.ts +13 -0
  28. package/build/components/Common/ConnectorList/index.d.ts +2 -0
  29. package/build/components/Common/ConnectorList/styles.d.ts +9 -0
  30. package/build/components/Common/CopyToClipboard/CopyToClipboardIcon.d.ts +5 -0
  31. package/build/components/Common/CopyToClipboard/index.d.ts +7 -0
  32. package/build/components/Common/CustomQRCode/QRCode.d.ts +12 -0
  33. package/build/components/Common/CustomQRCode/index.d.ts +6 -0
  34. package/build/components/Common/CustomQRCode/styles.d.ts +8 -0
  35. package/build/components/Common/CustomQRCode/types.d.ts +8 -0
  36. package/build/components/Common/DynamicContainer/index.d.ts +7 -0
  37. package/build/components/Common/FitText/index.d.ts +10 -0
  38. package/build/components/Common/Input/index.d.ts +4 -0
  39. package/build/components/Common/Input/styles.d.ts +3 -0
  40. package/build/components/Common/Input/types.d.ts +2 -0
  41. package/build/components/Common/LazyImage/index.d.ts +8 -0
  42. package/build/components/Common/Loading/index.d.ts +6 -0
  43. package/build/components/Common/Logo/index.d.ts +8 -0
  44. package/build/components/Common/Logo/styles.d.ts +6 -0
  45. package/build/components/Common/Modal/index.d.ts +24 -0
  46. package/build/components/Common/Modal/styles.d.ts +33 -0
  47. package/build/components/Common/Portal/index.d.ts +2 -0
  48. package/build/components/Common/PoweredByFooter/index.d.ts +5 -0
  49. package/build/components/Common/ScrollArea/index.d.ts +7 -0
  50. package/build/components/Common/ScrollArea/styles.d.ts +8 -0
  51. package/build/components/Common/Spinner/index.d.ts +1 -0
  52. package/build/components/Common/Spinner/styles.d.ts +1 -0
  53. package/build/components/Common/SquircleSpinner/index.d.ts +5 -0
  54. package/build/components/Common/SquircleSpinner/styles.d.ts +4 -0
  55. package/build/components/Common/ThemedButton/index.d.ts +15 -0
  56. package/build/components/Common/ThemedButton/styles.d.ts +4 -0
  57. package/build/components/Common/Tooltip/index.d.ts +4 -0
  58. package/build/components/Common/Tooltip/styles.d.ts +8 -0
  59. package/build/components/Common/Tooltip/types.d.ts +9 -0
  60. package/build/components/ConnectButton/index.d.ts +33 -0
  61. package/build/components/ConnectButton/styles.d.ts +4 -0
  62. package/build/components/ConnectKitThemeProvider/ConnectKitThemeProvider.d.ts +16 -0
  63. package/build/components/ConnectModal/ConnectUsing.d.ts +2 -0
  64. package/build/components/ConnectModal/ConnectWithInjector/CircleSpinner/index.d.ts +9 -0
  65. package/build/components/ConnectModal/ConnectWithInjector/CircleSpinner/styles.d.ts +7 -0
  66. package/build/components/ConnectModal/ConnectWithInjector/index.d.ts +16 -0
  67. package/build/components/ConnectModal/ConnectWithInjector/styles.d.ts +9 -0
  68. package/build/components/ConnectModal/ConnectWithOAuth.d.ts +2 -0
  69. package/build/components/ConnectModal/ConnectWithQRCode.d.ts +5 -0
  70. package/build/components/ConnectModal/index.d.ts +8 -0
  71. package/build/components/FloatingGraphic/styles.d.ts +11 -0
  72. package/build/components/NetworkButton/index.d.ts +8 -0
  73. package/build/components/OpenfortKit/OpenfortKit.d.ts +28 -0
  74. package/build/components/OpenfortKit/context.d.ts +38 -0
  75. package/build/components/OpenfortKit/types.d.ts +136 -0
  76. package/build/components/OpenfortKit/useOpenfortKit.d.ts +1 -0
  77. package/build/components/Pages/About/graphics.d.ts +11 -0
  78. package/build/components/Pages/About/index.d.ts +3 -0
  79. package/build/components/Pages/About/styles.d.ts +12 -0
  80. package/build/components/Pages/Connectors/index.d.ts +3 -0
  81. package/build/components/Pages/Connectors/styles.d.ts +9 -0
  82. package/build/components/Pages/DownloadApp/index.d.ts +2 -0
  83. package/build/components/Pages/EmailLogin/index.d.ts +3 -0
  84. package/build/components/Pages/EmailSignup/index.d.ts +3 -0
  85. package/build/components/Pages/EmailVerification/index.d.ts +3 -0
  86. package/build/components/Pages/ForgotPassword/index.d.ts +3 -0
  87. package/build/components/Pages/LinkEmail/index.d.ts +3 -0
  88. package/build/components/Pages/Loading/index.d.ts +3 -0
  89. package/build/components/Pages/MobileConnectors/index.d.ts +3 -0
  90. package/build/components/Pages/MobileConnectors/styles.d.ts +11 -0
  91. package/build/components/Pages/Onboarding/index.d.ts +3 -0
  92. package/build/components/Pages/Profile/LinkedProviders.d.ts +1 -0
  93. package/build/components/Pages/Profile/index.d.ts +5 -0
  94. package/build/components/Pages/Profile/styles.d.ts +10 -0
  95. package/build/components/Pages/Providers/index.d.ts +7 -0
  96. package/build/components/Pages/Providers/styles.d.ts +3 -0
  97. package/build/components/Pages/Recover/index.d.ts +3 -0
  98. package/build/components/Pages/SoicalProviders/index.d.ts +3 -0
  99. package/build/components/Pages/SoicalProviders/styles.d.ts +3 -0
  100. package/build/components/Pages/SwitchNetworks/index.d.ts +3 -0
  101. package/build/components/contexts/web3/index.d.ts +25 -0
  102. package/build/constants/chainConfigs.d.ts +18 -0
  103. package/build/constants/defaultTheme.d.ts +4 -0
  104. package/build/constants/openfort.d.ts +2 -0
  105. package/build/defaultConfig.d.ts +14 -0
  106. package/build/defaultConnectors.d.ts +14 -0
  107. package/build/defaultTransports.d.ts +15 -0
  108. package/build/hooks/connectors/useCoinbaseWalletUri.d.ts +0 -0
  109. package/build/hooks/connectors/useWalletConnectUri.d.ts +7 -0
  110. package/build/hooks/openfort/auth/requestEmailVerification.d.ts +5 -0
  111. package/build/hooks/openfort/auth/status.d.ts +14 -0
  112. package/build/hooks/openfort/auth/useAuthCallback.d.ts +39 -0
  113. package/build/hooks/openfort/auth/useCreateWalletPostAuth.d.ts +6 -0
  114. package/build/hooks/openfort/auth/useEmailAuth.d.ts +51 -0
  115. package/build/hooks/openfort/auth/useGuestAuth.d.ts +16 -0
  116. package/build/hooks/openfort/auth/useOAuth.d.ts +20 -0
  117. package/build/hooks/openfort/auth/useSignOut.d.ts +8 -0
  118. package/build/hooks/openfort/auth/useThirdPartyAuth.d.ts +1 -0
  119. package/build/hooks/openfort/auth/useWalletAuth.d.ts +20 -0
  120. package/build/hooks/openfort/hookConsistency.d.ts +13 -0
  121. package/build/hooks/openfort/useConnectWithSiwe.d.ts +4 -0
  122. package/build/hooks/openfort/useProviders.d.ts +6 -0
  123. package/build/hooks/openfort/useStatus.d.ts +16 -0
  124. package/build/hooks/openfort/useUI.d.ts +10 -0
  125. package/build/hooks/openfort/useUser.d.ts +5 -0
  126. package/build/hooks/openfort/useWallets.d.ts +37 -0
  127. package/build/hooks/useChainIsSupported.d.ts +1 -0
  128. package/build/hooks/useChains.d.ts +2 -0
  129. package/build/hooks/useConnect.d.ts +110 -0
  130. package/build/hooks/useConnectCallback.d.ts +10 -0
  131. package/build/hooks/useConnectors.d.ts +7 -0
  132. package/build/hooks/useEnsFallbackConfig.d.ts +2 -0
  133. package/build/hooks/useFitText.d.ts +14 -0
  134. package/build/hooks/useFocusTrap.d.ts +1 -0
  135. package/build/hooks/useGoogleFont.d.ts +3 -0
  136. package/build/hooks/useIsMobile.d.ts +1 -0
  137. package/build/hooks/useIsMounted.d.ts +1 -0
  138. package/build/hooks/useLastConnector.d.ts +4 -0
  139. package/build/hooks/useLocalStorage.d.ts +7 -0
  140. package/build/hooks/useLocales.d.ts +1 -0
  141. package/build/hooks/useLockBodyScroll.d.ts +1 -0
  142. package/build/hooks/usePrevious.d.ts +1 -0
  143. package/build/hooks/useWalletConnectModal.d.ts +4 -0
  144. package/build/hooks/useWindowSize.d.ts +4 -0
  145. package/build/index.d.ts +27 -0
  146. package/build/index.es.js +13011 -0
  147. package/build/index.es.js.map +1 -0
  148. package/build/localizations/index.d.ts +93 -0
  149. package/build/localizations/locales/ar-AE.d.ts +3 -0
  150. package/build/localizations/locales/ca-AD.d.ts +3 -0
  151. package/build/localizations/locales/ee-EE.d.ts +3 -0
  152. package/build/localizations/locales/en-US.d.ts +93 -0
  153. package/build/localizations/locales/es-ES.d.ts +3 -0
  154. package/build/localizations/locales/fa-IR.d.ts +3 -0
  155. package/build/localizations/locales/fr-FR.d.ts +3 -0
  156. package/build/localizations/locales/index.d.ts +2 -0
  157. package/build/localizations/locales/ja-JP.d.ts +93 -0
  158. package/build/localizations/locales/pt-BR.d.ts +3 -0
  159. package/build/localizations/locales/ru-RU.d.ts +3 -0
  160. package/build/localizations/locales/tr-TR.d.ts +3 -0
  161. package/build/localizations/locales/vi-VN.d.ts +3 -0
  162. package/build/localizations/locales/zh-CN.d.ts +3 -0
  163. package/build/openfort/OpenfortProvider.d.ts +17 -0
  164. package/build/openfort/OpenfortProvider_old.d.ts +0 -0
  165. package/build/openfort/context.d.ts +2 -0
  166. package/build/openfort/core/client.d.ts +24 -0
  167. package/build/openfort/core/index.d.ts +3 -0
  168. package/build/openfort/useOpenfort.d.ts +1 -0
  169. package/build/siwe/create-siwe-message.d.ts +1 -0
  170. package/build/styles/defaultTheme.d.ts +3 -0
  171. package/build/styles/index.d.ts +6 -0
  172. package/build/styles/styled/index.d.ts +12 -0
  173. package/build/styles/themes/base.d.ts +129 -0
  174. package/build/styles/themes/index.d.ts +673 -0
  175. package/build/styles/themes/midnight.d.ts +74 -0
  176. package/build/styles/themes/minimal.d.ts +94 -0
  177. package/build/styles/themes/nouns.d.ts +79 -0
  178. package/build/styles/themes/retro.d.ts +89 -0
  179. package/build/styles/themes/rounded.d.ts +86 -0
  180. package/build/styles/themes/soft.d.ts +69 -0
  181. package/build/styles/themes/web95.d.ts +91 -0
  182. package/build/styles/types.d.ts +80 -0
  183. package/build/types.d.ts +32 -0
  184. package/build/utils/index.d.ts +18 -0
  185. package/build/utils/localstorage.d.ts +9 -0
  186. package/build/utils/p3.d.ts +2 -0
  187. package/build/utils/wallets.d.ts +24 -0
  188. package/build/version.d.ts +1 -0
  189. package/build/wallets/index.d.ts +7 -0
  190. package/build/wallets/useWallets.d.ts +9 -0
  191. package/build/wallets/walletConfigs.d.ts +30 -0
  192. package/package.json +78 -0
@@ -0,0 +1,32 @@
1
+ import { Languages as Lang } from './localizations';
2
+ export type Languages = Lang;
3
+ export type Theme = 'auto' | 'web95' | 'retro' | 'soft' | 'midnight' | 'minimal' | 'rounded' | 'nouns';
4
+ export type Mode = 'light' | 'dark' | 'auto';
5
+ export type CustomTheme = any;
6
+ export type All = {
7
+ theme?: Theme;
8
+ mode?: Mode;
9
+ customTheme?: CustomTheme;
10
+ lang?: Languages;
11
+ };
12
+ export type { ConnectKitOptions as OpenfortKitOptions, OpenfortWalletConfig } from './components/OpenfortKit/types';
13
+ export type { CustomAvatarProps } from './components/Common/Avatar';
14
+ export declare enum OpenfortKitErrorType {
15
+ AUTHENTICATION_ERROR = "AUTHENTICATION_ERROR"
16
+ }
17
+ interface Data {
18
+ [key: string]: any;
19
+ }
20
+ export declare class OpenfortKitError extends Error {
21
+ type: OpenfortKitErrorType;
22
+ data: Data;
23
+ constructor(message: string, type: OpenfortKitErrorType, data?: Data);
24
+ }
25
+ export type OpenfortHookOptions<T = {
26
+ error?: OpenfortKitError;
27
+ }> = {
28
+ onSuccess?: (data: T) => void;
29
+ onError?: (error: OpenfortKitError) => void;
30
+ onSettled?: (data: T | undefined | null, error: OpenfortKitError | null) => void;
31
+ throwOnError?: boolean;
32
+ };
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+ declare const truncateEthAddress: (address?: string, separator?: string) => string;
3
+ declare const truncateENSAddress: (ensName: string, maxLength: number) => string;
4
+ declare const truncateUserId: (playerId?: string, separator?: string) => string;
5
+ declare const nFormatter: (num: number, digits?: number) => string;
6
+ declare const detectBrowser: () => "" | import("detect-browser").Browser | "bot" | "node" | "react-native";
7
+ declare const detectOS: () => "" | import("detect-browser").OperatingSystem | NodeJS.Platform;
8
+ declare const isAndroid: () => boolean;
9
+ declare const isMobile: () => boolean;
10
+ type ReactChildArray = ReturnType<typeof React.Children.toArray>;
11
+ declare function flattenChildren(children: React.ReactNode): ReactChildArray;
12
+ export declare const isWalletConnectConnector: (connectorId?: string) => connectorId is "walletConnect";
13
+ export declare const isMetaMaskConnector: (connectorId?: string) => connectorId is "metaMaskSDK";
14
+ export declare const isCoinbaseWalletConnector: (connectorId?: string) => connectorId is "coinbaseWalletSDK";
15
+ export declare const isLedgerConnector: (connectorId?: string) => connectorId is "ledger";
16
+ export declare const isSafeConnector: (connectorId?: string) => connectorId is "safe";
17
+ export declare const isInjectedConnector: (connectorId?: string) => connectorId is "injected";
18
+ export { nFormatter, truncateEthAddress, truncateENSAddress, truncateUserId, isMobile, isAndroid, detectBrowser, detectOS, flattenChildren, };
@@ -0,0 +1,9 @@
1
+ /**
2
+ * LocalStorage helper functions to save and retrieve data on a per-app basis
3
+ * e.g recently connected wallets, transactions, etc.
4
+ */
5
+ export declare const save: (storageKey: string, data: any[]) => any;
6
+ export declare const get: (storageKey: string) => any;
7
+ export declare const add: (storageKey: string, item: any) => any;
8
+ export declare const remove: (storageKey: string, item: any) => any;
9
+ export declare const clear: (storageKey: string) => any;
@@ -0,0 +1,2 @@
1
+ export declare const hexToP3: (hex: string) => string;
2
+ export declare const p3Hex: (hex: string, property: string) => import("styled-components").FlattenSimpleInterpolation;
@@ -0,0 +1,24 @@
1
+ declare global {
2
+ interface Window {
3
+ trustWallet: any;
4
+ trustwallet: any;
5
+ }
6
+ }
7
+ export declare const isWalletInstalled: (name: string) => boolean;
8
+ export declare const isMetaMask: () => boolean;
9
+ export declare const isCoinbaseWallet: () => boolean;
10
+ export declare const isFamily: () => boolean;
11
+ export declare const isBrave: () => boolean;
12
+ export declare const isTokenary: () => boolean;
13
+ export declare const isDawn: () => boolean;
14
+ export declare const isFrame: () => boolean;
15
+ export declare const isPhantom: () => boolean;
16
+ export declare const isInfinityWallet: () => boolean;
17
+ export declare const isRabby: () => boolean;
18
+ export declare const isFrontier: () => boolean;
19
+ export declare const isTrust: () => any;
20
+ export declare const isTokenPocket: () => boolean;
21
+ export declare const isTalisman: () => boolean;
22
+ export declare const isFordefi: () => boolean;
23
+ export declare const isRainbow: () => boolean;
24
+ export declare const isZerion: () => boolean;
@@ -0,0 +1 @@
1
+ export declare const OPENFORTKIT_VERSION = "0.0.1";
@@ -0,0 +1,7 @@
1
+ import { CreateConnectorFn } from 'wagmi';
2
+ import { walletConfigs } from './walletConfigs';
3
+ type WalletIds = Extract<keyof typeof walletConfigs, string>;
4
+ export declare const wallets: {
5
+ [key: WalletIds]: CreateConnectorFn;
6
+ };
7
+ export {};
@@ -0,0 +1,9 @@
1
+ import { Connector } from 'wagmi';
2
+ import { WalletConfigProps } from './walletConfigs';
3
+ export type WalletProps = {
4
+ id: string;
5
+ connector: Connector;
6
+ isInstalled?: boolean;
7
+ } & WalletConfigProps;
8
+ export declare const useWallet: (id: string) => WalletProps | null;
9
+ export declare const useWallets: () => WalletProps[];
@@ -0,0 +1,30 @@
1
+ /**
2
+ * EIP-6963: Multi Injected Provider Discovery
3
+ * https://eips.ethereum.org/EIPS/eip-6963
4
+ *
5
+ */
6
+ export type WalletConfigProps = {
7
+ name?: string;
8
+ shortName?: string;
9
+ icon?: string | React.ReactNode;
10
+ iconConnector?: React.ReactNode;
11
+ iconShape?: 'squircle' | 'circle' | 'square';
12
+ iconShouldShrink?: boolean;
13
+ downloadUrls?: {
14
+ download?: string;
15
+ website?: string;
16
+ desktop?: string;
17
+ android?: string;
18
+ ios?: string;
19
+ chrome?: string;
20
+ firefox?: string;
21
+ brave?: string;
22
+ edge?: string;
23
+ safari?: string;
24
+ };
25
+ getWalletConnectDeeplink?: (uri: string) => string;
26
+ shouldDeeplinkDesktop?: boolean;
27
+ };
28
+ export declare const walletConfigs: {
29
+ [rdns: string]: WalletConfigProps;
30
+ };
package/package.json ADDED
@@ -0,0 +1,78 @@
1
+ {
2
+ "name": "@openfort/react",
3
+ "version": "0.0.1",
4
+ "author": "Openfort (https://www.openfort.io)",
5
+ "license": "BSD-2-Clause license",
6
+ "description": "The easiest way to integrate Openfort to your project.",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/openfort-xyz/openfort-kit.git",
10
+ "directory": "packages/openfortkit"
11
+ },
12
+ "type": "module",
13
+ "exports": {
14
+ "import": "./build/index.es.js",
15
+ "types": "./build/index.d.ts"
16
+ },
17
+ "types": "./build/index.d.ts",
18
+ "engines": {
19
+ "node": ">=12.4"
20
+ },
21
+ "files": [
22
+ "build",
23
+ "README.md"
24
+ ],
25
+ "scripts": {
26
+ "start": "rollup --config rollup.config.dev.js -w",
27
+ "dev": "rollup --config rollup.config.dev.js -w",
28
+ "build": "rollup --config rollup.config.prod.js",
29
+ "lint": "eslint src --ext .ts"
30
+ },
31
+ "keywords": [
32
+ "ens",
33
+ "react-hook",
34
+ "blockchain",
35
+ "hooks",
36
+ "Openfort",
37
+ "ethereum",
38
+ "react"
39
+ ],
40
+ "dependencies": {
41
+ "@openfort/openfort-js": "^0.9.5",
42
+ "buffer": "^6.0.3",
43
+ "detect-browser": "^5.3.0",
44
+ "framer-motion": "^6.3.11",
45
+ "qrcode": "^1.5.0",
46
+ "react-is": "^19.1.0",
47
+ "react-transition-state": "^1.1.4",
48
+ "react-use-measure": "^2.1.1",
49
+ "resize-observer-polyfill": "^1.5.1",
50
+ "styled-components": "^5.3.5"
51
+ },
52
+ "peerDependencies": {
53
+ "@tanstack/react-query": ">=5.0.0",
54
+ "react": "17.x || 18.x || 19.x",
55
+ "react-dom": "17.x || 18.x || 19.x",
56
+ "viem": "2.x",
57
+ "wagmi": "2.x"
58
+ },
59
+ "devDependencies": {
60
+ "@eslint/js": "^9.21.0",
61
+ "@types/node": "18.7.18",
62
+ "@types/qrcode": "^1.4.2",
63
+ "@types/react": "^18.0.6",
64
+ "@types/react-dom": "^18.0.2",
65
+ "@types/styled-components": "^5.1.25",
66
+ "eslint": "^9.21.0",
67
+ "eslint-plugin-react-hooks": "^5.1.0",
68
+ "eslint-plugin-react-refresh": "^0.4.19",
69
+ "typescript": "^5.0.4",
70
+ "typescript-eslint": "^8.24.1"
71
+ },
72
+ "resolutions": {
73
+ "react": "^18.0.0",
74
+ "react-dom": "^18.0.0",
75
+ "viem": "^2.x",
76
+ "wagmi": "^2.x"
77
+ }
78
+ }