Coinbase Pro API for Node.js, written in TypeScript and covered by tests.
This project was created to continue an active Coinbase Pro API after Coinbase deprecated the official Node.js library on January, 16 2020. The official predecessor was also deprecated on July, 19th 2016.
- 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.
npm
npm install coinbase-pro-node
Yarn
yarn add coinbase-pro-node
JavaScript
const {CoinbasePro} = require('coinbase-pro-node');
const client = new CoinbasePro();
TypeScript
import {CoinbasePro} from 'coinbase-pro-node';
const client = new CoinbasePro();
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 Examples
If you want to listen to WebSocket messages, have a look at these demo scripts:
Real World Examples
You can checkout GitHub's dependency graph to see who is using "coinbase-pro-node".
- Coinbase Pro API Reference
- coinbase-pro-node API docs
- coinbase-pro-node npm page
- coinbase-pro-node users
Contributions, issues and feature requests are welcome!
Feel free to check issues page.
The following commits will help you getting started quickly with the code base:
This project is MIT licensed.
Give a ⭐️ if this project helped you!