VaultCatalogue

One row per configured vault — share model, live exchange rate, live fees and exit routes — with an unreadable value rendered unavailable rather than as a zero.

import { VaultCatalogue } from '@flarekit-dev/react-ui'

VaultCatalogue lists the vaults configured for the active network: which protocol, which deposit asset, whether the share is the vault itself or a separate LP token, the live exchange rate, the live withdrawal fee per route, and the exits the vault actually offers. Every value comes from a read, carries its provenance, and renders when it is unknown.

Live#

The preview runs the gallery's own rows, built from the M7 Coston2 reads. The state switcher walks the cases the surface was verified against, so nothing here shows a row shape the catalogue never actually reached.

observed fixtures

Vaults

Coston2
FirelightSelf-share vault · stFXRP
On chainjust now
Deposit assetFTestXRP
Exchange rate1.000000 FTestXRP / stFXRP
Withdrawal feeDelayed None
Exit routesDelayed
Deposit headroom0.005939 FTestXRP A global vault limit, not standard maxDeposit.
Delayed exit
UpshiftSeparate LP token · vFXRP
On chainjust now
Deposit assetFTestXRP
Exchange rate1.008494 FTestXRP / vFXRP
Withdrawal feeInstant 0.50% · Delayed 0.25%
Exit routesInstant · Delayed
Withdrawal cap10000.000000 FTestXRP
Instant exitDelayed exit

Usage#

Hand it the configured vaults and whatever reads you have. A vault with no reads is a row that says so — you do not have to hold the list back until every read lands.

import { vaultsFor } from '@flarekit-dev/core'
import { VaultCatalogue } from '@flarekit-dev/react-ui'
import '@flarekit-dev/react-ui/styles.css'

export function Vaults({ reads, now }) {
  const rows = vaultsFor('coston2').map((config) => ({
    config,
    ...(reads[config.key] ? { reads: reads[config.key] } : {}),
  }))

  return <VaultCatalogue rows={rows} now={now} networkLabel="Coston2" />
}

Props#

PropTypeDefaultDescription
rowsrequiredreadonly VaultRow[]One row per vault: its `VaultConfig`, the live `reads` when they were fetched, and the `provenance` observation behind them. Omit `reads` and the row renders unavailable rather than empty.
nowrequirednumberThe host clock in unix seconds, for the provenance chip ages. A prop, never `Date.now()` inside the component, so a render is reproducible.
networkLabelstringThe network named in the panel subtitle — `Coston2`, `Flare`. Vault addresses come from `@flarekit-dev/contracts`; this only labels them.
mockLabelstringNames the mock driving the rows, which renders an explicit Mock note. Set it only when the data really is mock; it is never a fallback.
theme'light' | 'dark'Overrides the inherited theme. Normally left unset — the widget follows data-theme.
classNamestringExtra class on the outer element, so a host layout can place the catalogue.

What it renders#

A panel of vault rows. Each row leads with the protocol and its share model — Self-share vault with the vault's own token, or Separate LP token with the LP symbol — then the deposit asset, the exchange rate as assets per share, the withdrawal fee per route, the exit routes, and the caps that exist: Firelight's global deposit headroom, Upshift's withdrawal cap. It fetches nothing itself, so the same catalogue serves a page, a modal or an embed.

States#

Every state in the switcher above is imported from packages/react-ui/gallery/, one source of truth for both the gallery and these docs:

  • list — both vaults, each with its share model, live rate, live fees and exit-route chips.
  • vault paused — a first-class state, not a user error. Deposits and reads are unaffected and the row says so; the withdraw action is unavailable until the vault resumes.
  • withdraw unverified — the vault's reads all render, but its withdraw action is a declared-unbuilt affordance with the reason stated. This is the withdrawVerified: false flag: the path has not been driven live on this network, which is not proven, not broken.
  • read unavailable — the reads could not be fetched. The row says it could not read the vault and that this is not a zero, because a confident 0 here would be an invented balance.

Mock to live#

The catalogue is prop-driven, so moving from the mock to a live network changes where the rows' reads come from, not the screen. Vault addresses come from @flarekit-dev/contracts; network is configuration.

// From this…
const adapter = createMockVaultAdapter('upshift-fxrp')

// …to this. The component does not change.
const adapter = makeVaultAdapter(publicClient, vaultByKey('coston2', 'upshift-fxrp')!)

What it will not do#

It will not render an unread value as 0, and it will not offer a withdraw action for a vault whose withdraw path is unverified on this network — it shows the affordance disabled with the reason, rather than a plan that could sign an approval and then revert. A paused vault is stated as paused, never as an error you caused.