TransferRegistryClient

class TransferRegistryClient(baseUrl: String, http: OkHttpClient = OkHttpClient())

Client for a CIP-0056 registry's off-ledger transfer-instruction API (/registry/transfer-instruction/v1/...).

Registries hand out two things a wallet cannot derive on its own: the factory contract to exercise for a new transfer, and per-choice contexts (referenced contracts + disclosed contracts) for accept/reject/withdraw.

Constructors

Link copied to clipboard
constructor(baseUrl: String, http: OkHttpClient = OkHttpClient())

Types

Link copied to clipboard
data class RegistryChoiceContext(val choiceContextData: JsonElement?, val disclosedContracts: List<TransferRegistryClient.RegistryDisclosedContract>)

What a registry returns for one choice. choiceContextData is the Daml-JSON ChoiceContext the choice's extraArgs must carry — ChoiceContextJson.extraArgsValue re-encodes it for gRPC — or null when the registry sent none; disclosedContracts must be submitted with the command.

Link copied to clipboard
data class RegistryDisclosedContract(val templateId: String, val contractId: String, val createdEventBlobBase64: String, val synchronizerId: String)

A contract the registry asks us to disclose with the command.

Link copied to clipboard
data class TransferFactory(val factoryId: String, val transferKind: String, val choiceContext: TransferRegistryClient.RegistryChoiceContext)

The registry's answer to transferFactory: which factory contract to exercise, how the registry will route the transfer, and the choice context to submit with it.

Functions

Link copied to clipboard
suspend fun transferFactory(choiceArguments: JsonObject, excludeDebugFields: Boolean = true): TransferRegistryClient.TransferFactory

POST /transfer-factory: the factory + context for a new transfer.

Link copied to clipboard

POST /{id}/choice-contexts/{accept|reject|withdraw}.