
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
defi-utils
Advanced tools
An Accessible Defi Utility for Defi
npm install --save defi-utils
or
yarn add defi-utils
import DefiUtils from 'defi-utils'
/**
* Convert a full decimals value into basic units
*
* @param decimals
* @returns DefiUtils
*/
new DefiUtils("1").toBasicUnits(18).toString() // 100000000000000000000
/**
* Convert a basic units value into full decimals
*
* @param decimals
* @returns DefiUtils
*/
new DefiUtils("100000000000000000000").toFullDecimals(18).toString() // 1
/**
* Convert a token amount into underlying amount
*
* @param exchangeRate
* @returns DefiUtils
*/
new DefiUtils("4999831433").toUnderlying("200006742877822").toString() // 1000000
/**
* Convert a underlying amount into token amount
*
* @param exchangeRate
* @returns DefiUtils
*/
new DefiUtils("1000000").toTokens("200006742877822").toString() // 4999831434
/**
* Convert a value into a usd value
*
* @param priceUSD
* @returns DefiUtils
*/
new DefiUtils("20").toUSD(2).toString() // 40
/**
* Convert a value usd into a value
*
* @param priceUSD
* @returns DefiUtils
*/
new DefiUtils("40").fromUSD(2).toString() // 20
MIT
FAQs
> An Accessible Defi Utility for Defi
The npm package defi-utils receives a total of 24 weekly downloads. As such, defi-utils popularity was classified as not popular.
We found that defi-utils demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.