diff --git a/packages/proto-signing/src/msgs.ts b/packages/proto-signing/src/msgs.ts index b2774207..e9be32e7 100644 --- a/packages/proto-signing/src/msgs.ts +++ b/packages/proto-signing/src/msgs.ts @@ -6,7 +6,7 @@ import { Registry } from "./registry"; export const defaultRegistry = new Registry(); -@registered(defaultRegistry, "/cosmos.Coin") +@registered(defaultRegistry, "/cosmos.base.v1beta1.Coin") export class Coin extends Message { @cosmosField.string(1) public readonly denom?: string; @@ -15,13 +15,13 @@ export class Coin extends Message { public readonly amount?: string; } -@registered(defaultRegistry, "/cosmos.bank.MsgSend") +@registered(defaultRegistry, "/cosmos.bank.v1beta1.MsgSend") export class MsgSend extends Message { - @cosmosField.bytes(1) - public readonly from_address?: Uint8Array; + @cosmosField.string(1) + public readonly from_address?: string; - @cosmosField.bytes(2) - public readonly to_address?: Uint8Array; + @cosmosField.string(2) + public readonly to_address?: string; @cosmosField.repeatedMessage(3, Coin) public readonly amount?: readonly Coin[]; diff --git a/packages/proto-signing/src/registry.ts b/packages/proto-signing/src/registry.ts index d13a9ecb..0dbaab72 100644 --- a/packages/proto-signing/src/registry.ts +++ b/packages/proto-signing/src/registry.ts @@ -29,9 +29,9 @@ export interface TxBodyValue { } const defaultTypeUrls = { - cosmosCoin: "/cosmos.Coin", - cosmosMsgSend: "/cosmos.bank.MsgSend", - cosmosTxBody: "/cosmos.tx.TxBody", + cosmosCoin: "/cosmos.base.v1beta1.Coin", + cosmosMsgSend: "/cosmos.bank.v1beta1.MsgSend", + cosmosTxBody: "/cosmos.tx.v1beta1.TxBody", googleAny: "/google.protobuf.Any", }; @@ -41,8 +41,8 @@ export class Registry { public constructor(customTypes: Iterable<[string, GeneratedType]> = []) { const { cosmosCoin, cosmosMsgSend } = defaultTypeUrls; this.types = new Map([ - [cosmosCoin, cosmos.Coin], - [cosmosMsgSend, cosmos.bank.MsgSend], + [cosmosCoin, cosmos.base.v1beta1.Coin], + [cosmosMsgSend, cosmos.bank.v1beta1.MsgSend], ...customTypes, ]); } @@ -73,7 +73,7 @@ export class Registry { } public encodeTxBody(txBodyFields: TxBodyValue): Uint8Array { - const { TxBody } = cosmos.tx; + const { TxBody } = cosmos.tx.v1beta1; const { Any } = google.protobuf; const wrappedMessages = txBodyFields.messages.map((message) => { @@ -104,8 +104,8 @@ export class Registry { return decoded; } - public decodeTxBody(txBody: Uint8Array): cosmos.tx.TxBody { - const { TxBody } = cosmos.tx; + public decodeTxBody(txBody: Uint8Array): cosmos.tx.v1beta1.TxBody { + const { TxBody } = cosmos.tx.v1beta1; const decodedTxBody = TxBody.decode(txBody); return { diff --git a/packages/proto-signing/types/msgs.d.ts b/packages/proto-signing/types/msgs.d.ts index 6c9ed2c0..cd2fc811 100644 --- a/packages/proto-signing/types/msgs.d.ts +++ b/packages/proto-signing/types/msgs.d.ts @@ -6,7 +6,7 @@ export declare class Coin extends Message { readonly amount?: string; } export declare class MsgSend extends Message { - readonly from_address?: Uint8Array; - readonly to_address?: Uint8Array; + readonly from_address?: string; + readonly to_address?: string; readonly amount?: readonly Coin[]; } diff --git a/packages/proto-signing/types/registry.d.ts b/packages/proto-signing/types/registry.d.ts index 4016a1ad..deaebd2d 100644 --- a/packages/proto-signing/types/registry.d.ts +++ b/packages/proto-signing/types/registry.d.ts @@ -37,5 +37,5 @@ export declare class Registry { encode({ typeUrl, value }: EncodeObject): Uint8Array; encodeTxBody(txBodyFields: TxBodyValue): Uint8Array; decode({ typeUrl, value }: DecodeObject): any; - decodeTxBody(txBody: Uint8Array): cosmos.tx.TxBody; + decodeTxBody(txBody: Uint8Array): cosmos.tx.v1beta1.TxBody; }