Struct ApiClient

Source
pub struct ApiClient<T> { /* private fields */ }

Implementations§

Source§

impl ApiClient<Channel>

Source

pub async fn connect<D>(dst: D) -> Result<Self, Error>
where D: TryInto<Endpoint>, D::Error: Into<StdError>,

Attempt to create a new client by connecting to a given endpoint.

Source§

impl<T> ApiClient<T>
where T: GrpcService<BoxBody>, T::Error: Into<StdError>, T::ResponseBody: Body<Data = Bytes> + Send + 'static, <T::ResponseBody as Body>::Error: Into<StdError> + Send,

Source

pub fn new(inner: T) -> Self

Source

pub fn with_origin(inner: T, origin: Uri) -> Self

Source

pub fn with_interceptor<F>( inner: T, interceptor: F, ) -> ApiClient<InterceptedService<T, F>>
where F: Interceptor, T::ResponseBody: Default, T: Service<Request<BoxBody>, Response = Response<<T as GrpcService<BoxBody>>::ResponseBody>>, <T as Service<Request<BoxBody>>>::Error: Into<StdError> + Send + Sync,

Source

pub fn send_compressed(self, encoding: CompressionEncoding) -> Self

Compress requests with the given encoding.

This requires the server to support it otherwise it might respond with an error.

Source

pub fn accept_compressed(self, encoding: CompressionEncoding) -> Self

Enable decompressing responses.

Source

pub fn max_decoding_message_size(self, limit: usize) -> Self

Limits the maximum size of a decoded message.

Default: 4MB

Source

pub fn max_encoding_message_size(self, limit: usize) -> Self

Limits the maximum size of an encoded message.

Default: usize::MAX

Source

pub async fn get_rate_limit( &mut self, request: impl IntoRequest<GetRateLimitRequest>, ) -> Result<Response<GetRateLimitResponse>, Status>

Source

pub async fn get_transaction( &mut self, request: impl IntoRequest<GetTransactionRequest>, ) -> Result<Response<GetTransactionResponse>, Status>

Source

pub async fn post_submit_v2( &mut self, request: impl IntoRequest<PostSubmitRequest>, ) -> Result<Response<PostSubmitResponse>, Status>

Source

pub async fn post_submit_batch_v2( &mut self, request: impl IntoRequest<PostSubmitBatchRequest>, ) -> Result<Response<PostSubmitBatchResponse>, Status>

Source

pub async fn post_submit_snipe_v2( &mut self, request: impl IntoRequest<PostSubmitSnipeRequest>, ) -> Result<Response<PostSubmitSnipeResponse>, Status>

Source

pub async fn post_submit_paladin_v2( &mut self, request: impl IntoRequest<PostSubmitPaladinRequest>, ) -> Result<Response<PostSubmitResponse>, Status>

Source

pub async fn get_raydium_pools( &mut self, request: impl IntoRequest<GetRaydiumPoolsRequest>, ) -> Result<Response<GetRaydiumPoolsResponse>, Status>

Raydium V2

Source

pub async fn get_raydium_pool_reserve( &mut self, request: impl IntoRequest<GetRaydiumPoolReserveRequest>, ) -> Result<Response<GetRaydiumPoolReserveResponse>, Status>

Source

pub async fn get_raydium_quotes( &mut self, request: impl IntoRequest<GetRaydiumQuotesRequest>, ) -> Result<Response<GetRaydiumQuotesResponse>, Status>

Source

pub async fn get_pump_fun_quotes( &mut self, request: impl IntoRequest<GetPumpFunQuotesRequest>, ) -> Result<Response<GetPumpFunQuotesResponse>, Status>

Source

pub async fn get_raydium_cpmm_quotes( &mut self, request: impl IntoRequest<GetRaydiumCpmmQuotesRequest>, ) -> Result<Response<GetRaydiumCpmmQuotesResponse>, Status>

Source

pub async fn get_raydium_prices( &mut self, request: impl IntoRequest<GetRaydiumPricesRequest>, ) -> Result<Response<GetRaydiumPricesResponse>, Status>

Source

pub async fn get_raydium_clmm_quotes( &mut self, request: impl IntoRequest<GetRaydiumClmmQuotesRequest>, ) -> Result<Response<GetRaydiumClmmQuotesResponse>, Status>

Source

pub async fn get_raydium_clmm_pools( &mut self, request: impl IntoRequest<GetRaydiumClmmPoolsRequest>, ) -> Result<Response<GetRaydiumClmmPoolsResponse>, Status>

Source

pub async fn post_raydium_clmm_swap( &mut self, request: impl IntoRequest<PostRaydiumSwapRequest>, ) -> Result<Response<PostRaydiumSwapResponse>, Status>

Source

pub async fn post_raydium_clmm_route_swap( &mut self, request: impl IntoRequest<PostRaydiumRouteSwapRequest>, ) -> Result<Response<PostRaydiumRouteSwapResponse>, Status>

Source

pub async fn post_raydium_swap( &mut self, request: impl IntoRequest<PostRaydiumSwapRequest>, ) -> Result<Response<PostRaydiumSwapResponse>, Status>

Source

pub async fn post_raydium_route_swap( &mut self, request: impl IntoRequest<PostRaydiumRouteSwapRequest>, ) -> Result<Response<PostRaydiumRouteSwapResponse>, Status>

Source

pub async fn post_raydium_cpmm_swap( &mut self, request: impl IntoRequest<PostRaydiumCpmmSwapRequest>, ) -> Result<Response<PostRaydiumCpmmSwapResponse>, Status>

Source

pub async fn get_jupiter_quotes( &mut self, request: impl IntoRequest<GetJupiterQuotesRequest>, ) -> Result<Response<GetJupiterQuotesResponse>, Status>

Jupiter V2

Source

pub async fn get_jupiter_prices( &mut self, request: impl IntoRequest<GetJupiterPricesRequest>, ) -> Result<Response<GetJupiterPricesResponse>, Status>

Source

pub async fn post_jupiter_swap( &mut self, request: impl IntoRequest<PostJupiterSwapRequest>, ) -> Result<Response<PostJupiterSwapResponse>, Status>

Source

pub async fn post_raydium_swap_instructions( &mut self, request: impl IntoRequest<PostRaydiumSwapInstructionsRequest>, ) -> Result<Response<PostRaydiumSwapInstructionsResponse>, Status>

Source

pub async fn post_jupiter_swap_instructions( &mut self, request: impl IntoRequest<PostJupiterSwapInstructionsRequest>, ) -> Result<Response<PostJupiterSwapInstructionsResponse>, Status>

Source

pub async fn post_jupiter_route_swap( &mut self, request: impl IntoRequest<PostJupiterRouteSwapRequest>, ) -> Result<Response<PostJupiterRouteSwapResponse>, Status>

Source

pub async fn get_markets_v2( &mut self, request: impl IntoRequest<GetMarketsRequestV2>, ) -> Result<Response<GetMarketsResponseV2>, Status>

Source

pub async fn get_tickers_v2( &mut self, request: impl IntoRequest<GetTickersRequestV2>, ) -> Result<Response<GetTickersResponseV2>, Status>

Source

pub async fn get_orderbook_v2( &mut self, request: impl IntoRequest<GetOrderbookRequestV2>, ) -> Result<Response<GetOrderbookResponseV2>, Status>

Source

pub async fn get_market_depth_v2( &mut self, request: impl IntoRequest<GetMarketDepthRequestV2>, ) -> Result<Response<GetMarketDepthResponseV2>, Status>

Source

pub async fn post_order_v2( &mut self, request: impl IntoRequest<PostOrderRequestV2>, ) -> Result<Response<PostOrderResponse>, Status>

Source

pub async fn post_cancel_order_v2( &mut self, request: impl IntoRequest<PostCancelOrderRequestV2>, ) -> Result<Response<PostCancelOrderResponseV2>, Status>

Source

pub async fn post_replace_order_v2( &mut self, request: impl IntoRequest<PostReplaceOrderRequestV2>, ) -> Result<Response<PostOrderResponse>, Status>

Source

pub async fn post_zeta_cross_margin_account( &mut self, request: impl IntoRequest<PostZetaCrossMarginAccountRequest>, ) -> Result<Response<PostZetaCrossMarginAccountResponse>, Status>

Source

pub async fn post_settle_v2( &mut self, request: impl IntoRequest<PostSettleRequestV2>, ) -> Result<Response<PostSettleResponse>, Status>

Source

pub async fn get_open_orders_v2( &mut self, request: impl IntoRequest<GetOpenOrdersRequestV2>, ) -> Result<Response<GetOpenOrdersResponseV2>, Status>

Source

pub async fn get_unsettled_v2( &mut self, request: impl IntoRequest<GetUnsettledRequestV2>, ) -> Result<Response<GetUnsettledResponse>, Status>

Source

pub async fn get_price( &mut self, request: impl IntoRequest<GetPriceRequest>, ) -> Result<Response<GetPriceResponse>, Status>

Source

pub async fn get_markets( &mut self, request: impl IntoRequest<GetMarketsRequest>, ) -> Result<Response<GetMarketsResponse>, Status>

Source

pub async fn get_pools( &mut self, request: impl IntoRequest<GetPoolsRequest>, ) -> Result<Response<GetPoolsResponse>, Status>

Source

pub async fn get_tickers( &mut self, request: impl IntoRequest<GetTickersRequest>, ) -> Result<Response<GetTickersResponse>, Status>

Source

pub async fn get_kline( &mut self, request: impl IntoRequest<GetKlineRequest>, ) -> Result<Response<GetKlineResponse>, Status>

Source

pub async fn get_orderbook( &mut self, request: impl IntoRequest<GetOrderbookRequest>, ) -> Result<Response<GetOrderbookResponse>, Status>

Source

pub async fn get_market_depth( &mut self, request: impl IntoRequest<GetMarketDepthRequest>, ) -> Result<Response<GetMarketDepthResponse>, Status>

Source

pub async fn get_trades( &mut self, request: impl IntoRequest<GetTradesRequest>, ) -> Result<Response<GetTradesResponse>, Status>

Source

pub async fn get_quotes( &mut self, request: impl IntoRequest<GetQuotesRequest>, ) -> Result<Response<GetQuotesResponse>, Status>

Source

pub async fn get_server_time( &mut self, request: impl IntoRequest<GetServerTimeRequest>, ) -> Result<Response<GetServerTimeResponse>, Status>

system API

Source

pub async fn get_recent_block_hash( &mut self, request: impl IntoRequest<GetRecentBlockHashRequest>, ) -> Result<Response<GetRecentBlockHashResponse>, Status>

Source

pub async fn get_recent_block_hash_v2( &mut self, request: impl IntoRequest<GetRecentBlockHashRequestV2>, ) -> Result<Response<GetRecentBlockHashResponseV2>, Status>

Source

pub async fn get_priority_fee( &mut self, request: impl IntoRequest<GetPriorityFeeRequest>, ) -> Result<Response<GetPriorityFeeResponse>, Status>

Source

pub async fn get_priority_fee_by_program( &mut self, request: impl IntoRequest<GetPriorityFeeByProgramRequest>, ) -> Result<Response<GetPriorityFeeByProgramResponse>, Status>

Source

pub async fn get_account_balance( &mut self, request: impl IntoRequest<GetAccountBalanceRequest>, ) -> Result<Response<GetAccountBalanceResponse>, Status>

account endpoints

Source

pub async fn get_token_accounts( &mut self, request: impl IntoRequest<GetTokenAccountsRequest>, ) -> Result<Response<GetTokenAccountsResponse>, Status>

Source

pub async fn get_account_balance_v2( &mut self, request: impl IntoRequest<GetAccountBalanceRequest>, ) -> Result<Response<GetAccountBalanceResponse>, Status>

Source

pub async fn post_order( &mut self, request: impl IntoRequest<PostOrderRequest>, ) -> Result<Response<PostOrderResponse>, Status>

trade endpoints

Source

pub async fn post_submit( &mut self, request: impl IntoRequest<PostSubmitRequest>, ) -> Result<Response<PostSubmitResponse>, Status>

Source

pub async fn post_submit_batch( &mut self, request: impl IntoRequest<PostSubmitBatchRequest>, ) -> Result<Response<PostSubmitBatchResponse>, Status>

Source

pub async fn post_cancel_order( &mut self, request: impl IntoRequest<PostCancelOrderRequest>, ) -> Result<Response<PostCancelOrderResponse>, Status>

Source

pub async fn post_cancel_by_client_order_id( &mut self, request: impl IntoRequest<PostCancelByClientOrderIdRequest>, ) -> Result<Response<PostCancelOrderResponse>, Status>

Source

pub async fn post_cancel_all( &mut self, request: impl IntoRequest<PostCancelAllRequest>, ) -> Result<Response<PostCancelAllResponse>, Status>

Source

pub async fn post_replace_by_client_order_id( &mut self, request: impl IntoRequest<PostOrderRequest>, ) -> Result<Response<PostOrderResponse>, Status>

Source

pub async fn post_replace_order( &mut self, request: impl IntoRequest<PostReplaceOrderRequest>, ) -> Result<Response<PostOrderResponse>, Status>

Source

pub async fn post_settle( &mut self, request: impl IntoRequest<PostSettleRequest>, ) -> Result<Response<PostSettleResponse>, Status>

Source

pub async fn post_trade_swap( &mut self, request: impl IntoRequest<TradeSwapRequest>, ) -> Result<Response<TradeSwapResponse>, Status>

Source

pub async fn get_orders( &mut self, request: impl IntoRequest<GetOrdersRequest>, ) -> Result<Response<GetOrdersResponse>, Status>

Source

pub async fn get_open_orders( &mut self, request: impl IntoRequest<GetOpenOrdersRequest>, ) -> Result<Response<GetOpenOrdersResponse>, Status>

Source

pub async fn get_order_by_id( &mut self, request: impl IntoRequest<GetOrderByIdRequest>, ) -> Result<Response<GetOrderByIdResponse>, Status>

Source

pub async fn get_unsettled( &mut self, request: impl IntoRequest<GetUnsettledRequest>, ) -> Result<Response<GetUnsettledResponse>, Status>

Source

pub async fn post_route_trade_swap( &mut self, request: impl IntoRequest<RouteTradeSwapRequest>, ) -> Result<Response<TradeSwapResponse>, Status>

Source

pub async fn get_orderbooks_stream( &mut self, request: impl IntoRequest<GetOrderbooksRequest>, ) -> Result<Response<Streaming<GetOrderbooksStreamResponse>>, Status>

streaming endpoints

Source

pub async fn get_market_depths_stream( &mut self, request: impl IntoRequest<GetMarketDepthsRequest>, ) -> Result<Response<Streaming<GetMarketDepthsStreamResponse>>, Status>

Source

pub async fn get_tickers_stream( &mut self, request: impl IntoRequest<GetTickersStreamRequest>, ) -> Result<Response<Streaming<GetTickersStreamResponse>>, Status>

Source

pub async fn get_zeta_transaction_stream( &mut self, request: impl IntoRequest<GetZetaTransactionStreamRequest>, ) -> Result<Response<Streaming<GetZetaTransactionStreamResponse>>, Status>

Source

pub async fn get_trades_stream( &mut self, request: impl IntoRequest<GetTradesRequest>, ) -> Result<Response<Streaming<GetTradesStreamResponse>>, Status>

Source

pub async fn get_order_status_stream( &mut self, request: impl IntoRequest<GetOrderStatusStreamRequest>, ) -> Result<Response<Streaming<GetOrderStatusStreamResponse>>, Status>

Source

pub async fn get_recent_block_hash_stream( &mut self, request: impl IntoRequest<GetRecentBlockHashRequest>, ) -> Result<Response<Streaming<GetRecentBlockHashResponse>>, Status>

Source

pub async fn get_block_stream( &mut self, request: impl IntoRequest<GetBlockStreamRequest>, ) -> Result<Response<Streaming<GetBlockStreamResponse>>, Status>

Source

pub async fn get_priority_fee_stream( &mut self, request: impl IntoRequest<GetPriorityFeeRequest>, ) -> Result<Response<Streaming<GetPriorityFeeResponse>>, Status>

Source

pub async fn get_priority_fee_by_program_stream( &mut self, request: impl IntoRequest<GetPriorityFeeByProgramRequest>, ) -> Result<Response<Streaming<GetPriorityFeeByProgramResponse>>, Status>

Source

pub async fn get_bundle_tip_stream( &mut self, request: impl IntoRequest<GetBundleTipRequest>, ) -> Result<Response<Streaming<GetBundleTipResponse>>, Status>

Source

pub async fn get_quotes_stream( &mut self, request: impl IntoRequest<GetQuotesStreamRequest>, ) -> Result<Response<Streaming<GetQuotesStreamResponse>>, Status>

Source

pub async fn get_pool_reserves_stream( &mut self, request: impl IntoRequest<GetPoolReservesStreamRequest>, ) -> Result<Response<Streaming<GetPoolReservesStreamResponse>>, Status>

Source

pub async fn get_prices_stream( &mut self, request: impl IntoRequest<GetPricesStreamRequest>, ) -> Result<Response<Streaming<GetPricesStreamResponse>>, Status>

Source

pub async fn get_new_raydium_pools_stream( &mut self, request: impl IntoRequest<GetNewRaydiumPoolsRequest>, ) -> Result<Response<Streaming<GetNewRaydiumPoolsResponse>>, Status>

Source

pub async fn get_new_raydium_pools_by_transaction_stream( &mut self, request: impl IntoRequest<GetNewRaydiumPoolsByTransactionRequest>, ) -> Result<Response<Streaming<GetNewRaydiumPoolsByTransactionResponse>>, Status>

Source

pub async fn get_swaps_stream( &mut self, request: impl IntoRequest<GetSwapsStreamRequest>, ) -> Result<Response<Streaming<GetSwapsStreamResponse>>, Status>

Source

pub async fn get_pump_fun_swaps_stream( &mut self, request: impl IntoRequest<GetPumpFunSwapsStreamRequest>, ) -> Result<Response<Streaming<GetPumpFunSwapsStreamResponse>>, Status>

Source

pub async fn get_pump_fun_new_tokens_stream( &mut self, request: impl IntoRequest<GetPumpFunNewTokensStreamRequest>, ) -> Result<Response<Streaming<GetPumpFunNewTokensStreamResponse>>, Status>

Source

pub async fn get_pump_fun_new_amm_pool_stream( &mut self, request: impl IntoRequest<GetPumpFunNewAmmPoolStreamRequest>, ) -> Result<Response<Streaming<GetPumpFunNewAmmPoolStreamResponse>>, Status>

Source

pub async fn get_pump_fun_amm_swap_stream( &mut self, request: impl IntoRequest<GetPumpFunAmmSwapStreamRequest>, ) -> Result<Response<Streaming<GetPumpFunAmmSwapStreamResponse>>, Status>

Source

pub async fn post_pump_fun_swap( &mut self, request: impl IntoRequest<PostPumpFunSwapRequest>, ) -> Result<Response<PostPumpFunSwapResponse>, Status>

Source

pub async fn post_pump_fun_swap_sol( &mut self, request: impl IntoRequest<PostPumpFunSwapRequestSol>, ) -> Result<Response<PostPumpFunSwapResponse>, Status>

Source

pub async fn get_pump_fun_amm_quotes( &mut self, request: impl IntoRequest<GetPumpFunAmmQuotesRequest>, ) -> Result<Response<GetPumpFunAmmQuotesResponse>, Status>

Source

pub async fn post_pump_fun_amm_swap( &mut self, request: impl IntoRequest<PostPumpFunAmmSwapRequest>, ) -> Result<Response<PostPumpFunAmmSwapResponse>, Status>

Trait Implementations§

Source§

impl<T: Clone> Clone for ApiClient<T>

Source§

fn clone(&self) -> ApiClient<T>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: Debug> Debug for ApiClient<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<T> !Freeze for ApiClient<T>

§

impl<T> RefUnwindSafe for ApiClient<T>
where T: RefUnwindSafe,

§

impl<T> Send for ApiClient<T>
where T: Send,

§

impl<T> Sync for ApiClient<T>
where T: Sync,

§

impl<T> Unpin for ApiClient<T>
where T: Unpin,

§

impl<T> UnwindSafe for ApiClient<T>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more