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