Skip to content

Releases: DLC-link/canton-lib

v0.6.0

19 May 13:25
8344619

Choose a tag to compare

Added

  • keycloak::login::token_url(host, realm) and
    keycloak::login::master_token_url(host) — build OIDC token endpoint URLs
    using the Keycloak 17+ (Quarkus distribution) path layout, which omits the
    /auth context root. Use these for default Keycloak 17+ deployments where
    realm endpoints are served at /realms/{realm}/.... The existing
    client_credentials_url, password_url, and password_master_url
    helpers are unchanged and continue to emit the legacy /auth/realms/...
    paths for backwards compatibility.

Changed

  • Bumped canton-api-client from 3.3.0-0.1.0 to 3.6.0-0.1.0 (regenerated from the Canton 3.6.0 OpenAPI spec). Most spec-level changes are absorbed inside the conversion functions in common::filters and ledger::common with no caller-visible API changes; the only behavior change is the ledger_end::get note below.
  • ledger::ledger_end::get and ledger::ledger_end::get_with_client now return Err("Ledger end response missing offset") when the upstream offset field is absent. In Canton 3.6 the field became optional on the wire; treating it as a hard error preserves the previous Response.offset: i64 API surface and surfaces what is almost certainly a server-side bug rather than silently defaulting.

v0.5.0

11 May 15:45
e5b459f

Choose a tag to compare

[0.5.0] - 2026-05-11

Added

  • ledger::submit::wait_for_transaction(Params) — calls the flat POST /v2/commands/submit-and-wait-for-transaction JSON Ledger API endpoint and returns the raw JsSubmitAndWaitForTransactionResponse body ({ "transaction": { "events": [...] } }). When Submission::transaction_format is unset, builds a default TransactionFormat { transactionShape: TRANSACTION_SHAPE_LEDGER_EFFECTS, eventFormat: { verbose: true, filtersByParty: <actAs ∪ readAs> → {} } } to match the behavior the deprecated tree endpoint hardcoded server-side. When set, the caller's value is moved to the top-level request body so it is not double-nested inside commands.
  • common::consts::TRANSACTION_SHAPE_LEDGER_EFFECTS — JSON Ledger API enum constant used by wait_for_transaction's default TransactionFormat.

Deprecated

  • ledger::submit::wait_for_transaction_tree — still calls POST /v2/commands/submit-and-wait-for-transaction-tree and returns the tree-shaped response unchanged, but emits a deprecation warning. The endpoint is removed in Canton 3.5.0; migrate to wait_for_transaction before upgrading. Note the response shape changes from { "transactionTree": { "eventsById": {...} } } (with CreatedTreeEvent / ExercisedTreeEvent) to { "transaction": { "events": [...] } } (with CreatedEvent / ExercisedEvent), so downstream parsing must be updated as part of the migration.

Changed

  • README "Submit Commands" curl example updated to the flat endpoint and shows the required transactionFormat block.

Migration: wait_for_transaction_treewait_for_transaction

The tree endpoint is removed in Canton 3.5.0. Both functions take the same
Params { ledger_host, access_token, request: Submission } and return
Result<String, String>, so the call site itself changes only by name — but
the response body shape changes, so downstream JSON parsing must be
updated.

1. Update the call

// Before (deprecated, removed in Canton 3.5.0):
let body = ledger::submit::wait_for_transaction_tree(Params {
    ledger_host,
    access_token,
    request: submission,
}).await?;

// After:
let body = ledger::submit::wait_for_transaction(Params {
    ledger_host,
    access_token,
    request: submission,
}).await?;

wait_for_transaction requires Submission.act_as to contain at least one
party when Submission.transaction_format is unset (otherwise the default
filtersByParty would be empty and the server rejects it with an opaque
error). The tree endpoint accepted an empty act_as; if you relied on that,
either populate act_as or set transaction_format explicitly.

2. Update response parsing

Response shape changes from a tree-keyed object map to a flat event array:

// Before — wait_for_transaction_tree response:
{
  "transactionTree": {
    "eventsById": {
      "0": { "CreatedTreeEvent":  { /* ... */ } },
      "1": { "ExercisedTreeEvent": { /* ... */ } }
    }
  }
}

// After — wait_for_transaction response:
{
  "transaction": {
    "events": [
      { "CreatedEvent":   { /* ... */ } },
      { "ExercisedEvent": { /* ... */ } }
    ]
  }
}

Concretely: replace transactionTree.eventsById lookups with iteration over
transaction.events, and rename CreatedTreeEventCreatedEvent and
ExercisedTreeEventExercisedEvent in your deserialization types.

3. (Optional) customize transactionFormat

If Submission::transaction_format is left unset, wait_for_transaction
builds a default equivalent to what the tree endpoint applied server-side:
transactionShape = TRANSACTION_SHAPE_LEDGER_EFFECTS, verbose = true, and
one empty-filter entry in filtersByParty per party in actAs ∪ readAs. To
override (e.g. for ACS_DELTA shape or party-specific template filters),
set Submission::transaction_format before calling.

v0.4.0

07 Apr 13:26
c5d32f4

Choose a tag to compare

What's Changed

Added

  • DamlDecimal newtype wrapper for Daml Decimal (Numeric 10) values — enforces ≤10 decimal places at construction time, arithmetic with banker's rounding (HalfEven), custom serde (JSON string format)
  • DamlDecimal::ZERO constant
  • Sum trait implementation for DamlDecimal
  • CHANGELOG.md following Keep a Changelog format
  • rust-toolchain.toml pinning Rust 1.94.1

Breaking Changes

  • Transfer::amount: StringDamlDecimal
  • ContextValue::Decimal: f64DamlDecimal
  • Wallet mining_rounds fields: StringDamlDecimal (11 fields) and StringOption<DamlDecimal> (2 fields)
  • wallet crate now depends on common instead of rust_decimal

See CHANGELOG.md for full details and migration guide.

Full Changelog: v0.3.1...v0.4.0

v0.3.1

06 Mar 15:58
v0.3.1
fc64849

Choose a tag to compare

What's Changed

  • fix: extend context-value to handle all potential cases by @scolear in #7
  • Fix README and .env.example accuracy by @gyorgybalazsi in #6

New Contributors

Full Changelog: v0.3.0...v0.3.1