mirror of
https://github.com/aljazceru/bitfinex-api-py.git
synced 2026-02-08 15:24:21 +01:00
return taken funding
This commit is contained in:
22
examples/rest/return_taken_funding.py
Normal file
22
examples/rest/return_taken_funding.py
Normal file
@@ -0,0 +1,22 @@
|
||||
# python -c "import examples.rest.return_taken_funding"
|
||||
|
||||
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")
|
||||
)
|
||||
|
||||
loans = bfx.rest.auth.get_funding_loans(symbol="fUSD")
|
||||
|
||||
for loan in loans:
|
||||
print(f"Loan {loan}")
|
||||
|
||||
notification = bfx.rest.auth.submit_funding_close(
|
||||
id=loan.id
|
||||
)
|
||||
|
||||
print("Funding close notification:", notification)
|
||||
Reference in New Issue
Block a user