gitstock
v0.1.0
Published
Typed client for gitstock.io — the onchain reference for Robinhood Chain stock tokens. Canonical addresses, guarded live prices, field notes. No key, no auth.
Downloads
127
Maintainers
Readme
gitstock
Typed client for gitstock.io — the onchain reference for Robinhood Chain (4663) stock tokens. Canonical addresses, guarded live prices, field notes. Zero dependencies, no key, no auth, CORS open.
npm i gitstockimport { getStock, getRegistry, isStale, FEED_ABI, ADDRESSES } from "gitstock";
const nvda = await getStock("NVDA");
nvda.price.usd // live price (already stock × uiMultiplier — do NOT multiply again)
nvda.feed.proxy // the canonical Chainlink proxy to read on-chain
nvda.fieldNotes // the quirks that break integrations
nvda.dependents // tokens paired against NVDA (with community scam flags)
const { tokens } = await getRegistry(); // all 100+ tokens, factory-verified addressesReading on-chain yourself (ethers / viem)
The API gives you the resolved feed.proxy; pair it with FEED_ABI and guard with isStale:
import { ethers } from "ethers";
import { getStock, FEED_ABI, isStale } from "gitstock";
const { feed } = await getStock("NVDA");
const c = new ethers.Contract(feed.proxy, FEED_ABI, provider);
const [, answer, , updatedAt] = await c.latestRoundData();
const price = Number(ethers.formatUnits(answer, await c.decimals()));
if (isStale(updatedAt)) throw new Error("stale price");The quirks (why this exists)
- The stock token stores no price and no feed pointer on-chain — the token→feed mapping exists nowhere else.
- Never resolve by symbol — impostor tokens exist. Verify against
ADDRESSES.factoryTokenCreated events. - Do not gate on the L2 sequencer feed — it's hardwired "down" on this chain; the standard Chainlink pattern
will never render a price. Use
isStale()(24h heartbeat) as the real guard. - Prices track total return (dividends reinvest via
uiMultiplier()), so they drift above headline quotes.
Full field notes: https://gitstock.io/docs · Machine spec: https://gitstock.io/llms.txt
API surface
getStock(sym) · getRegistry() · getHistory(sym) · getDependents() · getPrices() · getStatus()
Constants: CHAIN_ID, ADDRESSES, FEED_ABI, STOCK_ABI, FEED_HEARTBEAT_SECONDS · Helper: isStale()
MIT © Bal (adrizenin)
