mirror of
https://github.com/aljazceru/bitfinex-api-py.git
synced 2025-12-19 06:44:22 +01:00
@@ -188,6 +188,11 @@ class _RestAuthenticatedEndpoints(_Requests):
|
|||||||
|
|
||||||
return [ serializers.FundingCredit.parse(*sub_data) for sub_data in self._POST(endpoint, data=data) ]
|
return [ serializers.FundingCredit.parse(*sub_data) for sub_data in self._POST(endpoint, data=data) ]
|
||||||
|
|
||||||
|
def get_funding_info(self, key: str) -> FundingInfo:
|
||||||
|
response = self._POST(f"auth/r/info/funding/{key}")
|
||||||
|
|
||||||
|
return serializers.FundingInfo.parse(*([response[1]] + response[2]))
|
||||||
|
|
||||||
def submit_funding_close(self, id: int) -> Notification[Literal[None]]:
|
def submit_funding_close(self, id: int) -> Notification[Literal[None]]:
|
||||||
return serializers._Notification[Literal[None]](serializer=None).parse(
|
return serializers._Notification[Literal[None]](serializer=None).parse(
|
||||||
*self._POST("auth/w/funding/close", data={ "id": id })
|
*self._POST("auth/w/funding/close", data={ "id": id })
|
||||||
|
|||||||
@@ -438,6 +438,14 @@ FundingAutoRenew = generate_labeler_serializer("FundingAutoRenew", klass=types.F
|
|||||||
"threshold"
|
"threshold"
|
||||||
])
|
])
|
||||||
|
|
||||||
|
FundingInfo = generate_labeler_serializer("FundingInfo", klass=types.FundingInfo, labels=[
|
||||||
|
"symbol",
|
||||||
|
"yield_loan",
|
||||||
|
"yield_lend",
|
||||||
|
"duration_loan",
|
||||||
|
"duration_lend"
|
||||||
|
])
|
||||||
|
|
||||||
Transfer = generate_labeler_serializer("Transfer", klass=types.Transfer, labels=[
|
Transfer = generate_labeler_serializer("Transfer", klass=types.Transfer, labels=[
|
||||||
"mts",
|
"mts",
|
||||||
"wallet_from",
|
"wallet_from",
|
||||||
|
|||||||
@@ -354,6 +354,14 @@ class FundingAutoRenew(_Type):
|
|||||||
rate: float
|
rate: float
|
||||||
threshold: float
|
threshold: float
|
||||||
|
|
||||||
|
@dataclass()
|
||||||
|
class FundingInfo(_Type):
|
||||||
|
symbol: str
|
||||||
|
yield_loan: float
|
||||||
|
yield_lend: float
|
||||||
|
duration_loan: float
|
||||||
|
duration_lend: float
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class Transfer(_Type):
|
class Transfer(_Type):
|
||||||
mts: int
|
mts: int
|
||||||
|
|||||||
13
examples/rest/get_funding_info.py
Normal file
13
examples/rest/get_funding_info.py
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
# python -c "import examples.rest.get_funding_info"
|
||||||
|
|
||||||
|
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")
|
||||||
|
)
|
||||||
|
|
||||||
|
print(bfx.rest.auth.get_funding_info(key="fUSD"))
|
||||||
Reference in New Issue
Block a user