Request Transaction Data

Get transaction data of logics combinations

post
/v1/transactions/build
Body
anyOptional
and
Responses
200

OK

application/json
post
/v1/transactions/build
200

OK

Provides the transaction request that needs to be sent, comprising the Router contract address (to), transaction data (data), and the amount of ETH to be carried in the transaction (value).

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);

The result contains a list of chains that looks the following:

For more information on the routerData object and its properties, please refer to the Router Data Documentation.

Last updated