Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ 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**(change before release)
* 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
Expand Down
3 changes: 2 additions & 1 deletion examples/chain_client/0_LocalOrderHash.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import asyncio

from pyinjective.async_client import AsyncClient
from pyinjective.composer import Composer
from pyinjective.transaction import Transaction
from pyinjective.core.network import Network
from pyinjective.wallet import PrivateKey
Expand All @@ -11,7 +12,7 @@ async def main() -> None:
network = Network.testnet()

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

Expand Down
2 changes: 1 addition & 1 deletion examples/chain_client/13_MsgIncreasePositionMargin.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ async def main() -> None:
network = Network.testnet()

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

Expand Down
2 changes: 1 addition & 1 deletion examples/chain_client/15_MsgWithdraw.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ async def main() -> None:
network = Network.testnet()

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

Expand Down
2 changes: 1 addition & 1 deletion examples/chain_client/16_MsgSubaccountTransfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ async def main() -> None:
network = Network.testnet()

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

Expand Down
2 changes: 1 addition & 1 deletion examples/chain_client/17_MsgBatchUpdateOrders.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ async def main() -> None:
network = Network.testnet()

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

Expand Down
2 changes: 1 addition & 1 deletion examples/chain_client/18_MsgBid.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ async def main() -> None:
network = Network.testnet()

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

Expand Down
2 changes: 1 addition & 1 deletion examples/chain_client/19_MsgGrant.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ async def main() -> None:
network = Network.testnet()

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

Expand Down
2 changes: 1 addition & 1 deletion examples/chain_client/1_MsgSend.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ async def main() -> None:
network = Network.testnet()

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

Expand Down
2 changes: 1 addition & 1 deletion examples/chain_client/20_MsgExec.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ async def main() -> None:
network = Network.testnet()

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

Expand Down
2 changes: 1 addition & 1 deletion examples/chain_client/21_MsgRevoke.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ async def main() -> None:
network = Network.testnet()

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

Expand Down
2 changes: 1 addition & 1 deletion examples/chain_client/22_MsgSendToEth.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ async def main() -> None:
network = Network.testnet()

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

Expand Down
2 changes: 1 addition & 1 deletion examples/chain_client/23_MsgRelayPriceFeedPrice.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ async def main() -> None:
network = Network.testnet()

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

Expand Down
2 changes: 1 addition & 1 deletion examples/chain_client/24_MsgRewardsOptOut.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ async def main() -> None:
network = Network.testnet()

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

Expand Down
2 changes: 1 addition & 1 deletion examples/chain_client/25_MsgDelegate.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ async def main() -> None:
network = Network.testnet()

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

Expand Down
2 changes: 1 addition & 1 deletion examples/chain_client/26_MsgWithdrawDelegatorReward.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ async def main() -> None:
network = Network.testnet()

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

Expand Down
2 changes: 1 addition & 1 deletion examples/chain_client/27_Grants.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

async def main() -> None:
network = Network.testnet()
client = AsyncClient(network, insecure=False)
client = AsyncClient(network)
granter = "inj14au322k9munkmx5wrchz9q30juf5wjgz2cfqku"
grantee = "inj1hkhdaj2a2clmq5jq6mspsggqs32vynpk228q3r"
msg_type_url = "/injective.exchange.v1beta1.MsgCreateDerivativeLimitOrder"
Expand Down
2 changes: 1 addition & 1 deletion examples/chain_client/28_BankBalances.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

async def main() -> None:
network = Network.testnet()
client = AsyncClient(network, insecure=False)
client = AsyncClient(network)
address = "inj1cml96vmptgw99syqrrz8az79xer2pcgp0a885r"
all_bank_balances = await client.get_bank_balances(address=address)
print(all_bank_balances)
Expand Down
2 changes: 1 addition & 1 deletion examples/chain_client/29_BankBalance.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

async def main() -> None:
network = Network.testnet()
client = AsyncClient(network, insecure=False)
client = AsyncClient(network)
address = "inj1cml96vmptgw99syqrrz8az79xer2pcgp0a885r"
denom = "inj"
bank_balance = await client.get_bank_balance(address=address, denom=denom)
Expand Down
4 changes: 2 additions & 2 deletions examples/chain_client/2_MsgDeposit.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@

async def main() -> None:
# select network: local, testnet, mainnet
network = Network.testnet()
network = Network.testnet(node="sentry")

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

Expand Down
2 changes: 1 addition & 1 deletion examples/chain_client/30_ExternalTransfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ async def main() -> None:
network = Network.testnet()

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ async def main() -> None:
network = Network.testnet()

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ async def main() -> None:
network = Network.testnet()

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

Expand Down
2 changes: 1 addition & 1 deletion examples/chain_client/33_MsgCancelBinaryOptionsOrder.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ async def main() -> None:
network = Network.testnet()

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ async def main() -> None:
network = Network.testnet()

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ async def main() -> None:
network = Network.testnet()

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

Expand Down
2 changes: 1 addition & 1 deletion examples/chain_client/36_MsgRelayProviderPrices.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ async def main() -> None:
network = Network.testnet()

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

Expand Down
2 changes: 1 addition & 1 deletion examples/chain_client/37_GetTx.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

async def main() -> None:
network = Network.testnet()
client = AsyncClient(network, insecure=False)
client = AsyncClient(network)
tx_hash = "7746BC12EB82B4D59D036FBFF2F67BDCA6F62A20B3DBC25661707DD61D4DC1B7"
tx_logs = await client.get_tx(tx_hash=tx_hash)
print(tx_logs)
Expand Down
2 changes: 1 addition & 1 deletion examples/chain_client/39_Account.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

async def main() -> None:
network = Network.testnet()
client = AsyncClient(network, insecure=False)
client = AsyncClient(network)
address = "inj1knhahceyp57j5x7xh69p7utegnnnfgxavmahjr"
acc = await client.get_account(address=address)
print(acc)
Expand Down
2 changes: 1 addition & 1 deletion examples/chain_client/3_MsgCreateSpotLimitOrder.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ async def main() -> None:
network = Network.testnet()

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

Expand Down
2 changes: 1 addition & 1 deletion examples/chain_client/40_MsgExecuteContract.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ async def main() -> None:

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

Expand Down
2 changes: 1 addition & 1 deletion examples/chain_client/41_MsgCreateInsuranceFund.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ async def main() -> None:

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

Expand Down
2 changes: 1 addition & 1 deletion examples/chain_client/42_MsgUnderwrite.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ async def main() -> None:

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

Expand Down
2 changes: 1 addition & 1 deletion examples/chain_client/43_MsgRequestRedemption.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ async def main() -> None:

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

Expand Down
1 change: 0 additions & 1 deletion examples/chain_client/44_MessageBroadcaster.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ async def main() -> None:
message_broadcaster = MsgBroadcasterWithPk.new_using_simulation(
network=network,
private_key=private_key_in_hexa,
use_secure_connection=True
)

priv_key = PrivateKey.from_hex(private_key_in_hexa)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ async def main() -> None:
composer = ProtoMsgComposer(network=network.string())

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

# load account
Expand All @@ -25,7 +25,6 @@ async def main() -> None:
message_broadcaster = MsgBroadcasterWithPk.new_for_grantee_account_using_simulation(
network=network,
grantee_private_key=private_key_in_hexa,
use_secure_connection=True
)

# prepare tx msg
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ async def main() -> None:
message_broadcaster = MsgBroadcasterWithPk.new_without_simulation(
network=network,
private_key=private_key_in_hexa,
use_secure_connection=True
)

priv_key = PrivateKey.from_hex(private_key_in_hexa)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ async def main() -> None:
composer = ProtoMsgComposer(network=network.string())

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

# load account
Expand All @@ -25,7 +25,6 @@ async def main() -> None:
message_broadcaster = MsgBroadcasterWithPk.new_for_grantee_account_without_simulation(
network=network,
grantee_private_key=private_key_in_hexa,
use_secure_connection=True
)

# prepare tx msg
Expand Down
2 changes: 1 addition & 1 deletion examples/chain_client/4_MsgCreateSpotMarketOrder.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ async def main() -> None:
network = Network.testnet()

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

Expand Down
2 changes: 1 addition & 1 deletion examples/chain_client/5_MsgCancelSpotOrder.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ async def main() -> None:
network = Network.testnet()

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

Expand Down
2 changes: 1 addition & 1 deletion examples/chain_client/6_MsgCreateDerivativeLimitOrder.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ async def main() -> None:
network = Network.testnet()

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

Expand Down
Loading