Download the PHP package butschster/kraken-api-client without Composer
On this page you can find all versions of the php package butschster/kraken-api-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download butschster/kraken-api-client
More information about butschster/kraken-api-client
Files in butschster/kraken-api-client
Package kraken-api-client
Short Description The most powerful and extendable REST API / Websocket client for Kraken.com. Built on PHP8.0
License MIT
Informations about the package kraken-api-client
The most powerful and extendable REST API / Websocket client for Kraken.com. Built on PHP8.1
This is an unofficial Kraken.com PHP8.1 package, which should help users very quickly connect to API from their Laravel or other php project. Of course, the primary feature of this package is the ability to interact with Kraken REST API, but also it allows connecting to Kraken Websocket server.
Features
- REST API client
- Websocket client
- Well documented
- Well tested
Requirements
- Laravel 8.x, Laravel 9.x, Laravel 10.x, or other framework
- PHP 8.1 and above
Installation
Require this package with composer using the following command:
composer require butschster/kraken-api-client
Using
Laravel Autodiscovery
If you're using Laravel 8.0+ or above, the package will automatically register the KrakenServiceProvider.
Other PHP frameworks
REST API client
Websocket client
Configuration
You can update your .env file with the following:
REST API methods
API client usage
By using dependency injection
Make request
This package uses jms/serializer for converting API responses to object, so you have to pass class, that will use for deserializing.
Note: For non exists API methods you have to create response classes by your self.
If request return an error, will be thrown an exception \Butschster\Kraken\Exceptions\KrakenApiErrorException
Get Server Time
Get the server's time.
See: https://docs.kraken.com/rest/#operation/getServerTime
Get System Status
Get the current system status or trading mode.
See: https://docs.kraken.com/rest/#operation/getSystemStatus
Get Asset Info
Get information about the assets that are available for deposit, withdrawal, trading and staking.
See: https://docs.kraken.com/rest/#operation/getAssetInfo
Get Tradable Asset Pairs
Get tradable asset pairs
See: https://docs.kraken.com/rest/#operation/getTradableAssetPairs
Get Ticker Information
Note: Today's prices start at midnight UTC
See: https://docs.kraken.com/rest/#operation/getTickerInformation
Get Order Book
See: https://docs.kraken.com/rest/#operation/getOrderBook
Get Account Balance
Retrieve all cash balances, net of pending withdrawals.
See: https://docs.kraken.com/rest/#operation/getAccountBalance
Get Trade Balance
Retrieve a summary of collateral balances, margin position valuations, equity and margin level.
See: https://docs.kraken.com/rest/#operation/getTradeBalance
Get Open Orders
Retrieve information about currently open orders.
See: https://docs.kraken.com/rest/#operation/getOpenOrders
Get Closed Orders
Retrieve information about orders that have been closed (filled or cancelled). 50 results are returned at a time, the most recent by default. Note: If an order's tx ID is given for start or end time, the order's opening time (opentm) is used
See: https://docs.kraken.com/rest/#operation/getClosedOrders
Query Orders Info
Retrieve information about specific orders.
See: https://docs.kraken.com/rest/#operation/getOrdersInfo
Add Order
Place a new order. Note: See the AssetPairs endpoint for details on the available trading pairs, their price and quantity precisions, order minimums, available leverage, etc.
See: https://docs.kraken.com/rest/#operation/addOrder
Cancel Order
Cancel a particular open order (or set of open orders) by txid or userref
See: https://docs.kraken.com/rest/#operation/cancelOrder
Cancel All Orders
Cancel all open orders
See: https://docs.kraken.com/rest/#operation/cancelAllOrders
Cancel All Orders After X
CancelAllOrdersAfter provides a "Dead Man's Switch" mechanism to protect the client from network malfunction, extreme latency or unexpected matching engine downtime. The client can send a request with a timeout (in seconds), that will start a countdown timer which will cancel all client orders when the timer expires. The client has to keep sending new requests to push back the trigger time, or deactivate the mechanism by specifying a timeout of 0. If the timer expires, all orders are cancelled and then the timer remains disabled until the client provides a new (non-zero) timeout.
The recommended use is to make a call every 15 to 30 seconds, providing a timeout of 60 seconds. This allows the client to keep the orders in place in case of a brief disconnection or transient delay, while keeping them safe in case of a network breakdown. It is also recommended to disable the timer ahead of regularly scheduled trading engine maintenance (if the timer is enabled, all orders will be cancelled when the trading engine comes back from downtime - planned or otherwise).
See: https://docs.kraken.com/rest/#operation/cancelAllOrdersAfter
Get Deposit Methods
Retrieve methods available for depositing a particular asset.
See: https://docs.kraken.com/rest/#operation/getDepositMethods
Get Deposit Addresses
Retrieve (or generate a new) deposit addresses for a particular asset and method.
See: https://docs.kraken.com/rest/#operation/getDepositAddresses
Get Withdrawal Information
Retrieve fee information about potential withdrawals for a particular asset, key and amount.
See: https://docs.kraken.com/rest/#operation/getWithdrawalInformation
Get Websockets Token
An authentication token must be requested via this REST API endpoint in order to connect to and authenticate with our Websockets API. The token should be used within 15 minutes of creation, but it does not expire once a successful Websockets connection and private subscription has been made and is maintained.
See: https://docs.kraken.com/rest/#operation/getWebsocketsToken
Websocket Client
Websocket client usage
By using dependency injection
Ping
Client can ping server to determine whether connection is alive, server responds with pong. This is an application level ping as opposed to default ping in websockets standard which is server initiated
See: https://docs.kraken.com/websockets/#message-ping
HeartBeat
Server heartbeat sent if no subscription traffic within 1 second (approximately)
See: https://docs.kraken.com/websockets/#message-heartbeat
Subscribe to an event
Subscribe to a topic on a single or multiple currency pairs.
See: https://docs.kraken.com/websockets/#message-subscribe
Custom events
You can create you own events
Enjoy!
All versions of kraken-api-client with dependencies
guzzlehttp/guzzle Version ^7.0
illuminate/support Version ^8|^9.0|^10.0|^11.0
jms/serializer Version ^3.12
brick/money Version ^0.8.0
ratchet/pawl Version ^0.3.5
webmozart/assert Version ^1.10