@jaw.id/wagmi 0.0.1 → 0.0.3

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/README.md +11 -88
  2. package/cjs-error.cjs +4 -0
  3. package/package.json +5 -2
package/README.md CHANGED
@@ -1,21 +1,21 @@
1
1
  # @jaw.id/wagmi
2
2
 
3
- Wagmi connector and React hooks for JAW (JustaName Account Wallet) smart accounts.
3
+ [Wagmi](https://wagmi.sh) connector and React hooks for [JAW.id](https://jaw.id) smart accounts.
4
+
5
+ ## Documentation
6
+
7
+ For documentation and guides, visit [docs.jaw.id](https://docs.jaw.id).
4
8
 
5
9
  ## Installation
6
10
 
7
11
  ```bash
8
12
  npm install @jaw.id/wagmi wagmi @tanstack/react-query
9
13
  # or
10
- yarn add @jaw.id/wagmi wagmi @tanstack/react-query
11
- # or
12
14
  bun add @jaw.id/wagmi wagmi @tanstack/react-query
13
15
  ```
14
16
 
15
17
  ## Quick Start
16
18
 
17
- ### 1. Configure Wagmi with JAW Connector
18
-
19
19
  ```typescript
20
20
  import { createConfig, http } from 'wagmi';
21
21
  import { mainnet, sepolia } from 'wagmi/chains';
@@ -25,7 +25,7 @@ export const config = createConfig({
25
25
  chains: [mainnet, sepolia],
26
26
  connectors: [
27
27
  jaw({
28
- apiKey: 'your-api-key',
28
+ apiKey: 'your-api-key',
29
29
  }),
30
30
  ],
31
31
  transports: {
@@ -35,26 +35,20 @@ export const config = createConfig({
35
35
  });
36
36
  ```
37
37
 
38
- ### 2. Use React Hooks
39
-
40
38
  ```tsx
41
- import { useConnect, useDisconnect, useGrantPermissions } from '@jaw.id/wagmi';
39
+ import { useConnect, useDisconnect } from '@jaw.id/wagmi';
42
40
  import { useAccount } from 'wagmi';
43
41
 
44
42
  function App() {
45
43
  const { connect } = useConnect();
46
44
  const { disconnect } = useDisconnect();
47
45
  const { address, isConnected } = useAccount();
48
- const { grantPermissions } = useGrantPermissions();
49
46
 
50
47
  if (isConnected) {
51
48
  return (
52
49
  <div>
53
50
  <p>Connected: {address}</p>
54
51
  <button onClick={() => disconnect()}>Disconnect</button>
55
- <button onClick={() => grantPermissions({ permissions: [...] })}>
56
- Grant Permissions
57
- </button>
58
52
  </div>
59
53
  );
60
54
  }
@@ -63,85 +57,14 @@ function App() {
63
57
  }
64
58
  ```
65
59
 
66
- ## Exports
67
-
68
- ### Connector
69
-
70
- - `jaw(options)` - Wagmi connector factory
60
+ ## AI-Assisted Development
71
61
 
72
- ```typescript
73
- import { jaw } from '@jaw.id/wagmi';
74
-
75
- const connector = jaw({
76
- apiKey: 'your-api-key',
77
- });
78
- ```
79
-
80
- ### React Hooks
81
-
82
- Available as named exports or via the `Hooks` namespace:
83
-
84
- ```typescript
85
- import { useConnect, Hooks } from '@jaw.id/wagmi';
86
-
87
- // Both are equivalent:
88
- useConnect();
89
- Hooks.useConnect();
90
- ```
62
+ Add JAW.id skills to your AI coding agent:
91
63
 
92
- | Hook | Description |
93
- |------|-------------|
94
- | `useConnect` | Connect to JAW wallet |
95
- | `useDisconnect` | Disconnect from wallet |
96
- | `useGrantPermissions` | Grant permissions to apps (EIP-7715) |
97
- | `useRevokePermissions` | Revoke previously granted permissions |
98
- | `usePermissions` | Query current permissions |
99
- | `useGetAssets` | Query wallet assets (EIP-7811) |
100
- | `useCapabilities` | Query wallet capabilities |
101
-
102
- ### Actions (Non-React)
103
-
104
- For use outside React components or with other state managers:
105
-
106
- ```typescript
107
- import { connect, Actions } from '@jaw.id/wagmi';
108
-
109
- // Both are equivalent:
110
- await connect(config, { connector });
111
- await Actions.connect(config, { connector });
112
- ```
113
-
114
- | Action | Description |
115
- |--------|-------------|
116
- | `connect` | Connect to wallet |
117
- | `disconnect` | Disconnect from wallet |
118
- | `grantPermissions` | Grant permissions |
119
- | `revokePermissions` | Revoke permissions |
120
- | `getPermissions` | Get current permissions |
121
- | `getAssets` | Get wallet assets |
122
- | `getCapabilities` | Get wallet capabilities |
123
-
124
- ### TanStack Query Utilities
125
-
126
- Query key factories for custom query implementations:
127
-
128
- ```typescript
129
- import { Query, getPermissionsQueryKey } from '@jaw.id/wagmi';
130
-
131
- // Use with TanStack Query
132
- const queryKey = getPermissionsQueryKey({ address, chainId });
64
+ ```bash
65
+ npx skills add JustaName-id/jaw-skills
133
66
  ```
134
67
 
135
- ## Peer Dependencies
136
-
137
- - `react` >= 18.0.0
138
- - `wagmi` >= 3.0.0
139
- - `@tanstack/react-query` >= 5.0.0
140
-
141
- ## Documentation
142
-
143
- For detailed guides, API reference, and examples, visit **[docs.jaw.id](https://docs.jaw.id)**.
144
-
145
68
  ## License
146
69
 
147
70
  [MIT](../../LICENSE.md)
package/cjs-error.cjs ADDED
@@ -0,0 +1,4 @@
1
+ throw new Error(
2
+ '@jaw.id/wagmi is ESM-only because it depends on wagmi (ESM-only). ' +
3
+ 'Use ESM imports or dynamic import("@jaw.id/wagmi").'
4
+ );
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@jaw.id/wagmi",
3
- "version": "0.0.1",
3
+ "description": "Wagmi connector and React hooks for JAW.id.",
4
+ "version": "0.0.3",
4
5
  "type": "module",
5
6
  "main": "./dist/index.js",
6
7
  "module": "./dist/index.js",
@@ -11,6 +12,7 @@
11
12
  "@jaw-mono/source": "./src/index.ts",
12
13
  "types": "./dist/index.d.ts",
13
14
  "import": "./dist/index.js",
15
+ "require": "./cjs-error.cjs",
14
16
  "default": "./dist/index.js"
15
17
  }
16
18
  },
@@ -24,10 +26,11 @@
24
26
  },
25
27
  "files": [
26
28
  "dist",
29
+ "cjs-error.cjs",
27
30
  "!**/*.tsbuildinfo"
28
31
  ],
29
32
  "dependencies": {
30
- "@jaw.id/core": "0.0.1",
33
+ "@jaw.id/core": "0.0.2",
31
34
  "@wagmi/core": "^3.0.0",
32
35
  "tslib": "^2.3.0",
33
36
  "viem": "^2.38.2"