Type a real call. Get a real answer.
loading viem + registry…
This runs live in your browser — real eth_calls to Robinhood Chain's public
RPC and a real fetch to GeckoTerminal, using viem via esm.sh
(no bundler, no server, no fake data). Supports price, prices,
coins, and single-hop quote. portfolio and
swap need the full package in Node.
Quickstart
Node ≥ 20. viem is a peer dependency.
npm install hood-js viem
import hood from 'hood-js'
const { usd } = await hood.price('AAPL')
console.log(`AAPL: $${usd}`)
const top = await hood.coins({ limit: 5 })
for (const c of top) console.log(c.symbol, `$${c.priceUsd}`, `${c.change24h}%`)
const q = await hood.quote({ sell: 'USDG', buy: 'WETH', amount: 100 })
const { hash, url } = await hood.swap({ ...q, wallet: process.env.PK })
console.log('done:', url)
API reference
Every read needs nothing — no key, no wallet. Only swap does.
| Call | Returns | Wallet? |
|---|---|---|
hood.price(symbol) | live USD price for one Stock Token | no |
hood.prices([symbols]) | batched multicall, same order | no |
hood.portfolio(address) | multiplier-correct, USD-valued positions | no |
hood.coins({ limit?, window? }) | trending memecoins (launchpads + Uniswap) | no |
hood.launches({ live? }, cb?) | recent or streamed NOXA / Odyssey launches | no |
hood.quote({ sell, buy, amount }) | a swap quote — spread into swap() | no |
hood.swap({ ...quote, wallet }) | executed swap: hash, url, amounts | yes |
hood.config({ ... }) | hood (chainable) | — |
hood.testnet() / hood.mainnet() | hood (chainable) | — |
hood.config({ acknowledgeEligibility: true }),
affirming eligibility. Memecoins are never gated.
One error type, always friendly
Never a raw viem stack trace — a HoodError with a plain-language message and a stable code.
Offline validation
Bad arguments (empty symbol, negative amount, missing wallet) fail instantly with BAD_INPUT — no network round-trip.
Typed codes
UNKNOWN_SYMBOL, NO_FEED, STALE_PRICE, NO_ROUTE, NEEDS_WALLET, NEEDS_ELIGIBILITY, and more.
cause preserved
The original hoodchain/viem error rides along on err.cause for debugging — nothing is hidden, just translated.