Skip to content

Reference

getAllocationCancelContext

POST allocation cancel choice-context — disclosed contracts payload for cancelling an allocation by id.

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) — Defaults false; strips optional diagnostics when true.

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.

See also

Source

src/clients/validator-api/operations/v0/scan-proxy/registry/allocations/v1/get-allocation-cancel-context.ts on GitHub.