Merge pull request #235 from Davi0kProgramsThings/fix/refactoring

Merge branch `Davi0kProgramsThings:fix/refactoring` into branch `bitfinexcom:master`.
This commit is contained in:
Dario Moceri
2024-03-05 15:38:02 +01:00
committed by GitHub
49 changed files with 2149 additions and 1611 deletions

View File

@@ -5,10 +5,7 @@ import os
from bfxapi import Client
from bfxapi.types import Notification, PositionClaim
bfx = Client(
api_key=os.getenv("BFX_API_KEY"),
api_secret=os.getenv("BFX_API_SECRET")
)
bfx = Client(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():

View File

@@ -13,10 +13,7 @@ from bfxapi.types import (
Withdrawal,
)
bfx = Client(
api_key=os.getenv("BFX_API_KEY"),
api_secret=os.getenv("BFX_API_SECRET")
)
bfx = Client(api_key=os.getenv("BFX_API_KEY"), api_secret=os.getenv("BFX_API_SECRET"))
# Gets all user's available wallets
wallets: List[Wallet] = bfx.rest.auth.get_wallets()

View File

@@ -8,10 +8,7 @@ from bfxapi.types import (
DerivativePositionCollateralLimits,
)
bfx = Client(
api_key=os.getenv("BFX_API_KEY"),
api_secret=os.getenv("BFX_API_SECRET")
)
bfx = Client(api_key=os.getenv("BFX_API_KEY"), api_secret=os.getenv("BFX_API_SECRET"))
submit_order_notification = bfx.rest.auth.submit_order(
type="LIMIT", symbol="tBTCF0:USTF0", amount="0.015", price="16700", lev=10

View File

@@ -5,10 +5,7 @@ import os
from bfxapi import Client
from bfxapi.types import FundingOffer, Notification
bfx = Client(
api_key=os.getenv("BFX_API_KEY"),
api_secret=os.getenv("BFX_API_SECRET")
)
bfx = Client(api_key=os.getenv("BFX_API_KEY"), api_secret=os.getenv("BFX_API_SECRET"))
# Submit a new funding offer
notification: Notification[FundingOffer] = bfx.rest.auth.submit_funding_offer(

View File

@@ -5,10 +5,7 @@ import os
from bfxapi import Client
from bfxapi.types import Notification, Order
bfx = Client(
api_key=os.getenv("BFX_API_KEY"),
api_secret=os.getenv("BFX_API_SECRET")
)
bfx = Client(api_key=os.getenv("BFX_API_KEY"), api_secret=os.getenv("BFX_API_SECRET"))
# Submit a new order
submit_order_notification: Notification[Order] = bfx.rest.auth.submit_order(

View File

@@ -6,10 +6,7 @@ from typing import List
from bfxapi import Client
from bfxapi.types import FundingLoan, Notification
bfx = Client(
api_key=os.getenv("BFX_API_KEY"),
api_secret=os.getenv("BFX_API_SECRET")
)
bfx = Client(api_key=os.getenv("BFX_API_KEY"), api_secret=os.getenv("BFX_API_SECRET"))
loans: List[FundingLoan] = bfx.rest.auth.get_funding_loans(symbol="fUSD")

View File

@@ -4,10 +4,7 @@ import os
from bfxapi import Client
bfx = Client(
api_key=os.getenv("BFX_API_KEY"),
api_secret=os.getenv("BFX_API_SECRET")
)
bfx = Client(api_key=os.getenv("BFX_API_KEY"), api_secret=os.getenv("BFX_API_SECRET"))
if not bfx.rest.merchant.set_merchant_settings("bfx_pay_recommend_store", 1):
print("Cannot set <bfx_pay_recommend_store> to <1>.")

View File

@@ -5,10 +5,7 @@ import os
from bfxapi import Client
from bfxapi.types import InvoiceSubmission
bfx = Client(
api_key=os.getenv("BFX_API_KEY"),
api_secret=os.getenv("BFX_API_SECRET")
)
bfx = Client(api_key=os.getenv("BFX_API_KEY"), api_secret=os.getenv("BFX_API_SECRET"))
customer_info = {
"nationality": "DE",