0.4.15 • Published 3 years ago
@thorswap-lib/xchain-util v0.4.15
@thorswap-lib/xchain-util
Utitity helpers for XChain clients
Modules (in alphabetical order)
asset- Utilities for handling assetsasync- Utitilies forasynchandlingbn- Utitilies for usingbignumber.jschain- Utilities for multi-chainstring- Utilities for strings
Usage
BigNumber
import bn, {
isValidBN,
bnOrZero,
validBNOrZero,
formatBN,
formatBNCurrency,
fixedBN
} from '@thorswap-lib/xchain-util'Async
import delay from '@thorswap-lib/xchain-util'Asset Helpers
import {
assetAmount,
baseAmount,
isAssetAmount,
isBaseAmount,
baseToAsset,
assetToBase,
formatAssetAmount,
formatBaseAsAssetAmount,
formatAssetAmountCurrency,
} from '@thorswap-lib/xchain-util'Installation
yarn add @thorswap-lib/xchain-utilThe following peer dependencies have to be installed into your project. These are not included in @thorswap-lib/xchain-util.
yarn add bignumber.js