Python SDK for interacting with the Osmosis AMM.
The osmosispy
and osmosis_proto
package allows you to interact with the Osmosis AMM using Python.
python -m pip install --upgrade pip
pip install osmosispy # requires Python 3.11.2+
example.py
#!/usr/bin/env python3
import osmosispy
mnemonic_key = "fat patch excite gold bubble large tunnel vote fine title hover junior advice cable ordinary column mass aunt trigger lucky hope animal abandon mansion"
# authorize in the mainnet
network = osmosispy.Network.mainnet()
trader = osmosispy.Sdk.authorize(key=mnemonic_key).with_network(network)
# print the address
print(trader.address)
$ python3 example.py
osmo1jggt8pcj2d8m9n62luytf8sdncj5uxfs3su2my
For more examples see the examples directory.
The publish workflow looks like this:
-
Code-gen the new types from the chain. If there are changes, these should be committed.
poetry run make proto-gen
-
Increment the package version. For example, use
poetry version preminor
to do a pre-release for a minor version.poetry version [update-keyword]
-
Create a tag and push it the remote origin.
git tag -asm "v1.2.3" v1.2.3 git push --tags
-
The tag will trigger a GitHub Action Workflow.