cryptohopper
Official Rust SDK for the Cryptohopper API.
Status: 0.1.0-alpha.1 — full coverage of all 18 public API domains from day one. Matches
@cryptohopper/sdk,cryptohopper(Python),cryptohopper-go-sdk, and the Ruby gem at v0.4.0.
Install
Or in Cargo.toml:
[]
= "0.1.0-alpha.1"
= { = "1", = ["rt-multi-thread", "macros"] }
Requires Rust 1.76+.
Quickstart
use Client;
use json;
async
Authentication
Cryptohopper uses OAuth2 bearer tokens — see cryptohopper.com → developer dashboard to register an OAuth app.
use Client;
let ch = builder
.api_key
.app_key // optional
.build?;
Resources
use json;
// Read-only
ch.user.get.await?;
ch.hoppers.list.await?;
ch.hoppers.get.await?;
ch.exchange.ticker.await?;
ch.strategy.list.await?;
ch.backtest.limits.await?;
ch.market.homepage.await?;
// Write / trade
ch.hoppers.buy.await?;
ch.hoppers.config_update.await?;
ch.hoppers.panic.await?;
// A1 — signals / arbitrage / marketmaker / template
ch.signals.performance.await?;
ch.arbitrage.exchange_history.await?;
ch.marketmaker.get.await?;
ch.template.load.await?; // apply template 3 to hopper 42
// A2 — ai / platform / chart / subscription
ch.ai.get_credits.await?;
ch.ai.llm_analyze.await?;
ch.platform.bot_types.await?;
ch.subscription.plans.await?;
// A3 — social / tournaments / webhooks / app
ch.social.get_profile.await?;
ch.social.create_post.await?;
ch.tournaments.active.await?;
ch.webhooks.create.await?;
Client options
| Builder method | Default | Description |
|---|---|---|
api_key(...) |
— (required) | OAuth2 bearer token |
app_key(...) |
— | Optional OAuth client_id, sent as x-api-app-key |
base_url(...) |
https://api.cryptohopper.com/v1 |
Override for staging |
timeout(...) |
30s |
Per-request timeout |
max_retries(...) |
3 |
Retries on HTTP 429 (respects Retry-After). 0 disables. |
user_agent(...) |
— | Appended after cryptohopper-sdk-rust/<version> |
http_client(...) |
— | Bring your own reqwest::Client |
Errors
Every non-2xx response becomes a cryptohopper::Error:
use ;
use json;
# async
Known codes: Unauthorized, Forbidden, NotFound, RateLimited, ValidationError, DeviceUnauthorized, Conflict, ServerError, ServiceUnavailable, NetworkError, Timeout, Unknown. Unknown server-side codes pass through as ErrorCode::Other(String).
Rate limiting
On HTTP 429 the SDK retries with exponential backoff up to max_retries (default 3), honouring Retry-After. Pass .max_retries(0) to disable auto-retry.
Development
Release
Push a rs-v<version> git tag. The release workflow runs fmt + clippy + tests, verifies tag-version parity, and publishes to crates.io via CARGO_REGISTRY_TOKEN.
Related packages
| Language | Package | Install |
|---|---|---|
| Node.js | @cryptohopper/sdk |
npm i @cryptohopper/sdk |
| Python | cryptohopper |
pip install cryptohopper |
| Ruby | cryptohopper |
gem install cryptohopper --pre |
| Go | github.com/cryptohopper/cryptohopper-go-sdk |
go get github.com/cryptohopper/cryptohopper-go-sdk |
| CLI | cryptohopper-cli |
GitHub Releases binaries |
License
MIT — see LICENSE.