I'm using the Coinbase Pro official Node.js client library.
How do I access the response object after making a request using promises?
My use case: I'm calling authedClient.getFills() and want to use response.headers['cb-after'] in my next request to get the next page of data. Ultimately, I'm trying to make a function called getAllFills that would get all the pages of fills (one after the other) for a specific product ID.
You can't. To access the
responseobject, you must use the callback API.Their promise API doesn't expose the
responseobject. You can see this if you look at thePublicClient.makeRequestCallback()method in/lib/clients/public.jsof the Coinbase Pro Node.js API source code on GitHub.