proto-signing: Make registry types interfaces

This commit is contained in:
willclarktech 2020-06-30 15:39:24 +02:00
parent 15fdb34d91
commit 8f933e171b
No known key found for this signature in database
GPG Key ID: 551A86E2E398ADF7
2 changed files with 12 additions and 12 deletions

View File

@ -9,23 +9,23 @@ export interface GeneratedType {
readonly decode: (reader: protobuf.Reader | Uint8Array, length?: number) => any;
}
export type EncodeObject = {
export interface EncodeObject {
readonly typeUrl: string;
readonly value: any;
};
}
export type DecodeObject = {
export interface DecodeObject {
readonly typeUrl: string;
readonly value: Uint8Array;
};
}
export type TxBodyValue = {
export interface TxBodyValue {
readonly messages: readonly EncodeObject[];
readonly memo?: string;
readonly timeoutHeight?: number;
readonly extensionOptions?: google.protobuf.IAny[];
readonly nonCriticalExtensionOptions?: google.protobuf.IAny[];
};
}
const defaultTypeUrls = {
cosmosCoin: "/cosmos.Coin",

View File

@ -12,21 +12,21 @@ export interface GeneratedType {
) => protobuf.Writer;
readonly decode: (reader: protobuf.Reader | Uint8Array, length?: number) => any;
}
export declare type EncodeObject = {
export interface EncodeObject {
readonly typeUrl: string;
readonly value: any;
};
export declare type DecodeObject = {
}
export interface DecodeObject {
readonly typeUrl: string;
readonly value: Uint8Array;
};
export declare type TxBodyValue = {
}
export interface TxBodyValue {
readonly messages: readonly EncodeObject[];
readonly memo?: string;
readonly timeoutHeight?: number;
readonly extensionOptions?: google.protobuf.IAny[];
readonly nonCriticalExtensionOptions?: google.protobuf.IAny[];
};
}
export declare class Registry {
private readonly types;
constructor(customTypes?: Iterable<[string, GeneratedType]>);