Skip to content

Commit

Permalink
Coinbase migration to Advanced Trade (#1005)
Browse files Browse the repository at this point in the history
* Updated Coinbase: from Coinbase Pro to Advanced Trade

* updated AUTHORS.md

* finalized Coinbase updates

* flake8

* bug and typo fix

* bug fix

* bug fix

* Removed seq_no as per doc: Subscribe to the level2 channel to guarantee that messages are delivered and your order book is in sync.

* updates based on PR comments

* updated CHANGES.md based on PR comment
  • Loading branch information
thomasbs17 authored Feb 4, 2024
1 parent 0aa3930 commit df692b6
Show file tree
Hide file tree
Showing 4 changed files with 103 additions and 300 deletions.
1 change: 1 addition & 0 deletions AUTHORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ Cryptofeed was originally created by Bryant Moscon, but many others have contrib
* [O. Janche](https://github.com/toyan) - <toyan@yandex.ru>
* [Bastien Enjalbert](https://github.com/bastienjalbert) - <bastienjalbert@gmail.com>
* [Jonggyun Kim](https://github.com/gyunt) - <truth0233@gmail.com>
* [Thomas Bouamoud](https://github.com/thomasbs17) - <thomasbs17@yahoo.fr>
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
### 2.4.1
* Bugfix: Handle empty nextFundingRate in OKX
* Bugfix: Handle null next_funding_time and estimated_rate in HuobiSwap funding
* Update: transitioned from Coinbase Pro (retired) to Coinbase Advanced Trade

### 2.4.0 (2024-01-07)
* Update: Fix tests
Expand Down
6 changes: 3 additions & 3 deletions cryptofeed/exchange.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def _symbol_endpoint_prepare(cls, ep: RestEndpoint) -> Union[List[str], str]:
return ep.route('instruments')

@classmethod
def symbol_mapping(cls, refresh=False) -> Dict:
def symbol_mapping(cls, refresh=False, headers: dict = None) -> Dict:
if Symbols.populated(cls.id) and not refresh:
return Symbols.get(cls.id)[0]
try:
Expand All @@ -97,10 +97,10 @@ def symbol_mapping(cls, refresh=False) -> Dict:
if isinstance(addr, list):
for ep in addr:
LOG.debug("%s: reading symbol information from %s", cls.id, ep)
data.append(cls.http_sync.read(ep, json=True, uuid=cls.id))
data.append(cls.http_sync.read(ep, json=True, headers=headers, uuid=cls.id))
else:
LOG.debug("%s: reading symbol information from %s", cls.id, addr)
data.append(cls.http_sync.read(addr, json=True, uuid=cls.id))
data.append(cls.http_sync.read(addr, json=True, headers=headers, uuid=cls.id))

syms, info = cls._parse_symbol_data(data if len(data) > 1 else data[0])
Symbols.set(cls.id, syms, info)
Expand Down
Loading

0 comments on commit df692b6

Please sign in to comment.