@keystoneos/react hooks.
Prerequisites
@keystoneos/reactinstalledKeystoneProviderconfigured with a valid session token (see Getting Started)- A React project with TypeScript
What you will build
A settlement list page with:- A table showing reference, state, parties, asset/payment amounts, and creation date
- Color-coded state badges
- A dropdown filter for settlement states
- Previous/next pagination with total count
- Click-to-detail navigation
Setting up the provider
Before building the dashboard component, make sure your app is wrapped inKeystoneProvider with a session token from your backend. The token needs settlements:read scope at minimum.
Building the state badge
ThegetStateInfo utility returns display metadata for each settlement state, including a human-readable label and a semantic category you can map to colors.
getStateInfo function maps states to categories:
| State | Category | Suggested Color |
|---|---|---|
INSTRUCTED | neutral | Gray |
COMPLIANCE_CHECKING | active | Blue |
COMPLIANCE_CLEARED | active | Blue |
AWAITING_DEPOSITS | warning | Amber |
EXECUTING_SWAP | active | Blue |
FINALIZED | success | Green |
ROLLED_BACK | error | Red |
TIMED_OUT | error | Red |
Building the state filter
Create a dropdown that filters settlements by state. Passingundefined fetches all states.
Building pagination controls
The complete dashboard
This is the full working component that ties everything together.What the data looks like
Here is an example of what a row renders with realistic data:| Reference | State | Parties | Asset | Payment | Created |
|---|---|---|---|---|---|
TRADE-2026-0042 | Awaiting Deposits | Securitize Fund I / Ondo Capital | 12,000,000 OUSG | 12,120,000 USDC | Apr 1, 2026 |
TRADE-2026-0038 | Finalized | Securitize Fund I / Ondo Capital | 5,000,000 US09311A1007 | 5,050,000 USDC | Mar 28, 2026 |
Adding click-to-detail navigation
The table rows are already clickable (usingwindow.location.href). In a real application, use your router’s navigation method:
Next steps
Real-time Tracking
Build a detail view with live state updates and event timelines.
Bilateral Instructions
Create settlements by submitting bilateral instructions.
useSettlements Reference
Full API reference for the useSettlements hook.
State Machine
Understand the settlement state machine and transitions.