Skip to content

Commit

Permalink
[skip ci] update changelog, remove staking references
Browse files Browse the repository at this point in the history
  • Loading branch information
btschwertfeger committed Mar 10, 2024
1 parent 344a518 commit f0eb18b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 25 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@

**Implemented enhancements:**

- Resolve "Add NFT support: `kraken.nft.Trade` and `kraken.nft.Market`" [\#200](https://github.com/btschwertfeger/python-kraken-sdk/pull/200) ([btschwertfeger](https://github.com/btschwertfeger))
- Resolve "Mark `kraken.spot.Staking` as deprecated and add `kraken.spot.Earn`" [\#199](https://github.com/btschwertfeger/python-kraken-sdk/pull/199) ([btschwertfeger](https://github.com/btschwertfeger))
- Resolve "Add `ledger` parameter to `kraken.spot.User.get_trades_history`" [\#195](https://github.com/btschwertfeger/python-kraken-sdk/pull/195) ([btschwertfeger](https://github.com/btschwertfeger))
- Resolve "Add `kraken.futures.Trade.get_max_order_size`" [\#193](https://github.com/btschwertfeger/python-kraken-sdk/pull/193) ([btschwertfeger](https://github.com/btschwertfeger))
- Resolve "Add `processBefore` parameter to `kraken.futures.Trade.`{`cancel_order`,`edit_order`,`create_order`,`create_batch_order`}" [\#192](https://github.com/btschwertfeger/python-kraken-sdk/pull/192) ([btschwertfeger](https://github.com/btschwertfeger))

Uncategorized merged pull requests:

- Resolve "Mark `kraken.spot.KrakenSpotWSClientV1` as deprecated" [\#201](https://github.com/btschwertfeger/python-kraken-sdk/pull/201) ([btschwertfeger](https://github.com/btschwertfeger))
- Resolve "The POST and query parameters of KrakenSpotBaseAPI and KrakenFuturesBaseAPI are not proper encoded in some case" [\#189](https://github.com/btschwertfeger/python-kraken-sdk/pull/189) ([btschwertfeger](https://github.com/btschwertfeger))
- adjust CI configuration [\#187](https://github.com/btschwertfeger/python-kraken-sdk/pull/187) ([btschwertfeger](https://github.com/btschwertfeger))
- Merge the CI/CD and release workflow + fix scheduled execution [\#186](https://github.com/btschwertfeger/python-kraken-sdk/pull/186) ([btschwertfeger](https://github.com/btschwertfeger))
Expand Down
15 changes: 5 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,13 @@ maintain a valid order book using the Orderbook client can be found in

The Kraken Spot REST API offers many endpoints for almost every use-case. The
python-kraken-sdk aims to provide all of them - split in User, Market, Trade,
Funding and Staking related clients.
Funding and Staking (Earn) related clients.

The following code block demonstrates how to use some of them. More examples
can be found in `examples/spot_examples.py`.

```python
from kraken.spot import User, Market, Trade, Funding, Staking
from kraken.spot import Earn, User, Market, Trade, Funding

def main():
key = "kraken-public-key"
Expand Down Expand Up @@ -183,14 +183,9 @@ def main():
print(funding.cancel_withdraw(asset="DOT", refid="<some id>"))
#

# ____STAKING___________________________
staking = Staking(key=key, secret=secret)
print(staking.list_stakeable_assets())
print(
staking.stake_asset(
asset="DOT", amount=20, method="polkadot-staked"
)
)
# ____EARN________________________
earn = Earn(key=key, secret=secret)
print(earn.list_earn_strategies(asset="DOT"))
#

if __name__ == "__main__":
Expand Down
25 changes: 10 additions & 15 deletions examples/spot_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import time
from pathlib import Path

from kraken.spot import Funding, Market, Staking, Trade, User
from kraken.spot import Earn, Funding, Market, Trade, User

logging.basicConfig(
format="%(asctime)s %(module)s,line: %(lineno)d %(levelname)8s | %(message)s",
Expand Down Expand Up @@ -185,27 +185,22 @@ def funding_examples() -> None:
)


def staking_examples() -> None:
"""Example usage of the Staking client"""
staking = Staking(key=key, secret=secret)
print(staking.list_stakeable_assets())
print(staking.list_staking_transactions())
print(staking.get_pending_staking_transactions())
raise ValueError(
"Attention: Please check if you really want to execute staking functions.",
)
if False:
print(staking.stake_asset(asset="DOT", amount=2000, method="polkadot-staked"))
print(staking.unstake_asset(asset="DOT", amount=200, method="polkadot-staked"))
time.sleep(2)
def earn_examples() -> None:
"""
Example usage of the Funding client; not shown, since special API key
permissions must be set.
"""
earn = Earn(key=key, secret=secret) # noqa: F841
# ...
# see tests/spot/test_spot_earn.py for examples.


def main() -> None:
user_examples()
market_examples()
trade_examples()
funding_examples()
staking_examples()
earn_examples()


if __name__ == "__main__":
Expand Down

0 comments on commit f0eb18b

Please sign in to comment.