KrakenApi

Description

Makes every interactions between GreedyBoy and the Kraken API.

Code

class KrakenApi. KrakenApi ( apiKey , apiPrivateKey , token = None )

Interacts with Kraken API.

AddOrder ( buyOrSell , orderType , amount , cryptocurrency = 'XDG' , currency = 'EUR' , test = True , price = 1 )
Parameters
  • buyOrSell ( str ) – “buy” or “sell”

  • orderType ( str ) – can be one of these : “market”, “limit”, “stop-loss”, “take-profit”, “stop-loss-limit”, “take-profit-limit”, “settle-position”

CancelOrders ( )

Just cancels every orders

CheckAccount ( )

Checks the account balances

GetCryptoAndFiatBalance ( currencyInitial : str , fiatInitial : str = 'EUR' )

Gets a specific currency & fiat balance

Parameters
  • currencyInitial ( str ) – initials of the cryptocurrency

  • fiatInitial – initials of the fiat currency

:type fiatInitial:str

GetLastTrades ( )

Gets the last trades made on your account

GetPairs ( finishesWith : Optional [ str ] = None )

Gets a list containing every exchange pairs (XDGEUR or XBTUSD for instance)

Parameters

finishesWith ( str ) – to specify if you only want EUR exchange pairs for instance (so you need to put “EUR”)

GetPrices ( crypto : str , interval : int , since : int , fiat : str = 'EUR' )

Returns an array containing every price info, formatted like this : [time, open, high, low, close, vwap, volume, count]

Parameters
  • crypto ( str ) – name of the crypto (XDG for instance)

  • fiat ( str ) – name of the fiat exchange currency (EUR for instance)

  • interval ( int ) – interval (in min)

  • since ( int ) – epoch time in seconds

GetPricesFullname ( cryptoFiat : str , interval : int , since : int )

GetPrices but with cryptoFiat parameter instead of crypto & fiat separated

Parameters
  • cryptoFiat ( str ) – name of the pair

  • interval ( int ) – interval (in min)

  • since ( int ) – epoch time in seconds

getToken ( )

Gets the token from Kraken.

Check for configuration to see how it works.

kraken_get_request ( uri_path )
kraken_post_request ( uri_path , data )
KrakenApi. get_kraken_signature ( urlpath , data , secret )
KrakenApi. get_kraken_token ( apiKey , apiPrivateKey )

Gets the token from Kraken.

Check for configuration to see how it works.