ChiaWalletSdk 0.38.0
dotnet add package ChiaWalletSdk --version 0.38.0
NuGet\Install-Package ChiaWalletSdk -Version 0.38.0
<PackageReference Include="ChiaWalletSdk" Version="0.38.0" />
<PackageVersion Include="ChiaWalletSdk" Version="0.38.0" />
<PackageReference Include="ChiaWalletSdk" />
paket add ChiaWalletSdk --version 0.38.0
#r "nuget: ChiaWalletSdk, 0.38.0"
#:package ChiaWalletSdk@0.38.0
#addin nuget:?package=ChiaWalletSdk&version=0.38.0
#tool nuget:?package=ChiaWalletSdk&version=0.38.0
Chia Wallet SDK for .NET
.NET bindings for the Chia Wallet SDK, generated with UniFFI and uniffi-bindgen-cs.
Installation
dotnet add package ChiaWalletSdk
The package targets .NET 8 and includes native libraries for Linux (x64, arm64), macOS (x64, arm64), and Windows (x64).
Example
using ChiaWalletSdk;
using var sim = new Simulator();
using var clvm = new Clvm();
using var alice = sim.Bls(1000);
var spend = clvm.DelegatedSpend([
clvm.CreateCoin(alice.PuzzleHash(), 900, null),
clvm.ReserveFee(100),
]);
clvm.SpendStandardCoin(alice.Coin(), alice.Pk(), spend);
sim.SpendCoins(clvm.CoinSpends(), [alice.Sk()]);
var coins = sim.UnspentCoins(alice.PuzzleHash(), false);
Console.WriteLine($"Created a coin with {coins[0].Amount()} mojos");
Usage notes
- Objects are backed by Rust memory and implement
IDisposable, so they can be freed deterministically withusing. Otherwise, they are freed by a finalizer. - Errors are thrown as
ChiaException. - Field getters and setters are methods (such as
coin.Amount()andcoin.SetAmount(...)). Setters mutate the object in place. UseClone()to copy an object. u64values areulong. Values that can exceed 64 bits (BigIntandu128) are decimal strings, which can be parsed withSystem.Numerics.BigInteger.Parse.- Static methods are exported on the
Sdkclass, prefixed with the class name, such asSdk.ConstantsCatPuzzleHash(). - Async methods (such as
RpcClientrequests) return aTask.
Development
To build the library and generate the bindings for the current platform, install uniffi-bindgen-cs and run the generation script:
cargo install uniffi-bindgen-cs --git https://github.com/NordSecurity/uniffi-bindgen-cs --tag v0.11.1+v0.31.0
./dotnet/generate.sh
dotnet test dotnet/ChiaWalletSdk.Tests
The generation script also applies fix-bindings.py, which works around a few bugs in the generator. Each fix is documented in the script, and fails loudly if the generated code changes shape.
| 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
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.38.0 | 53 | 11/12/2026 |
| 0.33.0-dotnet.3 | 142 | 6/8/2026 |
| 0.33.0-dotnet.1 | 87 | 6/1/2026 |
| 0.0.6-local | 125 | 4/16/2026 |
| 0.0.5-local | 99 | 4/12/2026 |
| 0.0.4-local | 101 | 4/10/2026 |
| 0.0.3-local | 97 | 4/10/2026 |
| 0.0.2-local | 87 | 4/10/2026 |
| 0.0.1-local | 105 | 4/10/2026 |
| 0.0.0-local | 90 | 4/9/2026 |