pub struct StreamApi { /* private fields */ }Expand description
Stream API client for real-time data subscriptions
Implementations§
Source§impl StreamApi
impl StreamApi
Sourcepub fn is_connected(&self) -> bool
pub fn is_connected(&self) -> bool
Check if connected
Sourcepub async fn connect(&self) -> Result<(), ChainStreamError>
pub async fn connect(&self) -> Result<(), ChainStreamError>
Connect to the WebSocket server
Sourcepub async fn disconnect(&self)
pub async fn disconnect(&self)
Disconnect from the WebSocket server
Sourcepub async fn subscribe<F>(
&self,
channel: &str,
callback: F,
filter: Option<&str>,
method_name: Option<&str>,
) -> Result<Unsubscribe, ChainStreamError>
pub async fn subscribe<F>( &self, channel: &str, callback: F, filter: Option<&str>, method_name: Option<&str>, ) -> Result<Unsubscribe, ChainStreamError>
Subscribe to a channel with a raw callback
Sourcepub async fn subscribe_token_candles<F>(
&self,
chain: &str,
token_address: &str,
resolution: Resolution,
callback: F,
filter: Option<&str>,
) -> Result<Unsubscribe, ChainStreamError>
pub async fn subscribe_token_candles<F>( &self, chain: &str, token_address: &str, resolution: Resolution, callback: F, filter: Option<&str>, ) -> Result<Unsubscribe, ChainStreamError>
Subscribe to token candle data
Sourcepub async fn subscribe_token_stats<F>(
&self,
chain: &str,
token_address: &str,
callback: F,
filter: Option<&str>,
) -> Result<Unsubscribe, ChainStreamError>
pub async fn subscribe_token_stats<F>( &self, chain: &str, token_address: &str, callback: F, filter: Option<&str>, ) -> Result<Unsubscribe, ChainStreamError>
Subscribe to token statistics
Sourcepub async fn subscribe_new_token<F>(
&self,
chain: &str,
callback: F,
filter: Option<&str>,
) -> Result<Unsubscribe, ChainStreamError>
pub async fn subscribe_new_token<F>( &self, chain: &str, callback: F, filter: Option<&str>, ) -> Result<Unsubscribe, ChainStreamError>
Subscribe to new tokens
Sourcepub async fn subscribe_token_trade<F>(
&self,
chain: &str,
token_address: &str,
callback: F,
filter: Option<&str>,
) -> Result<Unsubscribe, ChainStreamError>
pub async fn subscribe_token_trade<F>( &self, chain: &str, token_address: &str, callback: F, filter: Option<&str>, ) -> Result<Unsubscribe, ChainStreamError>
Subscribe to token trades
Sourcepub async fn subscribe_wallet_balance<F>(
&self,
chain: &str,
wallet_address: &str,
callback: F,
filter: Option<&str>,
) -> Result<Unsubscribe, ChainStreamError>
pub async fn subscribe_wallet_balance<F>( &self, chain: &str, wallet_address: &str, callback: F, filter: Option<&str>, ) -> Result<Unsubscribe, ChainStreamError>
Subscribe to wallet balance
Sourcepub async fn subscribe_token_holders<F>(
&self,
chain: &str,
token_address: &str,
callback: F,
filter: Option<&str>,
) -> Result<Unsubscribe, ChainStreamError>
pub async fn subscribe_token_holders<F>( &self, chain: &str, token_address: &str, callback: F, filter: Option<&str>, ) -> Result<Unsubscribe, ChainStreamError>
Subscribe to token holders
Sourcepub async fn subscribe_token_supply<F>(
&self,
chain: &str,
token_address: &str,
callback: F,
filter: Option<&str>,
) -> Result<Unsubscribe, ChainStreamError>
pub async fn subscribe_token_supply<F>( &self, chain: &str, token_address: &str, callback: F, filter: Option<&str>, ) -> Result<Unsubscribe, ChainStreamError>
Subscribe to token supply
Sourcepub async fn subscribe_dex_pool_balance<F>(
&self,
chain: &str,
pool_address: &str,
callback: F,
filter: Option<&str>,
) -> Result<Unsubscribe, ChainStreamError>
pub async fn subscribe_dex_pool_balance<F>( &self, chain: &str, pool_address: &str, callback: F, filter: Option<&str>, ) -> Result<Unsubscribe, ChainStreamError>
Subscribe to DEX pool balance
Sourcepub async fn subscribe_token_max_liquidity<F>(
&self,
chain: &str,
token_address: &str,
callback: F,
filter: Option<&str>,
) -> Result<Unsubscribe, ChainStreamError>
pub async fn subscribe_token_max_liquidity<F>( &self, chain: &str, token_address: &str, callback: F, filter: Option<&str>, ) -> Result<Unsubscribe, ChainStreamError>
Subscribe to token max liquidity
Sourcepub async fn subscribe_token_total_liquidity<F>(
&self,
chain: &str,
token_address: &str,
callback: F,
filter: Option<&str>,
) -> Result<Unsubscribe, ChainStreamError>
pub async fn subscribe_token_total_liquidity<F>( &self, chain: &str, token_address: &str, callback: F, filter: Option<&str>, ) -> Result<Unsubscribe, ChainStreamError>
Subscribe to token total liquidity
Sourcepub async fn subscribe_wallet_pnl<F>(
&self,
chain: &str,
wallet_address: &str,
callback: F,
filter: Option<&str>,
) -> Result<Unsubscribe, ChainStreamError>
pub async fn subscribe_wallet_pnl<F>( &self, chain: &str, wallet_address: &str, callback: F, filter: Option<&str>, ) -> Result<Unsubscribe, ChainStreamError>
Subscribe to wallet PnL
Sourcepub async fn subscribe_new_tokens_metadata<F>(
&self,
chain: &str,
callback: F,
filter: Option<&str>,
) -> Result<Unsubscribe, ChainStreamError>
pub async fn subscribe_new_tokens_metadata<F>( &self, chain: &str, callback: F, filter: Option<&str>, ) -> Result<Unsubscribe, ChainStreamError>
Subscribe to new tokens metadata
Sourcepub async fn subscribe_ranking_tokens_list<F>(
&self,
chain: &str,
ranking_type: RankingType,
callback: F,
filter: Option<&str>,
) -> Result<Unsubscribe, ChainStreamError>
pub async fn subscribe_ranking_tokens_list<F>( &self, chain: &str, ranking_type: RankingType, callback: F, filter: Option<&str>, ) -> Result<Unsubscribe, ChainStreamError>
Subscribe to ranking tokens list
Auto Trait Implementations§
impl Freeze for StreamApi
impl !RefUnwindSafe for StreamApi
impl Send for StreamApi
impl Sync for StreamApi
impl Unpin for StreamApi
impl !UnwindSafe for StreamApi
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