pub struct LighterClient { /* private fields */ }
Expand description
Main client for interacting with the Lighter API
Implementations§
Source§impl LighterClient
impl LighterClient
Sourcepub fn new(config: Config, private_key: &str) -> Result<Self>
pub fn new(config: Config, private_key: &str) -> Result<Self>
Create a new Lighter client with the given configuration and private key
Sourcepub fn from_mnemonic(
config: Config,
mnemonic: &str,
account_index: u32,
) -> Result<Self>
pub fn from_mnemonic( config: Config, mnemonic: &str, account_index: u32, ) -> Result<Self>
Create a new Lighter client with a mnemonic phrase
Sourcepub fn new_read_only(config: Config) -> Result<Self>
pub fn new_read_only(config: Config) -> Result<Self>
Create a new client with just an API key (no signing capabilities)
Sourcepub fn account(&self) -> &AccountApi
pub fn account(&self) -> &AccountApi
Access account-related API endpoints
Sourcepub fn transactions(&self) -> &TransactionApi
pub fn transactions(&self) -> &TransactionApi
Access transaction-related API endpoints
Sourcepub fn market_data(&self) -> &CandlestickApi
pub fn market_data(&self) -> &CandlestickApi
Access market data API endpoints
Sourcepub fn websocket(&mut self) -> &mut WebSocketClient
pub fn websocket(&mut self) -> &mut WebSocketClient
Access WebSocket client
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for LighterClient
impl !RefUnwindSafe for LighterClient
impl Send for LighterClient
impl Sync for LighterClient
impl Unpin for LighterClient
impl !UnwindSafe for LighterClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more