Skip to main content

Module v2

Module v2 

Source
Expand description

CIP-0112 — the V2 token standard.

The shape is the one V1 established: ask the registry for a factory, take the choice context it returns, exercise the choice with the contracts it said to disclose. What changed is worth stating, because a caller porting from V1 meets all of it at once.

  • Accounts, not parties. A V2 Transfer moves between two Accounts. A party can hold several, so “who owns this” and “where does it live” stopped being the same question. Both the owner and the provider of an account are optional — an account held at a provider can be named by its id alone, which is what lets a registry route to an account whose owning party it does not need to state.
  • Every choice names its actors. V2 choices carry actors: Vec<Party> — who is exercising, which V1 left implicit in the submitting party.
  • Settlement moved to a factory. A V1 allocation is executed through a choice on itself; a V2 one is settled as part of a batch, through settle_batch. That is what lets both legs of a delivery-versus-payment settle together instead of one at a time.
  • Allocation instructions have their own choices. V1 drove them entirely through the factory.

Every path and payload here comes from the V2 OpenAPI documents in the Splice repository, not from V1 with a digit changed — the two differ in ways a search-and-replace would get wrong.

Modules§

events
Reading V2 transfer events off a transaction.

Functions§

accept
Accept an offered V2 transfer — the receiver’s move.
accept_allocation_instruction
Accept a pending V2 allocation instruction — the registry asked the allocating party to confirm, and this is the confirmation.
allocate
Resolve the V2 allocation factory and build the exercise that allocates.
cancel
Cancel a V2 allocation — the executor’s move.
reject
Reject an offered V2 transfer.
settle_batch
Settle a batch of allocations through the settlement factory — the executor’s move, and the V2 replacement for V1’s execute-transfer.
transfer
Resolve the V2 transfer factory and build the exercise that performs transfer.
withdraw
Withdraw an offered V2 transfer — the sender’s move.
withdraw_allocation
Withdraw a V2 allocation, releasing the holdings — the sender’s move.
withdraw_allocation_instruction
Withdraw a pending V2 allocation instruction.