Class representing a hive asset, e.g. `1.000 HIVE` or `12.112233 VESTS`.

### Hierarchy

- Asset

## Index

### Constructors

- constructor

### Properties

- amount
- symbol

### Methods

- add
- divide
- getPrecision
- multiply
- steem_symbols
- subtract
- toJSON
- toString
- from
- fromString
- max
- min

## Constructors

### constructor

- new Asset(amount: number, symbol: AssetSymbol): Asset

- - Defined in chain/asset.ts:60

  #### Parameters

  - ##### amount: number

  - ##### symbol: AssetSymbol

  #### Returns Asset

## Properties

### amount

amount: number

- Defined in chain/asset.ts:62

### symbol

symbol: AssetSymbol

- Defined in chain/asset.ts:63

## Methods

### add

- add(amount: Asset | string | number): Asset

- - Defined in chain/asset.ts:174

  Return a new Asset instance with amount added.

  #### Parameters

  - ##### amount: Asset | string | number

  #### Returns Asset

### divide

- divide(divisor: Asset | string | number): Asset

- - Defined in chain/asset.ts:207

  Return a new Asset with the amount divided.

  #### Parameters

  - ##### divisor: Asset | string | number

  #### Returns Asset

### getPrecision

- getPrecision(): number

- - Defined in chain/asset.ts:135

  Return asset precision.

  #### Returns number

### multiply

- multiply(factor: Asset | string | number): Asset

- - Defined in chain/asset.ts:195

  Return a new Asset with the amount multiplied by factor.

  #### Parameters

  - ##### factor: Asset | string | number

  #### Returns Asset

### steem_symbols

- steem_symbols(): Asset

- - Defined in chain/asset.ts:153

  returns a representation of this asset using only STEEM SBD for legacy purposes

  #### Returns Asset

### subtract

- subtract(amount: Asset | string | number): Asset

- - Defined in chain/asset.ts:183

  Return a new Asset instance with amount subtracted.

  #### Parameters

  - ##### amount: Asset | string | number

  #### Returns Asset

### toJSON

- toJSON(): string

- - Defined in chain/asset.ts:219

  For JSON serialization, same as toString().

  #### Returns string

### toString

- toString(): string

- - Defined in chain/asset.ts:167

  Return a string representation of this asset, e.g. `42.000 HIVE`.

  #### Returns string

### Static from

- from(value: string | Asset | number, symbol?: AssetSymbol): Asset

- - Defined in chain/asset.ts:93

  Convenience to create new Asset.

  #### Parameters

  - ##### value: string | Asset | number

  - ##### Optional symbol: AssetSymbol

    Symbol to use when created from number. Will also be used to validate the asset, throws if the passed value has a different symbol than this.

  #### Returns Asset

### Static fromString

- fromString(string: string, expectedSymbol?: AssetSymbol): Asset

- - Defined in chain/asset.ts:69

  Create a new Asset instance from a string, e.g. `42.000 HIVE`.

  #### Parameters

  - ##### string: string

  - ##### Optional expectedSymbol: AssetSymbol

  #### Returns Asset

### Static max

- max(a: Asset, b: Asset): Asset

- - Defined in chain/asset.ts:124

  Return the larger of the two assets.

  #### Parameters

  - ##### a: Asset

  - ##### b: Asset

  #### Returns Asset

### Static min

- min(a: Asset, b: Asset): Asset

- - Defined in chain/asset.ts:113

  Return the smaller of the two assets.

  #### Parameters

  - ##### a: Asset

  - ##### b: Asset

  #### Returns Asset

Generated using TypeDoc