diff --git a/CHANGELOG.md b/CHANGELOG.md index f50dc156ee..df8f1d8f58 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,8 +9,8 @@ and this project adheres to ### Added - @cosmjs/stargate: Add support for different account types in `accountFromAny` - and `StargateClient`. Added vesting accounts `BaseVestingAccount`, - `ContinuousVestingAccount`, `DelayedVestingAccount` and + and `StargateClient`. Added `ModuleAccount` and vesting accounts + `BaseVestingAccount`, `ContinuousVestingAccount`, `DelayedVestingAccount` and `PeriodicVestingAccount`. ### Changed diff --git a/packages/stargate/src/stargateclient.ts b/packages/stargate/src/stargateclient.ts index f4a1aef120..99d862639f 100644 --- a/packages/stargate/src/stargateclient.ts +++ b/packages/stargate/src/stargateclient.ts @@ -19,7 +19,7 @@ import { import { assert, assertDefinedAndNotNull } from "@cosmjs/utils"; import Long from "long"; -import { BaseAccount } from "./codec/cosmos/auth/v1beta1/auth"; +import { BaseAccount, ModuleAccount } from "./codec/cosmos/auth/v1beta1/auth"; import { MsgData, TxMsgData } from "./codec/cosmos/base/abci/v1beta1/abci"; import { Coin } from "./codec/cosmos/base/v1beta1/coin"; import { @@ -123,6 +123,11 @@ export function accountFromAny(input: Any): Account { case "/cosmos.auth.v1beta1.BaseAccount": return accountFromBaseAccount(BaseAccount.decode(value)); + case "/cosmos.auth.v1beta1.ModuleAccount": { + const baseAccount = ModuleAccount.decode(value).baseAccount; + assert(baseAccount); + return accountFromBaseAccount(baseAccount); + } // vesting