> ## Documentation Index
> Fetch the complete documentation index at: https://docs.li.fi/llms.txt
> Use this file to discover all available pages before exploring further.

# Materialisers 目录

> 在 compose manifest 中注册的每一个 materialiser。

export const ComposeMaterialisers = () => {
  const DEDICATED_MATERIALISERS = new Set(['balanceOf', 'call', 'directDeposit', 'flashloan']);
  const [state, setState] = useState({
    data: null,
    error: null
  });
  useEffect(() => {
    let cancelled = false;
    setState({
      data: null,
      error: null
    });
    const run = async () => {
      try {
        const response = await fetch('https://composer.li.quest/compose/manifest');
        if (!response.ok) throw new Error(`HTTP ${response.status} ${response.statusText}`);
        const body = await response.json();
        if (!body || body.success !== true) {
          throw new Error(body?.error?.message ?? 'Unexpected response shape');
        }
        if (!cancelled) setState({
          data: body.data,
          error: null
        });
      } catch (err) {
        if (!cancelled) setState({
          data: null,
          error: err.message ?? String(err)
        });
      }
    };
    run();
    return () => {
      cancelled = true;
    };
  }, []);
  const slugify = s => String(s).replace(/\./g, '-').replace(/([a-z0-9])([A-Z])/g, '$1-$2').replace(/_/g, '-').toLowerCase();
  const renderBody = () => {
    if (state.error) {
      return <div style={{
        padding: '0.75rem 1rem',
        border: '1px solid #f5c6cb',
        background: '#f8d7da',
        color: '#721c24',
        borderRadius: '6px'
      }}>
        <strong>Failed to load materialisers.</strong>
        <div style={{
        fontFamily: 'monospace',
        marginTop: '0.25rem',
        fontSize: '0.9em'
      }}>{state.error}</div>
      </div>;
    }
    if (!state.data) return <div>Loading materialisers…</div>;
    const manifest = state.data;
    const materialisers = [...manifest.materialisers ?? []].sort((a, b) => a.kind.localeCompare(b.kind));
    return <>
      <div style={{
      marginBottom: '0.5rem',
      fontSize: '0.9em',
      opacity: 0.75
    }}>
        Manifest version <code>{manifest.manifestVersion}</code> · <code>{materialisers.length}</code> materialisers
      </div>
      <table>
        <thead>
          <tr>
            <th className="text-left"><strong>Materialiser</strong></th>
            <th className="text-left"><strong>Description</strong></th>
            <th className="text-left"><strong>Accepts</strong></th>
          </tr>
        </thead>
        <tbody>
          {materialisers.map(m => <tr key={m.kind}>
              <td>
                {DEDICATED_MATERIALISERS.has(m.kind) ? <a href={`/composer/composer-api/materialisers/${slugify(m.kind)}`}><code>{m.kind}</code></a> : <code>{m.kind}</code>}
              </td>
              <td>{m.description ?? ''}</td>
              <td><code>{m.accepts}</code></td>
            </tr>)}
        </tbody>
      </table>
    </>;
  };
  return renderBody();
};

本页列出在 compose manifest 中注册的每一个 materialiser。有关 materialiser 的定义、何时使用它，以及它们所产生的前置条件，请参见 [Build a Flow](/composer/composer-api/guides/build-a-flow#wire-runtime-values)。

下方列表根据 compose manifest 实时渲染。每一项都链接到一个单独的 materialiser 页面，其中包含它的 config JSON Schema 和一个使用示例。

<ComposeMaterialisers />
