Draft
Conversation
Improvement: added multi-sync logic + new scenario script 15-multi-sync-trade.ts Signed-off-by: vkalashnykov <viktor.kalashnykov@digitalasset.com>
Improvement: added uploading of DARs for Token and Trading App Signed-off-by: vkalashnykov <viktor.kalashnykov@digitalasset.com>
Signed-off-by: vkalashnykov <viktor.kalashnykov@digitalasset.com>
Signed-off-by: vkalashnykov <viktor.kalashnykov@digitalasset.com>
Improvement: added discovery of AmuletRules and creation of TokenRules and Trading App contracts (the latter two seem not to work yet) Signed-off-by: vkalashnykov <viktor.kalashnykov@digitalasset.com>
Improvement: added TokenRules, Token contract, Amulet Contract and Trade Contract creation Signed-off-by: vkalashnykov <viktor.kalashnykov@digitalasset.com>
Improvement: added Allocations for Amulet (Alice) and Token (Bob) and execising of Settle Choice for Trade Signed-off-by: vkalashnykov <viktor.kalashnykov@digitalasset.com>
Improvement: added Creation of Amulet for Bob and Token for Alice Contracts after exercising Trade. Also moved Bob party, Token Rules and Token Contracts to app synchronizer Signed-off-by: vkalashnykov <viktor.kalashnykov@digitalasset.com>
Improvement: added final step for reassignment of Token Contract from global synchornizer to app synchronizer Signed-off-by: vkalashnykov <viktor.kalashnykov@digitalasset.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Multi-Synchronizer DvP Example & SDK Enhancements
Summary
Adds a new end-to-end example script (15-multi-sync-trade) demonstrating a Delivery vs Payment (DvP) trade across multiple synchronizers, along with the SDK and infrastructure changes required to support it.
New Example Script
docs/wallet-integration-guide/examples/scripts/15-multi-sync-trade.ts (~920 lines)
Implements the multi-synchronizer DvP workflow from the "Example: token using private synchronizer" design, showcasing how assets on different synchronizers (global vs. private) can be traded atomically.
Participants:
Canton Coin app (Global Synchronizer) — Amulet instrument
Token app (Private Synchronizer) — Token instrument
Alice — holds Amulet, receives Token
Bob — holds Token, receives Amulet
Trading app — orchestrates the OTC trade
Flow:
SDK initialization & synchronizer discovery (global + private)
DAR upload for the trading app
Party onboarding (Alice, Bob, Trading App)
Amulet minting for Alice & token setup
Trading app creates an OTC Trade → Allocation requests emitted
Alice allocates Amulet on the global synchronizer
Bob allocates Token on the private synchronizer
Pre-settlement: reassign Bob's allocation (private → global) via unassign/assign
Trading app settles the trade (OTCTrade_Settle)
Post-settlement: reassign Alice's new Token holding (global → private)
Final holdings verification
Note: Several steps are stubbed out (wrapped in comments) because the Token app DAR and private-sync reassignment for external parties are not yet available. The script is structured so these stubs can be replaced with real calls once the platform supports them.
SDK Changes
New Contracts namespace (sdk/wallet-sdk/src/wallet/namespace/contract/)
Provides contract reassignment operations needed for multi-synchronizer workflows:
assignContract(options) — Assigns a contract to a target synchronizer (completes a reassignment started by unassign)
unassignContract(options) — Unassigns a contract from a source synchronizer, initiating a cross-synchronizer move
Both methods call POST /v2/commands/submit-and-wait-for-reassignment with the appropriate AssignCommand / UnassignCommand.
Exposed on the SDK as sdk.contracts.
New State namespace (sdk/wallet-sdk/src/wallet/namespace/state/)
Provides ledger state queries:
connectedSynchronizers(options?) — Returns the list of connected synchronizers for a given party/participant via GET /v2/state/connected-synchronizers
Exposed on the SDK as sdk.ledger.state.
SignedPartyCreation enhancement
Party creation now respects an optional synchronizerId from createPartyOptions, falling back to defaultSynchronizerId. This allows onboarding parties on a specific synchronizer (e.g., the private one).
New type exports
ConnectedSynchronizer, ConnectedSynchronizersOptions
AssignContractOptions, UnassignContractOptions
Contracts class
Localnet Infrastructure
Multi-sync profile support (scripts/src/start-localnet.ts)
Refactored profile selection to be dynamic instead of hard-coded
Default profiles: sv, app-provider, app-user
New --multi-sync flag appends the multi-sync Docker Compose profile
New --profile flag (repeatable) allows fully custom profile selection
Added elapsed-time logging on start/stop
New root-level npm scripts
Script Description
start:localnet:multi-sync Starts localnet with the multi-sync profile enabled
stop:localnet:multi-sync Stops the multi-sync localnet and removes volumes
API Specs
Ledger API 3.4.12 (api-specs/ledger-api/3.4.12/openapi.yaml)
Package vetting endpoints: GET /v2/package-vetting and POST /v2/package-vetting marked as deprecated; replaced by POST /v2/package-vetting/list and POST /v2/package-vetting/update
TAPS support: Added optional tapsMaxPasses field to JsCommandsMeta and submission request schemas for Topology-Aware Package Selection
How to Test
Start localnet with multi-sync profile
yarn start:localnet:multi-sync
Run the new example
cd docs/wallet-integration-guide/examples
yarn run-15
Stop
yarn stop:localnet:multi-sync