Coinbase rate limits impact calls for arbitrarily large number of pages
I ran into what looks like a Coinbase API rate limit issue when calling AuthenticatedClient.get_account_history, read the source, and didn't see how API rate limits were being handled in PublicClient._send_paginated_message .
Here's the Coinbase Pro API rate limits page: https://docs.pro.coinbase.com/#rate-limits
It says: "PUBLIC ENDPOINTS We throttle public endpoints by IP: 3 requests per second, up to 6 requests per second in bursts.
PRIVATE ENDPOINTS We throttle private endpoints by profile ID: 5 requests per second, up to 10 requests per second in bursts."
This patch adds a time.sleep of .2 seconds to paginated calls in the AuthenticatedClient (to meet the 5 request per second limit) and sets a default time.sleep of .34 seconds for all other paginated calls (e.g. the PublicClient).
The changes are simple and easy to read, but I only tested them for performance. I have not tested all of the paginated calls. The changes necessarily make the pulling of multiple pages of data slower.
Great consideration, but maybe we ought to pass the sleep_interval through kwargs in the functions that are paginated, so the defaults can easily be overridden by the application.