diff --git a/examples/chain_client/perp/open_position.py b/examples/chain_client/perp/open_position.py index 4941293d..859775dd 100644 --- a/examples/chain_client/perp/open_position.py +++ b/examples/chain_client/perp/open_position.py @@ -25,9 +25,9 @@ def main() -> None: sender=trader.address, token_pair="unusd:unibi", side=Side.BUY, - quote_asset_amount="5", - leverage="5", - base_asset_amount_limit="5", + quote_asset_amount=1, + leverage=2, + base_asset_amount_limit=3, ) print(res) diff --git a/examples/chain_client/perp/open_position_ext.py b/examples/chain_client/perp/open_position_ext.py index de7a30e4..2342ce85 100644 --- a/examples/chain_client/perp/open_position_ext.py +++ b/examples/chain_client/perp/open_position_ext.py @@ -37,9 +37,9 @@ def main() -> None: sender=address.to_acc_bech32(), token_pair="unusd:unibi", side=Side.BUY, - quote_asset_amount="5", - leverage="5", - base_asset_amount_limit="5", + quote_asset_amount=5, + leverage=5, + base_asset_amount_limit=5, ) # build sim tx diff --git a/nibiru/network.py b/nibiru/network.py index 33f6217e..7dde80ce 100644 --- a/nibiru/network.py +++ b/nibiru/network.py @@ -21,7 +21,14 @@ def devnet(cls) -> "Network": @classmethod def testnet(cls) -> "Network": - raise NotImplementedError + return cls( + lcd_endpoint='http://ec2-54-221-169-63.compute-1.amazonaws.com:1317', + grpc_endpoint='ec2-54-221-169-63.compute-1.amazonaws.com:9090', + grpc_exchange_endpoint='ec2-54-221-169-63.compute-1.amazonaws.com:9090', + chain_id='nibiru-testnet-3', + fee_denom='unibi', + env='test', + ) @classmethod def mainnet(cls) -> "Network": @@ -35,8 +42,8 @@ def local(cls) -> "Network": grpc_exchange_endpoint='localhost:9090', chain_id='nibiru-localnet-0', fee_denom='unibi', - env='local' + env='local', ) def string(self): - return self.env \ No newline at end of file + return self.env diff --git a/nibiru/sdks/tx/dex.py b/nibiru/sdks/tx/dex.py index 47833b43..7c629d91 100644 --- a/nibiru/sdks/tx/dex.py +++ b/nibiru/sdks/tx/dex.py @@ -8,7 +8,7 @@ class Dex(Tx): - def create_pool(self, creator: str, swap_fee: str, exit_fee: str, assets: List[PoolAsset], **kwargs): + def create_pool(self, creator: str, swap_fee: float, exit_fee: float, assets: List[PoolAsset], **kwargs): msg = DexComposer.create_pool(creator=creator, swap_fee=swap_fee, exit_fee=exit_fee, assets=assets) return super().execute_msg(msg, **kwargs) diff --git a/nibiru/sdks/tx/perp.py b/nibiru/sdks/tx/perp.py index ac79c3e6..6e0da376 100644 --- a/nibiru/sdks/tx/perp.py +++ b/nibiru/sdks/tx/perp.py @@ -23,9 +23,9 @@ def open_position( sender: str, token_pair: str, side: Side, - quote_asset_amount: str, - leverage: str, - base_asset_amount_limit: str, + quote_asset_amount: float, + leverage: float, + base_asset_amount_limit: float, **kwargs, ): msg = PerpComposer.open_position( diff --git a/nibiru/utils.py b/nibiru/utils.py index 7fcdb761..db70d7b6 100644 --- a/nibiru/utils.py +++ b/nibiru/utils.py @@ -2,7 +2,7 @@ # number of decimal places PRECISION = 18 -INT_MULT = 10**6 +INT_MULT = 1e6 # reimplementation of cosmos-sdk/types/decimal.go @@ -114,7 +114,7 @@ def sdkdec_to_float(dec_str: str) -> float: def float_to_sdkint(i: float) -> str: - return i * INT_MULT + return str(i * INT_MULT) def sdkint_to_float(int_str: str) -> float: diff --git a/setup.py b/setup.py index d517e925..2e49676b 100755 --- a/setup.py +++ b/setup.py @@ -17,7 +17,7 @@ EMAIL = "dev@nibiru.fi" AUTHOR = "Nibiru Chain" REQUIRES_PYTHON = ">=3.7.0" -VERSION = "0.0.6" +VERSION = "0.0.7" REQUIRED = [ "grpcio",