mirror of
https://github.com/cosmos/cosmjs.git
synced 2025-03-10 21:49:15 +00:00
Add support for ModuleAccount
This commit is contained in:
parent
429cd848b5
commit
f2191ee211
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user