Expand description
Canton Network token-standard workflows (CIP-56 and CIP-0112).
The token-standard types are generated from the Splice DARs and live in
the canton-splice-api-token-* crates. This crate is the workflow over
them: resolving a factory, asking a registry for a choice context,
attaching the contracts it says to disclose, and exercising the choice.
Nothing here re-declares a Daml type. That would duplicate the code
generator and go stale on the next Splice release; the Holding this crate
names is the same Rust type an application reads out of the ledger.
§Why a registry is involved at all
A transfer is exercised through an interface, and only the registry knows what reference data that choice needs — its own configuration contracts, the rules for an instrument, the current round. So the client asks for a choice context and gets back both the data to pass in and the contracts the participant must be shown. Those contracts are usually invisible to the submitting party, which is exactly what explicit disclosure is for.
The registry’s API is off-ledger HTTP, specified by the token standard’s OpenAPI documents.
Re-exports§
pub use transfer::TokenCommand;pub use transfer::accept;pub use transfer::reject;pub use transfer::transfer;pub use transfer::withdraw;
Modules§
- allocation
- Allocations: reserving holdings now so a third party can settle later.
- holdings
- Which holdings a party has, read from the ledger.
- transfer
- CIP-56 transfers: resolve the factory, take its context, exercise the choice.
- types
- The generated token-standard types this crate’s API is written in terms of, re-exported so they can be named without depending on each generated crate directly.
- v2
- CIP-0112 — the V2 token standard.
Structs§
- Choice
Context - A choice context, ready to be used against either transport.
- Choice
Context Request - A request for a choice context.
- Factory
With Context - A factory contract together with the context for exercising its choice.
- Holding
- The V1
Holdinginterface, at the root because it is the type a caller reaches for first. Everything else is undertypes. Marker for the Daml interfaceHolding(held viaContractId). - Instrument
- An instrument the registry issues.
- Registry
Client - A client for one registry’s off-ledger API.
- Registry
Info - What a registry says about itself.
- Wire
Choice Context - What a registry returns for a choice.
- Wire
Disclosed Contract - A contract the participant must be shown for a choice to resolve.
Enums§
- Allocation
Choice - The choices an allocation offers.
- Allocation
Instruction Choice - The choices a V2 allocation instruction offers.
- Transfer
Instruction Choice - The choices a transfer instruction offers, as the registry paths name them.
- Transfer
Kind - How a transfer will be carried out, as the registry decides.