hood-cli 0.1.0
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/LICENSE +201 -0
- package/README.md +471 -0
- package/contracts/ERC20.sol +70 -0
- package/dist/chunk-CWEBZB3L.js +2248 -0
- package/dist/chunk-CWEBZB3L.js.map +1 -0
- package/dist/cli.js +1996 -0
- package/dist/cli.js.map +1 -0
- package/dist/dist-PVZTS5LZ.js +138 -0
- package/dist/dist-PVZTS5LZ.js.map +1 -0
- package/package.json +69 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the
|
|
44
|
+
purposes of this License, Derivative Works shall not include works
|
|
45
|
+
that remain separable from, or merely link (or bind by name) to the
|
|
46
|
+
interfaces of, the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including the
|
|
49
|
+
original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 nirholas
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,471 @@
|
|
|
1
|
+
# hood-cli
|
|
2
|
+
|
|
3
|
+
**The command-line toolkit for [Robinhood Chain](https://docs.robinhood.com/chain/) (chain ID 4663).**
|
|
4
|
+
|
|
5
|
+
Instant reads with zero config, guarded writes with an encrypted local wallet. Prices,
|
|
6
|
+
portfolios, launches, swaps, transfers, transaction decoding — the `gh`/`vercel` of Robinhood
|
|
7
|
+
Chain. Built on [`hoodchain`](https://github.com/nirholas/robinhood-chain-sdk) and
|
|
8
|
+
[viem](https://viem.sh).
|
|
9
|
+
|
|
10
|
+
Who it's for: anyone tracking Stock Tokens (tokenized equities on Robinhood Chain), watching
|
|
11
|
+
NOXA/Odyssey memecoin launches, or scripting swaps and transfers from a terminal or CI job.
|
|
12
|
+
Read commands (`price`, `stocks`, `coins`, `launches`, `tx`, `token`, `portfolio`, `watch`)
|
|
13
|
+
work immediately with no wallet or API key. Write commands (`swap`, `transfer`,
|
|
14
|
+
`deploy-token`) need a wallet and always stop for an explicit confirmation before signing.
|
|
15
|
+
|
|
16
|
+
Docs + a live animated terminal demo (a REAL captured session, not invented output):
|
|
17
|
+
**https://nirholas.github.io/hood-cli/** · full flag-by-flag command reference:
|
|
18
|
+
**https://nirholas.github.io/hood-cli/commands.html** (generated straight from `hood
|
|
19
|
+
<command> --help` — never hand-written, never drifts from the shipped binary).
|
|
20
|
+
|
|
21
|
+
## Install
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npm install -g hood-cli
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
This installs two equivalent binaries: `hood` and `hoodc`.
|
|
28
|
+
|
|
29
|
+
Run without installing:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
npx hood-cli price AAPL
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
From a checkout:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
git clone https://github.com/nirholas/hood-cli.git
|
|
39
|
+
cd hood-cli
|
|
40
|
+
npm install
|
|
41
|
+
npm run build
|
|
42
|
+
node dist/cli.js price AAPL
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Requires Node ≥ 20.
|
|
46
|
+
|
|
47
|
+
## Quickstart
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
$ hood price AAPL
|
|
51
|
+
◈ AAPL · Robinhood Chain mainnet
|
|
52
|
+
Oracle $315.50
|
|
53
|
+
Updated 1d 18h ago
|
|
54
|
+
DEX no pool
|
|
55
|
+
Premium —
|
|
56
|
+
Token 0xaF3D…93f9
|
|
57
|
+
|
|
58
|
+
$ hood stocks --sort premium --dex --limit 6
|
|
59
|
+
◈ Stock Tokens · mainnet · 6 shown · 6 priced
|
|
60
|
+
SYMBOL PRICE DEX PREMIUM AGE NAME ADDRESS
|
|
61
|
+
────────────────────────────────────────────────────────────────────────────────
|
|
62
|
+
CLSK $12.86 $15.51 +20.58% 1d 17h CleanSpark 0xcBB9…Cee3
|
|
63
|
+
IONQ $43.08 $49.44 +14.76% 1d 18h IonQ 0x5583…0EfE
|
|
64
|
+
NBIS $219.24 $248.41 +13.31% 1d 17h Nebius Group 0x9D9c…7931
|
|
65
|
+
|
|
66
|
+
$ hood portfolio 0x9701fb0aDe1E269c8f64Ec0C7b3cfADB31A13A52
|
|
67
|
+
◈ Portfolio · 0x9701…3A52 · mainnet
|
|
68
|
+
ETH 0.003784
|
|
69
|
+
USDG $0.0550
|
|
70
|
+
Stocks $0.00
|
|
71
|
+
Total $0.0550
|
|
72
|
+
|
|
73
|
+
No Stock Token positions. Fund with `hood swap --sell USDG --buy <ticker>`.
|
|
74
|
+
|
|
75
|
+
$ hood swap --sell USDG --buy WETH --amount 250
|
|
76
|
+
◈ Swap quote · mainnet · add --execute to send
|
|
77
|
+
Sell 250 USDG
|
|
78
|
+
Buy ~0.138501866807990729 WETH
|
|
79
|
+
Min. received 0.137809357473950775 WETH (0.50% slippage)
|
|
80
|
+
Rate 1 USDG ≈ 0.000554 WETH
|
|
81
|
+
Route direct pool
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Every command supports `--json` for machine-readable output — pipe it into `jq` or a script.
|
|
85
|
+
|
|
86
|
+
## Global options
|
|
87
|
+
|
|
88
|
+
These apply to every command and must come before the subcommand name (`hood --json price AAPL`):
|
|
89
|
+
|
|
90
|
+
| Flag | Description |
|
|
91
|
+
| --- | --- |
|
|
92
|
+
| `-v, --version` | print the CLI version |
|
|
93
|
+
| `--json` | machine-readable JSON output instead of the human-formatted view |
|
|
94
|
+
| `--network <net>` | `mainnet` (default) or `testnet` |
|
|
95
|
+
| `--rpc <url>` | override the RPC endpoint for this invocation |
|
|
96
|
+
| `--verbose` | show the raw underlying error cause on failure |
|
|
97
|
+
| `--yes` | skip the interactive yes/no confirmation on writes (still requires `--execute`) |
|
|
98
|
+
| `--acknowledge-eligibility` | affirm Stock Token acquisition eligibility (you are not a US/CA/UK/CH person) |
|
|
99
|
+
| `--no-color` | disable ANSI colour in human output |
|
|
100
|
+
| `-h, --help` | show help for the command |
|
|
101
|
+
|
|
102
|
+
## Command reference
|
|
103
|
+
|
|
104
|
+
| Command | Description |
|
|
105
|
+
| --- | --- |
|
|
106
|
+
| `price <symbol>` | Chainlink oracle price + DEX price + premium for a Stock Token |
|
|
107
|
+
| `stocks` | The full Stock Token board with live Chainlink prices |
|
|
108
|
+
| `coins` | Memecoin screener — newest or trending launches |
|
|
109
|
+
| `launches` | Recent memecoin launches from NOXA and The Odyssey |
|
|
110
|
+
| `portfolio <address>` | Multiplier-correct Stock Token positions + USD totals for an address |
|
|
111
|
+
| `tx <hash>` | Decode a transaction: status, transfers, gas, method |
|
|
112
|
+
| `token <address>` | Inspect a token: metadata, supply, multiplier, price |
|
|
113
|
+
| `watch <addrOrToken>` | Live activity stream for an address or a token (ERC-20 transfers + native ETH) |
|
|
114
|
+
| `swap` | Quote (default) or execute a Uniswap v3 swap between two tokens |
|
|
115
|
+
| `transfer` | Send ETH or an ERC-20 token to an address |
|
|
116
|
+
| `faucet` | Print testnet faucet instructions + current testnet balances |
|
|
117
|
+
| `deploy-token` | Deploy a fixed-supply ERC-20 from a JSON config (direct-rail, no launchpad) |
|
|
118
|
+
| `config` | Manage hood-cli settings (rpc, wallet, network) |
|
|
119
|
+
|
|
120
|
+
Every argument below is a real, implemented flag — run `hood <command> --help` at any time to
|
|
121
|
+
see it straight from the CLI.
|
|
122
|
+
|
|
123
|
+
### `hood price <symbol>`
|
|
124
|
+
|
|
125
|
+
Chainlink oracle price, DEX price, and the premium/discount between them for one Stock Token.
|
|
126
|
+
|
|
127
|
+
| Flag | Description |
|
|
128
|
+
| --- | --- |
|
|
129
|
+
| `symbol` (arg) | ticker (`AAPL`) or token address |
|
|
130
|
+
| `--watch` | live-updating view that repaints in place |
|
|
131
|
+
| `--interval <ms>` | refresh interval for `--watch` (default `4000`) |
|
|
132
|
+
| `--max-age <seconds>` | max acceptable Chainlink answer age |
|
|
133
|
+
| `--no-dex` | skip the Uniswap price probe (oracle only) |
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
hood price AAPL
|
|
137
|
+
hood price 0xaF3D... --no-dex
|
|
138
|
+
hood price TSLA --watch --interval 2000
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### `hood stocks`
|
|
142
|
+
|
|
143
|
+
The full Stock Token board — every canonical, verified Stock Token with a live Chainlink feed.
|
|
144
|
+
|
|
145
|
+
| Flag | Description |
|
|
146
|
+
| --- | --- |
|
|
147
|
+
| `--sort <key>` | `symbol` \| `price` \| `premium` (premium implies `--dex`); default `symbol` |
|
|
148
|
+
| `--dex` | also probe Uniswap for DEX price + premium (slower) |
|
|
149
|
+
| `--priced` | only show tokens with a live Chainlink feed |
|
|
150
|
+
| `--limit <n>` | show at most `n` rows |
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
hood stocks
|
|
154
|
+
hood stocks --sort premium --dex --limit 10
|
|
155
|
+
hood stocks --priced --json
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
### `hood coins`
|
|
159
|
+
|
|
160
|
+
Screener over the NOXA/Odyssey bonding-curve launchpads: newest launches, or ranked by trade
|
|
161
|
+
activity.
|
|
162
|
+
|
|
163
|
+
| Flag | Description |
|
|
164
|
+
| --- | --- |
|
|
165
|
+
| `--new` | newest launches (default) |
|
|
166
|
+
| `--trending` | rank by bonding-curve trade activity |
|
|
167
|
+
| `--lookback <blocks>` | blocks to scan (default `50000`) |
|
|
168
|
+
| `--limit <n>` | rows to show (default `20`) |
|
|
169
|
+
| `--names` | resolve token symbols on-chain |
|
|
170
|
+
|
|
171
|
+
Mainnet only — the launchpads don't exist on testnet.
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
hood coins --names
|
|
175
|
+
hood coins --trending --lookback 100000 --limit 10
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
### `hood launches`
|
|
179
|
+
|
|
180
|
+
The raw launch feed for NOXA and The Odyssey, or a live stream of new ones.
|
|
181
|
+
|
|
182
|
+
| Flag | Description |
|
|
183
|
+
| --- | --- |
|
|
184
|
+
| `--follow` | stream new launches live instead of a snapshot |
|
|
185
|
+
| `--launchpad <name>` | `noxa` \| `odyssey` (default: both) |
|
|
186
|
+
| `--lookback <blocks>` | blocks to scan for the snapshot (default `30000`) |
|
|
187
|
+
| `--limit <n>` | max rows in the snapshot (default `25`) |
|
|
188
|
+
| `--names` | resolve each token symbol on-chain |
|
|
189
|
+
|
|
190
|
+
```bash
|
|
191
|
+
hood launches --lookback 2000000 --limit 5 --names
|
|
192
|
+
hood launches --follow --launchpad odyssey
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
### `hood portfolio <address>`
|
|
196
|
+
|
|
197
|
+
Multiplier-correct Stock Token positions (share-equivalents, not raw balances) plus ETH,
|
|
198
|
+
USDG, and a USD grand total.
|
|
199
|
+
|
|
200
|
+
| Flag | Description |
|
|
201
|
+
| --- | --- |
|
|
202
|
+
| `address` (arg) | wallet address to inspect |
|
|
203
|
+
| `--max-age <seconds>` | max acceptable Chainlink answer age |
|
|
204
|
+
|
|
205
|
+
```bash
|
|
206
|
+
hood portfolio 0x9701fb0aDe1E269c8f64Ec0C7b3cfADB31A13A52
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
### `hood tx <hash>`
|
|
210
|
+
|
|
211
|
+
Decodes a transaction: status, from/to, value, method selector, gas, fee, block time, and
|
|
212
|
+
every ERC-20 `Transfer` log inside it (symbols resolved for known Stock Tokens and read
|
|
213
|
+
on-chain for anything else).
|
|
214
|
+
|
|
215
|
+
```bash
|
|
216
|
+
hood tx 0x870a3bee3070f10e3c4f34271cfde70fd5aa0dc2eade6f07d01ae6c9a00285bd
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
### `hood token <address>`
|
|
220
|
+
|
|
221
|
+
Token metadata: name, decimals, total supply, holder count, the `uiMultiplier` for Stock
|
|
222
|
+
Tokens, Chainlink oracle price (if it has a feed), and DEX price.
|
|
223
|
+
|
|
224
|
+
| Flag | Description |
|
|
225
|
+
| --- | --- |
|
|
226
|
+
| `address` (arg) | token address or ticker |
|
|
227
|
+
|
|
228
|
+
```bash
|
|
229
|
+
hood token AAPL
|
|
230
|
+
hood token 0xcBB9...
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
### `hood watch <addrOrToken>`
|
|
234
|
+
|
|
235
|
+
Streams live activity until `Ctrl-C`. Without `--token`, a wallet address streams native ETH
|
|
236
|
+
in/out plus every USDG transfer touching it (mainnet only — it needs the Stock Token
|
|
237
|
+
registry). With `--token`, or when the argument isn't a valid address, it streams every
|
|
238
|
+
transfer of that token.
|
|
239
|
+
|
|
240
|
+
| Flag | Description |
|
|
241
|
+
| --- | --- |
|
|
242
|
+
| `addrOrToken` (arg) | wallet address, token address, or ticker to watch |
|
|
243
|
+
| `--token` | treat the argument as a token (stream ALL transfers of it) |
|
|
244
|
+
|
|
245
|
+
```bash
|
|
246
|
+
hood watch 0x9701fb0aDe1E269c8f64Ec0C7b3cfADB31A13A52
|
|
247
|
+
hood watch AAPL --token
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
### `hood swap`
|
|
251
|
+
|
|
252
|
+
Quotes a Uniswap v3 swap by default; add `--execute` to sign and send it. Recognizes `USDG`,
|
|
253
|
+
`WETH`/`ETH`, any Stock Token ticker, or a raw `0x` address for both `--sell` and `--buy`.
|
|
254
|
+
|
|
255
|
+
| Flag | Description |
|
|
256
|
+
| --- | --- |
|
|
257
|
+
| `--sell <token>` | ticker or address to sell (e.g. `USDG`) — required |
|
|
258
|
+
| `--buy <token>` | ticker or address to buy — required |
|
|
259
|
+
| `--amount <amount>` | amount of `--sell` to spend, in whole tokens — required |
|
|
260
|
+
| `--slippage <bps>` | slippage tolerance in basis points (default `50` = 0.5%) |
|
|
261
|
+
| `--execute` | sign and send (default: quote only) |
|
|
262
|
+
|
|
263
|
+
```bash
|
|
264
|
+
hood swap --sell USDG --buy WETH --amount 250
|
|
265
|
+
hood swap --sell USDG --buy AAPL --amount 500 --slippage 100 --execute
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
`--execute` prints a confirmation table and stops for an explicit `y`/`N` unless `--yes` is
|
|
269
|
+
passed. It also checks the configured `maxSpendUsd` cap (see **Configuration** below) and
|
|
270
|
+
Stock Token acquisition eligibility — a swap that mints/acquires a Stock Token for a
|
|
271
|
+
non-affirmed operator fails with a guard error until you pass
|
|
272
|
+
`--acknowledge-eligibility`.
|
|
273
|
+
|
|
274
|
+
### `hood transfer`
|
|
275
|
+
|
|
276
|
+
Sends native ETH or an ERC-20 token to an address.
|
|
277
|
+
|
|
278
|
+
| Flag | Description |
|
|
279
|
+
| --- | --- |
|
|
280
|
+
| `--to <address>` | recipient address — required |
|
|
281
|
+
| `--amount <amount>` | amount to send, in whole tokens — required |
|
|
282
|
+
| `--token <token>` | ticker or address to send (default: native ETH) |
|
|
283
|
+
|
|
284
|
+
```bash
|
|
285
|
+
hood transfer --to 0x9701fb0aDe1E269c8f64Ec0C7b3cfADB31A13A52 --amount 0.01
|
|
286
|
+
hood transfer --to 0x9701... --amount 100 --token USDG
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
Same confirmation gate and `maxSpendUsd` cap as `swap`.
|
|
290
|
+
|
|
291
|
+
### `hood faucet`
|
|
292
|
+
|
|
293
|
+
Prints the testnet faucet URL and instructions, plus your current testnet balances if a
|
|
294
|
+
wallet is configured. Testnet-only (`--network testnet`); each claim (browser-only — it
|
|
295
|
+
requires Cloudflare Turnstile + Google Sign-In and can't be automated) drips testnet ETH plus
|
|
296
|
+
5 each of `TSLA`, `AMZN`, `PLTR`, `NFLX`, `AMD`.
|
|
297
|
+
|
|
298
|
+
```bash
|
|
299
|
+
hood faucet --network testnet
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
### `hood deploy-token`
|
|
303
|
+
|
|
304
|
+
Deploys a fixed-supply ERC-20 (not a Stock Token, not launchpad-listed — a plain direct-rail
|
|
305
|
+
token) from a JSON config.
|
|
306
|
+
|
|
307
|
+
| Flag | Description |
|
|
308
|
+
| --- | --- |
|
|
309
|
+
| `--config <path>` | path to a JSON file: `{ name, symbol, decimals?, initialSupply }` — required |
|
|
310
|
+
| `--execute` | sign and send (default: print the deploy plan only) |
|
|
311
|
+
|
|
312
|
+
Config file example:
|
|
313
|
+
|
|
314
|
+
```json
|
|
315
|
+
{
|
|
316
|
+
"name": "My Token",
|
|
317
|
+
"symbol": "MTK",
|
|
318
|
+
"decimals": 18,
|
|
319
|
+
"initialSupply": 1000000
|
|
320
|
+
}
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
```bash
|
|
324
|
+
hood deploy-token --config ./mytoken.json
|
|
325
|
+
hood deploy-token --config ./mytoken.json --execute
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
### `hood config`
|
|
329
|
+
|
|
330
|
+
Manages the persistent CLI config at `~/.config/hood/config.json` (or `$HOOD_CONFIG_DIR`).
|
|
331
|
+
|
|
332
|
+
| Subcommand | Description |
|
|
333
|
+
| --- | --- |
|
|
334
|
+
| `config set <key> [value]` | set a config value: `network`, `rpc`, `testnetRpc`, `alchemyKey`, `maxSpendUsd`, or `wallet` |
|
|
335
|
+
| `config get <key>` | print one config value |
|
|
336
|
+
| `config list` | print the full config (secrets masked) |
|
|
337
|
+
|
|
338
|
+
```bash
|
|
339
|
+
hood config set network testnet
|
|
340
|
+
hood config set rpc https://your-rpc.example.com
|
|
341
|
+
hood config set alchemyKey <your-alchemy-key>
|
|
342
|
+
hood config set maxSpendUsd 500
|
|
343
|
+
hood config set wallet
|
|
344
|
+
hood config get walletAddress
|
|
345
|
+
hood config list
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
`config set wallet` with no value generates a new private key (or, if
|
|
349
|
+
`ROBINHOOD_CHAIN_IMPORT_KEY` is set, imports it), prompts twice for a password, and writes an
|
|
350
|
+
AES-256-GCM keystore (scrypt KDF, Node's built-in `crypto` — the same primitive set as the
|
|
351
|
+
Web3 Secret Storage spec) to `~/.config/hood/keystore.json`. The private key never touches the
|
|
352
|
+
config file or plaintext disk.
|
|
353
|
+
|
|
354
|
+
## Wallet & signing
|
|
355
|
+
|
|
356
|
+
Every write command (`swap --execute`, `transfer`, `deploy-token --execute`, `config set
|
|
357
|
+
wallet`) needs a signer. Precedence:
|
|
358
|
+
|
|
359
|
+
1. `ROBINHOOD_CHAIN_PRIVATE_KEY` env var — a hex private key (with or without `0x` prefix).
|
|
360
|
+
Best for CI or power users; bypasses the keystore entirely.
|
|
361
|
+
2. The encrypted keystore created by `hood config set wallet`, unlocked by a password prompt
|
|
362
|
+
(or the `HOOD_WALLET_PASSWORD` env var, so scripts never need an interactive TTY).
|
|
363
|
+
|
|
364
|
+
No wallet is required for any read command (`price`, `stocks`, `coins`, `launches`, `tx`,
|
|
365
|
+
`token`, `portfolio`, `watch`).
|
|
366
|
+
|
|
367
|
+
## Configuration & environment variables
|
|
368
|
+
|
|
369
|
+
| Variable | Purpose |
|
|
370
|
+
| --- | --- |
|
|
371
|
+
| `HOOD_CONFIG_DIR` | overrides the config/keystore directory (default `~/.config/hood`) |
|
|
372
|
+
| `HOOD_WALLET_PASSWORD` | wallet keystore password, read non-interactively (for scripts/CI) |
|
|
373
|
+
| `ROBINHOOD_CHAIN_PRIVATE_KEY` | sign with this private key directly, skipping the keystore |
|
|
374
|
+
| `ROBINHOOD_CHAIN_IMPORT_KEY` | private key to import when running `hood config set wallet` (instead of generating a new one) |
|
|
375
|
+
|
|
376
|
+
Persistent config keys (`hood config set <key> <value>`):
|
|
377
|
+
|
|
378
|
+
| Key | Purpose |
|
|
379
|
+
| --- | --- |
|
|
380
|
+
| `network` | default network for every command: `mainnet` or `testnet` |
|
|
381
|
+
| `rpc` | custom mainnet RPC URL |
|
|
382
|
+
| `testnetRpc` | custom testnet RPC URL |
|
|
383
|
+
| `alchemyKey` | Alchemy API key — builds `https://robinhood-mainnet.g.alchemy.com/v2/{key}` automatically |
|
|
384
|
+
| `maxSpendUsd` | hard USD ceiling on a single `swap`/`transfer`; the write is refused if the estimated spend exceeds it (unpriceable tokens are never blocked, only warned about) |
|
|
385
|
+
| `wallet` | special: runs the interactive wallet setup flow described above |
|
|
386
|
+
|
|
387
|
+
Resolution order for RPC URL: `--rpc` flag → `alchemyKey` (mainnet) / `testnetRpc` → `rpc` →
|
|
388
|
+
the SDK's public default.
|
|
389
|
+
|
|
390
|
+
## Networks
|
|
391
|
+
|
|
392
|
+
| Network | Chain ID | Notes |
|
|
393
|
+
| --- | --- | --- |
|
|
394
|
+
| `mainnet` (default) | 4663 | Stock Tokens, Chainlink feeds, NOXA/Odyssey launchpads, Uniswap v3 pools all live here |
|
|
395
|
+
| `testnet` | 46630 | `TSLA`, `AMZN`, `PLTR`, `NFLX`, `AMD` faucet tokens; no launchpads, no Chainlink feeds |
|
|
396
|
+
|
|
397
|
+
Pass `--network testnet` on any command, or set it once with `hood config set network
|
|
398
|
+
testnet`.
|
|
399
|
+
|
|
400
|
+
## Exit codes
|
|
401
|
+
|
|
402
|
+
| Code | Meaning |
|
|
403
|
+
| --- | --- |
|
|
404
|
+
| `0` | success |
|
|
405
|
+
| `1` | generic runtime failure |
|
|
406
|
+
| `2` | bad usage / invalid arguments |
|
|
407
|
+
| `3` | network / RPC unreachable or timed out |
|
|
408
|
+
| `4` | a guard rail refused the action (eligibility, spend cap, unconfirmed prompt) |
|
|
409
|
+
| `5` | requested resource not found (unknown symbol, missing transaction) |
|
|
410
|
+
| `6` | wallet required but not configured, or wrong password |
|
|
411
|
+
|
|
412
|
+
Every error also prints a human hint on how to fix it; add `--verbose` to see the raw
|
|
413
|
+
underlying cause, or `--json` to get `{ error, hint, exitCode }` for scripting.
|
|
414
|
+
|
|
415
|
+
## Safety notes
|
|
416
|
+
|
|
417
|
+
- **Stock Token eligibility.** Stock Tokens are tokenized securities and may not be acquired
|
|
418
|
+
by US/CA/UK/CH persons. Any write that would acquire one refuses to run unless you pass
|
|
419
|
+
`--acknowledge-eligibility`, affirming you are not a person from a restricted jurisdiction.
|
|
420
|
+
- **Confirmation gate.** `swap --execute`, `transfer`, and `deploy-token --execute` always
|
|
421
|
+
print a confirmation table and require an explicit `y` before signing, unless `--yes` is
|
|
422
|
+
passed. On a non-interactive stdin without `--yes`, the command fails closed rather than
|
|
423
|
+
hanging or silently proceeding.
|
|
424
|
+
- **Spend cap.** Set `maxSpendUsd` once (`hood config set maxSpendUsd 500`) to have every swap
|
|
425
|
+
and transfer checked against it before signing.
|
|
426
|
+
|
|
427
|
+
## Development
|
|
428
|
+
|
|
429
|
+
```bash
|
|
430
|
+
npm install
|
|
431
|
+
npm run build # tsup → dist/cli.js (single self-contained ESM file)
|
|
432
|
+
npm run typecheck
|
|
433
|
+
npm test # vitest run tests/unit — parsing, formatting, guard rails (offline)
|
|
434
|
+
npm run e2e # scripts/e2e.mjs — exercises the BUILT binary against live chain data
|
|
435
|
+
```
|
|
436
|
+
|
|
437
|
+
`npm run compile-erc20` regenerates `src/generated/erc20.ts` from `contracts/ERC20.sol`
|
|
438
|
+
(the fixed-supply token `deploy-token` deploys) — only needed if you change the contract.
|
|
439
|
+
|
|
440
|
+
### Docs site
|
|
441
|
+
|
|
442
|
+
The `docs/` folder is a static site (GitHub Pages, deploy-from-branch, no build step on
|
|
443
|
+
Pages itself) whose content is generated, never hand-written:
|
|
444
|
+
|
|
445
|
+
```bash
|
|
446
|
+
npm run capture # drives the built binary against live mainnet, saves docs/session.json
|
|
447
|
+
npm run docs:commands # generates docs/commands-data.json from the CLI's own --help output
|
|
448
|
+
npm run docs:build # stitches both into docs/index.html + docs/commands.html
|
|
449
|
+
npm run docs # runs all three in order
|
|
450
|
+
```
|
|
451
|
+
|
|
452
|
+
`docs/index.template.html` and `docs/commands.template.html` are the editable sources;
|
|
453
|
+
`docs/index.html` and `docs/commands.html` are the generated, real-data-inlined output that
|
|
454
|
+
Pages actually serves — re-run `npm run docs` after any command change to keep them in sync.
|
|
455
|
+
|
|
456
|
+
### Publishing
|
|
457
|
+
|
|
458
|
+
```bash
|
|
459
|
+
npm run build
|
|
460
|
+
npm test
|
|
461
|
+
npm pack # verify the tarball installs clean: npm i -g ./hood-cli-*.tgz
|
|
462
|
+
npm publish --access public
|
|
463
|
+
```
|
|
464
|
+
|
|
465
|
+
## License
|
|
466
|
+
|
|
467
|
+
Apache-2.0 © 2026 nirholas. See [LICENSE](./LICENSE).
|
|
468
|
+
|
|
469
|
+
---
|
|
470
|
+
|
|
471
|
+
Built by [nirholas](https://x.com/nichxbt) · [three.ws](https://three.ws)
|