Skip to main content

Crate lunar_lander_quic_client

Crate lunar_lander_quic_client 

Source
Expand description

Official Rust QUIC client for Hello Moon Lunar Lander.

lunar-lander-quic-client is intentionally narrow:

  • connect to a Lunar Lander QUIC endpoint
  • generate the client certificate in code from your API key
  • send one serialized Solana transaction payload per uni stream
  • optionally send one serialized Solana transaction payload per bidi stream and read a compact admission response

It does not perform simulation, preflight, or transaction construction.

§What This Crate Does

Use this crate when you already have serialized transaction bytes and want to submit them over Lunar Lander’s QUIC ingress path with a small, focused client.

The client:

  • opens one QUIC connection and reuses it across many sends
  • generates a self-signed client certificate in code from your API key
  • writes each transaction payload to its own uni stream
  • optionally writes transaction payloads to bidi streams and decodes compact response frames

§What This Crate Does Not Do

This crate intentionally does not:

  • build or sign transactions
  • wrap HTTP submission APIs
  • provide JSON-RPC helpers
  • simulate or preflight transactions

§Example

use lunar_lander_quic_client::LunarLanderQuicClient;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let api_key = std::env::var("LUNAR_LANDER_API_KEY")?;
    let client = LunarLanderQuicClient::connect(
        "lunar-lander.hellomoon.io:16888",
        api_key,
    )
    .await?;

    let tx_bytes = create_signed_transaction_somewhere()?;
    client.send_transaction(&tx_bytes).await?;
    Ok(())
}

fn create_signed_transaction_somewhere() -> Result<Vec<u8>, Box<dyn std::error::Error>> {
    unimplemented!("build and serialize a signed Solana transaction")
}

§MEV Protection

Enable MEV protection by setting mev_protect: true in ClientOptions:

use lunar_lander_quic_client::{ClientOptions, LunarLanderQuicClient};

let client = LunarLanderQuicClient::connect_with_options(
    "lunar-lander.hellomoon.io:16888",
    std::env::var("LUNAR_LANDER_API_KEY")?,
    ClientOptions {
        mev_protect: true,
        ..ClientOptions::default()
    },
)
.await?;

Structs§

ClientOptions
Connection-level tuning for LunarLanderQuicClient.
LunarLanderQuicClient
Connected Lunar Lander QUIC client.
QuicSubmitResponse
Typed response returned by LunarLanderQuicClient::send_transaction_with_response.

Enums§

ClientError
Error type returned by the client library.
ConnectionHealth
Reported reconnect state for a LunarLanderQuicClient.
QuicSubmitCode
HTTP-like status category for a compact QUIC submit response.
QuicSubmitResponseFrameError
Errors returned while decoding or encoding compact QUIC submit response frames.

Constants§

DEFAULT_PORT
Default UDP port for Lunar Lander QUIC ingress.
LUNAR_LANDER_TPU_PROTOCOL_ID
ALPN identifier used by the Lunar Lander QUIC endpoint.
MAX_QUIC_SUBMIT_RESPONSE_BODY_BYTES
Maximum response body size this client will accept from a bidi submit.
MAX_QUIC_SUBMIT_RESPONSE_FRAME_BYTES
Maximum full response frame size this client will read from a bidi submit.
MAX_WIRE_TX_BYTES
Maximum serialized Solana transaction size accepted on the QUIC path.
QUIC_SUBMIT_RESPONSE_HEADER_LEN
Header length for the compact QUIC submit response frame.
QUIC_SUBMIT_RESPONSE_VERSION
Version byte used by Lunar Lander’s compact QUIC submit response frame.

Type Aliases§

Result