Skip to content

Commit c9622d5

Browse files
Merge pull request #125 from InjectiveLabs/f/prepare_release
feat: release v0.5.6.9
2 parents cdb476c + bbd6415 commit c9622d5

File tree

12 files changed

+376
-277
lines changed

12 files changed

+376
-277
lines changed

README.md

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ Note that the [sync client](https://github.com/InjectiveLabs/sdk-python/blob/mas
8080
### Changelogs
8181
**0.5.6.9**
8282
* Add MsgExternalTransfer to the composer
83+
* Add support for Binary Options
84+
* Add multi-subaccount support in local order hash calculation
85+
* Re-gen ini files
8386

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

113116

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

131118
## License
132119

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Copyright 2021 Injective Labs
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
"""Injective Exchange API client for Python. Example only."""
15+
16+
import asyncio
17+
import logging
18+
19+
from pyinjective.async_client import AsyncClient
20+
from pyinjective.constant import Network
21+
22+
async def main() -> None:
23+
network = Network.testnet()
24+
client = AsyncClient(network, insecure=False)
25+
market_status = "active" # active, paused, suspended, demolished or expired
26+
quote_denom = "peggy0xdAC17F958D2ee523a2206206994597C13D831ec7"
27+
market = await client.get_binary_options_markets(
28+
market_status=market_status,
29+
quote_denom=quote_denom
30+
)
31+
32+
print(market)
33+
34+
if __name__ == '__main__':
35+
logging.basicConfig(level=logging.INFO)
36+
asyncio.get_event_loop().run_until_complete(main())
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Copyright 2021 Injective Labs
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
"""Injective Exchange API client for Python. Example only."""
15+
16+
import asyncio
17+
import logging
18+
19+
from pyinjective.async_client import AsyncClient
20+
from pyinjective.constant import Network
21+
22+
async def main() -> None:
23+
network = Network.testnet()
24+
client = AsyncClient(network, insecure=False)
25+
market_id = "0x12d35c0b585f21c266b6f11855aea196245d90a49c0d6844e48f1a7049fa629e"
26+
market = await client.get_binary_options_market(market_id=market_id)
27+
print(market)
28+
29+
if __name__ == '__main__':
30+
logging.basicConfig(level=logging.INFO)
31+
asyncio.get_event_loop().run_until_complete(main())

pyinjective/async_client.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -786,3 +786,15 @@ async def get_funding_rates(self, market_id: str, **kwargs):
786786
limit=kwargs.get("limit"),
787787
)
788788
return await self.stubDerivativeExchange.FundingRates(req)
789+
790+
async def get_binary_options_markets(self, **kwargs):
791+
req = derivative_exchange_rpc_pb.BinaryOptionsMarketsRequest(
792+
market_status=kwargs.get("market_status"),
793+
quote_denom=kwargs.get("quote_denom"),
794+
)
795+
return await self.stubDerivativeExchange.BinaryOptionsMarkets(req)
796+
797+
async def get_binary_options_market(self, market_id: str):
798+
req = derivative_exchange_rpc_pb.BinaryOptionsMarketRequest(market_id=market_id)
799+
return await self.stubDerivativeExchange.BinaryOptionsMarket(req)
800+

pyinjective/constant.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ def mainnet(cls, node='k8s'):
146146
@classmethod
147147
def local(cls):
148148
return cls(
149-
lcd_endpoint='localhost:10337',
149+
lcd_endpoint='http://localhost:10337',
150150
grpc_endpoint='localhost:9900',
151151
grpc_exchange_endpoint='localhost:9910',
152152
chain_id='injective-1',

pyinjective/proto/exchange/injective_derivative_exchange_rpc_pb2.py

Lines changed: 25 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyinjective/proto/exchange/injective_spot_exchange_rpc_pb2.py

Lines changed: 23 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)