Expand description
Unofficial Rust SDK for the Revolut X crypto exchange REST API.
revolutx is a handwritten, domain-oriented SDK aimed at trading bots and
automation. The local OpenAPI specification is used as a contract and
regression-test source, but generated OpenAPI types are not part of the
public API. Prices, quantities, balances, and fees use
rust_decimal::Decimal (re-exported as Decimal); they are never f64.
§Authentication
Authenticated requests are signed automatically with Ed25519 — callers never
construct the X-Revx-Timestamp or X-Revx-Signature headers themselves.
Generate a key pair with:
openssl genpkey -algorithm ed25519 -out private.pem
openssl pkey -in private.pem -pubout -out public.pem§Example
use revolutx::{Environment, RevolutXClient};
let client = RevolutXClient::builder()
.api_key("your-api-key")
.private_key_pem(std::fs::read_to_string("private.pem").unwrap())
.environment(Environment::Production)
.build()?;
// Read-only: fetch balances and an order book.
let balances = client.balances().get_all().await?;
let book = client.market_data().order_book("BTC-USD").await?;
println!("{} balances, {} bid levels", balances.len(), book.bids.len());Public market data needs no credentials:
let client = revolutx::RevolutXClient::builder().build()?;
let book = client.market_data().public_order_book("BTC-USD").await?;
println!("best bid level count: {}", book.bids.len());§Disclaimer
This crate is not affiliated with Revolut. Trading automation carries financial risk; callers are responsible for their own validation, risk controls, and credential security. The SDK handles API access, typing, signing, and error reporting only — it does not provide trading strategy or risk management.
Re-exports§
pub use access::AccessLevel;pub use agent::AgentControl;pub use agent::AgentExecutor;pub use agent::AgentServer;pub use agent::AuthOutcome;pub use agent::AuthToken;pub use agent::default_socket_path;pub use client::ClientBuilder;pub use client::Environment;pub use client::RevolutXClient;pub use config::ClientConfig;pub use config::client_from_env;pub use error::ApiError;pub use error::ApiErrorKind;pub use error::Error;pub use error::Result;pub use keystore::Keystore;pub use keystore::KeystoreError;pub use model::Page;pub use model::RawPage;pub use model::common::ClientOrderId;pub use model::common::OrderId;pub use model::common::Price;pub use model::common::Quantity;pub use model::common::Side;pub use model::common::Symbol;pub use model::common::Timestamp;pub use transport::LocalExecutor;pub use transport::RawResponse;pub use transport::RequestExecutor;pub use transport::RequestSpec;
Modules§
- access
- Access tiers — the capability ladder shared by the signing agent’s authoritative gate and the high-level command layer.
- agent
- Signing-agent proxy (
agentfeature, unix-only). - api
- Endpoint groups.
- client
- Client configuration and endpoint entry points.
- commands
- High-level command layer (
commandsfeature). - config
- Build a
RevolutXClientfrom credentials and a target environment, with a fallback to theREVOLUTX_*environment variables. - error
- Public error model.
- fix
- FIX 4.4 client (market data and trading). Enabled by the
fixfeature. - keystore
- Encrypted credential vault (
keystorefeature). - model
- Public domain models.
- transport
- Request execution and the pluggable transport seam.
Structs§
- Decimal
Decimalrepresents a 128 bit representation of a fixed-precision decimal number. The finite set of values of typeDecimalare of the form m / 10e, where m is an integer such that -296 < m < 296, and e is an integer between 0 and 28 inclusive.- Ed25519
Signer - The default
Signer: holds the API key and the Ed25519 signing key in memory for the lifetime of the client. Both are zeroized on drop (the key viaed25519-dalek’szeroizesupport). - Generated
KeyPair - A freshly generated Ed25519 key pair, PEM-encoded, from
generate_key_pair. - Request
Auth - The authentication material for a single request.
Traits§
- Signer
- Authenticates Revolut X requests.
Functions§
- generate_
key_ pair - Generates a new Ed25519 key pair from operating-system randomness.
- public_
pem_ from_ private_ pem - Derives the SPKI public-key PEM from a PKCS#8 private-key PEM.