getTransferFactory wraps the token-standard transfer-instruction registry proxied through validator scan-proxy. Supply choiceArguments that match the Daml transfer factory choice your flow exercises 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.getTransferFactory.
Minimal example
const res = await canton.validator.getTransferFactory({
choiceArguments: { /* factory-specific payload */ },
excludeDebugFields: false,
});
console.log(res.factoryId, res.transferKind);
Parameters
choiceArguments(required, record) — JSON-shaped arguments expected by the transfer factory choice your workflow invokes.excludeDebugFields(optional, boolean) — Defaults tofalse; omits optional debug payloads whentrue.
Returns
factoryId(string) — Factory identifier used when assembling ledger submissions.transferKind(enum) — One ofself,direct, oroffer, describing routing semantics documented by token-standard tooling.choiceContext— IncludeschoiceContextDataplusdisclosedContractssuitable for packaging alongside ledger writes.
Errors and pitfalls
- Wrong argument shapes yield validator-side failures—mirror splice codegen or canonical fixtures before iterating blindly.
Auth and party
Authenticated bearer token; ledger submissions afterward still honor Canton authorization rules.