0.4.15 • Published 3 years ago

@thorswap-lib/xchain-util v0.4.15

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

@thorswap-lib/xchain-util

Utitity helpers for XChain clients

Modules (in alphabetical order)

  • asset - Utilities for handling assets
  • async - Utitilies for async handling
  • bn - Utitilies for using bignumber.js
  • chain - Utilities for multi-chain
  • string - 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-util

The following peer dependencies have to be installed into your project. These are not included in @thorswap-lib/xchain-util.

yarn add bignumber.js
0.4.10

3 years ago

0.4.8

3 years ago

0.4.15

3 years ago

0.4.13

3 years ago

0.4.11

3 years ago

0.4.12

3 years ago

0.4.7

3 years ago

0.4.5

3 years ago

0.4.6

3 years ago

0.4.4

3 years ago

0.4.3

3 years ago

0.4.1

3 years ago

0.4.2

3 years ago

0.3.2

4 years ago

0.3.1

4 years ago