Request Transaction Data
const getRouterTransactionRequest = async (routerData) => {
const result = await client.post("/v1/transactions/build", { body: routerData });
return result.data;
};
const routerData = {
chainId: 1,
account: USER_ADDRESS,
logics: [swapLogic, supplyLogic],
// If the estimate result returns permitData, the user should sign the permitData,
// and return the signed permitSig along with it.
permitData: permitData,
permitSig: permitSig,
// If there is only one referral address, you can use the 'referral' property.
// If there are multiple referral addresses, use 'referrals' and specify the rates accordingly.
referral: collector,
referrals: [
{ collector: collector, rate: 5000 },
...
]
};
const transactionRequest = await getRouterTransactionRequest(routerData);Last updated