Import
Usage
Parameters
None.Return Type
| Property | Type | Description |
|---|---|---|
templates | SettlementTemplate[] | Array of available templates. |
isLoading | boolean | true during fetch. |
error | string | null | Error message if fetch failed. |
refetch | () => Promise<void> | Manually re-fetch templates. |
SettlementTemplate
| Property | Type | Description |
|---|---|---|
id | string | Template UUID. |
slug | string | URL-friendly identifier (e.g., "dvp-bilateral"). |
name | string | Human-readable name. |
description | string | Template description. |
config | TemplateConfig | State machine definition. |
TemplateConfig
| Property | Type | Description |
|---|---|---|
states | string[] | All possible states. |
initial_state | string | Starting state for new settlements. |
terminal_states | string[] | States that end the settlement. |
failure_states | string[] | Terminal states indicating failure. |
transitions | object | Allowed state transitions. |
required_roles | string[] | Party roles needed (e.g., ["seller", "buyer"]). |
required_leg_types | string[] | Leg types needed (e.g., ["asset_delivery", "payment"]). |
Behavior
- Fetches once on mount.
- Templates are global (not environment-scoped) and rarely change.
- Use
refetch()if you need to re-check after template updates.