Signing the payload is the critical step. The API returns
payloadToSign, and you must sign it with Para before calling /v1/execute.Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Build server-side flows with Para session-based authentication and Biconomy using the REST API
payloadToSign, and you must sign it with Para before calling /v1/execute.import { Para as ParaServer, Environment } from "@getpara/server-sdk";
const para = new ParaServer(Environment.BETA, process.env.PARA_API_KEY);
await para.importSession(session);
const ownerAddress = await para.getAddress();
let 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-7702",
ownerAddress,
composeFlows: [...],
}),
});
if (quoteResponse.status === 412) {
const { authorizations } = await quoteResponse.json();
const signedAuths = await Promise.all(
authorizations.map(async (authItem) => {
const authorization = await para.signAuthorization({
contractAddress: authItem.address,
chainId: authItem.chainId,
nonce: authItem.nonce,
});
return {
...authorization,
yParity: authorization.yParity,
v: authorization.v?.toString(),
};
})
);
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-7702",
ownerAddress,
composeFlows: [...],
authorizations: signedAuths,
}),
});
}
const quote = await quoteResponse.json();
const payload = quote.payloadToSign[0];
const signablePayload = payload.signablePayload ?? payload;
const signature = await para.signMessage(signablePayload.message.raw);
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 }],
}),
});