Skip to content

Commit

Permalink
Merge pull request #23 from rajrohit10/patch-1
Browse files Browse the repository at this point in the history
Updating osmosis_trade.py
  • Loading branch information
ctrl-Felix authored Dec 27, 2023
2 parents f1b8dbc + b9a10e5 commit 462f2ec
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions examples/osmosis_trade.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

from mospy import Account, Transaction
from osmosis_protobuf.osmosis.gamm.v1beta1.tx_pb2 import MsgSwapExactAmountIn
import osmosis_protobuf.osmosis.gamm.v1beta1.tx_pb2 as tx_osmosis
import osmosis_protobuf.osmosis.poolmanager.v1beta1.tx_pb2 as tx_osmosis
from mospy.clients import HTTPClient

seed_phrase = ""
Expand All @@ -21,19 +21,19 @@
msg.sender = account.address

routes = [
{'pool_id': "678", 'denom': "uosmo"},
{'pool_id': '1', 'denom': 'ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2'}
{'pool_id': "678", 'token_out_denom': "uosmo"},
{'pool_id': '1', 'token_out_denom': 'ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2'}
]
for route in routes:
_route = tx_osmosis.SwapAmountInRoute()
_route.poolId = int(route["pool_id"])
_route.tokenOutDenom = route["denom"]
_route.pool_id = int(route["pool_id"])
_route.token_out_denom = route["token_out_denom"]
msg.routes.append(_route)


msg.tokenIn.denom = "uatom"
msg.tokenIn.amount = str(1)
msg.tokenOutMinAmount = str(1)
msg.token_in.denom = "uatom"
msg.token_in.amount = str(1)
msg.token_out_min_amount = str(1)

tx.add_raw_msg(msg, type_url="/osmosis.gamm.v1beta1.MsgSwapExactAmountIn")
tx.set_fee( amount=25000, denom="uosmo")
Expand Down

0 comments on commit 462f2ec

Please sign in to comment.