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 🙏

© 2025 – Pkg Stats / Ryan Hefner

futuur

v1.0.3

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

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.

Installation

npm install futuur

Usage

Initialize the SDK

import { Futuur } from 'futuur';

const sdk = new Futuur({
  publicKey: 'your_public_key',
  privateKey: 'your_private_key',
  timeout: 10000 // optional, defaults to 10000ms
});

Markets

Get list of markets:

const markets = await sdk.marketList({
  page: 1,
  per_page: 20
});

Get specific market:

const market = await sdk.marketDetail('market_id');

Get related markets:

const relatedMarkets = await sdk.relatedMarkets('market_id');

Suggest a market:

const suggestion = await sdk.suggestMarket({
  title: 'Market Title',
  description: 'Market Description'
});

Categories

Get all categories:

const categories = await sdk.categoryList();

Get specific category:

const category = await sdk.categoryDetail('category_id');

Get root categories:

const rootCategories = await sdk.rootCategories();

Get root categories with main children:

const categoriesWithChildren = await sdk.rootCategoriesAndMainChildren();

Betting

Place a bet:

const bet = await sdk.purchase({
  outcome: 123456,
  shares: 100
});

Get betting list:

const bets = await sdk.bettingList({
  page: 1,
  per_page: 20
});

Get specific bet:

const bet = await sdk.betDetail('bet_id');

Get partial amount on sell:

const amount = await sdk.getPartialAmountOnSell('bet_id', {
  shares: 50
});

Get current rates:

const rates = await sdk.currentRates();

User Information

Get user information:

const userInfo = await sdk.me();

Error Handling

The SDK throws errors with detailed information about the failed request. It's recommended to wrap API calls in try-catch blocks:

try {
  const result = await sdk.purchase({
    outcome: 123456,
    shares: 100
  });
  console.log('Success:', result);
} catch (error) {
  console.error('Operation failed:', error);
}

API Reference

Constructor Options

| Option | Type | Required | Default | Description | |--------|------|----------|---------|-------------| | publicKey | string | Yes | - | Your Futuur API public key | | privateKey | string | Yes | - | Your Futuur API private key | | timeout | number | No | 10000 | Request timeout in milliseconds |

Available Methods

| Method | Description | |--------|-------------| | me() | Get user information | | categoryList(params?) | Get list of categories | | categoryDetail(id) | Get specific category details | | rootCategories() | Get root categories | | rootCategoriesAndMainChildren(params?) | Get root categories with main children | | marketList(params?) | Get list of markets | | marketDetail(id) | Get specific market details | | relatedMarkets(id) | Get related markets | | suggestMarket(params) | Suggest a new market | | bettingList(params) | Get list of bets | | betDetail(id) | Get specific bet details | | getPartialAmountOnSell(id, params?) | Get partial amount on sell | | currentRates() | Get current rates | | purchase(body) | Place a bet |

Authentication

The SDK automatically handles authentication using HMAC signatures. Each request is signed using your private key and includes:

  • Your public key
  • A timestamp
  • An HMAC signature

Development

Building

npm run build

License

MIT

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Support

If you encounter any issues or have questions, please file an issue on the GitHub repository.

Security

Never commit or share your private key. Always use environment variables or secure secret management systems to handle sensitive credentials.

Disclaimer

This is an unofficial SDK and is not affiliated with, maintained by, or in any way officially connected with Futuur.