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

added private staking endpoints #7

Merged
merged 1 commit into from
Jul 6, 2022
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
6 changes: 3 additions & 3 deletions client.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
from trade.trade import TradeData
from user.user import UserData
from funding.funding import FundingData
from staking.staking import StakingData


class User(UserData):
pass


class Trade(TradeData):
pass


class Market(MarketData):
pass

class Funding(FundingData):
pass


class Stakind(StakingData)
Empty file added staking/__init__.py
Empty file.
34 changes: 34 additions & 0 deletions staking/staking.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
from kraken.base_request.base_request import KrakenBaseRestAPI


class StakingData(KrakenBaseRestAPI):

def stake_asset(self, asset: str, amount: str, method: str) -> dict:
'''https://docs.kraken.com/rest/#operation/stake'''
params = {
'asset': asset,
'amount': str(amount),
'method': method
}
return self._request('POST', '/private/Stake', params=params)

def unstake_asset(self, asset: str, amount: str) -> dict:
'''https://docs.kraken.com/rest/#operation/unstake'''
params = {
'asset': asset,
'amount': str(amount)
}
return self._request('POST', '/private/Unstake', params=params)

def list_stakeable_assets(self) -> dict:
'''https://docs.kraken.com/rest/#operation/getStakingAssetInfo'''
return self._request('POST', '/private/Staking/Assets')

def get_pending_staking_transactions(self) -> dict:
'''https://docs.kraken.com/rest/#operation/getStakingPendingDeposits'''
return self._request('POST', '/private/Staking/Pending')

def list_staking_transactions(self) -> dict:
'''https://docs.kraken.com/rest/#operation/getStakingTransactions'''
return self._request('POST', '/private/Transactions')

6 changes: 6 additions & 0 deletions trade/trade.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,9 @@ def cancel_order_batch(self, orders: [str]) -> dict:
params = { 'orders': orders }
return self._request('POST', '/private/CancelOrderBatch')


def test():
dsfdsfd
sdfdsf
sdfsdf