diff --git a/CHANGELOG.md b/CHANGELOG.md index df189d7e..155f29c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## `v0.0.60` + +### Features + +- Parse `EthermintAccount` in `toBaseAccount` util function + ## `v0.0.59` ### Fixes diff --git a/package.json b/package.json index 3c968475..15e2b0f2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cosmes", - "version": "0.0.59", + "version": "0.0.60", "private": false, "packageManager": "pnpm@8.3.0", "sideEffects": false, diff --git a/src/client/utils/toBaseAccount.ts b/src/client/utils/toBaseAccount.ts index ba9f7e2a..448cd631 100644 --- a/src/client/utils/toBaseAccount.ts +++ b/src/client/utils/toBaseAccount.ts @@ -4,6 +4,7 @@ import { CosmosVestingV1beta1BaseVestingAccount as BaseVestingAccount, CosmosVestingV1beta1ContinuousVestingAccount as ContinuousVestingAccount, CosmosVestingV1beta1DelayedVestingAccount as DelayedVesting, + EthermintTypesV1EthAccount as EthermintAccount, InjectiveTypesV1beta1EthAccount as InjectiveAccount, CosmosVestingV1beta1PeriodicVestingAccount as PeriodicVestingAccount, } from "cosmes/protobufs"; @@ -56,6 +57,13 @@ export function toBaseAccount({ typeUrl, value }: Any): BaseAccount { } return baseAccount; } + case EthermintAccount.typeName: { + const { baseAccount } = EthermintAccount.fromBinary(value); + if (!baseAccount) { + throw new Error(ERR_UNABLE_TO_RESOLVE_BASE_ACCOUNT); + } + return baseAccount; + } default: { throw new Error(`${ERR_UNKNOWN_ACCOUNT_TYPE}: ${typeUrl.slice(1)}`); }