Download the PHP package csba92/revx-php without Composer
On this page you can find all versions of the php package csba92/revx-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package revx-php
revx-php
An unofficial, mostly vibe-coded, PHP 8.4+ client for the Revolut X REST API. It covers public market data, authenticated account data, and signed order lifecycle operations without framework dependencies.
Requirements
- PHP 8.4 or later
curl,openssl,sodium, andjsonPHP extensions- An Ed25519 private key and Revolut X API key for account endpoints
Installation
Install from Packagist once the repository has been published:
Until then, Composer can install a tagged GitHub release directly. Replace the repository URL with the account that owns revx-php:
For development from a clone:
Quick start
Public market data needs no credentials:
For account data, pass credentials from your application's configuration:
All monetary values are returned by the API as strings. Keep them as strings or use a decimal library; avoid converting them to floats for financial calculations.
Environment configuration
Client::fromEnvironment() reads the following optional variables:
| Variable | Purpose |
|---|---|
REVX_API_KEY |
Revolut X API key |
REVX_PRIVATE_KEY |
PEM-encoded Ed25519 private key |
REVX_PRIVATE_KEY_PATH |
Path to a PEM key; used when REVX_PRIVATE_KEY is absent |
REVX_BASE_URL |
API host override, useful for controlled test environments |
REVX_TIMEOUT |
Request timeout in seconds; defaults to 30 |
Use either REVX_PRIVATE_KEY or REVX_PRIVATE_KEY_PATH. The private-key value takes precedence.
Do not commit a .env file or a PEM file. The supplied .gitignore excludes both.
API
Market data
ticker() returns the first ticker object or null when the requested symbol is not returned. The collection methods return the API response unchanged.
Account data
Account endpoints require both an API key and an Ed25519 private key.
List endpoints preserve the exchange's { data, metadata } response shape, including any pagination cursor in metadata.next_cursor.
Trades and fills
All three methods return the response payload from Revolut X. Public and private history include pagination information in metadata.next_cursor when another page is available.
Trading
Trading calls require an authenticated client. Supply your own UUID for every clientOrderId; this is important for safely locating an order when a network reply is lost.
place() sends the configuration object as provided, so it can represent every order type supported by the current Revolut X API. replace() likewise forwards the permitted replacement fields without narrowing the exchange contract.
Authentication
The client signs authenticated requests with Ed25519. The signature covers the exact string specified by Revolut X:
It then sends X-Revx-API-Key, X-Revx-Timestamp, and X-Revx-Signature headers. The private key remains inside your process; it is never sent over the network.
Generate an Ed25519 key pair with OpenSSL, then register its public key in Revolut X before creating an API key:
Treat private.pem and the API key as production secrets. Restrict the key file to its owner and rotate the API key immediately if it is exposed.
Errors
All library exceptions extend Revx\Exception\RevxException.
AuthenticationException— credentials are missing or the private key cannot be used.ApiException— the exchange returned a non-2xx response. It exposesstatus,response, andretryAfterwhen provided.NetworkException— cURL could not complete the request.
Scope
This package exposes:
- public currencies, pairs, tickers, candles, and order books;
- authenticated balances and order lookups;
- public and authenticated trade history, plus per-order fills;
- order placement, replacement, cancellation, and cancellation of all active orders.
Trading operations send real instructions to the exchange. Validate application inputs, use least-privilege API keys, and treat order placement and cancellation as production-impacting actions.
Testing
The test suite uses an in-memory HTTP transport, so it makes no network calls and needs no real Revolut X credentials.
License
MIT. See LICENSE.
All versions of revx-php with dependencies
ext-curl Version *
ext-openssl Version *
ext-sodium Version *
ext-json Version *