Options
All
  • Public
  • Public/Protected
  • All
Menu

Package bi

@ckb-lumos/bi

A big number library for lumos.

Example

import { BI } from "@ckb-lumos/bi";

BI.from(1).add(1)

Index

Type aliases

BIish

BIish: number | string | bigint | BI

BIish

BIish: number | string | bigint | BI

Unit

Unit: "shannon" | "ckb" | number

Unit

Unit: "shannon" | "ckb" | number

Variables

Const ckbDecimals

ckbDecimals: 8 = 8

Const ckbDecimals

ckbDecimals: 8 = 8

Const negativeOne

negativeOne: BI = BI.from(-1)

Const validUnitNames

validUnitNames: string[] = ["shannon", "ckb"]

Functions

formatFixed

  • formatFixed(value: BIish, decimals: number): string
  • Parameters

    • value: BIish
    • decimals: number

    Returns string

formatUnit

  • formatUnit(value: BIish, unit: Unit): string
  • Parameters

    Returns string

formatUnit

  • formatUnit(value: BIish, unit: Unit): string
  • Parameters

    Returns string

isBILike

  • isBILike(value: unknown): value is Record<string, unknown>
  • Parameters

    • value: unknown

    Returns value is Record<string, unknown>

isBIish

  • isBIish(value: unknown): value is BIish
  • Parameters

    • value: unknown

    Returns value is BIish

isBIish

  • isBIish(value: unknown): value is BIish
  • Parameters

    • value: unknown

    Returns value is BIish

isValidDecimalSize

  • isValidDecimalSize(decimals: number): boolean
  • Parameters

    • decimals: number

    Returns boolean

parseDecimals

  • parseDecimals(unit: Unit): number
  • Parameters

    Returns number

parseFixed

  • parseFixed(value: string, decimals: number): BI
  • Parameters

    • value: string
    • decimals: number

    Returns BI

parseUnit

  • parseUnit(value: string, unit: Unit): BI
  • Parameters

    • value: string
    • unit: Unit

    Returns BI

parseUnit

  • parseUnit(value: string, unit: Unit): BI
  • Parameters

    • value: string
    • unit: Unit

    Returns BI

toBI

  • toBI(value: JSBI): BI
  • Parameters

    • value: JSBI

    Returns BI

toJSBI

  • toJSBI(value: BIish): JSBI
  • Parameters

    Returns JSBI

toJSBI

  • toJSBI(value: BIish): JSBI
  • Parameters

    Returns JSBI

Generated using TypeDoc