mirror of
https://github.com/aljazceru/bitfinex-api-py.git
synced 2025-12-19 06:44:22 +01:00
Rewrite all rest examples according to v3.0.0b3's changes.
This commit is contained in:
@@ -2,18 +2,18 @@
|
||||
|
||||
import os
|
||||
|
||||
from bfxapi import Client, REST_HOST
|
||||
|
||||
from bfxapi import Client
|
||||
from bfxapi.types import Notification, PositionClaim
|
||||
|
||||
bfx = Client(
|
||||
rest_host=REST_HOST,
|
||||
api_key=os.getenv("BFX_API_KEY"),
|
||||
api_secret=os.getenv("BFX_API_SECRET")
|
||||
)
|
||||
|
||||
# Claims all active positions
|
||||
for position in bfx.rest.auth.get_positions():
|
||||
notification: Notification[PositionClaim] = bfx.rest.auth.claim_position(position.position_id)
|
||||
notification: Notification[PositionClaim] = bfx.rest.auth.claim_position(
|
||||
position.position_id
|
||||
)
|
||||
claim: PositionClaim = notification.data
|
||||
print(f"Position: {position} | PositionClaim: {claim}")
|
||||
|
||||
Reference in New Issue
Block a user