All Projects → bennycode → Coinbase Pro Node

bennycode / Coinbase Pro Node

Licence: mit
Coinbase Pro API written in TypeScript and covered by tests.

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Coinbase Pro Node

Ccxt Rest
Open Source Unified REST API of 100+ Crypto Exchange Sites (18k+ docker pulls) - https://ccxt-rest.io/
Stars: ✭ 210 (+81.03%)
Mutual labels:  api, ethereum, bitcoin, cryptocurrency, trading, exchange
Python Poloniex
Poloniex API wrapper for Python 2.7 & 3
Stars: ✭ 557 (+380.17%)
Mutual labels:  api, bitcoin, cryptocurrency, trading-api, trading, exchange
Coinapi Sdk
SDKs for CoinAPI
Stars: ✭ 238 (+105.17%)
Mutual labels:  api, api-client, ethereum, bitcoin, trading-api, exchange
Ccxt
A JavaScript / Python / PHP cryptocurrency trading API with support for more than 100 bitcoin/altcoin exchanges
Stars: ✭ 22,501 (+19297.41%)
Mutual labels:  api, ethereum, bitcoin, cryptocurrency, trading, exchange
Stocklook
crypto currency library for trading & market making bots, account management, and data analysis
Stars: ✭ 119 (+2.59%)
Mutual labels:  ethereum, bitcoin, cryptocurrency, coinbase, trading
Qtbitcointrader
Secure multi crypto exchange trading client
Stars: ✭ 520 (+348.28%)
Mutual labels:  ethereum, bitcoin, cryptocurrency, trading, exchange
Ccxt.net
CCXT.NET – CryptoCurrency eXchange Trading Library for .NET
Stars: ✭ 89 (-23.28%)
Mutual labels:  api, bitcoin, cryptocurrency, trading, exchange
Cryptofeed
Cryptocurrency Exchange Websocket Data Feed Handler
Stars: ✭ 643 (+454.31%)
Mutual labels:  bitcoin, cryptocurrency, coinbase, trading, exchange
Uniswap Python
🦄 The unofficial Python client for the Uniswap exchange.
Stars: ✭ 191 (+64.66%)
Mutual labels:  api, ethereum, trading-api, trading, exchange
Cryptotrader
A cryptocurrency trader for all famous exchanges
Stars: ✭ 228 (+96.55%)
Mutual labels:  ethereum, bitcoin, cryptocurrency, trading, exchange
Coinbase Pro Node
DEPRECATED — The official Node.js library for Coinbase Pro
Stars: ✭ 782 (+574.14%)
Mutual labels:  ethereum, bitcoin, coinbase, trading-api, trading
Krypto Trading Bot
Self-hosted crypto trading bot (automated high frequency market making) written in C++
Stars: ✭ 2,589 (+2131.9%)
Mutual labels:  bitcoin, cryptocurrency, coinbase, trading, exchange
Coinbasepro Python
The unofficial Python client for the Coinbase Pro API
Stars: ✭ 1,386 (+1094.83%)
Mutual labels:  ethereum, bitcoin, coinbase, trading, exchange
Kupi Terminal
Ccxt based, open source, customized, extendable trading platform that supports 130+ crypto exchanges.
Stars: ✭ 104 (-10.34%)
Mutual labels:  bitcoin, cryptocurrency, trading-api, trading, exchange
Exchangesharp
ExchangeSharp is a powerful, fast and easy to use .NET/C# API for interfacing with many crypto currency exchanges. REST and web sockets are supported.
Stars: ✭ 489 (+321.55%)
Mutual labels:  api, ethereum, bitcoin, cryptocurrency, exchange
Wolfbot
Crypto currency trading bot written in TypeScript for NodeJS
Stars: ✭ 335 (+188.79%)
Mutual labels:  ethereum, bitcoin, cryptocurrency, trading, exchange
Algo Coin
Python library for algorithmic trading cryptocurrencies across multiple exchanges
Stars: ✭ 365 (+214.66%)
Mutual labels:  ethereum, bitcoin, cryptocurrency, coinbase, exchange
Bxbot
A simple Bitcoin trading bot written in Java.
Stars: ✭ 515 (+343.97%)
Mutual labels:  bitcoin, cryptocurrency, trading-api, trading
Kelp
Kelp is a free and open-source trading bot for the Stellar DEX and 100+ centralized exchanges
Stars: ✭ 580 (+400%)
Mutual labels:  ethereum, cryptocurrency, trading-api, trading
Cated
CATEd - Cryptocurrency Analytics and Trading Engine for Django
Stars: ✭ 84 (-27.59%)
Mutual labels:  ethereum, bitcoin, cryptocurrency, trading

Coinbase Pro API

Language Details Code Coverage License Package Version Dependency Updates

Coinbase Pro API for Node.js, written in TypeScript and covered by tests.

Motivation

The purpose of coinbase-pro-node is to continue an active Coinbase Pro API after Coinbase deprecated the official Node.js library on January, 16 2020. Its predecessor got deprecated on July, 19th 2016.

Features

  • Typed. Source code is 100% TypeScript. No need to install external typings.
  • Tested. Code coverage is 100%. No surprises when using "coinbase-pro-node".
  • Convenient. Request throttling is built-in. Don't worry about rate limiting.
  • Comfortable. More than an API client. You will get extras like candle watching.
  • Maintained. Automated security updates. No threats from outdated dependencies.
  • Documented. Get started with demo scripts and generated documentation.
  • Modern. HTTP client with Promise API. Don't lose yourself in callback hell.
  • Robust. WebSocket reconnection is built-in. No problems if your Wi-Fi is gone.

Installation

npm

npm install coinbase-pro-node

Yarn

yarn add coinbase-pro-node

Setup

JavaScript

const {CoinbasePro} = require('coinbase-pro-node');
const client = new CoinbasePro();

TypeScript

import {CoinbasePro} from 'coinbase-pro-node';
const client = new CoinbasePro();

Usage

The demo section provides many examples on how to use "coinbase-pro-node". There is also an automatically generated API documentation. For a quick start, here is a simple example for a REST request:

REST example

import {CoinbasePro} from 'coinbase-pro-node';

// API Keys can be generated here:
// https://pro.coinbase.com/profile/api
// https://public.sandbox.pro.coinbase.com/profile/api
const auth = {
  apiKey: '',
  apiSecret: '',
  passphrase: '',
  // The Sandbox is for testing only and offers a subset of the products/assets:
  // https://docs.pro.coinbase.com/#sandbox
  useSandbox: true,
};

const client = new CoinbasePro(auth);

client.rest.account.listAccounts().then(accounts => {
  const message = `You can trade "${accounts.length}" different pairs.`;
  console.log(message);
});

WebSocket example

If you want to listen to WebSocket messages, have a look at these demo scripts:

Demos

All demo scripts are executable from the root directory. If you want to use specific credentials with a demo script, simply add a .env file to the root of this package to modify environment variables used in init-client.ts.

npx ts-node ./src/demo/dump-candles.ts

Tip: There is a .env.defaults file which serves as a template. Just remove its .defaults extension and enter your credentials to get started. Do not commit this file (or your credentials) to any repository!

Web Frontend Applications

The "coinbase-pro-node" library was built to be used in Node.js environments BUT you can also make use of it in web frontend applications (using React, Vue.js, etc.). However, due to the CORS restrictions of modern web browser, you will have to use a proxy server.

A proxy server can be setup with webpack's DevServer proxy configuration or http-proxy-middleware.

Here is an example:

Backend

import {createProxyMiddleware} from 'http-proxy-middleware';
import express from 'express';

const app = express();

app.use(
  '/api-coinbase-pro',
  createProxyMiddleware({
    target: 'https://api.pro.coinbase.com',
    changeOrigin: true,
    pathRewrite: {
      [`^/api-coinbase-pro`]: '',
    },
  })
);

Later on, you can use the proxy URL (/api-coinbase-pro from above) in your web application to initialize "coinbase-pro-node" with it:

Frontend

const client = new CoinbasePro({
  httpUrl: '/api-coinbase-pro',
  apiKey: '',
  apiSecret: '',
  passphrase: '',
  useSandbox: false,
});

Real-world examples

Checkout GitHub's dependency graph to see who uses "coinbase-pro-node" in production. There are also npm packages depending on "coinbase-pro-node".

Maintainers

Benny Neugebauer on Stack Exchange

Contributing

Contributions, issues and feature requests are welcome!

Feel free to check the issues page.

The following commits will help you getting started quickly with the code base:

All resources can be found in the Coinbase Pro API reference.

License

This project is MIT licensed.

⭐️ Show your support ⭐️

Please leave a star if you find this project useful.

If you like this project, you might also like these related projects:

  • trading-signals, Technical indicators, written in TypeScript, with arbitrary-precision arithmetic.
  • ig-trading-api, REST API, written in TypeScript, for CFD trading with IG.
  • binance-api-node, Heavily tested and Promise-based Binance API with TypeScript definitions.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].