npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@oko-agent/sdk

v0.1.0

Published

TypeScript SDK for the OKO protocol API — market data, AI chat, wallet analysis, and trading

Downloads

11

Readme

@oko-agent/sdk

TypeScript SDK for the OKO protocol — market data, live tickers, AI chat, wallet analysis, and trading management.

Installation

npm install @oko-agent/sdk
# or
yarn add @oko-agent/sdk

Quick Start

import { OkoClient } from '@oko-agent/sdk'

const client = new OkoClient({ baseUrl: 'https://api.oko-agent.io' })

// Live price stream
const { unsubscribe } = client.ticker.subscribe((update) => {
  console.log(update.symbol, update.price, update.changePercent)
})

// Market data
const coins = await client.market.getCoins()
console.log(coins[0].name, coins[0].price)

// AI chat
const res = await client.chat.send("What's the latest crypto news?")
console.log(res.message)

// Wallet analysis (streaming)
await client.wallet.analyze('0x123...', (chunk) => process.stdout.write(chunk))

API Reference

new OkoClient(config)

| Option | Type | Description | |--------|------|-------------| | baseUrl | string | OKO backend URL (required) | | apiKey | string | JWT for authenticated endpoints (optional) | | timeout | number | Request timeout in ms (default: 10000) |

client.ticker

| Method | Description | |--------|-------------| | subscribe(callback, options?) | Subscribe to live price updates (SSE). Returns { unsubscribe } | | stream() | Async generator yielding TickerUpdate values |

client.market

| Method | Returns | Description | |--------|---------|-------------| | getGlobal() | GlobalMarketData | Market cap, volume, Fear & Greed | | getCoins() | CoinRow[] | Top 20 by market cap | | getTrending() | TrendingCoin[] | Trending coins | | getGainers() | TopGainer[] | Top 24h gainers | | getChart() | ChartDataPoint[] | 7-day market cap + BTC price |

client.wallet

| Method | Description | |--------|-------------| | getBalances(address) | Token balances for an EVM or Solana wallet | | analyze(address, onChunk, options?) | Stream AI wallet analysis | | chat(address, payload) | Follow-up chat in wallet analysis context |

client.chat

| Method | Description | |--------|-------------| | send(message, history?) | General AI crypto chat |

client.auth (requires account)

| Method | Description | |--------|-------------| | register({ email, password }) | Create account, returns OTP setup details | | completeRegistration({ user_id, otp_code }) | Verify first OTP, returns JWT | | login({ email, password }) | Login, may require OTP | | verifyOTP({ user_id, otp_code }) | Verify OTP after login, returns JWT | | logout() | Blacklist current JWT |

client.traders (requires JWT)

| Method | Description | |--------|-------------| | list() | List all your traders | | create(payload) | Create a new trader | | start(id) / stop(id) | Start or stop a trader | | status(traderId) | Live status + position | | statistics(traderId) | Trading statistics |

client.strategies (requires JWT)

| Method | Description | |--------|-------------| | list() | List strategies | | create(payload) | Create strategy | | activate(id) | Set as active strategy | | previewPrompt(config) | Preview AI prompt for a config |

Examples

# Stream live tickers
OKO_BASE_URL=https://api.oko-agent.io npx tsx examples/stream-tickers.ts

# Market overview
OKO_BASE_URL=https://api.oko-agent.io npx tsx examples/market-data.ts

# Analyze a wallet
OKO_BASE_URL=https://api.oko-agent.io WALLET=0x123... npx tsx examples/wallet-analyze.ts

# Interactive AI chat
OKO_BASE_URL=https://api.oko-agent.io npx tsx examples/chat.ts

License

MIT