Skip to content

Commit

Permalink
update fee denom, url, use dydx testnet network config in posting txns (
Browse files Browse the repository at this point in the history
  • Loading branch information
dydxwill committed Oct 20, 2023
1 parent eb78924 commit cdef96c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion v4-client-py/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package-dir = {"" = "v4_client_py"}

[tool.poetry]
name = "v4-client-py"
version = "0.6.9"
version = "0.7.0"
description = "dYdX v4 Client"
authors = ["John Huang <[email protected]>"]
license = "BSL-1.1"
Expand Down
5 changes: 3 additions & 2 deletions v4-client-py/v4_client_py/chain/aerial/client/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def prepare_and_broadcast_basic_transaction(
gas_limit: Optional[int] = None,
memo: Optional[str] = None,
broadcast_mode: BroadcastMode = None,
fee: int = 5000,
fee: Optional[int] = None,
) -> SubmittedTx:
"""Prepare and broadcast basic transaction.
Expand All @@ -36,7 +36,8 @@ def prepare_and_broadcast_basic_transaction(
# query the account information for the sender
if account is None:
account = client.query_account(sender.address())

if fee is None:
fee = client.network_config.fee_minimum_gas_price
if gas_limit is None:

# we need to build up a representative transaction so that we can accurately simulate it
Expand Down
8 changes: 4 additions & 4 deletions v4-client-py/v4_client_py/chain/aerial/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ def fetch_dydx_testnet(cls) -> "NetworkConfig":
:return: Network configuration
"""
return NetworkConfig(
chain_id="dydx",
url="grpc+https://v4.testnet.dydx.exchange",
fee_minimum_gas_price=5000000000,
fee_denomination="dv4tnt",
chain_id="dydx-testnet-4",
url="grpc+https://dydx-testnet-archive.allthatnode.com:9090",
fee_minimum_gas_price=4630550000000000,
fee_denomination="adv4tnt",
staking_denomination="dv4tnt",
faucet_url="http://faucet.v4testnet.dydx.exchange",
)
Expand Down
5 changes: 2 additions & 3 deletions v4-client-py/v4_client_py/clients/modules/post.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ def send_message(
'''

wallet = subaccount.wallet
url = ('grpc+https://' if self.config.ssl_enabled else 'grpc+http://') + self.config.grpc_endpoint
network = NetworkConfig(self.config.chain_id, 0, None, None, url, None)
network = NetworkConfig.fetch_dydx_testnet()
ledger = LedgerClient(network)
tx = Transaction()
tx.add_message(msg)
Expand All @@ -57,7 +56,7 @@ def send_message(
gas_limit=gas_limit,
memo=None,
broadcast_mode=broadcast_mode if (broadcast_mode != None) else self.default_broadcast_mode(msg),
fee=0 if zeroFee else 5000,
fee=0 if zeroFee else None,
)

def place_order(
Expand Down

0 comments on commit cdef96c

Please sign in to comment.