@rarimo/swap
Version:
Internal tools that other Rarimo packages use to swap tokens.
38 lines (37 loc) • 1.1 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
getSameChainBundleData: function() {
return getSameChainBundleData;
},
buildSameChainBundleData: function() {
return buildSameChainBundleData;
}
});
const _enums = require("../../../enums");
const getSameChainBundleData = (isBridgingRequired, bundle)=>{
if (isBridgingRequired) return [];
return buildSameChainBundleData(bundle);
};
const buildSameChainBundleData = ({ bundle } = {})=>{
if (!bundle) return [];
// If bridging is not required and a bundle is provided, thus we need to execute
// a bundle on the same chain. To execute the transaction bundle on the same
// chain, we need to use multicall
return [
{
command: _enums.SwapCommands.Multicall,
skipRevert: false,
data: bundle
}
];
};
//# sourceMappingURL=same-chain.js.map