Skip to content

0.2.0

Choose a tag to compare

@vsima vsima released this 07 Aug 12:24
· 98 commits to main since this release

The core read/write loop, complete on both platforms: submit commands with dedup-safe retries, stream the resulting ledger updates with gap-free resumption, decode Canton's structured errors, and build/read Daml values ergonomically. Everything below is tested three ways — unit, wire-level fakes, and live Canton nodes in CI — with identical semantics on Swift and Kotlin.

New

Command submission

  • CommandSubmission — commands, act/read-as parties, dedup duration, synchronizer pinning; the command id defaults to a UUID that stays stable across retries, so the participant's deduplication guarantees a retried submission can never execute twice
  • submitAndWait(...) → update id; submitAndWaitForTransaction(...) → committed transaction
  • RetryPolicy: exponential backoff with jitter; a server-suggested RetryInfo delay takes precedence

Update streams

  • updates(UpdateSubscription) — Flow (Kotlin) / AsyncThrowingStream (Swift) over UpdateService.GetUpdates that transparently reconnects and resumes from the last received offset: one uninterrupted, gap-free, duplicate-free stream
  • LedgerUpdate models transactions, reassignments, topology transactions, and offset checkpoints, each exposing its resume offset
  • ledgerEnd() for anchoring fresh subscriptions

Typed errors

  • CantonError / CantonException decode Canton's structured google.rpc details: error code (ErrorInfo.reason), correlation id (RequestInfo), retryability and suggested backoff (RetryInfo)

Daml value codecs

  • Builders (DamlValues.… / Value.…) and typed readers (asParty(), requireField(…), …) for all value cases, held byte-compatible across both SDKs by shared golden vectors in testdata/values/

Examples

  • New iOS sample app (examples/ios), verified on-simulator against a live Canton node — parity with the Android sample

Install

implementation("io.github.vsima.canton:canton-sdk:0.2.0")
.package(url: "https://github.com/vsima/canton-mobile-sdk.git", from: "0.2.0")

Compatibility: Canton 3.5.11 protos (com.daml.ledger.api.v2). Expect breaking changes before 1.0.