0.4.15 • Published 2 years ago

@thorswap-lib/xchain-util v0.4.15

Weekly downloads
-
License
MIT
Repository
github
Last release
2 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

2 years ago

0.4.8

2 years ago

0.4.15

2 years ago

0.4.13

2 years ago

0.4.11

2 years ago

0.4.12

2 years ago

0.4.7

2 years ago

0.4.5

2 years ago

0.4.6

2 years ago

0.4.4

2 years ago

0.4.3

2 years ago

0.4.1

2 years ago

0.4.2

2 years ago

0.3.2

2 years ago

0.3.1

2 years ago