diff --git a/packages/launchpad/src/fee.ts b/packages/launchpad/src/fee.ts index f1c4e8fc..7622d551 100644 --- a/packages/launchpad/src/fee.ts +++ b/packages/launchpad/src/fee.ts @@ -13,11 +13,11 @@ export class GasPrice { } public static fromString(gasPrice: string): GasPrice { - const matchResult = gasPrice.match(/^(?[0-9.]+?)(?[a-z]+)$/); + const matchResult = gasPrice.match(/^([0-9.]+?)([a-z]+)$/); if (!matchResult) { throw new Error("Invalid gas price string"); } - const { amount, denom } = matchResult.groups as { readonly amount: string; readonly denom: string }; + const [_, amount, denom] = matchResult; if (denom.length < 3 || denom.length > 127) { throw new Error("Gas price denomination must be between 3 and 127 characters"); } diff --git a/packages/stargate/src/fee.ts b/packages/stargate/src/fee.ts index a41c7ce2..ee4b0f6f 100644 --- a/packages/stargate/src/fee.ts +++ b/packages/stargate/src/fee.ts @@ -20,11 +20,11 @@ export class GasPrice { } public static fromString(gasPrice: string): GasPrice { - const matchResult = gasPrice.match(/^(?[0-9.]+?)(?[a-z]+)$/); + const matchResult = gasPrice.match(/^([0-9.]+?)([a-z]+)$/); if (!matchResult) { throw new Error("Invalid gas price string"); } - const { amount, denom } = matchResult.groups as { readonly amount: string; readonly denom: string }; + const [_, amount, denom] = matchResult; if (denom.length < 3 || denom.length > 127) { throw new Error("Gas price denomination must be between 3 and 127 characters"); }