Installation
Packages
| Package | Purpose |
|---|---|
github.com/lasersell/lasersell-sdk/go | ExitAPIClient, SendTarget, SignUnsignedTx, SendTransaction |
github.com/lasersell/lasersell-sdk/go/stream | StreamClient, StreamSession, StreamConfigure, message types |
API Client
All methods accept acontext.Context for cancellation and timeouts.
*int, *string). The intPtr and strPtr helpers above are not part of the SDK. Define them in your own code or use inline expressions like &[]int{2000}[0].
Custom Options
Exit Intelligence Stream Session
Liquidity Snapshots and Partial Sells
Tier 1+ only. Requires a Professional or Advanced subscription. See the announcement for full details.
StreamSession caches the latest liquidity snapshot per position. Query slippage bands, maximum sellable amounts, and liquidity trends:
BuildPartialSellTx() to sell a portion of a position based on slippage data:
Mirror Trading
Configure watch wallets to mirror trades from other wallets. When a watched wallet opens a position on a supported market, the stream sends aMirrorBuySignalServerMessage with an unsigned transaction for your wallet to execute.
WatchWallets slice specifies which wallets to mirror. Each WatchWalletConfig includes an AutoBuy configuration that controls how much to spend when mirroring a trade, and a MirrorSell flag that determines whether to also mirror sell transactions.
The MirrorConfig struct sets global limits: MaxPositionsPerWallet caps concurrent mirrored positions, CooldownSec enforces a delay between mirror buys, MaxActiveSOL limits total SOL exposure, and BuySlippageBps sets the slippage tolerance for mirror buy transactions.
Transaction Helpers
The second parameter toSendTransaction is an *http.Client. Pass nil to use the SDK’s default HTTP client.
Error Handling
context.Context Patterns
All Go SDK methods accept context.Context as their first argument. Use this to control:
- Timeouts:
context.WithTimeout(ctx, 5*time.Second) - Cancellation:
context.WithCancel(ctx)for graceful shutdown - Deadlines:
context.WithDeadline(ctx, time.Now().Add(30*time.Second))

