diff --git a/packages/launchpad/src/fee.ts b/packages/launchpad/src/fee.ts index 7622d551..b3949755 100644 --- a/packages/launchpad/src/fee.ts +++ b/packages/launchpad/src/fee.ts @@ -3,6 +3,10 @@ import { Decimal, Uint53 } from "@cosmjs/math"; export type FeeTable = Record; +/** + * A gas price, i.e. the price of a single gas. This is typically a fraction of + * the smallest fee token unit, such as 0.012utoken. + */ export class GasPrice { public readonly amount: Decimal; public readonly denom: string; @@ -12,6 +16,9 @@ export class GasPrice { this.denom = denom; } + /** + * Parses a gas price formatted as ``, e.g. `GasPrice.fromString("0.012utoken")`. + */ public static fromString(gasPrice: string): GasPrice { const matchResult = gasPrice.match(/^([0-9.]+?)([a-z]+)$/); if (!matchResult) { diff --git a/packages/stargate/src/fee.ts b/packages/stargate/src/fee.ts index ee4b0f6f..4ad98317 100644 --- a/packages/stargate/src/fee.ts +++ b/packages/stargate/src/fee.ts @@ -8,6 +8,9 @@ import { coins } from "@cosmjs/proto-signing"; export type FeeTable = Record; /** + * A gas price, i.e. the price of a single gas. This is typically a fraction of + * the smallest fee token unit, such as 0.012utoken. + * * This is the same as GasPrice from @cosmjs/launchpad but those might diverge in the future. */ export class GasPrice { @@ -19,6 +22,9 @@ export class GasPrice { this.denom = denom; } + /** + * Parses a gas price formatted as ``, e.g. `GasPrice.fromString("0.012utoken")`. + */ public static fromString(gasPrice: string): GasPrice { const matchResult = gasPrice.match(/^([0-9.]+?)([a-z]+)$/); if (!matchResult) {