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