nodpay 0.2.4 → 0.2.5
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/SKILL.md +10 -29
- package/package.json +1 -1
package/SKILL.md
CHANGED
|
@@ -42,9 +42,9 @@ The wallet is a **Safe 2-of-3 multisig**. You hold 1 key, the user holds 2 (pass
|
|
|
42
42
|
npx nodpay keygen --env-file .env
|
|
43
43
|
```
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
Outputs your agent's **public address** only. The private key is written directly to `.env` — it never appears in your output or context.
|
|
46
46
|
|
|
47
|
-
If
|
|
47
|
+
If a key already exists in the file, it reuses it and prints the address.
|
|
48
48
|
|
|
49
49
|
**After keygen**, trigger a gateway restart so the env var takes effect. Send your wallet link message to the user BEFORE restarting — the restart will interrupt your session.
|
|
50
50
|
|
|
@@ -102,8 +102,6 @@ Each wallet file:
|
|
|
102
102
|
}
|
|
103
103
|
```
|
|
104
104
|
|
|
105
|
-
`agentSigner` is your agent's EOA address (derived from `NODPAY_AGENT_KEY`).
|
|
106
|
-
|
|
107
105
|
For EOA wallets, replace passkey fields with `"userSigner": "0x..."`.
|
|
108
106
|
|
|
109
107
|
One agent key serves all wallets — multi-wallet is handled user-side (different passkeys/recovery keys → different Safe addresses, same agent).
|
|
@@ -113,7 +111,6 @@ One agent key serves all wallets — multi-wallet is handled user-side (differen
|
|
|
113
111
|
### Propose a transaction
|
|
114
112
|
|
|
115
113
|
```bash
|
|
116
|
-
NODPAY_AGENT_KEY=0x... \
|
|
117
114
|
npx nodpay propose \
|
|
118
115
|
--chain <CHAIN_NAME> \
|
|
119
116
|
--safe <WALLET_ADDRESS> \
|
|
@@ -134,12 +131,8 @@ The script outputs JSON with an `approveUrl`. Send it to the user:
|
|
|
134
131
|
|
|
135
132
|
### Check balance
|
|
136
133
|
|
|
137
|
-
Use the RPC URL for the wallet's chain (see `references/networks.json`):
|
|
138
|
-
|
|
139
134
|
```bash
|
|
140
|
-
|
|
141
|
-
-H "Content-Type: application/json" \
|
|
142
|
-
-d '{"jsonrpc":"2.0","method":"eth_getBalance","params":["<WALLET_ADDRESS>","latest"],"id":1}'
|
|
135
|
+
npx nodpay propose --chain <CHAIN_NAME> --safe <WALLET_ADDRESS> --check-balance
|
|
143
136
|
```
|
|
144
137
|
|
|
145
138
|
If balance is 0, remind the user to deposit before proposing.
|
|
@@ -154,9 +147,7 @@ Always check before proposing — this tells you the current nonce, pending ops,
|
|
|
154
147
|
|
|
155
148
|
---
|
|
156
149
|
|
|
157
|
-
##
|
|
158
|
-
|
|
159
|
-
### Flags
|
|
150
|
+
## Flags
|
|
160
151
|
|
|
161
152
|
| Flag | Required | Description |
|
|
162
153
|
|------|----------|-------------|
|
|
@@ -172,16 +163,6 @@ Always check before proposing — this tells you the current nonce, pending ops,
|
|
|
172
163
|
| `--nonce` | optional | Force nonce (for replacements) |
|
|
173
164
|
| `--purpose` | optional | Human-readable label |
|
|
174
165
|
|
|
175
|
-
### Environment
|
|
176
|
-
|
|
177
|
-
Only one env var is required:
|
|
178
|
-
|
|
179
|
-
| Var | Description |
|
|
180
|
-
|-----|-------------|
|
|
181
|
-
| `NODPAY_AGENT_KEY` | Agent signing key (required) |
|
|
182
|
-
|
|
183
|
-
Chain config (RPC, bundler) is auto-resolved via `--chain` from [`@nodpay/core/networks`](https://www.npmjs.com/package/@nodpay/core). You can override with `RPC_URL`/`CHAIN_ID` env vars if needed, but `--chain` is the recommended way.
|
|
184
|
-
|
|
185
166
|
### Supported Chains
|
|
186
167
|
|
|
187
168
|
`ethereum`, `base`, `arbitrum`, `optimism`, `polygon`, `sepolia`, `base_sepolia`
|
|
@@ -192,11 +173,11 @@ The wallet address is the same across all chains (counterfactual). Chain is only
|
|
|
192
173
|
|
|
193
174
|
## Transaction Patterns
|
|
194
175
|
|
|
195
|
-
**Sequential**: Just call propose multiple times. Nonces auto-increment
|
|
176
|
+
**Sequential**: Just call propose multiple times. Nonces auto-increment.
|
|
196
177
|
|
|
197
|
-
**Replace**:
|
|
178
|
+
**Replace**: Propose with `--nonce N` to replace a pending tx at nonce N. Check pending nonces via `GET /api/txs?safe=<ADDRESS>`.
|
|
198
179
|
|
|
199
|
-
**Cascade**: Rejecting tx at nonce N
|
|
180
|
+
**Cascade**: Rejecting tx at nonce N invalidates all tx with nonce > N. Irreversible.
|
|
200
181
|
|
|
201
182
|
⚠️ **Never propose a new nonce then reject an older one** — the cascade will destroy your new tx too.
|
|
202
183
|
|
|
@@ -204,7 +185,7 @@ The wallet address is the same across all chains (counterfactual). Chain is only
|
|
|
204
185
|
|
|
205
186
|
## Reconnect (Wallet Recovery)
|
|
206
187
|
|
|
207
|
-
If the user cleared their browser data,
|
|
188
|
+
If the user cleared their browser data, build a reconnect link:
|
|
208
189
|
|
|
209
190
|
```
|
|
210
191
|
https://nodpay.ai/?agent=YOUR_AGENT_ADDRESS&safe=WALLET_ADDRESS&recovery=RECOVERY_SIGNER&x=PASSKEY_X&y=PASSKEY_Y
|
|
@@ -234,7 +215,7 @@ User opens → verifies passkey → wallet restored. No on-chain action needed.
|
|
|
234
215
|
| User says | Action |
|
|
235
216
|
|-----------|--------|
|
|
236
217
|
| "create a wallet" | Send `https://nodpay.ai/?agent=YOUR_ADDRESS` |
|
|
237
|
-
| "send 0.1 ETH to 0x..." | Propose transaction |
|
|
238
|
-
| "balance" |
|
|
218
|
+
| "send 0.1 ETH to 0x..." | Propose transaction with `--chain` |
|
|
219
|
+
| "balance" | Check balance on the relevant chain |
|
|
239
220
|
| "pending?" | `GET /api/txs?safe=...` |
|
|
240
221
|
| "wallet disappeared" | Send reconnect link |
|