Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
ee19f3f
(feat) Add pytest-grpc plugin to mock grpc iteractions
May 22, 2023
0652401
(feat) Refactor Composer to use actual markets and tokens to translat…
May 25, 2023
dd7f18e
(fix) Remove deprecation warning from Denom class since it is still b…
May 26, 2023
78b990f
(fix) Undoing rename changes that impacted proto autogenreated compon…
May 29, 2023
68972ac
(fix) Solved issue preventing executing historical orders request bot…
May 26, 2023
2dad929
(fix) Add bugfix description in the changelog in README file
May 26, 2023
2e0de16
(feat) Refactor Composer to use actual markets and tokens to translat…
May 25, 2023
d9b516a
Merge branch 'dev' into feat/refactor_markets_and_tokens
aarmoa May 29, 2023
44f5c40
(fix) Turned market classes and token class into dataclass with eq an…
May 29, 2023
6fc81f4
(fix) Undoing impact of rename of Market to SpotMarket in grpc autoge…
May 29, 2023
05f6d91
(feat) Included logic to validate INI files metadata against indexer …
May 29, 2023
79c722e
(fix) Fixed INI files to synchronize them with the information for th…
May 29, 2023
541b01a
(fix) Updated examples and the `run-examples.sh` script to enable the…
May 30, 2023
6e837a8
(fix) Remove pysha3 requirement from Pipfile.lock since it is not req…
May 30, 2023
747ff34
(feat) Add pytest-grpc plugin to mock grpc iteractions
May 22, 2023
1b52ba4
(feat) Refactor Composer to use actual markets and tokens to translat…
May 25, 2023
b2192c1
(fix) Remove deprecation warning from Denom class since it is still b…
May 26, 2023
8fa18c1
(feat) Refactor Composer to use actual markets and tokens to translat…
May 25, 2023
b5ccef2
(fix) Turned market classes and token class into dataclass with eq an…
May 29, 2023
0c5683e
(feat) Included logic to validate INI files metadata against indexer …
May 29, 2023
ce896be
(fix) Fixed INI files to synchronize them with the information for th…
May 29, 2023
2d16214
(fix) Updated examples and the `run-examples.sh` script to enable the…
May 30, 2023
115affd
(fix) Regenerated Pipfile.lock after synchronizing the branch with th…
Jun 6, 2023
855a48e
Merge branch 'feat/refactor_markets_and_tokens' of https://github.com…
Jun 6, 2023
3951c1a
(fix) Included __init__.py in the tests folder to make it a python mo…
Jun 6, 2023
6dedca5
(fix) Added extra logic to allow the tokens initialization to accept …
Jun 15, 2023
308b5fc
Merge pull request #220 from InjectiveLabs/fix/rebase_dev_after_0_7_r…
aarmoa Jul 12, 2023
86484cb
Merge branch 'dev' of https://github.com/InjectiveLabs/sdk-python int…
Jul 12, 2023
485a27b
Merge pull request #205 from InjectiveLabs/feat/refactor_markets_and_…
aarmoa Jul 12, 2023
d67b6b8
Merge branch 'master' of https://github.com/InjectiveLabs/sdk-python …
Aug 23, 2023
8abeb38
(feat) Added a component to calculate gas limit for the Transaction B…
Aug 18, 2023
41be560
(fix) Change version number and update README file
Aug 18, 2023
34d1d74
(fix) Changes to gas limit estimation to reduce a little bit gas cons…
Aug 18, 2023
222b721
(fix) Undo change in the example to get a transaction by hash
Aug 18, 2023
d53eca6
(feat) Improved the logic in the gas limit estimator component to con…
Aug 22, 2023
3ecfb4d
(fix) Updated library version number and README file
Aug 22, 2023
f871090
(feat) Created the cookies admin for load balanced mainnet and testne…
Aug 23, 2023
e3b4dff
(feat) Applied the new cookies assistant in the AsyncClient
Aug 23, 2023
f2d9e85
Merge pull request #229 from InjectiveLabs/feat/refactor_cookies_mana…
aarmoa Aug 24, 2023
b983b00
add WithdrawValidatorCommission to composer.py
Jackson-DKMG Aug 29, 2023
e6461c6
Create 48_WithdrawValidatorCommission_Rewards
Jackson-DKMG Aug 29, 2023
3a63cb1
(fix) Made cookie_assistant parameter optional when creating a custom…
Aug 30, 2023
9918722
(fix) Updated README.md Changelogs with the latest changes
Aug 30, 2023
1dfae88
Merge pull request #235 from InjectiveLabs/fix/cookie_assistant_for_c…
aarmoa Aug 30, 2023
ca0a5f6
Merge pull request #234 from HighStakesSwitzerland/dev
aarmoa Aug 30, 2023
36e16d6
(fix) Solved issue in the composer logic to unpack messages from a tr…
Aug 30, 2023
e755da3
Merge pull request #236 from InjectiveLabs/fix/unpack_transaction_mes…
aarmoa Aug 30, 2023
0ad254c
(feat) Deprecated testnet k8s nodes and replaced them with the bare-m…
Sep 1, 2023
5070bce
Merge pull request #237 from InjectiveLabs/feat/testnet_k8s_deprecation
aarmoa Sep 1, 2023
3f2ae5d
Merge branch 'master' of https://github.com/InjectiveLabs/sdk-python …
Sep 1, 2023
d481da4
Merge pull request #238 from InjectiveLabs/fix/rebase_dev_from_master
aarmoa Sep 1, 2023
bc266da
(feat) Made lb bare-metal node the default for mainnet. Fixed an issu…
Sep 6, 2023
c644349
Merge pull request #239 from InjectiveLabs/feat/make_bare_metal_lb_de…
aarmoa Sep 6, 2023
c8d68eb
(fix) Fixed error in the changelog inside the README file
Sep 6, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ copy-proto:
done

tests:
pytest -v tests/**
pytest -v

.PHONY: all gen gen-client copy-proto tests
1 change: 1 addition & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ websockets = "*"
[dev-packages]
pytest = "*"
pytest-asyncio = "*"
pytest-grpc = "*"
requests-mock = "*"

[requires]
Expand Down
1,507 changes: 757 additions & 750 deletions Pipfile.lock

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,23 @@ make tests
```

### Changelogs
**0.8.1**
* Moved the configuration to use a secure or insecure connection inside the Network class. The AsyncClient's `insecure` parameter is no longer used for anything and will be removed in the future.
* Made the new load balanced bare-metal node the default one for mainnet (it is called `lb`). The legacy one (load balanced k8s node) is called `lb_k8s`

**0.8**
* Refactor Composer to be created with all the markets and tokens. The Composer now uses the real markets and tokens to convert human-readable values to chain format
* The Composer can still be instantiated without markets and tokens. When markets and tokens are not provided the Composer loads the required information from the Denoms used in previous versions
* Change in AsyncClient to be able to create Composer instances for the client network, markets and tokens
* Examples have been adapted to create Composer instances using the AsyncClient
* Added new nodes (bare-metal load balancing nodes) for mainnet and testnet
* Deprecated the kubernetes load balanced nodes for testnet
* Refactored the cookies management logic into a cookie assistant. Added the required logic to support the new cookies format for bare-metal load balanced nodes
* Removed class Client. The only supported now is the async version called AsyncClient.

**0.7.1.1**
* Fixed Testnet network URLs

**0.7.2.1**
* Synchronization of denoms configuration files.

Expand Down
2 changes: 1 addition & 1 deletion examples/SendToInjective.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import asyncio
import logging

from pyinjective.constant import Network
from pyinjective.core.network import Network
from pyinjective.sendtocosmos import Peggo

import importlib.resources as pkg_resources
Expand Down
9 changes: 4 additions & 5 deletions examples/chain_client/0_LocalOrderHash.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
import asyncio
import logging

from pyinjective.composer import Composer as ProtoMsgComposer
from pyinjective.async_client import AsyncClient
from pyinjective.composer import Composer
from pyinjective.transaction import Transaction
from pyinjective.constant import Network
from pyinjective.core.network import Network
from pyinjective.wallet import PrivateKey
from pyinjective.orderhash import OrderHashManager

async def main() -> None:
# select network: local, testnet, mainnet
network = Network.testnet()
composer = ProtoMsgComposer(network=network.string())

# initialize grpc client
client = AsyncClient(network, insecure=False)
client = AsyncClient(network)
composer = await client.composer()
await client.sync_timeout_height()

# load account
Expand Down
8 changes: 3 additions & 5 deletions examples/chain_client/13_MsgIncreasePositionMargin.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
import asyncio
import logging

from pyinjective.composer import Composer as ProtoMsgComposer
from pyinjective.async_client import AsyncClient
from pyinjective.transaction import Transaction
from pyinjective.constant import Network
from pyinjective.core.network import Network
from pyinjective.wallet import PrivateKey


async def main() -> None:
# select network: local, testnet, mainnet
network = Network.testnet()
composer = ProtoMsgComposer(network=network.string())

# initialize grpc client
client = AsyncClient(network, insecure=False)
client = AsyncClient(network)
composer = await client.composer()
await client.sync_timeout_height()

# load account
Expand Down
8 changes: 3 additions & 5 deletions examples/chain_client/15_MsgWithdraw.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,20 @@
# limitations under the License.

import asyncio
import logging

from pyinjective.composer import Composer as ProtoMsgComposer
from pyinjective.async_client import AsyncClient
from pyinjective.transaction import Transaction
from pyinjective.constant import Network
from pyinjective.core.network import Network
from pyinjective.wallet import PrivateKey


async def main() -> None:
# select network: local, testnet, mainnet
network = Network.testnet()
composer = ProtoMsgComposer(network=network.string())

# initialize grpc client
client = AsyncClient(network, insecure=False)
client = AsyncClient(network)
composer = await client.composer()
await client.sync_timeout_height()

# load account
Expand Down
8 changes: 3 additions & 5 deletions examples/chain_client/16_MsgSubaccountTransfer.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
import asyncio
import logging

from pyinjective.composer import Composer as ProtoMsgComposer
from pyinjective.async_client import AsyncClient
from pyinjective.transaction import Transaction
from pyinjective.constant import Network
from pyinjective.core.network import Network
from pyinjective.wallet import PrivateKey


async def main() -> None:
# select network: local, testnet, mainnet
network = Network.testnet()
composer = ProtoMsgComposer(network=network.string())

# initialize grpc client
client = AsyncClient(network, insecure=False)
client = AsyncClient(network)
composer = await client.composer()
await client.sync_timeout_height()

# load account
Expand Down
10 changes: 4 additions & 6 deletions examples/chain_client/17_MsgBatchUpdateOrders.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
import asyncio
import logging

from pyinjective.composer import Composer as ProtoMsgComposer
from pyinjective.async_client import AsyncClient
from pyinjective.transaction import Transaction
from pyinjective.constant import Network
from pyinjective.core.network import Network
from pyinjective.wallet import PrivateKey


async def main() -> None:
# select network: local, testnet, mainnet
network = Network.testnet()
composer = ProtoMsgComposer(network=network.string())

# initialize grpc client
client = AsyncClient(network, insecure=False)
client = AsyncClient(network)
composer = await client.composer()
await client.sync_timeout_height()

# load account
Expand Down Expand Up @@ -132,7 +130,7 @@ async def main() -> None:
print(sim_res)
return

sim_res_msg = ProtoMsgComposer.MsgResponses(sim_res, simulation=True)
sim_res_msg = composer.MsgResponses(sim_res, simulation=True)
print("---Simulation Response---")
print(sim_res_msg)

Expand Down
8 changes: 3 additions & 5 deletions examples/chain_client/18_MsgBid.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
import asyncio
import logging

from pyinjective.composer import Composer as ProtoMsgComposer
from pyinjective.async_client import AsyncClient
from pyinjective.transaction import Transaction
from pyinjective.constant import Network
from pyinjective.core.network import Network
from pyinjective.wallet import PrivateKey

async def main() -> None:
# select network: local, testnet, mainnet
network = Network.testnet()
composer = ProtoMsgComposer(network=network.string())

# initialize grpc client
client = AsyncClient(network, insecure=False)
client = AsyncClient(network)
composer = await client.composer()
await client.sync_timeout_height()

# load account
Expand Down
8 changes: 3 additions & 5 deletions examples/chain_client/19_MsgGrant.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
import asyncio
import logging

from pyinjective.composer import Composer as ProtoMsgComposer
from pyinjective.async_client import AsyncClient
from pyinjective.transaction import Transaction
from pyinjective.constant import Network
from pyinjective.core.network import Network
from pyinjective.wallet import PrivateKey


async def main() -> None:
# select network: local, testnet, mainnet
network = Network.testnet()
composer = ProtoMsgComposer(network=network.string())

# initialize grpc client
client = AsyncClient(network, insecure=False)
client = AsyncClient(network)
composer = await client.composer()
await client.sync_timeout_height()

# load account
Expand Down
9 changes: 3 additions & 6 deletions examples/chain_client/1_MsgSend.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
import asyncio
import logging

from pyinjective.composer import Composer as ProtoMsgComposer
from pyinjective.async_client import AsyncClient
from pyinjective.transaction import Transaction
from pyinjective.constant import Network
from pyinjective.core.network import Network
from pyinjective.wallet import PrivateKey


async def main() -> None:
# select network: local, testnet, mainnet
network = Network.testnet()
composer = ProtoMsgComposer(network=network.string())

# initialize grpc client
# set custom cookie location (optional) - defaults to current dir
client = AsyncClient(network, insecure=False, chain_cookie_location="/tmp/.chain_cookie")
client = AsyncClient(network)
composer = await client.composer()
await client.sync_timeout_height()

# load account
Expand Down
12 changes: 5 additions & 7 deletions examples/chain_client/20_MsgExec.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
import asyncio
import logging

from pyinjective.composer import Composer as ProtoMsgComposer
from pyinjective.async_client import AsyncClient
from pyinjective.transaction import Transaction
from pyinjective.constant import Network
from pyinjective.core.network import Network
from pyinjective.wallet import PrivateKey, Address


async def main() -> None:
# select network: local, testnet, mainnet
network = Network.testnet()
composer = ProtoMsgComposer(network=network.string())

# initialize grpc client
client = AsyncClient(network, insecure=False)
client = AsyncClient(network)
composer = await client.composer()
await client.sync_timeout_height()

# load account
Expand Down Expand Up @@ -63,9 +61,9 @@ async def main() -> None:
print(sim_res)
return

sim_res_msg = ProtoMsgComposer.MsgResponses(sim_res, simulation=True)
sim_res_msg = composer.MsgResponses(sim_res, simulation=True)
data=sim_res_msg[0]
unpacked_msg_res = ProtoMsgComposer.UnpackMsgExecResponse(
unpacked_msg_res = composer.UnpackMsgExecResponse(
msg_type=msg0.__class__.__name__,
data=data
)
Expand Down
8 changes: 3 additions & 5 deletions examples/chain_client/21_MsgRevoke.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
import asyncio
import logging

from pyinjective.composer import Composer as ProtoMsgComposer
from pyinjective.async_client import AsyncClient
from pyinjective.transaction import Transaction
from pyinjective.constant import Network
from pyinjective.core.network import Network
from pyinjective.wallet import PrivateKey


async def main() -> None:
# select network: local, testnet, mainnet
network = Network.testnet()
composer = ProtoMsgComposer(network=network.string())

# initialize grpc client
client = AsyncClient(network, insecure=False)
client = AsyncClient(network)
composer = await client.composer()
await client.sync_timeout_height()

# load account
Expand Down
8 changes: 3 additions & 5 deletions examples/chain_client/22_MsgSendToEth.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
import asyncio
import logging
import requests

from pyinjective.composer import Composer as ProtoMsgComposer
from pyinjective.async_client import AsyncClient
from pyinjective.transaction import Transaction
from pyinjective.constant import Network
from pyinjective.core.network import Network
from pyinjective.wallet import PrivateKey

async def main() -> None:
# select network: local, testnet, mainnet
network = Network.testnet()
composer = ProtoMsgComposer(network=network.string())

# initialize grpc client
client = AsyncClient(network, insecure=False)
client = AsyncClient(network)
composer = await client.composer()
await client.sync_timeout_height()

# load account
Expand Down
8 changes: 3 additions & 5 deletions examples/chain_client/23_MsgRelayPriceFeedPrice.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
import asyncio
import logging

from pyinjective.composer import Composer as ProtoMsgComposer
from pyinjective.async_client import AsyncClient
from pyinjective.transaction import Transaction
from pyinjective.constant import Network
from pyinjective.core.network import Network
from pyinjective.wallet import PrivateKey


async def main() -> None:
# select network: local, testnet, mainnet
network = Network.testnet()
composer = ProtoMsgComposer(network=network.string())

# initialize grpc client
client = AsyncClient(network, insecure=False)
client = AsyncClient(network)
composer = await client.composer()
await client.sync_timeout_height()

# load account
Expand Down
8 changes: 3 additions & 5 deletions examples/chain_client/24_MsgRewardsOptOut.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
import asyncio
import logging

from pyinjective.composer import Composer as ProtoMsgComposer
from pyinjective.async_client import AsyncClient
from pyinjective.transaction import Transaction
from pyinjective.constant import Network
from pyinjective.core.network import Network
from pyinjective.wallet import PrivateKey


async def main() -> None:
# select network: local, testnet, mainnet
network = Network.testnet()
composer = ProtoMsgComposer(network=network.string())

# initialize grpc client
client = AsyncClient(network, insecure=False)
client = AsyncClient(network)
composer = await client.composer()
await client.sync_timeout_height()

# load account
Expand Down
Loading