getAllocationCancelContext retrieves ChoiceContext-shaped material keyed by allocationId so wallets can exercise cancel flows without manually assembling disclosures.
Setup
import { Canton } from '@fairmint/canton-node-sdk';
const canton = new Canton({
network: 'devnet',
provider: '5n',
partyId: 'OWN_PARTY_ID',
});
Import and receiver
import { Canton } from '@fairmint/canton-node-sdk';
Receiver: canton.validator.getAllocationCancelContext.
Minimal example
const ctx = await canton.validator.getAllocationCancelContext({
allocationId: '<allocation-contract-or-registry-id>',
meta: { route: 'cancel-flow' },
});
Parameters
allocationId(required, string) — Registry allocation identifier embedded in the REST path.meta(optional, string record) — Optional key/value hints echoed into request JSON when provided.excludeDebugFields(optional, boolean) — Defaultsfalse; strips optional diagnostics whentrue.
Returns
Choice-context payload: choiceContextData plus disclosedContracts entries mirroring other allocation helper responses.
Errors and pitfalls
- Unknown allocation IDs yield HTTP failures—confirm allocations via indexer before polling contexts repeatedly.
Auth and party
Authenticated bearer token for validator scan-proxy; ledger authorization still enforced when exercising choices.