Skip to main content
Templates are read-only definitions that configure the settlement state machine, required roles, leg types, compliance providers, and action handlers.

list

const { items: templates } = await client.templates.list();

for (const template of templates) {
  console.log(`${template.slug}: ${template.name}`);
  console.log(`  Roles: ${template.config.requiredRoles.join(", ")}`);
  console.log(`  States: ${template.config.states.length}`);
}
FieldTypeDefaultDescription
limitnumber50Max items per page
offsetnumber0Items to skip

get

const template = await client.templates.get("template-uuid");

console.log(template.config.initialState);    // "INSTRUCTED"
console.log(template.config.terminalStates);  // ["FINALIZED", "ROLLED_BACK", "TIMED_OUT"]

SettlementTemplateRead

FieldTypeDescription
idstringTemplate UUID
slugstringURL-friendly identifier (e.g., "dvp-bilateral")
namestringHuman-readable name
descriptionstring | nullTemplate description
configTemplateConfigState machine definition
versionnumberCurrent version
isActivebooleanWhether the template is available
createdAtstringCreation timestamp
updatedAtstringLast update timestamp

TemplateConfig

FieldTypeDescription
statesstring[]All possible states in the lifecycle
initialStatestringStarting state for new settlements
terminalStatesstring[]States that end the settlement
failureStatesstring[]Subset of terminal states indicating failure
transitionsRecord<string, TransitionRule>Which states can transition to which
requiredRolesstring[]Party roles needed (e.g., ["seller", "buyer"])
complianceComplianceConfigCompliance provider configuration
actionsRecord<string, ActionConfig>Action handlers per state

TransitionRule

{ allowedNext: string[] }

ComplianceConfig

FieldTypeDescription
entityProvidersstring[]KYC/AML providers (e.g., ["lseg_worldcheck"])
walletProvidersstring[]Wallet screening providers (e.g., ["cipherowl"])
recheckAtStatesstring[]States where compliance is re-verified

ActionConfig

FieldTypeDescription
typestringAction type (e.g., "compliance_check", "noop", "register_escrow")
providerstringProvider handling this action
resolutionstring"immediate", "webhook", "poll", or "manual"
timeoutSecondsnumberMax time for the action to complete
paramsobjectAction-specific configuration