New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

gemini-api

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gemini-api

Node.js client for the Gemini cryptocurrency exchange API.

  • 1.0.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
82
decreased by-66.26%
Maintainers
1
Weekly downloads
 
Created
Source

gemini-api

Gemini cryptocurrency exchange API wrapper for Node.js

Installation

yarn add gemini-api

Usage

Clients for both the REST API and streaming WebSocket API are included. Private endpoints as indicated in the API docs require authentication with an API key and secret key.

Example usage:

import GeminiAPI from 'gemini-api';

const restClient = new GeminiAPI({ key, secret, sandbox: false });
const websocketClient =
  new GeminiAPI.WebsocketClient({ key, secret, sandbox: false });

restClient.getOrderBook('btcusd', { limit_asks: 10, limit_bids: 10 })
  .then(console.log)
  .catch(console.error);

websocketClient.openMarketSocket('btcusd', () => {
  websocketClient.addMarketMessageListener(data =>
    doSomethingCool(data)
  );
});

// The methods are bound properly, so feel free to destructure them:
const { getTicker } = restClient;
getTicker('btcusd')
  .then(data =>
    console.log(`Last trade: $${data.last} / BTC`)
  )

API

REST

All methods return promises.

  • getAllSymbols()
  • getTicker(symbol)
  • getOrderBook(symbol, params = {})
  • getTradeHistory(symbol, params = {})
  • getCurrentAuction(symbol)
  • getAuctionHistory(symbol, params = {})
  • newOrder(params = {})
  • cancelOrder({ order_id })
  • cancelAllSessionOrders()
  • cancelAllActiveOrders()
  • getMyOrderStatus({ order_id })
  • getMyActiveOrders()
  • getMyPastTrades(params = {})
  • getMyTradeVolume()
  • getMyAvailableBalances()

WebSocket

  • openMarketSocket(symbol, onOpen)
  • openOrderSocket(onOpen)
  • addMarketMessageListener(listener)
  • addOrderMessageListener(listener)
  • removeMarketMessageListener(listener)
  • removeOrderMessageListener(listener)
  • addMarketListener(event, listener)
  • addOrderListener(event, listener)
  • removeMarketListener(event, listener)
  • removeOrderListener(event, listener)

To Do

  • Improved documentation
  • More robust error handling

Feedback and pull requests welcome!

FAQs

Package last updated on 12 Apr 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc