@biconomy/abstractjs
Version:
SDK for Biconomy integration with support for account abstraction, smart accounts, ERC-4337.
27 lines • 928 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.queryBridge = void 0;
const toAcrossPlugin_1 = require("../utils/toAcrossPlugin.js");
const queryBridge = async (params) => {
const { depositor, recipient, fromChainId, toChainId, plugin = (0, toAcrossPlugin_1.toAcrossPlugin)(), amount, tokenMapping } = params;
const result = await plugin.encodeBridgeUserOp({
depositor,
recipient,
fromChainId,
toChainId,
tokenMapping,
bridgingAmount: amount
});
if (!result.receivedAtDestination)
return null;
return {
fromChainId: fromChainId,
amount,
receivedAtDestination: result.receivedAtDestination,
plugin,
userOp: result.userOp,
bridgingDurationExpectedMs: result.bridgingDurationExpectedMs
};
};
exports.queryBridge = queryBridge;
//# sourceMappingURL=queryBridge.js.map