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.
Signing the payload is the critical step. The API returns payloadToSign and a quoteType (permit or onchain) that tells you how to sign.
Minimal EOA (Fusion) flow
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 }],
}),
});