diff --git a/CHANGELOG.md b/CHANGELOG.md index cad1842ddd..e4d5b6399d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,13 @@ and this project adheres to ## [Unreleased] +### Fixed + +- @cosmjs/stargate: Fix valid values of `BondStatusString` for `validators` + query ([#1170]). + +[#1170]: https://github.com/cosmos/cosmjs/issues/1170 + ### Changed - @cosmjs/stargate: Change `packetCommitment` parameter `sequence` type from diff --git a/packages/stargate/src/modules/staking/queries.ts b/packages/stargate/src/modules/staking/queries.ts index 94484cdddf..013828485f 100644 --- a/packages/stargate/src/modules/staking/queries.ts +++ b/packages/stargate/src/modules/staking/queries.ts @@ -21,7 +21,14 @@ import Long from "long"; import { createPagination, createProtobufRpcClient, QueryClient } from "../../queryclient"; -export type BondStatusString = Exclude; +// It's an enum in Go and a string in the protobuf API. "BOND_STATUS_UNSPECIFIED" +// is excluded and "" is supported instead 🤷. +// +// String values: https://github.com/cosmos/cosmos-sdk/blob/v0.45.5/x/staking/types/staking.pb.go#L57-L62 +// Validation: https://github.com/cosmos/cosmos-sdk/blob/v0.45.5/x/staking/keeper/grpc_query.go#L29-L32 +export type BondStatusString = + | keyof Pick + | ""; export interface StakingExtension { readonly staking: {