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 tofalse; whentrue, omits optional diagnostic blobs when supported server-side.
Returns
factoryId(string) — Identifier you reference when submitting ledger commands.choiceContext— ContainschoiceContextDataplusdisclosedContractsentries ready forledger.submitAndWait-style submissions.
Errors and pitfalls
- Mis-shaped
choiceArgumentsyields 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.