For the complete documentation index, see llms.txt. This page is also available as Markdown.

Composing App Flows

Build realistic connect, sign, transfer, and contract flows with the MOSS React SDK.

Treat these as product-flow patterns, not just code snippets. The goal is predictable user intent, clear approvals, and minimal delegated authority by default.

Connect and Gate UI

function WalletButton() {
  const status = useStatus();
  const connect = useConnect();

  if (!status.initialised) return <button disabled>Loading wallet...</button>;

  return (
    <button onClick={() => connect.mutate()}>
      {status.status === 'connected' ? status.address : 'Connect MOSS'}
    </button>
  );
}

Use this first step to gate account access. In connected-wallet UX copy, prefer:

  • Creating your account

  • Restoring account

Sign After Connect

MOSS Auth Token Flow

Transfer with Post-Success Refresh

Wallet-Native Send/Swap Entry

Read Contract Data in a Flow

Permissions-First Automation

When a flow needs follow-up actions without repeated prompts, grant the narrowest possible app permissions first and only then introduce silent behavior for session grants.

Last updated