Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
68759f3
feat: updated changelog and version number for v1.9.0 release
aarmoa Feb 13, 2025
b09a7a0
Merge pull request #371 from InjectiveLabs/feat/release_v1_9_0
aarmoa Feb 13, 2025
65ce48e
fix: updated the oracle stream prices script to send the oracle type …
aarmoa Feb 17, 2025
a9b3c79
Merge pull request #372 from InjectiveLabs/fix/fix_stream_prices_exam…
aarmoa Feb 17, 2025
7074685
fix: added quantization in the functions that convert notional values…
aarmoa Mar 3, 2025
0416c2a
Merge pull request #374 from InjectiveLabs/fix/add_notional_quantization
aarmoa Mar 3, 2025
a054d14
cp-235: updated the gas limit estimator logic to reflect the new logi…
aarmoa Mar 17, 2025
41dda82
cp-235: updated all proto definitions with the candidate indexer and …
aarmoa Mar 17, 2025
fd60afc
Merge branch 'master' of https://github.com/InjectiveLabs/sdk-python …
aarmoa Mar 17, 2025
45b98d2
feat: added a new message based fee calculator supporting the Exchang…
aarmoa Mar 24, 2025
f675e2a
fix: fix broadcaster creation example scripts
aarmoa Mar 24, 2025
02165b5
fix: pointed to the correct injective-core branch for the proto gener…
aarmoa Mar 25, 2025
1418b58
fix: updated gas heuristics per message gas cost to sync with latest …
aarmoa Apr 3, 2025
14909ae
fix: added cleanup code in AsyncClient for the object destruction phase
aarmoa Apr 4, 2025
9f2062c
feat: updated proto definitions for chain v1.15 upgrade and Indexer v…
aarmoa Apr 7, 2025
25b01df
feat: made the gas calculator using gas heuristics the default one fo…
aarmoa Apr 8, 2025
104d176
fix: fixed gas calculation using heuristics to not duplicate the requ…
aarmoa Apr 8, 2025
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
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@

All notable changes to this project will be documented in this file.

## [1.9.0] - 9999-99-99
## [1.10.0] - 9999-99-99
### Changed
- Update in the implementation of the gas limit estimator to use the same values as the chain for the fixed gas messages

## [1.9.1] - 2025-03-03
### Fixed
- Added quantization in the functions that convert notional values to chain format

## [1.9.0] - 2025-02-13
### Added
- Added support for all new queries and messages from the new Permissions module

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ clean-all:
$(call clean_repos)

clone-injective-indexer:
git clone https://github.com/InjectiveLabs/injective-indexer.git -b v1.13.117_RC1 --depth 1 --single-branch
git clone https://github.com/InjectiveLabs/injective-indexer.git -b v1.14.25 --depth 1 --single-branch

clone-all: clone-injective-indexer

Expand Down
10 changes: 5 additions & 5 deletions buf.gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@ inputs:
- module: buf.build/googleapis/googleapis
- module: buf.build/cosmos/ics23
- git_repo: https://github.com/InjectiveLabs/cosmos-sdk
tag: v0.50.9-inj-2
tag: v0.50.9-inj-4
- git_repo: https://github.com/InjectiveLabs/ibc-go
tag: v8.3.2-inj-0
tag: v8.6.1-inj
- git_repo: https://github.com/InjectiveLabs/wasmd
tag: v0.53.2-inj-1
tag: v0.53.2-inj.2
# - git_repo: https://github.com/InjectiveLabs/wasmd
# branch: v0.51.x-inj
# subdir: proto
# - git_repo: https://github.com/InjectiveLabs/injective-core
# tag: v1.13.0
# tag: v1.15.0-alpha
# subdir: proto
- git_repo: https://github.com/InjectiveLabs/injective-core
branch: testnet
branch: master
subdir: proto
- directory: proto
2 changes: 1 addition & 1 deletion examples/exchange_client/oracle_rpc/1_StreamPrices.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ async def main() -> None:

base_symbol = market.oracle_base
quote_symbol = market.oracle_quote
oracle_type = market.oracle_type
oracle_type = market.oracle_type.lower()

task = asyncio.get_event_loop().create_task(
client.listen_oracle_prices_updates(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ async def main() -> None:
network = Network.testnet()
client = AsyncClient(network)
account_address = "inj1clw20s2uxeyxtam6f7m84vgae92s9eh7vygagt"
portfolio = await client.fetch_account_portfolio_balances(account_address=account_address)
portfolio = await client.fetch_account_portfolio_balances(account_address=account_address, usd=False)
print(portfolio)


Expand Down
8 changes: 6 additions & 2 deletions pyinjective/async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -2037,8 +2037,12 @@ async def fetch_binary_options_market(self, market_id: str) -> Dict[str, Any]:
return await self.exchange_derivative_api.fetch_binary_options_market(market_id=market_id)

# PortfolioRPC
async def fetch_account_portfolio_balances(self, account_address: str) -> Dict[str, Any]:
return await self.exchange_portfolio_api.fetch_account_portfolio_balances(account_address=account_address)
async def fetch_account_portfolio_balances(
self, account_address: str, usd: Optional[bool] = None
) -> Dict[str, Any]:
return await self.exchange_portfolio_api.fetch_account_portfolio_balances(
account_address=account_address, usd=usd
)

async def listen_account_portfolio_updates(
self,
Expand Down
8 changes: 5 additions & 3 deletions pyinjective/client/indexer/grpc/indexer_grpc_portfolio_api.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Any, Callable, Dict
from typing import Any, Callable, Dict, Optional

from grpc.aio import Channel

Expand All @@ -21,8 +21,10 @@ async def fetch_account_portfolio(self, account_address: str) -> Dict[str, Any]:

return response

async def fetch_account_portfolio_balances(self, account_address: str) -> Dict[str, Any]:
request = exchange_portfolio_pb.AccountPortfolioBalancesRequest(account_address=account_address)
async def fetch_account_portfolio_balances(
self, account_address: str, usd: Optional[bool] = None
) -> Dict[str, Any]:
request = exchange_portfolio_pb.AccountPortfolioBalancesRequest(account_address=account_address, usd=usd)
response = await self._execute_call(call=self._stub.AccountPortfolioBalances, request=request)

return response
Expand Down
4 changes: 2 additions & 2 deletions pyinjective/core/broadcaster.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ async def configure_gas_fee_for_transaction(


class MessageBasedTransactionFeeCalculator(TransactionFeeCalculator):
TRANSACTION_GAS_LIMIT = 60_000
TRANSACTION_ANTE_GAS_LIMIT = 105_000

def __init__(self, client: AsyncClient, composer: Composer, gas_price: Optional[int] = None):
self._client = client
Expand All @@ -294,7 +294,7 @@ async def configure_gas_fee_for_transaction(
public_key: PublicKey,
):
messages_gas_limit = math.ceil(self._calculate_gas_limit(messages=transaction.msgs))
transaction_gas_limit = messages_gas_limit + self.TRANSACTION_GAS_LIMIT
transaction_gas_limit = messages_gas_limit + self.TRANSACTION_ANTE_GAS_LIMIT

fee = [
self._composer.coin(
Expand Down
Loading
Loading