Rewrite all rest examples according to v3.0.0b3's changes.

This commit is contained in:
Davide Casale
2023-10-26 17:46:38 +02:00
parent 9287723678
commit 1ec6c49428
15 changed files with 141 additions and 139 deletions

View File

@@ -2,14 +2,19 @@
from typing import List
from bfxapi import Client, PUB_REST_HOST
from bfxapi import Client
from bfxapi.types import (
FundingCurrencyBook,
FundingCurrencyRawBook,
TradingPairBook,
TradingPairRawBook,
)
from bfxapi.types import TradingPairBook, TradingPairRawBook, \
FundingCurrencyBook, FundingCurrencyRawBook
bfx = Client()
bfx = Client(rest_host=PUB_REST_HOST)
t_book: List[TradingPairBook] = bfx.rest.public.get_t_book("tBTCUSD", precision="P0", len=25)
t_book: List[TradingPairBook] = bfx.rest.public.get_t_book(
"tBTCUSD", precision="P0", len=25
)
print("25 price points of tBTCUSD order book (with precision P0):", t_book)
@@ -17,7 +22,9 @@ t_raw_book: List[TradingPairRawBook] = bfx.rest.public.get_t_raw_book("tBTCUSD")
print("tBTCUSD raw order book:", t_raw_book)
f_book: List[FundingCurrencyBook] = bfx.rest.public.get_f_book("fUSD", precision="P0", len=25)
f_book: List[FundingCurrencyBook] = bfx.rest.public.get_f_book(
"fUSD", precision="P0", len=25
)
print("25 price points of fUSD order book (with precision P0):", f_book)