mirror of
https://github.com/aljazceru/bitfinex-api-py.git
synced 2025-12-19 06:44:22 +01:00
add endpoints, minor fixs, use format instead of str
Co-authored-by: itsdeka <dario.moceri@bitfinex.com>
This commit is contained in:
19
examples/rest/claim_position.py
Normal file
19
examples/rest/claim_position.py
Normal file
@@ -0,0 +1,19 @@
|
||||
# python -c "from examples.rest.claim_position import *"
|
||||
|
||||
import os
|
||||
|
||||
from bfxapi.client import Client, Constants
|
||||
|
||||
bfx = Client(
|
||||
REST_HOST=Constants.REST_HOST,
|
||||
API_KEY=os.getenv("BFX_API_KEY"),
|
||||
API_SECRET=os.getenv("BFX_API_SECRET")
|
||||
)
|
||||
|
||||
open_margin_positions = bfx.rest.auth.get_positions()
|
||||
|
||||
# claim all positions
|
||||
for position in open_margin_positions:
|
||||
print(f"Position {position}")
|
||||
claim = bfx.rest.auth.claim_position(position.POSITION_ID, amount=0.000001)
|
||||
print(f"Claim {claim.NOTIFY_INFO}")
|
||||
@@ -1,3 +1,5 @@
|
||||
# python -c "from examples.rest.create_funding_offer import *"
|
||||
|
||||
import os
|
||||
|
||||
from bfxapi.client import Client, Constants
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# python -c "from examples.rest.create_order import *"
|
||||
|
||||
import os
|
||||
|
||||
from bfxapi.client import Client, Constants
|
||||
|
||||
Reference in New Issue
Block a user