Skip to content

Commit

Permalink
Merge pull request #125 from InjectiveLabs/f/prepare_release
Browse files Browse the repository at this point in the history
feat: release v0.5.6.9
  • Loading branch information
achilleas-kal authored Jun 30, 2022
2 parents cdb476c + bbd6415 commit c9622d5
Show file tree
Hide file tree
Showing 12 changed files with 376 additions and 277 deletions.
19 changes: 3 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ Note that the [sync client](https://github.com/InjectiveLabs/sdk-python/blob/mas
### Changelogs
**0.5.6.9**
* Add MsgExternalTransfer to the composer
* Add support for Binary Options
* Add multi-subaccount support in local order hash calculation
* Re-gen ini files

**0.5.6.8**
* Add skip & limit params to Exchange API methods
Expand Down Expand Up @@ -111,22 +114,6 @@ Note that the [sync client](https://github.com/InjectiveLabs/sdk-python/blob/mas
* Re-gen ini files


**0.5.6.4**
* Add K8S endpoint on testnet as default
* Add root CA certs for mainnet & testnet for secure gRPC connections
* Add method to unpack responses inside MsgExec
* Fix type hints in composer & clients
* Add Peggy contract ABI
* Add reduce-only support for market orders
* Add sticky session cookie for broadcast methods
* Add historical funding rates in clients
* Fixes in spot conversions for price/quantity returned from the backend
* Add MsgSendToEth & SendToCosmos in the composer for INJ <> ETH transfers
* Add function to compute order hashes locally
* Add load balancer endpoint on mainnet as default
* Re-gen ini files



## License

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Copyright 2021 Injective Labs
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Injective Exchange API client for Python. Example only."""

import asyncio
import logging

from pyinjective.async_client import AsyncClient
from pyinjective.constant import Network

async def main() -> None:
network = Network.testnet()
client = AsyncClient(network, insecure=False)
market_status = "active" # active, paused, suspended, demolished or expired
quote_denom = "peggy0xdAC17F958D2ee523a2206206994597C13D831ec7"
market = await client.get_binary_options_markets(
market_status=market_status,
quote_denom=quote_denom
)

print(market)

if __name__ == '__main__':
logging.basicConfig(level=logging.INFO)
asyncio.get_event_loop().run_until_complete(main())
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Copyright 2021 Injective Labs
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Injective Exchange API client for Python. Example only."""

import asyncio
import logging

from pyinjective.async_client import AsyncClient
from pyinjective.constant import Network

async def main() -> None:
network = Network.testnet()
client = AsyncClient(network, insecure=False)
market_id = "0x12d35c0b585f21c266b6f11855aea196245d90a49c0d6844e48f1a7049fa629e"
market = await client.get_binary_options_market(market_id=market_id)
print(market)

if __name__ == '__main__':
logging.basicConfig(level=logging.INFO)
asyncio.get_event_loop().run_until_complete(main())
12 changes: 12 additions & 0 deletions pyinjective/async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -786,3 +786,15 @@ async def get_funding_rates(self, market_id: str, **kwargs):
limit=kwargs.get("limit"),
)
return await self.stubDerivativeExchange.FundingRates(req)

async def get_binary_options_markets(self, **kwargs):
req = derivative_exchange_rpc_pb.BinaryOptionsMarketsRequest(
market_status=kwargs.get("market_status"),
quote_denom=kwargs.get("quote_denom"),
)
return await self.stubDerivativeExchange.BinaryOptionsMarkets(req)

async def get_binary_options_market(self, market_id: str):
req = derivative_exchange_rpc_pb.BinaryOptionsMarketRequest(market_id=market_id)
return await self.stubDerivativeExchange.BinaryOptionsMarket(req)

2 changes: 1 addition & 1 deletion pyinjective/constant.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def mainnet(cls, node='k8s'):
@classmethod
def local(cls):
return cls(
lcd_endpoint='localhost:10337',
lcd_endpoint='http://localhost:10337',
grpc_endpoint='localhost:9900',
grpc_exchange_endpoint='localhost:9910',
chain_id='injective-1',
Expand Down
43 changes: 25 additions & 18 deletions pyinjective/proto/exchange/injective_derivative_exchange_rpc_pb2.py

Large diffs are not rendered by default.

39 changes: 23 additions & 16 deletions pyinjective/proto/exchange/injective_spot_exchange_rpc_pb2.py

Large diffs are not rendered by default.

Loading

0 comments on commit c9622d5

Please sign in to comment.