Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: upgrades for chain 0.17.0 version #204

Merged
merged 2 commits into from
Jan 18, 2023
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
2 changes: 0 additions & 2 deletions .github/workflows/pytests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ jobs:
WEBSOCKET_ENDPOINT: ${{ secrets.WEBSOCKET_ENDPOINT }}
CHAIN_ID: ${{ secrets.CHAIN_ID }}
VALIDATOR_MNEMONIC: ${{ secrets.VALIDATOR_MNEMONIC }}
ORACLE_MNEMONIC: ${{ secrets.ORACLE_MNEMONIC }}
NETWORK_INSECURE: ${{ secrets.NETWORK_INSECURE }}
DEVNET_NUMBER: ${{ secrets.DEVNET_NUMBER }}
steps:
# ----------------------------------------------
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.

## Unreleased

## v0.17.0

Compatible with NibiruChain/nibiru v0.17

- [[#204]](https://github.com/NibiruChain/py-sdk/pull/204) chore: update protos to v0.17.0


## v0.16.4-dev.1

Compatible with NibiruChain/nibiru v0.16
Expand Down
2 changes: 0 additions & 2 deletions HACKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,11 @@ You'll need to set up a `.env` configuration file to set environment variables f
# Example configuration for the Nibiry Python SDK
HOST="..."
VALIDATOR_MNEMONIC="..."
ORACLE_MNEMONIC="..."
TENDERMINT_RPC_ENDPOINT="http://...:26657"
LCD_ENDPOINT="http://...:1317"
GRPC_ENDPOINT="...:9090"
WEBSOCKET_ENDPOINT="ws://...:26657/websocket"
CHAIN_ID="..."
NETWORK_INSECURE=true
```

#### Environment variables in GitHub Actions
Expand Down
1 change: 0 additions & 1 deletion docs-md/msg/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@ Sub-modules
* nibiru.msg.dex
* nibiru.msg.msg
* nibiru.msg.perp
* nibiru.msg.pricefeed
* nibiru.msg.staking
7 changes: 0 additions & 7 deletions docs-md/msg/msg.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ Classes
bank: Methods for the Cosmos x/bank module.
dex: Methods for the Nibiru Chain x/dex module.
perp: Methods for the Nibiru Chain x/perp module
pricefeed: Methods for the Nibiru Chain x/perp module
staking: Methods for the Cosmos x/staking and x/distribution modules.

### Class variables
Expand Down Expand Up @@ -41,12 +40,6 @@ Classes
- add_margin: Deleverages a position by adding margin to back it.
- remove_margin: Increases the leverage of the position by removing margin.

`pricefeed`
: Messages for the x/pricefeed module.

Methods:
- post_price

`staking`
: Messages for the x/staking and x/distribution modules.

Expand Down
66 changes: 0 additions & 66 deletions docs-md/msg/pricefeed.md

This file was deleted.

1 change: 0 additions & 1 deletion docs-md/pytypes/common.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ Classes
* nibiru.msg.perp.MsgLiquidate
* nibiru.msg.perp.MsgOpenPosition
* nibiru.msg.perp.MsgRemoveMargin
* nibiru.msg.pricefeed.MsgPostPrice
* nibiru.msg.staking.MsgDelegate
* nibiru.msg.staking.MsgUndelegate
* nibiru.msg.staking.MsgWithdrawDelegatorReward
Expand Down
1 change: 0 additions & 1 deletion docs-md/query_clients/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ Sub-modules
* nibiru.query_clients.dex
* nibiru.query_clients.epoch
* nibiru.query_clients.perp
* nibiru.query_clients.pricefeed
* nibiru.query_clients.staking
* nibiru.query_clients.util
* nibiru.query_clients.vpool
32 changes: 0 additions & 32 deletions docs-md/query_clients/pricefeed.md

This file was deleted.

1 change: 0 additions & 1 deletion docs-md/query_clients/util.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ Classes
* nibiru.query_clients.dex.DexQueryClient
* nibiru.query_clients.epoch.EpochQueryClient
* nibiru.query_clients.perp.PerpQueryClient
* nibiru.query_clients.pricefeed.PricefeedQueryClient
* nibiru.query_clients.staking.StakingQueryClient
* nibiru.query_clients.vpool.VpoolQueryClient

Expand Down
2 changes: 1 addition & 1 deletion docs-md/sdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Classes
sdk = (
Sdk.authorize(val_mnemonic)
.with_config(tx_config)
.with_network(network, network_insecure)
.with_network(network)
)
```

Expand Down
8 changes: 0 additions & 8 deletions docs/source/nibiru.msg.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,6 @@ nibiru.msg.perp module
:undoc-members:
:show-inheritance:

nibiru.msg.pricefeed module
---------------------------

.. automodule:: nibiru.msg.pricefeed
:members:
:undoc-members:
:show-inheritance:

Module contents
---------------

Expand Down
8 changes: 0 additions & 8 deletions docs/source/nibiru.query_clients.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,6 @@ nibiru.query\_clients.perp module
:undoc-members:
:show-inheritance:

nibiru.query\_clients.pricefeed module
--------------------------------------

.. automodule:: nibiru.query_clients.pricefeed
:members:
:undoc-members:
:show-inheritance:

nibiru.query\_clients.util module
---------------------------------

Expand Down
14 changes: 0 additions & 14 deletions docs/source/perpetual.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,20 +69,6 @@ dollar value of BTC on spot exchanges is the index price of the BTC:USD
perp. Thus we’d call BTC **“the underlying”**. Usually, the index price
is taken as the average of spot prices across major exchanges.

.. code:: python

trader.query.pricefeed.price("ubtc:unusd")

'''
Output:
{
"price": {
"pair_id": "ubtc:unusd",
"price": 20776.0
}
}
'''

Some trading strategies can be built on the difference between mark price
and index price.

Expand Down
31 changes: 13 additions & 18 deletions nibiru/event_specs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
from enum import Enum

import google.protobuf.message
from nibiru_proto.proto.dex.v1 import tx_pb2 as dex_events # noqa
from nibiru_proto.proto.dex.v1 import event_pb2 as dex_events
from nibiru_proto.proto.lockup.v1 import tx_pb2 as lockup_events # noqa
from nibiru_proto.proto.perp.v1 import event_pb2 as perp_events
from nibiru_proto.proto.pricefeed import tx_pb2 as pricefeed_events
from nibiru_proto.proto.stablecoin import events_pb2 as stablecoin_events # noqa
from nibiru_proto.proto.vpool.v1 import event_pb2 as vpool_events

Expand All @@ -26,29 +25,25 @@ class EventType(Enum):
SwapOnVpoolEvent = vpool_events.SwapOnVpoolEvent
MarkPriceChanged = vpool_events.MarkPriceChangedEvent

# # Dex event
# PoolJoinedEvent = dex_events.EventPoolJoined
# PoolCreatedEvent = dex_events.EventPoolCreated
# PoolExitedEvent = dex_events.EventPoolExited
# AssetsSwappedEvent = dex_events.EventAssetsSwapped
# Dex event
PoolJoinedEvent = dex_events.EventPoolJoined
PoolCreatedEvent = dex_events.EventPoolCreated
PoolExitedEvent = dex_events.EventPoolExited
AssetsSwappedEvent = dex_events.EventAssetsSwapped

# Lockup event
# LockEvent = lockup_events.EventLock
# UnlockInitiatedEvent = lockup_events.EventUnlockInitiated
# UnlockEvent = lockup_events.EventUnlock

# Pricefeed events
OracleUpdatePriceEvent = pricefeed_events.EventOracleUpdatePrice
PairPriceUpdatedEvent = pricefeed_events.EventPairPriceUpdated

# Stablecoin events
# TransferEvent = stablecoin_events.EventTransfer
# MintStableEvent = stablecoin_events.EventMintStable
# BurnStableEvent = stablecoin_events.EventBurnStable
# MintNIBIEvent = stablecoin_events.EventMintNIBI
# BurnNIBIEvent = stablecoin_events.EventBurnNIBI
# RecollateralizeEvent = stablecoin_events.EventRecollateralize
# BuybackEvent = stablecoin_events.EventBuyback
TransferEvent = stablecoin_events.EventTransfer
MintStableEvent = stablecoin_events.EventMintStable
BurnStableEvent = stablecoin_events.EventBurnStable
MintNIBIEvent = stablecoin_events.EventMintNIBI
BurnNIBIEvent = stablecoin_events.EventBurnNIBI
RecollateralizeEvent = stablecoin_events.EventRecollateralize
BuybackEvent = stablecoin_events.EventBuyback

# Bank
Transfer = "transfer"
Expand Down
1 change: 0 additions & 1 deletion nibiru/grpc_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ def __init__(

# Query services
self.dex = query_clients.DexQueryClient(self.chain_channel)
self.pricefeed = query_clients.PricefeedQueryClient(self.chain_channel)
self.perp = query_clients.PerpQueryClient(self.chain_channel)
self.vpool = query_clients.VpoolQueryClient(self.chain_channel)
self.epoch = query_clients.EpochQueryClient(self.chain_channel)
Expand Down
3 changes: 0 additions & 3 deletions nibiru/msg/msg.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from nibiru.msg.bank import MsgsBank
from nibiru.msg.dex import MsgsDex
from nibiru.msg.perp import MsgsPerp
from nibiru.msg.pricefeed import MsgsPricefeed
from nibiru.msg.staking import MsgsStaking


Expand All @@ -17,14 +16,12 @@ class MsgClient:
bank: Methods for the Cosmos x/bank module.
dex: Methods for the Nibiru Chain x/dex module.
perp: Methods for the Nibiru Chain x/perp module
pricefeed: Methods for the Nibiru Chain x/perp module
staking: Methods for the Cosmos x/staking and x/distribution modules.
"""

bank = MsgsBank
dex = MsgsDex
perp = MsgsPerp
pricefeed = MsgsPricefeed
staking = MsgsStaking


Expand Down
Loading