coinbase / coinbase-pro-node

DEPRECATED — The official Node.js library for Coinbase Pro
Apache License 2.0
844 stars 316 forks source link

TypeScript getProductTrades with options fails #306

Closed wilwade closed 6 years ago

wilwade commented 6 years ago

TypeScript 2.8.1

const opts = { before: 1599086, after: 1599088, limit: 10 };
const trades = await publicClient.getProductTrades('BTC-USD', opts);

Results in a ts error:

TS2345: Argument of type '{ before: number; after: number; limit: number; }' is not assignable to parameter of type 'callback<any>'.
  Type '{ before: number; after: number; limit: number; }' provides no match for the signature '(err: any, response: Response, data: any): void'.

It appears that ts is matching the first def instead of the second here: https://github.com/coinbase/gdax-node/blob/master/index.d.ts#L165

Perhaps it is the newer version of TypeScript, but I'll throw up a small pr with one fix for it.

fb55 commented 6 years ago

Fixed in #307