Daml.Runtime
0.2.0-preview.3
Prefix Reserved
dotnet add package Daml.Runtime --version 0.2.0-preview.3
NuGet\Install-Package Daml.Runtime -Version 0.2.0-preview.3
<PackageReference Include="Daml.Runtime" Version="0.2.0-preview.3" />
<PackageVersion Include="Daml.Runtime" Version="0.2.0-preview.3" />
<PackageReference Include="Daml.Runtime" />
paket add Daml.Runtime --version 0.2.0-preview.3
#r "nuget: Daml.Runtime, 0.2.0-preview.3"
#:package Daml.Runtime@0.2.0-preview.3
#addin nuget:?package=Daml.Runtime&version=0.2.0-preview.3&prerelease
#tool nuget:?package=Daml.Runtime&version=0.2.0-preview.3&prerelease
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:
- Building custom serialization logic
- Working with the Ledger API directly
- 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 | Versions 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. |
-
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 |