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

# Cash-out flow

> End-to-end sequence for moving USDC from an Archer smart wallet to a fiat bank account through Bridge.

Cash-out is the composition of three subsystems: Bridge (KYC + off-ramp), the Archer smart wallet (USDC transfer), and the host wallet-authorization surface (signature).

## Actors

* **End user** — owns the smart wallet, completes KYC, taps “Cash out”.
* **Host app** — hosts the SDK, owns the signing key, drives the UI.
* **Archer API** — prepares intents, calls Bridge, relays user operations.
* **Bridge** — KYC provider and off-ramp; issues liquidation addresses and settles fiat.
* **Base network** — executes the USDC transfer on chain.

## Sequence

```text theme={null}
end user      host app          SDK / API         Bridge         Base
   │              │                 │              │              │
   │  tap cash out                  │              │              │
   ├───────────▶│                 │              │              │
   │              │ getBridgeStatus│              │              │
   │              ├───────────────▶ KYC + TOS ──▶│              │
   │              │ ensureLiquidationAddress    │              │
   │              ├───────────────────────────▶│              │
   │              │ prepareCashOut(amount, usdc)│              │
   │              ├───────────────▶ build intent│              │
   │              ◀─── prepared user op + payload────────────┤              │
   │  approve     │                 │              │              │
   ◀───────────┤                 │              │              │
   │  sign        │                 │              │              │
   ├───────────▶ Privy signer   │              │              │
   │              │ submitWalletIntent(intent, signed)          │
   │              ├───────────────▶ verify + bundle ────────▶│ transfer USDC
   │              │                 │              │              │ to liquidation
   │              │                 │              ◀───────────┤ addr
   │              │                 │   settle fiat│              │
   │              │                 │              │─▶ payout   │
```

## Steps

1. **Check status.** `client.getBridgeStatus()`. If not approved, `startBridgeVerification` and send the end user through `kyc_link` / `tos_link`.
2. **Add a destination.** `createExternalAccount` (or list existing ones). Bridge validates the account (in the US, via VoP for supported rails).
3. **Ensure a liquidation address.** `ensureLiquidationAddress` returns a Base address that Bridge sweeps to fiat and settles to the external account.
4. **Prepare.** `prepareCashOut` builds an `erc20_transfer` intent from the end user's smart wallet to the liquidation address and asks Archer to prepare the ERC-4337 user operation.
5. **Authorize.** The host calls its wallet-authorization surface with `prepared.intent` and `prepared.prepared.request_payload`, receives a signature, and packages it as `SignedPayload`.
6. **Submit.** `submitWalletIntent` returns `{ tx_hash, user_operation_hash }`. The transfer executes on Base.
7. **Settle.** Bridge detects the deposit at the liquidation address and initiates fiat settlement to the linked bank account. Poll `getOfframpHistory` for status.

## Failure recovery

* If step 5 fails (user rejects, signer offline), nothing has hit chain — you can retry from step 4.
* If step 6 succeeds but the user operation reverts on chain, the response carries a `tx_hash`; the funds never leave the smart wallet.
* Bridge settlement failures show up in `getOfframpHistory` with `combined_status` reflecting the reason.


## Related topics

- [Quickstart](/quickstart.md)
- [Cash out to a bank account](/guides/cash-out.md)
