Validated InteractiveSubmissionPrepareRequest (commands, commandId, userId, actAs, readAs, synchronizerId, optional disclosedContracts, verboseHashing, packageIdSelectionPreference) hashed via Canton prior to signing for interactiveSubmissionExecute.
Receiver: await canton.ledger.interactiveSubmissionPrepare
Setup
import { Canton } from '@fairmint/canton-node-sdk';
const canton = new Canton({
network: 'devnet',
provider: '5n',
partyId: 'OWN_PARTY_ID',
});
Minimal example
const prepared = await canton.ledger.interactiveSubmissionPrepare({
commands: [],
commandId: 'prep-1',
userId: 'alice',
actAs: [canton.getPartyId()],
readAs: [],
synchronizerId: 'sync-id',
});
console.log(prepared.preparedTransactionHash);
Parameters — InteractiveSubmissionPrepareRequest
Defined by InteractiveSubmissionPrepareRequestSchema (schemas/api/interactive-submission.ts): CompositeCommand subsets (Create, Exercise, …).
Returns — InteractiveSubmissionPrepareResponse
preparedTransactionHash(required base16/hash string)- optional
preparedTransaction,hashingSchemeVersion,hashingDetails - optional
costEstimation(traffic cost projections) when Canton exposes metering hooks.
Errors and pitfalls
If hashing commands inconsistent later Canton rejects execute—never mutate payloads between prepare and execute.
Auth and party
Bearer token aligning with userId / actAs identities participating.