@test-xchain/xchain-util
v0.3.5
Published
Helper utilities for XChain clients
Downloads
2
Readme
@test-xchain/xchain-util
THORChain = "THOR",
Utitity helpers for XChain clients
Modules (in alphabetical order)
asset
- Utilities for handling assetsasync
- Utitilies forasync
handlingbn
- Utitilies for usingbignumber.js
chain
- Utilities for multi-chainstring
- Utilities for strings
Usage
BigNumber
import bn, {
isValidBN,
bnOrZero,
validBNOrZero,
formatBN,
formatBNCurrency,
fixedBN
} from '@test-xchain/xchain-util'
Async
import delay from '@test-xchain/xchain-util'
Asset Helpers
import {
assetAmount,
baseAmount,
isAssetAmount,
isBaseAmount,
baseToAsset,
assetToBase,
formatAssetAmount,
formatBaseAsAssetAmount,
formatAssetAmountCurrency,
} from '@test-xchain/xchain-util'
Installation
yarn add @test-xchain/xchain-util
The following peer dependencies have to be installed into your project. These are not included in @test-xchain/xchain-util
.
yarn add bignumber.js