Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@xchainjs/xchain-util

Package Overview
Dependencies
Maintainers
5
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@xchainjs/xchain-util

Helper utilities for XChain clients

  • 0.2.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
151
decreased by-70.22%
Maintainers
5
Weekly downloads
 
Created
Source

@xchainjs/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 '@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-util

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

yarn add bignumber.js

Keywords

FAQs

Package last updated on 11 Dec 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc