Skip to content

Commit

Permalink
add fee percentage
Browse files Browse the repository at this point in the history
  • Loading branch information
dni committed Jan 23, 2023
1 parent dd4b24d commit 75c7ca7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion boltz_client/boltz.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ def __init__(self, config: BoltzConfig):
self._cfg = config
self.limit_minimal = 0
self.limit_maximal = 0
self.fee_percentage = 0
self.set_limits()
self.mempool = MempoolClient(self._cfg.mempool_url, self._cfg.mempool_ws_url)

Expand Down Expand Up @@ -97,9 +98,12 @@ def set_limits(self) -> None:
f"{self._cfg.api_url}/getpairs",
headers={"Content-Type": "application/json"},
)
limits = data["pairs"]["BTC/BTC"]["limits"]
pair = data["pairs"]["BTC/BTC"]
limits = pair["limits"]
fees = pair["fees"]
self.limit_maximal = limits["maximal"]
self.limit_minimal = limits["minimal"]
self.fee_percentage = fees["percentage"]

def check_limits(self, amount: int) -> None:
valid = amount >= self.limit_minimal and amount <= self.limit_maximal
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "boltz_client"
version = "0.1.2"
version = "0.1.3"
description = "python boltz client"
license = "MIT"
authors = ["dni <office@dnilabs.com>"]
Expand Down

0 comments on commit 75c7ca7

Please sign in to comment.