diff --git a/packages/proto-signing/src/registry.ts b/packages/proto-signing/src/registry.ts index 90dbf127..760db180 100644 --- a/packages/proto-signing/src/registry.ts +++ b/packages/proto-signing/src/registry.ts @@ -95,12 +95,13 @@ export class Registry { * change the `customTypes` argument to override the default types if set. * See https://github.com/cosmos/cosmjs/issues/994 */ - public constructor(customTypes: Iterable<[string, GeneratedType]> = []) { + public constructor(customTypes?: Iterable<[string, GeneratedType]>) { const { cosmosCoin, cosmosMsgSend } = defaultTypeUrls; - this.types = new Map([ + this.types = customTypes ? new Map([ + ...customTypes + ]) : new Map([ [cosmosCoin, Coin], [cosmosMsgSend, MsgSend], - ...customTypes, ]); } diff --git a/packages/stargate/src/signingstargateclient.ts b/packages/stargate/src/signingstargateclient.ts index 0d34e1c7..5b00c2cf 100644 --- a/packages/stargate/src/signingstargateclient.ts +++ b/packages/stargate/src/signingstargateclient.ts @@ -72,6 +72,7 @@ import { calculateFee, GasPrice } from "./fee"; import { DeliverTxResponse, StargateClient } from "./stargateclient"; export const defaultRegistryTypes: ReadonlyArray<[string, GeneratedType]> = [ + ["/cosmos.base.v1beta1.Coin", Coin], ["/cosmos.bank.v1beta1.MsgMultiSend", MsgMultiSend], ["/cosmos.distribution.v1beta1.MsgFundCommunityPool", MsgFundCommunityPool], ["/cosmos.distribution.v1beta1.MsgSetWithdrawAddress", MsgSetWithdrawAddress],