bennycode / coinbase-pro-node

Coinbase API written in TypeScript and covered by tests.
https://bennycode.com/coinbase-pro-node
MIT License
254 stars 62 forks source link

getProducts() Returns Incomplete List of Currency Pairs #97

Closed bfailing closed 4 years ago

bfailing commented 4 years ago

At this time, https://api.pro.coinbase.com/products returns 58 currency pairs. However, the following only returns 6:

const {CoinbasePro} = require('coinbase-pro-node');
const auth = {
    apiKey: '',
    apiSecret: '',
    passphrase: '',
    useSandbox: true,
};
const client = new CoinbasePro(auth);
const response = await client.rest.product.getProducts();

Is there a way to make it return all currency pairs?

bfailing commented 4 years ago

It was because useSandbox was set to true instead of false. It may be helpful to others to update your documentation to set the default value to false and/or indicate that setting it to true returns a subset of the products as indicated in the "Sandbox" section of the Coinbase Pro API Reference.

bennycode commented 4 years ago

This is a good tip! I followed your advice and expanded the documentation: https://github.com/bennyn/coinbase-pro-node/commit/71d4bf9daf9aa361bf202a1e139060c5169a80b3