@multiversx/sdk-dapp-swap
Version:
A library to hold the main logic for swapping between tokens on the MultiversX blockchain
3 lines (2 loc) • 436 B
JavaScript
import{b as e}from"./chunk-QXTSQDB3.js";import{f as n}from"./chunk-5W737WN4.js";n();import r from"bignumber.js";var y=({tolerance:m,secondAmount:i,isFixedOutput:o,swapActionType:p,secondTokenDecimals:t})=>{if(!i)return;if(o||p!=="swap")return e({input:i,decimals:t});let u=new r(1).dividedBy(new r(m).dividedBy(100).plus(1)).times(i).toFixed(0);return e({input:u,decimals:t})};export{y as a};
//# sourceMappingURL=chunk-ZVPH66VY.js.map