pacifica_rust_sdk

Crates.iopacifica_rust_sdk
lib.rspacifica_rust_sdk
version0.1.1
created_at2025-09-21 20:37:29.500738+00
updated_at2025-09-21 23:07:58.713595+00
descriptionRust SDK for pacifica.fi exchange
homepage
repositoryhttps://github.com/Neiroleptik/pacifica_rust_sdk
max_upload_size
id1849163
size400,645
(Neiroleptik)

documentation

README

Pacifica Rust SDK

This is a community Rust SDK for the Pacifica exchange.
It provides both Asynchronous REST and WebSocket clients, utilities for tick/lot handling, signing, etc., and typed models for working with the API.



Table of Contents

  1. Installation
  2. Usage example
  3. Project structure
  4. Async and error handling

Installation

Add this SDK as a dependency in Cargo.toml:

For the latest development version from GitHub:

[dependencies]
pacifica_rust_sdk = { git = "https://github.com/Neiroleptik/pacifica_rust_sdk.git", branch = "main" }

For the latest stable version on crates.io:

pacifica_rust_sdk = "x.y.z" 

Note: The GitHub version may contain the latest features and fixes, but it could be unstable.
The crates.io version is stable and recommended for production use.


Usage example

use pacifica_rust_sdk::common::errors::ExchangeError;
use pacifica_rust_sdk::rest::rest_client::RestClient;
use pacifica_rust_sdk::info::info_client::InfoClient;
use pacifica_rust_sdk::models::info::response::market::MarketModel;

#[tokio::main]
async fn main() -> Result<(), ExchangeError> {
    // Create InfoClient for mainnet without WebSocket
    let info = InfoClient::new(
        true,        // is_mainnet
        false,       // enable_ws
        None,        // api_key
    ).await?;

    // Access market cache
    let markets: &std::collections::HashMap<String, MarketModel> = &info.market_cache;

    for (symbol, m) in markets {
        println!("{}: {:?}", symbol, m);
    }

    Ok(())
}

If WebSocket is enabled, you can subscribe to channels and receive live updates.


Project structure

  • rest - REST client and HTTP utilities
  • ws - WebSocket client and subscriptions
  • info - information client for market metadata
  • common - errors, tick/lot utils, helpers
  • models - typed request/response structure

Commit count: 37

cargo fmt