ChiaWalletSdk 0.38.0

dotnet add package ChiaWalletSdk --version 0.38.0
                    
NuGet\Install-Package ChiaWalletSdk -Version 0.38.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ChiaWalletSdk" Version="0.38.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ChiaWalletSdk" Version="0.38.0" />
                    
Directory.Packages.props
<PackageReference Include="ChiaWalletSdk" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ChiaWalletSdk --version 0.38.0
                    
#r "nuget: ChiaWalletSdk, 0.38.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package ChiaWalletSdk@0.38.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ChiaWalletSdk&version=0.38.0
                    
Install as a Cake Addin
#tool nuget:?package=ChiaWalletSdk&version=0.38.0
                    
Install as a Cake Tool

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 with using. Otherwise, they are freed by a finalizer.
  • Errors are thrown as ChiaException.
  • Field getters and setters are methods (such as coin.Amount() and coin.SetAmount(...)). Setters mutate the object in place. Use Clone() to copy an object.
  • u64 values are ulong. Values that can exceed 64 bits (BigInt and u128) are decimal strings, which can be parsed with System.Numerics.BigInteger.Parse.
  • Static methods are exported on the Sdk class, prefixed with the class name, such as Sdk.ConstantsCatPuzzleHash().
  • Async methods (such as RpcClient requests) return a Task.

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • 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