Skip to main content

Crate fyers

Crate fyers 

Source
Expand description

§fyers

An idiomatic, strongly-typed, async Rust client for the Fyers Trading API.

§Overview

This crate provides a type-safe interface to the Fyers REST API, modeling requests and responses as Rust types rather than exposing raw JSON values.

§Example

use fyers::{Fyers, FyersError};

#[tokio::main]
async fn main() -> Result<(), FyersError> {
    let fyers = Fyers::new("CLIENT_ID", "ACCESS_TOKEN");

    let profile = fyers.profile().await?;
    println!("{profile:?}");

    Ok(())
}

Re-exports§

pub use client::Fyers;

Modules§

auth
Authentication helpers for the Fyers API.
client
Fyers Client.

Structs§

Candle
A single OHLCV candle returned by the Fyers History API.
HistoryBuilder
Builder for creating a HistoryRequest used with Fyers::history.
HistoryRequest
The request type sent to the Fyers history API.
Order
Returned on successfully placing an order.
OrderBuilder
Builder for creating an OrderRequest used with Fyers::place_order.
OrderRequest
The request type sent to the Fyers place order API.
Profile
Basic account profile information returned by the Fyers API.

Enums§

CandleResolution
Candle timeframe used when requesting historical market data.
ExitPositionResult
Result of an exit position operation.
FyersError
Errors that can occur when interacting with the Fyers API.
OrderType
Type of order to place.
ProductType
Product type for an order.
Side
Order side used when placing trades.
Validity
Order validity specifying how long the order remains active.

Functions§

ist_datetime
Create a UTC DateTime from an IST date/time.