Options
All
  • Public
  • Public/Protected
  • All
Menu

Captures sdk.Coin and sdk.DecCoin from Cosmos SDK. A composite value that combines a denomination with an amount value. Coins are immutable once created, and operations that return Coin will return a new Coin. See Coins for a collection of Coin objects.

Hierarchy

Implements

Index

Constructors

constructor

  • Creates a new coin. Depending on the type of amount, it will be converted to an integer coin or decimal coin.

    Parameters

    • denom: Denom

      denomination

    • amount: Input

      coin's amount

    Returns Coin

Properties

Readonly amount

amount: Output

Readonly denom

denom: Denom

denomination

Methods

add

div

isDecCoin

  • isDecCoin(): boolean

isIntCoin

  • isIntCoin(): boolean

mod

mul

sub

toData

toDecCoin

toIntCoin

toJSON

  • toJSON(): string

toString

  • toString(): string
  • Outputs <amount><denom>.

    Eg: Coin('uluna', 1500) -> 1500uluna

    Returns string

Static fromData

Legend

  • Constructor
  • Property
  • Method
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Static property
  • Static method
  • Property

Generated using TypeDoc