Crates.io | kuru-sdk-rs |
lib.rs | kuru-sdk-rs |
version | 0.1.1 |
source | src |
created_at | 2024-11-07 06:31:21.30972 |
updated_at | 2024-11-07 07:54:41.165344 |
description | Rust SDK to interact with Kuru Contracts |
homepage | |
repository | |
max_upload_size | |
id | 1439532 |
size | 270,144 |
A comprehensive Rust SDK for interacting with the Kuru Protocol, providing orderbook management, margin trading, and meta-transaction capabilities.
The Kuru SDK enables seamless interaction with Kuru Protocol's smart contracts, offering:
use kuru_sdk::{Orderbook, MarginAccount, Token, KuruForwarder};
// Initialize core components
let orderbook = Orderbook::new("0x...", provider.clone())?;
let margin_account = MarginAccount::new("main", "0x...", provider.clone())?;
let token = Token::new("USDC", "0x...", provider.clone())?;
// Place a limit order
let (tx_hash, order_id) = orderbook.add_buy_order(
"100.5", // price
"1.5", // size
false, // post_only
None, // gas_price
None // gas_limit
).await?;
// Deposit to margin account
let tx_hash = margin_account.deposit(
&user_address,
&token,
&amount
).await?;
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Kuru SDK โ
โ โ
โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโโ โ
โ โ Orderbook โ โ Margin โ โ Meta โ โ
โ โ System โโโโค Account โโโโค TX โ โ
โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโโ โ
โ โฒ โฒ โฒ โ
โ โ โ โ โ
โ โโโโโโดโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโดโโโโ โ
โ โ Order Processing System โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโ โ
โ โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโ โ
โ โ Inventory โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Order Management
Margin Trading
Meta Transactions
Real-time Updates
WebSocket integration
Order status tracking
Event processing
State management
# Run all tests
cargo test