-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #242 from Davi0kProgramsThings/v3.0.2
Merge branch `Davi0kProgramsThings:v3.0.2` into branch `bitfinexcom:master`.
- Loading branch information
Showing
10 changed files
with
99 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = "3.0.1" | ||
__version__ = "3.0.2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
from .dataclasses import ( | ||
BalanceAvailable, | ||
BalanceInfo, | ||
BaseMarginInfo, | ||
Candle, | ||
CurrencyConversion, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# python -c "import examples.websocket.auth.calc" | ||
|
||
import os | ||
|
||
from bfxapi import Client | ||
from bfxapi.types import BaseMarginInfo, FundingInfo, SymbolMarginInfo | ||
|
||
bfx = Client( | ||
api_key=os.getenv("BFX_API_KEY"), | ||
api_secret=os.getenv("BFX_API_SECRET"), | ||
) | ||
|
||
|
||
@bfx.wss.on("authenticated") | ||
async def on_authenticated(_): | ||
await bfx.wss.inputs.calc("margin_base", "margin_sym_tBTCUSD", "funding_sym_fUST") | ||
|
||
|
||
@bfx.wss.on("base_margin_info") | ||
def on_base_margin_info(data: BaseMarginInfo): | ||
print("Base margin info:", data) | ||
|
||
|
||
@bfx.wss.on("symbol_margin_info") | ||
def on_symbol_margin_info(data: SymbolMarginInfo): | ||
if data.symbol == "tBTCUSD": | ||
print("Symbol margin info:", data) | ||
|
||
|
||
@bfx.wss.on("funding_info_update") | ||
def on_funding_info_update(data: FundingInfo): | ||
if data.symbol == "fUST": | ||
print("Funding info update:", data) | ||
|
||
|
||
bfx.wss.run() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters