Download the PHP package happyslucker/changenow-api without Composer
On this page you can find all versions of the php package happyslucker/changenow-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download happyslucker/changenow-api
More information about happyslucker/changenow-api
Files in happyslucker/changenow-api
Package changenow-api
Short Description PHP library for ChangeNow cryptocurrency exchange REST API
License MIT
Informations about the package changenow-api
About ChangeNOW API
ChangeNOW API is a type-safe, feature-complete PHP library for the ChangeNOW cryptocurrency exchange REST API. It wraps both v1 and v2 endpoints with strictly typed DTOs, modular services, and full test coverage — no magic arrays, no guesswork.
✨ Features
- Full API Coverage: All 29 endpoints from v1 and v2 — currencies, rates, exchanges, private transfers, address validation, and more.
- Strictly Typed DTOs: Every response is a
readonlyvalue object with a staticfromArray()factory and full PHPDoc generics. - Modular Architecture: Separate service classes per API section (
common(),standardFlow(),fixedRateFlow(),markets(), etc.). - PSR-compliant HTTP: Built on
GuzzleHttp\ClientInterface— inject your own client for mocking or custom middleware. - Tested: 40+ PHPUnit tests covering every endpoint, including error responses and edge cases.
- API Key Authentication: Automatically sent via
x-api-keyheader — no manual header management.
📦 Installation
Ensure you have ext-curl and ext-json installed.
🚀 Quick Start
1. Fetch Available Currencies
Retrieve all tradable assets from the ChangeNOW platform.
2. Estimate & Create an Exchange
Get a rate estimate and immediately create a standard-flow transaction.
3. Fixed-Rate Exchange (Reverse)
Create a fixed-rate transaction where you specify the exact output amount.
4. Validate an Address
Check if a cryptocurrency address is valid before sending funds.
🛠️ Architecture
Module Structure
The library is split into domain-aligned services, each accessible via a lazy-loaded property on the client.
| Service | Endpoints | Description |
|---|---|---|
$client->common() |
v1 | Currencies, pairs, transaction status |
$client->standardFlow() |
v1 | Floating-rate estimation & creation |
$client->fixedRateFlow() |
v1 | Fixed-rate markets & creation |
$client->markets() |
v2 | Currencies, amounts, ranges, estimates |
$client->exchangeActions() |
v2 | Continue / refund public exchanges |
$client->privateTransfer() |
v2 | Private transfer estimation & creation |
$client->validate() |
v2 | Address & user address validation |
$client->v2Exchange() |
v2 | V2 exchange CRUD |
Data Transfer Objects
Every API response is mapped to a readonly DTO. No associative arrays leak out of the library — you always work with typed objects.
Exception Handling
All API errors throw ChangeNowException with the upstream message and HTTP status code.
⚙️ Requirements
- PHP: 8.4 or higher
- Extensions:
curl— Required by Guzzle for HTTP transportjson— Required for request/response serialisationmbstring— Recommended for multibyte string handling
📜 License
The MIT License (MIT).