Daml.Runtime
0.4.1-preview.1
Prefix Reserved
dotnet add package Daml.Runtime --version 0.4.1-preview.1
NuGet\Install-Package Daml.Runtime -Version 0.4.1-preview.1
<PackageReference Include="Daml.Runtime" Version="0.4.1-preview.1" />
<PackageVersion Include="Daml.Runtime" Version="0.4.1-preview.1" />
<PackageReference Include="Daml.Runtime" />
paket add Daml.Runtime --version 0.4.1-preview.1
#r "nuget: Daml.Runtime, 0.4.1-preview.1"
#:package Daml.Runtime@0.4.1-preview.1
#addin nuget:?package=Daml.Runtime&version=0.4.1-preview.1&prerelease
#tool nuget:?package=Daml.Runtime&version=0.4.1-preview.1&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 (47)
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 |
|
|
Splice.Api.Token.Holding.V1
C# bindings for Daml package splice-api-token-holding-v1 |
|
|
Splice.Api.Token.Allocation.V1
C# bindings for Daml package splice-api-token-allocation-v1 |
|
|
Splice.Api.Token.Transfer.Instruction.V1
C# bindings for Daml package splice-api-token-transfer-instruction-v1 |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.4.1-preview.1 | 237 | 7/25/2026 |
| 0.4.0-preview.3 | 300 | 7/19/2026 |
| 0.4.0-preview.2 | 377 | 7/18/2026 |
| 0.4.0-preview.1 | 287 | 7/17/2026 |
| 0.3.0-preview.1 | 356 | 7/4/2026 |
| 0.2.0-preview.3 | 230 | 7/3/2026 |
| 0.2.0-preview.2 | 232 | 7/2/2026 |
| 0.1.8-preview.5 | 286 | 6/24/2026 |
| 0.1.8-preview.4 | 246 | 6/23/2026 |
| 0.1.8-preview.2 | 480 | 6/12/2026 |
| 0.1.8-preview.1 | 79 | 6/11/2026 |