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

@coldbell/decidash-ts-sdk

v1.17.1

Published

TypeScript SDK for the decidash

Readme

Decidash TS SDK

Package Install

pnpm add @coldbell/decidash-ts-sdk

Install & Build

pnpm install
pnpm build

Run Example

npx tsx example/account.ts
npx tsx example/contract.ts
npx tsx example/market.ts
npx tsx example/websocket.ts
npx tsx example/traders.ts

SDK Structure (excluding /src/contract)

  • src/config.ts: defines the DeciDashConfig interface plus ready-to-use presets (e.g., DeciDashConfig.DEVNET) and the MARKET_LIST helper. Override fetchFn or WebSocketCtor here to adapt to SSR/React Native environments.
  • src/api/index.ts: re-exports every public helper so consumers can import from the package root (import { getMarkets } from "decidash-ts-sdk").
  • src/api/utils.ts: typed get/post wrappers that honor the injected fetchFn and raise on non-OK responses.
  • src/api/types.ts: source of truth for all DTOs covering markets, orders, asset contexts, funding history, leaderboard entries, portfolio charts, plus WebSocket payloads. Keep these synced with backend schema to preserve type safety across the app.

HTTP API Clients (src/api)

  • market.ts exposes REST helpers such as getMarkets, getMarketPrices, getMarketDepth, getMarketCandlesticks, getAssetContexts, getDexRegistration, and getLeaderboard. Query strings are built via a shared utility, and legacy aliases (getMarket, getMarketPrice, getAssetContext) remain for backwards compatibility.
  • account.ts provides account-centric endpoints: getAccountOverviews, getAccountPositions, getUserOpenOrders, getOrderDetail, getUserTradeHistory, getUserFundingRateHistory, and getPortfolioChart.
  • traders.ts targets the DeciDash dashboard: getTradersDashboard, getTraders, getTraderDetail, getTraderStats, and getTraderAssetStats.

WebSocket Session (src/api/websocket.ts)

  • WSAPISession manages the lifecycle of a trading WebSocket connection. It exposes typed subscription helpers for every documented topic (market depth, individual/all market prices, market candlesticks, user open orders, order history, positions, users with positions, user/market trade history, user funding history, and account overview). Returns async iterables so you can bridge to RxJS, React hooks, or custom stream handlers.

Root Barrel (src/index.ts)

  • Aggregates config, API helpers, WebSocket tools, and types for convenient consumption. Import from here in your frontend to avoid deep relative paths.

Example Scripts (/example)

  • account.ts, market.ts, and traders.ts demonstrate the REST helpers in realistic flows (filtering, pagination, data formatting).
  • websocket.ts shows how to subscribe and gracefully tear down multiple topics in sequence.
  • contract.ts covers on-chain helpers and lives alongside the others for parity, but the SDK description above focuses on non-contract modules per this guide.

Frontend Integration Notes

  • Always pass a DeciDashConfig when calling helpers; the SDK will fall back to the preset’s fetchFn/WebSocketCtor if provided.
  • Wrap promise-returning helpers with SWR/React Query or your preferred data layer. The method signatures are uniform: { decidashConfig, ...params }.
  • Convert WebSocket async iterables into your state management system (e.g., for await loops, ReadableStream readers, or custom adapters).
  • Leverage the exported types in src/api/types.ts for component props, stores, or validation to stay aligned with the backend contract.