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.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package kraken-api-client

kraken

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.

Support me on Patreon Build Status Packagist Downloads License

Features

Requirements

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

PHP Build Version
Package Version
Requires php Version ^8.1
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
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package butschster/kraken-api-client contains the following files

Loading the files please wait ....