SolSharp 1.1.0
Prefix ReservedSee the version list below for details.
dotnet add package SolSharp --version 1.1.0
NuGet\Install-Package SolSharp -Version 1.1.0
<PackageReference Include="SolSharp" Version="1.1.0" />
<PackageVersion Include="SolSharp" Version="1.1.0" />
<PackageReference Include="SolSharp" />
paket add SolSharp --version 1.1.0
#r "nuget: SolSharp, 1.1.0"
#:package SolSharp@1.1.0
#addin nuget:?package=SolSharp&version=1.1.0
#tool nuget:?package=SolSharp&version=1.1.0
SolSharp
A lean, modern, Native AOT-ready .NET SDK for Solana — RPC, WebSocket streaming, and wire-level transaction signing and building. No reflection anywhere: all JSON is source-generated, and every assembly compiles clean to a native binary.
SolSharp is built for low latency and a small dependency footprint. If you are writing bots, indexers, or backend services that talk to Solana from .NET and care about speed and control, this is aimed at you.
Why SolSharp
- Native AOT ready. Source-generated JSON (no reflection), trimmable, AOT-clean — ship a self-contained native binary with instant startup. CI runs a native-compiled smoke test on every push.
- Full RPC coverage. The complete current JSON-RPC HTTP read surface, send/simulate, batching, and multiplexed WebSocket subscriptions with automatic reconnect.
- Wire-level control. Spec-accurate legacy and v0 transaction building, signing, and decoding —
every encoding checked byte-for-byte against the Rust
solana-sdk. - Lean. No kitchen-sink dependency graph; allocation-free hot paths and span-based APIs.
Quick start
using SolSharp.Rpc;
using SolSharp.Wallet;
using SolSharp.Programs;
// DI with a built-in resilience pipeline (or: new SolanaRpcClient(httpClient))
services.AddSolanaRpc("https://your-rpc-endpoint");
var lamports = await rpc.GetBalanceAsync(account);
// Build, sign, and send a transfer
using var payer = Keypair.Parse(secret);
var blockhash = (await rpc.GetLatestBlockhashAsync()).Blockhash;
var tx = new TransactionBuilder()
.SetRecentBlockhash(blockhash)
.AddInstruction(SystemProgram.Transfer(payer.PublicKey, recipient, 1_000_000))
.Build(payer);
var signature = await rpc.SendAndConfirmTransactionAsync(tx.Serialize());
// WebSocket streaming
await using var ws = new SolanaWsClient();
await ws.ConnectAsync(new Uri("wss://your-rpc-endpoint"));
await foreach (var slot in ws.SubscribeSlotsAsync())
Console.WriteLine(slot.Slot);
Learn more
- Usage guide — a task-oriented cookbook: keys and mnemonic import, reads, SPL token state, priority fees, v0 + address lookup tables, durable nonces, decoding transactions, subscriptions, batching, and confirmation.
- GitHub repository
- Changelog
Security
SolSharp handles private keys and builds transactions that move funds. It has not been audited — use at your own risk. Never hand a raw private key to a dependency you do not control: sign with your own signer and simulate before sending.
To report a vulnerability, use the security policy — private reporting, not a public issue.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- BouncyCastle.Cryptography (>= 2.6.2)
- Microsoft.Extensions.Http (>= 8.0.1)
- Microsoft.Extensions.Http.Resilience (>= 8.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.2)
- SimpleBase (>= 5.6.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
1.1.0 — completes the WebSocket subscription surface with two new IAsyncEnumerable streams: SubscribeSlotsUpdatesAsync (slotsUpdatesSubscribe — the full slot lifecycle: shreds received, bank created, frozen with per-slot transaction stats, optimistic confirmation, root, dead) and SubscribeVotesAsync (voteSubscribe — gossip votes before they land in a block; the node must run with --rpc-pubsub-enable-vote-subscription). Both are marked unstable by Solana. New models: SlotsUpdate, SlotsUpdateStats, VoteNotification. No breaking changes. Changelog: https://github.com/jecacs/SolSharp/blob/main/CHANGELOG.md