lasersell-sdk
Rust SDK for the LaserSell API.
Modules
exit_api: Build unsigned buy/sell transactions.stream: Websocket client, protocol types, and session helpers.tx: Sign, encode, and submit Solana transactions.retry: Shared retry helpers.
Install
[]
= "0.1"
Build a sell transaction
use ;
use SecretString;
let client = with_api_key?;
let request = BuildSellTxRequest ;
let response = client.build_sell_tx.await?;
println!;
Stream + auto-sell flow
use ;
use ;
use ServerMessage;
use ;
use SecretString;
use read_keypair_file;
let keypair = read_keypair_file?;
let http = builder.no_proxy.build?;
let client = new;
let configure = StreamConfigure ;
let mut session = connect.await?;
while let Some = session.recv.await
RPC endpoint
The SDK ships with the Solana public mainnet-beta RPC as a default so you can get started immediately:
let target = default_rpc;
A private RPC is highly recommended for production — the public endpoint is rate-limited and unreliable under load. Free private RPC tiers are available from Helius and Chainstack, among others:
let target = Rpc ;
Examples
See examples/ for runnable programs:
examples/build_buy.rs: Build unsigned buy txexamples/build_sell.rs: Build unsigned sell txexamples/build_and_send_sell.rs: Build, sign, and submit sell txexamples/auto_sell.rs: Stream listener that signs and submits exits
Error types
ExitApiError: API transport and response errorsTxSubmitError: Transaction signing and submission errors
Both implement std::error::Error and can be matched by variant for structured error handling.