Skip to content

Reference

getAllocationFactory

POST token-standard allocation-factory — factory contract id plus choice context for AllocationFactory_Allocate-style flows.

getAllocationFactory wraps the Splice allocation-instruction registry endpoint proxied through the validator scan-proxy. Pass choiceArguments matching the Daml choice your wallet intends to exercise next.

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.getAllocationFactory.

Minimal example

const factory = await canton.validator.getAllocationFactory({
  choiceArguments: { /* fields required by your Allocate choice */ },
  excludeDebugFields: false,
});
console.log(factory.factoryId);

Parameters

  • choiceArguments (required, record) — Tagged payload forwarded as JSON objects/strings matching ledger expectations for the allocate choice.
  • excludeDebugFields (optional, boolean) — Defaults to false; when true, omits optional diagnostic blobs when supported server-side.

Returns

  • factoryId (string) — Identifier you reference when submitting ledger commands.
  • choiceContext — Contains choiceContextData plus disclosedContracts entries ready for ledger.submitAndWait-style submissions.

Errors and pitfalls

  • Mis-shaped choiceArguments yields validator-side interpretation failures—mirror documented templates from your instrument admin.

Auth and party

Authenticated bearer token; ledger submissions afterward still respect actAs on LedgerJsonApiClient.

See also

Source

src/clients/validator-api/operations/v0/scan-proxy/registry/allocation-instruction/v1/get-allocation-factory.ts on GitHub.