@leapwallet/buffer-boba
Version:
Buffer Boba is a library for decoding protocol buffers in the cosmos ecosystem.
32 lines (31 loc) • 1.08 kB
TypeScript
import { GeneratedType } from '@cosmjs/proto-signing';
import { Writer, Reader } from 'protobufjs';
import { Any } from './proto/google/protobuf/any';
export type AnyWithUnpacked = Any | (Any & {
unpacked: unknown;
factory: ProtoFactory;
});
export declare class UnknownMessage implements Any {
protected readonly _typeUrl: string;
protected readonly _value: Uint8Array;
constructor(_typeUrl: string, _value: Uint8Array);
get typeUrl(): string;
get value(): Uint8Array;
toJSON(): {
type_url: string;
value: string;
};
}
export interface ProtoFactory {
encode: (message: any, writer?: Writer) => Writer;
decode: (r: Reader | Uint8Array, l?: number) => any;
fromJSON: (object: any) => any;
toJSON: (message: any) => any;
}
export declare class ProtoCodec {
protected codecRegistry: Record<string, ProtoFactory>;
unpackAny(any: Any): AnyWithUnpacked;
registerType(typeUrl: string, generatedType: GeneratedType): void;
listSupportedTypes(): string[];
}
export declare const defaultProtoCodec: ProtoCodec;