Biconomy SDK
Search…
⌃K

Gas Payment from Smart Account

Besides gas sponsorship (using Account Abstraction Paymasters) Dapps can make users pay (from wallet assets) in supported ERC20 tokens by the relayer.
// your transaction action
const tx1 = {
to: <DESTINATION_CONTRACT>,
data: <ENCODED_DATA>
}
const feeQuotes = await smartAccount.prepareRefundTransaction(
{transaction:tx1}
);
// pick a fee quote, create transaction and dispatch
const transaction = await smartAccount.createRefundTransaction({
transaction: tx1,
feeQuote: feeQuotes[1], // say user chooses USDC from above
});
const txId = await smartAccount.sendTransaction({
tx: transaction, // temp
gasLimit,
});
Here's a complete example