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

# External Wallets + Supertransaction API

> Enable MEE orchestration for MetaMask, Rabby, and Trust Wallet using the REST API

External wallets use `eoa` mode (Fusion) and do not support EIP-7702. This is the minimal Supertransaction API flow: request a quote, **sign the payload returned by the API**, then execute.

<Info>
  Signing the payload is the critical step. The API returns `payloadToSign` and a `quoteType` (`permit` or `onchain`) that tells you how to sign.
</Info>

## Minimal EOA (Fusion) flow

```typescript theme={null}
import { createWalletClient, custom } from "viem";

const walletClient = createWalletClient({
  account: userAddress,
  transport: custom(window.ethereum),
});

const quoteResponse = await fetch("https://api.biconomy.io/v1/quote", {
  method: "POST",
  headers: {
    "X-API-Key": "YOUR_API_KEY",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    mode: "eoa",
    ownerAddress: userAddress,
    fundingTokens: [
      {
        tokenAddress: "0xToken",
        chainId: 1,
        amount: "1000000",
      },
    ],
    composeFlows: [...],
  }),
});

const quote = await quoteResponse.json();
const payload = quote.payloadToSign[0];

let signature;
if (quote.quoteType === "permit") {
  signature = await walletClient.signTypedData({
    ...payload.signablePayload,
    account: userAddress,
  });
} else {
  const txHash = await walletClient.sendTransaction({
    to: payload.to,
    data: payload.data,
    value: BigInt(payload.value || "0"),
  });
  signature = txHash;
}

await fetch("https://api.biconomy.io/v1/execute", {
  method: "POST",
  headers: {
    "X-API-Key": "YOUR_API_KEY",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    ...quote,
    payloadToSign: [{ ...payload, signature }],
  }),
});
```
