Download the PHP package tigusigalpa/whale-alert-php without Composer

On this page you can find all versions of the php package tigusigalpa/whale-alert-php. 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 whale-alert-php

Whale Alert PHP/Laravel Client/SDK/Library

Whale Alert PHP SDK

Packagist Tests Coverage Static analysis Codecov PHP Version

An unofficial PHP client library for the Whale Alert Enterprise API.

Disclaimer: This is an unofficial SDK and is not affiliated with, endorsed by, or sponsored by Whale Alert. All product names, logos, and brands are property of their respective owners.

What is this?

This library makes it easy to talk to the Whale Alert Enterprise API from PHP. Whether you want to query transactions and blocks, check blockchain status, or stream real-time whale alerts over WebSocket, the client gives you typed, immutable DTOs and robust error handling out of the box.

It is built around a few ideas that should feel natural in modern PHP:

Features

Installation

Install the package with Composer:

The package uses Guzzle by default, but you can substitute any PSR-18 HTTP client if you prefer.

Quick Start

REST API

This example creates a client, calls a public endpoint that does not need an API key, and then calls an authenticated endpoint and lists transactions:

WebSocket API

The WebSocket client streams real-time alerts. You register message and error handlers, connect, subscribe, and then call listen() to enter the read loop. Automatic reconnection is opt-in: set maxReconnects greater than zero. It sends RFC 6455 ping frames every 30 seconds by default and requires a pong within 60 seconds; set pingInterval to tune the ping cadence.

Laravel Integration

If you are building a Laravel application, the package can register itself and expose a friendly facade.

1. Add the service provider

For Laravel 11 and later, providers are usually registered in bootstrap/providers.php:

In older Laravel versions, add it to config/app.php instead.

2. Publish the config

Run this command to copy the default configuration into config/whale-alert.php:

3. Set your environment variables

Add these lines to your .env file:

4. Use the facade

5. Or inject the client

If you prefer dependency injection, type-hint the client in a controller or command:

The service provider registers WhaleAlertClient as a singleton, so the same configured instance is reused throughout the request lifecycle.

Configuration

Config Options

The Tigusigalpa\WhaleAlert\Config class controls client behavior:

Option Description Default
apiKey API key for authenticated endpoints ''
baseUrl API base URL https://leviathan.whale-alert.io
timeout HTTP timeout in seconds 30
maxRetries Max retry attempts for idempotent GETs 0 (disabled)
retryDelayMs Initial retry delay in milliseconds 500
retryMaxDelayMs Maximum retry delay cap in milliseconds 10000
userAgent User-Agent header whale-alert-php/1.0.0

You can also build a Config from an associative array, which is useful when loading values from Laravel config or a DI container:

Laravel Config

After publishing, config/whale-alert.php looks like this:

Error Handling

Each API error is mapped to a typed exception. You can catch specific exceptions for fine-grained handling, or catch the base ApiException for a generic fallback.

Exception Hierarchy

Exception HTTP Status Typical cause
UnauthorizedException 401 Missing or invalid API key
ForbiddenException 403 Insufficient permissions
NotFoundException 404 Unknown blockchain, transaction, or block
ValidationException 422 Parameter validation failure
RateLimitException 429 Too many requests
ServerException 5xx Provider-side error
MissingApiKeyException N/A (client-side) An authenticated endpoint was called without an API key

Retry Policy

Retries are disabled by default. Enable them by setting maxRetries on the Config object or in your Laravel config.

The retry policy is designed to be safe and predictable:

Pagination

List endpoints return a TransactionPage that includes the current slice of transactions and an optional next URL. You can iterate manually or use the built-in helper.

Manual next-page fetching

The same helpers exist for address transactions: getAddressTransactions, getAddressTransactionsNext.

Financial Precision

Cryptocurrency amounts can be very small or very large, and PHP's float type cannot represent them exactly. For that reason, all monetary fields in this library (fee, amount in addresses, and similar) are kept as string.

Keep them as strings for display or pass them to a decimal-arithmetic package such as brick/math. Only cast to float if you fully understand the precision implications.

API Reference

The client exposes one flat API that maps directly to the REST endpoints.

For the official API documentation, visit https://developer.whale-alert.io/api-account/documentation.

Examples

Runnable examples are in the examples/ directory:

Run them from the repository root:

Testing

The project includes unit tests for the REST client, WebSocket client, DTOs, and error handling. Install the test dependencies and run PHPUnit:

License

MIT — see LICENSE

Author

Igor Sazonov — github.com/tigusigalpa


All versions of whale-alert-php with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
guzzlehttp/guzzle Version ^7.15.2
psr/http-client Version ^1.0
psr/http-factory Version ^1.0
psr/http-message Version ^2.0
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 tigusigalpa/whale-alert-php contains the following files

Loading the files please wait ...