Crypto Amount

CryptoAmount

Utility Class to combine an amount (asset/base) with the Asset

Parameters

  • amount
  • asset

check

This guard protects against trying to perform math with different assets

Example. const x = new CryptoAmount(assetAmount(1),AssetBTC) const y = new CryptoAmount(assetAmount(1),AssetETH)

x.plus(y) <- will throw error "cannot perform math on 2 diff assets BTC.BTC ETH.ETH

Parameters

  • v CryptoNumeric