@hikaru-fi/swap-router
Version:
Package for calculating optimal path for executing swaps
32 lines (28 loc) • 589 B
JavaScript
const PoolTypes = {
WeightedPool: 'WeightedPool',
StablePool: 'StablePool',
All: 'All'
}
const SwapTypes = {
// main swap types
Sell: 'SellTokens',
Buy: 'BuyTokens',
None: 'None',
// helper swap types
SingleSwap: 'SingleSwap',
MultipleSwaps: 'MultipleSwaps'
}
/**
*
* @param {String} swapType
* @returns {Number}
*/
function getSwapType(swapType) {
if (swapType == SwapTypes.Sell) return 0;
if (swapType == SwapTypes.Buy) return 1;
}
module.exports = {
PoolTypes,
SwapTypes,
getSwapType
}