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:101

  #### Parameters

  - ##### amount: number

  - ##### symbol: AssetSymbol

  #### Returns Asset

## Properties

### amount

amount: number

- Defined in steem/asset.ts:103

### symbol

symbol: AssetSymbol

- Defined in steem/asset.ts:103

## Methods

### add

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

- - Defined in steem/asset.ts:128

  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:155

  Return a new Asset with the amount divided.

  #### Parameters

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

  #### Returns Asset

### getPrecision

- getPrecision(): number

- - Defined in steem/asset.ts:108

  Return asset precision.

  #### Returns number

### multiply

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

- - Defined in steem/asset.ts:146

  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:137

  Return a new Asset instance with amount subtracted.

  #### Parameters

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

  #### Returns Asset

### toJSON

- toJSON(): string

- - Defined in steem/asset.ts:164

  For JSON serialization, same as toString().

  #### Returns string

### toString

- toString(): string

- - Defined in steem/asset.ts:121

  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:72

  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:52

  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:98

  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:90

  Return the smaller of the two assets.

  #### Parameters

  - ##### a: Asset

  - ##### b: Asset

  #### Returns Asset

Generated using TypeDoc