mirror of
https://github.com/aljazceru/bitfinex-api-py.git
synced 2025-12-19 14:54:21 +01:00
26 lines
613 B
Python
26 lines
613 B
Python
import os
|
|
|
|
from bfxapi.client import Client, Constants
|
|
from bfxapi.enums import FundingOfferType
|
|
from bfxapi.utils.flags import calculate_offer_flags
|
|
|
|
bfx = Client(
|
|
REST_HOST=Constants.REST_HOST,
|
|
API_KEY=os.getenv("BFX_API_KEY"),
|
|
API_SECRET=os.getenv("BFX_API_SECRET")
|
|
)
|
|
|
|
notification = bfx.rest.auth.submit_funding_offer(
|
|
type=FundingOfferType.LIMIT,
|
|
symbol="fUSD",
|
|
amount="123.45",
|
|
rate="0.001",
|
|
period=2,
|
|
flags=calculate_offer_flags(hidden=True)
|
|
)
|
|
|
|
print("Offer notification:", notification)
|
|
|
|
offers = bfx.rest.auth.get_active_funding_offers()
|
|
|
|
print("Offers:", offers) |