pub struct HttpClient { /* private fields */ }Expand description
HTTP client for making API requests
Implementations§
Source§impl HttpClient
impl HttpClient
Sourcepub fn with_config(enable_tracing: bool) -> Self
pub fn with_config(enable_tracing: bool) -> Self
Create a new HTTP client with custom configuration
Sourcepub fn with_base_url(self, base_url: impl Into<String>) -> Self
pub fn with_base_url(self, base_url: impl Into<String>) -> Self
Set the base URL for all requests
Sourcepub fn with_api_key(self, api_key: impl Into<String>) -> Self
pub fn with_api_key(self, api_key: impl Into<String>) -> Self
Set the API key for authentication
Sourcepub fn with_max_response_body_bytes(self, limit: usize) -> Self
pub fn with_max_response_body_bytes(self, limit: usize) -> Self
Set the maximum number of response-body bytes buffered in memory.
Sourcepub fn with_header(
self,
name: impl Into<String>,
value: impl Into<String>,
) -> Self
pub fn with_header( self, name: impl Into<String>, value: impl Into<String>, ) -> Self
Add a custom header to all requests
Sourcepub fn with_headers(self, headers: BTreeMap<String, String>) -> Self
pub fn with_headers(self, headers: BTreeMap<String, String>) -> Self
Add multiple custom headers
Source§impl HttpClient
impl HttpClient
Sourcepub async fn send_transaction(
&self,
request: Option<SendTransactionRequest>,
) -> Result<SendTransactionResponse, ApiOpError<SendTransactionApiError>>
pub async fn send_transaction( &self, request: Option<SendTransactionRequest>, ) -> Result<SendTransactionResponse, ApiOpError<SendTransactionApiError>>
Send a transaction
tx.jup.ag is a Solana RPC-compatible endpoint (compatible where possible) that forwards signed transactions to the Solana cluster through Jupiter’s landing infrastructure. It implements the standard Solana sendTransaction method, so any Solana client can point at it. A success response means the transaction was accepted and forwarded, not that it landed; confirm landing on your own RPC.
It is send-only: getLatestBlockhash, simulateTransaction, and confirmation queries are not served. Keep your own RPC for those.
Authentication: requires your Jupiter API key in the x-api-key header.
Validation:
- Transaction must be a valid signed Solana transaction with all required signatures
- Transaction must contain a SOL transfer of >= 1,000,000 lamports (0.001 SOL) to one of the 16 tip receiver accounts
- Transaction must not exceed the Solana transaction size limit
Tip receiver accounts (16 Jupiter V6 program authorities):
GGztQqQ6pCPaJQnNpXBgELr5cs3WwDakRbh1iEMzjgSJ, 2MFoS3MPtvyQ4Wh4M9pdfPjz6UhVoNbFbGJAskCPCj3h, BQ72nSv9f3PRyRKCBnHLVrerrv37CYTHm5h3s9VSGQDV, 6U91aKa8pmMxkJwBCfPTmUEfZi6dHe7DcFq2ALvB2tbB, 4xDsmeTWPNjgSVSS1VTfzFq3iHZhp77ffPkAmkZkdu71, CapuXNQoDviLvU1PxFiizLgPNQCxrsag1uMeyk6zLVps, 9nnLbotNTcUhvbrsA6Mdkx45Sm82G35zo28AqUvjExn8, 6LXutJvKUw8Q5ue2gCgKHQdAN4suWW8awzFVC6XCguFx, HFqp6ErWHY6Uzhj8rFyjYuDya2mXUpYEk8VW75K9PSiY, DSN3j1ykL3obAVNv7ZX49VsFCPe4LqzxHnmtLiPwY6xg, 69yhtoJR4JYPPABZcSNkzuqbaFbwHsCkja1sP1Q2aVT5, HU23r7UoZbqTUuh3vA7emAGztFtqwTeVips789vqxxBw, 3LoAYHuSd7Gh8d7RTFnhvYtiTiefdZ5ByamU42vkzd76, 3CgvbiM3op4vjrrjH2zcrQUwsqh5veNVRjFCB9N6sRoD, GP8StUXNYSZjPikyRsvkTbvRV1GBxMErb59cpeCJnDf1, 7iWnBRRhBCiNXXPhqiGzvvBkKrvFSWqqmxRyu9VyYBxE
Randomise which account you send to across transactions to reduce write-lock contention.
POST /
Sourcepub fn send_transaction_builder(&self) -> SendTransactionBuilder<'_>
pub fn send_transaction_builder(&self) -> SendTransactionBuilder<'_>
Start an additive builder for sendTransaction.
Trait Implementations§
Source§impl Clone for HttpClient
impl Clone for HttpClient
Source§fn clone(&self) -> HttpClient
fn clone(&self) -> HttpClient
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more