@antigane/wallet-adapters 0.0.6 → 0.0.7

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 (3) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +97 -60
  3. package/package.json +1 -1
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Antigane Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,73 +1,110 @@
1
- # React + TypeScript + Vite
1
+ # @antigane/wallet-adapters
2
2
 
3
- This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
3
+ Wallet connect UI and adapters for React. Includes a ready-made `ConnectButton` with a modal for MetaMask and Phantom.
4
4
 
5
- Currently, two official plugins are available:
5
+ ## Install
6
6
 
7
- - [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) (or [oxc](https://oxc.rs) when used in [rolldown-vite](https://vite.dev/guide/rolldown)) for Fast Refresh
8
- - [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
7
+ ```bash
8
+ npm i @antigane/wallet-adapters
9
+ # or
10
+ pnpm add @antigane/wallet-adapters
11
+ # or
12
+ yarn add @antigane/wallet-adapters
13
+ ```
14
+
15
+ ### Peer dependencies
16
+
17
+ Make sure these are installed in your app:
18
+
19
+ - `react` >= 18
20
+ - `react-dom` >= 18
21
+ - `framer-motion` >= 12.24.0 < 13
22
+
23
+ ## Quick start
24
+
25
+ ```tsx
26
+ import { ConnectButton } from "@antigane/wallet-adapters";
27
+
28
+ export default function App() {
29
+ return (
30
+ <div style={{ padding: 24 }}>
31
+ <ConnectButton
32
+ onSigned={(state) => {
33
+ console.log("signed", state);
34
+ }}
35
+ onChange={(state) => {
36
+ console.log("change", state);
37
+ }}
38
+ />
39
+ </div>
40
+ );
41
+ }
42
+ ```
43
+
44
+ Styles are bundled automatically in the library build, so importing the component is enough.
45
+ This package is browser-only because it uses `window` for wallet detection.
46
+
47
+ ## Props
48
+
49
+ ### ConnectButton
9
50
 
10
- ## React Compiler
51
+ - `onSigned?: (state: SignState) => void`
52
+ - `onChange?: (state: SignState | null) => void`
11
53
 
12
- The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see [this documentation](https://react.dev/learn/react-compiler/installation).
54
+ `SignState` shape:
13
55
 
14
- ## Expanding the ESLint configuration
56
+ ```ts
57
+ type SignState = {
58
+ signature?: string;
59
+ message?: string;
60
+ accountId?: string;
61
+ accountType?: "EVM" | "SOLANA";
62
+ };
63
+ ```
64
+
65
+ ## Assets
66
+
67
+ The modal uses wallet icons at these paths:
15
68
 
16
- If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
69
+ - `/assets/wallets/metamask.svg`
70
+ - `/assets/wallets/phantom.svg`
71
+ - `/assets/wallets/peridotwallet.svg`
17
72
 
18
- ```js
19
- export default defineConfig([
20
- globalIgnores(['dist']),
21
- {
22
- files: ['**/*.{ts,tsx}'],
23
- extends: [
24
- // Other configs...
73
+ If your app does not already serve them, copy the SVGs from this package's `public/assets/wallets` into your app's public folder with the same paths.
25
74
 
26
- // Remove tseslint.configs.recommended and replace with this
27
- tseslint.configs.recommendedTypeChecked,
28
- // Alternatively, use this for stricter rules
29
- tseslint.configs.strictTypeChecked,
30
- // Optionally, add this for stylistic rules
31
- tseslint.configs.stylisticTypeChecked,
75
+ ## Theming
32
76
 
33
- // Other configs...
34
- ],
35
- languageOptions: {
36
- parserOptions: {
37
- project: ['./tsconfig.node.json', './tsconfig.app.json'],
38
- tsconfigRootDir: import.meta.dirname,
39
- },
40
- // other options...
41
- },
42
- },
43
- ])
77
+ This library uses CSS variables for colors. You can override them anywhere in your app:
78
+
79
+ ```css
80
+ :root {
81
+ --background: #111312;
82
+ --foreground: #ffffff;
83
+ --card: #0d100e;
84
+ --card-foreground: #ffffff;
85
+ --accent: #2ecc71;
86
+ --highlight: #9bffb6;
87
+ --muted: #111312;
88
+ --muted-foreground: #6e6e6e;
89
+ }
44
90
  ```
45
91
 
46
- You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:
47
-
48
- ```js
49
- // eslint.config.js
50
- import reactX from 'eslint-plugin-react-x'
51
- import reactDom from 'eslint-plugin-react-dom'
52
-
53
- export default defineConfig([
54
- globalIgnores(['dist']),
55
- {
56
- files: ['**/*.{ts,tsx}'],
57
- extends: [
58
- // Other configs...
59
- // Enable lint rules for React
60
- reactX.configs['recommended-typescript'],
61
- // Enable lint rules for React DOM
62
- reactDom.configs.recommended,
63
- ],
64
- languageOptions: {
65
- parserOptions: {
66
- project: ['./tsconfig.node.json', './tsconfig.app.json'],
67
- tsconfigRootDir: import.meta.dirname,
68
- },
69
- // other options...
70
- },
71
- },
72
- ])
92
+ ## Troubleshooting
93
+
94
+ If styles do not appear in a consumer app:
95
+
96
+ 1) Ensure the app's bundler supports CSS imports from `node_modules`.
97
+ 2) Ensure the app is not stripping CSS side effects during tree-shaking.
98
+ 3) Ensure your build is using the latest published package version.
99
+
100
+ If you use Next.js, render the button in a client component:
101
+
102
+ ```tsx
103
+ "use client";
104
+
105
+ import { ConnectButton } from "@antigane/wallet-adapters";
73
106
  ```
107
+
108
+ ## License
109
+
110
+ MIT
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@antigane/wallet-adapters",
3
3
  "private": false,
4
- "version": "0.0.6",
4
+ "version": "0.0.7",
5
5
  "type": "module",
6
6
  "homepage": "https://github.com/antiganehq",
7
7
  "repository": {