Function getFusionQuote

Gets a quote using either permit or standard on-chain transaction based on token capabilities. This function automatically determines whether to use permit-based or standard transactions by checking the payment token's permit support.

const quote = await getFusionQuote(client, {
chainId: "1",
walletProvider: "metamask",
trigger: {
chainId: "1",
paymentToken: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48" // USDC
},
instructions: [{
to: "0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
data: "0x...",
value: "0"
}]
});
// Returns either GetPermitQuotePayload or GetOnChainQuotePayload
// depending on USDC's permit support

Will throw an error if:

  • The payment token information cannot be retrieved
  • The quote generation fails
  • The API request fails