Apply pylint's linting rules to examples/rest/authenticated/*.py.

This commit is contained in:
Davide Casale
2023-03-08 19:39:00 +01:00
parent bd09cc4ae4
commit 88c016e1f8
6 changed files with 19 additions and 19 deletions

View File

@@ -16,4 +16,4 @@ bfx = Client(
for position in bfx.rest.auth.get_positions():
notification: Notification[PositionClaim] = bfx.rest.auth.claim_position(position.position_id)
claim: PositionClaim = notification.data
print(f"Position: {position} | PositionClaim: {claim}")
print(f"Position: {position} | PositionClaim: {claim}")

View File

@@ -19,8 +19,8 @@ wallets: List[Wallet] = bfx.rest.auth.get_wallets()
# Transfers funds (0.001 ETH) from exchange wallet to funding wallet
A: Notification[Transfer] = bfx.rest.auth.transfer_between_wallets(
from_wallet="exchange", to_wallet="funding", from_currency="ETH",
to_currency="ETH", amount=0.001)
from_wallet="exchange", to_wallet="funding", currency="ETH",
currency_to="ETH", amount=0.001)
print("Transfer:", A.data)
@@ -41,4 +41,4 @@ D: Notification[Withdrawal] = bfx.rest.auth.submit_wallet_withdrawal(
wallet="exchange", method="tetheruse", address="0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
amount=1.0)
print("Withdrawal:", D.data)
print("Withdrawal:", D.data)

View File

@@ -32,5 +32,5 @@ print("Status:", bool(derivative_position_collateral.status))
derivative_position_collateral_limits: DerivativePositionCollateralLimits = \
bfx.rest.auth.get_derivative_position_collateral_limits(symbol="tBTCF0:USTF0")
print(f"Minimum collateral: {derivative_position_collateral_limits.min_collateral} | \
Maximum collateral: {derivative_position_collateral_limits.max_collateral}")
print(f"Minimum collateral: {derivative_position_collateral_limits.min_collateral} | " \
f"Maximum collateral: {derivative_position_collateral_limits.max_collateral}")

View File

@@ -14,11 +14,11 @@ bfx = Client(
# Submit a new funding offer
notification: Notification[FundingOffer] = bfx.rest.auth.submit_funding_offer(
type=FundingOfferType.LIMIT,
symbol="fUSD",
amount=123.45,
rate=0.001,
period=2,
type=FundingOfferType.LIMIT,
symbol="fUSD",
amount=123.45,
rate=0.001,
period=2,
flags=Flag.HIDDEN
)
@@ -27,4 +27,4 @@ print("Funding Offer notification:", notification)
# Get all fUSD active funding offers
offers = bfx.rest.auth.get_funding_offers(symbol="fUSD")
print("Offers (fUSD):", offers)
print("Offers (fUSD):", offers)

View File

@@ -15,9 +15,9 @@ bfx = Client(
# Submit a new order
submit_order_notification: Notification[Order] = bfx.rest.auth.submit_order(
type=OrderType.EXCHANGE_LIMIT,
symbol="tBTCUST",
amount=0.015,
price=10000,
symbol="tBTCUST",
amount=0.015,
price=10000,
flags=Flag.HIDDEN + Flag.OCO + Flag.CLOSE
)
@@ -28,7 +28,7 @@ order: Order = submit_order_notification.data
# Update its amount and its price
update_order_notification: Notification[Order] = bfx.rest.auth.update_order(
id=order.id,
amount=0.020,
amount=0.020,
price=10150
)
@@ -39,4 +39,4 @@ cancel_order_notification: Notification[Order] = bfx.rest.auth.cancel_order(
id=order.id
)
print("Cancel order notification:", cancel_order_notification)
print("Cancel order notification:", cancel_order_notification)

View File

@@ -16,9 +16,9 @@ loans: List[FundingLoan] = bfx.rest.auth.get_funding_loans(symbol="fUSD")
# Set every loan's keep funding status to <off> (1: <on>, 2: <off>)
notification: Notification[None] = bfx.rest.auth.toggle_keep_funding(
funding_type="loan",
type="loan",
ids=[ loan.id for loan in loans ],
changes={ loan.id: 2 for loan in loans }
)
print("Toggle keep funding notification:", notification)
print("Toggle keep funding notification:", notification)