Skip to content

Commit

Permalink
Merge pull request #7 from btschwertfeger/3-add-kraken-staking-endpoints
Browse files Browse the repository at this point in the history
added private staking endpoints
  • Loading branch information
btschwertfeger authored Jul 6, 2022
2 parents 9b28064 + 4b0799d commit 5866767
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 3 deletions.
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

0 comments on commit 5866767

Please sign in to comment.