Skip to main content

Class: GasPrice

A gas price, i.e. the price of a single unit of gas. This is typically a fraction of the smallest fee token unit, such as 0.012utoken.

Constructors

constructor

new GasPrice(amount, denom): GasPrice

Parameters

NameType
amountDecimal
denomstring

Returns

GasPrice

Defined in

node_modules/@cosmjs/stargate/build/fee.d.ts:10

Properties

amount

Readonly amount: Decimal

Defined in

node_modules/@cosmjs/stargate/build/fee.d.ts:8


denom

Readonly denom: string

Defined in

node_modules/@cosmjs/stargate/build/fee.d.ts:9

Methods

toString

toString(): string

Returns a string representation of this gas price, e.g. "0.025uatom". This can be used as an input to GasPrice.fromString.

Returns

string

Defined in

node_modules/@cosmjs/stargate/build/fee.d.ts:24


fromString

fromString(gasPrice): GasPrice

Parses a gas price formatted as <amount><denom>, e.g. GasPrice.fromString("0.012utoken").

The denom must match the Cosmos SDK 0.42 pattern (https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/types/coin.go#L599-L601). See GasPrice in @cosmjs/stargate for a more generic matcher.

Separators are not yet supported.

Parameters

NameType
gasPricestring

Returns

GasPrice

Defined in

node_modules/@cosmjs/stargate/build/fee.d.ts:19