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

futuur

v2.0.0

Published

A TypeScript SDK for interacting with the Futuur API. This SDK provides a simple and type-safe way to interact with all Futuur API endpoints.

Readme

Futuur SDK

npm version

TypeScript SDK for the Futuur API (v2). Type-safe access to events, markets, orders, and wagers.

Full API reference: docs.futuur.com.

Installation

npm install futuur

Usage

Initialize

import { Futuur } from "futuur";

const sdk = new Futuur({
  publicKey: process.env.FUTUUR_PUBLIC_KEY!,
  privateKey: process.env.FUTUUR_PRIVATE_KEY!,
  timeout: 10000, // optional, default 10000ms
});

Account

const me = await sdk.me();
const ranking = await sdk.ranking();

Events

const events = await sdk.listEvents({
  currency_mode: "play_money",
  live: true,
  limit: 20,
});

const event = await sdk.getEvent(1023);
const actions = await sdk.getEventActions(1023, { my_bets: true });

const book = await sdk.getOrderBook(1023, {
  currency_mode: "play_money",
  market: 4567,
  position: "l",
});

const history = await sdk.getPriceHistory(1023, {
  currency_mode: "play_money",
  time_interval: "week",
});

const eventWagers = await sdk.getEventWagers(1023, { active: true });

Wagers

const wagers = await sdk.listWagers({ active: true, limit: 50 });
const wager = await sdk.getWager(98765);

Orders

const open = await sdk.listOrders({ status: "open", side: "bid" });

// Limit order
const limit = await sdk.createOrder({
  market: 4567,
  side: "bid",
  currency: "USDC",
  price: 0.62,
  shares: 100,
  position: "l",
});

// Market order (price = null)
const market = await sdk.createOrder({
  market: 4567,
  side: "bid",
  currency: "USDC",
  price: null,
  amount: 50,
});

await sdk.cancelOrder(10482);

API Reference

Constructor Options

| Option | Type | Required | Default | | ------------ | ------ | -------- | --------------------------- | | publicKey | string | yes | — | | privateKey | string | yes | — | | timeout | number | no | 10000 | | baseUrl | string | no | https://api.futuur.com |

Methods

| Method | Endpoint | | ----------------------------------- | ----------------------------------- | | me() | GET /me/ | | ranking() | GET /me/ranking/ | | listEvents(params?) | GET /events/ | | getEvent(id) | GET /events/{id}/ | | getEventActions(id, params?) | GET /events/{id}/actions/ | | getOrderBook(id, params) | GET /events/{id}/order_book/ | | getPriceHistory(id, params) | GET /events/{id}/price_history/ | | getEventWagers(id, params?) | GET /events/{id}/wagers/ | | listWagers(params?) | GET /wagers/ | | getWager(id) | GET /wagers/{id}/ | | listOrders(params?) | GET /orders/ | | createOrder(body) | POST /orders/ | | cancelOrder(id) | PATCH /orders/{id}/cancel/ |

Authentication

The SDK signs every request with HMAC-SHA512 using your private key. Request headers Key, Timestamp, HMAC are added automatically. Never commit your private key — load it from env vars or a secrets manager.

Error Handling

try {
  await sdk.createOrder({
    market: 4567,
    side: "bid",
    currency: "USDC",
    price: 0.62,
    shares: 100,
  });
} catch (err) {
  // axios error — inspect err.response?.data for API error code
  console.error(err);
}

Common API errors: UserNotEnoughBalance, MarketClosed, OrderBookConflictingOrders, InvalidShares.

Migration from v1

v2 is a breaking rewrite around the new resource model (events / markets / orders / wagers). Removed: marketList, marketDetail, relatedMarkets, suggestMarket, categoryList, categoryDetail, rootCategories, rootCategoriesAndMainChildren, bettingList, betDetail, getPartialAmountOnSell, currentRates, purchase, sell. Trading now goes through createOrder / cancelOrder; positions are read via listWagers / getWager.

Development

npm run build

License

MIT

Disclaimer

Unofficial SDK. Not affiliated with Futuur.