Class representing a steem asset, e.g. `1.000 STEEM` or `12.112233 VESTS`.

### Hierarchy

- Asset

## Index

### Constructors

- constructor

### Properties

- amount
- symbol

### Methods

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

## Constructors

### constructor

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

- - Defined in steem/asset.ts:107

  #### Parameters

  - ##### amount: number

  - ##### symbol: AssetSymbol

  #### Returns Asset

## Properties

### amount

amount: number

- Defined in steem/asset.ts:109

### symbol

symbol: AssetSymbol

- Defined in steem/asset.ts:109

## Methods

### add

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

- - Defined in steem/asset.ts:136

  Return a new Asset instance with amount added.

  #### Parameters

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

  #### Returns Asset

### divide

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

- - Defined in steem/asset.ts:163

  Return a new Asset with the amount divided.

  #### Parameters

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

  #### Returns Asset

### getPrecision

- getPrecision(): number

- - Defined in steem/asset.ts:114

  Return asset precision.

  #### Returns number

### multiply

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

- - Defined in steem/asset.ts:154

  Return a new Asset with the amount multiplied by factor.

  #### Parameters

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

  #### Returns Asset

### subtract

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

- - Defined in steem/asset.ts:145

  Return a new Asset instance with amount subtracted.

  #### Parameters

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

  #### Returns Asset

### toJSON

- toJSON(): string

- - Defined in steem/asset.ts:172

  For JSON serialization, same as toString().

  #### Returns string

### toString

- toString(): string

- - Defined in steem/asset.ts:129

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

  #### Returns string

### Static from

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

- - Defined in steem/asset.ts:78

  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 steem/asset.ts:58

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

  #### Parameters

  - ##### string: string

  - ##### Optional expectedSymbol: AssetSymbol

  #### Returns Asset

### Static max

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

- - Defined in steem/asset.ts:104

  Return the larger of the two assets.

  #### Parameters

  - ##### a: Asset

  - ##### b: Asset

  #### Returns Asset

### Static min

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

- - Defined in steem/asset.ts:96

  Return the smaller of the two assets.

  #### Parameters

  - ##### a: Asset

  - ##### b: Asset

  #### Returns Asset

Generated using TypeDoc