Daml.Runtime 0.2.0-preview.3

Prefix Reserved
This is a prerelease version of Daml.Runtime.
dotnet add package Daml.Runtime --version 0.2.0-preview.3
                    
NuGet\Install-Package Daml.Runtime -Version 0.2.0-preview.3
                    
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="Daml.Runtime" Version="0.2.0-preview.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Daml.Runtime" Version="0.2.0-preview.3" />
                    
Directory.Packages.props
<PackageReference Include="Daml.Runtime" />
                    
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 Daml.Runtime --version 0.2.0-preview.3
                    
#r "nuget: Daml.Runtime, 0.2.0-preview.3"
                    
#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 Daml.Runtime@0.2.0-preview.3
                    
#: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=Daml.Runtime&version=0.2.0-preview.3&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Daml.Runtime&version=0.2.0-preview.3&prerelease
                    
Install as a Cake Tool

Daml.Runtime

Runtime library for Daml C# code generation. This package provides the base types and serialization support required by C# code generated from Daml templates.

Installation

dotnet add package Daml.Runtime

Usage

This package is automatically referenced by code generated by the Daml C# code generator (e.g. via dpm codegen-cs). You typically don't need to use it directly unless you're:

  1. Building custom serialization logic
  2. Working with the Ledger API directly
  3. Creating utility libraries for Daml contracts

Working with Generated Types

Generated template classes implement ITemplate and provide:

  • Strongly-typed contract creation
  • Choice exercise methods
  • JSON serialization/deserialization
  • Contract ID types

Given a Daml Iou template with a Transfer choice, the generated code is used like this (taken from the compiled samples/QuickstartExample):

using Daml.Runtime.Commands;
using Daml.Runtime.Data;
using Quickstart;

var alice = new Party("Alice::1220deadbeef");
var charlie = new Party("Charlie::1220deadbeef");

var iou = new Iou(
    Issuer: alice,
    Owner: new Party("Bob::1220deadbeef"),
    Currency: "USD",
    Amount: 1000.00m
);

var createCmd = CreateCommand.For(iou);

var contractId = new Iou.ContractId("00abc123");
var exerciseCmd = ExerciseCommand.For(
    contractId,
    Iou.ChoiceTransfer.Name,
    new Iou.Transfer(NewOwner: charlie).ToRecord());

var submission = CommandsSubmission.Single(createCmd)
    .WithActAs(alice)
    .WithWorkflowId(new WorkflowId("iou-issuance"))
    .WithCommandId(new CommandId(Guid.NewGuid().ToString()));

Manual Serialization

If you need to work with Daml values directly:

using Daml.Runtime.Data;
using Daml.Runtime.Serialization;

var record = DamlRecord.Create(
    DamlField.Create("name", new DamlText("Alice")),
    DamlField.Create("amount", new DamlNumeric(42.5m))
);

var json = DamlJsonSerializer.Serialize(record);

var parsed = DamlJsonSerializer.DeserializeRecord(json);

Type Mappings

Daml Type Generated C# Type Runtime backing
Int long DamlInt64
Numeric n decimal DamlNumeric
Text string DamlText
Bool bool DamlBool
Party Party DamlParty
Date DateOnly DamlDate
Time DateTimeOffset DamlTimestamp
ContractId T ContractId<T> DamlContractId
Optional a T? DamlOptional
List a IReadOnlyList<T> DamlList
TextMap a IReadOnlyDictionary<string, T> DamlTextMap

License

Apache-2.0

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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.
  • net10.0

    • No dependencies.

NuGet packages (37)

Showing the top 5 NuGet packages that depend on Daml.Runtime:

Package Downloads
Daml.Ledger.Abstractions

Transport-agnostic abstractions for Daml ledger clients. Defines ILedgerClient, the contract any Daml ledger transport (gRPC Canton, planned HTTP REST, in-memory test fake) implements.

Splice.Api.Token.Metadata.V1

C# bindings for Daml package splice-api-token-metadata-v1

Daml.Codegen.Testing.Conformance

Conformance corpus for daml-codegen-csharp: compiled generated types plus the DAR they were generated from, for live-ledger round-trip testing by consumers. Not for production use.

Daml.Codegen.CSharp

C# code generator library for Daml smart contracts. Consumes an IntermediateDar protobuf (see Daml.Codegen.Intermediate) and emits strongly-typed C# bindings.

Splice.Api.Token.Holding.V1

C# bindings for Daml package splice-api-token-holding-v1

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.2.0-preview.3 0 7/3/2026
0.2.0-preview.2 37 7/2/2026
0.1.8-preview.5 275 6/24/2026
0.1.8-preview.4 238 6/23/2026
0.1.8-preview.2 473 6/12/2026
0.1.8-preview.1 70 6/11/2026