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

gemini-crypto-ts-sdk

v1.0.6

Published

TypeScript SDK wrapper for Gemini Crypto Exchange API

Readme

🚀 Gemini Crypto TypeScript SDK

A TypeScript SDK for interacting with the Gemini Cryptocurrency Exchange API. This SDK provides a simple interface for both REST and WebSocket APIs.

Features

  • 🔒 Secure authentication handling
  • 🔄 Real-time WebSocket data streams
  • 💪 Strongly typed responses
  • 🎮 Sandbox environment support

Installation

npm install gemini-crypto-ts-sdk

Quick Start

import { Gemini } from 'gemini-crypto-ts-sdk';

// Initialize the client
const gemini = new Gemini({
    apiKey: 'your-api-key',
    apiSecret: 'your-api-secret',
    mode: 'sandbox' // or 'live'
});

// REST API Examples

// Get ticker info
const ticker = await gemini.api.getTicker('btcusd');

// Place a new order
const order = await gemini.api.newOrder({
    symbol: 'btcusd',
    amount: '100',
    price: '125000',
    side: 'buy',
    type: 'exchange limit',
    options: ["immediate-or-cancel"]
});

// Get account balances
const balances = await gemini.api.getBalances();


// WebSocket Example - Market Data
gemini.socket({
    endpoint: "/v2/marketdata/BTCUSD",
    messageHandler: (data) => {
        const message = JSON.parse(data.toString());
        console.log('Market Data Update:', message);
    },
    subscriptions: [
        {
            type: "subscribe",
            subscriptions: [{ name: "candles_1m", symbols: ["BTCUSD"] }],
        },
    ],
});

// WebSocket Example - Order Events
gemini.socket({
    endpoint: "/v1/order/events",
    messageHandler: (data) => {
        const message = JSON.parse(data.toString());
        console.log('Order Event:', message);
    },
});

Documentation

REST API

This SDK provides a wrapper for endpoints documented in the Gemini REST API Documentation. It is not exhaustive, PRs are welcome.

Key features include:

  • Market Data Order Management
  • Account Management
  • Trading
  • Settlement

WebSocket API

Real-time data streaming is available as documented in the Gemini WebSocket API Documentation.

Supported streams:

  • Market Data
  • Order Events
  • Candles
  • Trading

Environment

The SDK supports both production and sandbox environments:

// Sandbox Environment
const sandboxClient = new Gemini({
    apiKey: 'sandbox-key',
    apiSecret: 'sandbox-secret',
    mode: 'sandbox'
});

// Production Environment
const productionClient = new Gemini({
    apiKey: 'live-key',
    apiSecret: 'live-secret',
    mode: 'live'
});

‼️ Note: The Gemini Sandbox environment seems to be unstable and unreliable at the moment.

Error Handling

The SDK provides detailed error information through the GeminiAPIError class:

try {
    await gemini.api.newOrder(/* ... */);
} catch (error) {
    if (error instanceof GeminiAPIError) {
        console.error('API Error:', error.message);
        console.error('Error Code:', error.code);
    }
}

Contributing

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

License

MIT

Changelog

See CHANGELOG.md for release history.