@kaiachain/web3js-ext
Version:
web3.js extension for kaiachain blockchain
18 lines (17 loc) • 988 B
JavaScript
import { getGaslessSwapRouter, getApproveTx, getAmountRepay, getMinAmountOut, getAmountIn, getSwapTx, } from "./gasless.js";
export function context_gasless(context, eth) {
return {
getGaslessSwapRouter: async function (address) {
return await getGaslessSwapRouter(context, address);
},
getApproveTx: async function (fromAddress, tokenAddr, routerAddress, gasPrice) {
return await getApproveTx(context, eth, fromAddress, tokenAddr, routerAddress, gasPrice);
},
getSwapTx: async function (fromAddress, tokenAddr, routerAddress, amountIn, minAmountOut, amountRepay, gasPrice, approveRequired = false, deadlineBuffer = 1800) {
return await getSwapTx(eth, fromAddress, tokenAddr, routerAddress, amountIn, minAmountOut, amountRepay, gasPrice, approveRequired, deadlineBuffer);
},
getAmountRepay: getAmountRepay,
getMinAmountOut: getMinAmountOut,
getAmountIn: getAmountIn,
};
}