0.1.8-preview.4 — interface-only read path; Daml Finance + Splice codegen unblocked
Pre-releaseThis release supersedes 0.1.8-preview.3, which was published to NuGet.org and then unlisted before general use because of a mandatory codegen fix. 0.1.8-preview.4 contains everything from preview.3 plus the preview.4 changes below — if you were on preview.2, this is the next release to take.
The headline is the interface-only read path — read-path helpers now accept Daml interface markers, not just templates, and match created contracts by interface view — and the codegen fixes that unblock the generated Daml Finance and Splice C# packages (the Key-accessor revert, the DayOfWeek stdlib mapping, the Period/CS0542 and sibling-version/NU1102 fixes). Generated Daml Finance 2.10.0 (8 packages) and Splice 0.6.5 (22 packages) C# bindings are published to GitHub Packages and attached to this release.
Changes since 0.1.8-preview.2
Added
- Read-path helpers now accept Daml interface markers, not just templates, and match created contracts by interface view. The generic constraint on
TransactionResultExtensions.Single<T>/TrySingle<T>/All<T>,ILedgerClient.TryExerciseForCreatedAsync<TTemplate>and bothSubscribeAsync<T>overloads, andContractStreamEvent<T>is relaxed fromITemplatetoIDamlType. WhenTis a template the match is unchanged (created contract'sTemplateId); whenTis an interface marker (IDamlInterface), a created contract matches when itsInterfaceIdscontainsT's interface identifier (module + entity, package-id-agnostic). Constraint relaxation is source-compatible.TryCreateAsync<TTemplate>andSubscribeActiveAsync<T>intentionally stayITemplate-constrained — create paths remain template-only. Daml.Runtime.Contracts.CreatedContractgains an init-onlyIReadOnlyList<Identifier> InterfaceIds { get; init; }member carrying the interface ids the participant computed for a created event. Non-breaking: it is not a positional parameter, so existing 3-arg construction keeps working and the field defaults to an empty (non-null) list. Enables interface-only consumption, where a contract is known only as an interface and must be matched/dispatched at runtime.- A
--version-suffixcodegen option that appends a SemVer prerelease suffix (e.g.preview.4) to generated package versions, producing versions like0.1.6.1-preview.4. Mirrors the emitter's own prerelease tag and affects only the generated package<Version>; theDaml.Runtimereference version is unaffected. - A generated
README.mdfor each package, plusPackageTags(andPackageProjectUrl/RepositoryUrl/RepositoryTypewhen--repository-urlis supplied) in the package<PropertyGroup>, so published packages render on nuget.org without the missing-README warning. The README install hint adds--prereleasefor prerelease packages. - Generated Splice/Daml.Finance NuGet packages now ship a package icon (
PackageIcon), so they render with the project icon on nuget.org.
Changed
- The contract-key
Keyaccessor on generated keyed templates now emits a non-partialproperty that throwsNotImplementedException, reverting the body-lesspartialdeclaration introduced in0.1.5. Key-bearing packages now compile and publish standalone: thepartialrequired a hand-rolled implementing partial, which the automated DAR publish pipeline has no author for, so every keyed package failed to build withCS9248(blocking the Daml Finance and Splice publishes). The key type is still generated and serializable for caller-constructed key-based operations, and: IHasKey<TKey>is unchanged — only the body reverts. Generated key-bearing packages consequently no longer pin<LangVersion>13</LangVersion>. Translating the Damlkeyexpression into a real C# projection remains tracked for a future release. - Generated code and runtime messages no longer embed internal issue-tracker references; limitation notes (contract-key projection, generic-type serialization) now read as generic, consumer-facing prose.
Fixed
- Generated C# no longer fails to compile when a record or template references the Daml stdlib enum
DA.Date.Types:DayOfWeek. The enum now resolves to a runtime-providedDaml.Runtime.Stdlib.DayOfWeek(with serialization extensions), matching how otherdaml-stdlibtypes are handled, instead of emitting a conversion call to a helper class that was never generated (CS0103). Because the runtime enum shares its simple name withSystem.DayOfWeek, the reference is emitted fullyglobal::-qualified to avoid an ambiguous reference (CS0104). Unblocks the Daml Financeinterface-types-date-v3package. - Generated C# no longer fails to compile with
CS0542when a Daml record field PascalCases to the same name as its enclosing type (e.g. Daml FinancePeriodwith fieldperiod). The colliding C# member is now disambiguated with a trailing underscore while the Daml record field name used for (de)serialization stays unchanged. - Generated
.csprojfiles now reference co-produced sibling packages using the full package version, including the emitter counter and any--version-suffixprerelease tag. Previously sibling<PackageReference>versions dropped the suffix, so a prerelease set (e.g.3.0.0-preview.4) emitted>= 3.0.0references that NuGet could not resolve (NU1102). - Generated submission-extension XML docs no longer leak an internal issue-tracking reference into consumer output.
- Choice-argument types that reuse the same simple name across different modules no longer collide: the choice-arg-to-template map is now keyed by the module-qualified (
Module:Name) name, so each resolves to its own parent template instead of one silently overwriting the other and emitting unresolvable type references. - A choice-argument type mapped by two templates in the same package no longer overwrites silently: the choice-arg-to-template map now warns and keeps the first-seen mapping (in both
PackageEmitContextandDarCrossPackageResolver) instead of last-wins, so the clash is surfaced rather than mis-resolving cross-references.
What's included
| Package | Purpose |
|---|---|
Daml.Codegen.CSharp |
the C# emitter library |
Daml.Runtime |
runtime types referenced by generated code |
Daml.Ledger.Abstractions |
transport-agnostic ILedgerClient submission/subscription interface |
Daml.Codegen.Testing.Conformance |
compiled conformance corpus + embedded DAR for live-ledger round-trip tests |
The four core packages are versioned in lockstep and published to NuGet.org. The codegen CLI ships separately as a multi-arch OCI component for dpm — oci://ghcr.io/peacefulstudio/dpm-codegen-cs:0.1.8-preview.4 (linux/amd64, linux/arm64, darwin/arm64, windows/amd64); the per-RID bundle tarballs and all .nupkg/.snupkg files are attached below.
Generated DAR bindings (GitHub Packages)
Generated C# bindings built with this release are published to GitHub Packages (https://nuget.pkg.github.com/peacefulstudio/index.json) and attached here:
- Daml Finance 2.10.0 — 8 packages (
Daml.Finance.*, e.g.Daml.Finance.Util.V4 4.0.0-preview.4) - Splice 0.6.5 — 22 packages (
Splice.*, e.g.Splice.Amulet 0.1.18.1-preview.4)
Versioning and stability
This project is pre-1.0: under SemVer 0.x, any release may change the public API without a major-version bump. This is a preview release.
Getting started
Add the codegen component to your daml.yaml (set DPM_AUTO_INSTALL=true so dpm fetches it on first use):
components:
- oci://ghcr.io/peacefulstudio/dpm-codegen-cs:0.1.8-preview.4Add the runtime package to your C# project:
dotnet add package Daml.Runtime --prereleaseThen generate from your DAR with dpm codegen-cs — the README Quick Start walks through the full DAR-to-NuGet pipeline, the CLI flags, and the MSBuild integration.
Full changelog
See CHANGELOG.md for the complete record.