-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: refactor fee calculation to support multiple denominations (#253)
- Loading branch information
Showing
5 changed files
with
46 additions
and
8 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
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,18 @@ | ||
import asyncio | ||
|
||
from dydx_v4_client.node.fee import Denom, calculate_fee | ||
|
||
|
||
async def test(): | ||
try: | ||
for denom in Denom: | ||
gas_limit, fee_amount = calculate_fee(100000, denom) | ||
print(f"Denom: {denom.name}") | ||
print(f"Gas Limit: {gas_limit}") | ||
print(f"Amount: {fee_amount} {denom.name}") | ||
print() | ||
except ValueError as e: | ||
print(f"Error: {e}") | ||
|
||
|
||
asyncio.run(test()) |
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,8 +1,11 @@ | ||
[tool.poetry] | ||
name = "dydx-v4-client" | ||
version = "1.0.1" | ||
version = "1.1.0" | ||
description = "" | ||
authors = ["Piotr Piwoński <[email protected]>"] | ||
authors = [ | ||
"Saul Martin <[email protected]>", | ||
"Piotr Piwoński <[email protected]>", | ||
] | ||
readme = "README.md" | ||
|
||
[tool.poetry.dependencies] | ||
|