diff --git a/packages/proto-signing/src/codec/cosmos/bank/v1beta1/bank.ts b/packages/proto-signing/src/codec/cosmos/bank/v1beta1/bank.ts new file mode 100644 index 00000000..afff626e --- /dev/null +++ b/packages/proto-signing/src/codec/cosmos/bank/v1beta1/bank.ts @@ -0,0 +1,650 @@ +/* eslint-disable */ +import { Coin } from "../../../cosmos/base/v1beta1/coin"; +import { Writer, Reader } from "protobufjs/minimal"; + +/** + * Params defines the parameters for the bank module. + */ +export interface Params { + sendEnabled: SendEnabled[]; + defaultSendEnabled: boolean; +} + +/** + * SendEnabled maps coin denom to a send_enabled status (whether a denom is + * sendable). + */ +export interface SendEnabled { + denom: string; + enabled: boolean; +} + +/** + * Input models transaction input. + */ +export interface Input { + address: string; + coins: Coin[]; +} + +/** + * Output models transaction outputs. + */ +export interface Output { + address: string; + coins: Coin[]; +} + +/** + * Supply represents a struct that passively keeps track of the total supply + * amounts in the network. + */ +export interface Supply { + total: Coin[]; +} + +/** + * DenomUnit represents a struct that describes a given + * denomination unit of the basic token. + */ +export interface DenomUnit { + /** + * denom represents the string name of the given denom unit (e.g uatom). + */ + denom: string; + /** + * exponent represents power of 10 exponent that one must + * raise the base_denom to in order to equal the given DenomUnit's denom + * 1 denom = 1^exponent base_denom + * (e.g. with a base_denom of uatom, one can create a DenomUnit of 'atom' with + * exponent = 6, thus: 1 atom = 10^6 uatom). + */ + exponent: number; + /** + * aliases is a list of string aliases for the given denom + */ + aliases: string[]; +} + +/** + * Metadata represents a struct that describes + * a basic token. + */ +export interface Metadata { + description: string; + /** + * denom_units represents the list of DenomUnit's for a given coin + */ + denomUnits: DenomUnit[]; + /** + * base represents the base denom (should be the DenomUnit with exponent = 0). + */ + base: string; + /** + * display indicates the suggested denom that should be + * displayed in clients. + */ + display: string; +} + +const baseParams: object = { + defaultSendEnabled: false, +}; + +const baseSendEnabled: object = { + denom: "", + enabled: false, +}; + +const baseInput: object = { + address: "", +}; + +const baseOutput: object = { + address: "", +}; + +const baseSupply: object = {}; + +const baseDenomUnit: object = { + denom: "", + exponent: 0, + aliases: "", +}; + +const baseMetadata: object = { + description: "", + base: "", + display: "", +}; + +export const protobufPackage = "cosmos.bank.v1beta1"; + +export const Params = { + encode(message: Params, writer: Writer = Writer.create()): Writer { + for (const v of message.sendEnabled) { + SendEnabled.encode(v!, writer.uint32(10).fork()).ldelim(); + } + writer.uint32(16).bool(message.defaultSendEnabled); + return writer; + }, + decode(input: Uint8Array | Reader, length?: number): Params { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseParams } as Params; + message.sendEnabled = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sendEnabled.push(SendEnabled.decode(reader, reader.uint32())); + break; + case 2: + message.defaultSendEnabled = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Params { + const message = { ...baseParams } as Params; + message.sendEnabled = []; + if (object.sendEnabled !== undefined && object.sendEnabled !== null) { + for (const e of object.sendEnabled) { + message.sendEnabled.push(SendEnabled.fromJSON(e)); + } + } + if (object.defaultSendEnabled !== undefined && object.defaultSendEnabled !== null) { + message.defaultSendEnabled = Boolean(object.defaultSendEnabled); + } else { + message.defaultSendEnabled = false; + } + return message; + }, + fromPartial(object: DeepPartial): Params { + const message = { ...baseParams } as Params; + message.sendEnabled = []; + if (object.sendEnabled !== undefined && object.sendEnabled !== null) { + for (const e of object.sendEnabled) { + message.sendEnabled.push(SendEnabled.fromPartial(e)); + } + } + if (object.defaultSendEnabled !== undefined && object.defaultSendEnabled !== null) { + message.defaultSendEnabled = object.defaultSendEnabled; + } else { + message.defaultSendEnabled = false; + } + return message; + }, + toJSON(message: Params): unknown { + const obj: any = {}; + if (message.sendEnabled) { + obj.sendEnabled = message.sendEnabled.map((e) => (e ? SendEnabled.toJSON(e) : undefined)); + } else { + obj.sendEnabled = []; + } + message.defaultSendEnabled !== undefined && (obj.defaultSendEnabled = message.defaultSendEnabled); + return obj; + }, +}; + +export const SendEnabled = { + encode(message: SendEnabled, writer: Writer = Writer.create()): Writer { + writer.uint32(10).string(message.denom); + writer.uint32(16).bool(message.enabled); + return writer; + }, + decode(input: Uint8Array | Reader, length?: number): SendEnabled { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseSendEnabled } as SendEnabled; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.enabled = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): SendEnabled { + const message = { ...baseSendEnabled } as SendEnabled; + if (object.denom !== undefined && object.denom !== null) { + message.denom = String(object.denom); + } else { + message.denom = ""; + } + if (object.enabled !== undefined && object.enabled !== null) { + message.enabled = Boolean(object.enabled); + } else { + message.enabled = false; + } + return message; + }, + fromPartial(object: DeepPartial): SendEnabled { + const message = { ...baseSendEnabled } as SendEnabled; + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } else { + message.denom = ""; + } + if (object.enabled !== undefined && object.enabled !== null) { + message.enabled = object.enabled; + } else { + message.enabled = false; + } + return message; + }, + toJSON(message: SendEnabled): unknown { + const obj: any = {}; + message.denom !== undefined && (obj.denom = message.denom); + message.enabled !== undefined && (obj.enabled = message.enabled); + return obj; + }, +}; + +export const Input = { + encode(message: Input, writer: Writer = Writer.create()): Writer { + writer.uint32(10).string(message.address); + for (const v of message.coins) { + Coin.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, length?: number): Input { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseInput } as Input; + message.coins = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.coins.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Input { + const message = { ...baseInput } as Input; + message.coins = []; + if (object.address !== undefined && object.address !== null) { + message.address = String(object.address); + } else { + message.address = ""; + } + if (object.coins !== undefined && object.coins !== null) { + for (const e of object.coins) { + message.coins.push(Coin.fromJSON(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): Input { + const message = { ...baseInput } as Input; + message.coins = []; + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } else { + message.address = ""; + } + if (object.coins !== undefined && object.coins !== null) { + for (const e of object.coins) { + message.coins.push(Coin.fromPartial(e)); + } + } + return message; + }, + toJSON(message: Input): unknown { + const obj: any = {}; + message.address !== undefined && (obj.address = message.address); + if (message.coins) { + obj.coins = message.coins.map((e) => (e ? Coin.toJSON(e) : undefined)); + } else { + obj.coins = []; + } + return obj; + }, +}; + +export const Output = { + encode(message: Output, writer: Writer = Writer.create()): Writer { + writer.uint32(10).string(message.address); + for (const v of message.coins) { + Coin.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, length?: number): Output { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseOutput } as Output; + message.coins = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.coins.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Output { + const message = { ...baseOutput } as Output; + message.coins = []; + if (object.address !== undefined && object.address !== null) { + message.address = String(object.address); + } else { + message.address = ""; + } + if (object.coins !== undefined && object.coins !== null) { + for (const e of object.coins) { + message.coins.push(Coin.fromJSON(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): Output { + const message = { ...baseOutput } as Output; + message.coins = []; + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } else { + message.address = ""; + } + if (object.coins !== undefined && object.coins !== null) { + for (const e of object.coins) { + message.coins.push(Coin.fromPartial(e)); + } + } + return message; + }, + toJSON(message: Output): unknown { + const obj: any = {}; + message.address !== undefined && (obj.address = message.address); + if (message.coins) { + obj.coins = message.coins.map((e) => (e ? Coin.toJSON(e) : undefined)); + } else { + obj.coins = []; + } + return obj; + }, +}; + +export const Supply = { + encode(message: Supply, writer: Writer = Writer.create()): Writer { + for (const v of message.total) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, length?: number): Supply { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseSupply } as Supply; + message.total = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.total.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Supply { + const message = { ...baseSupply } as Supply; + message.total = []; + if (object.total !== undefined && object.total !== null) { + for (const e of object.total) { + message.total.push(Coin.fromJSON(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): Supply { + const message = { ...baseSupply } as Supply; + message.total = []; + if (object.total !== undefined && object.total !== null) { + for (const e of object.total) { + message.total.push(Coin.fromPartial(e)); + } + } + return message; + }, + toJSON(message: Supply): unknown { + const obj: any = {}; + if (message.total) { + obj.total = message.total.map((e) => (e ? Coin.toJSON(e) : undefined)); + } else { + obj.total = []; + } + return obj; + }, +}; + +export const DenomUnit = { + encode(message: DenomUnit, writer: Writer = Writer.create()): Writer { + writer.uint32(10).string(message.denom); + writer.uint32(16).uint32(message.exponent); + for (const v of message.aliases) { + writer.uint32(26).string(v!); + } + return writer; + }, + decode(input: Uint8Array | Reader, length?: number): DenomUnit { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDenomUnit } as DenomUnit; + message.aliases = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.exponent = reader.uint32(); + break; + case 3: + message.aliases.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): DenomUnit { + const message = { ...baseDenomUnit } as DenomUnit; + message.aliases = []; + if (object.denom !== undefined && object.denom !== null) { + message.denom = String(object.denom); + } else { + message.denom = ""; + } + if (object.exponent !== undefined && object.exponent !== null) { + message.exponent = Number(object.exponent); + } else { + message.exponent = 0; + } + if (object.aliases !== undefined && object.aliases !== null) { + for (const e of object.aliases) { + message.aliases.push(String(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): DenomUnit { + const message = { ...baseDenomUnit } as DenomUnit; + message.aliases = []; + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } else { + message.denom = ""; + } + if (object.exponent !== undefined && object.exponent !== null) { + message.exponent = object.exponent; + } else { + message.exponent = 0; + } + if (object.aliases !== undefined && object.aliases !== null) { + for (const e of object.aliases) { + message.aliases.push(e); + } + } + return message; + }, + toJSON(message: DenomUnit): unknown { + const obj: any = {}; + message.denom !== undefined && (obj.denom = message.denom); + message.exponent !== undefined && (obj.exponent = message.exponent); + if (message.aliases) { + obj.aliases = message.aliases.map((e) => e); + } else { + obj.aliases = []; + } + return obj; + }, +}; + +export const Metadata = { + encode(message: Metadata, writer: Writer = Writer.create()): Writer { + writer.uint32(10).string(message.description); + for (const v of message.denomUnits) { + DenomUnit.encode(v!, writer.uint32(18).fork()).ldelim(); + } + writer.uint32(26).string(message.base); + writer.uint32(34).string(message.display); + return writer; + }, + decode(input: Uint8Array | Reader, length?: number): Metadata { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMetadata } as Metadata; + message.denomUnits = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.description = reader.string(); + break; + case 2: + message.denomUnits.push(DenomUnit.decode(reader, reader.uint32())); + break; + case 3: + message.base = reader.string(); + break; + case 4: + message.display = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Metadata { + const message = { ...baseMetadata } as Metadata; + message.denomUnits = []; + if (object.description !== undefined && object.description !== null) { + message.description = String(object.description); + } else { + message.description = ""; + } + if (object.denomUnits !== undefined && object.denomUnits !== null) { + for (const e of object.denomUnits) { + message.denomUnits.push(DenomUnit.fromJSON(e)); + } + } + if (object.base !== undefined && object.base !== null) { + message.base = String(object.base); + } else { + message.base = ""; + } + if (object.display !== undefined && object.display !== null) { + message.display = String(object.display); + } else { + message.display = ""; + } + return message; + }, + fromPartial(object: DeepPartial): Metadata { + const message = { ...baseMetadata } as Metadata; + message.denomUnits = []; + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } else { + message.description = ""; + } + if (object.denomUnits !== undefined && object.denomUnits !== null) { + for (const e of object.denomUnits) { + message.denomUnits.push(DenomUnit.fromPartial(e)); + } + } + if (object.base !== undefined && object.base !== null) { + message.base = object.base; + } else { + message.base = ""; + } + if (object.display !== undefined && object.display !== null) { + message.display = object.display; + } else { + message.display = ""; + } + return message; + }, + toJSON(message: Metadata): unknown { + const obj: any = {}; + message.description !== undefined && (obj.description = message.description); + if (message.denomUnits) { + obj.denomUnits = message.denomUnits.map((e) => (e ? DenomUnit.toJSON(e) : undefined)); + } else { + obj.denomUnits = []; + } + message.base !== undefined && (obj.base = message.base); + message.display !== undefined && (obj.display = message.display); + return obj; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/packages/proto-signing/src/codec/cosmos/bank/v1beta1/tx.ts b/packages/proto-signing/src/codec/cosmos/bank/v1beta1/tx.ts new file mode 100644 index 00000000..6a967bfb --- /dev/null +++ b/packages/proto-signing/src/codec/cosmos/bank/v1beta1/tx.ts @@ -0,0 +1,324 @@ +/* eslint-disable */ +import { Coin } from "../../../cosmos/base/v1beta1/coin"; +import { Input, Output } from "../../../cosmos/bank/v1beta1/bank"; +import { Reader, Writer } from "protobufjs/minimal"; + +/** + * MsgSend represents a message to send coins from one account to another. + */ +export interface MsgSend { + fromAddress: string; + toAddress: string; + amount: Coin[]; +} + +/** + * MsgSendResponse defines the Msg/Send response type. + */ +export interface MsgSendResponse {} + +/** + * MsgMultiSend represents an arbitrary multi-in, multi-out send message. + */ +export interface MsgMultiSend { + inputs: Input[]; + outputs: Output[]; +} + +/** + * MsgMultiSendResponse defines the Msg/MultiSend response type. + */ +export interface MsgMultiSendResponse {} + +const baseMsgSend: object = { + fromAddress: "", + toAddress: "", +}; + +const baseMsgSendResponse: object = {}; + +const baseMsgMultiSend: object = {}; + +const baseMsgMultiSendResponse: object = {}; + +/** + * Msg defines the bank Msg service. + */ +export interface Msg { + /** + * Send defines a method for sending coins from one account to another account. + */ + Send(request: MsgSend): Promise; + + /** + * MultiSend defines a method for sending coins from some accounts to other accounts. + */ + MultiSend(request: MsgMultiSend): Promise; +} + +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + + constructor(rpc: Rpc) { + this.rpc = rpc; + } + + Send(request: MsgSend): Promise { + const data = MsgSend.encode(request).finish(); + const promise = this.rpc.request("cosmos.bank.v1beta1.Msg", "Send", data); + return promise.then((data) => MsgSendResponse.decode(new Reader(data))); + } + + MultiSend(request: MsgMultiSend): Promise { + const data = MsgMultiSend.encode(request).finish(); + const promise = this.rpc.request("cosmos.bank.v1beta1.Msg", "MultiSend", data); + return promise.then((data) => MsgMultiSendResponse.decode(new Reader(data))); + } +} + +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; +} + +export const protobufPackage = "cosmos.bank.v1beta1"; + +export const MsgSend = { + encode(message: MsgSend, writer: Writer = Writer.create()): Writer { + writer.uint32(10).string(message.fromAddress); + writer.uint32(18).string(message.toAddress); + for (const v of message.amount) { + Coin.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, length?: number): MsgSend { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgSend } as MsgSend; + message.amount = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fromAddress = reader.string(); + break; + case 2: + message.toAddress = reader.string(); + break; + case 3: + message.amount.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgSend { + const message = { ...baseMsgSend } as MsgSend; + message.amount = []; + if (object.fromAddress !== undefined && object.fromAddress !== null) { + message.fromAddress = String(object.fromAddress); + } else { + message.fromAddress = ""; + } + if (object.toAddress !== undefined && object.toAddress !== null) { + message.toAddress = String(object.toAddress); + } else { + message.toAddress = ""; + } + if (object.amount !== undefined && object.amount !== null) { + for (const e of object.amount) { + message.amount.push(Coin.fromJSON(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgSend { + const message = { ...baseMsgSend } as MsgSend; + message.amount = []; + if (object.fromAddress !== undefined && object.fromAddress !== null) { + message.fromAddress = object.fromAddress; + } else { + message.fromAddress = ""; + } + if (object.toAddress !== undefined && object.toAddress !== null) { + message.toAddress = object.toAddress; + } else { + message.toAddress = ""; + } + if (object.amount !== undefined && object.amount !== null) { + for (const e of object.amount) { + message.amount.push(Coin.fromPartial(e)); + } + } + return message; + }, + toJSON(message: MsgSend): unknown { + const obj: any = {}; + message.fromAddress !== undefined && (obj.fromAddress = message.fromAddress); + message.toAddress !== undefined && (obj.toAddress = message.toAddress); + if (message.amount) { + obj.amount = message.amount.map((e) => (e ? Coin.toJSON(e) : undefined)); + } else { + obj.amount = []; + } + return obj; + }, +}; + +export const MsgSendResponse = { + encode(_: MsgSendResponse, writer: Writer = Writer.create()): Writer { + return writer; + }, + decode(input: Uint8Array | Reader, length?: number): MsgSendResponse { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgSendResponse } as MsgSendResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(_: any): MsgSendResponse { + const message = { ...baseMsgSendResponse } as MsgSendResponse; + return message; + }, + fromPartial(_: DeepPartial): MsgSendResponse { + const message = { ...baseMsgSendResponse } as MsgSendResponse; + return message; + }, + toJSON(_: MsgSendResponse): unknown { + const obj: any = {}; + return obj; + }, +}; + +export const MsgMultiSend = { + encode(message: MsgMultiSend, writer: Writer = Writer.create()): Writer { + for (const v of message.inputs) { + Input.encode(v!, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.outputs) { + Output.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, length?: number): MsgMultiSend { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgMultiSend } as MsgMultiSend; + message.inputs = []; + message.outputs = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.inputs.push(Input.decode(reader, reader.uint32())); + break; + case 2: + message.outputs.push(Output.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgMultiSend { + const message = { ...baseMsgMultiSend } as MsgMultiSend; + message.inputs = []; + message.outputs = []; + if (object.inputs !== undefined && object.inputs !== null) { + for (const e of object.inputs) { + message.inputs.push(Input.fromJSON(e)); + } + } + if (object.outputs !== undefined && object.outputs !== null) { + for (const e of object.outputs) { + message.outputs.push(Output.fromJSON(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgMultiSend { + const message = { ...baseMsgMultiSend } as MsgMultiSend; + message.inputs = []; + message.outputs = []; + if (object.inputs !== undefined && object.inputs !== null) { + for (const e of object.inputs) { + message.inputs.push(Input.fromPartial(e)); + } + } + if (object.outputs !== undefined && object.outputs !== null) { + for (const e of object.outputs) { + message.outputs.push(Output.fromPartial(e)); + } + } + return message; + }, + toJSON(message: MsgMultiSend): unknown { + const obj: any = {}; + if (message.inputs) { + obj.inputs = message.inputs.map((e) => (e ? Input.toJSON(e) : undefined)); + } else { + obj.inputs = []; + } + if (message.outputs) { + obj.outputs = message.outputs.map((e) => (e ? Output.toJSON(e) : undefined)); + } else { + obj.outputs = []; + } + return obj; + }, +}; + +export const MsgMultiSendResponse = { + encode(_: MsgMultiSendResponse, writer: Writer = Writer.create()): Writer { + return writer; + }, + decode(input: Uint8Array | Reader, length?: number): MsgMultiSendResponse { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgMultiSendResponse } as MsgMultiSendResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(_: any): MsgMultiSendResponse { + const message = { ...baseMsgMultiSendResponse } as MsgMultiSendResponse; + return message; + }, + fromPartial(_: DeepPartial): MsgMultiSendResponse { + const message = { ...baseMsgMultiSendResponse } as MsgMultiSendResponse; + return message; + }, + toJSON(_: MsgMultiSendResponse): unknown { + const obj: any = {}; + return obj; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/packages/proto-signing/src/codec/cosmos/base/v1beta1/coin.ts b/packages/proto-signing/src/codec/cosmos/base/v1beta1/coin.ts new file mode 100644 index 00000000..34f4bad5 --- /dev/null +++ b/packages/proto-signing/src/codec/cosmos/base/v1beta1/coin.ts @@ -0,0 +1,287 @@ +/* eslint-disable */ +import { Writer, Reader } from "protobufjs/minimal"; + +/** + * Coin defines a token with a denomination and an amount. + * + * NOTE: The amount field is an Int which implements the custom method + * signatures required by gogoproto. + */ +export interface Coin { + denom: string; + amount: string; +} + +/** + * DecCoin defines a token with a denomination and a decimal amount. + * + * NOTE: The amount field is an Dec which implements the custom method + * signatures required by gogoproto. + */ +export interface DecCoin { + denom: string; + amount: string; +} + +/** + * IntProto defines a Protobuf wrapper around an Int object. + */ +export interface IntProto { + int: string; +} + +/** + * DecProto defines a Protobuf wrapper around a Dec object. + */ +export interface DecProto { + dec: string; +} + +const baseCoin: object = { + denom: "", + amount: "", +}; + +const baseDecCoin: object = { + denom: "", + amount: "", +}; + +const baseIntProto: object = { + int: "", +}; + +const baseDecProto: object = { + dec: "", +}; + +export const protobufPackage = "cosmos.base.v1beta1"; + +export const Coin = { + encode(message: Coin, writer: Writer = Writer.create()): Writer { + writer.uint32(10).string(message.denom); + writer.uint32(18).string(message.amount); + return writer; + }, + decode(input: Uint8Array | Reader, length?: number): Coin { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCoin } as Coin; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.amount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Coin { + const message = { ...baseCoin } as Coin; + if (object.denom !== undefined && object.denom !== null) { + message.denom = String(object.denom); + } else { + message.denom = ""; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = String(object.amount); + } else { + message.amount = ""; + } + return message; + }, + fromPartial(object: DeepPartial): Coin { + const message = { ...baseCoin } as Coin; + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } else { + message.denom = ""; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } else { + message.amount = ""; + } + return message; + }, + toJSON(message: Coin): unknown { + const obj: any = {}; + message.denom !== undefined && (obj.denom = message.denom); + message.amount !== undefined && (obj.amount = message.amount); + return obj; + }, +}; + +export const DecCoin = { + encode(message: DecCoin, writer: Writer = Writer.create()): Writer { + writer.uint32(10).string(message.denom); + writer.uint32(18).string(message.amount); + return writer; + }, + decode(input: Uint8Array | Reader, length?: number): DecCoin { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDecCoin } as DecCoin; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.amount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): DecCoin { + const message = { ...baseDecCoin } as DecCoin; + if (object.denom !== undefined && object.denom !== null) { + message.denom = String(object.denom); + } else { + message.denom = ""; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = String(object.amount); + } else { + message.amount = ""; + } + return message; + }, + fromPartial(object: DeepPartial): DecCoin { + const message = { ...baseDecCoin } as DecCoin; + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } else { + message.denom = ""; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } else { + message.amount = ""; + } + return message; + }, + toJSON(message: DecCoin): unknown { + const obj: any = {}; + message.denom !== undefined && (obj.denom = message.denom); + message.amount !== undefined && (obj.amount = message.amount); + return obj; + }, +}; + +export const IntProto = { + encode(message: IntProto, writer: Writer = Writer.create()): Writer { + writer.uint32(10).string(message.int); + return writer; + }, + decode(input: Uint8Array | Reader, length?: number): IntProto { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseIntProto } as IntProto; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.int = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): IntProto { + const message = { ...baseIntProto } as IntProto; + if (object.int !== undefined && object.int !== null) { + message.int = String(object.int); + } else { + message.int = ""; + } + return message; + }, + fromPartial(object: DeepPartial): IntProto { + const message = { ...baseIntProto } as IntProto; + if (object.int !== undefined && object.int !== null) { + message.int = object.int; + } else { + message.int = ""; + } + return message; + }, + toJSON(message: IntProto): unknown { + const obj: any = {}; + message.int !== undefined && (obj.int = message.int); + return obj; + }, +}; + +export const DecProto = { + encode(message: DecProto, writer: Writer = Writer.create()): Writer { + writer.uint32(10).string(message.dec); + return writer; + }, + decode(input: Uint8Array | Reader, length?: number): DecProto { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDecProto } as DecProto; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.dec = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): DecProto { + const message = { ...baseDecProto } as DecProto; + if (object.dec !== undefined && object.dec !== null) { + message.dec = String(object.dec); + } else { + message.dec = ""; + } + return message; + }, + fromPartial(object: DeepPartial): DecProto { + const message = { ...baseDecProto } as DecProto; + if (object.dec !== undefined && object.dec !== null) { + message.dec = object.dec; + } else { + message.dec = ""; + } + return message; + }, + toJSON(message: DecProto): unknown { + const obj: any = {}; + message.dec !== undefined && (obj.dec = message.dec); + return obj; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/packages/proto-signing/src/codec/cosmos/crypto/multisig/v1beta1/multisig.ts b/packages/proto-signing/src/codec/cosmos/crypto/multisig/v1beta1/multisig.ts new file mode 100644 index 00000000..6caa5ba6 --- /dev/null +++ b/packages/proto-signing/src/codec/cosmos/crypto/multisig/v1beta1/multisig.ts @@ -0,0 +1,183 @@ +/* eslint-disable */ +import { Writer, Reader } from "protobufjs/minimal"; + +/** + * MultiSignature wraps the signatures from a multisig.LegacyAminoPubKey. + * See cosmos.tx.v1betata1.ModeInfo.Multi for how to specify which signers + * signed and with which modes. + */ +export interface MultiSignature { + signatures: Uint8Array[]; +} + +/** + * CompactBitArray is an implementation of a space efficient bit array. + * This is used to ensure that the encoded data takes up a minimal amount of + * space after proto encoding. + * This is not thread safe, and is not intended for concurrent usage. + */ +export interface CompactBitArray { + extraBitsStored: number; + elems: Uint8Array; +} + +const baseMultiSignature: object = {}; + +const baseCompactBitArray: object = { + extraBitsStored: 0, +}; + +export const protobufPackage = "cosmos.crypto.multisig.v1beta1"; + +export const MultiSignature = { + encode(message: MultiSignature, writer: Writer = Writer.create()): Writer { + for (const v of message.signatures) { + writer.uint32(10).bytes(v!); + } + return writer; + }, + decode(input: Uint8Array | Reader, length?: number): MultiSignature { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMultiSignature } as MultiSignature; + message.signatures = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signatures.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MultiSignature { + const message = { ...baseMultiSignature } as MultiSignature; + message.signatures = []; + if (object.signatures !== undefined && object.signatures !== null) { + for (const e of object.signatures) { + message.signatures.push(bytesFromBase64(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): MultiSignature { + const message = { ...baseMultiSignature } as MultiSignature; + message.signatures = []; + if (object.signatures !== undefined && object.signatures !== null) { + for (const e of object.signatures) { + message.signatures.push(e); + } + } + return message; + }, + toJSON(message: MultiSignature): unknown { + const obj: any = {}; + if (message.signatures) { + obj.signatures = message.signatures.map((e) => base64FromBytes(e !== undefined ? e : new Uint8Array())); + } else { + obj.signatures = []; + } + return obj; + }, +}; + +export const CompactBitArray = { + encode(message: CompactBitArray, writer: Writer = Writer.create()): Writer { + writer.uint32(8).uint32(message.extraBitsStored); + writer.uint32(18).bytes(message.elems); + return writer; + }, + decode(input: Uint8Array | Reader, length?: number): CompactBitArray { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCompactBitArray } as CompactBitArray; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.extraBitsStored = reader.uint32(); + break; + case 2: + message.elems = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): CompactBitArray { + const message = { ...baseCompactBitArray } as CompactBitArray; + if (object.extraBitsStored !== undefined && object.extraBitsStored !== null) { + message.extraBitsStored = Number(object.extraBitsStored); + } else { + message.extraBitsStored = 0; + } + if (object.elems !== undefined && object.elems !== null) { + message.elems = bytesFromBase64(object.elems); + } + return message; + }, + fromPartial(object: DeepPartial): CompactBitArray { + const message = { ...baseCompactBitArray } as CompactBitArray; + if (object.extraBitsStored !== undefined && object.extraBitsStored !== null) { + message.extraBitsStored = object.extraBitsStored; + } else { + message.extraBitsStored = 0; + } + if (object.elems !== undefined && object.elems !== null) { + message.elems = object.elems; + } else { + message.elems = new Uint8Array(); + } + return message; + }, + toJSON(message: CompactBitArray): unknown { + const obj: any = {}; + message.extraBitsStored !== undefined && (obj.extraBitsStored = message.extraBitsStored); + message.elems !== undefined && + (obj.elems = base64FromBytes(message.elems !== undefined ? message.elems : new Uint8Array())); + return obj; + }, +}; + +interface WindowBase64 { + atob(b64: string): string; + btoa(bin: string): string; +} + +const windowBase64 = (globalThis as unknown) as WindowBase64; +const atob = windowBase64.atob || ((b64: string) => Buffer.from(b64, "base64").toString("binary")); +const btoa = windowBase64.btoa || ((bin: string) => Buffer.from(bin, "binary").toString("base64")); + +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/packages/proto-signing/src/codec/cosmos/crypto/secp256k1/keys.ts b/packages/proto-signing/src/codec/cosmos/crypto/secp256k1/keys.ts new file mode 100644 index 00000000..eb131770 --- /dev/null +++ b/packages/proto-signing/src/codec/cosmos/crypto/secp256k1/keys.ts @@ -0,0 +1,154 @@ +/* eslint-disable */ +import { Writer, Reader } from "protobufjs/minimal"; + +/** + * PubKey defines a secp256k1 public key + * Key is the compressed form of the pubkey. The first byte depends is a 0x02 byte + * if the y-coordinate is the lexicographically largest of the two associated with + * the x-coordinate. Otherwise the first byte is a 0x03. + * This prefix is followed with the x-coordinate. + */ +export interface PubKey { + key: Uint8Array; +} + +/** + * PrivKey defines a secp256k1 private key. + */ +export interface PrivKey { + key: Uint8Array; +} + +const basePubKey: object = {}; + +const basePrivKey: object = {}; + +export const protobufPackage = "cosmos.crypto.secp256k1"; + +export const PubKey = { + encode(message: PubKey, writer: Writer = Writer.create()): Writer { + writer.uint32(10).bytes(message.key); + return writer; + }, + decode(input: Uint8Array | Reader, length?: number): PubKey { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...basePubKey } as PubKey; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): PubKey { + const message = { ...basePubKey } as PubKey; + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + return message; + }, + fromPartial(object: DeepPartial): PubKey { + const message = { ...basePubKey } as PubKey; + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } else { + message.key = new Uint8Array(); + } + return message; + }, + toJSON(message: PubKey): unknown { + const obj: any = {}; + message.key !== undefined && + (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); + return obj; + }, +}; + +export const PrivKey = { + encode(message: PrivKey, writer: Writer = Writer.create()): Writer { + writer.uint32(10).bytes(message.key); + return writer; + }, + decode(input: Uint8Array | Reader, length?: number): PrivKey { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...basePrivKey } as PrivKey; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): PrivKey { + const message = { ...basePrivKey } as PrivKey; + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + return message; + }, + fromPartial(object: DeepPartial): PrivKey { + const message = { ...basePrivKey } as PrivKey; + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } else { + message.key = new Uint8Array(); + } + return message; + }, + toJSON(message: PrivKey): unknown { + const obj: any = {}; + message.key !== undefined && + (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); + return obj; + }, +}; + +interface WindowBase64 { + atob(b64: string): string; + btoa(bin: string): string; +} + +const windowBase64 = (globalThis as unknown) as WindowBase64; +const atob = windowBase64.atob || ((b64: string) => Buffer.from(b64, "base64").toString("binary")); +const btoa = windowBase64.btoa || ((bin: string) => Buffer.from(bin, "binary").toString("base64")); + +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/packages/proto-signing/src/codec/cosmos/tx/signing/v1beta1/signing.ts b/packages/proto-signing/src/codec/cosmos/tx/signing/v1beta1/signing.ts new file mode 100644 index 00000000..c1c3552c --- /dev/null +++ b/packages/proto-signing/src/codec/cosmos/tx/signing/v1beta1/signing.ts @@ -0,0 +1,532 @@ +/* eslint-disable */ +import { Any } from "../../../../google/protobuf/any"; +import * as Long from "long"; +import { CompactBitArray } from "../../../../cosmos/crypto/multisig/v1beta1/multisig"; +import { Writer, Reader } from "protobufjs/minimal"; + +/** + * SignatureDescriptors wraps multiple SignatureDescriptor's. + */ +export interface SignatureDescriptors { + /** + * signatures are the signature descriptors + */ + signatures: SignatureDescriptor[]; +} + +/** + * SignatureDescriptor is a convenience type which represents the full data for + * a signature including the public key of the signer, signing modes and the + * signature itself. It is primarily used for coordinating signatures between + * clients. + */ +export interface SignatureDescriptor { + /** + * public_key is the public key of the signer + */ + publicKey?: Any; + data?: SignatureDescriptor_Data; + /** + * sequence is the sequence of the account, which describes the + * number of committed transactions signed by a given address. It is used to prevent + * replay attacks. + */ + sequence: Long; +} + +/** + * Data represents signature data + */ +export interface SignatureDescriptor_Data { + /** + * single represents a single signer + */ + single?: SignatureDescriptor_Data_Single | undefined; + /** + * multi represents a multisig signer + */ + multi?: SignatureDescriptor_Data_Multi | undefined; +} + +/** + * Single is the signature data for a single signer + */ +export interface SignatureDescriptor_Data_Single { + /** + * mode is the signing mode of the single signer + */ + mode: SignMode; + /** + * signature is the raw signature bytes + */ + signature: Uint8Array; +} + +/** + * Multi is the signature data for a multisig public key + */ +export interface SignatureDescriptor_Data_Multi { + /** + * bitarray specifies which keys within the multisig are signing + */ + bitarray?: CompactBitArray; + /** + * signatures is the signatures of the multi-signature + */ + signatures: SignatureDescriptor_Data[]; +} + +const baseSignatureDescriptors: object = {}; + +const baseSignatureDescriptor: object = { + sequence: Long.UZERO, +}; + +const baseSignatureDescriptor_Data: object = {}; + +const baseSignatureDescriptor_Data_Single: object = { + mode: 0, +}; + +const baseSignatureDescriptor_Data_Multi: object = {}; + +export const protobufPackage = "cosmos.tx.signing.v1beta1"; + +/** SignMode represents a signing mode with its own security guarantees. + */ +export enum SignMode { + /** SIGN_MODE_UNSPECIFIED - SIGN_MODE_UNSPECIFIED specifies an unknown signing mode and will be + rejected + */ + SIGN_MODE_UNSPECIFIED = 0, + /** SIGN_MODE_DIRECT - SIGN_MODE_DIRECT specifies a signing mode which uses SignDoc and is + verified with raw bytes from Tx + */ + SIGN_MODE_DIRECT = 1, + /** SIGN_MODE_TEXTUAL - SIGN_MODE_TEXTUAL is a future signing mode that will verify some + human-readable textual representation on top of the binary representation + from SIGN_MODE_DIRECT + */ + SIGN_MODE_TEXTUAL = 2, + /** SIGN_MODE_LEGACY_AMINO_JSON - SIGN_MODE_LEGACY_AMINO_JSON is a backwards compatibility mode which uses + Amino JSON and will be removed in the future + */ + SIGN_MODE_LEGACY_AMINO_JSON = 127, + UNRECOGNIZED = -1, +} + +export function signModeFromJSON(object: any): SignMode { + switch (object) { + case 0: + case "SIGN_MODE_UNSPECIFIED": + return SignMode.SIGN_MODE_UNSPECIFIED; + case 1: + case "SIGN_MODE_DIRECT": + return SignMode.SIGN_MODE_DIRECT; + case 2: + case "SIGN_MODE_TEXTUAL": + return SignMode.SIGN_MODE_TEXTUAL; + case 127: + case "SIGN_MODE_LEGACY_AMINO_JSON": + return SignMode.SIGN_MODE_LEGACY_AMINO_JSON; + case -1: + case "UNRECOGNIZED": + default: + return SignMode.UNRECOGNIZED; + } +} + +export function signModeToJSON(object: SignMode): string { + switch (object) { + case SignMode.SIGN_MODE_UNSPECIFIED: + return "SIGN_MODE_UNSPECIFIED"; + case SignMode.SIGN_MODE_DIRECT: + return "SIGN_MODE_DIRECT"; + case SignMode.SIGN_MODE_TEXTUAL: + return "SIGN_MODE_TEXTUAL"; + case SignMode.SIGN_MODE_LEGACY_AMINO_JSON: + return "SIGN_MODE_LEGACY_AMINO_JSON"; + default: + return "UNKNOWN"; + } +} + +export const SignatureDescriptors = { + encode(message: SignatureDescriptors, writer: Writer = Writer.create()): Writer { + for (const v of message.signatures) { + SignatureDescriptor.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, length?: number): SignatureDescriptors { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseSignatureDescriptors } as SignatureDescriptors; + message.signatures = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signatures.push(SignatureDescriptor.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): SignatureDescriptors { + const message = { ...baseSignatureDescriptors } as SignatureDescriptors; + message.signatures = []; + if (object.signatures !== undefined && object.signatures !== null) { + for (const e of object.signatures) { + message.signatures.push(SignatureDescriptor.fromJSON(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): SignatureDescriptors { + const message = { ...baseSignatureDescriptors } as SignatureDescriptors; + message.signatures = []; + if (object.signatures !== undefined && object.signatures !== null) { + for (const e of object.signatures) { + message.signatures.push(SignatureDescriptor.fromPartial(e)); + } + } + return message; + }, + toJSON(message: SignatureDescriptors): unknown { + const obj: any = {}; + if (message.signatures) { + obj.signatures = message.signatures.map((e) => (e ? SignatureDescriptor.toJSON(e) : undefined)); + } else { + obj.signatures = []; + } + return obj; + }, +}; + +export const SignatureDescriptor = { + encode(message: SignatureDescriptor, writer: Writer = Writer.create()): Writer { + if (message.publicKey !== undefined && message.publicKey !== undefined) { + Any.encode(message.publicKey, writer.uint32(10).fork()).ldelim(); + } + if (message.data !== undefined && message.data !== undefined) { + SignatureDescriptor_Data.encode(message.data, writer.uint32(18).fork()).ldelim(); + } + writer.uint32(24).uint64(message.sequence); + return writer; + }, + decode(input: Uint8Array | Reader, length?: number): SignatureDescriptor { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseSignatureDescriptor } as SignatureDescriptor; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.publicKey = Any.decode(reader, reader.uint32()); + break; + case 2: + message.data = SignatureDescriptor_Data.decode(reader, reader.uint32()); + break; + case 3: + message.sequence = reader.uint64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): SignatureDescriptor { + const message = { ...baseSignatureDescriptor } as SignatureDescriptor; + if (object.publicKey !== undefined && object.publicKey !== null) { + message.publicKey = Any.fromJSON(object.publicKey); + } else { + message.publicKey = undefined; + } + if (object.data !== undefined && object.data !== null) { + message.data = SignatureDescriptor_Data.fromJSON(object.data); + } else { + message.data = undefined; + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = Long.fromString(object.sequence); + } else { + message.sequence = Long.UZERO; + } + return message; + }, + fromPartial(object: DeepPartial): SignatureDescriptor { + const message = { ...baseSignatureDescriptor } as SignatureDescriptor; + if (object.publicKey !== undefined && object.publicKey !== null) { + message.publicKey = Any.fromPartial(object.publicKey); + } else { + message.publicKey = undefined; + } + if (object.data !== undefined && object.data !== null) { + message.data = SignatureDescriptor_Data.fromPartial(object.data); + } else { + message.data = undefined; + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = object.sequence as Long; + } else { + message.sequence = Long.UZERO; + } + return message; + }, + toJSON(message: SignatureDescriptor): unknown { + const obj: any = {}; + message.publicKey !== undefined && + (obj.publicKey = message.publicKey ? Any.toJSON(message.publicKey) : undefined); + message.data !== undefined && + (obj.data = message.data ? SignatureDescriptor_Data.toJSON(message.data) : undefined); + message.sequence !== undefined && (obj.sequence = (message.sequence || Long.UZERO).toString()); + return obj; + }, +}; + +export const SignatureDescriptor_Data = { + encode(message: SignatureDescriptor_Data, writer: Writer = Writer.create()): Writer { + if (message.single !== undefined) { + SignatureDescriptor_Data_Single.encode(message.single, writer.uint32(10).fork()).ldelim(); + } + if (message.multi !== undefined) { + SignatureDescriptor_Data_Multi.encode(message.multi, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, length?: number): SignatureDescriptor_Data { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseSignatureDescriptor_Data } as SignatureDescriptor_Data; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.single = SignatureDescriptor_Data_Single.decode(reader, reader.uint32()); + break; + case 2: + message.multi = SignatureDescriptor_Data_Multi.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): SignatureDescriptor_Data { + const message = { ...baseSignatureDescriptor_Data } as SignatureDescriptor_Data; + if (object.single !== undefined && object.single !== null) { + message.single = SignatureDescriptor_Data_Single.fromJSON(object.single); + } else { + message.single = undefined; + } + if (object.multi !== undefined && object.multi !== null) { + message.multi = SignatureDescriptor_Data_Multi.fromJSON(object.multi); + } else { + message.multi = undefined; + } + return message; + }, + fromPartial(object: DeepPartial): SignatureDescriptor_Data { + const message = { ...baseSignatureDescriptor_Data } as SignatureDescriptor_Data; + if (object.single !== undefined && object.single !== null) { + message.single = SignatureDescriptor_Data_Single.fromPartial(object.single); + } else { + message.single = undefined; + } + if (object.multi !== undefined && object.multi !== null) { + message.multi = SignatureDescriptor_Data_Multi.fromPartial(object.multi); + } else { + message.multi = undefined; + } + return message; + }, + toJSON(message: SignatureDescriptor_Data): unknown { + const obj: any = {}; + message.single !== undefined && + (obj.single = message.single ? SignatureDescriptor_Data_Single.toJSON(message.single) : undefined); + message.multi !== undefined && + (obj.multi = message.multi ? SignatureDescriptor_Data_Multi.toJSON(message.multi) : undefined); + return obj; + }, +}; + +export const SignatureDescriptor_Data_Single = { + encode(message: SignatureDescriptor_Data_Single, writer: Writer = Writer.create()): Writer { + writer.uint32(8).int32(message.mode); + writer.uint32(18).bytes(message.signature); + return writer; + }, + decode(input: Uint8Array | Reader, length?: number): SignatureDescriptor_Data_Single { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseSignatureDescriptor_Data_Single } as SignatureDescriptor_Data_Single; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.mode = reader.int32() as any; + break; + case 2: + message.signature = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): SignatureDescriptor_Data_Single { + const message = { ...baseSignatureDescriptor_Data_Single } as SignatureDescriptor_Data_Single; + if (object.mode !== undefined && object.mode !== null) { + message.mode = signModeFromJSON(object.mode); + } else { + message.mode = 0; + } + if (object.signature !== undefined && object.signature !== null) { + message.signature = bytesFromBase64(object.signature); + } + return message; + }, + fromPartial(object: DeepPartial): SignatureDescriptor_Data_Single { + const message = { ...baseSignatureDescriptor_Data_Single } as SignatureDescriptor_Data_Single; + if (object.mode !== undefined && object.mode !== null) { + message.mode = object.mode; + } else { + message.mode = 0; + } + if (object.signature !== undefined && object.signature !== null) { + message.signature = object.signature; + } else { + message.signature = new Uint8Array(); + } + return message; + }, + toJSON(message: SignatureDescriptor_Data_Single): unknown { + const obj: any = {}; + message.mode !== undefined && (obj.mode = signModeToJSON(message.mode)); + message.signature !== undefined && + (obj.signature = base64FromBytes( + message.signature !== undefined ? message.signature : new Uint8Array(), + )); + return obj; + }, +}; + +export const SignatureDescriptor_Data_Multi = { + encode(message: SignatureDescriptor_Data_Multi, writer: Writer = Writer.create()): Writer { + if (message.bitarray !== undefined && message.bitarray !== undefined) { + CompactBitArray.encode(message.bitarray, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.signatures) { + SignatureDescriptor_Data.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, length?: number): SignatureDescriptor_Data_Multi { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseSignatureDescriptor_Data_Multi } as SignatureDescriptor_Data_Multi; + message.signatures = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bitarray = CompactBitArray.decode(reader, reader.uint32()); + break; + case 2: + message.signatures.push(SignatureDescriptor_Data.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): SignatureDescriptor_Data_Multi { + const message = { ...baseSignatureDescriptor_Data_Multi } as SignatureDescriptor_Data_Multi; + message.signatures = []; + if (object.bitarray !== undefined && object.bitarray !== null) { + message.bitarray = CompactBitArray.fromJSON(object.bitarray); + } else { + message.bitarray = undefined; + } + if (object.signatures !== undefined && object.signatures !== null) { + for (const e of object.signatures) { + message.signatures.push(SignatureDescriptor_Data.fromJSON(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): SignatureDescriptor_Data_Multi { + const message = { ...baseSignatureDescriptor_Data_Multi } as SignatureDescriptor_Data_Multi; + message.signatures = []; + if (object.bitarray !== undefined && object.bitarray !== null) { + message.bitarray = CompactBitArray.fromPartial(object.bitarray); + } else { + message.bitarray = undefined; + } + if (object.signatures !== undefined && object.signatures !== null) { + for (const e of object.signatures) { + message.signatures.push(SignatureDescriptor_Data.fromPartial(e)); + } + } + return message; + }, + toJSON(message: SignatureDescriptor_Data_Multi): unknown { + const obj: any = {}; + message.bitarray !== undefined && + (obj.bitarray = message.bitarray ? CompactBitArray.toJSON(message.bitarray) : undefined); + if (message.signatures) { + obj.signatures = message.signatures.map((e) => (e ? SignatureDescriptor_Data.toJSON(e) : undefined)); + } else { + obj.signatures = []; + } + return obj; + }, +}; + +interface WindowBase64 { + atob(b64: string): string; + btoa(bin: string): string; +} + +const windowBase64 = (globalThis as unknown) as WindowBase64; +const atob = windowBase64.atob || ((b64: string) => Buffer.from(b64, "base64").toString("binary")); +const btoa = windowBase64.btoa || ((bin: string) => Buffer.from(bin, "binary").toString("base64")); + +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/packages/proto-signing/src/codec/cosmos/tx/v1beta1/tx.ts b/packages/proto-signing/src/codec/cosmos/tx/v1beta1/tx.ts new file mode 100644 index 00000000..cd82e4d3 --- /dev/null +++ b/packages/proto-signing/src/codec/cosmos/tx/v1beta1/tx.ts @@ -0,0 +1,1161 @@ +/* eslint-disable */ +import * as Long from "long"; +import { Any } from "../../../google/protobuf/any"; +import { SignMode, signModeFromJSON, signModeToJSON } from "../../../cosmos/tx/signing/v1beta1/signing"; +import { CompactBitArray } from "../../../cosmos/crypto/multisig/v1beta1/multisig"; +import { Coin } from "../../../cosmos/base/v1beta1/coin"; +import { Writer, Reader } from "protobufjs/minimal"; + +/** + * Tx is the standard type used for broadcasting transactions. + */ +export interface Tx { + /** + * body is the processable content of the transaction + */ + body?: TxBody; + /** + * auth_info is the authorization related content of the transaction, + * specifically signers, signer modes and fee + */ + authInfo?: AuthInfo; + /** + * signatures is a list of signatures that matches the length and order of + * AuthInfo's signer_infos to allow connecting signature meta information like + * public key and signing mode by position. + */ + signatures: Uint8Array[]; +} + +/** + * TxRaw is a variant of Tx that pins the signer's exact binary representation + * of body and auth_info. This is used for signing, broadcasting and + * verification. The binary `serialize(tx: TxRaw)` is stored in Tendermint and + * the hash `sha256(serialize(tx: TxRaw))` becomes the "txhash", commonly used + * as the transaction ID. + */ +export interface TxRaw { + /** + * body_bytes is a protobuf serialization of a TxBody that matches the + * representation in SignDoc. + */ + bodyBytes: Uint8Array; + /** + * auth_info_bytes is a protobuf serialization of an AuthInfo that matches the + * representation in SignDoc. + */ + authInfoBytes: Uint8Array; + /** + * signatures is a list of signatures that matches the length and order of + * AuthInfo's signer_infos to allow connecting signature meta information like + * public key and signing mode by position. + */ + signatures: Uint8Array[]; +} + +/** + * SignDoc is the type used for generating sign bytes for SIGN_MODE_DIRECT. + */ +export interface SignDoc { + /** + * body_bytes is protobuf serialization of a TxBody that matches the + * representation in TxRaw. + */ + bodyBytes: Uint8Array; + /** + * auth_info_bytes is a protobuf serialization of an AuthInfo that matches the + * representation in TxRaw. + */ + authInfoBytes: Uint8Array; + /** + * chain_id is the unique identifier of the chain this transaction targets. + * It prevents signed transactions from being used on another chain by an + * attacker + */ + chainId: string; + /** + * account_number is the account number of the account in state + */ + accountNumber: Long; +} + +/** + * TxBody is the body of a transaction that all signers sign over. + */ +export interface TxBody { + /** + * messages is a list of messages to be executed. The required signers of + * those messages define the number and order of elements in AuthInfo's + * signer_infos and Tx's signatures. Each required signer address is added to + * the list only the first time it occurs. + * By convention, the first required signer (usually from the first message) + * is referred to as the primary signer and pays the fee for the whole + * transaction. + */ + messages: Any[]; + /** + * memo is any arbitrary memo to be added to the transaction + */ + memo: string; + /** + * timeout is the block height after which this transaction will not + * be processed by the chain + */ + timeoutHeight: Long; + /** + * extension_options are arbitrary options that can be added by chains + * when the default options are not sufficient. If any of these are present + * and can't be handled, the transaction will be rejected + */ + extensionOptions: Any[]; + /** + * extension_options are arbitrary options that can be added by chains + * when the default options are not sufficient. If any of these are present + * and can't be handled, they will be ignored + */ + nonCriticalExtensionOptions: Any[]; +} + +/** + * AuthInfo describes the fee and signer modes that are used to sign a + * transaction. + */ +export interface AuthInfo { + /** + * signer_infos defines the signing modes for the required signers. The number + * and order of elements must match the required signers from TxBody's + * messages. The first element is the primary signer and the one which pays + * the fee. + */ + signerInfos: SignerInfo[]; + /** + * Fee is the fee and gas limit for the transaction. The first signer is the + * primary signer and the one which pays the fee. The fee can be calculated + * based on the cost of evaluating the body and doing signature verification + * of the signers. This can be estimated via simulation. + */ + fee?: Fee; +} + +/** + * SignerInfo describes the public key and signing mode of a single top-level + * signer. + */ +export interface SignerInfo { + /** + * public_key is the public key of the signer. It is optional for accounts + * that already exist in state. If unset, the verifier can use the required \ + * signer address for this position and lookup the public key. + */ + publicKey?: Any; + /** + * mode_info describes the signing mode of the signer and is a nested + * structure to support nested multisig pubkey's + */ + modeInfo?: ModeInfo; + /** + * sequence is the sequence of the account, which describes the + * number of committed transactions signed by a given address. It is used to + * prevent replay attacks. + */ + sequence: Long; +} + +/** + * ModeInfo describes the signing mode of a single or nested multisig signer. + */ +export interface ModeInfo { + /** + * single represents a single signer + */ + single?: ModeInfo_Single | undefined; + /** + * multi represents a nested multisig signer + */ + multi?: ModeInfo_Multi | undefined; +} + +/** + * Single is the mode info for a single signer. It is structured as a message + * to allow for additional fields such as locale for SIGN_MODE_TEXTUAL in the + * future + */ +export interface ModeInfo_Single { + /** + * mode is the signing mode of the single signer + */ + mode: SignMode; +} + +/** + * Multi is the mode info for a multisig public key + */ +export interface ModeInfo_Multi { + /** + * bitarray specifies which keys within the multisig are signing + */ + bitarray?: CompactBitArray; + /** + * mode_infos is the corresponding modes of the signers of the multisig + * which could include nested multisig public keys + */ + modeInfos: ModeInfo[]; +} + +/** + * Fee includes the amount of coins paid in fees and the maximum + * gas to be used by the transaction. The ratio yields an effective "gasprice", + * which must be above some miminum to be accepted into the mempool. + */ +export interface Fee { + /** + * amount is the amount of coins to be paid as a fee + */ + amount: Coin[]; + /** + * gas_limit is the maximum gas that can be used in transaction processing + * before an out of gas error occurs + */ + gasLimit: Long; + /** + * if unset, the first signer is responsible for paying the fees. If set, the specified account must pay the fees. + * the payer must be a tx signer (and thus have signed this field in AuthInfo). + * setting this field does *not* change the ordering of required signers for the transaction. + */ + payer: string; + /** + * if set, the fee payer (either the first signer or the value of the payer field) requests that a fee grant be used + * to pay fees instead of the fee payer's own balance. If an appropriate fee grant does not exist or the chain does + * not support fee grants, this will fail + */ + granter: string; +} + +const baseTx: object = {}; + +const baseTxRaw: object = {}; + +const baseSignDoc: object = { + chainId: "", + accountNumber: Long.UZERO, +}; + +const baseTxBody: object = { + memo: "", + timeoutHeight: Long.UZERO, +}; + +const baseAuthInfo: object = {}; + +const baseSignerInfo: object = { + sequence: Long.UZERO, +}; + +const baseModeInfo: object = {}; + +const baseModeInfo_Single: object = { + mode: 0, +}; + +const baseModeInfo_Multi: object = {}; + +const baseFee: object = { + gasLimit: Long.UZERO, + payer: "", + granter: "", +}; + +export const protobufPackage = "cosmos.tx.v1beta1"; + +export const Tx = { + encode(message: Tx, writer: Writer = Writer.create()): Writer { + if (message.body !== undefined && message.body !== undefined) { + TxBody.encode(message.body, writer.uint32(10).fork()).ldelim(); + } + if (message.authInfo !== undefined && message.authInfo !== undefined) { + AuthInfo.encode(message.authInfo, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.signatures) { + writer.uint32(26).bytes(v!); + } + return writer; + }, + decode(input: Uint8Array | Reader, length?: number): Tx { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseTx } as Tx; + message.signatures = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.body = TxBody.decode(reader, reader.uint32()); + break; + case 2: + message.authInfo = AuthInfo.decode(reader, reader.uint32()); + break; + case 3: + message.signatures.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Tx { + const message = { ...baseTx } as Tx; + message.signatures = []; + if (object.body !== undefined && object.body !== null) { + message.body = TxBody.fromJSON(object.body); + } else { + message.body = undefined; + } + if (object.authInfo !== undefined && object.authInfo !== null) { + message.authInfo = AuthInfo.fromJSON(object.authInfo); + } else { + message.authInfo = undefined; + } + if (object.signatures !== undefined && object.signatures !== null) { + for (const e of object.signatures) { + message.signatures.push(bytesFromBase64(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): Tx { + const message = { ...baseTx } as Tx; + message.signatures = []; + if (object.body !== undefined && object.body !== null) { + message.body = TxBody.fromPartial(object.body); + } else { + message.body = undefined; + } + if (object.authInfo !== undefined && object.authInfo !== null) { + message.authInfo = AuthInfo.fromPartial(object.authInfo); + } else { + message.authInfo = undefined; + } + if (object.signatures !== undefined && object.signatures !== null) { + for (const e of object.signatures) { + message.signatures.push(e); + } + } + return message; + }, + toJSON(message: Tx): unknown { + const obj: any = {}; + message.body !== undefined && (obj.body = message.body ? TxBody.toJSON(message.body) : undefined); + message.authInfo !== undefined && + (obj.authInfo = message.authInfo ? AuthInfo.toJSON(message.authInfo) : undefined); + if (message.signatures) { + obj.signatures = message.signatures.map((e) => base64FromBytes(e !== undefined ? e : new Uint8Array())); + } else { + obj.signatures = []; + } + return obj; + }, +}; + +export const TxRaw = { + encode(message: TxRaw, writer: Writer = Writer.create()): Writer { + writer.uint32(10).bytes(message.bodyBytes); + writer.uint32(18).bytes(message.authInfoBytes); + for (const v of message.signatures) { + writer.uint32(26).bytes(v!); + } + return writer; + }, + decode(input: Uint8Array | Reader, length?: number): TxRaw { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseTxRaw } as TxRaw; + message.signatures = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bodyBytes = reader.bytes(); + break; + case 2: + message.authInfoBytes = reader.bytes(); + break; + case 3: + message.signatures.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): TxRaw { + const message = { ...baseTxRaw } as TxRaw; + message.signatures = []; + if (object.bodyBytes !== undefined && object.bodyBytes !== null) { + message.bodyBytes = bytesFromBase64(object.bodyBytes); + } + if (object.authInfoBytes !== undefined && object.authInfoBytes !== null) { + message.authInfoBytes = bytesFromBase64(object.authInfoBytes); + } + if (object.signatures !== undefined && object.signatures !== null) { + for (const e of object.signatures) { + message.signatures.push(bytesFromBase64(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): TxRaw { + const message = { ...baseTxRaw } as TxRaw; + message.signatures = []; + if (object.bodyBytes !== undefined && object.bodyBytes !== null) { + message.bodyBytes = object.bodyBytes; + } else { + message.bodyBytes = new Uint8Array(); + } + if (object.authInfoBytes !== undefined && object.authInfoBytes !== null) { + message.authInfoBytes = object.authInfoBytes; + } else { + message.authInfoBytes = new Uint8Array(); + } + if (object.signatures !== undefined && object.signatures !== null) { + for (const e of object.signatures) { + message.signatures.push(e); + } + } + return message; + }, + toJSON(message: TxRaw): unknown { + const obj: any = {}; + message.bodyBytes !== undefined && + (obj.bodyBytes = base64FromBytes( + message.bodyBytes !== undefined ? message.bodyBytes : new Uint8Array(), + )); + message.authInfoBytes !== undefined && + (obj.authInfoBytes = base64FromBytes( + message.authInfoBytes !== undefined ? message.authInfoBytes : new Uint8Array(), + )); + if (message.signatures) { + obj.signatures = message.signatures.map((e) => base64FromBytes(e !== undefined ? e : new Uint8Array())); + } else { + obj.signatures = []; + } + return obj; + }, +}; + +export const SignDoc = { + encode(message: SignDoc, writer: Writer = Writer.create()): Writer { + writer.uint32(10).bytes(message.bodyBytes); + writer.uint32(18).bytes(message.authInfoBytes); + writer.uint32(26).string(message.chainId); + writer.uint32(32).uint64(message.accountNumber); + return writer; + }, + decode(input: Uint8Array | Reader, length?: number): SignDoc { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseSignDoc } as SignDoc; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bodyBytes = reader.bytes(); + break; + case 2: + message.authInfoBytes = reader.bytes(); + break; + case 3: + message.chainId = reader.string(); + break; + case 4: + message.accountNumber = reader.uint64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): SignDoc { + const message = { ...baseSignDoc } as SignDoc; + if (object.bodyBytes !== undefined && object.bodyBytes !== null) { + message.bodyBytes = bytesFromBase64(object.bodyBytes); + } + if (object.authInfoBytes !== undefined && object.authInfoBytes !== null) { + message.authInfoBytes = bytesFromBase64(object.authInfoBytes); + } + if (object.chainId !== undefined && object.chainId !== null) { + message.chainId = String(object.chainId); + } else { + message.chainId = ""; + } + if (object.accountNumber !== undefined && object.accountNumber !== null) { + message.accountNumber = Long.fromString(object.accountNumber); + } else { + message.accountNumber = Long.UZERO; + } + return message; + }, + fromPartial(object: DeepPartial): SignDoc { + const message = { ...baseSignDoc } as SignDoc; + if (object.bodyBytes !== undefined && object.bodyBytes !== null) { + message.bodyBytes = object.bodyBytes; + } else { + message.bodyBytes = new Uint8Array(); + } + if (object.authInfoBytes !== undefined && object.authInfoBytes !== null) { + message.authInfoBytes = object.authInfoBytes; + } else { + message.authInfoBytes = new Uint8Array(); + } + if (object.chainId !== undefined && object.chainId !== null) { + message.chainId = object.chainId; + } else { + message.chainId = ""; + } + if (object.accountNumber !== undefined && object.accountNumber !== null) { + message.accountNumber = object.accountNumber as Long; + } else { + message.accountNumber = Long.UZERO; + } + return message; + }, + toJSON(message: SignDoc): unknown { + const obj: any = {}; + message.bodyBytes !== undefined && + (obj.bodyBytes = base64FromBytes( + message.bodyBytes !== undefined ? message.bodyBytes : new Uint8Array(), + )); + message.authInfoBytes !== undefined && + (obj.authInfoBytes = base64FromBytes( + message.authInfoBytes !== undefined ? message.authInfoBytes : new Uint8Array(), + )); + message.chainId !== undefined && (obj.chainId = message.chainId); + message.accountNumber !== undefined && + (obj.accountNumber = (message.accountNumber || Long.UZERO).toString()); + return obj; + }, +}; + +export const TxBody = { + encode(message: TxBody, writer: Writer = Writer.create()): Writer { + for (const v of message.messages) { + Any.encode(v!, writer.uint32(10).fork()).ldelim(); + } + writer.uint32(18).string(message.memo); + writer.uint32(24).uint64(message.timeoutHeight); + for (const v of message.extensionOptions) { + Any.encode(v!, writer.uint32(8186).fork()).ldelim(); + } + for (const v of message.nonCriticalExtensionOptions) { + Any.encode(v!, writer.uint32(16378).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, length?: number): TxBody { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseTxBody } as TxBody; + message.messages = []; + message.extensionOptions = []; + message.nonCriticalExtensionOptions = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.messages.push(Any.decode(reader, reader.uint32())); + break; + case 2: + message.memo = reader.string(); + break; + case 3: + message.timeoutHeight = reader.uint64() as Long; + break; + case 1023: + message.extensionOptions.push(Any.decode(reader, reader.uint32())); + break; + case 2047: + message.nonCriticalExtensionOptions.push(Any.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): TxBody { + const message = { ...baseTxBody } as TxBody; + message.messages = []; + message.extensionOptions = []; + message.nonCriticalExtensionOptions = []; + if (object.messages !== undefined && object.messages !== null) { + for (const e of object.messages) { + message.messages.push(Any.fromJSON(e)); + } + } + if (object.memo !== undefined && object.memo !== null) { + message.memo = String(object.memo); + } else { + message.memo = ""; + } + if (object.timeoutHeight !== undefined && object.timeoutHeight !== null) { + message.timeoutHeight = Long.fromString(object.timeoutHeight); + } else { + message.timeoutHeight = Long.UZERO; + } + if (object.extensionOptions !== undefined && object.extensionOptions !== null) { + for (const e of object.extensionOptions) { + message.extensionOptions.push(Any.fromJSON(e)); + } + } + if (object.nonCriticalExtensionOptions !== undefined && object.nonCriticalExtensionOptions !== null) { + for (const e of object.nonCriticalExtensionOptions) { + message.nonCriticalExtensionOptions.push(Any.fromJSON(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): TxBody { + const message = { ...baseTxBody } as TxBody; + message.messages = []; + message.extensionOptions = []; + message.nonCriticalExtensionOptions = []; + if (object.messages !== undefined && object.messages !== null) { + for (const e of object.messages) { + message.messages.push(Any.fromPartial(e)); + } + } + if (object.memo !== undefined && object.memo !== null) { + message.memo = object.memo; + } else { + message.memo = ""; + } + if (object.timeoutHeight !== undefined && object.timeoutHeight !== null) { + message.timeoutHeight = object.timeoutHeight as Long; + } else { + message.timeoutHeight = Long.UZERO; + } + if (object.extensionOptions !== undefined && object.extensionOptions !== null) { + for (const e of object.extensionOptions) { + message.extensionOptions.push(Any.fromPartial(e)); + } + } + if (object.nonCriticalExtensionOptions !== undefined && object.nonCriticalExtensionOptions !== null) { + for (const e of object.nonCriticalExtensionOptions) { + message.nonCriticalExtensionOptions.push(Any.fromPartial(e)); + } + } + return message; + }, + toJSON(message: TxBody): unknown { + const obj: any = {}; + if (message.messages) { + obj.messages = message.messages.map((e) => (e ? Any.toJSON(e) : undefined)); + } else { + obj.messages = []; + } + message.memo !== undefined && (obj.memo = message.memo); + message.timeoutHeight !== undefined && + (obj.timeoutHeight = (message.timeoutHeight || Long.UZERO).toString()); + if (message.extensionOptions) { + obj.extensionOptions = message.extensionOptions.map((e) => (e ? Any.toJSON(e) : undefined)); + } else { + obj.extensionOptions = []; + } + if (message.nonCriticalExtensionOptions) { + obj.nonCriticalExtensionOptions = message.nonCriticalExtensionOptions.map((e) => + e ? Any.toJSON(e) : undefined, + ); + } else { + obj.nonCriticalExtensionOptions = []; + } + return obj; + }, +}; + +export const AuthInfo = { + encode(message: AuthInfo, writer: Writer = Writer.create()): Writer { + for (const v of message.signerInfos) { + SignerInfo.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.fee !== undefined && message.fee !== undefined) { + Fee.encode(message.fee, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, length?: number): AuthInfo { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseAuthInfo } as AuthInfo; + message.signerInfos = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signerInfos.push(SignerInfo.decode(reader, reader.uint32())); + break; + case 2: + message.fee = Fee.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): AuthInfo { + const message = { ...baseAuthInfo } as AuthInfo; + message.signerInfos = []; + if (object.signerInfos !== undefined && object.signerInfos !== null) { + for (const e of object.signerInfos) { + message.signerInfos.push(SignerInfo.fromJSON(e)); + } + } + if (object.fee !== undefined && object.fee !== null) { + message.fee = Fee.fromJSON(object.fee); + } else { + message.fee = undefined; + } + return message; + }, + fromPartial(object: DeepPartial): AuthInfo { + const message = { ...baseAuthInfo } as AuthInfo; + message.signerInfos = []; + if (object.signerInfos !== undefined && object.signerInfos !== null) { + for (const e of object.signerInfos) { + message.signerInfos.push(SignerInfo.fromPartial(e)); + } + } + if (object.fee !== undefined && object.fee !== null) { + message.fee = Fee.fromPartial(object.fee); + } else { + message.fee = undefined; + } + return message; + }, + toJSON(message: AuthInfo): unknown { + const obj: any = {}; + if (message.signerInfos) { + obj.signerInfos = message.signerInfos.map((e) => (e ? SignerInfo.toJSON(e) : undefined)); + } else { + obj.signerInfos = []; + } + message.fee !== undefined && (obj.fee = message.fee ? Fee.toJSON(message.fee) : undefined); + return obj; + }, +}; + +export const SignerInfo = { + encode(message: SignerInfo, writer: Writer = Writer.create()): Writer { + if (message.publicKey !== undefined && message.publicKey !== undefined) { + Any.encode(message.publicKey, writer.uint32(10).fork()).ldelim(); + } + if (message.modeInfo !== undefined && message.modeInfo !== undefined) { + ModeInfo.encode(message.modeInfo, writer.uint32(18).fork()).ldelim(); + } + writer.uint32(24).uint64(message.sequence); + return writer; + }, + decode(input: Uint8Array | Reader, length?: number): SignerInfo { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseSignerInfo } as SignerInfo; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.publicKey = Any.decode(reader, reader.uint32()); + break; + case 2: + message.modeInfo = ModeInfo.decode(reader, reader.uint32()); + break; + case 3: + message.sequence = reader.uint64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): SignerInfo { + const message = { ...baseSignerInfo } as SignerInfo; + if (object.publicKey !== undefined && object.publicKey !== null) { + message.publicKey = Any.fromJSON(object.publicKey); + } else { + message.publicKey = undefined; + } + if (object.modeInfo !== undefined && object.modeInfo !== null) { + message.modeInfo = ModeInfo.fromJSON(object.modeInfo); + } else { + message.modeInfo = undefined; + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = Long.fromString(object.sequence); + } else { + message.sequence = Long.UZERO; + } + return message; + }, + fromPartial(object: DeepPartial): SignerInfo { + const message = { ...baseSignerInfo } as SignerInfo; + if (object.publicKey !== undefined && object.publicKey !== null) { + message.publicKey = Any.fromPartial(object.publicKey); + } else { + message.publicKey = undefined; + } + if (object.modeInfo !== undefined && object.modeInfo !== null) { + message.modeInfo = ModeInfo.fromPartial(object.modeInfo); + } else { + message.modeInfo = undefined; + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = object.sequence as Long; + } else { + message.sequence = Long.UZERO; + } + return message; + }, + toJSON(message: SignerInfo): unknown { + const obj: any = {}; + message.publicKey !== undefined && + (obj.publicKey = message.publicKey ? Any.toJSON(message.publicKey) : undefined); + message.modeInfo !== undefined && + (obj.modeInfo = message.modeInfo ? ModeInfo.toJSON(message.modeInfo) : undefined); + message.sequence !== undefined && (obj.sequence = (message.sequence || Long.UZERO).toString()); + return obj; + }, +}; + +export const ModeInfo = { + encode(message: ModeInfo, writer: Writer = Writer.create()): Writer { + if (message.single !== undefined) { + ModeInfo_Single.encode(message.single, writer.uint32(10).fork()).ldelim(); + } + if (message.multi !== undefined) { + ModeInfo_Multi.encode(message.multi, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, length?: number): ModeInfo { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseModeInfo } as ModeInfo; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.single = ModeInfo_Single.decode(reader, reader.uint32()); + break; + case 2: + message.multi = ModeInfo_Multi.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): ModeInfo { + const message = { ...baseModeInfo } as ModeInfo; + if (object.single !== undefined && object.single !== null) { + message.single = ModeInfo_Single.fromJSON(object.single); + } else { + message.single = undefined; + } + if (object.multi !== undefined && object.multi !== null) { + message.multi = ModeInfo_Multi.fromJSON(object.multi); + } else { + message.multi = undefined; + } + return message; + }, + fromPartial(object: DeepPartial): ModeInfo { + const message = { ...baseModeInfo } as ModeInfo; + if (object.single !== undefined && object.single !== null) { + message.single = ModeInfo_Single.fromPartial(object.single); + } else { + message.single = undefined; + } + if (object.multi !== undefined && object.multi !== null) { + message.multi = ModeInfo_Multi.fromPartial(object.multi); + } else { + message.multi = undefined; + } + return message; + }, + toJSON(message: ModeInfo): unknown { + const obj: any = {}; + message.single !== undefined && + (obj.single = message.single ? ModeInfo_Single.toJSON(message.single) : undefined); + message.multi !== undefined && + (obj.multi = message.multi ? ModeInfo_Multi.toJSON(message.multi) : undefined); + return obj; + }, +}; + +export const ModeInfo_Single = { + encode(message: ModeInfo_Single, writer: Writer = Writer.create()): Writer { + writer.uint32(8).int32(message.mode); + return writer; + }, + decode(input: Uint8Array | Reader, length?: number): ModeInfo_Single { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseModeInfo_Single } as ModeInfo_Single; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.mode = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): ModeInfo_Single { + const message = { ...baseModeInfo_Single } as ModeInfo_Single; + if (object.mode !== undefined && object.mode !== null) { + message.mode = signModeFromJSON(object.mode); + } else { + message.mode = 0; + } + return message; + }, + fromPartial(object: DeepPartial): ModeInfo_Single { + const message = { ...baseModeInfo_Single } as ModeInfo_Single; + if (object.mode !== undefined && object.mode !== null) { + message.mode = object.mode; + } else { + message.mode = 0; + } + return message; + }, + toJSON(message: ModeInfo_Single): unknown { + const obj: any = {}; + message.mode !== undefined && (obj.mode = signModeToJSON(message.mode)); + return obj; + }, +}; + +export const ModeInfo_Multi = { + encode(message: ModeInfo_Multi, writer: Writer = Writer.create()): Writer { + if (message.bitarray !== undefined && message.bitarray !== undefined) { + CompactBitArray.encode(message.bitarray, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.modeInfos) { + ModeInfo.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, length?: number): ModeInfo_Multi { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseModeInfo_Multi } as ModeInfo_Multi; + message.modeInfos = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bitarray = CompactBitArray.decode(reader, reader.uint32()); + break; + case 2: + message.modeInfos.push(ModeInfo.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): ModeInfo_Multi { + const message = { ...baseModeInfo_Multi } as ModeInfo_Multi; + message.modeInfos = []; + if (object.bitarray !== undefined && object.bitarray !== null) { + message.bitarray = CompactBitArray.fromJSON(object.bitarray); + } else { + message.bitarray = undefined; + } + if (object.modeInfos !== undefined && object.modeInfos !== null) { + for (const e of object.modeInfos) { + message.modeInfos.push(ModeInfo.fromJSON(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): ModeInfo_Multi { + const message = { ...baseModeInfo_Multi } as ModeInfo_Multi; + message.modeInfos = []; + if (object.bitarray !== undefined && object.bitarray !== null) { + message.bitarray = CompactBitArray.fromPartial(object.bitarray); + } else { + message.bitarray = undefined; + } + if (object.modeInfos !== undefined && object.modeInfos !== null) { + for (const e of object.modeInfos) { + message.modeInfos.push(ModeInfo.fromPartial(e)); + } + } + return message; + }, + toJSON(message: ModeInfo_Multi): unknown { + const obj: any = {}; + message.bitarray !== undefined && + (obj.bitarray = message.bitarray ? CompactBitArray.toJSON(message.bitarray) : undefined); + if (message.modeInfos) { + obj.modeInfos = message.modeInfos.map((e) => (e ? ModeInfo.toJSON(e) : undefined)); + } else { + obj.modeInfos = []; + } + return obj; + }, +}; + +export const Fee = { + encode(message: Fee, writer: Writer = Writer.create()): Writer { + for (const v of message.amount) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + writer.uint32(16).uint64(message.gasLimit); + writer.uint32(26).string(message.payer); + writer.uint32(34).string(message.granter); + return writer; + }, + decode(input: Uint8Array | Reader, length?: number): Fee { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseFee } as Fee; + message.amount = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.amount.push(Coin.decode(reader, reader.uint32())); + break; + case 2: + message.gasLimit = reader.uint64() as Long; + break; + case 3: + message.payer = reader.string(); + break; + case 4: + message.granter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Fee { + const message = { ...baseFee } as Fee; + message.amount = []; + if (object.amount !== undefined && object.amount !== null) { + for (const e of object.amount) { + message.amount.push(Coin.fromJSON(e)); + } + } + if (object.gasLimit !== undefined && object.gasLimit !== null) { + message.gasLimit = Long.fromString(object.gasLimit); + } else { + message.gasLimit = Long.UZERO; + } + if (object.payer !== undefined && object.payer !== null) { + message.payer = String(object.payer); + } else { + message.payer = ""; + } + if (object.granter !== undefined && object.granter !== null) { + message.granter = String(object.granter); + } else { + message.granter = ""; + } + return message; + }, + fromPartial(object: DeepPartial): Fee { + const message = { ...baseFee } as Fee; + message.amount = []; + if (object.amount !== undefined && object.amount !== null) { + for (const e of object.amount) { + message.amount.push(Coin.fromPartial(e)); + } + } + if (object.gasLimit !== undefined && object.gasLimit !== null) { + message.gasLimit = object.gasLimit as Long; + } else { + message.gasLimit = Long.UZERO; + } + if (object.payer !== undefined && object.payer !== null) { + message.payer = object.payer; + } else { + message.payer = ""; + } + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } else { + message.granter = ""; + } + return message; + }, + toJSON(message: Fee): unknown { + const obj: any = {}; + if (message.amount) { + obj.amount = message.amount.map((e) => (e ? Coin.toJSON(e) : undefined)); + } else { + obj.amount = []; + } + message.gasLimit !== undefined && (obj.gasLimit = (message.gasLimit || Long.UZERO).toString()); + message.payer !== undefined && (obj.payer = message.payer); + message.granter !== undefined && (obj.granter = message.granter); + return obj; + }, +}; + +interface WindowBase64 { + atob(b64: string): string; + btoa(bin: string): string; +} + +const windowBase64 = (globalThis as unknown) as WindowBase64; +const atob = windowBase64.atob || ((b64: string) => Buffer.from(b64, "base64").toString("binary")); +const btoa = windowBase64.btoa || ((bin: string) => Buffer.from(bin, "binary").toString("base64")); + +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/packages/proto-signing/src/codec/cosmos_proto/cosmos.ts b/packages/proto-signing/src/codec/cosmos_proto/cosmos.ts new file mode 100644 index 00000000..1ef6995b --- /dev/null +++ b/packages/proto-signing/src/codec/cosmos_proto/cosmos.ts @@ -0,0 +1,3 @@ +/* eslint-disable */ + +export const protobufPackage = "cosmos_proto"; diff --git a/packages/proto-signing/src/codec/generated/codecimpl.d.ts b/packages/proto-signing/src/codec/generated/codecimpl.d.ts deleted file mode 100644 index dd187a06..00000000 --- a/packages/proto-signing/src/codec/generated/codecimpl.d.ts +++ /dev/null @@ -1,2016 +0,0 @@ -import * as $protobuf from "protobufjs"; -/** Namespace cosmos. */ -export namespace cosmos { - /** Namespace bank. */ - namespace bank { - /** Namespace v1beta1. */ - namespace v1beta1 { - /** Properties of a Params. */ - interface IParams { - /** Params sendEnabled */ - sendEnabled?: cosmos.bank.v1beta1.ISendEnabled[] | null; - - /** Params defaultSendEnabled */ - defaultSendEnabled?: boolean | null; - } - - /** Represents a Params. */ - class Params implements IParams { - /** - * Constructs a new Params. - * @param [p] Properties to set - */ - constructor(p?: cosmos.bank.v1beta1.IParams); - - /** Params sendEnabled. */ - public sendEnabled: cosmos.bank.v1beta1.ISendEnabled[]; - - /** Params defaultSendEnabled. */ - public defaultSendEnabled: boolean; - - /** - * Creates a new Params instance using the specified properties. - * @param [properties] Properties to set - * @returns Params instance - */ - public static create(properties?: cosmos.bank.v1beta1.IParams): cosmos.bank.v1beta1.Params; - - /** - * Encodes the specified Params message. Does not implicitly {@link cosmos.bank.v1beta1.Params.verify|verify} messages. - * @param m Params message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.bank.v1beta1.IParams, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Params message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Params - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.bank.v1beta1.Params; - } - - /** Properties of a SendEnabled. */ - interface ISendEnabled { - /** SendEnabled denom */ - denom?: string | null; - - /** SendEnabled enabled */ - enabled?: boolean | null; - } - - /** Represents a SendEnabled. */ - class SendEnabled implements ISendEnabled { - /** - * Constructs a new SendEnabled. - * @param [p] Properties to set - */ - constructor(p?: cosmos.bank.v1beta1.ISendEnabled); - - /** SendEnabled denom. */ - public denom: string; - - /** SendEnabled enabled. */ - public enabled: boolean; - - /** - * Creates a new SendEnabled instance using the specified properties. - * @param [properties] Properties to set - * @returns SendEnabled instance - */ - public static create(properties?: cosmos.bank.v1beta1.ISendEnabled): cosmos.bank.v1beta1.SendEnabled; - - /** - * Encodes the specified SendEnabled message. Does not implicitly {@link cosmos.bank.v1beta1.SendEnabled.verify|verify} messages. - * @param m SendEnabled message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.bank.v1beta1.ISendEnabled, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SendEnabled message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns SendEnabled - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.bank.v1beta1.SendEnabled; - } - - /** Properties of an Input. */ - interface IInput { - /** Input address */ - address?: string | null; - - /** Input coins */ - coins?: cosmos.base.v1beta1.ICoin[] | null; - } - - /** Represents an Input. */ - class Input implements IInput { - /** - * Constructs a new Input. - * @param [p] Properties to set - */ - constructor(p?: cosmos.bank.v1beta1.IInput); - - /** Input address. */ - public address: string; - - /** Input coins. */ - public coins: cosmos.base.v1beta1.ICoin[]; - - /** - * Creates a new Input instance using the specified properties. - * @param [properties] Properties to set - * @returns Input instance - */ - public static create(properties?: cosmos.bank.v1beta1.IInput): cosmos.bank.v1beta1.Input; - - /** - * Encodes the specified Input message. Does not implicitly {@link cosmos.bank.v1beta1.Input.verify|verify} messages. - * @param m Input message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.bank.v1beta1.IInput, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Input message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Input - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.bank.v1beta1.Input; - } - - /** Properties of an Output. */ - interface IOutput { - /** Output address */ - address?: string | null; - - /** Output coins */ - coins?: cosmos.base.v1beta1.ICoin[] | null; - } - - /** Represents an Output. */ - class Output implements IOutput { - /** - * Constructs a new Output. - * @param [p] Properties to set - */ - constructor(p?: cosmos.bank.v1beta1.IOutput); - - /** Output address. */ - public address: string; - - /** Output coins. */ - public coins: cosmos.base.v1beta1.ICoin[]; - - /** - * Creates a new Output instance using the specified properties. - * @param [properties] Properties to set - * @returns Output instance - */ - public static create(properties?: cosmos.bank.v1beta1.IOutput): cosmos.bank.v1beta1.Output; - - /** - * Encodes the specified Output message. Does not implicitly {@link cosmos.bank.v1beta1.Output.verify|verify} messages. - * @param m Output message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.bank.v1beta1.IOutput, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Output message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Output - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.bank.v1beta1.Output; - } - - /** Properties of a Supply. */ - interface ISupply { - /** Supply total */ - total?: cosmos.base.v1beta1.ICoin[] | null; - } - - /** Represents a Supply. */ - class Supply implements ISupply { - /** - * Constructs a new Supply. - * @param [p] Properties to set - */ - constructor(p?: cosmos.bank.v1beta1.ISupply); - - /** Supply total. */ - public total: cosmos.base.v1beta1.ICoin[]; - - /** - * Creates a new Supply instance using the specified properties. - * @param [properties] Properties to set - * @returns Supply instance - */ - public static create(properties?: cosmos.bank.v1beta1.ISupply): cosmos.bank.v1beta1.Supply; - - /** - * Encodes the specified Supply message. Does not implicitly {@link cosmos.bank.v1beta1.Supply.verify|verify} messages. - * @param m Supply message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.bank.v1beta1.ISupply, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Supply message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Supply - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.bank.v1beta1.Supply; - } - - /** Properties of a DenomUnit. */ - interface IDenomUnit { - /** DenomUnit denom */ - denom?: string | null; - - /** DenomUnit exponent */ - exponent?: number | null; - - /** DenomUnit aliases */ - aliases?: string[] | null; - } - - /** Represents a DenomUnit. */ - class DenomUnit implements IDenomUnit { - /** - * Constructs a new DenomUnit. - * @param [p] Properties to set - */ - constructor(p?: cosmos.bank.v1beta1.IDenomUnit); - - /** DenomUnit denom. */ - public denom: string; - - /** DenomUnit exponent. */ - public exponent: number; - - /** DenomUnit aliases. */ - public aliases: string[]; - - /** - * Creates a new DenomUnit instance using the specified properties. - * @param [properties] Properties to set - * @returns DenomUnit instance - */ - public static create(properties?: cosmos.bank.v1beta1.IDenomUnit): cosmos.bank.v1beta1.DenomUnit; - - /** - * Encodes the specified DenomUnit message. Does not implicitly {@link cosmos.bank.v1beta1.DenomUnit.verify|verify} messages. - * @param m DenomUnit message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.bank.v1beta1.IDenomUnit, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DenomUnit message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns DenomUnit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.bank.v1beta1.DenomUnit; - } - - /** Properties of a Metadata. */ - interface IMetadata { - /** Metadata description */ - description?: string | null; - - /** Metadata denomUnits */ - denomUnits?: cosmos.bank.v1beta1.IDenomUnit[] | null; - - /** Metadata base */ - base?: string | null; - - /** Metadata display */ - display?: string | null; - } - - /** Represents a Metadata. */ - class Metadata implements IMetadata { - /** - * Constructs a new Metadata. - * @param [p] Properties to set - */ - constructor(p?: cosmos.bank.v1beta1.IMetadata); - - /** Metadata description. */ - public description: string; - - /** Metadata denomUnits. */ - public denomUnits: cosmos.bank.v1beta1.IDenomUnit[]; - - /** Metadata base. */ - public base: string; - - /** Metadata display. */ - public display: string; - - /** - * Creates a new Metadata instance using the specified properties. - * @param [properties] Properties to set - * @returns Metadata instance - */ - public static create(properties?: cosmos.bank.v1beta1.IMetadata): cosmos.bank.v1beta1.Metadata; - - /** - * Encodes the specified Metadata message. Does not implicitly {@link cosmos.bank.v1beta1.Metadata.verify|verify} messages. - * @param m Metadata message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.bank.v1beta1.IMetadata, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Metadata message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Metadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.bank.v1beta1.Metadata; - } - - /** Represents a Msg */ - class Msg extends $protobuf.rpc.Service { - /** - * Constructs a new Msg service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Creates new Msg service using the specified rpc implementation. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - * @returns RPC service. Useful where requests and/or responses are streamed. - */ - public static create( - rpcImpl: $protobuf.RPCImpl, - requestDelimited?: boolean, - responseDelimited?: boolean, - ): Msg; - - /** - * Calls Send. - * @param request MsgSend message or plain object - * @param callback Node-style callback called with the error, if any, and MsgSendResponse - */ - public send( - request: cosmos.bank.v1beta1.IMsgSend, - callback: cosmos.bank.v1beta1.Msg.SendCallback, - ): void; - - /** - * Calls Send. - * @param request MsgSend message or plain object - * @returns Promise - */ - public send(request: cosmos.bank.v1beta1.IMsgSend): Promise; - - /** - * Calls MultiSend. - * @param request MsgMultiSend message or plain object - * @param callback Node-style callback called with the error, if any, and MsgMultiSendResponse - */ - public multiSend( - request: cosmos.bank.v1beta1.IMsgMultiSend, - callback: cosmos.bank.v1beta1.Msg.MultiSendCallback, - ): void; - - /** - * Calls MultiSend. - * @param request MsgMultiSend message or plain object - * @returns Promise - */ - public multiSend( - request: cosmos.bank.v1beta1.IMsgMultiSend, - ): Promise; - } - - namespace Msg { - /** - * Callback as used by {@link cosmos.bank.v1beta1.Msg#send}. - * @param error Error, if any - * @param [response] MsgSendResponse - */ - type SendCallback = (error: Error | null, response?: cosmos.bank.v1beta1.MsgSendResponse) => void; - - /** - * Callback as used by {@link cosmos.bank.v1beta1.Msg#multiSend}. - * @param error Error, if any - * @param [response] MsgMultiSendResponse - */ - type MultiSendCallback = ( - error: Error | null, - response?: cosmos.bank.v1beta1.MsgMultiSendResponse, - ) => void; - } - - /** Properties of a MsgSend. */ - interface IMsgSend { - /** MsgSend fromAddress */ - fromAddress?: string | null; - - /** MsgSend toAddress */ - toAddress?: string | null; - - /** MsgSend amount */ - amount?: cosmos.base.v1beta1.ICoin[] | null; - } - - /** Represents a MsgSend. */ - class MsgSend implements IMsgSend { - /** - * Constructs a new MsgSend. - * @param [p] Properties to set - */ - constructor(p?: cosmos.bank.v1beta1.IMsgSend); - - /** MsgSend fromAddress. */ - public fromAddress: string; - - /** MsgSend toAddress. */ - public toAddress: string; - - /** MsgSend amount. */ - public amount: cosmos.base.v1beta1.ICoin[]; - - /** - * Creates a new MsgSend instance using the specified properties. - * @param [properties] Properties to set - * @returns MsgSend instance - */ - public static create(properties?: cosmos.bank.v1beta1.IMsgSend): cosmos.bank.v1beta1.MsgSend; - - /** - * Encodes the specified MsgSend message. Does not implicitly {@link cosmos.bank.v1beta1.MsgSend.verify|verify} messages. - * @param m MsgSend message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.bank.v1beta1.IMsgSend, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgSend message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns MsgSend - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.bank.v1beta1.MsgSend; - } - - /** Properties of a MsgSendResponse. */ - interface IMsgSendResponse {} - - /** Represents a MsgSendResponse. */ - class MsgSendResponse implements IMsgSendResponse { - /** - * Constructs a new MsgSendResponse. - * @param [p] Properties to set - */ - constructor(p?: cosmos.bank.v1beta1.IMsgSendResponse); - - /** - * Creates a new MsgSendResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns MsgSendResponse instance - */ - public static create( - properties?: cosmos.bank.v1beta1.IMsgSendResponse, - ): cosmos.bank.v1beta1.MsgSendResponse; - - /** - * Encodes the specified MsgSendResponse message. Does not implicitly {@link cosmos.bank.v1beta1.MsgSendResponse.verify|verify} messages. - * @param m MsgSendResponse message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.bank.v1beta1.IMsgSendResponse, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgSendResponse message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns MsgSendResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.bank.v1beta1.MsgSendResponse; - } - - /** Properties of a MsgMultiSend. */ - interface IMsgMultiSend { - /** MsgMultiSend inputs */ - inputs?: cosmos.bank.v1beta1.IInput[] | null; - - /** MsgMultiSend outputs */ - outputs?: cosmos.bank.v1beta1.IOutput[] | null; - } - - /** Represents a MsgMultiSend. */ - class MsgMultiSend implements IMsgMultiSend { - /** - * Constructs a new MsgMultiSend. - * @param [p] Properties to set - */ - constructor(p?: cosmos.bank.v1beta1.IMsgMultiSend); - - /** MsgMultiSend inputs. */ - public inputs: cosmos.bank.v1beta1.IInput[]; - - /** MsgMultiSend outputs. */ - public outputs: cosmos.bank.v1beta1.IOutput[]; - - /** - * Creates a new MsgMultiSend instance using the specified properties. - * @param [properties] Properties to set - * @returns MsgMultiSend instance - */ - public static create( - properties?: cosmos.bank.v1beta1.IMsgMultiSend, - ): cosmos.bank.v1beta1.MsgMultiSend; - - /** - * Encodes the specified MsgMultiSend message. Does not implicitly {@link cosmos.bank.v1beta1.MsgMultiSend.verify|verify} messages. - * @param m MsgMultiSend message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.bank.v1beta1.IMsgMultiSend, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgMultiSend message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns MsgMultiSend - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.bank.v1beta1.MsgMultiSend; - } - - /** Properties of a MsgMultiSendResponse. */ - interface IMsgMultiSendResponse {} - - /** Represents a MsgMultiSendResponse. */ - class MsgMultiSendResponse implements IMsgMultiSendResponse { - /** - * Constructs a new MsgMultiSendResponse. - * @param [p] Properties to set - */ - constructor(p?: cosmos.bank.v1beta1.IMsgMultiSendResponse); - - /** - * Creates a new MsgMultiSendResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns MsgMultiSendResponse instance - */ - public static create( - properties?: cosmos.bank.v1beta1.IMsgMultiSendResponse, - ): cosmos.bank.v1beta1.MsgMultiSendResponse; - - /** - * Encodes the specified MsgMultiSendResponse message. Does not implicitly {@link cosmos.bank.v1beta1.MsgMultiSendResponse.verify|verify} messages. - * @param m MsgMultiSendResponse message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.bank.v1beta1.IMsgMultiSendResponse, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a MsgMultiSendResponse message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns MsgMultiSendResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.bank.v1beta1.MsgMultiSendResponse; - } - } - } - - /** Namespace base. */ - namespace base { - /** Namespace v1beta1. */ - namespace v1beta1 { - /** Properties of a Coin. */ - interface ICoin { - /** Coin denom */ - denom?: string | null; - - /** Coin amount */ - amount?: string | null; - } - - /** Represents a Coin. */ - class Coin implements ICoin { - /** - * Constructs a new Coin. - * @param [p] Properties to set - */ - constructor(p?: cosmos.base.v1beta1.ICoin); - - /** Coin denom. */ - public denom: string; - - /** Coin amount. */ - public amount: string; - - /** - * Creates a new Coin instance using the specified properties. - * @param [properties] Properties to set - * @returns Coin instance - */ - public static create(properties?: cosmos.base.v1beta1.ICoin): cosmos.base.v1beta1.Coin; - - /** - * Encodes the specified Coin message. Does not implicitly {@link cosmos.base.v1beta1.Coin.verify|verify} messages. - * @param m Coin message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.base.v1beta1.ICoin, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Coin message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Coin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.base.v1beta1.Coin; - } - - /** Properties of a DecCoin. */ - interface IDecCoin { - /** DecCoin denom */ - denom?: string | null; - - /** DecCoin amount */ - amount?: string | null; - } - - /** Represents a DecCoin. */ - class DecCoin implements IDecCoin { - /** - * Constructs a new DecCoin. - * @param [p] Properties to set - */ - constructor(p?: cosmos.base.v1beta1.IDecCoin); - - /** DecCoin denom. */ - public denom: string; - - /** DecCoin amount. */ - public amount: string; - - /** - * Creates a new DecCoin instance using the specified properties. - * @param [properties] Properties to set - * @returns DecCoin instance - */ - public static create(properties?: cosmos.base.v1beta1.IDecCoin): cosmos.base.v1beta1.DecCoin; - - /** - * Encodes the specified DecCoin message. Does not implicitly {@link cosmos.base.v1beta1.DecCoin.verify|verify} messages. - * @param m DecCoin message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.base.v1beta1.IDecCoin, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DecCoin message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns DecCoin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.base.v1beta1.DecCoin; - } - - /** Properties of an IntProto. */ - interface IIntProto { - /** IntProto int */ - int?: string | null; - } - - /** Represents an IntProto. */ - class IntProto implements IIntProto { - /** - * Constructs a new IntProto. - * @param [p] Properties to set - */ - constructor(p?: cosmos.base.v1beta1.IIntProto); - - /** IntProto int. */ - public int: string; - - /** - * Creates a new IntProto instance using the specified properties. - * @param [properties] Properties to set - * @returns IntProto instance - */ - public static create(properties?: cosmos.base.v1beta1.IIntProto): cosmos.base.v1beta1.IntProto; - - /** - * Encodes the specified IntProto message. Does not implicitly {@link cosmos.base.v1beta1.IntProto.verify|verify} messages. - * @param m IntProto message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.base.v1beta1.IIntProto, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an IntProto message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns IntProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.base.v1beta1.IntProto; - } - - /** Properties of a DecProto. */ - interface IDecProto { - /** DecProto dec */ - dec?: string | null; - } - - /** Represents a DecProto. */ - class DecProto implements IDecProto { - /** - * Constructs a new DecProto. - * @param [p] Properties to set - */ - constructor(p?: cosmos.base.v1beta1.IDecProto); - - /** DecProto dec. */ - public dec: string; - - /** - * Creates a new DecProto instance using the specified properties. - * @param [properties] Properties to set - * @returns DecProto instance - */ - public static create(properties?: cosmos.base.v1beta1.IDecProto): cosmos.base.v1beta1.DecProto; - - /** - * Encodes the specified DecProto message. Does not implicitly {@link cosmos.base.v1beta1.DecProto.verify|verify} messages. - * @param m DecProto message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.base.v1beta1.IDecProto, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DecProto message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns DecProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.base.v1beta1.DecProto; - } - } - } - - /** Namespace crypto. */ - namespace crypto { - /** Namespace multisig. */ - namespace multisig { - /** Namespace v1beta1. */ - namespace v1beta1 { - /** Properties of a MultiSignature. */ - interface IMultiSignature { - /** MultiSignature signatures */ - signatures?: Uint8Array[] | null; - } - - /** Represents a MultiSignature. */ - class MultiSignature implements IMultiSignature { - /** - * Constructs a new MultiSignature. - * @param [p] Properties to set - */ - constructor(p?: cosmos.crypto.multisig.v1beta1.IMultiSignature); - - /** MultiSignature signatures. */ - public signatures: Uint8Array[]; - - /** - * Creates a new MultiSignature instance using the specified properties. - * @param [properties] Properties to set - * @returns MultiSignature instance - */ - public static create( - properties?: cosmos.crypto.multisig.v1beta1.IMultiSignature, - ): cosmos.crypto.multisig.v1beta1.MultiSignature; - - /** - * Encodes the specified MultiSignature message. Does not implicitly {@link cosmos.crypto.multisig.v1beta1.MultiSignature.verify|verify} messages. - * @param m MultiSignature message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.crypto.multisig.v1beta1.IMultiSignature, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a MultiSignature message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns MultiSignature - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.crypto.multisig.v1beta1.MultiSignature; - } - - /** Properties of a CompactBitArray. */ - interface ICompactBitArray { - /** CompactBitArray extraBitsStored */ - extraBitsStored?: number | null; - - /** CompactBitArray elems */ - elems?: Uint8Array | null; - } - - /** Represents a CompactBitArray. */ - class CompactBitArray implements ICompactBitArray { - /** - * Constructs a new CompactBitArray. - * @param [p] Properties to set - */ - constructor(p?: cosmos.crypto.multisig.v1beta1.ICompactBitArray); - - /** CompactBitArray extraBitsStored. */ - public extraBitsStored: number; - - /** CompactBitArray elems. */ - public elems: Uint8Array; - - /** - * Creates a new CompactBitArray instance using the specified properties. - * @param [properties] Properties to set - * @returns CompactBitArray instance - */ - public static create( - properties?: cosmos.crypto.multisig.v1beta1.ICompactBitArray, - ): cosmos.crypto.multisig.v1beta1.CompactBitArray; - - /** - * Encodes the specified CompactBitArray message. Does not implicitly {@link cosmos.crypto.multisig.v1beta1.CompactBitArray.verify|verify} messages. - * @param m CompactBitArray message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.crypto.multisig.v1beta1.ICompactBitArray, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a CompactBitArray message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns CompactBitArray - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.crypto.multisig.v1beta1.CompactBitArray; - } - } - } - - /** Namespace secp256k1. */ - namespace secp256k1 { - /** Properties of a PubKey. */ - interface IPubKey { - /** PubKey key */ - key?: Uint8Array | null; - } - - /** Represents a PubKey. */ - class PubKey implements IPubKey { - /** - * Constructs a new PubKey. - * @param [p] Properties to set - */ - constructor(p?: cosmos.crypto.secp256k1.IPubKey); - - /** PubKey key. */ - public key: Uint8Array; - - /** - * Creates a new PubKey instance using the specified properties. - * @param [properties] Properties to set - * @returns PubKey instance - */ - public static create(properties?: cosmos.crypto.secp256k1.IPubKey): cosmos.crypto.secp256k1.PubKey; - - /** - * Encodes the specified PubKey message. Does not implicitly {@link cosmos.crypto.secp256k1.PubKey.verify|verify} messages. - * @param m PubKey message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.crypto.secp256k1.IPubKey, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PubKey message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns PubKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.crypto.secp256k1.PubKey; - } - - /** Properties of a PrivKey. */ - interface IPrivKey { - /** PrivKey key */ - key?: Uint8Array | null; - } - - /** Represents a PrivKey. */ - class PrivKey implements IPrivKey { - /** - * Constructs a new PrivKey. - * @param [p] Properties to set - */ - constructor(p?: cosmos.crypto.secp256k1.IPrivKey); - - /** PrivKey key. */ - public key: Uint8Array; - - /** - * Creates a new PrivKey instance using the specified properties. - * @param [properties] Properties to set - * @returns PrivKey instance - */ - public static create(properties?: cosmos.crypto.secp256k1.IPrivKey): cosmos.crypto.secp256k1.PrivKey; - - /** - * Encodes the specified PrivKey message. Does not implicitly {@link cosmos.crypto.secp256k1.PrivKey.verify|verify} messages. - * @param m PrivKey message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.crypto.secp256k1.IPrivKey, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PrivKey message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns PrivKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.crypto.secp256k1.PrivKey; - } - } - } - - /** Namespace tx. */ - namespace tx { - /** Namespace v1beta1. */ - namespace v1beta1 { - /** Properties of a Tx. */ - interface ITx { - /** Tx body */ - body?: cosmos.tx.v1beta1.ITxBody | null; - - /** Tx authInfo */ - authInfo?: cosmos.tx.v1beta1.IAuthInfo | null; - - /** Tx signatures */ - signatures?: Uint8Array[] | null; - } - - /** Represents a Tx. */ - class Tx implements ITx { - /** - * Constructs a new Tx. - * @param [p] Properties to set - */ - constructor(p?: cosmos.tx.v1beta1.ITx); - - /** Tx body. */ - public body?: cosmos.tx.v1beta1.ITxBody | null; - - /** Tx authInfo. */ - public authInfo?: cosmos.tx.v1beta1.IAuthInfo | null; - - /** Tx signatures. */ - public signatures: Uint8Array[]; - - /** - * Creates a new Tx instance using the specified properties. - * @param [properties] Properties to set - * @returns Tx instance - */ - public static create(properties?: cosmos.tx.v1beta1.ITx): cosmos.tx.v1beta1.Tx; - - /** - * Encodes the specified Tx message. Does not implicitly {@link cosmos.tx.v1beta1.Tx.verify|verify} messages. - * @param m Tx message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.tx.v1beta1.ITx, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Tx message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Tx - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.tx.v1beta1.Tx; - } - - /** Properties of a TxRaw. */ - interface ITxRaw { - /** TxRaw bodyBytes */ - bodyBytes?: Uint8Array | null; - - /** TxRaw authInfoBytes */ - authInfoBytes?: Uint8Array | null; - - /** TxRaw signatures */ - signatures?: Uint8Array[] | null; - } - - /** Represents a TxRaw. */ - class TxRaw implements ITxRaw { - /** - * Constructs a new TxRaw. - * @param [p] Properties to set - */ - constructor(p?: cosmos.tx.v1beta1.ITxRaw); - - /** TxRaw bodyBytes. */ - public bodyBytes: Uint8Array; - - /** TxRaw authInfoBytes. */ - public authInfoBytes: Uint8Array; - - /** TxRaw signatures. */ - public signatures: Uint8Array[]; - - /** - * Creates a new TxRaw instance using the specified properties. - * @param [properties] Properties to set - * @returns TxRaw instance - */ - public static create(properties?: cosmos.tx.v1beta1.ITxRaw): cosmos.tx.v1beta1.TxRaw; - - /** - * Encodes the specified TxRaw message. Does not implicitly {@link cosmos.tx.v1beta1.TxRaw.verify|verify} messages. - * @param m TxRaw message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.tx.v1beta1.ITxRaw, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TxRaw message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns TxRaw - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.tx.v1beta1.TxRaw; - } - - /** Properties of a SignDoc. */ - interface ISignDoc { - /** SignDoc bodyBytes */ - bodyBytes?: Uint8Array | null; - - /** SignDoc authInfoBytes */ - authInfoBytes?: Uint8Array | null; - - /** SignDoc chainId */ - chainId?: string | null; - - /** SignDoc accountNumber */ - accountNumber?: Long | null; - } - - /** Represents a SignDoc. */ - class SignDoc implements ISignDoc { - /** - * Constructs a new SignDoc. - * @param [p] Properties to set - */ - constructor(p?: cosmos.tx.v1beta1.ISignDoc); - - /** SignDoc bodyBytes. */ - public bodyBytes: Uint8Array; - - /** SignDoc authInfoBytes. */ - public authInfoBytes: Uint8Array; - - /** SignDoc chainId. */ - public chainId: string; - - /** SignDoc accountNumber. */ - public accountNumber: Long; - - /** - * Creates a new SignDoc instance using the specified properties. - * @param [properties] Properties to set - * @returns SignDoc instance - */ - public static create(properties?: cosmos.tx.v1beta1.ISignDoc): cosmos.tx.v1beta1.SignDoc; - - /** - * Encodes the specified SignDoc message. Does not implicitly {@link cosmos.tx.v1beta1.SignDoc.verify|verify} messages. - * @param m SignDoc message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.tx.v1beta1.ISignDoc, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SignDoc message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns SignDoc - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.tx.v1beta1.SignDoc; - } - - /** Properties of a TxBody. */ - interface ITxBody { - /** TxBody messages */ - messages?: google.protobuf.IAny[] | null; - - /** TxBody memo */ - memo?: string | null; - - /** TxBody timeoutHeight */ - timeoutHeight?: Long | null; - - /** TxBody extensionOptions */ - extensionOptions?: google.protobuf.IAny[] | null; - - /** TxBody nonCriticalExtensionOptions */ - nonCriticalExtensionOptions?: google.protobuf.IAny[] | null; - } - - /** Represents a TxBody. */ - class TxBody implements ITxBody { - /** - * Constructs a new TxBody. - * @param [p] Properties to set - */ - constructor(p?: cosmos.tx.v1beta1.ITxBody); - - /** TxBody messages. */ - public messages: google.protobuf.IAny[]; - - /** TxBody memo. */ - public memo: string; - - /** TxBody timeoutHeight. */ - public timeoutHeight: Long; - - /** TxBody extensionOptions. */ - public extensionOptions: google.protobuf.IAny[]; - - /** TxBody nonCriticalExtensionOptions. */ - public nonCriticalExtensionOptions: google.protobuf.IAny[]; - - /** - * Creates a new TxBody instance using the specified properties. - * @param [properties] Properties to set - * @returns TxBody instance - */ - public static create(properties?: cosmos.tx.v1beta1.ITxBody): cosmos.tx.v1beta1.TxBody; - - /** - * Encodes the specified TxBody message. Does not implicitly {@link cosmos.tx.v1beta1.TxBody.verify|verify} messages. - * @param m TxBody message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.tx.v1beta1.ITxBody, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TxBody message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns TxBody - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.tx.v1beta1.TxBody; - } - - /** Properties of an AuthInfo. */ - interface IAuthInfo { - /** AuthInfo signerInfos */ - signerInfos?: cosmos.tx.v1beta1.ISignerInfo[] | null; - - /** AuthInfo fee */ - fee?: cosmos.tx.v1beta1.IFee | null; - } - - /** Represents an AuthInfo. */ - class AuthInfo implements IAuthInfo { - /** - * Constructs a new AuthInfo. - * @param [p] Properties to set - */ - constructor(p?: cosmos.tx.v1beta1.IAuthInfo); - - /** AuthInfo signerInfos. */ - public signerInfos: cosmos.tx.v1beta1.ISignerInfo[]; - - /** AuthInfo fee. */ - public fee?: cosmos.tx.v1beta1.IFee | null; - - /** - * Creates a new AuthInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns AuthInfo instance - */ - public static create(properties?: cosmos.tx.v1beta1.IAuthInfo): cosmos.tx.v1beta1.AuthInfo; - - /** - * Encodes the specified AuthInfo message. Does not implicitly {@link cosmos.tx.v1beta1.AuthInfo.verify|verify} messages. - * @param m AuthInfo message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.tx.v1beta1.IAuthInfo, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AuthInfo message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns AuthInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.tx.v1beta1.AuthInfo; - } - - /** Properties of a SignerInfo. */ - interface ISignerInfo { - /** SignerInfo publicKey */ - publicKey?: google.protobuf.IAny | null; - - /** SignerInfo modeInfo */ - modeInfo?: cosmos.tx.v1beta1.IModeInfo | null; - - /** SignerInfo sequence */ - sequence?: Long | null; - } - - /** Represents a SignerInfo. */ - class SignerInfo implements ISignerInfo { - /** - * Constructs a new SignerInfo. - * @param [p] Properties to set - */ - constructor(p?: cosmos.tx.v1beta1.ISignerInfo); - - /** SignerInfo publicKey. */ - public publicKey?: google.protobuf.IAny | null; - - /** SignerInfo modeInfo. */ - public modeInfo?: cosmos.tx.v1beta1.IModeInfo | null; - - /** SignerInfo sequence. */ - public sequence: Long; - - /** - * Creates a new SignerInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns SignerInfo instance - */ - public static create(properties?: cosmos.tx.v1beta1.ISignerInfo): cosmos.tx.v1beta1.SignerInfo; - - /** - * Encodes the specified SignerInfo message. Does not implicitly {@link cosmos.tx.v1beta1.SignerInfo.verify|verify} messages. - * @param m SignerInfo message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.tx.v1beta1.ISignerInfo, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SignerInfo message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns SignerInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.tx.v1beta1.SignerInfo; - } - - /** Properties of a ModeInfo. */ - interface IModeInfo { - /** ModeInfo single */ - single?: cosmos.tx.v1beta1.ModeInfo.ISingle | null; - - /** ModeInfo multi */ - multi?: cosmos.tx.v1beta1.ModeInfo.IMulti | null; - } - - /** Represents a ModeInfo. */ - class ModeInfo implements IModeInfo { - /** - * Constructs a new ModeInfo. - * @param [p] Properties to set - */ - constructor(p?: cosmos.tx.v1beta1.IModeInfo); - - /** ModeInfo single. */ - public single?: cosmos.tx.v1beta1.ModeInfo.ISingle | null; - - /** ModeInfo multi. */ - public multi?: cosmos.tx.v1beta1.ModeInfo.IMulti | null; - - /** ModeInfo sum. */ - public sum?: "single" | "multi"; - - /** - * Creates a new ModeInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns ModeInfo instance - */ - public static create(properties?: cosmos.tx.v1beta1.IModeInfo): cosmos.tx.v1beta1.ModeInfo; - - /** - * Encodes the specified ModeInfo message. Does not implicitly {@link cosmos.tx.v1beta1.ModeInfo.verify|verify} messages. - * @param m ModeInfo message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.tx.v1beta1.IModeInfo, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ModeInfo message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns ModeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.tx.v1beta1.ModeInfo; - } - - namespace ModeInfo { - /** Properties of a Single. */ - interface ISingle { - /** Single mode */ - mode?: cosmos.tx.signing.v1beta1.SignMode | null; - } - - /** Represents a Single. */ - class Single implements ISingle { - /** - * Constructs a new Single. - * @param [p] Properties to set - */ - constructor(p?: cosmos.tx.v1beta1.ModeInfo.ISingle); - - /** Single mode. */ - public mode: cosmos.tx.signing.v1beta1.SignMode; - - /** - * Creates a new Single instance using the specified properties. - * @param [properties] Properties to set - * @returns Single instance - */ - public static create( - properties?: cosmos.tx.v1beta1.ModeInfo.ISingle, - ): cosmos.tx.v1beta1.ModeInfo.Single; - - /** - * Encodes the specified Single message. Does not implicitly {@link cosmos.tx.v1beta1.ModeInfo.Single.verify|verify} messages. - * @param m Single message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.tx.v1beta1.ModeInfo.ISingle, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Single message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Single - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.tx.v1beta1.ModeInfo.Single; - } - - /** Properties of a Multi. */ - interface IMulti { - /** Multi bitarray */ - bitarray?: cosmos.crypto.multisig.v1beta1.ICompactBitArray | null; - - /** Multi modeInfos */ - modeInfos?: cosmos.tx.v1beta1.IModeInfo[] | null; - } - - /** Represents a Multi. */ - class Multi implements IMulti { - /** - * Constructs a new Multi. - * @param [p] Properties to set - */ - constructor(p?: cosmos.tx.v1beta1.ModeInfo.IMulti); - - /** Multi bitarray. */ - public bitarray?: cosmos.crypto.multisig.v1beta1.ICompactBitArray | null; - - /** Multi modeInfos. */ - public modeInfos: cosmos.tx.v1beta1.IModeInfo[]; - - /** - * Creates a new Multi instance using the specified properties. - * @param [properties] Properties to set - * @returns Multi instance - */ - public static create( - properties?: cosmos.tx.v1beta1.ModeInfo.IMulti, - ): cosmos.tx.v1beta1.ModeInfo.Multi; - - /** - * Encodes the specified Multi message. Does not implicitly {@link cosmos.tx.v1beta1.ModeInfo.Multi.verify|verify} messages. - * @param m Multi message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.tx.v1beta1.ModeInfo.IMulti, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Multi message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Multi - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.tx.v1beta1.ModeInfo.Multi; - } - } - - /** Properties of a Fee. */ - interface IFee { - /** Fee amount */ - amount?: cosmos.base.v1beta1.ICoin[] | null; - - /** Fee gasLimit */ - gasLimit?: Long | null; - - /** Fee payer */ - payer?: string | null; - - /** Fee granter */ - granter?: string | null; - } - - /** Represents a Fee. */ - class Fee implements IFee { - /** - * Constructs a new Fee. - * @param [p] Properties to set - */ - constructor(p?: cosmos.tx.v1beta1.IFee); - - /** Fee amount. */ - public amount: cosmos.base.v1beta1.ICoin[]; - - /** Fee gasLimit. */ - public gasLimit: Long; - - /** Fee payer. */ - public payer: string; - - /** Fee granter. */ - public granter: string; - - /** - * Creates a new Fee instance using the specified properties. - * @param [properties] Properties to set - * @returns Fee instance - */ - public static create(properties?: cosmos.tx.v1beta1.IFee): cosmos.tx.v1beta1.Fee; - - /** - * Encodes the specified Fee message. Does not implicitly {@link cosmos.tx.v1beta1.Fee.verify|verify} messages. - * @param m Fee message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.tx.v1beta1.IFee, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Fee message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Fee - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.tx.v1beta1.Fee; - } - } - - /** Namespace signing. */ - namespace signing { - /** Namespace v1beta1. */ - namespace v1beta1 { - /** SignMode enum. */ - enum SignMode { - SIGN_MODE_UNSPECIFIED = 0, - SIGN_MODE_DIRECT = 1, - SIGN_MODE_TEXTUAL = 2, - SIGN_MODE_LEGACY_AMINO_JSON = 127, - } - - /** Properties of a SignatureDescriptors. */ - interface ISignatureDescriptors { - /** SignatureDescriptors signatures */ - signatures?: cosmos.tx.signing.v1beta1.ISignatureDescriptor[] | null; - } - - /** Represents a SignatureDescriptors. */ - class SignatureDescriptors implements ISignatureDescriptors { - /** - * Constructs a new SignatureDescriptors. - * @param [p] Properties to set - */ - constructor(p?: cosmos.tx.signing.v1beta1.ISignatureDescriptors); - - /** SignatureDescriptors signatures. */ - public signatures: cosmos.tx.signing.v1beta1.ISignatureDescriptor[]; - - /** - * Creates a new SignatureDescriptors instance using the specified properties. - * @param [properties] Properties to set - * @returns SignatureDescriptors instance - */ - public static create( - properties?: cosmos.tx.signing.v1beta1.ISignatureDescriptors, - ): cosmos.tx.signing.v1beta1.SignatureDescriptors; - - /** - * Encodes the specified SignatureDescriptors message. Does not implicitly {@link cosmos.tx.signing.v1beta1.SignatureDescriptors.verify|verify} messages. - * @param m SignatureDescriptors message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.tx.signing.v1beta1.ISignatureDescriptors, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a SignatureDescriptors message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns SignatureDescriptors - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.tx.signing.v1beta1.SignatureDescriptors; - } - - /** Properties of a SignatureDescriptor. */ - interface ISignatureDescriptor { - /** SignatureDescriptor publicKey */ - publicKey?: google.protobuf.IAny | null; - - /** SignatureDescriptor data */ - data?: cosmos.tx.signing.v1beta1.SignatureDescriptor.IData | null; - - /** SignatureDescriptor sequence */ - sequence?: Long | null; - } - - /** Represents a SignatureDescriptor. */ - class SignatureDescriptor implements ISignatureDescriptor { - /** - * Constructs a new SignatureDescriptor. - * @param [p] Properties to set - */ - constructor(p?: cosmos.tx.signing.v1beta1.ISignatureDescriptor); - - /** SignatureDescriptor publicKey. */ - public publicKey?: google.protobuf.IAny | null; - - /** SignatureDescriptor data. */ - public data?: cosmos.tx.signing.v1beta1.SignatureDescriptor.IData | null; - - /** SignatureDescriptor sequence. */ - public sequence: Long; - - /** - * Creates a new SignatureDescriptor instance using the specified properties. - * @param [properties] Properties to set - * @returns SignatureDescriptor instance - */ - public static create( - properties?: cosmos.tx.signing.v1beta1.ISignatureDescriptor, - ): cosmos.tx.signing.v1beta1.SignatureDescriptor; - - /** - * Encodes the specified SignatureDescriptor message. Does not implicitly {@link cosmos.tx.signing.v1beta1.SignatureDescriptor.verify|verify} messages. - * @param m SignatureDescriptor message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.tx.signing.v1beta1.ISignatureDescriptor, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a SignatureDescriptor message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns SignatureDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.tx.signing.v1beta1.SignatureDescriptor; - } - - namespace SignatureDescriptor { - /** Properties of a Data. */ - interface IData { - /** Data single */ - single?: cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.ISingle | null; - - /** Data multi */ - multi?: cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.IMulti | null; - } - - /** Represents a Data. */ - class Data implements IData { - /** - * Constructs a new Data. - * @param [p] Properties to set - */ - constructor(p?: cosmos.tx.signing.v1beta1.SignatureDescriptor.IData); - - /** Data single. */ - public single?: cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.ISingle | null; - - /** Data multi. */ - public multi?: cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.IMulti | null; - - /** Data sum. */ - public sum?: "single" | "multi"; - - /** - * Creates a new Data instance using the specified properties. - * @param [properties] Properties to set - * @returns Data instance - */ - public static create( - properties?: cosmos.tx.signing.v1beta1.SignatureDescriptor.IData, - ): cosmos.tx.signing.v1beta1.SignatureDescriptor.Data; - - /** - * Encodes the specified Data message. Does not implicitly {@link cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.verify|verify} messages. - * @param m Data message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.tx.signing.v1beta1.SignatureDescriptor.IData, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a Data message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Data - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.tx.signing.v1beta1.SignatureDescriptor.Data; - } - - namespace Data { - /** Properties of a Single. */ - interface ISingle { - /** Single mode */ - mode?: cosmos.tx.signing.v1beta1.SignMode | null; - - /** Single signature */ - signature?: Uint8Array | null; - } - - /** Represents a Single. */ - class Single implements ISingle { - /** - * Constructs a new Single. - * @param [p] Properties to set - */ - constructor(p?: cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.ISingle); - - /** Single mode. */ - public mode: cosmos.tx.signing.v1beta1.SignMode; - - /** Single signature. */ - public signature: Uint8Array; - - /** - * Creates a new Single instance using the specified properties. - * @param [properties] Properties to set - * @returns Single instance - */ - public static create( - properties?: cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.ISingle, - ): cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single; - - /** - * Encodes the specified Single message. Does not implicitly {@link cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single.verify|verify} messages. - * @param m Single message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.ISingle, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a Single message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Single - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single; - } - - /** Properties of a Multi. */ - interface IMulti { - /** Multi bitarray */ - bitarray?: cosmos.crypto.multisig.v1beta1.ICompactBitArray | null; - - /** Multi signatures */ - signatures?: cosmos.tx.signing.v1beta1.SignatureDescriptor.IData[] | null; - } - - /** Represents a Multi. */ - class Multi implements IMulti { - /** - * Constructs a new Multi. - * @param [p] Properties to set - */ - constructor(p?: cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.IMulti); - - /** Multi bitarray. */ - public bitarray?: cosmos.crypto.multisig.v1beta1.ICompactBitArray | null; - - /** Multi signatures. */ - public signatures: cosmos.tx.signing.v1beta1.SignatureDescriptor.IData[]; - - /** - * Creates a new Multi instance using the specified properties. - * @param [properties] Properties to set - * @returns Multi instance - */ - public static create( - properties?: cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.IMulti, - ): cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi; - - /** - * Encodes the specified Multi message. Does not implicitly {@link cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi.verify|verify} messages. - * @param m Multi message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.IMulti, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a Multi message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Multi - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi; - } - } - } - } - } - } -} - -/** Namespace google. */ -export namespace google { - /** Namespace protobuf. */ - namespace protobuf { - /** Properties of an Any. */ - interface IAny { - /** Any type_url */ - type_url?: string | null; - - /** Any value */ - value?: Uint8Array | null; - } - - /** Represents an Any. */ - class Any implements IAny { - /** - * Constructs a new Any. - * @param [p] Properties to set - */ - constructor(p?: google.protobuf.IAny); - - /** Any type_url. */ - public type_url: string; - - /** Any value. */ - public value: Uint8Array; - - /** - * Creates a new Any instance using the specified properties. - * @param [properties] Properties to set - * @returns Any instance - */ - public static create(properties?: google.protobuf.IAny): google.protobuf.Any; - - /** - * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @param m Any message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: google.protobuf.IAny, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Any message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): google.protobuf.Any; - } - } -} - -/** Namespace tendermint. */ -export namespace tendermint { - /** Namespace crypto. */ - namespace crypto { - /** Properties of a PublicKey. */ - interface IPublicKey { - /** PublicKey ed25519 */ - ed25519?: Uint8Array | null; - - /** PublicKey secp256k1 */ - secp256k1?: Uint8Array | null; - } - - /** Represents a PublicKey. */ - class PublicKey implements IPublicKey { - /** - * Constructs a new PublicKey. - * @param [p] Properties to set - */ - constructor(p?: tendermint.crypto.IPublicKey); - - /** PublicKey ed25519. */ - public ed25519: Uint8Array; - - /** PublicKey secp256k1. */ - public secp256k1: Uint8Array; - - /** PublicKey sum. */ - public sum?: "ed25519" | "secp256k1"; - - /** - * Creates a new PublicKey instance using the specified properties. - * @param [properties] Properties to set - * @returns PublicKey instance - */ - public static create(properties?: tendermint.crypto.IPublicKey): tendermint.crypto.PublicKey; - - /** - * Encodes the specified PublicKey message. Does not implicitly {@link tendermint.crypto.PublicKey.verify|verify} messages. - * @param m PublicKey message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: tendermint.crypto.IPublicKey, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PublicKey message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns PublicKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): tendermint.crypto.PublicKey; - } - } -} diff --git a/packages/proto-signing/src/codec/generated/codecimpl.js b/packages/proto-signing/src/codec/generated/codecimpl.js deleted file mode 100644 index 751b07fe..00000000 --- a/packages/proto-signing/src/codec/generated/codecimpl.js +++ /dev/null @@ -1,1717 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.tendermint = exports.google = exports.cosmos = void 0; -var $protobuf = require("protobufjs/minimal"); -const $Reader = $protobuf.Reader, - $Writer = $protobuf.Writer, - $util = $protobuf.util; -const $root = {}; -exports.cosmos = $root.cosmos = (() => { - const cosmos = {}; - cosmos.bank = (function () { - const bank = {}; - bank.v1beta1 = (function () { - const v1beta1 = {}; - v1beta1.Params = (function () { - function Params(p) { - this.sendEnabled = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - Params.prototype.sendEnabled = $util.emptyArray; - Params.prototype.defaultSendEnabled = false; - Params.create = function create(properties) { - return new Params(properties); - }; - Params.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.sendEnabled != null && m.sendEnabled.length) { - for (var i = 0; i < m.sendEnabled.length; ++i) - $root.cosmos.bank.v1beta1.SendEnabled.encode(m.sendEnabled[i], w.uint32(10).fork()).ldelim(); - } - if (m.defaultSendEnabled != null && Object.hasOwnProperty.call(m, "defaultSendEnabled")) - w.uint32(16).bool(m.defaultSendEnabled); - return w; - }; - Params.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.bank.v1beta1.Params(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - if (!(m.sendEnabled && m.sendEnabled.length)) m.sendEnabled = []; - m.sendEnabled.push($root.cosmos.bank.v1beta1.SendEnabled.decode(r, r.uint32())); - break; - case 2: - m.defaultSendEnabled = r.bool(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return Params; - })(); - v1beta1.SendEnabled = (function () { - function SendEnabled(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - SendEnabled.prototype.denom = ""; - SendEnabled.prototype.enabled = false; - SendEnabled.create = function create(properties) { - return new SendEnabled(properties); - }; - SendEnabled.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.denom != null && Object.hasOwnProperty.call(m, "denom")) w.uint32(10).string(m.denom); - if (m.enabled != null && Object.hasOwnProperty.call(m, "enabled")) w.uint32(16).bool(m.enabled); - return w; - }; - SendEnabled.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.bank.v1beta1.SendEnabled(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.denom = r.string(); - break; - case 2: - m.enabled = r.bool(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return SendEnabled; - })(); - v1beta1.Input = (function () { - function Input(p) { - this.coins = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - Input.prototype.address = ""; - Input.prototype.coins = $util.emptyArray; - Input.create = function create(properties) { - return new Input(properties); - }; - Input.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.address != null && Object.hasOwnProperty.call(m, "address")) w.uint32(10).string(m.address); - if (m.coins != null && m.coins.length) { - for (var i = 0; i < m.coins.length; ++i) - $root.cosmos.base.v1beta1.Coin.encode(m.coins[i], w.uint32(18).fork()).ldelim(); - } - return w; - }; - Input.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.bank.v1beta1.Input(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.address = r.string(); - break; - case 2: - if (!(m.coins && m.coins.length)) m.coins = []; - m.coins.push($root.cosmos.base.v1beta1.Coin.decode(r, r.uint32())); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return Input; - })(); - v1beta1.Output = (function () { - function Output(p) { - this.coins = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - Output.prototype.address = ""; - Output.prototype.coins = $util.emptyArray; - Output.create = function create(properties) { - return new Output(properties); - }; - Output.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.address != null && Object.hasOwnProperty.call(m, "address")) w.uint32(10).string(m.address); - if (m.coins != null && m.coins.length) { - for (var i = 0; i < m.coins.length; ++i) - $root.cosmos.base.v1beta1.Coin.encode(m.coins[i], w.uint32(18).fork()).ldelim(); - } - return w; - }; - Output.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.bank.v1beta1.Output(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.address = r.string(); - break; - case 2: - if (!(m.coins && m.coins.length)) m.coins = []; - m.coins.push($root.cosmos.base.v1beta1.Coin.decode(r, r.uint32())); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return Output; - })(); - v1beta1.Supply = (function () { - function Supply(p) { - this.total = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - Supply.prototype.total = $util.emptyArray; - Supply.create = function create(properties) { - return new Supply(properties); - }; - Supply.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.total != null && m.total.length) { - for (var i = 0; i < m.total.length; ++i) - $root.cosmos.base.v1beta1.Coin.encode(m.total[i], w.uint32(10).fork()).ldelim(); - } - return w; - }; - Supply.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.bank.v1beta1.Supply(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - if (!(m.total && m.total.length)) m.total = []; - m.total.push($root.cosmos.base.v1beta1.Coin.decode(r, r.uint32())); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return Supply; - })(); - v1beta1.DenomUnit = (function () { - function DenomUnit(p) { - this.aliases = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - DenomUnit.prototype.denom = ""; - DenomUnit.prototype.exponent = 0; - DenomUnit.prototype.aliases = $util.emptyArray; - DenomUnit.create = function create(properties) { - return new DenomUnit(properties); - }; - DenomUnit.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.denom != null && Object.hasOwnProperty.call(m, "denom")) w.uint32(10).string(m.denom); - if (m.exponent != null && Object.hasOwnProperty.call(m, "exponent")) - w.uint32(16).uint32(m.exponent); - if (m.aliases != null && m.aliases.length) { - for (var i = 0; i < m.aliases.length; ++i) w.uint32(26).string(m.aliases[i]); - } - return w; - }; - DenomUnit.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.bank.v1beta1.DenomUnit(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.denom = r.string(); - break; - case 2: - m.exponent = r.uint32(); - break; - case 3: - if (!(m.aliases && m.aliases.length)) m.aliases = []; - m.aliases.push(r.string()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return DenomUnit; - })(); - v1beta1.Metadata = (function () { - function Metadata(p) { - this.denomUnits = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - Metadata.prototype.description = ""; - Metadata.prototype.denomUnits = $util.emptyArray; - Metadata.prototype.base = ""; - Metadata.prototype.display = ""; - Metadata.create = function create(properties) { - return new Metadata(properties); - }; - Metadata.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.description != null && Object.hasOwnProperty.call(m, "description")) - w.uint32(10).string(m.description); - if (m.denomUnits != null && m.denomUnits.length) { - for (var i = 0; i < m.denomUnits.length; ++i) - $root.cosmos.bank.v1beta1.DenomUnit.encode(m.denomUnits[i], w.uint32(18).fork()).ldelim(); - } - if (m.base != null && Object.hasOwnProperty.call(m, "base")) w.uint32(26).string(m.base); - if (m.display != null && Object.hasOwnProperty.call(m, "display")) w.uint32(34).string(m.display); - return w; - }; - Metadata.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.bank.v1beta1.Metadata(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.description = r.string(); - break; - case 2: - if (!(m.denomUnits && m.denomUnits.length)) m.denomUnits = []; - m.denomUnits.push($root.cosmos.bank.v1beta1.DenomUnit.decode(r, r.uint32())); - break; - case 3: - m.base = r.string(); - break; - case 4: - m.display = r.string(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return Metadata; - })(); - v1beta1.Msg = (function () { - function Msg(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - (Msg.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Msg; - Msg.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - Object.defineProperty( - (Msg.prototype.send = function send(request, callback) { - return this.rpcCall( - send, - $root.cosmos.bank.v1beta1.MsgSend, - $root.cosmos.bank.v1beta1.MsgSendResponse, - request, - callback, - ); - }), - "name", - { value: "Send" }, - ); - Object.defineProperty( - (Msg.prototype.multiSend = function multiSend(request, callback) { - return this.rpcCall( - multiSend, - $root.cosmos.bank.v1beta1.MsgMultiSend, - $root.cosmos.bank.v1beta1.MsgMultiSendResponse, - request, - callback, - ); - }), - "name", - { value: "MultiSend" }, - ); - return Msg; - })(); - v1beta1.MsgSend = (function () { - function MsgSend(p) { - this.amount = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - MsgSend.prototype.fromAddress = ""; - MsgSend.prototype.toAddress = ""; - MsgSend.prototype.amount = $util.emptyArray; - MsgSend.create = function create(properties) { - return new MsgSend(properties); - }; - MsgSend.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.fromAddress != null && Object.hasOwnProperty.call(m, "fromAddress")) - w.uint32(10).string(m.fromAddress); - if (m.toAddress != null && Object.hasOwnProperty.call(m, "toAddress")) - w.uint32(18).string(m.toAddress); - if (m.amount != null && m.amount.length) { - for (var i = 0; i < m.amount.length; ++i) - $root.cosmos.base.v1beta1.Coin.encode(m.amount[i], w.uint32(26).fork()).ldelim(); - } - return w; - }; - MsgSend.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.bank.v1beta1.MsgSend(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.fromAddress = r.string(); - break; - case 2: - m.toAddress = r.string(); - break; - case 3: - if (!(m.amount && m.amount.length)) m.amount = []; - m.amount.push($root.cosmos.base.v1beta1.Coin.decode(r, r.uint32())); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return MsgSend; - })(); - v1beta1.MsgSendResponse = (function () { - function MsgSendResponse(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - MsgSendResponse.create = function create(properties) { - return new MsgSendResponse(properties); - }; - MsgSendResponse.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - return w; - }; - MsgSendResponse.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.bank.v1beta1.MsgSendResponse(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return MsgSendResponse; - })(); - v1beta1.MsgMultiSend = (function () { - function MsgMultiSend(p) { - this.inputs = []; - this.outputs = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - MsgMultiSend.prototype.inputs = $util.emptyArray; - MsgMultiSend.prototype.outputs = $util.emptyArray; - MsgMultiSend.create = function create(properties) { - return new MsgMultiSend(properties); - }; - MsgMultiSend.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.inputs != null && m.inputs.length) { - for (var i = 0; i < m.inputs.length; ++i) - $root.cosmos.bank.v1beta1.Input.encode(m.inputs[i], w.uint32(10).fork()).ldelim(); - } - if (m.outputs != null && m.outputs.length) { - for (var i = 0; i < m.outputs.length; ++i) - $root.cosmos.bank.v1beta1.Output.encode(m.outputs[i], w.uint32(18).fork()).ldelim(); - } - return w; - }; - MsgMultiSend.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.bank.v1beta1.MsgMultiSend(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - if (!(m.inputs && m.inputs.length)) m.inputs = []; - m.inputs.push($root.cosmos.bank.v1beta1.Input.decode(r, r.uint32())); - break; - case 2: - if (!(m.outputs && m.outputs.length)) m.outputs = []; - m.outputs.push($root.cosmos.bank.v1beta1.Output.decode(r, r.uint32())); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return MsgMultiSend; - })(); - v1beta1.MsgMultiSendResponse = (function () { - function MsgMultiSendResponse(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - MsgMultiSendResponse.create = function create(properties) { - return new MsgMultiSendResponse(properties); - }; - MsgMultiSendResponse.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - return w; - }; - MsgMultiSendResponse.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.bank.v1beta1.MsgMultiSendResponse(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return MsgMultiSendResponse; - })(); - return v1beta1; - })(); - return bank; - })(); - cosmos.base = (function () { - const base = {}; - base.v1beta1 = (function () { - const v1beta1 = {}; - v1beta1.Coin = (function () { - function Coin(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - Coin.prototype.denom = ""; - Coin.prototype.amount = ""; - Coin.create = function create(properties) { - return new Coin(properties); - }; - Coin.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.denom != null && Object.hasOwnProperty.call(m, "denom")) w.uint32(10).string(m.denom); - if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) w.uint32(18).string(m.amount); - return w; - }; - Coin.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.base.v1beta1.Coin(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.denom = r.string(); - break; - case 2: - m.amount = r.string(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return Coin; - })(); - v1beta1.DecCoin = (function () { - function DecCoin(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - DecCoin.prototype.denom = ""; - DecCoin.prototype.amount = ""; - DecCoin.create = function create(properties) { - return new DecCoin(properties); - }; - DecCoin.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.denom != null && Object.hasOwnProperty.call(m, "denom")) w.uint32(10).string(m.denom); - if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) w.uint32(18).string(m.amount); - return w; - }; - DecCoin.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.base.v1beta1.DecCoin(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.denom = r.string(); - break; - case 2: - m.amount = r.string(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return DecCoin; - })(); - v1beta1.IntProto = (function () { - function IntProto(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - IntProto.prototype.int = ""; - IntProto.create = function create(properties) { - return new IntProto(properties); - }; - IntProto.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.int != null && Object.hasOwnProperty.call(m, "int")) w.uint32(10).string(m.int); - return w; - }; - IntProto.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.base.v1beta1.IntProto(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.int = r.string(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return IntProto; - })(); - v1beta1.DecProto = (function () { - function DecProto(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - DecProto.prototype.dec = ""; - DecProto.create = function create(properties) { - return new DecProto(properties); - }; - DecProto.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.dec != null && Object.hasOwnProperty.call(m, "dec")) w.uint32(10).string(m.dec); - return w; - }; - DecProto.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.base.v1beta1.DecProto(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.dec = r.string(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return DecProto; - })(); - return v1beta1; - })(); - return base; - })(); - cosmos.crypto = (function () { - const crypto = {}; - crypto.multisig = (function () { - const multisig = {}; - multisig.v1beta1 = (function () { - const v1beta1 = {}; - v1beta1.MultiSignature = (function () { - function MultiSignature(p) { - this.signatures = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - MultiSignature.prototype.signatures = $util.emptyArray; - MultiSignature.create = function create(properties) { - return new MultiSignature(properties); - }; - MultiSignature.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.signatures != null && m.signatures.length) { - for (var i = 0; i < m.signatures.length; ++i) w.uint32(10).bytes(m.signatures[i]); - } - return w; - }; - MultiSignature.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.crypto.multisig.v1beta1.MultiSignature(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - if (!(m.signatures && m.signatures.length)) m.signatures = []; - m.signatures.push(r.bytes()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return MultiSignature; - })(); - v1beta1.CompactBitArray = (function () { - function CompactBitArray(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - CompactBitArray.prototype.extraBitsStored = 0; - CompactBitArray.prototype.elems = $util.newBuffer([]); - CompactBitArray.create = function create(properties) { - return new CompactBitArray(properties); - }; - CompactBitArray.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.extraBitsStored != null && Object.hasOwnProperty.call(m, "extraBitsStored")) - w.uint32(8).uint32(m.extraBitsStored); - if (m.elems != null && Object.hasOwnProperty.call(m, "elems")) w.uint32(18).bytes(m.elems); - return w; - }; - CompactBitArray.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.crypto.multisig.v1beta1.CompactBitArray(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.extraBitsStored = r.uint32(); - break; - case 2: - m.elems = r.bytes(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return CompactBitArray; - })(); - return v1beta1; - })(); - return multisig; - })(); - crypto.secp256k1 = (function () { - const secp256k1 = {}; - secp256k1.PubKey = (function () { - function PubKey(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - PubKey.prototype.key = $util.newBuffer([]); - PubKey.create = function create(properties) { - return new PubKey(properties); - }; - PubKey.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.key != null && Object.hasOwnProperty.call(m, "key")) w.uint32(10).bytes(m.key); - return w; - }; - PubKey.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.crypto.secp256k1.PubKey(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.key = r.bytes(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return PubKey; - })(); - secp256k1.PrivKey = (function () { - function PrivKey(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - PrivKey.prototype.key = $util.newBuffer([]); - PrivKey.create = function create(properties) { - return new PrivKey(properties); - }; - PrivKey.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.key != null && Object.hasOwnProperty.call(m, "key")) w.uint32(10).bytes(m.key); - return w; - }; - PrivKey.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.crypto.secp256k1.PrivKey(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.key = r.bytes(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return PrivKey; - })(); - return secp256k1; - })(); - return crypto; - })(); - cosmos.tx = (function () { - const tx = {}; - tx.v1beta1 = (function () { - const v1beta1 = {}; - v1beta1.Tx = (function () { - function Tx(p) { - this.signatures = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - Tx.prototype.body = null; - Tx.prototype.authInfo = null; - Tx.prototype.signatures = $util.emptyArray; - Tx.create = function create(properties) { - return new Tx(properties); - }; - Tx.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.body != null && Object.hasOwnProperty.call(m, "body")) - $root.cosmos.tx.v1beta1.TxBody.encode(m.body, w.uint32(10).fork()).ldelim(); - if (m.authInfo != null && Object.hasOwnProperty.call(m, "authInfo")) - $root.cosmos.tx.v1beta1.AuthInfo.encode(m.authInfo, w.uint32(18).fork()).ldelim(); - if (m.signatures != null && m.signatures.length) { - for (var i = 0; i < m.signatures.length; ++i) w.uint32(26).bytes(m.signatures[i]); - } - return w; - }; - Tx.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.tx.v1beta1.Tx(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.body = $root.cosmos.tx.v1beta1.TxBody.decode(r, r.uint32()); - break; - case 2: - m.authInfo = $root.cosmos.tx.v1beta1.AuthInfo.decode(r, r.uint32()); - break; - case 3: - if (!(m.signatures && m.signatures.length)) m.signatures = []; - m.signatures.push(r.bytes()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return Tx; - })(); - v1beta1.TxRaw = (function () { - function TxRaw(p) { - this.signatures = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - TxRaw.prototype.bodyBytes = $util.newBuffer([]); - TxRaw.prototype.authInfoBytes = $util.newBuffer([]); - TxRaw.prototype.signatures = $util.emptyArray; - TxRaw.create = function create(properties) { - return new TxRaw(properties); - }; - TxRaw.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.bodyBytes != null && Object.hasOwnProperty.call(m, "bodyBytes")) - w.uint32(10).bytes(m.bodyBytes); - if (m.authInfoBytes != null && Object.hasOwnProperty.call(m, "authInfoBytes")) - w.uint32(18).bytes(m.authInfoBytes); - if (m.signatures != null && m.signatures.length) { - for (var i = 0; i < m.signatures.length; ++i) w.uint32(26).bytes(m.signatures[i]); - } - return w; - }; - TxRaw.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.tx.v1beta1.TxRaw(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.bodyBytes = r.bytes(); - break; - case 2: - m.authInfoBytes = r.bytes(); - break; - case 3: - if (!(m.signatures && m.signatures.length)) m.signatures = []; - m.signatures.push(r.bytes()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return TxRaw; - })(); - v1beta1.SignDoc = (function () { - function SignDoc(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - SignDoc.prototype.bodyBytes = $util.newBuffer([]); - SignDoc.prototype.authInfoBytes = $util.newBuffer([]); - SignDoc.prototype.chainId = ""; - SignDoc.prototype.accountNumber = $util.Long ? $util.Long.fromBits(0, 0, true) : 0; - SignDoc.create = function create(properties) { - return new SignDoc(properties); - }; - SignDoc.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.bodyBytes != null && Object.hasOwnProperty.call(m, "bodyBytes")) - w.uint32(10).bytes(m.bodyBytes); - if (m.authInfoBytes != null && Object.hasOwnProperty.call(m, "authInfoBytes")) - w.uint32(18).bytes(m.authInfoBytes); - if (m.chainId != null && Object.hasOwnProperty.call(m, "chainId")) w.uint32(26).string(m.chainId); - if (m.accountNumber != null && Object.hasOwnProperty.call(m, "accountNumber")) - w.uint32(32).uint64(m.accountNumber); - return w; - }; - SignDoc.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.tx.v1beta1.SignDoc(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.bodyBytes = r.bytes(); - break; - case 2: - m.authInfoBytes = r.bytes(); - break; - case 3: - m.chainId = r.string(); - break; - case 4: - m.accountNumber = r.uint64(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return SignDoc; - })(); - v1beta1.TxBody = (function () { - function TxBody(p) { - this.messages = []; - this.extensionOptions = []; - this.nonCriticalExtensionOptions = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - TxBody.prototype.messages = $util.emptyArray; - TxBody.prototype.memo = ""; - TxBody.prototype.timeoutHeight = $util.Long ? $util.Long.fromBits(0, 0, true) : 0; - TxBody.prototype.extensionOptions = $util.emptyArray; - TxBody.prototype.nonCriticalExtensionOptions = $util.emptyArray; - TxBody.create = function create(properties) { - return new TxBody(properties); - }; - TxBody.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.messages != null && m.messages.length) { - for (var i = 0; i < m.messages.length; ++i) - $root.google.protobuf.Any.encode(m.messages[i], w.uint32(10).fork()).ldelim(); - } - if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) w.uint32(18).string(m.memo); - if (m.timeoutHeight != null && Object.hasOwnProperty.call(m, "timeoutHeight")) - w.uint32(24).uint64(m.timeoutHeight); - if (m.extensionOptions != null && m.extensionOptions.length) { - for (var i = 0; i < m.extensionOptions.length; ++i) - $root.google.protobuf.Any.encode(m.extensionOptions[i], w.uint32(8186).fork()).ldelim(); - } - if (m.nonCriticalExtensionOptions != null && m.nonCriticalExtensionOptions.length) { - for (var i = 0; i < m.nonCriticalExtensionOptions.length; ++i) - $root.google.protobuf.Any.encode( - m.nonCriticalExtensionOptions[i], - w.uint32(16378).fork(), - ).ldelim(); - } - return w; - }; - TxBody.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.tx.v1beta1.TxBody(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - if (!(m.messages && m.messages.length)) m.messages = []; - m.messages.push($root.google.protobuf.Any.decode(r, r.uint32())); - break; - case 2: - m.memo = r.string(); - break; - case 3: - m.timeoutHeight = r.uint64(); - break; - case 1023: - if (!(m.extensionOptions && m.extensionOptions.length)) m.extensionOptions = []; - m.extensionOptions.push($root.google.protobuf.Any.decode(r, r.uint32())); - break; - case 2047: - if (!(m.nonCriticalExtensionOptions && m.nonCriticalExtensionOptions.length)) - m.nonCriticalExtensionOptions = []; - m.nonCriticalExtensionOptions.push($root.google.protobuf.Any.decode(r, r.uint32())); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return TxBody; - })(); - v1beta1.AuthInfo = (function () { - function AuthInfo(p) { - this.signerInfos = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - AuthInfo.prototype.signerInfos = $util.emptyArray; - AuthInfo.prototype.fee = null; - AuthInfo.create = function create(properties) { - return new AuthInfo(properties); - }; - AuthInfo.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.signerInfos != null && m.signerInfos.length) { - for (var i = 0; i < m.signerInfos.length; ++i) - $root.cosmos.tx.v1beta1.SignerInfo.encode(m.signerInfos[i], w.uint32(10).fork()).ldelim(); - } - if (m.fee != null && Object.hasOwnProperty.call(m, "fee")) - $root.cosmos.tx.v1beta1.Fee.encode(m.fee, w.uint32(18).fork()).ldelim(); - return w; - }; - AuthInfo.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.tx.v1beta1.AuthInfo(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - if (!(m.signerInfos && m.signerInfos.length)) m.signerInfos = []; - m.signerInfos.push($root.cosmos.tx.v1beta1.SignerInfo.decode(r, r.uint32())); - break; - case 2: - m.fee = $root.cosmos.tx.v1beta1.Fee.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return AuthInfo; - })(); - v1beta1.SignerInfo = (function () { - function SignerInfo(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - SignerInfo.prototype.publicKey = null; - SignerInfo.prototype.modeInfo = null; - SignerInfo.prototype.sequence = $util.Long ? $util.Long.fromBits(0, 0, true) : 0; - SignerInfo.create = function create(properties) { - return new SignerInfo(properties); - }; - SignerInfo.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.publicKey != null && Object.hasOwnProperty.call(m, "publicKey")) - $root.google.protobuf.Any.encode(m.publicKey, w.uint32(10).fork()).ldelim(); - if (m.modeInfo != null && Object.hasOwnProperty.call(m, "modeInfo")) - $root.cosmos.tx.v1beta1.ModeInfo.encode(m.modeInfo, w.uint32(18).fork()).ldelim(); - if (m.sequence != null && Object.hasOwnProperty.call(m, "sequence")) - w.uint32(24).uint64(m.sequence); - return w; - }; - SignerInfo.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.tx.v1beta1.SignerInfo(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.publicKey = $root.google.protobuf.Any.decode(r, r.uint32()); - break; - case 2: - m.modeInfo = $root.cosmos.tx.v1beta1.ModeInfo.decode(r, r.uint32()); - break; - case 3: - m.sequence = r.uint64(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return SignerInfo; - })(); - v1beta1.ModeInfo = (function () { - function ModeInfo(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - ModeInfo.prototype.single = null; - ModeInfo.prototype.multi = null; - let $oneOfFields; - Object.defineProperty(ModeInfo.prototype, "sum", { - get: $util.oneOfGetter(($oneOfFields = ["single", "multi"])), - set: $util.oneOfSetter($oneOfFields), - }); - ModeInfo.create = function create(properties) { - return new ModeInfo(properties); - }; - ModeInfo.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.single != null && Object.hasOwnProperty.call(m, "single")) - $root.cosmos.tx.v1beta1.ModeInfo.Single.encode(m.single, w.uint32(10).fork()).ldelim(); - if (m.multi != null && Object.hasOwnProperty.call(m, "multi")) - $root.cosmos.tx.v1beta1.ModeInfo.Multi.encode(m.multi, w.uint32(18).fork()).ldelim(); - return w; - }; - ModeInfo.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.tx.v1beta1.ModeInfo(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.single = $root.cosmos.tx.v1beta1.ModeInfo.Single.decode(r, r.uint32()); - break; - case 2: - m.multi = $root.cosmos.tx.v1beta1.ModeInfo.Multi.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - ModeInfo.Single = (function () { - function Single(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - Single.prototype.mode = 0; - Single.create = function create(properties) { - return new Single(properties); - }; - Single.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.mode != null && Object.hasOwnProperty.call(m, "mode")) w.uint32(8).int32(m.mode); - return w; - }; - Single.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.tx.v1beta1.ModeInfo.Single(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.mode = r.int32(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return Single; - })(); - ModeInfo.Multi = (function () { - function Multi(p) { - this.modeInfos = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - Multi.prototype.bitarray = null; - Multi.prototype.modeInfos = $util.emptyArray; - Multi.create = function create(properties) { - return new Multi(properties); - }; - Multi.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.bitarray != null && Object.hasOwnProperty.call(m, "bitarray")) - $root.cosmos.crypto.multisig.v1beta1.CompactBitArray.encode( - m.bitarray, - w.uint32(10).fork(), - ).ldelim(); - if (m.modeInfos != null && m.modeInfos.length) { - for (var i = 0; i < m.modeInfos.length; ++i) - $root.cosmos.tx.v1beta1.ModeInfo.encode(m.modeInfos[i], w.uint32(18).fork()).ldelim(); - } - return w; - }; - Multi.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.tx.v1beta1.ModeInfo.Multi(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.bitarray = $root.cosmos.crypto.multisig.v1beta1.CompactBitArray.decode(r, r.uint32()); - break; - case 2: - if (!(m.modeInfos && m.modeInfos.length)) m.modeInfos = []; - m.modeInfos.push($root.cosmos.tx.v1beta1.ModeInfo.decode(r, r.uint32())); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return Multi; - })(); - return ModeInfo; - })(); - v1beta1.Fee = (function () { - function Fee(p) { - this.amount = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - Fee.prototype.amount = $util.emptyArray; - Fee.prototype.gasLimit = $util.Long ? $util.Long.fromBits(0, 0, true) : 0; - Fee.prototype.payer = ""; - Fee.prototype.granter = ""; - Fee.create = function create(properties) { - return new Fee(properties); - }; - Fee.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.amount != null && m.amount.length) { - for (var i = 0; i < m.amount.length; ++i) - $root.cosmos.base.v1beta1.Coin.encode(m.amount[i], w.uint32(10).fork()).ldelim(); - } - if (m.gasLimit != null && Object.hasOwnProperty.call(m, "gasLimit")) - w.uint32(16).uint64(m.gasLimit); - if (m.payer != null && Object.hasOwnProperty.call(m, "payer")) w.uint32(26).string(m.payer); - if (m.granter != null && Object.hasOwnProperty.call(m, "granter")) w.uint32(34).string(m.granter); - return w; - }; - Fee.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.tx.v1beta1.Fee(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - if (!(m.amount && m.amount.length)) m.amount = []; - m.amount.push($root.cosmos.base.v1beta1.Coin.decode(r, r.uint32())); - break; - case 2: - m.gasLimit = r.uint64(); - break; - case 3: - m.payer = r.string(); - break; - case 4: - m.granter = r.string(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return Fee; - })(); - return v1beta1; - })(); - tx.signing = (function () { - const signing = {}; - signing.v1beta1 = (function () { - const v1beta1 = {}; - v1beta1.SignMode = (function () { - const valuesById = {}, - values = Object.create(valuesById); - values[(valuesById[0] = "SIGN_MODE_UNSPECIFIED")] = 0; - values[(valuesById[1] = "SIGN_MODE_DIRECT")] = 1; - values[(valuesById[2] = "SIGN_MODE_TEXTUAL")] = 2; - values[(valuesById[127] = "SIGN_MODE_LEGACY_AMINO_JSON")] = 127; - return values; - })(); - v1beta1.SignatureDescriptors = (function () { - function SignatureDescriptors(p) { - this.signatures = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - SignatureDescriptors.prototype.signatures = $util.emptyArray; - SignatureDescriptors.create = function create(properties) { - return new SignatureDescriptors(properties); - }; - SignatureDescriptors.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.signatures != null && m.signatures.length) { - for (var i = 0; i < m.signatures.length; ++i) - $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.encode( - m.signatures[i], - w.uint32(10).fork(), - ).ldelim(); - } - return w; - }; - SignatureDescriptors.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.tx.signing.v1beta1.SignatureDescriptors(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - if (!(m.signatures && m.signatures.length)) m.signatures = []; - m.signatures.push( - $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.decode(r, r.uint32()), - ); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return SignatureDescriptors; - })(); - v1beta1.SignatureDescriptor = (function () { - function SignatureDescriptor(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - SignatureDescriptor.prototype.publicKey = null; - SignatureDescriptor.prototype.data = null; - SignatureDescriptor.prototype.sequence = $util.Long ? $util.Long.fromBits(0, 0, true) : 0; - SignatureDescriptor.create = function create(properties) { - return new SignatureDescriptor(properties); - }; - SignatureDescriptor.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.publicKey != null && Object.hasOwnProperty.call(m, "publicKey")) - $root.google.protobuf.Any.encode(m.publicKey, w.uint32(10).fork()).ldelim(); - if (m.data != null && Object.hasOwnProperty.call(m, "data")) - $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.encode( - m.data, - w.uint32(18).fork(), - ).ldelim(); - if (m.sequence != null && Object.hasOwnProperty.call(m, "sequence")) - w.uint32(24).uint64(m.sequence); - return w; - }; - SignatureDescriptor.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.tx.signing.v1beta1.SignatureDescriptor(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.publicKey = $root.google.protobuf.Any.decode(r, r.uint32()); - break; - case 2: - m.data = $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.decode(r, r.uint32()); - break; - case 3: - m.sequence = r.uint64(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - SignatureDescriptor.Data = (function () { - function Data(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - Data.prototype.single = null; - Data.prototype.multi = null; - let $oneOfFields; - Object.defineProperty(Data.prototype, "sum", { - get: $util.oneOfGetter(($oneOfFields = ["single", "multi"])), - set: $util.oneOfSetter($oneOfFields), - }); - Data.create = function create(properties) { - return new Data(properties); - }; - Data.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.single != null && Object.hasOwnProperty.call(m, "single")) - $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single.encode( - m.single, - w.uint32(10).fork(), - ).ldelim(); - if (m.multi != null && Object.hasOwnProperty.call(m, "multi")) - $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi.encode( - m.multi, - w.uint32(18).fork(), - ).ldelim(); - return w; - }; - Data.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.single = $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single.decode( - r, - r.uint32(), - ); - break; - case 2: - m.multi = $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi.decode( - r, - r.uint32(), - ); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - Data.Single = (function () { - function Single(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - Single.prototype.mode = 0; - Single.prototype.signature = $util.newBuffer([]); - Single.create = function create(properties) { - return new Single(properties); - }; - Single.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.mode != null && Object.hasOwnProperty.call(m, "mode")) w.uint32(8).int32(m.mode); - if (m.signature != null && Object.hasOwnProperty.call(m, "signature")) - w.uint32(18).bytes(m.signature); - return w; - }; - Single.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.mode = r.int32(); - break; - case 2: - m.signature = r.bytes(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return Single; - })(); - Data.Multi = (function () { - function Multi(p) { - this.signatures = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - Multi.prototype.bitarray = null; - Multi.prototype.signatures = $util.emptyArray; - Multi.create = function create(properties) { - return new Multi(properties); - }; - Multi.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.bitarray != null && Object.hasOwnProperty.call(m, "bitarray")) - $root.cosmos.crypto.multisig.v1beta1.CompactBitArray.encode( - m.bitarray, - w.uint32(10).fork(), - ).ldelim(); - if (m.signatures != null && m.signatures.length) { - for (var i = 0; i < m.signatures.length; ++i) - $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.encode( - m.signatures[i], - w.uint32(18).fork(), - ).ldelim(); - } - return w; - }; - Multi.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.bitarray = $root.cosmos.crypto.multisig.v1beta1.CompactBitArray.decode(r, r.uint32()); - break; - case 2: - if (!(m.signatures && m.signatures.length)) m.signatures = []; - m.signatures.push( - $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.decode(r, r.uint32()), - ); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return Multi; - })(); - return Data; - })(); - return SignatureDescriptor; - })(); - return v1beta1; - })(); - return signing; - })(); - return tx; - })(); - return cosmos; -})(); -exports.google = $root.google = (() => { - const google = {}; - google.protobuf = (function () { - const protobuf = {}; - protobuf.Any = (function () { - function Any(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - Any.prototype.type_url = ""; - Any.prototype.value = $util.newBuffer([]); - Any.create = function create(properties) { - return new Any(properties); - }; - Any.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.type_url != null && Object.hasOwnProperty.call(m, "type_url")) w.uint32(10).string(m.type_url); - if (m.value != null && Object.hasOwnProperty.call(m, "value")) w.uint32(18).bytes(m.value); - return w; - }; - Any.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.google.protobuf.Any(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.type_url = r.string(); - break; - case 2: - m.value = r.bytes(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return Any; - })(); - return protobuf; - })(); - return google; -})(); -exports.tendermint = $root.tendermint = (() => { - const tendermint = {}; - tendermint.crypto = (function () { - const crypto = {}; - crypto.PublicKey = (function () { - function PublicKey(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) this[ks[i]] = p[ks[i]]; - } - PublicKey.prototype.ed25519 = $util.newBuffer([]); - PublicKey.prototype.secp256k1 = $util.newBuffer([]); - let $oneOfFields; - Object.defineProperty(PublicKey.prototype, "sum", { - get: $util.oneOfGetter(($oneOfFields = ["ed25519", "secp256k1"])), - set: $util.oneOfSetter($oneOfFields), - }); - PublicKey.create = function create(properties) { - return new PublicKey(properties); - }; - PublicKey.encode = function encode(m, w) { - if (!w) w = $Writer.create(); - if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) w.uint32(10).bytes(m.ed25519); - if (m.secp256k1 != null && Object.hasOwnProperty.call(m, "secp256k1")) - w.uint32(18).bytes(m.secp256k1); - return w; - }; - PublicKey.decode = function decode(r, l) { - if (!(r instanceof $Reader)) r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, - m = new $root.tendermint.crypto.PublicKey(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.ed25519 = r.bytes(); - break; - case 2: - m.secp256k1 = r.bytes(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - return PublicKey; - })(); - return crypto; - })(); - return tendermint; -})(); -module.exports = $root; diff --git a/packages/proto-signing/src/codec/gogoproto/gogo.ts b/packages/proto-signing/src/codec/gogoproto/gogo.ts new file mode 100644 index 00000000..ecf800e0 --- /dev/null +++ b/packages/proto-signing/src/codec/gogoproto/gogo.ts @@ -0,0 +1,3 @@ +/* eslint-disable */ + +export const protobufPackage = "gogoproto"; diff --git a/packages/proto-signing/src/codec/google/protobuf/any.ts b/packages/proto-signing/src/codec/google/protobuf/any.ts new file mode 100644 index 00000000..8b24c81b --- /dev/null +++ b/packages/proto-signing/src/codec/google/protobuf/any.ts @@ -0,0 +1,225 @@ +/* eslint-disable */ +import { Writer, Reader } from "protobufjs/minimal"; + +/** + * `Any` contains an arbitrary serialized protocol buffer message along with a + * URL that describes the type of the serialized message. + * + * Protobuf library provides support to pack/unpack Any values in the form + * of utility functions or additional generated methods of the Any type. + * + * Example 1: Pack and unpack a message in C++. + * + * Foo foo = ...; + * Any any; + * any.PackFrom(foo); + * ... + * if (any.UnpackTo(&foo)) { + * ... + * } + * + * Example 2: Pack and unpack a message in Java. + * + * Foo foo = ...; + * Any any = Any.pack(foo); + * ... + * if (any.is(Foo.class)) { + * foo = any.unpack(Foo.class); + * } + * + * Example 3: Pack and unpack a message in Python. + * + * foo = Foo(...) + * any = Any() + * any.Pack(foo) + * ... + * if any.Is(Foo.DESCRIPTOR): + * any.Unpack(foo) + * ... + * + * Example 4: Pack and unpack a message in Go + * + * foo := &pb.Foo{...} + * any, err := ptypes.MarshalAny(foo) + * ... + * foo := &pb.Foo{} + * if err := ptypes.UnmarshalAny(any, foo); err != nil { + * ... + * } + * + * The pack methods provided by protobuf library will by default use + * 'type.googleapis.com/full.type.name' as the type URL and the unpack + * methods only use the fully qualified type name after the last '/' + * in the type URL, for example "foo.bar.com/x/y.z" will yield type + * name "y.z". + * + * + * JSON + * ==== + * The JSON representation of an `Any` value uses the regular + * representation of the deserialized, embedded message, with an + * additional field `@type` which contains the type URL. Example: + * + * package google.profile; + * message Person { + * string first_name = 1; + * string last_name = 2; + * } + * + * { + * "@type": "type.googleapis.com/google.profile.Person", + * "firstName": , + * "lastName": + * } + * + * If the embedded message type is well-known and has a custom JSON + * representation, that representation will be embedded adding a field + * `value` which holds the custom JSON in addition to the `@type` + * field. Example (for message [google.protobuf.Duration][]): + * + * { + * "@type": "type.googleapis.com/google.protobuf.Duration", + * "value": "1.212s" + * } + * + */ +export interface Any { + /** + * A URL/resource name that uniquely identifies the type of the serialized + * protocol buffer message. This string must contain at least + * one "/" character. The last segment of the URL's path must represent + * the fully qualified name of the type (as in + * `path/google.protobuf.Duration`). The name should be in a canonical form + * (e.g., leading "." is not accepted). + * + * In practice, teams usually precompile into the binary all types that they + * expect it to use in the context of Any. However, for URLs which use the + * scheme `http`, `https`, or no scheme, one can optionally set up a type + * server that maps type URLs to message definitions as follows: + * + * * If no scheme is provided, `https` is assumed. + * * An HTTP GET on the URL must yield a [google.protobuf.Type][] + * value in binary format, or produce an error. + * * Applications are allowed to cache lookup results based on the + * URL, or have them precompiled into a binary to avoid any + * lookup. Therefore, binary compatibility needs to be preserved + * on changes to types. (Use versioned type names to manage + * breaking changes.) + * + * Note: this functionality is not currently available in the official + * protobuf release, and it is not used for type URLs beginning with + * type.googleapis.com. + * + * Schemes other than `http`, `https` (or the empty scheme) might be + * used with implementation specific semantics. + * + */ + typeUrl: string; + /** + * Must be a valid serialized protocol buffer of the above specified type. + */ + value: Uint8Array; +} + +const baseAny: object = { + typeUrl: "", +}; + +export const protobufPackage = "google.protobuf"; + +export const Any = { + encode(message: Any, writer: Writer = Writer.create()): Writer { + writer.uint32(10).string(message.typeUrl); + writer.uint32(18).bytes(message.value); + return writer; + }, + decode(input: Uint8Array | Reader, length?: number): Any { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseAny } as Any; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.typeUrl = reader.string(); + break; + case 2: + message.value = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Any { + const message = { ...baseAny } as Any; + if (object.typeUrl !== undefined && object.typeUrl !== null) { + message.typeUrl = String(object.typeUrl); + } else { + message.typeUrl = ""; + } + if (object.value !== undefined && object.value !== null) { + message.value = bytesFromBase64(object.value); + } + return message; + }, + fromPartial(object: DeepPartial): Any { + const message = { ...baseAny } as Any; + if (object.typeUrl !== undefined && object.typeUrl !== null) { + message.typeUrl = object.typeUrl; + } else { + message.typeUrl = ""; + } + if (object.value !== undefined && object.value !== null) { + message.value = object.value; + } else { + message.value = new Uint8Array(); + } + return message; + }, + toJSON(message: Any): unknown { + const obj: any = {}; + message.typeUrl !== undefined && (obj.typeUrl = message.typeUrl); + message.value !== undefined && + (obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array())); + return obj; + }, +}; + +interface WindowBase64 { + atob(b64: string): string; + btoa(bin: string): string; +} + +const windowBase64 = (globalThis as unknown) as WindowBase64; +const atob = windowBase64.atob || ((b64: string) => Buffer.from(b64, "base64").toString("binary")); +const btoa = windowBase64.btoa || ((bin: string) => Buffer.from(bin, "binary").toString("base64")); + +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/packages/proto-signing/src/codec/google/protobuf/descriptor.ts b/packages/proto-signing/src/codec/google/protobuf/descriptor.ts new file mode 100644 index 00000000..0ff4add2 --- /dev/null +++ b/packages/proto-signing/src/codec/google/protobuf/descriptor.ts @@ -0,0 +1,4559 @@ +/* eslint-disable */ +import * as Long from "long"; +import { Writer, Reader } from "protobufjs/minimal"; + +/** + * The protocol compiler can output a FileDescriptorSet containing the .proto + * files it parses. + */ +export interface FileDescriptorSet { + file: FileDescriptorProto[]; +} + +/** + * Describes a complete .proto file. + */ +export interface FileDescriptorProto { + /** + * file name, relative to root of source tree + */ + name: string; + /** + * e.g. "foo", "foo.bar", etc. + */ + package: string; + /** + * Names of files imported by this file. + */ + dependency: string[]; + /** + * Indexes of the public imported files in the dependency list above. + */ + publicDependency: number[]; + /** + * Indexes of the weak imported files in the dependency list. + * For Google-internal migration only. Do not use. + */ + weakDependency: number[]; + /** + * All top-level definitions in this file. + */ + messageType: DescriptorProto[]; + enumType: EnumDescriptorProto[]; + service: ServiceDescriptorProto[]; + extension: FieldDescriptorProto[]; + options?: FileOptions; + /** + * This field contains optional information about the original source code. + * You may safely remove this entire field without harming runtime + * functionality of the descriptors -- the information is needed only by + * development tools. + */ + sourceCodeInfo?: SourceCodeInfo; + /** + * The syntax of the proto file. + * The supported values are "proto2" and "proto3". + */ + syntax: string; +} + +/** + * Describes a message type. + */ +export interface DescriptorProto { + name: string; + field: FieldDescriptorProto[]; + extension: FieldDescriptorProto[]; + nestedType: DescriptorProto[]; + enumType: EnumDescriptorProto[]; + extensionRange: DescriptorProto_ExtensionRange[]; + oneofDecl: OneofDescriptorProto[]; + options?: MessageOptions; + reservedRange: DescriptorProto_ReservedRange[]; + /** + * Reserved field names, which may not be used by fields in the same message. + * A given name may only be reserved once. + */ + reservedName: string[]; +} + +export interface DescriptorProto_ExtensionRange { + /** + * Inclusive. + */ + start: number; + /** + * Exclusive. + */ + end: number; + options?: ExtensionRangeOptions; +} + +/** + * Range of reserved tag numbers. Reserved tag numbers may not be used by + * fields or extension ranges in the same message. Reserved ranges may + * not overlap. + */ +export interface DescriptorProto_ReservedRange { + /** + * Inclusive. + */ + start: number; + /** + * Exclusive. + */ + end: number; +} + +export interface ExtensionRangeOptions { + /** + * The parser stores options it doesn't recognize here. See above. + */ + uninterpretedOption: UninterpretedOption[]; +} + +/** + * Describes a field within a message. + */ +export interface FieldDescriptorProto { + name: string; + number: number; + label: FieldDescriptorProto_Label; + /** + * If type_name is set, this need not be set. If both this and type_name + * are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. + */ + type: FieldDescriptorProto_Type; + /** + * For message and enum types, this is the name of the type. If the name + * starts with a '.', it is fully-qualified. Otherwise, C++-like scoping + * rules are used to find the type (i.e. first the nested types within this + * message are searched, then within the parent, on up to the root + * namespace). + */ + typeName: string; + /** + * For extensions, this is the name of the type being extended. It is + * resolved in the same manner as type_name. + */ + extendee: string; + /** + * For numeric types, contains the original text representation of the value. + * For booleans, "true" or "false". + * For strings, contains the default text contents (not escaped in any way). + * For bytes, contains the C escaped value. All bytes >= 128 are escaped. + * TODO(kenton): Base-64 encode? + */ + defaultValue: string; + /** + * If set, gives the index of a oneof in the containing type's oneof_decl + * list. This field is a member of that oneof. + */ + oneofIndex: number; + /** + * JSON name of this field. The value is set by protocol compiler. If the + * user has set a "json_name" option on this field, that option's value + * will be used. Otherwise, it's deduced from the field's name by converting + * it to camelCase. + */ + jsonName: string; + options?: FieldOptions; + /** + * If true, this is a proto3 "optional". When a proto3 field is optional, it + * tracks presence regardless of field type. + * + * When proto3_optional is true, this field must be belong to a oneof to + * signal to old proto3 clients that presence is tracked for this field. This + * oneof is known as a "synthetic" oneof, and this field must be its sole + * member (each proto3 optional field gets its own synthetic oneof). Synthetic + * oneofs exist in the descriptor only, and do not generate any API. Synthetic + * oneofs must be ordered after all "real" oneofs. + * + * For message fields, proto3_optional doesn't create any semantic change, + * since non-repeated message fields always track presence. However it still + * indicates the semantic detail of whether the user wrote "optional" or not. + * This can be useful for round-tripping the .proto file. For consistency we + * give message fields a synthetic oneof also, even though it is not required + * to track presence. This is especially important because the parser can't + * tell if a field is a message or an enum, so it must always create a + * synthetic oneof. + * + * Proto2 optional fields do not set this flag, because they already indicate + * optional with `LABEL_OPTIONAL`. + */ + proto3Optional: boolean; +} + +/** + * Describes a oneof. + */ +export interface OneofDescriptorProto { + name: string; + options?: OneofOptions; +} + +/** + * Describes an enum type. + */ +export interface EnumDescriptorProto { + name: string; + value: EnumValueDescriptorProto[]; + options?: EnumOptions; + /** + * Range of reserved numeric values. Reserved numeric values may not be used + * by enum values in the same enum declaration. Reserved ranges may not + * overlap. + */ + reservedRange: EnumDescriptorProto_EnumReservedRange[]; + /** + * Reserved enum value names, which may not be reused. A given name may only + * be reserved once. + */ + reservedName: string[]; +} + +/** + * Range of reserved numeric values. Reserved values may not be used by + * entries in the same enum. Reserved ranges may not overlap. + * + * Note that this is distinct from DescriptorProto.ReservedRange in that it + * is inclusive such that it can appropriately represent the entire int32 + * domain. + */ +export interface EnumDescriptorProto_EnumReservedRange { + /** + * Inclusive. + */ + start: number; + /** + * Inclusive. + */ + end: number; +} + +/** + * Describes a value within an enum. + */ +export interface EnumValueDescriptorProto { + name: string; + number: number; + options?: EnumValueOptions; +} + +/** + * Describes a service. + */ +export interface ServiceDescriptorProto { + name: string; + method: MethodDescriptorProto[]; + options?: ServiceOptions; +} + +/** + * Describes a method of a service. + */ +export interface MethodDescriptorProto { + name: string; + /** + * Input and output type names. These are resolved in the same way as + * FieldDescriptorProto.type_name, but must refer to a message type. + */ + inputType: string; + outputType: string; + options?: MethodOptions; + /** + * Identifies if client streams multiple client messages + */ + clientStreaming: boolean; + /** + * Identifies if server streams multiple server messages + */ + serverStreaming: boolean; +} + +export interface FileOptions { + /** + * Sets the Java package where classes generated from this .proto will be + * placed. By default, the proto package is used, but this is often + * inappropriate because proto packages do not normally start with backwards + * domain names. + */ + javaPackage: string; + /** + * If set, all the classes from the .proto file are wrapped in a single + * outer class with the given name. This applies to both Proto1 + * (equivalent to the old "--one_java_file" option) and Proto2 (where + * a .proto always translates to a single class, but you may want to + * explicitly choose the class name). + */ + javaOuterClassname: string; + /** + * If set true, then the Java code generator will generate a separate .java + * file for each top-level message, enum, and service defined in the .proto + * file. Thus, these types will *not* be nested inside the outer class + * named by java_outer_classname. However, the outer class will still be + * generated to contain the file's getDescriptor() method as well as any + * top-level extensions defined in the file. + */ + javaMultipleFiles: boolean; + /** + * This option does nothing. + */ + javaGenerateEqualsAndHash: boolean; + /** + * If set true, then the Java2 code generator will generate code that + * throws an exception whenever an attempt is made to assign a non-UTF-8 + * byte sequence to a string field. + * Message reflection will do the same. + * However, an extension field still accepts non-UTF-8 byte sequences. + * This option has no effect on when used with the lite runtime. + */ + javaStringCheckUtf8: boolean; + optimizeFor: FileOptions_OptimizeMode; + /** + * Sets the Go package where structs generated from this .proto will be + * placed. If omitted, the Go package will be derived from the following: + * - The basename of the package import path, if provided. + * - Otherwise, the package statement in the .proto file, if present. + * - Otherwise, the basename of the .proto file, without extension. + */ + goPackage: string; + /** + * Should generic services be generated in each language? "Generic" services + * are not specific to any particular RPC system. They are generated by the + * main code generators in each language (without additional plugins). + * Generic services were the only kind of service generation supported by + * early versions of google.protobuf. + * + * Generic services are now considered deprecated in favor of using plugins + * that generate code specific to your particular RPC system. Therefore, + * these default to false. Old code which depends on generic services should + * explicitly set them to true. + */ + ccGenericServices: boolean; + javaGenericServices: boolean; + pyGenericServices: boolean; + phpGenericServices: boolean; + /** + * Is this file deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for everything in the file, or it will be completely ignored; in the very + * least, this is a formalization for deprecating files. + */ + deprecated: boolean; + /** + * Enables the use of arenas for the proto messages in this file. This applies + * only to generated classes for C++. + */ + ccEnableArenas: boolean; + /** + * Sets the objective c class prefix which is prepended to all objective c + * generated classes from this .proto. There is no default. + */ + objcClassPrefix: string; + /** + * Namespace for generated classes; defaults to the package. + */ + csharpNamespace: string; + /** + * By default Swift generators will take the proto package and CamelCase it + * replacing '.' with underscore and use that to prefix the types/symbols + * defined. When this options is provided, they will use this value instead + * to prefix the types/symbols defined. + */ + swiftPrefix: string; + /** + * Sets the php class prefix which is prepended to all php generated classes + * from this .proto. Default is empty. + */ + phpClassPrefix: string; + /** + * Use this option to change the namespace of php generated classes. Default + * is empty. When this option is empty, the package name will be used for + * determining the namespace. + */ + phpNamespace: string; + /** + * Use this option to change the namespace of php generated metadata classes. + * Default is empty. When this option is empty, the proto file name will be + * used for determining the namespace. + */ + phpMetadataNamespace: string; + /** + * Use this option to change the package of ruby generated classes. Default + * is empty. When this option is not set, the package name will be used for + * determining the ruby package. + */ + rubyPackage: string; + /** + * The parser stores options it doesn't recognize here. + * See the documentation for the "Options" section above. + */ + uninterpretedOption: UninterpretedOption[]; +} + +export interface MessageOptions { + /** + * Set true to use the old proto1 MessageSet wire format for extensions. + * This is provided for backwards-compatibility with the MessageSet wire + * format. You should not use this for any other reason: It's less + * efficient, has fewer features, and is more complicated. + * + * The message must be defined exactly as follows: + * message Foo { + * option message_set_wire_format = true; + * extensions 4 to max; + * } + * Note that the message cannot have any defined fields; MessageSets only + * have extensions. + * + * All extensions of your type must be singular messages; e.g. they cannot + * be int32s, enums, or repeated messages. + * + * Because this is an option, the above two restrictions are not enforced by + * the protocol compiler. + */ + messageSetWireFormat: boolean; + /** + * Disables the generation of the standard "descriptor()" accessor, which can + * conflict with a field of the same name. This is meant to make migration + * from proto1 easier; new code should avoid fields named "descriptor". + */ + noStandardDescriptorAccessor: boolean; + /** + * Is this message deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the message, or it will be completely ignored; in the very least, + * this is a formalization for deprecating messages. + */ + deprecated: boolean; + /** + * Whether the message is an automatically generated map entry type for the + * maps field. + * + * For maps fields: + * map map_field = 1; + * The parsed descriptor looks like: + * message MapFieldEntry { + * option map_entry = true; + * optional KeyType key = 1; + * optional ValueType value = 2; + * } + * repeated MapFieldEntry map_field = 1; + * + * Implementations may choose not to generate the map_entry=true message, but + * use a native map in the target language to hold the keys and values. + * The reflection APIs in such implementations still need to work as + * if the field is a repeated message field. + * + * NOTE: Do not set the option in .proto files. Always use the maps syntax + * instead. The option should only be implicitly set by the proto compiler + * parser. + */ + mapEntry: boolean; + /** + * The parser stores options it doesn't recognize here. See above. + */ + uninterpretedOption: UninterpretedOption[]; +} + +export interface FieldOptions { + /** + * The ctype option instructs the C++ code generator to use a different + * representation of the field than it normally would. See the specific + * options below. This option is not yet implemented in the open source + * release -- sorry, we'll try to include it in a future version! + */ + ctype: FieldOptions_CType; + /** + * The packed option can be enabled for repeated primitive fields to enable + * a more efficient representation on the wire. Rather than repeatedly + * writing the tag and type for each element, the entire array is encoded as + * a single length-delimited blob. In proto3, only explicit setting it to + * false will avoid using packed encoding. + */ + packed: boolean; + /** + * The jstype option determines the JavaScript type used for values of the + * field. The option is permitted only for 64 bit integral and fixed types + * (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING + * is represented as JavaScript string, which avoids loss of precision that + * can happen when a large value is converted to a floating point JavaScript. + * Specifying JS_NUMBER for the jstype causes the generated JavaScript code to + * use the JavaScript "number" type. The behavior of the default option + * JS_NORMAL is implementation dependent. + * + * This option is an enum to permit additional types to be added, e.g. + * goog.math.Integer. + */ + jstype: FieldOptions_JSType; + /** + * Should this field be parsed lazily? Lazy applies only to message-type + * fields. It means that when the outer message is initially parsed, the + * inner message's contents will not be parsed but instead stored in encoded + * form. The inner message will actually be parsed when it is first accessed. + * + * This is only a hint. Implementations are free to choose whether to use + * eager or lazy parsing regardless of the value of this option. However, + * setting this option true suggests that the protocol author believes that + * using lazy parsing on this field is worth the additional bookkeeping + * overhead typically needed to implement it. + * + * This option does not affect the public interface of any generated code; + * all method signatures remain the same. Furthermore, thread-safety of the + * interface is not affected by this option; const methods remain safe to + * call from multiple threads concurrently, while non-const methods continue + * to require exclusive access. + * + * + * Note that implementations may choose not to check required fields within + * a lazy sub-message. That is, calling IsInitialized() on the outer message + * may return true even if the inner message has missing required fields. + * This is necessary because otherwise the inner message would have to be + * parsed in order to perform the check, defeating the purpose of lazy + * parsing. An implementation which chooses not to check required fields + * must be consistent about it. That is, for any particular sub-message, the + * implementation must either *always* check its required fields, or *never* + * check its required fields, regardless of whether or not the message has + * been parsed. + */ + lazy: boolean; + /** + * Is this field deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for accessors, or it will be completely ignored; in the very least, this + * is a formalization for deprecating fields. + */ + deprecated: boolean; + /** + * For Google-internal migration only. Do not use. + */ + weak: boolean; + /** + * The parser stores options it doesn't recognize here. See above. + */ + uninterpretedOption: UninterpretedOption[]; +} + +export interface OneofOptions { + /** + * The parser stores options it doesn't recognize here. See above. + */ + uninterpretedOption: UninterpretedOption[]; +} + +export interface EnumOptions { + /** + * Set this option to true to allow mapping different tag names to the same + * value. + */ + allowAlias: boolean; + /** + * Is this enum deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the enum, or it will be completely ignored; in the very least, this + * is a formalization for deprecating enums. + */ + deprecated: boolean; + /** + * The parser stores options it doesn't recognize here. See above. + */ + uninterpretedOption: UninterpretedOption[]; +} + +export interface EnumValueOptions { + /** + * Is this enum value deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the enum value, or it will be completely ignored; in the very least, + * this is a formalization for deprecating enum values. + */ + deprecated: boolean; + /** + * The parser stores options it doesn't recognize here. See above. + */ + uninterpretedOption: UninterpretedOption[]; +} + +export interface ServiceOptions { + /** + * Is this service deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the service, or it will be completely ignored; in the very least, + * this is a formalization for deprecating services. + */ + deprecated: boolean; + /** + * The parser stores options it doesn't recognize here. See above. + */ + uninterpretedOption: UninterpretedOption[]; +} + +export interface MethodOptions { + /** + * Is this method deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the method, or it will be completely ignored; in the very least, + * this is a formalization for deprecating methods. + */ + deprecated: boolean; + idempotencyLevel: MethodOptions_IdempotencyLevel; + /** + * The parser stores options it doesn't recognize here. See above. + */ + uninterpretedOption: UninterpretedOption[]; +} + +/** + * A message representing a option the parser does not recognize. This only + * appears in options protos created by the compiler::Parser class. + * DescriptorPool resolves these when building Descriptor objects. Therefore, + * options protos in descriptor objects (e.g. returned by Descriptor::options(), + * or produced by Descriptor::CopyTo()) will never have UninterpretedOptions + * in them. + */ +export interface UninterpretedOption { + name: UninterpretedOption_NamePart[]; + /** + * The value of the uninterpreted option, in whatever type the tokenizer + * identified it as during parsing. Exactly one of these should be set. + */ + identifierValue: string; + positiveIntValue: Long; + negativeIntValue: Long; + doubleValue: number; + stringValue: Uint8Array; + aggregateValue: string; +} + +/** + * The name of the uninterpreted option. Each string represents a segment in + * a dot-separated name. is_extension is true iff a segment represents an + * extension (denoted with parentheses in options specs in .proto files). + * E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents + * "foo.(bar.baz).qux". + */ +export interface UninterpretedOption_NamePart { + namePart: string; + isExtension: boolean; +} + +/** + * Encapsulates information about the original source file from which a + * FileDescriptorProto was generated. + */ +export interface SourceCodeInfo { + /** + * A Location identifies a piece of source code in a .proto file which + * corresponds to a particular definition. This information is intended + * to be useful to IDEs, code indexers, documentation generators, and similar + * tools. + * + * For example, say we have a file like: + * message Foo { + * optional string foo = 1; + * } + * Let's look at just the field definition: + * optional string foo = 1; + * ^ ^^ ^^ ^ ^^^ + * a bc de f ghi + * We have the following locations: + * span path represents + * [a,i) [ 4, 0, 2, 0 ] The whole field definition. + * [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). + * [c,d) [ 4, 0, 2, 0, 5 ] The type (string). + * [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). + * [g,h) [ 4, 0, 2, 0, 3 ] The number (1). + * + * Notes: + * - A location may refer to a repeated field itself (i.e. not to any + * particular index within it). This is used whenever a set of elements are + * logically enclosed in a single code segment. For example, an entire + * extend block (possibly containing multiple extension definitions) will + * have an outer location whose path refers to the "extensions" repeated + * field without an index. + * - Multiple locations may have the same path. This happens when a single + * logical declaration is spread out across multiple places. The most + * obvious example is the "extend" block again -- there may be multiple + * extend blocks in the same scope, each of which will have the same path. + * - A location's span is not always a subset of its parent's span. For + * example, the "extendee" of an extension declaration appears at the + * beginning of the "extend" block and is shared by all extensions within + * the block. + * - Just because a location's span is a subset of some other location's span + * does not mean that it is a descendant. For example, a "group" defines + * both a type and a field in a single declaration. Thus, the locations + * corresponding to the type and field and their components will overlap. + * - Code which tries to interpret locations should probably be designed to + * ignore those that it doesn't understand, as more types of locations could + * be recorded in the future. + */ + location: SourceCodeInfo_Location[]; +} + +export interface SourceCodeInfo_Location { + /** + * Identifies which part of the FileDescriptorProto was defined at this + * location. + * + * Each element is a field number or an index. They form a path from + * the root FileDescriptorProto to the place where the definition. For + * example, this path: + * [ 4, 3, 2, 7, 1 ] + * refers to: + * file.message_type(3) // 4, 3 + * .field(7) // 2, 7 + * .name() // 1 + * This is because FileDescriptorProto.message_type has field number 4: + * repeated DescriptorProto message_type = 4; + * and DescriptorProto.field has field number 2: + * repeated FieldDescriptorProto field = 2; + * and FieldDescriptorProto.name has field number 1: + * optional string name = 1; + * + * Thus, the above path gives the location of a field name. If we removed + * the last element: + * [ 4, 3, 2, 7 ] + * this path refers to the whole field declaration (from the beginning + * of the label to the terminating semicolon). + */ + path: number[]; + /** + * Always has exactly three or four elements: start line, start column, + * end line (optional, otherwise assumed same as start line), end column. + * These are packed into a single field for efficiency. Note that line + * and column numbers are zero-based -- typically you will want to add + * 1 to each before displaying to a user. + */ + span: number[]; + /** + * If this SourceCodeInfo represents a complete declaration, these are any + * comments appearing before and after the declaration which appear to be + * attached to the declaration. + * + * A series of line comments appearing on consecutive lines, with no other + * tokens appearing on those lines, will be treated as a single comment. + * + * leading_detached_comments will keep paragraphs of comments that appear + * before (but not connected to) the current element. Each paragraph, + * separated by empty lines, will be one comment element in the repeated + * field. + * + * Only the comment content is provided; comment markers (e.g. //) are + * stripped out. For block comments, leading whitespace and an asterisk + * will be stripped from the beginning of each line other than the first. + * Newlines are included in the output. + * + * Examples: + * + * optional int32 foo = 1; // Comment attached to foo. + * // Comment attached to bar. + * optional int32 bar = 2; + * + * optional string baz = 3; + * // Comment attached to baz. + * // Another line attached to baz. + * + * // Comment attached to qux. + * // + * // Another line attached to qux. + * optional double qux = 4; + * + * // Detached comment for corge. This is not leading or trailing comments + * // to qux or corge because there are blank lines separating it from + * // both. + * + * // Detached comment for corge paragraph 2. + * + * optional string corge = 5; + * /* Block comment attached + * * to corge. Leading asterisks + * * will be removed. * / + * /* Block comment attached to + * * grault. * / + * optional int32 grault = 6; + * + * // ignored detached comments. + */ + leadingComments: string; + trailingComments: string; + leadingDetachedComments: string[]; +} + +/** + * Describes the relationship between generated code and its original source + * file. A GeneratedCodeInfo message is associated with only one generated + * source file, but may contain references to different source .proto files. + */ +export interface GeneratedCodeInfo { + /** + * An Annotation connects some span of text in generated code to an element + * of its generating .proto file. + */ + annotation: GeneratedCodeInfo_Annotation[]; +} + +export interface GeneratedCodeInfo_Annotation { + /** + * Identifies the element in the original source .proto file. This field + * is formatted the same as SourceCodeInfo.Location.path. + */ + path: number[]; + /** + * Identifies the filesystem path to the original source .proto. + */ + sourceFile: string; + /** + * Identifies the starting offset in bytes in the generated code + * that relates to the identified object. + */ + begin: number; + /** + * Identifies the ending offset in bytes in the generated code that + * relates to the identified offset. The end offset should be one past + * the last relevant byte (so the length of the text = end - begin). + */ + end: number; +} + +const baseFileDescriptorSet: object = {}; + +const baseFileDescriptorProto: object = { + name: "", + package: "", + dependency: "", + publicDependency: 0, + weakDependency: 0, + syntax: "", +}; + +const baseDescriptorProto: object = { + name: "", + reservedName: "", +}; + +const baseDescriptorProto_ExtensionRange: object = { + start: 0, + end: 0, +}; + +const baseDescriptorProto_ReservedRange: object = { + start: 0, + end: 0, +}; + +const baseExtensionRangeOptions: object = {}; + +const baseFieldDescriptorProto: object = { + name: "", + number: 0, + label: 1, + type: 1, + typeName: "", + extendee: "", + defaultValue: "", + oneofIndex: 0, + jsonName: "", + proto3Optional: false, +}; + +const baseOneofDescriptorProto: object = { + name: "", +}; + +const baseEnumDescriptorProto: object = { + name: "", + reservedName: "", +}; + +const baseEnumDescriptorProto_EnumReservedRange: object = { + start: 0, + end: 0, +}; + +const baseEnumValueDescriptorProto: object = { + name: "", + number: 0, +}; + +const baseServiceDescriptorProto: object = { + name: "", +}; + +const baseMethodDescriptorProto: object = { + name: "", + inputType: "", + outputType: "", + clientStreaming: false, + serverStreaming: false, +}; + +const baseFileOptions: object = { + javaPackage: "", + javaOuterClassname: "", + javaMultipleFiles: false, + javaGenerateEqualsAndHash: false, + javaStringCheckUtf8: false, + optimizeFor: 1, + goPackage: "", + ccGenericServices: false, + javaGenericServices: false, + pyGenericServices: false, + phpGenericServices: false, + deprecated: false, + ccEnableArenas: false, + objcClassPrefix: "", + csharpNamespace: "", + swiftPrefix: "", + phpClassPrefix: "", + phpNamespace: "", + phpMetadataNamespace: "", + rubyPackage: "", +}; + +const baseMessageOptions: object = { + messageSetWireFormat: false, + noStandardDescriptorAccessor: false, + deprecated: false, + mapEntry: false, +}; + +const baseFieldOptions: object = { + ctype: 0, + packed: false, + jstype: 0, + lazy: false, + deprecated: false, + weak: false, +}; + +const baseOneofOptions: object = {}; + +const baseEnumOptions: object = { + allowAlias: false, + deprecated: false, +}; + +const baseEnumValueOptions: object = { + deprecated: false, +}; + +const baseServiceOptions: object = { + deprecated: false, +}; + +const baseMethodOptions: object = { + deprecated: false, + idempotencyLevel: 0, +}; + +const baseUninterpretedOption: object = { + identifierValue: "", + positiveIntValue: Long.UZERO, + negativeIntValue: Long.ZERO, + doubleValue: 0, + aggregateValue: "", +}; + +const baseUninterpretedOption_NamePart: object = { + namePart: "", + isExtension: false, +}; + +const baseSourceCodeInfo: object = {}; + +const baseSourceCodeInfo_Location: object = { + path: 0, + span: 0, + leadingComments: "", + trailingComments: "", + leadingDetachedComments: "", +}; + +const baseGeneratedCodeInfo: object = {}; + +const baseGeneratedCodeInfo_Annotation: object = { + path: 0, + sourceFile: "", + begin: 0, + end: 0, +}; + +export const protobufPackage = "google.protobuf"; + +export enum FieldDescriptorProto_Type { + /** TYPE_DOUBLE - 0 is reserved for errors. + Order is weird for historical reasons. + */ + TYPE_DOUBLE = 1, + TYPE_FLOAT = 2, + /** TYPE_INT64 - Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if + negative values are likely. + */ + TYPE_INT64 = 3, + TYPE_UINT64 = 4, + /** TYPE_INT32 - Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if + negative values are likely. + */ + TYPE_INT32 = 5, + TYPE_FIXED64 = 6, + TYPE_FIXED32 = 7, + TYPE_BOOL = 8, + TYPE_STRING = 9, + /** TYPE_GROUP - Tag-delimited aggregate. + Group type is deprecated and not supported in proto3. However, Proto3 + implementations should still be able to parse the group wire format and + treat group fields as unknown fields. + */ + TYPE_GROUP = 10, + /** TYPE_MESSAGE - Length-delimited aggregate. + */ + TYPE_MESSAGE = 11, + /** TYPE_BYTES - New in version 2. + */ + TYPE_BYTES = 12, + TYPE_UINT32 = 13, + TYPE_ENUM = 14, + TYPE_SFIXED32 = 15, + TYPE_SFIXED64 = 16, + /** TYPE_SINT32 - Uses ZigZag encoding. + */ + TYPE_SINT32 = 17, + /** TYPE_SINT64 - Uses ZigZag encoding. + */ + TYPE_SINT64 = 18, + UNRECOGNIZED = -1, +} + +export function fieldDescriptorProto_TypeFromJSON(object: any): FieldDescriptorProto_Type { + switch (object) { + case 1: + case "TYPE_DOUBLE": + return FieldDescriptorProto_Type.TYPE_DOUBLE; + case 2: + case "TYPE_FLOAT": + return FieldDescriptorProto_Type.TYPE_FLOAT; + case 3: + case "TYPE_INT64": + return FieldDescriptorProto_Type.TYPE_INT64; + case 4: + case "TYPE_UINT64": + return FieldDescriptorProto_Type.TYPE_UINT64; + case 5: + case "TYPE_INT32": + return FieldDescriptorProto_Type.TYPE_INT32; + case 6: + case "TYPE_FIXED64": + return FieldDescriptorProto_Type.TYPE_FIXED64; + case 7: + case "TYPE_FIXED32": + return FieldDescriptorProto_Type.TYPE_FIXED32; + case 8: + case "TYPE_BOOL": + return FieldDescriptorProto_Type.TYPE_BOOL; + case 9: + case "TYPE_STRING": + return FieldDescriptorProto_Type.TYPE_STRING; + case 10: + case "TYPE_GROUP": + return FieldDescriptorProto_Type.TYPE_GROUP; + case 11: + case "TYPE_MESSAGE": + return FieldDescriptorProto_Type.TYPE_MESSAGE; + case 12: + case "TYPE_BYTES": + return FieldDescriptorProto_Type.TYPE_BYTES; + case 13: + case "TYPE_UINT32": + return FieldDescriptorProto_Type.TYPE_UINT32; + case 14: + case "TYPE_ENUM": + return FieldDescriptorProto_Type.TYPE_ENUM; + case 15: + case "TYPE_SFIXED32": + return FieldDescriptorProto_Type.TYPE_SFIXED32; + case 16: + case "TYPE_SFIXED64": + return FieldDescriptorProto_Type.TYPE_SFIXED64; + case 17: + case "TYPE_SINT32": + return FieldDescriptorProto_Type.TYPE_SINT32; + case 18: + case "TYPE_SINT64": + return FieldDescriptorProto_Type.TYPE_SINT64; + case -1: + case "UNRECOGNIZED": + default: + return FieldDescriptorProto_Type.UNRECOGNIZED; + } +} + +export function fieldDescriptorProto_TypeToJSON(object: FieldDescriptorProto_Type): string { + switch (object) { + case FieldDescriptorProto_Type.TYPE_DOUBLE: + return "TYPE_DOUBLE"; + case FieldDescriptorProto_Type.TYPE_FLOAT: + return "TYPE_FLOAT"; + case FieldDescriptorProto_Type.TYPE_INT64: + return "TYPE_INT64"; + case FieldDescriptorProto_Type.TYPE_UINT64: + return "TYPE_UINT64"; + case FieldDescriptorProto_Type.TYPE_INT32: + return "TYPE_INT32"; + case FieldDescriptorProto_Type.TYPE_FIXED64: + return "TYPE_FIXED64"; + case FieldDescriptorProto_Type.TYPE_FIXED32: + return "TYPE_FIXED32"; + case FieldDescriptorProto_Type.TYPE_BOOL: + return "TYPE_BOOL"; + case FieldDescriptorProto_Type.TYPE_STRING: + return "TYPE_STRING"; + case FieldDescriptorProto_Type.TYPE_GROUP: + return "TYPE_GROUP"; + case FieldDescriptorProto_Type.TYPE_MESSAGE: + return "TYPE_MESSAGE"; + case FieldDescriptorProto_Type.TYPE_BYTES: + return "TYPE_BYTES"; + case FieldDescriptorProto_Type.TYPE_UINT32: + return "TYPE_UINT32"; + case FieldDescriptorProto_Type.TYPE_ENUM: + return "TYPE_ENUM"; + case FieldDescriptorProto_Type.TYPE_SFIXED32: + return "TYPE_SFIXED32"; + case FieldDescriptorProto_Type.TYPE_SFIXED64: + return "TYPE_SFIXED64"; + case FieldDescriptorProto_Type.TYPE_SINT32: + return "TYPE_SINT32"; + case FieldDescriptorProto_Type.TYPE_SINT64: + return "TYPE_SINT64"; + default: + return "UNKNOWN"; + } +} + +export enum FieldDescriptorProto_Label { + /** LABEL_OPTIONAL - 0 is reserved for errors + */ + LABEL_OPTIONAL = 1, + LABEL_REQUIRED = 2, + LABEL_REPEATED = 3, + UNRECOGNIZED = -1, +} + +export function fieldDescriptorProto_LabelFromJSON(object: any): FieldDescriptorProto_Label { + switch (object) { + case 1: + case "LABEL_OPTIONAL": + return FieldDescriptorProto_Label.LABEL_OPTIONAL; + case 2: + case "LABEL_REQUIRED": + return FieldDescriptorProto_Label.LABEL_REQUIRED; + case 3: + case "LABEL_REPEATED": + return FieldDescriptorProto_Label.LABEL_REPEATED; + case -1: + case "UNRECOGNIZED": + default: + return FieldDescriptorProto_Label.UNRECOGNIZED; + } +} + +export function fieldDescriptorProto_LabelToJSON(object: FieldDescriptorProto_Label): string { + switch (object) { + case FieldDescriptorProto_Label.LABEL_OPTIONAL: + return "LABEL_OPTIONAL"; + case FieldDescriptorProto_Label.LABEL_REQUIRED: + return "LABEL_REQUIRED"; + case FieldDescriptorProto_Label.LABEL_REPEATED: + return "LABEL_REPEATED"; + default: + return "UNKNOWN"; + } +} + +/** Generated classes can be optimized for speed or code size. + */ +export enum FileOptions_OptimizeMode { + /** SPEED - Generate complete code for parsing, serialization, + */ + SPEED = 1, + /** CODE_SIZE - etc. + */ + CODE_SIZE = 2, + /** LITE_RUNTIME - Generate code using MessageLite and the lite runtime. + */ + LITE_RUNTIME = 3, + UNRECOGNIZED = -1, +} + +export function fileOptions_OptimizeModeFromJSON(object: any): FileOptions_OptimizeMode { + switch (object) { + case 1: + case "SPEED": + return FileOptions_OptimizeMode.SPEED; + case 2: + case "CODE_SIZE": + return FileOptions_OptimizeMode.CODE_SIZE; + case 3: + case "LITE_RUNTIME": + return FileOptions_OptimizeMode.LITE_RUNTIME; + case -1: + case "UNRECOGNIZED": + default: + return FileOptions_OptimizeMode.UNRECOGNIZED; + } +} + +export function fileOptions_OptimizeModeToJSON(object: FileOptions_OptimizeMode): string { + switch (object) { + case FileOptions_OptimizeMode.SPEED: + return "SPEED"; + case FileOptions_OptimizeMode.CODE_SIZE: + return "CODE_SIZE"; + case FileOptions_OptimizeMode.LITE_RUNTIME: + return "LITE_RUNTIME"; + default: + return "UNKNOWN"; + } +} + +export enum FieldOptions_CType { + /** STRING - Default mode. + */ + STRING = 0, + CORD = 1, + STRING_PIECE = 2, + UNRECOGNIZED = -1, +} + +export function fieldOptions_CTypeFromJSON(object: any): FieldOptions_CType { + switch (object) { + case 0: + case "STRING": + return FieldOptions_CType.STRING; + case 1: + case "CORD": + return FieldOptions_CType.CORD; + case 2: + case "STRING_PIECE": + return FieldOptions_CType.STRING_PIECE; + case -1: + case "UNRECOGNIZED": + default: + return FieldOptions_CType.UNRECOGNIZED; + } +} + +export function fieldOptions_CTypeToJSON(object: FieldOptions_CType): string { + switch (object) { + case FieldOptions_CType.STRING: + return "STRING"; + case FieldOptions_CType.CORD: + return "CORD"; + case FieldOptions_CType.STRING_PIECE: + return "STRING_PIECE"; + default: + return "UNKNOWN"; + } +} + +export enum FieldOptions_JSType { + /** JS_NORMAL - Use the default type. + */ + JS_NORMAL = 0, + /** JS_STRING - Use JavaScript strings. + */ + JS_STRING = 1, + /** JS_NUMBER - Use JavaScript numbers. + */ + JS_NUMBER = 2, + UNRECOGNIZED = -1, +} + +export function fieldOptions_JSTypeFromJSON(object: any): FieldOptions_JSType { + switch (object) { + case 0: + case "JS_NORMAL": + return FieldOptions_JSType.JS_NORMAL; + case 1: + case "JS_STRING": + return FieldOptions_JSType.JS_STRING; + case 2: + case "JS_NUMBER": + return FieldOptions_JSType.JS_NUMBER; + case -1: + case "UNRECOGNIZED": + default: + return FieldOptions_JSType.UNRECOGNIZED; + } +} + +export function fieldOptions_JSTypeToJSON(object: FieldOptions_JSType): string { + switch (object) { + case FieldOptions_JSType.JS_NORMAL: + return "JS_NORMAL"; + case FieldOptions_JSType.JS_STRING: + return "JS_STRING"; + case FieldOptions_JSType.JS_NUMBER: + return "JS_NUMBER"; + default: + return "UNKNOWN"; + } +} + +/** Is this method side-effect-free (or safe in HTTP parlance), or idempotent, + or neither? HTTP based RPC implementation may choose GET verb for safe + methods, and PUT verb for idempotent methods instead of the default POST. + */ +export enum MethodOptions_IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + /** NO_SIDE_EFFECTS - implies idempotent + */ + NO_SIDE_EFFECTS = 1, + /** IDEMPOTENT - idempotent, but may have side effects + */ + IDEMPOTENT = 2, + UNRECOGNIZED = -1, +} + +export function methodOptions_IdempotencyLevelFromJSON(object: any): MethodOptions_IdempotencyLevel { + switch (object) { + case 0: + case "IDEMPOTENCY_UNKNOWN": + return MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN; + case 1: + case "NO_SIDE_EFFECTS": + return MethodOptions_IdempotencyLevel.NO_SIDE_EFFECTS; + case 2: + case "IDEMPOTENT": + return MethodOptions_IdempotencyLevel.IDEMPOTENT; + case -1: + case "UNRECOGNIZED": + default: + return MethodOptions_IdempotencyLevel.UNRECOGNIZED; + } +} + +export function methodOptions_IdempotencyLevelToJSON(object: MethodOptions_IdempotencyLevel): string { + switch (object) { + case MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN: + return "IDEMPOTENCY_UNKNOWN"; + case MethodOptions_IdempotencyLevel.NO_SIDE_EFFECTS: + return "NO_SIDE_EFFECTS"; + case MethodOptions_IdempotencyLevel.IDEMPOTENT: + return "IDEMPOTENT"; + default: + return "UNKNOWN"; + } +} + +export const FileDescriptorSet = { + encode(message: FileDescriptorSet, writer: Writer = Writer.create()): Writer { + for (const v of message.file) { + FileDescriptorProto.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, length?: number): FileDescriptorSet { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseFileDescriptorSet } as FileDescriptorSet; + message.file = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.file.push(FileDescriptorProto.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): FileDescriptorSet { + const message = { ...baseFileDescriptorSet } as FileDescriptorSet; + message.file = []; + if (object.file !== undefined && object.file !== null) { + for (const e of object.file) { + message.file.push(FileDescriptorProto.fromJSON(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): FileDescriptorSet { + const message = { ...baseFileDescriptorSet } as FileDescriptorSet; + message.file = []; + if (object.file !== undefined && object.file !== null) { + for (const e of object.file) { + message.file.push(FileDescriptorProto.fromPartial(e)); + } + } + return message; + }, + toJSON(message: FileDescriptorSet): unknown { + const obj: any = {}; + if (message.file) { + obj.file = message.file.map((e) => (e ? FileDescriptorProto.toJSON(e) : undefined)); + } else { + obj.file = []; + } + return obj; + }, +}; + +export const FileDescriptorProto = { + encode(message: FileDescriptorProto, writer: Writer = Writer.create()): Writer { + writer.uint32(10).string(message.name); + writer.uint32(18).string(message.package); + for (const v of message.dependency) { + writer.uint32(26).string(v!); + } + writer.uint32(82).fork(); + for (const v of message.publicDependency) { + writer.int32(v); + } + writer.ldelim(); + writer.uint32(90).fork(); + for (const v of message.weakDependency) { + writer.int32(v); + } + writer.ldelim(); + for (const v of message.messageType) { + DescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); + } + for (const v of message.enumType) { + EnumDescriptorProto.encode(v!, writer.uint32(42).fork()).ldelim(); + } + for (const v of message.service) { + ServiceDescriptorProto.encode(v!, writer.uint32(50).fork()).ldelim(); + } + for (const v of message.extension) { + FieldDescriptorProto.encode(v!, writer.uint32(58).fork()).ldelim(); + } + if (message.options !== undefined && message.options !== undefined) { + FileOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); + } + if (message.sourceCodeInfo !== undefined && message.sourceCodeInfo !== undefined) { + SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(74).fork()).ldelim(); + } + writer.uint32(98).string(message.syntax); + return writer; + }, + decode(input: Uint8Array | Reader, length?: number): FileDescriptorProto { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseFileDescriptorProto } as FileDescriptorProto; + message.dependency = []; + message.publicDependency = []; + message.weakDependency = []; + message.messageType = []; + message.enumType = []; + message.service = []; + message.extension = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.package = reader.string(); + break; + case 3: + message.dependency.push(reader.string()); + break; + case 10: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.publicDependency.push(reader.int32()); + } + } else { + message.publicDependency.push(reader.int32()); + } + break; + case 11: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.weakDependency.push(reader.int32()); + } + } else { + message.weakDependency.push(reader.int32()); + } + break; + case 4: + message.messageType.push(DescriptorProto.decode(reader, reader.uint32())); + break; + case 5: + message.enumType.push(EnumDescriptorProto.decode(reader, reader.uint32())); + break; + case 6: + message.service.push(ServiceDescriptorProto.decode(reader, reader.uint32())); + break; + case 7: + message.extension.push(FieldDescriptorProto.decode(reader, reader.uint32())); + break; + case 8: + message.options = FileOptions.decode(reader, reader.uint32()); + break; + case 9: + message.sourceCodeInfo = SourceCodeInfo.decode(reader, reader.uint32()); + break; + case 12: + message.syntax = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): FileDescriptorProto { + const message = { ...baseFileDescriptorProto } as FileDescriptorProto; + message.dependency = []; + message.publicDependency = []; + message.weakDependency = []; + message.messageType = []; + message.enumType = []; + message.service = []; + message.extension = []; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.package !== undefined && object.package !== null) { + message.package = String(object.package); + } else { + message.package = ""; + } + if (object.dependency !== undefined && object.dependency !== null) { + for (const e of object.dependency) { + message.dependency.push(String(e)); + } + } + if (object.publicDependency !== undefined && object.publicDependency !== null) { + for (const e of object.publicDependency) { + message.publicDependency.push(Number(e)); + } + } + if (object.weakDependency !== undefined && object.weakDependency !== null) { + for (const e of object.weakDependency) { + message.weakDependency.push(Number(e)); + } + } + if (object.messageType !== undefined && object.messageType !== null) { + for (const e of object.messageType) { + message.messageType.push(DescriptorProto.fromJSON(e)); + } + } + if (object.enumType !== undefined && object.enumType !== null) { + for (const e of object.enumType) { + message.enumType.push(EnumDescriptorProto.fromJSON(e)); + } + } + if (object.service !== undefined && object.service !== null) { + for (const e of object.service) { + message.service.push(ServiceDescriptorProto.fromJSON(e)); + } + } + if (object.extension !== undefined && object.extension !== null) { + for (const e of object.extension) { + message.extension.push(FieldDescriptorProto.fromJSON(e)); + } + } + if (object.options !== undefined && object.options !== null) { + message.options = FileOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + if (object.sourceCodeInfo !== undefined && object.sourceCodeInfo !== null) { + message.sourceCodeInfo = SourceCodeInfo.fromJSON(object.sourceCodeInfo); + } else { + message.sourceCodeInfo = undefined; + } + if (object.syntax !== undefined && object.syntax !== null) { + message.syntax = String(object.syntax); + } else { + message.syntax = ""; + } + return message; + }, + fromPartial(object: DeepPartial): FileDescriptorProto { + const message = { ...baseFileDescriptorProto } as FileDescriptorProto; + message.dependency = []; + message.publicDependency = []; + message.weakDependency = []; + message.messageType = []; + message.enumType = []; + message.service = []; + message.extension = []; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.package !== undefined && object.package !== null) { + message.package = object.package; + } else { + message.package = ""; + } + if (object.dependency !== undefined && object.dependency !== null) { + for (const e of object.dependency) { + message.dependency.push(e); + } + } + if (object.publicDependency !== undefined && object.publicDependency !== null) { + for (const e of object.publicDependency) { + message.publicDependency.push(e); + } + } + if (object.weakDependency !== undefined && object.weakDependency !== null) { + for (const e of object.weakDependency) { + message.weakDependency.push(e); + } + } + if (object.messageType !== undefined && object.messageType !== null) { + for (const e of object.messageType) { + message.messageType.push(DescriptorProto.fromPartial(e)); + } + } + if (object.enumType !== undefined && object.enumType !== null) { + for (const e of object.enumType) { + message.enumType.push(EnumDescriptorProto.fromPartial(e)); + } + } + if (object.service !== undefined && object.service !== null) { + for (const e of object.service) { + message.service.push(ServiceDescriptorProto.fromPartial(e)); + } + } + if (object.extension !== undefined && object.extension !== null) { + for (const e of object.extension) { + message.extension.push(FieldDescriptorProto.fromPartial(e)); + } + } + if (object.options !== undefined && object.options !== null) { + message.options = FileOptions.fromPartial(object.options); + } else { + message.options = undefined; + } + if (object.sourceCodeInfo !== undefined && object.sourceCodeInfo !== null) { + message.sourceCodeInfo = SourceCodeInfo.fromPartial(object.sourceCodeInfo); + } else { + message.sourceCodeInfo = undefined; + } + if (object.syntax !== undefined && object.syntax !== null) { + message.syntax = object.syntax; + } else { + message.syntax = ""; + } + return message; + }, + toJSON(message: FileDescriptorProto): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.package !== undefined && (obj.package = message.package); + if (message.dependency) { + obj.dependency = message.dependency.map((e) => e); + } else { + obj.dependency = []; + } + if (message.publicDependency) { + obj.publicDependency = message.publicDependency.map((e) => e); + } else { + obj.publicDependency = []; + } + if (message.weakDependency) { + obj.weakDependency = message.weakDependency.map((e) => e); + } else { + obj.weakDependency = []; + } + if (message.messageType) { + obj.messageType = message.messageType.map((e) => (e ? DescriptorProto.toJSON(e) : undefined)); + } else { + obj.messageType = []; + } + if (message.enumType) { + obj.enumType = message.enumType.map((e) => (e ? EnumDescriptorProto.toJSON(e) : undefined)); + } else { + obj.enumType = []; + } + if (message.service) { + obj.service = message.service.map((e) => (e ? ServiceDescriptorProto.toJSON(e) : undefined)); + } else { + obj.service = []; + } + if (message.extension) { + obj.extension = message.extension.map((e) => (e ? FieldDescriptorProto.toJSON(e) : undefined)); + } else { + obj.extension = []; + } + message.options !== undefined && + (obj.options = message.options ? FileOptions.toJSON(message.options) : undefined); + message.sourceCodeInfo !== undefined && + (obj.sourceCodeInfo = message.sourceCodeInfo + ? SourceCodeInfo.toJSON(message.sourceCodeInfo) + : undefined); + message.syntax !== undefined && (obj.syntax = message.syntax); + return obj; + }, +}; + +export const DescriptorProto = { + encode(message: DescriptorProto, writer: Writer = Writer.create()): Writer { + writer.uint32(10).string(message.name); + for (const v of message.field) { + FieldDescriptorProto.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.extension) { + FieldDescriptorProto.encode(v!, writer.uint32(50).fork()).ldelim(); + } + for (const v of message.nestedType) { + DescriptorProto.encode(v!, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.enumType) { + EnumDescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); + } + for (const v of message.extensionRange) { + DescriptorProto_ExtensionRange.encode(v!, writer.uint32(42).fork()).ldelim(); + } + for (const v of message.oneofDecl) { + OneofDescriptorProto.encode(v!, writer.uint32(66).fork()).ldelim(); + } + if (message.options !== undefined && message.options !== undefined) { + MessageOptions.encode(message.options, writer.uint32(58).fork()).ldelim(); + } + for (const v of message.reservedRange) { + DescriptorProto_ReservedRange.encode(v!, writer.uint32(74).fork()).ldelim(); + } + for (const v of message.reservedName) { + writer.uint32(82).string(v!); + } + return writer; + }, + decode(input: Uint8Array | Reader, length?: number): DescriptorProto { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDescriptorProto } as DescriptorProto; + message.field = []; + message.extension = []; + message.nestedType = []; + message.enumType = []; + message.extensionRange = []; + message.oneofDecl = []; + message.reservedRange = []; + message.reservedName = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.field.push(FieldDescriptorProto.decode(reader, reader.uint32())); + break; + case 6: + message.extension.push(FieldDescriptorProto.decode(reader, reader.uint32())); + break; + case 3: + message.nestedType.push(DescriptorProto.decode(reader, reader.uint32())); + break; + case 4: + message.enumType.push(EnumDescriptorProto.decode(reader, reader.uint32())); + break; + case 5: + message.extensionRange.push(DescriptorProto_ExtensionRange.decode(reader, reader.uint32())); + break; + case 8: + message.oneofDecl.push(OneofDescriptorProto.decode(reader, reader.uint32())); + break; + case 7: + message.options = MessageOptions.decode(reader, reader.uint32()); + break; + case 9: + message.reservedRange.push(DescriptorProto_ReservedRange.decode(reader, reader.uint32())); + break; + case 10: + message.reservedName.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): DescriptorProto { + const message = { ...baseDescriptorProto } as DescriptorProto; + message.field = []; + message.extension = []; + message.nestedType = []; + message.enumType = []; + message.extensionRange = []; + message.oneofDecl = []; + message.reservedRange = []; + message.reservedName = []; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.field !== undefined && object.field !== null) { + for (const e of object.field) { + message.field.push(FieldDescriptorProto.fromJSON(e)); + } + } + if (object.extension !== undefined && object.extension !== null) { + for (const e of object.extension) { + message.extension.push(FieldDescriptorProto.fromJSON(e)); + } + } + if (object.nestedType !== undefined && object.nestedType !== null) { + for (const e of object.nestedType) { + message.nestedType.push(DescriptorProto.fromJSON(e)); + } + } + if (object.enumType !== undefined && object.enumType !== null) { + for (const e of object.enumType) { + message.enumType.push(EnumDescriptorProto.fromJSON(e)); + } + } + if (object.extensionRange !== undefined && object.extensionRange !== null) { + for (const e of object.extensionRange) { + message.extensionRange.push(DescriptorProto_ExtensionRange.fromJSON(e)); + } + } + if (object.oneofDecl !== undefined && object.oneofDecl !== null) { + for (const e of object.oneofDecl) { + message.oneofDecl.push(OneofDescriptorProto.fromJSON(e)); + } + } + if (object.options !== undefined && object.options !== null) { + message.options = MessageOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + if (object.reservedRange !== undefined && object.reservedRange !== null) { + for (const e of object.reservedRange) { + message.reservedRange.push(DescriptorProto_ReservedRange.fromJSON(e)); + } + } + if (object.reservedName !== undefined && object.reservedName !== null) { + for (const e of object.reservedName) { + message.reservedName.push(String(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): DescriptorProto { + const message = { ...baseDescriptorProto } as DescriptorProto; + message.field = []; + message.extension = []; + message.nestedType = []; + message.enumType = []; + message.extensionRange = []; + message.oneofDecl = []; + message.reservedRange = []; + message.reservedName = []; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.field !== undefined && object.field !== null) { + for (const e of object.field) { + message.field.push(FieldDescriptorProto.fromPartial(e)); + } + } + if (object.extension !== undefined && object.extension !== null) { + for (const e of object.extension) { + message.extension.push(FieldDescriptorProto.fromPartial(e)); + } + } + if (object.nestedType !== undefined && object.nestedType !== null) { + for (const e of object.nestedType) { + message.nestedType.push(DescriptorProto.fromPartial(e)); + } + } + if (object.enumType !== undefined && object.enumType !== null) { + for (const e of object.enumType) { + message.enumType.push(EnumDescriptorProto.fromPartial(e)); + } + } + if (object.extensionRange !== undefined && object.extensionRange !== null) { + for (const e of object.extensionRange) { + message.extensionRange.push(DescriptorProto_ExtensionRange.fromPartial(e)); + } + } + if (object.oneofDecl !== undefined && object.oneofDecl !== null) { + for (const e of object.oneofDecl) { + message.oneofDecl.push(OneofDescriptorProto.fromPartial(e)); + } + } + if (object.options !== undefined && object.options !== null) { + message.options = MessageOptions.fromPartial(object.options); + } else { + message.options = undefined; + } + if (object.reservedRange !== undefined && object.reservedRange !== null) { + for (const e of object.reservedRange) { + message.reservedRange.push(DescriptorProto_ReservedRange.fromPartial(e)); + } + } + if (object.reservedName !== undefined && object.reservedName !== null) { + for (const e of object.reservedName) { + message.reservedName.push(e); + } + } + return message; + }, + toJSON(message: DescriptorProto): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + if (message.field) { + obj.field = message.field.map((e) => (e ? FieldDescriptorProto.toJSON(e) : undefined)); + } else { + obj.field = []; + } + if (message.extension) { + obj.extension = message.extension.map((e) => (e ? FieldDescriptorProto.toJSON(e) : undefined)); + } else { + obj.extension = []; + } + if (message.nestedType) { + obj.nestedType = message.nestedType.map((e) => (e ? DescriptorProto.toJSON(e) : undefined)); + } else { + obj.nestedType = []; + } + if (message.enumType) { + obj.enumType = message.enumType.map((e) => (e ? EnumDescriptorProto.toJSON(e) : undefined)); + } else { + obj.enumType = []; + } + if (message.extensionRange) { + obj.extensionRange = message.extensionRange.map((e) => + e ? DescriptorProto_ExtensionRange.toJSON(e) : undefined, + ); + } else { + obj.extensionRange = []; + } + if (message.oneofDecl) { + obj.oneofDecl = message.oneofDecl.map((e) => (e ? OneofDescriptorProto.toJSON(e) : undefined)); + } else { + obj.oneofDecl = []; + } + message.options !== undefined && + (obj.options = message.options ? MessageOptions.toJSON(message.options) : undefined); + if (message.reservedRange) { + obj.reservedRange = message.reservedRange.map((e) => + e ? DescriptorProto_ReservedRange.toJSON(e) : undefined, + ); + } else { + obj.reservedRange = []; + } + if (message.reservedName) { + obj.reservedName = message.reservedName.map((e) => e); + } else { + obj.reservedName = []; + } + return obj; + }, +}; + +export const DescriptorProto_ExtensionRange = { + encode(message: DescriptorProto_ExtensionRange, writer: Writer = Writer.create()): Writer { + writer.uint32(8).int32(message.start); + writer.uint32(16).int32(message.end); + if (message.options !== undefined && message.options !== undefined) { + ExtensionRangeOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, length?: number): DescriptorProto_ExtensionRange { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDescriptorProto_ExtensionRange } as DescriptorProto_ExtensionRange; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.start = reader.int32(); + break; + case 2: + message.end = reader.int32(); + break; + case 3: + message.options = ExtensionRangeOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): DescriptorProto_ExtensionRange { + const message = { ...baseDescriptorProto_ExtensionRange } as DescriptorProto_ExtensionRange; + if (object.start !== undefined && object.start !== null) { + message.start = Number(object.start); + } else { + message.start = 0; + } + if (object.end !== undefined && object.end !== null) { + message.end = Number(object.end); + } else { + message.end = 0; + } + if (object.options !== undefined && object.options !== null) { + message.options = ExtensionRangeOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + return message; + }, + fromPartial(object: DeepPartial): DescriptorProto_ExtensionRange { + const message = { ...baseDescriptorProto_ExtensionRange } as DescriptorProto_ExtensionRange; + if (object.start !== undefined && object.start !== null) { + message.start = object.start; + } else { + message.start = 0; + } + if (object.end !== undefined && object.end !== null) { + message.end = object.end; + } else { + message.end = 0; + } + if (object.options !== undefined && object.options !== null) { + message.options = ExtensionRangeOptions.fromPartial(object.options); + } else { + message.options = undefined; + } + return message; + }, + toJSON(message: DescriptorProto_ExtensionRange): unknown { + const obj: any = {}; + message.start !== undefined && (obj.start = message.start); + message.end !== undefined && (obj.end = message.end); + message.options !== undefined && + (obj.options = message.options ? ExtensionRangeOptions.toJSON(message.options) : undefined); + return obj; + }, +}; + +export const DescriptorProto_ReservedRange = { + encode(message: DescriptorProto_ReservedRange, writer: Writer = Writer.create()): Writer { + writer.uint32(8).int32(message.start); + writer.uint32(16).int32(message.end); + return writer; + }, + decode(input: Uint8Array | Reader, length?: number): DescriptorProto_ReservedRange { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDescriptorProto_ReservedRange } as DescriptorProto_ReservedRange; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.start = reader.int32(); + break; + case 2: + message.end = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): DescriptorProto_ReservedRange { + const message = { ...baseDescriptorProto_ReservedRange } as DescriptorProto_ReservedRange; + if (object.start !== undefined && object.start !== null) { + message.start = Number(object.start); + } else { + message.start = 0; + } + if (object.end !== undefined && object.end !== null) { + message.end = Number(object.end); + } else { + message.end = 0; + } + return message; + }, + fromPartial(object: DeepPartial): DescriptorProto_ReservedRange { + const message = { ...baseDescriptorProto_ReservedRange } as DescriptorProto_ReservedRange; + if (object.start !== undefined && object.start !== null) { + message.start = object.start; + } else { + message.start = 0; + } + if (object.end !== undefined && object.end !== null) { + message.end = object.end; + } else { + message.end = 0; + } + return message; + }, + toJSON(message: DescriptorProto_ReservedRange): unknown { + const obj: any = {}; + message.start !== undefined && (obj.start = message.start); + message.end !== undefined && (obj.end = message.end); + return obj; + }, +}; + +export const ExtensionRangeOptions = { + encode(message: ExtensionRangeOptions, writer: Writer = Writer.create()): Writer { + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, length?: number): ExtensionRangeOptions { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; + message.uninterpretedOption = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 999: + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): ExtensionRangeOptions { + const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; + message.uninterpretedOption = []; + if (object.uninterpretedOption !== undefined && object.uninterpretedOption !== null) { + for (const e of object.uninterpretedOption) { + message.uninterpretedOption.push(UninterpretedOption.fromJSON(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): ExtensionRangeOptions { + const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; + message.uninterpretedOption = []; + if (object.uninterpretedOption !== undefined && object.uninterpretedOption !== null) { + for (const e of object.uninterpretedOption) { + message.uninterpretedOption.push(UninterpretedOption.fromPartial(e)); + } + } + return message; + }, + toJSON(message: ExtensionRangeOptions): unknown { + const obj: any = {}; + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined, + ); + } else { + obj.uninterpretedOption = []; + } + return obj; + }, +}; + +export const FieldDescriptorProto = { + encode(message: FieldDescriptorProto, writer: Writer = Writer.create()): Writer { + writer.uint32(10).string(message.name); + writer.uint32(24).int32(message.number); + writer.uint32(32).int32(message.label); + writer.uint32(40).int32(message.type); + writer.uint32(50).string(message.typeName); + writer.uint32(18).string(message.extendee); + writer.uint32(58).string(message.defaultValue); + writer.uint32(72).int32(message.oneofIndex); + writer.uint32(82).string(message.jsonName); + if (message.options !== undefined && message.options !== undefined) { + FieldOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); + } + writer.uint32(136).bool(message.proto3Optional); + return writer; + }, + decode(input: Uint8Array | Reader, length?: number): FieldDescriptorProto { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 3: + message.number = reader.int32(); + break; + case 4: + message.label = reader.int32() as any; + break; + case 5: + message.type = reader.int32() as any; + break; + case 6: + message.typeName = reader.string(); + break; + case 2: + message.extendee = reader.string(); + break; + case 7: + message.defaultValue = reader.string(); + break; + case 9: + message.oneofIndex = reader.int32(); + break; + case 10: + message.jsonName = reader.string(); + break; + case 8: + message.options = FieldOptions.decode(reader, reader.uint32()); + break; + case 17: + message.proto3Optional = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): FieldDescriptorProto { + const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.number !== undefined && object.number !== null) { + message.number = Number(object.number); + } else { + message.number = 0; + } + if (object.label !== undefined && object.label !== null) { + message.label = fieldDescriptorProto_LabelFromJSON(object.label); + } else { + message.label = 1; + } + if (object.type !== undefined && object.type !== null) { + message.type = fieldDescriptorProto_TypeFromJSON(object.type); + } else { + message.type = 1; + } + if (object.typeName !== undefined && object.typeName !== null) { + message.typeName = String(object.typeName); + } else { + message.typeName = ""; + } + if (object.extendee !== undefined && object.extendee !== null) { + message.extendee = String(object.extendee); + } else { + message.extendee = ""; + } + if (object.defaultValue !== undefined && object.defaultValue !== null) { + message.defaultValue = String(object.defaultValue); + } else { + message.defaultValue = ""; + } + if (object.oneofIndex !== undefined && object.oneofIndex !== null) { + message.oneofIndex = Number(object.oneofIndex); + } else { + message.oneofIndex = 0; + } + if (object.jsonName !== undefined && object.jsonName !== null) { + message.jsonName = String(object.jsonName); + } else { + message.jsonName = ""; + } + if (object.options !== undefined && object.options !== null) { + message.options = FieldOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + if (object.proto3Optional !== undefined && object.proto3Optional !== null) { + message.proto3Optional = Boolean(object.proto3Optional); + } else { + message.proto3Optional = false; + } + return message; + }, + fromPartial(object: DeepPartial): FieldDescriptorProto { + const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.number !== undefined && object.number !== null) { + message.number = object.number; + } else { + message.number = 0; + } + if (object.label !== undefined && object.label !== null) { + message.label = object.label; + } else { + message.label = 1; + } + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } else { + message.type = 1; + } + if (object.typeName !== undefined && object.typeName !== null) { + message.typeName = object.typeName; + } else { + message.typeName = ""; + } + if (object.extendee !== undefined && object.extendee !== null) { + message.extendee = object.extendee; + } else { + message.extendee = ""; + } + if (object.defaultValue !== undefined && object.defaultValue !== null) { + message.defaultValue = object.defaultValue; + } else { + message.defaultValue = ""; + } + if (object.oneofIndex !== undefined && object.oneofIndex !== null) { + message.oneofIndex = object.oneofIndex; + } else { + message.oneofIndex = 0; + } + if (object.jsonName !== undefined && object.jsonName !== null) { + message.jsonName = object.jsonName; + } else { + message.jsonName = ""; + } + if (object.options !== undefined && object.options !== null) { + message.options = FieldOptions.fromPartial(object.options); + } else { + message.options = undefined; + } + if (object.proto3Optional !== undefined && object.proto3Optional !== null) { + message.proto3Optional = object.proto3Optional; + } else { + message.proto3Optional = false; + } + return message; + }, + toJSON(message: FieldDescriptorProto): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.number !== undefined && (obj.number = message.number); + message.label !== undefined && (obj.label = fieldDescriptorProto_LabelToJSON(message.label)); + message.type !== undefined && (obj.type = fieldDescriptorProto_TypeToJSON(message.type)); + message.typeName !== undefined && (obj.typeName = message.typeName); + message.extendee !== undefined && (obj.extendee = message.extendee); + message.defaultValue !== undefined && (obj.defaultValue = message.defaultValue); + message.oneofIndex !== undefined && (obj.oneofIndex = message.oneofIndex); + message.jsonName !== undefined && (obj.jsonName = message.jsonName); + message.options !== undefined && + (obj.options = message.options ? FieldOptions.toJSON(message.options) : undefined); + message.proto3Optional !== undefined && (obj.proto3Optional = message.proto3Optional); + return obj; + }, +}; + +export const OneofDescriptorProto = { + encode(message: OneofDescriptorProto, writer: Writer = Writer.create()): Writer { + writer.uint32(10).string(message.name); + if (message.options !== undefined && message.options !== undefined) { + OneofOptions.encode(message.options, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, length?: number): OneofDescriptorProto { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.options = OneofOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): OneofDescriptorProto { + const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.options !== undefined && object.options !== null) { + message.options = OneofOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + return message; + }, + fromPartial(object: DeepPartial): OneofDescriptorProto { + const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.options !== undefined && object.options !== null) { + message.options = OneofOptions.fromPartial(object.options); + } else { + message.options = undefined; + } + return message; + }, + toJSON(message: OneofDescriptorProto): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.options !== undefined && + (obj.options = message.options ? OneofOptions.toJSON(message.options) : undefined); + return obj; + }, +}; + +export const EnumDescriptorProto = { + encode(message: EnumDescriptorProto, writer: Writer = Writer.create()): Writer { + writer.uint32(10).string(message.name); + for (const v of message.value) { + EnumValueDescriptorProto.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.options !== undefined && message.options !== undefined) { + EnumOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.reservedRange) { + EnumDescriptorProto_EnumReservedRange.encode(v!, writer.uint32(34).fork()).ldelim(); + } + for (const v of message.reservedName) { + writer.uint32(42).string(v!); + } + return writer; + }, + decode(input: Uint8Array | Reader, length?: number): EnumDescriptorProto { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; + message.value = []; + message.reservedRange = []; + message.reservedName = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.value.push(EnumValueDescriptorProto.decode(reader, reader.uint32())); + break; + case 3: + message.options = EnumOptions.decode(reader, reader.uint32()); + break; + case 4: + message.reservedRange.push(EnumDescriptorProto_EnumReservedRange.decode(reader, reader.uint32())); + break; + case 5: + message.reservedName.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): EnumDescriptorProto { + const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; + message.value = []; + message.reservedRange = []; + message.reservedName = []; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.value !== undefined && object.value !== null) { + for (const e of object.value) { + message.value.push(EnumValueDescriptorProto.fromJSON(e)); + } + } + if (object.options !== undefined && object.options !== null) { + message.options = EnumOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + if (object.reservedRange !== undefined && object.reservedRange !== null) { + for (const e of object.reservedRange) { + message.reservedRange.push(EnumDescriptorProto_EnumReservedRange.fromJSON(e)); + } + } + if (object.reservedName !== undefined && object.reservedName !== null) { + for (const e of object.reservedName) { + message.reservedName.push(String(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): EnumDescriptorProto { + const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; + message.value = []; + message.reservedRange = []; + message.reservedName = []; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.value !== undefined && object.value !== null) { + for (const e of object.value) { + message.value.push(EnumValueDescriptorProto.fromPartial(e)); + } + } + if (object.options !== undefined && object.options !== null) { + message.options = EnumOptions.fromPartial(object.options); + } else { + message.options = undefined; + } + if (object.reservedRange !== undefined && object.reservedRange !== null) { + for (const e of object.reservedRange) { + message.reservedRange.push(EnumDescriptorProto_EnumReservedRange.fromPartial(e)); + } + } + if (object.reservedName !== undefined && object.reservedName !== null) { + for (const e of object.reservedName) { + message.reservedName.push(e); + } + } + return message; + }, + toJSON(message: EnumDescriptorProto): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + if (message.value) { + obj.value = message.value.map((e) => (e ? EnumValueDescriptorProto.toJSON(e) : undefined)); + } else { + obj.value = []; + } + message.options !== undefined && + (obj.options = message.options ? EnumOptions.toJSON(message.options) : undefined); + if (message.reservedRange) { + obj.reservedRange = message.reservedRange.map((e) => + e ? EnumDescriptorProto_EnumReservedRange.toJSON(e) : undefined, + ); + } else { + obj.reservedRange = []; + } + if (message.reservedName) { + obj.reservedName = message.reservedName.map((e) => e); + } else { + obj.reservedName = []; + } + return obj; + }, +}; + +export const EnumDescriptorProto_EnumReservedRange = { + encode(message: EnumDescriptorProto_EnumReservedRange, writer: Writer = Writer.create()): Writer { + writer.uint32(8).int32(message.start); + writer.uint32(16).int32(message.end); + return writer; + }, + decode(input: Uint8Array | Reader, length?: number): EnumDescriptorProto_EnumReservedRange { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseEnumDescriptorProto_EnumReservedRange } as EnumDescriptorProto_EnumReservedRange; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.start = reader.int32(); + break; + case 2: + message.end = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): EnumDescriptorProto_EnumReservedRange { + const message = { ...baseEnumDescriptorProto_EnumReservedRange } as EnumDescriptorProto_EnumReservedRange; + if (object.start !== undefined && object.start !== null) { + message.start = Number(object.start); + } else { + message.start = 0; + } + if (object.end !== undefined && object.end !== null) { + message.end = Number(object.end); + } else { + message.end = 0; + } + return message; + }, + fromPartial( + object: DeepPartial, + ): EnumDescriptorProto_EnumReservedRange { + const message = { ...baseEnumDescriptorProto_EnumReservedRange } as EnumDescriptorProto_EnumReservedRange; + if (object.start !== undefined && object.start !== null) { + message.start = object.start; + } else { + message.start = 0; + } + if (object.end !== undefined && object.end !== null) { + message.end = object.end; + } else { + message.end = 0; + } + return message; + }, + toJSON(message: EnumDescriptorProto_EnumReservedRange): unknown { + const obj: any = {}; + message.start !== undefined && (obj.start = message.start); + message.end !== undefined && (obj.end = message.end); + return obj; + }, +}; + +export const EnumValueDescriptorProto = { + encode(message: EnumValueDescriptorProto, writer: Writer = Writer.create()): Writer { + writer.uint32(10).string(message.name); + writer.uint32(16).int32(message.number); + if (message.options !== undefined && message.options !== undefined) { + EnumValueOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, length?: number): EnumValueDescriptorProto { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseEnumValueDescriptorProto } as EnumValueDescriptorProto; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.number = reader.int32(); + break; + case 3: + message.options = EnumValueOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): EnumValueDescriptorProto { + const message = { ...baseEnumValueDescriptorProto } as EnumValueDescriptorProto; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.number !== undefined && object.number !== null) { + message.number = Number(object.number); + } else { + message.number = 0; + } + if (object.options !== undefined && object.options !== null) { + message.options = EnumValueOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + return message; + }, + fromPartial(object: DeepPartial): EnumValueDescriptorProto { + const message = { ...baseEnumValueDescriptorProto } as EnumValueDescriptorProto; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.number !== undefined && object.number !== null) { + message.number = object.number; + } else { + message.number = 0; + } + if (object.options !== undefined && object.options !== null) { + message.options = EnumValueOptions.fromPartial(object.options); + } else { + message.options = undefined; + } + return message; + }, + toJSON(message: EnumValueDescriptorProto): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.number !== undefined && (obj.number = message.number); + message.options !== undefined && + (obj.options = message.options ? EnumValueOptions.toJSON(message.options) : undefined); + return obj; + }, +}; + +export const ServiceDescriptorProto = { + encode(message: ServiceDescriptorProto, writer: Writer = Writer.create()): Writer { + writer.uint32(10).string(message.name); + for (const v of message.method) { + MethodDescriptorProto.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.options !== undefined && message.options !== undefined) { + ServiceOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, length?: number): ServiceDescriptorProto { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; + message.method = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.method.push(MethodDescriptorProto.decode(reader, reader.uint32())); + break; + case 3: + message.options = ServiceOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): ServiceDescriptorProto { + const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; + message.method = []; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.method !== undefined && object.method !== null) { + for (const e of object.method) { + message.method.push(MethodDescriptorProto.fromJSON(e)); + } + } + if (object.options !== undefined && object.options !== null) { + message.options = ServiceOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + return message; + }, + fromPartial(object: DeepPartial): ServiceDescriptorProto { + const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; + message.method = []; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.method !== undefined && object.method !== null) { + for (const e of object.method) { + message.method.push(MethodDescriptorProto.fromPartial(e)); + } + } + if (object.options !== undefined && object.options !== null) { + message.options = ServiceOptions.fromPartial(object.options); + } else { + message.options = undefined; + } + return message; + }, + toJSON(message: ServiceDescriptorProto): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + if (message.method) { + obj.method = message.method.map((e) => (e ? MethodDescriptorProto.toJSON(e) : undefined)); + } else { + obj.method = []; + } + message.options !== undefined && + (obj.options = message.options ? ServiceOptions.toJSON(message.options) : undefined); + return obj; + }, +}; + +export const MethodDescriptorProto = { + encode(message: MethodDescriptorProto, writer: Writer = Writer.create()): Writer { + writer.uint32(10).string(message.name); + writer.uint32(18).string(message.inputType); + writer.uint32(26).string(message.outputType); + if (message.options !== undefined && message.options !== undefined) { + MethodOptions.encode(message.options, writer.uint32(34).fork()).ldelim(); + } + writer.uint32(40).bool(message.clientStreaming); + writer.uint32(48).bool(message.serverStreaming); + return writer; + }, + decode(input: Uint8Array | Reader, length?: number): MethodDescriptorProto { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.inputType = reader.string(); + break; + case 3: + message.outputType = reader.string(); + break; + case 4: + message.options = MethodOptions.decode(reader, reader.uint32()); + break; + case 5: + message.clientStreaming = reader.bool(); + break; + case 6: + message.serverStreaming = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MethodDescriptorProto { + const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.inputType !== undefined && object.inputType !== null) { + message.inputType = String(object.inputType); + } else { + message.inputType = ""; + } + if (object.outputType !== undefined && object.outputType !== null) { + message.outputType = String(object.outputType); + } else { + message.outputType = ""; + } + if (object.options !== undefined && object.options !== null) { + message.options = MethodOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + if (object.clientStreaming !== undefined && object.clientStreaming !== null) { + message.clientStreaming = Boolean(object.clientStreaming); + } else { + message.clientStreaming = false; + } + if (object.serverStreaming !== undefined && object.serverStreaming !== null) { + message.serverStreaming = Boolean(object.serverStreaming); + } else { + message.serverStreaming = false; + } + return message; + }, + fromPartial(object: DeepPartial): MethodDescriptorProto { + const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.inputType !== undefined && object.inputType !== null) { + message.inputType = object.inputType; + } else { + message.inputType = ""; + } + if (object.outputType !== undefined && object.outputType !== null) { + message.outputType = object.outputType; + } else { + message.outputType = ""; + } + if (object.options !== undefined && object.options !== null) { + message.options = MethodOptions.fromPartial(object.options); + } else { + message.options = undefined; + } + if (object.clientStreaming !== undefined && object.clientStreaming !== null) { + message.clientStreaming = object.clientStreaming; + } else { + message.clientStreaming = false; + } + if (object.serverStreaming !== undefined && object.serverStreaming !== null) { + message.serverStreaming = object.serverStreaming; + } else { + message.serverStreaming = false; + } + return message; + }, + toJSON(message: MethodDescriptorProto): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.inputType !== undefined && (obj.inputType = message.inputType); + message.outputType !== undefined && (obj.outputType = message.outputType); + message.options !== undefined && + (obj.options = message.options ? MethodOptions.toJSON(message.options) : undefined); + message.clientStreaming !== undefined && (obj.clientStreaming = message.clientStreaming); + message.serverStreaming !== undefined && (obj.serverStreaming = message.serverStreaming); + return obj; + }, +}; + +export const FileOptions = { + encode(message: FileOptions, writer: Writer = Writer.create()): Writer { + writer.uint32(10).string(message.javaPackage); + writer.uint32(66).string(message.javaOuterClassname); + writer.uint32(80).bool(message.javaMultipleFiles); + writer.uint32(160).bool(message.javaGenerateEqualsAndHash); + writer.uint32(216).bool(message.javaStringCheckUtf8); + writer.uint32(72).int32(message.optimizeFor); + writer.uint32(90).string(message.goPackage); + writer.uint32(128).bool(message.ccGenericServices); + writer.uint32(136).bool(message.javaGenericServices); + writer.uint32(144).bool(message.pyGenericServices); + writer.uint32(336).bool(message.phpGenericServices); + writer.uint32(184).bool(message.deprecated); + writer.uint32(248).bool(message.ccEnableArenas); + writer.uint32(290).string(message.objcClassPrefix); + writer.uint32(298).string(message.csharpNamespace); + writer.uint32(314).string(message.swiftPrefix); + writer.uint32(322).string(message.phpClassPrefix); + writer.uint32(330).string(message.phpNamespace); + writer.uint32(354).string(message.phpMetadataNamespace); + writer.uint32(362).string(message.rubyPackage); + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, length?: number): FileOptions { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseFileOptions } as FileOptions; + message.uninterpretedOption = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.javaPackage = reader.string(); + break; + case 8: + message.javaOuterClassname = reader.string(); + break; + case 10: + message.javaMultipleFiles = reader.bool(); + break; + case 20: + message.javaGenerateEqualsAndHash = reader.bool(); + break; + case 27: + message.javaStringCheckUtf8 = reader.bool(); + break; + case 9: + message.optimizeFor = reader.int32() as any; + break; + case 11: + message.goPackage = reader.string(); + break; + case 16: + message.ccGenericServices = reader.bool(); + break; + case 17: + message.javaGenericServices = reader.bool(); + break; + case 18: + message.pyGenericServices = reader.bool(); + break; + case 42: + message.phpGenericServices = reader.bool(); + break; + case 23: + message.deprecated = reader.bool(); + break; + case 31: + message.ccEnableArenas = reader.bool(); + break; + case 36: + message.objcClassPrefix = reader.string(); + break; + case 37: + message.csharpNamespace = reader.string(); + break; + case 39: + message.swiftPrefix = reader.string(); + break; + case 40: + message.phpClassPrefix = reader.string(); + break; + case 41: + message.phpNamespace = reader.string(); + break; + case 44: + message.phpMetadataNamespace = reader.string(); + break; + case 45: + message.rubyPackage = reader.string(); + break; + case 999: + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): FileOptions { + const message = { ...baseFileOptions } as FileOptions; + message.uninterpretedOption = []; + if (object.javaPackage !== undefined && object.javaPackage !== null) { + message.javaPackage = String(object.javaPackage); + } else { + message.javaPackage = ""; + } + if (object.javaOuterClassname !== undefined && object.javaOuterClassname !== null) { + message.javaOuterClassname = String(object.javaOuterClassname); + } else { + message.javaOuterClassname = ""; + } + if (object.javaMultipleFiles !== undefined && object.javaMultipleFiles !== null) { + message.javaMultipleFiles = Boolean(object.javaMultipleFiles); + } else { + message.javaMultipleFiles = false; + } + if (object.javaGenerateEqualsAndHash !== undefined && object.javaGenerateEqualsAndHash !== null) { + message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); + } else { + message.javaGenerateEqualsAndHash = false; + } + if (object.javaStringCheckUtf8 !== undefined && object.javaStringCheckUtf8 !== null) { + message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); + } else { + message.javaStringCheckUtf8 = false; + } + if (object.optimizeFor !== undefined && object.optimizeFor !== null) { + message.optimizeFor = fileOptions_OptimizeModeFromJSON(object.optimizeFor); + } else { + message.optimizeFor = 1; + } + if (object.goPackage !== undefined && object.goPackage !== null) { + message.goPackage = String(object.goPackage); + } else { + message.goPackage = ""; + } + if (object.ccGenericServices !== undefined && object.ccGenericServices !== null) { + message.ccGenericServices = Boolean(object.ccGenericServices); + } else { + message.ccGenericServices = false; + } + if (object.javaGenericServices !== undefined && object.javaGenericServices !== null) { + message.javaGenericServices = Boolean(object.javaGenericServices); + } else { + message.javaGenericServices = false; + } + if (object.pyGenericServices !== undefined && object.pyGenericServices !== null) { + message.pyGenericServices = Boolean(object.pyGenericServices); + } else { + message.pyGenericServices = false; + } + if (object.phpGenericServices !== undefined && object.phpGenericServices !== null) { + message.phpGenericServices = Boolean(object.phpGenericServices); + } else { + message.phpGenericServices = false; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = Boolean(object.deprecated); + } else { + message.deprecated = false; + } + if (object.ccEnableArenas !== undefined && object.ccEnableArenas !== null) { + message.ccEnableArenas = Boolean(object.ccEnableArenas); + } else { + message.ccEnableArenas = false; + } + if (object.objcClassPrefix !== undefined && object.objcClassPrefix !== null) { + message.objcClassPrefix = String(object.objcClassPrefix); + } else { + message.objcClassPrefix = ""; + } + if (object.csharpNamespace !== undefined && object.csharpNamespace !== null) { + message.csharpNamespace = String(object.csharpNamespace); + } else { + message.csharpNamespace = ""; + } + if (object.swiftPrefix !== undefined && object.swiftPrefix !== null) { + message.swiftPrefix = String(object.swiftPrefix); + } else { + message.swiftPrefix = ""; + } + if (object.phpClassPrefix !== undefined && object.phpClassPrefix !== null) { + message.phpClassPrefix = String(object.phpClassPrefix); + } else { + message.phpClassPrefix = ""; + } + if (object.phpNamespace !== undefined && object.phpNamespace !== null) { + message.phpNamespace = String(object.phpNamespace); + } else { + message.phpNamespace = ""; + } + if (object.phpMetadataNamespace !== undefined && object.phpMetadataNamespace !== null) { + message.phpMetadataNamespace = String(object.phpMetadataNamespace); + } else { + message.phpMetadataNamespace = ""; + } + if (object.rubyPackage !== undefined && object.rubyPackage !== null) { + message.rubyPackage = String(object.rubyPackage); + } else { + message.rubyPackage = ""; + } + if (object.uninterpretedOption !== undefined && object.uninterpretedOption !== null) { + for (const e of object.uninterpretedOption) { + message.uninterpretedOption.push(UninterpretedOption.fromJSON(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): FileOptions { + const message = { ...baseFileOptions } as FileOptions; + message.uninterpretedOption = []; + if (object.javaPackage !== undefined && object.javaPackage !== null) { + message.javaPackage = object.javaPackage; + } else { + message.javaPackage = ""; + } + if (object.javaOuterClassname !== undefined && object.javaOuterClassname !== null) { + message.javaOuterClassname = object.javaOuterClassname; + } else { + message.javaOuterClassname = ""; + } + if (object.javaMultipleFiles !== undefined && object.javaMultipleFiles !== null) { + message.javaMultipleFiles = object.javaMultipleFiles; + } else { + message.javaMultipleFiles = false; + } + if (object.javaGenerateEqualsAndHash !== undefined && object.javaGenerateEqualsAndHash !== null) { + message.javaGenerateEqualsAndHash = object.javaGenerateEqualsAndHash; + } else { + message.javaGenerateEqualsAndHash = false; + } + if (object.javaStringCheckUtf8 !== undefined && object.javaStringCheckUtf8 !== null) { + message.javaStringCheckUtf8 = object.javaStringCheckUtf8; + } else { + message.javaStringCheckUtf8 = false; + } + if (object.optimizeFor !== undefined && object.optimizeFor !== null) { + message.optimizeFor = object.optimizeFor; + } else { + message.optimizeFor = 1; + } + if (object.goPackage !== undefined && object.goPackage !== null) { + message.goPackage = object.goPackage; + } else { + message.goPackage = ""; + } + if (object.ccGenericServices !== undefined && object.ccGenericServices !== null) { + message.ccGenericServices = object.ccGenericServices; + } else { + message.ccGenericServices = false; + } + if (object.javaGenericServices !== undefined && object.javaGenericServices !== null) { + message.javaGenericServices = object.javaGenericServices; + } else { + message.javaGenericServices = false; + } + if (object.pyGenericServices !== undefined && object.pyGenericServices !== null) { + message.pyGenericServices = object.pyGenericServices; + } else { + message.pyGenericServices = false; + } + if (object.phpGenericServices !== undefined && object.phpGenericServices !== null) { + message.phpGenericServices = object.phpGenericServices; + } else { + message.phpGenericServices = false; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } else { + message.deprecated = false; + } + if (object.ccEnableArenas !== undefined && object.ccEnableArenas !== null) { + message.ccEnableArenas = object.ccEnableArenas; + } else { + message.ccEnableArenas = false; + } + if (object.objcClassPrefix !== undefined && object.objcClassPrefix !== null) { + message.objcClassPrefix = object.objcClassPrefix; + } else { + message.objcClassPrefix = ""; + } + if (object.csharpNamespace !== undefined && object.csharpNamespace !== null) { + message.csharpNamespace = object.csharpNamespace; + } else { + message.csharpNamespace = ""; + } + if (object.swiftPrefix !== undefined && object.swiftPrefix !== null) { + message.swiftPrefix = object.swiftPrefix; + } else { + message.swiftPrefix = ""; + } + if (object.phpClassPrefix !== undefined && object.phpClassPrefix !== null) { + message.phpClassPrefix = object.phpClassPrefix; + } else { + message.phpClassPrefix = ""; + } + if (object.phpNamespace !== undefined && object.phpNamespace !== null) { + message.phpNamespace = object.phpNamespace; + } else { + message.phpNamespace = ""; + } + if (object.phpMetadataNamespace !== undefined && object.phpMetadataNamespace !== null) { + message.phpMetadataNamespace = object.phpMetadataNamespace; + } else { + message.phpMetadataNamespace = ""; + } + if (object.rubyPackage !== undefined && object.rubyPackage !== null) { + message.rubyPackage = object.rubyPackage; + } else { + message.rubyPackage = ""; + } + if (object.uninterpretedOption !== undefined && object.uninterpretedOption !== null) { + for (const e of object.uninterpretedOption) { + message.uninterpretedOption.push(UninterpretedOption.fromPartial(e)); + } + } + return message; + }, + toJSON(message: FileOptions): unknown { + const obj: any = {}; + message.javaPackage !== undefined && (obj.javaPackage = message.javaPackage); + message.javaOuterClassname !== undefined && (obj.javaOuterClassname = message.javaOuterClassname); + message.javaMultipleFiles !== undefined && (obj.javaMultipleFiles = message.javaMultipleFiles); + message.javaGenerateEqualsAndHash !== undefined && + (obj.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash); + message.javaStringCheckUtf8 !== undefined && (obj.javaStringCheckUtf8 = message.javaStringCheckUtf8); + message.optimizeFor !== undefined && + (obj.optimizeFor = fileOptions_OptimizeModeToJSON(message.optimizeFor)); + message.goPackage !== undefined && (obj.goPackage = message.goPackage); + message.ccGenericServices !== undefined && (obj.ccGenericServices = message.ccGenericServices); + message.javaGenericServices !== undefined && (obj.javaGenericServices = message.javaGenericServices); + message.pyGenericServices !== undefined && (obj.pyGenericServices = message.pyGenericServices); + message.phpGenericServices !== undefined && (obj.phpGenericServices = message.phpGenericServices); + message.deprecated !== undefined && (obj.deprecated = message.deprecated); + message.ccEnableArenas !== undefined && (obj.ccEnableArenas = message.ccEnableArenas); + message.objcClassPrefix !== undefined && (obj.objcClassPrefix = message.objcClassPrefix); + message.csharpNamespace !== undefined && (obj.csharpNamespace = message.csharpNamespace); + message.swiftPrefix !== undefined && (obj.swiftPrefix = message.swiftPrefix); + message.phpClassPrefix !== undefined && (obj.phpClassPrefix = message.phpClassPrefix); + message.phpNamespace !== undefined && (obj.phpNamespace = message.phpNamespace); + message.phpMetadataNamespace !== undefined && (obj.phpMetadataNamespace = message.phpMetadataNamespace); + message.rubyPackage !== undefined && (obj.rubyPackage = message.rubyPackage); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined, + ); + } else { + obj.uninterpretedOption = []; + } + return obj; + }, +}; + +export const MessageOptions = { + encode(message: MessageOptions, writer: Writer = Writer.create()): Writer { + writer.uint32(8).bool(message.messageSetWireFormat); + writer.uint32(16).bool(message.noStandardDescriptorAccessor); + writer.uint32(24).bool(message.deprecated); + writer.uint32(56).bool(message.mapEntry); + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, length?: number): MessageOptions { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMessageOptions } as MessageOptions; + message.uninterpretedOption = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.messageSetWireFormat = reader.bool(); + break; + case 2: + message.noStandardDescriptorAccessor = reader.bool(); + break; + case 3: + message.deprecated = reader.bool(); + break; + case 7: + message.mapEntry = reader.bool(); + break; + case 999: + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MessageOptions { + const message = { ...baseMessageOptions } as MessageOptions; + message.uninterpretedOption = []; + if (object.messageSetWireFormat !== undefined && object.messageSetWireFormat !== null) { + message.messageSetWireFormat = Boolean(object.messageSetWireFormat); + } else { + message.messageSetWireFormat = false; + } + if (object.noStandardDescriptorAccessor !== undefined && object.noStandardDescriptorAccessor !== null) { + message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); + } else { + message.noStandardDescriptorAccessor = false; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = Boolean(object.deprecated); + } else { + message.deprecated = false; + } + if (object.mapEntry !== undefined && object.mapEntry !== null) { + message.mapEntry = Boolean(object.mapEntry); + } else { + message.mapEntry = false; + } + if (object.uninterpretedOption !== undefined && object.uninterpretedOption !== null) { + for (const e of object.uninterpretedOption) { + message.uninterpretedOption.push(UninterpretedOption.fromJSON(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): MessageOptions { + const message = { ...baseMessageOptions } as MessageOptions; + message.uninterpretedOption = []; + if (object.messageSetWireFormat !== undefined && object.messageSetWireFormat !== null) { + message.messageSetWireFormat = object.messageSetWireFormat; + } else { + message.messageSetWireFormat = false; + } + if (object.noStandardDescriptorAccessor !== undefined && object.noStandardDescriptorAccessor !== null) { + message.noStandardDescriptorAccessor = object.noStandardDescriptorAccessor; + } else { + message.noStandardDescriptorAccessor = false; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } else { + message.deprecated = false; + } + if (object.mapEntry !== undefined && object.mapEntry !== null) { + message.mapEntry = object.mapEntry; + } else { + message.mapEntry = false; + } + if (object.uninterpretedOption !== undefined && object.uninterpretedOption !== null) { + for (const e of object.uninterpretedOption) { + message.uninterpretedOption.push(UninterpretedOption.fromPartial(e)); + } + } + return message; + }, + toJSON(message: MessageOptions): unknown { + const obj: any = {}; + message.messageSetWireFormat !== undefined && (obj.messageSetWireFormat = message.messageSetWireFormat); + message.noStandardDescriptorAccessor !== undefined && + (obj.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor); + message.deprecated !== undefined && (obj.deprecated = message.deprecated); + message.mapEntry !== undefined && (obj.mapEntry = message.mapEntry); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined, + ); + } else { + obj.uninterpretedOption = []; + } + return obj; + }, +}; + +export const FieldOptions = { + encode(message: FieldOptions, writer: Writer = Writer.create()): Writer { + writer.uint32(8).int32(message.ctype); + writer.uint32(16).bool(message.packed); + writer.uint32(48).int32(message.jstype); + writer.uint32(40).bool(message.lazy); + writer.uint32(24).bool(message.deprecated); + writer.uint32(80).bool(message.weak); + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, length?: number): FieldOptions { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseFieldOptions } as FieldOptions; + message.uninterpretedOption = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ctype = reader.int32() as any; + break; + case 2: + message.packed = reader.bool(); + break; + case 6: + message.jstype = reader.int32() as any; + break; + case 5: + message.lazy = reader.bool(); + break; + case 3: + message.deprecated = reader.bool(); + break; + case 10: + message.weak = reader.bool(); + break; + case 999: + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): FieldOptions { + const message = { ...baseFieldOptions } as FieldOptions; + message.uninterpretedOption = []; + if (object.ctype !== undefined && object.ctype !== null) { + message.ctype = fieldOptions_CTypeFromJSON(object.ctype); + } else { + message.ctype = 0; + } + if (object.packed !== undefined && object.packed !== null) { + message.packed = Boolean(object.packed); + } else { + message.packed = false; + } + if (object.jstype !== undefined && object.jstype !== null) { + message.jstype = fieldOptions_JSTypeFromJSON(object.jstype); + } else { + message.jstype = 0; + } + if (object.lazy !== undefined && object.lazy !== null) { + message.lazy = Boolean(object.lazy); + } else { + message.lazy = false; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = Boolean(object.deprecated); + } else { + message.deprecated = false; + } + if (object.weak !== undefined && object.weak !== null) { + message.weak = Boolean(object.weak); + } else { + message.weak = false; + } + if (object.uninterpretedOption !== undefined && object.uninterpretedOption !== null) { + for (const e of object.uninterpretedOption) { + message.uninterpretedOption.push(UninterpretedOption.fromJSON(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): FieldOptions { + const message = { ...baseFieldOptions } as FieldOptions; + message.uninterpretedOption = []; + if (object.ctype !== undefined && object.ctype !== null) { + message.ctype = object.ctype; + } else { + message.ctype = 0; + } + if (object.packed !== undefined && object.packed !== null) { + message.packed = object.packed; + } else { + message.packed = false; + } + if (object.jstype !== undefined && object.jstype !== null) { + message.jstype = object.jstype; + } else { + message.jstype = 0; + } + if (object.lazy !== undefined && object.lazy !== null) { + message.lazy = object.lazy; + } else { + message.lazy = false; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } else { + message.deprecated = false; + } + if (object.weak !== undefined && object.weak !== null) { + message.weak = object.weak; + } else { + message.weak = false; + } + if (object.uninterpretedOption !== undefined && object.uninterpretedOption !== null) { + for (const e of object.uninterpretedOption) { + message.uninterpretedOption.push(UninterpretedOption.fromPartial(e)); + } + } + return message; + }, + toJSON(message: FieldOptions): unknown { + const obj: any = {}; + message.ctype !== undefined && (obj.ctype = fieldOptions_CTypeToJSON(message.ctype)); + message.packed !== undefined && (obj.packed = message.packed); + message.jstype !== undefined && (obj.jstype = fieldOptions_JSTypeToJSON(message.jstype)); + message.lazy !== undefined && (obj.lazy = message.lazy); + message.deprecated !== undefined && (obj.deprecated = message.deprecated); + message.weak !== undefined && (obj.weak = message.weak); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined, + ); + } else { + obj.uninterpretedOption = []; + } + return obj; + }, +}; + +export const OneofOptions = { + encode(message: OneofOptions, writer: Writer = Writer.create()): Writer { + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, length?: number): OneofOptions { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseOneofOptions } as OneofOptions; + message.uninterpretedOption = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 999: + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): OneofOptions { + const message = { ...baseOneofOptions } as OneofOptions; + message.uninterpretedOption = []; + if (object.uninterpretedOption !== undefined && object.uninterpretedOption !== null) { + for (const e of object.uninterpretedOption) { + message.uninterpretedOption.push(UninterpretedOption.fromJSON(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): OneofOptions { + const message = { ...baseOneofOptions } as OneofOptions; + message.uninterpretedOption = []; + if (object.uninterpretedOption !== undefined && object.uninterpretedOption !== null) { + for (const e of object.uninterpretedOption) { + message.uninterpretedOption.push(UninterpretedOption.fromPartial(e)); + } + } + return message; + }, + toJSON(message: OneofOptions): unknown { + const obj: any = {}; + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined, + ); + } else { + obj.uninterpretedOption = []; + } + return obj; + }, +}; + +export const EnumOptions = { + encode(message: EnumOptions, writer: Writer = Writer.create()): Writer { + writer.uint32(16).bool(message.allowAlias); + writer.uint32(24).bool(message.deprecated); + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, length?: number): EnumOptions { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseEnumOptions } as EnumOptions; + message.uninterpretedOption = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.allowAlias = reader.bool(); + break; + case 3: + message.deprecated = reader.bool(); + break; + case 999: + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): EnumOptions { + const message = { ...baseEnumOptions } as EnumOptions; + message.uninterpretedOption = []; + if (object.allowAlias !== undefined && object.allowAlias !== null) { + message.allowAlias = Boolean(object.allowAlias); + } else { + message.allowAlias = false; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = Boolean(object.deprecated); + } else { + message.deprecated = false; + } + if (object.uninterpretedOption !== undefined && object.uninterpretedOption !== null) { + for (const e of object.uninterpretedOption) { + message.uninterpretedOption.push(UninterpretedOption.fromJSON(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): EnumOptions { + const message = { ...baseEnumOptions } as EnumOptions; + message.uninterpretedOption = []; + if (object.allowAlias !== undefined && object.allowAlias !== null) { + message.allowAlias = object.allowAlias; + } else { + message.allowAlias = false; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } else { + message.deprecated = false; + } + if (object.uninterpretedOption !== undefined && object.uninterpretedOption !== null) { + for (const e of object.uninterpretedOption) { + message.uninterpretedOption.push(UninterpretedOption.fromPartial(e)); + } + } + return message; + }, + toJSON(message: EnumOptions): unknown { + const obj: any = {}; + message.allowAlias !== undefined && (obj.allowAlias = message.allowAlias); + message.deprecated !== undefined && (obj.deprecated = message.deprecated); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined, + ); + } else { + obj.uninterpretedOption = []; + } + return obj; + }, +}; + +export const EnumValueOptions = { + encode(message: EnumValueOptions, writer: Writer = Writer.create()): Writer { + writer.uint32(8).bool(message.deprecated); + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, length?: number): EnumValueOptions { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseEnumValueOptions } as EnumValueOptions; + message.uninterpretedOption = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.deprecated = reader.bool(); + break; + case 999: + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): EnumValueOptions { + const message = { ...baseEnumValueOptions } as EnumValueOptions; + message.uninterpretedOption = []; + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = Boolean(object.deprecated); + } else { + message.deprecated = false; + } + if (object.uninterpretedOption !== undefined && object.uninterpretedOption !== null) { + for (const e of object.uninterpretedOption) { + message.uninterpretedOption.push(UninterpretedOption.fromJSON(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): EnumValueOptions { + const message = { ...baseEnumValueOptions } as EnumValueOptions; + message.uninterpretedOption = []; + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } else { + message.deprecated = false; + } + if (object.uninterpretedOption !== undefined && object.uninterpretedOption !== null) { + for (const e of object.uninterpretedOption) { + message.uninterpretedOption.push(UninterpretedOption.fromPartial(e)); + } + } + return message; + }, + toJSON(message: EnumValueOptions): unknown { + const obj: any = {}; + message.deprecated !== undefined && (obj.deprecated = message.deprecated); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined, + ); + } else { + obj.uninterpretedOption = []; + } + return obj; + }, +}; + +export const ServiceOptions = { + encode(message: ServiceOptions, writer: Writer = Writer.create()): Writer { + writer.uint32(264).bool(message.deprecated); + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, length?: number): ServiceOptions { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseServiceOptions } as ServiceOptions; + message.uninterpretedOption = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 33: + message.deprecated = reader.bool(); + break; + case 999: + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): ServiceOptions { + const message = { ...baseServiceOptions } as ServiceOptions; + message.uninterpretedOption = []; + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = Boolean(object.deprecated); + } else { + message.deprecated = false; + } + if (object.uninterpretedOption !== undefined && object.uninterpretedOption !== null) { + for (const e of object.uninterpretedOption) { + message.uninterpretedOption.push(UninterpretedOption.fromJSON(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): ServiceOptions { + const message = { ...baseServiceOptions } as ServiceOptions; + message.uninterpretedOption = []; + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } else { + message.deprecated = false; + } + if (object.uninterpretedOption !== undefined && object.uninterpretedOption !== null) { + for (const e of object.uninterpretedOption) { + message.uninterpretedOption.push(UninterpretedOption.fromPartial(e)); + } + } + return message; + }, + toJSON(message: ServiceOptions): unknown { + const obj: any = {}; + message.deprecated !== undefined && (obj.deprecated = message.deprecated); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined, + ); + } else { + obj.uninterpretedOption = []; + } + return obj; + }, +}; + +export const MethodOptions = { + encode(message: MethodOptions, writer: Writer = Writer.create()): Writer { + writer.uint32(264).bool(message.deprecated); + writer.uint32(272).int32(message.idempotencyLevel); + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, length?: number): MethodOptions { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMethodOptions } as MethodOptions; + message.uninterpretedOption = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 33: + message.deprecated = reader.bool(); + break; + case 34: + message.idempotencyLevel = reader.int32() as any; + break; + case 999: + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MethodOptions { + const message = { ...baseMethodOptions } as MethodOptions; + message.uninterpretedOption = []; + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = Boolean(object.deprecated); + } else { + message.deprecated = false; + } + if (object.idempotencyLevel !== undefined && object.idempotencyLevel !== null) { + message.idempotencyLevel = methodOptions_IdempotencyLevelFromJSON(object.idempotencyLevel); + } else { + message.idempotencyLevel = 0; + } + if (object.uninterpretedOption !== undefined && object.uninterpretedOption !== null) { + for (const e of object.uninterpretedOption) { + message.uninterpretedOption.push(UninterpretedOption.fromJSON(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): MethodOptions { + const message = { ...baseMethodOptions } as MethodOptions; + message.uninterpretedOption = []; + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } else { + message.deprecated = false; + } + if (object.idempotencyLevel !== undefined && object.idempotencyLevel !== null) { + message.idempotencyLevel = object.idempotencyLevel; + } else { + message.idempotencyLevel = 0; + } + if (object.uninterpretedOption !== undefined && object.uninterpretedOption !== null) { + for (const e of object.uninterpretedOption) { + message.uninterpretedOption.push(UninterpretedOption.fromPartial(e)); + } + } + return message; + }, + toJSON(message: MethodOptions): unknown { + const obj: any = {}; + message.deprecated !== undefined && (obj.deprecated = message.deprecated); + message.idempotencyLevel !== undefined && + (obj.idempotencyLevel = methodOptions_IdempotencyLevelToJSON(message.idempotencyLevel)); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined, + ); + } else { + obj.uninterpretedOption = []; + } + return obj; + }, +}; + +export const UninterpretedOption = { + encode(message: UninterpretedOption, writer: Writer = Writer.create()): Writer { + for (const v of message.name) { + UninterpretedOption_NamePart.encode(v!, writer.uint32(18).fork()).ldelim(); + } + writer.uint32(26).string(message.identifierValue); + writer.uint32(32).uint64(message.positiveIntValue); + writer.uint32(40).int64(message.negativeIntValue); + writer.uint32(49).double(message.doubleValue); + writer.uint32(58).bytes(message.stringValue); + writer.uint32(66).string(message.aggregateValue); + return writer; + }, + decode(input: Uint8Array | Reader, length?: number): UninterpretedOption { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseUninterpretedOption } as UninterpretedOption; + message.name = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.name.push(UninterpretedOption_NamePart.decode(reader, reader.uint32())); + break; + case 3: + message.identifierValue = reader.string(); + break; + case 4: + message.positiveIntValue = reader.uint64() as Long; + break; + case 5: + message.negativeIntValue = reader.int64() as Long; + break; + case 6: + message.doubleValue = reader.double(); + break; + case 7: + message.stringValue = reader.bytes(); + break; + case 8: + message.aggregateValue = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): UninterpretedOption { + const message = { ...baseUninterpretedOption } as UninterpretedOption; + message.name = []; + if (object.name !== undefined && object.name !== null) { + for (const e of object.name) { + message.name.push(UninterpretedOption_NamePart.fromJSON(e)); + } + } + if (object.identifierValue !== undefined && object.identifierValue !== null) { + message.identifierValue = String(object.identifierValue); + } else { + message.identifierValue = ""; + } + if (object.positiveIntValue !== undefined && object.positiveIntValue !== null) { + message.positiveIntValue = Long.fromString(object.positiveIntValue); + } else { + message.positiveIntValue = Long.UZERO; + } + if (object.negativeIntValue !== undefined && object.negativeIntValue !== null) { + message.negativeIntValue = Long.fromString(object.negativeIntValue); + } else { + message.negativeIntValue = Long.ZERO; + } + if (object.doubleValue !== undefined && object.doubleValue !== null) { + message.doubleValue = Number(object.doubleValue); + } else { + message.doubleValue = 0; + } + if (object.stringValue !== undefined && object.stringValue !== null) { + message.stringValue = bytesFromBase64(object.stringValue); + } + if (object.aggregateValue !== undefined && object.aggregateValue !== null) { + message.aggregateValue = String(object.aggregateValue); + } else { + message.aggregateValue = ""; + } + return message; + }, + fromPartial(object: DeepPartial): UninterpretedOption { + const message = { ...baseUninterpretedOption } as UninterpretedOption; + message.name = []; + if (object.name !== undefined && object.name !== null) { + for (const e of object.name) { + message.name.push(UninterpretedOption_NamePart.fromPartial(e)); + } + } + if (object.identifierValue !== undefined && object.identifierValue !== null) { + message.identifierValue = object.identifierValue; + } else { + message.identifierValue = ""; + } + if (object.positiveIntValue !== undefined && object.positiveIntValue !== null) { + message.positiveIntValue = object.positiveIntValue as Long; + } else { + message.positiveIntValue = Long.UZERO; + } + if (object.negativeIntValue !== undefined && object.negativeIntValue !== null) { + message.negativeIntValue = object.negativeIntValue as Long; + } else { + message.negativeIntValue = Long.ZERO; + } + if (object.doubleValue !== undefined && object.doubleValue !== null) { + message.doubleValue = object.doubleValue; + } else { + message.doubleValue = 0; + } + if (object.stringValue !== undefined && object.stringValue !== null) { + message.stringValue = object.stringValue; + } else { + message.stringValue = new Uint8Array(); + } + if (object.aggregateValue !== undefined && object.aggregateValue !== null) { + message.aggregateValue = object.aggregateValue; + } else { + message.aggregateValue = ""; + } + return message; + }, + toJSON(message: UninterpretedOption): unknown { + const obj: any = {}; + if (message.name) { + obj.name = message.name.map((e) => (e ? UninterpretedOption_NamePart.toJSON(e) : undefined)); + } else { + obj.name = []; + } + message.identifierValue !== undefined && (obj.identifierValue = message.identifierValue); + message.positiveIntValue !== undefined && + (obj.positiveIntValue = (message.positiveIntValue || Long.UZERO).toString()); + message.negativeIntValue !== undefined && + (obj.negativeIntValue = (message.negativeIntValue || Long.ZERO).toString()); + message.doubleValue !== undefined && (obj.doubleValue = message.doubleValue); + message.stringValue !== undefined && + (obj.stringValue = base64FromBytes( + message.stringValue !== undefined ? message.stringValue : new Uint8Array(), + )); + message.aggregateValue !== undefined && (obj.aggregateValue = message.aggregateValue); + return obj; + }, +}; + +export const UninterpretedOption_NamePart = { + encode(message: UninterpretedOption_NamePart, writer: Writer = Writer.create()): Writer { + writer.uint32(10).string(message.namePart); + writer.uint32(16).bool(message.isExtension); + return writer; + }, + decode(input: Uint8Array | Reader, length?: number): UninterpretedOption_NamePart { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseUninterpretedOption_NamePart } as UninterpretedOption_NamePart; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.namePart = reader.string(); + break; + case 2: + message.isExtension = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): UninterpretedOption_NamePart { + const message = { ...baseUninterpretedOption_NamePart } as UninterpretedOption_NamePart; + if (object.namePart !== undefined && object.namePart !== null) { + message.namePart = String(object.namePart); + } else { + message.namePart = ""; + } + if (object.isExtension !== undefined && object.isExtension !== null) { + message.isExtension = Boolean(object.isExtension); + } else { + message.isExtension = false; + } + return message; + }, + fromPartial(object: DeepPartial): UninterpretedOption_NamePart { + const message = { ...baseUninterpretedOption_NamePart } as UninterpretedOption_NamePart; + if (object.namePart !== undefined && object.namePart !== null) { + message.namePart = object.namePart; + } else { + message.namePart = ""; + } + if (object.isExtension !== undefined && object.isExtension !== null) { + message.isExtension = object.isExtension; + } else { + message.isExtension = false; + } + return message; + }, + toJSON(message: UninterpretedOption_NamePart): unknown { + const obj: any = {}; + message.namePart !== undefined && (obj.namePart = message.namePart); + message.isExtension !== undefined && (obj.isExtension = message.isExtension); + return obj; + }, +}; + +export const SourceCodeInfo = { + encode(message: SourceCodeInfo, writer: Writer = Writer.create()): Writer { + for (const v of message.location) { + SourceCodeInfo_Location.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, length?: number): SourceCodeInfo { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseSourceCodeInfo } as SourceCodeInfo; + message.location = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.location.push(SourceCodeInfo_Location.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): SourceCodeInfo { + const message = { ...baseSourceCodeInfo } as SourceCodeInfo; + message.location = []; + if (object.location !== undefined && object.location !== null) { + for (const e of object.location) { + message.location.push(SourceCodeInfo_Location.fromJSON(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): SourceCodeInfo { + const message = { ...baseSourceCodeInfo } as SourceCodeInfo; + message.location = []; + if (object.location !== undefined && object.location !== null) { + for (const e of object.location) { + message.location.push(SourceCodeInfo_Location.fromPartial(e)); + } + } + return message; + }, + toJSON(message: SourceCodeInfo): unknown { + const obj: any = {}; + if (message.location) { + obj.location = message.location.map((e) => (e ? SourceCodeInfo_Location.toJSON(e) : undefined)); + } else { + obj.location = []; + } + return obj; + }, +}; + +export const SourceCodeInfo_Location = { + encode(message: SourceCodeInfo_Location, writer: Writer = Writer.create()): Writer { + writer.uint32(10).fork(); + for (const v of message.path) { + writer.int32(v); + } + writer.ldelim(); + writer.uint32(18).fork(); + for (const v of message.span) { + writer.int32(v); + } + writer.ldelim(); + writer.uint32(26).string(message.leadingComments); + writer.uint32(34).string(message.trailingComments); + for (const v of message.leadingDetachedComments) { + writer.uint32(50).string(v!); + } + return writer; + }, + decode(input: Uint8Array | Reader, length?: number): SourceCodeInfo_Location { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseSourceCodeInfo_Location } as SourceCodeInfo_Location; + message.path = []; + message.span = []; + message.leadingDetachedComments = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.path.push(reader.int32()); + } + } else { + message.path.push(reader.int32()); + } + break; + case 2: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.span.push(reader.int32()); + } + } else { + message.span.push(reader.int32()); + } + break; + case 3: + message.leadingComments = reader.string(); + break; + case 4: + message.trailingComments = reader.string(); + break; + case 6: + message.leadingDetachedComments.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): SourceCodeInfo_Location { + const message = { ...baseSourceCodeInfo_Location } as SourceCodeInfo_Location; + message.path = []; + message.span = []; + message.leadingDetachedComments = []; + if (object.path !== undefined && object.path !== null) { + for (const e of object.path) { + message.path.push(Number(e)); + } + } + if (object.span !== undefined && object.span !== null) { + for (const e of object.span) { + message.span.push(Number(e)); + } + } + if (object.leadingComments !== undefined && object.leadingComments !== null) { + message.leadingComments = String(object.leadingComments); + } else { + message.leadingComments = ""; + } + if (object.trailingComments !== undefined && object.trailingComments !== null) { + message.trailingComments = String(object.trailingComments); + } else { + message.trailingComments = ""; + } + if (object.leadingDetachedComments !== undefined && object.leadingDetachedComments !== null) { + for (const e of object.leadingDetachedComments) { + message.leadingDetachedComments.push(String(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): SourceCodeInfo_Location { + const message = { ...baseSourceCodeInfo_Location } as SourceCodeInfo_Location; + message.path = []; + message.span = []; + message.leadingDetachedComments = []; + if (object.path !== undefined && object.path !== null) { + for (const e of object.path) { + message.path.push(e); + } + } + if (object.span !== undefined && object.span !== null) { + for (const e of object.span) { + message.span.push(e); + } + } + if (object.leadingComments !== undefined && object.leadingComments !== null) { + message.leadingComments = object.leadingComments; + } else { + message.leadingComments = ""; + } + if (object.trailingComments !== undefined && object.trailingComments !== null) { + message.trailingComments = object.trailingComments; + } else { + message.trailingComments = ""; + } + if (object.leadingDetachedComments !== undefined && object.leadingDetachedComments !== null) { + for (const e of object.leadingDetachedComments) { + message.leadingDetachedComments.push(e); + } + } + return message; + }, + toJSON(message: SourceCodeInfo_Location): unknown { + const obj: any = {}; + if (message.path) { + obj.path = message.path.map((e) => e); + } else { + obj.path = []; + } + if (message.span) { + obj.span = message.span.map((e) => e); + } else { + obj.span = []; + } + message.leadingComments !== undefined && (obj.leadingComments = message.leadingComments); + message.trailingComments !== undefined && (obj.trailingComments = message.trailingComments); + if (message.leadingDetachedComments) { + obj.leadingDetachedComments = message.leadingDetachedComments.map((e) => e); + } else { + obj.leadingDetachedComments = []; + } + return obj; + }, +}; + +export const GeneratedCodeInfo = { + encode(message: GeneratedCodeInfo, writer: Writer = Writer.create()): Writer { + for (const v of message.annotation) { + GeneratedCodeInfo_Annotation.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: Uint8Array | Reader, length?: number): GeneratedCodeInfo { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; + message.annotation = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.annotation.push(GeneratedCodeInfo_Annotation.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): GeneratedCodeInfo { + const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; + message.annotation = []; + if (object.annotation !== undefined && object.annotation !== null) { + for (const e of object.annotation) { + message.annotation.push(GeneratedCodeInfo_Annotation.fromJSON(e)); + } + } + return message; + }, + fromPartial(object: DeepPartial): GeneratedCodeInfo { + const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; + message.annotation = []; + if (object.annotation !== undefined && object.annotation !== null) { + for (const e of object.annotation) { + message.annotation.push(GeneratedCodeInfo_Annotation.fromPartial(e)); + } + } + return message; + }, + toJSON(message: GeneratedCodeInfo): unknown { + const obj: any = {}; + if (message.annotation) { + obj.annotation = message.annotation.map((e) => + e ? GeneratedCodeInfo_Annotation.toJSON(e) : undefined, + ); + } else { + obj.annotation = []; + } + return obj; + }, +}; + +export const GeneratedCodeInfo_Annotation = { + encode(message: GeneratedCodeInfo_Annotation, writer: Writer = Writer.create()): Writer { + writer.uint32(10).fork(); + for (const v of message.path) { + writer.int32(v); + } + writer.ldelim(); + writer.uint32(18).string(message.sourceFile); + writer.uint32(24).int32(message.begin); + writer.uint32(32).int32(message.end); + return writer; + }, + decode(input: Uint8Array | Reader, length?: number): GeneratedCodeInfo_Annotation { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGeneratedCodeInfo_Annotation } as GeneratedCodeInfo_Annotation; + message.path = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.path.push(reader.int32()); + } + } else { + message.path.push(reader.int32()); + } + break; + case 2: + message.sourceFile = reader.string(); + break; + case 3: + message.begin = reader.int32(); + break; + case 4: + message.end = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): GeneratedCodeInfo_Annotation { + const message = { ...baseGeneratedCodeInfo_Annotation } as GeneratedCodeInfo_Annotation; + message.path = []; + if (object.path !== undefined && object.path !== null) { + for (const e of object.path) { + message.path.push(Number(e)); + } + } + if (object.sourceFile !== undefined && object.sourceFile !== null) { + message.sourceFile = String(object.sourceFile); + } else { + message.sourceFile = ""; + } + if (object.begin !== undefined && object.begin !== null) { + message.begin = Number(object.begin); + } else { + message.begin = 0; + } + if (object.end !== undefined && object.end !== null) { + message.end = Number(object.end); + } else { + message.end = 0; + } + return message; + }, + fromPartial(object: DeepPartial): GeneratedCodeInfo_Annotation { + const message = { ...baseGeneratedCodeInfo_Annotation } as GeneratedCodeInfo_Annotation; + message.path = []; + if (object.path !== undefined && object.path !== null) { + for (const e of object.path) { + message.path.push(e); + } + } + if (object.sourceFile !== undefined && object.sourceFile !== null) { + message.sourceFile = object.sourceFile; + } else { + message.sourceFile = ""; + } + if (object.begin !== undefined && object.begin !== null) { + message.begin = object.begin; + } else { + message.begin = 0; + } + if (object.end !== undefined && object.end !== null) { + message.end = object.end; + } else { + message.end = 0; + } + return message; + }, + toJSON(message: GeneratedCodeInfo_Annotation): unknown { + const obj: any = {}; + if (message.path) { + obj.path = message.path.map((e) => e); + } else { + obj.path = []; + } + message.sourceFile !== undefined && (obj.sourceFile = message.sourceFile); + message.begin !== undefined && (obj.begin = message.begin); + message.end !== undefined && (obj.end = message.end); + return obj; + }, +}; + +interface WindowBase64 { + atob(b64: string): string; + btoa(bin: string): string; +} + +const windowBase64 = (globalThis as unknown) as WindowBase64; +const atob = windowBase64.atob || ((b64: string) => Buffer.from(b64, "base64").toString("binary")); +const btoa = windowBase64.btoa || ((bin: string) => Buffer.from(bin, "binary").toString("base64")); + +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/packages/proto-signing/src/codec/index.ts b/packages/proto-signing/src/codec/index.ts deleted file mode 100644 index e27bfc7e..00000000 --- a/packages/proto-signing/src/codec/index.ts +++ /dev/null @@ -1,9 +0,0 @@ -import Long from "long"; -import protobuf from "protobufjs/minimal"; - -// Ensure the protobuf module has a Long implementation, which otherwise only works -// in Node.js (see https://github.com/protobufjs/protobuf.js/issues/921#issuecomment-334925145) -protobuf.util.Long = Long; -protobuf.configure(); - -export * from "./generated/codecimpl"; diff --git a/packages/proto-signing/src/codec/tendermint/crypto/keys.ts b/packages/proto-signing/src/codec/tendermint/crypto/keys.ts new file mode 100644 index 00000000..b2a42252 --- /dev/null +++ b/packages/proto-signing/src/codec/tendermint/crypto/keys.ts @@ -0,0 +1,114 @@ +/* eslint-disable */ +import { Writer, Reader } from "protobufjs/minimal"; + +/** + * PublicKey defines the keys available for use with Tendermint Validators + */ +export interface PublicKey { + ed25519: Uint8Array | undefined; + secp256k1: Uint8Array | undefined; +} + +const basePublicKey: object = {}; + +export const protobufPackage = "tendermint.crypto"; + +export const PublicKey = { + encode(message: PublicKey, writer: Writer = Writer.create()): Writer { + if (message.ed25519 !== undefined) { + writer.uint32(10).bytes(message.ed25519); + } + if (message.secp256k1 !== undefined) { + writer.uint32(18).bytes(message.secp256k1); + } + return writer; + }, + decode(input: Uint8Array | Reader, length?: number): PublicKey { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...basePublicKey } as PublicKey; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ed25519 = reader.bytes(); + break; + case 2: + message.secp256k1 = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): PublicKey { + const message = { ...basePublicKey } as PublicKey; + if (object.ed25519 !== undefined && object.ed25519 !== null) { + message.ed25519 = bytesFromBase64(object.ed25519); + } + if (object.secp256k1 !== undefined && object.secp256k1 !== null) { + message.secp256k1 = bytesFromBase64(object.secp256k1); + } + return message; + }, + fromPartial(object: DeepPartial): PublicKey { + const message = { ...basePublicKey } as PublicKey; + if (object.ed25519 !== undefined && object.ed25519 !== null) { + message.ed25519 = object.ed25519; + } else { + message.ed25519 = undefined; + } + if (object.secp256k1 !== undefined && object.secp256k1 !== null) { + message.secp256k1 = object.secp256k1; + } else { + message.secp256k1 = undefined; + } + return message; + }, + toJSON(message: PublicKey): unknown { + const obj: any = {}; + message.ed25519 !== undefined && + (obj.ed25519 = message.ed25519 !== undefined ? base64FromBytes(message.ed25519) : undefined); + message.secp256k1 !== undefined && + (obj.secp256k1 = message.secp256k1 !== undefined ? base64FromBytes(message.secp256k1) : undefined); + return obj; + }, +}; + +interface WindowBase64 { + atob(b64: string): string; + btoa(bin: string): string; +} + +const windowBase64 = (globalThis as unknown) as WindowBase64; +const atob = windowBase64.atob || ((b64: string) => Buffer.from(b64, "base64").toString("binary")); +const btoa = windowBase64.btoa || ((bin: string) => Buffer.from(bin, "binary").toString("base64")); + +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/packages/proto-signing/types/codec/cosmos/bank/v1beta1/bank.d.ts b/packages/proto-signing/types/codec/cosmos/bank/v1beta1/bank.d.ts new file mode 100644 index 00000000..03ef38bd --- /dev/null +++ b/packages/proto-signing/types/codec/cosmos/bank/v1beta1/bank.d.ts @@ -0,0 +1,143 @@ +import { Coin } from "../../../cosmos/base/v1beta1/coin"; +import { Writer, Reader } from "protobufjs/minimal"; +/** + * Params defines the parameters for the bank module. + */ +export interface Params { + sendEnabled: SendEnabled[]; + defaultSendEnabled: boolean; +} +/** + * SendEnabled maps coin denom to a send_enabled status (whether a denom is + * sendable). + */ +export interface SendEnabled { + denom: string; + enabled: boolean; +} +/** + * Input models transaction input. + */ +export interface Input { + address: string; + coins: Coin[]; +} +/** + * Output models transaction outputs. + */ +export interface Output { + address: string; + coins: Coin[]; +} +/** + * Supply represents a struct that passively keeps track of the total supply + * amounts in the network. + */ +export interface Supply { + total: Coin[]; +} +/** + * DenomUnit represents a struct that describes a given + * denomination unit of the basic token. + */ +export interface DenomUnit { + /** + * denom represents the string name of the given denom unit (e.g uatom). + */ + denom: string; + /** + * exponent represents power of 10 exponent that one must + * raise the base_denom to in order to equal the given DenomUnit's denom + * 1 denom = 1^exponent base_denom + * (e.g. with a base_denom of uatom, one can create a DenomUnit of 'atom' with + * exponent = 6, thus: 1 atom = 10^6 uatom). + */ + exponent: number; + /** + * aliases is a list of string aliases for the given denom + */ + aliases: string[]; +} +/** + * Metadata represents a struct that describes + * a basic token. + */ +export interface Metadata { + description: string; + /** + * denom_units represents the list of DenomUnit's for a given coin + */ + denomUnits: DenomUnit[]; + /** + * base represents the base denom (should be the DenomUnit with exponent = 0). + */ + base: string; + /** + * display indicates the suggested denom that should be + * displayed in clients. + */ + display: string; +} +export declare const protobufPackage = "cosmos.bank.v1beta1"; +export declare const Params: { + encode(message: Params, writer?: Writer): Writer; + decode(input: Uint8Array | Reader, length?: number | undefined): Params; + fromJSON(object: any): Params; + fromPartial(object: DeepPartial): Params; + toJSON(message: Params): unknown; +}; +export declare const SendEnabled: { + encode(message: SendEnabled, writer?: Writer): Writer; + decode(input: Uint8Array | Reader, length?: number | undefined): SendEnabled; + fromJSON(object: any): SendEnabled; + fromPartial(object: DeepPartial): SendEnabled; + toJSON(message: SendEnabled): unknown; +}; +export declare const Input: { + encode(message: Input, writer?: Writer): Writer; + decode(input: Uint8Array | Reader, length?: number | undefined): Input; + fromJSON(object: any): Input; + fromPartial(object: DeepPartial): Input; + toJSON(message: Input): unknown; +}; +export declare const Output: { + encode(message: Output, writer?: Writer): Writer; + decode(input: Uint8Array | Reader, length?: number | undefined): Output; + fromJSON(object: any): Output; + fromPartial(object: DeepPartial): Output; + toJSON(message: Output): unknown; +}; +export declare const Supply: { + encode(message: Supply, writer?: Writer): Writer; + decode(input: Uint8Array | Reader, length?: number | undefined): Supply; + fromJSON(object: any): Supply; + fromPartial(object: DeepPartial): Supply; + toJSON(message: Supply): unknown; +}; +export declare const DenomUnit: { + encode(message: DenomUnit, writer?: Writer): Writer; + decode(input: Uint8Array | Reader, length?: number | undefined): DenomUnit; + fromJSON(object: any): DenomUnit; + fromPartial(object: DeepPartial): DenomUnit; + toJSON(message: DenomUnit): unknown; +}; +export declare const Metadata: { + encode(message: Metadata, writer?: Writer): Writer; + decode(input: Uint8Array | Reader, length?: number | undefined): Metadata; + fromJSON(object: any): Metadata; + fromPartial(object: DeepPartial): Metadata; + toJSON(message: Metadata): unknown; +}; +declare type Builtin = Date | Function | Uint8Array | string | number | undefined; +export declare type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { + [K in keyof T]?: DeepPartial; + } + : Partial; +export {}; diff --git a/packages/proto-signing/types/codec/cosmos/bank/v1beta1/tx.d.ts b/packages/proto-signing/types/codec/cosmos/bank/v1beta1/tx.d.ts new file mode 100644 index 00000000..21343c48 --- /dev/null +++ b/packages/proto-signing/types/codec/cosmos/bank/v1beta1/tx.d.ts @@ -0,0 +1,90 @@ +import { Coin } from "../../../cosmos/base/v1beta1/coin"; +import { Input, Output } from "../../../cosmos/bank/v1beta1/bank"; +import { Reader, Writer } from "protobufjs/minimal"; +/** + * MsgSend represents a message to send coins from one account to another. + */ +export interface MsgSend { + fromAddress: string; + toAddress: string; + amount: Coin[]; +} +/** + * MsgSendResponse defines the Msg/Send response type. + */ +export interface MsgSendResponse {} +/** + * MsgMultiSend represents an arbitrary multi-in, multi-out send message. + */ +export interface MsgMultiSend { + inputs: Input[]; + outputs: Output[]; +} +/** + * MsgMultiSendResponse defines the Msg/MultiSend response type. + */ +export interface MsgMultiSendResponse {} +/** + * Msg defines the bank Msg service. + */ +export interface Msg { + /** + * Send defines a method for sending coins from one account to another account. + */ + Send(request: MsgSend): Promise; + /** + * MultiSend defines a method for sending coins from some accounts to other accounts. + */ + MultiSend(request: MsgMultiSend): Promise; +} +export declare class MsgClientImpl implements Msg { + private readonly rpc; + constructor(rpc: Rpc); + Send(request: MsgSend): Promise; + MultiSend(request: MsgMultiSend): Promise; +} +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; +} +export declare const protobufPackage = "cosmos.bank.v1beta1"; +export declare const MsgSend: { + encode(message: MsgSend, writer?: Writer): Writer; + decode(input: Uint8Array | Reader, length?: number | undefined): MsgSend; + fromJSON(object: any): MsgSend; + fromPartial(object: DeepPartial): MsgSend; + toJSON(message: MsgSend): unknown; +}; +export declare const MsgSendResponse: { + encode(_: MsgSendResponse, writer?: Writer): Writer; + decode(input: Uint8Array | Reader, length?: number | undefined): MsgSendResponse; + fromJSON(_: any): MsgSendResponse; + fromPartial(_: DeepPartial): MsgSendResponse; + toJSON(_: MsgSendResponse): unknown; +}; +export declare const MsgMultiSend: { + encode(message: MsgMultiSend, writer?: Writer): Writer; + decode(input: Uint8Array | Reader, length?: number | undefined): MsgMultiSend; + fromJSON(object: any): MsgMultiSend; + fromPartial(object: DeepPartial): MsgMultiSend; + toJSON(message: MsgMultiSend): unknown; +}; +export declare const MsgMultiSendResponse: { + encode(_: MsgMultiSendResponse, writer?: Writer): Writer; + decode(input: Uint8Array | Reader, length?: number | undefined): MsgMultiSendResponse; + fromJSON(_: any): MsgMultiSendResponse; + fromPartial(_: DeepPartial): MsgMultiSendResponse; + toJSON(_: MsgMultiSendResponse): unknown; +}; +declare type Builtin = Date | Function | Uint8Array | string | number | undefined; +export declare type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { + [K in keyof T]?: DeepPartial; + } + : Partial; +export {}; diff --git a/packages/proto-signing/types/codec/cosmos/base/v1beta1/coin.d.ts b/packages/proto-signing/types/codec/cosmos/base/v1beta1/coin.d.ts new file mode 100644 index 00000000..9336a029 --- /dev/null +++ b/packages/proto-signing/types/codec/cosmos/base/v1beta1/coin.d.ts @@ -0,0 +1,75 @@ +import { Writer, Reader } from "protobufjs/minimal"; +/** + * Coin defines a token with a denomination and an amount. + * + * NOTE: The amount field is an Int which implements the custom method + * signatures required by gogoproto. + */ +export interface Coin { + denom: string; + amount: string; +} +/** + * DecCoin defines a token with a denomination and a decimal amount. + * + * NOTE: The amount field is an Dec which implements the custom method + * signatures required by gogoproto. + */ +export interface DecCoin { + denom: string; + amount: string; +} +/** + * IntProto defines a Protobuf wrapper around an Int object. + */ +export interface IntProto { + int: string; +} +/** + * DecProto defines a Protobuf wrapper around a Dec object. + */ +export interface DecProto { + dec: string; +} +export declare const protobufPackage = "cosmos.base.v1beta1"; +export declare const Coin: { + encode(message: Coin, writer?: Writer): Writer; + decode(input: Uint8Array | Reader, length?: number | undefined): Coin; + fromJSON(object: any): Coin; + fromPartial(object: DeepPartial): Coin; + toJSON(message: Coin): unknown; +}; +export declare const DecCoin: { + encode(message: DecCoin, writer?: Writer): Writer; + decode(input: Uint8Array | Reader, length?: number | undefined): DecCoin; + fromJSON(object: any): DecCoin; + fromPartial(object: DeepPartial): DecCoin; + toJSON(message: DecCoin): unknown; +}; +export declare const IntProto: { + encode(message: IntProto, writer?: Writer): Writer; + decode(input: Uint8Array | Reader, length?: number | undefined): IntProto; + fromJSON(object: any): IntProto; + fromPartial(object: DeepPartial): IntProto; + toJSON(message: IntProto): unknown; +}; +export declare const DecProto: { + encode(message: DecProto, writer?: Writer): Writer; + decode(input: Uint8Array | Reader, length?: number | undefined): DecProto; + fromJSON(object: any): DecProto; + fromPartial(object: DeepPartial): DecProto; + toJSON(message: DecProto): unknown; +}; +declare type Builtin = Date | Function | Uint8Array | string | number | undefined; +export declare type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { + [K in keyof T]?: DeepPartial; + } + : Partial; +export {}; diff --git a/packages/proto-signing/types/codec/cosmos/crypto/multisig/v1beta1/multisig.d.ts b/packages/proto-signing/types/codec/cosmos/crypto/multisig/v1beta1/multisig.d.ts new file mode 100644 index 00000000..780eed76 --- /dev/null +++ b/packages/proto-signing/types/codec/cosmos/crypto/multisig/v1beta1/multisig.d.ts @@ -0,0 +1,47 @@ +import { Writer, Reader } from "protobufjs/minimal"; +/** + * MultiSignature wraps the signatures from a multisig.LegacyAminoPubKey. + * See cosmos.tx.v1betata1.ModeInfo.Multi for how to specify which signers + * signed and with which modes. + */ +export interface MultiSignature { + signatures: Uint8Array[]; +} +/** + * CompactBitArray is an implementation of a space efficient bit array. + * This is used to ensure that the encoded data takes up a minimal amount of + * space after proto encoding. + * This is not thread safe, and is not intended for concurrent usage. + */ +export interface CompactBitArray { + extraBitsStored: number; + elems: Uint8Array; +} +export declare const protobufPackage = "cosmos.crypto.multisig.v1beta1"; +export declare const MultiSignature: { + encode(message: MultiSignature, writer?: Writer): Writer; + decode(input: Uint8Array | Reader, length?: number | undefined): MultiSignature; + fromJSON(object: any): MultiSignature; + fromPartial(object: DeepPartial): MultiSignature; + toJSON(message: MultiSignature): unknown; +}; +export declare const CompactBitArray: { + encode(message: CompactBitArray, writer?: Writer): Writer; + decode(input: Uint8Array | Reader, length?: number | undefined): CompactBitArray; + fromJSON(object: any): CompactBitArray; + fromPartial(object: DeepPartial): CompactBitArray; + toJSON(message: CompactBitArray): unknown; +}; +declare type Builtin = Date | Function | Uint8Array | string | number | undefined; +export declare type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { + [K in keyof T]?: DeepPartial; + } + : Partial; +export {}; diff --git a/packages/proto-signing/types/codec/cosmos/crypto/secp256k1/keys.d.ts b/packages/proto-signing/types/codec/cosmos/crypto/secp256k1/keys.d.ts new file mode 100644 index 00000000..e8e5a400 --- /dev/null +++ b/packages/proto-signing/types/codec/cosmos/crypto/secp256k1/keys.d.ts @@ -0,0 +1,45 @@ +import { Writer, Reader } from "protobufjs/minimal"; +/** + * PubKey defines a secp256k1 public key + * Key is the compressed form of the pubkey. The first byte depends is a 0x02 byte + * if the y-coordinate is the lexicographically largest of the two associated with + * the x-coordinate. Otherwise the first byte is a 0x03. + * This prefix is followed with the x-coordinate. + */ +export interface PubKey { + key: Uint8Array; +} +/** + * PrivKey defines a secp256k1 private key. + */ +export interface PrivKey { + key: Uint8Array; +} +export declare const protobufPackage = "cosmos.crypto.secp256k1"; +export declare const PubKey: { + encode(message: PubKey, writer?: Writer): Writer; + decode(input: Uint8Array | Reader, length?: number | undefined): PubKey; + fromJSON(object: any): PubKey; + fromPartial(object: DeepPartial): PubKey; + toJSON(message: PubKey): unknown; +}; +export declare const PrivKey: { + encode(message: PrivKey, writer?: Writer): Writer; + decode(input: Uint8Array | Reader, length?: number | undefined): PrivKey; + fromJSON(object: any): PrivKey; + fromPartial(object: DeepPartial): PrivKey; + toJSON(message: PrivKey): unknown; +}; +declare type Builtin = Date | Function | Uint8Array | string | number | undefined; +export declare type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { + [K in keyof T]?: DeepPartial; + } + : Partial; +export {}; diff --git a/packages/proto-signing/types/codec/cosmos/tx/signing/v1beta1/signing.d.ts b/packages/proto-signing/types/codec/cosmos/tx/signing/v1beta1/signing.d.ts new file mode 100644 index 00000000..05dfe7a3 --- /dev/null +++ b/packages/proto-signing/types/codec/cosmos/tx/signing/v1beta1/signing.d.ts @@ -0,0 +1,144 @@ +import { Any } from "../../../../google/protobuf/any"; +import * as Long from "long"; +import { CompactBitArray } from "../../../../cosmos/crypto/multisig/v1beta1/multisig"; +import { Writer, Reader } from "protobufjs/minimal"; +/** + * SignatureDescriptors wraps multiple SignatureDescriptor's. + */ +export interface SignatureDescriptors { + /** + * signatures are the signature descriptors + */ + signatures: SignatureDescriptor[]; +} +/** + * SignatureDescriptor is a convenience type which represents the full data for + * a signature including the public key of the signer, signing modes and the + * signature itself. It is primarily used for coordinating signatures between + * clients. + */ +export interface SignatureDescriptor { + /** + * public_key is the public key of the signer + */ + publicKey?: Any; + data?: SignatureDescriptor_Data; + /** + * sequence is the sequence of the account, which describes the + * number of committed transactions signed by a given address. It is used to prevent + * replay attacks. + */ + sequence: Long; +} +/** + * Data represents signature data + */ +export interface SignatureDescriptor_Data { + /** + * single represents a single signer + */ + single?: SignatureDescriptor_Data_Single | undefined; + /** + * multi represents a multisig signer + */ + multi?: SignatureDescriptor_Data_Multi | undefined; +} +/** + * Single is the signature data for a single signer + */ +export interface SignatureDescriptor_Data_Single { + /** + * mode is the signing mode of the single signer + */ + mode: SignMode; + /** + * signature is the raw signature bytes + */ + signature: Uint8Array; +} +/** + * Multi is the signature data for a multisig public key + */ +export interface SignatureDescriptor_Data_Multi { + /** + * bitarray specifies which keys within the multisig are signing + */ + bitarray?: CompactBitArray; + /** + * signatures is the signatures of the multi-signature + */ + signatures: SignatureDescriptor_Data[]; +} +export declare const protobufPackage = "cosmos.tx.signing.v1beta1"; +/** SignMode represents a signing mode with its own security guarantees. + */ +export declare enum SignMode { + /** SIGN_MODE_UNSPECIFIED - SIGN_MODE_UNSPECIFIED specifies an unknown signing mode and will be + rejected + */ + SIGN_MODE_UNSPECIFIED = 0, + /** SIGN_MODE_DIRECT - SIGN_MODE_DIRECT specifies a signing mode which uses SignDoc and is + verified with raw bytes from Tx + */ + SIGN_MODE_DIRECT = 1, + /** SIGN_MODE_TEXTUAL - SIGN_MODE_TEXTUAL is a future signing mode that will verify some + human-readable textual representation on top of the binary representation + from SIGN_MODE_DIRECT + */ + SIGN_MODE_TEXTUAL = 2, + /** SIGN_MODE_LEGACY_AMINO_JSON - SIGN_MODE_LEGACY_AMINO_JSON is a backwards compatibility mode which uses + Amino JSON and will be removed in the future + */ + SIGN_MODE_LEGACY_AMINO_JSON = 127, + UNRECOGNIZED = -1, +} +export declare function signModeFromJSON(object: any): SignMode; +export declare function signModeToJSON(object: SignMode): string; +export declare const SignatureDescriptors: { + encode(message: SignatureDescriptors, writer?: Writer): Writer; + decode(input: Uint8Array | Reader, length?: number | undefined): SignatureDescriptors; + fromJSON(object: any): SignatureDescriptors; + fromPartial(object: DeepPartial): SignatureDescriptors; + toJSON(message: SignatureDescriptors): unknown; +}; +export declare const SignatureDescriptor: { + encode(message: SignatureDescriptor, writer?: Writer): Writer; + decode(input: Uint8Array | Reader, length?: number | undefined): SignatureDescriptor; + fromJSON(object: any): SignatureDescriptor; + fromPartial(object: DeepPartial): SignatureDescriptor; + toJSON(message: SignatureDescriptor): unknown; +}; +export declare const SignatureDescriptor_Data: { + encode(message: SignatureDescriptor_Data, writer?: Writer): Writer; + decode(input: Uint8Array | Reader, length?: number | undefined): SignatureDescriptor_Data; + fromJSON(object: any): SignatureDescriptor_Data; + fromPartial(object: DeepPartial): SignatureDescriptor_Data; + toJSON(message: SignatureDescriptor_Data): unknown; +}; +export declare const SignatureDescriptor_Data_Single: { + encode(message: SignatureDescriptor_Data_Single, writer?: Writer): Writer; + decode(input: Uint8Array | Reader, length?: number | undefined): SignatureDescriptor_Data_Single; + fromJSON(object: any): SignatureDescriptor_Data_Single; + fromPartial(object: DeepPartial): SignatureDescriptor_Data_Single; + toJSON(message: SignatureDescriptor_Data_Single): unknown; +}; +export declare const SignatureDescriptor_Data_Multi: { + encode(message: SignatureDescriptor_Data_Multi, writer?: Writer): Writer; + decode(input: Uint8Array | Reader, length?: number | undefined): SignatureDescriptor_Data_Multi; + fromJSON(object: any): SignatureDescriptor_Data_Multi; + fromPartial(object: DeepPartial): SignatureDescriptor_Data_Multi; + toJSON(message: SignatureDescriptor_Data_Multi): unknown; +}; +declare type Builtin = Date | Function | Uint8Array | string | number | undefined; +export declare type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { + [K in keyof T]?: DeepPartial; + } + : Partial; +export {}; diff --git a/packages/proto-signing/types/codec/cosmos/tx/v1beta1/tx.d.ts b/packages/proto-signing/types/codec/cosmos/tx/v1beta1/tx.d.ts new file mode 100644 index 00000000..9a65bd17 --- /dev/null +++ b/packages/proto-signing/types/codec/cosmos/tx/v1beta1/tx.d.ts @@ -0,0 +1,305 @@ +import * as Long from "long"; +import { Any } from "../../../google/protobuf/any"; +import { SignMode } from "../../../cosmos/tx/signing/v1beta1/signing"; +import { CompactBitArray } from "../../../cosmos/crypto/multisig/v1beta1/multisig"; +import { Coin } from "../../../cosmos/base/v1beta1/coin"; +import { Writer, Reader } from "protobufjs/minimal"; +/** + * Tx is the standard type used for broadcasting transactions. + */ +export interface Tx { + /** + * body is the processable content of the transaction + */ + body?: TxBody; + /** + * auth_info is the authorization related content of the transaction, + * specifically signers, signer modes and fee + */ + authInfo?: AuthInfo; + /** + * signatures is a list of signatures that matches the length and order of + * AuthInfo's signer_infos to allow connecting signature meta information like + * public key and signing mode by position. + */ + signatures: Uint8Array[]; +} +/** + * TxRaw is a variant of Tx that pins the signer's exact binary representation + * of body and auth_info. This is used for signing, broadcasting and + * verification. The binary `serialize(tx: TxRaw)` is stored in Tendermint and + * the hash `sha256(serialize(tx: TxRaw))` becomes the "txhash", commonly used + * as the transaction ID. + */ +export interface TxRaw { + /** + * body_bytes is a protobuf serialization of a TxBody that matches the + * representation in SignDoc. + */ + bodyBytes: Uint8Array; + /** + * auth_info_bytes is a protobuf serialization of an AuthInfo that matches the + * representation in SignDoc. + */ + authInfoBytes: Uint8Array; + /** + * signatures is a list of signatures that matches the length and order of + * AuthInfo's signer_infos to allow connecting signature meta information like + * public key and signing mode by position. + */ + signatures: Uint8Array[]; +} +/** + * SignDoc is the type used for generating sign bytes for SIGN_MODE_DIRECT. + */ +export interface SignDoc { + /** + * body_bytes is protobuf serialization of a TxBody that matches the + * representation in TxRaw. + */ + bodyBytes: Uint8Array; + /** + * auth_info_bytes is a protobuf serialization of an AuthInfo that matches the + * representation in TxRaw. + */ + authInfoBytes: Uint8Array; + /** + * chain_id is the unique identifier of the chain this transaction targets. + * It prevents signed transactions from being used on another chain by an + * attacker + */ + chainId: string; + /** + * account_number is the account number of the account in state + */ + accountNumber: Long; +} +/** + * TxBody is the body of a transaction that all signers sign over. + */ +export interface TxBody { + /** + * messages is a list of messages to be executed. The required signers of + * those messages define the number and order of elements in AuthInfo's + * signer_infos and Tx's signatures. Each required signer address is added to + * the list only the first time it occurs. + * By convention, the first required signer (usually from the first message) + * is referred to as the primary signer and pays the fee for the whole + * transaction. + */ + messages: Any[]; + /** + * memo is any arbitrary memo to be added to the transaction + */ + memo: string; + /** + * timeout is the block height after which this transaction will not + * be processed by the chain + */ + timeoutHeight: Long; + /** + * extension_options are arbitrary options that can be added by chains + * when the default options are not sufficient. If any of these are present + * and can't be handled, the transaction will be rejected + */ + extensionOptions: Any[]; + /** + * extension_options are arbitrary options that can be added by chains + * when the default options are not sufficient. If any of these are present + * and can't be handled, they will be ignored + */ + nonCriticalExtensionOptions: Any[]; +} +/** + * AuthInfo describes the fee and signer modes that are used to sign a + * transaction. + */ +export interface AuthInfo { + /** + * signer_infos defines the signing modes for the required signers. The number + * and order of elements must match the required signers from TxBody's + * messages. The first element is the primary signer and the one which pays + * the fee. + */ + signerInfos: SignerInfo[]; + /** + * Fee is the fee and gas limit for the transaction. The first signer is the + * primary signer and the one which pays the fee. The fee can be calculated + * based on the cost of evaluating the body and doing signature verification + * of the signers. This can be estimated via simulation. + */ + fee?: Fee; +} +/** + * SignerInfo describes the public key and signing mode of a single top-level + * signer. + */ +export interface SignerInfo { + /** + * public_key is the public key of the signer. It is optional for accounts + * that already exist in state. If unset, the verifier can use the required \ + * signer address for this position and lookup the public key. + */ + publicKey?: Any; + /** + * mode_info describes the signing mode of the signer and is a nested + * structure to support nested multisig pubkey's + */ + modeInfo?: ModeInfo; + /** + * sequence is the sequence of the account, which describes the + * number of committed transactions signed by a given address. It is used to + * prevent replay attacks. + */ + sequence: Long; +} +/** + * ModeInfo describes the signing mode of a single or nested multisig signer. + */ +export interface ModeInfo { + /** + * single represents a single signer + */ + single?: ModeInfo_Single | undefined; + /** + * multi represents a nested multisig signer + */ + multi?: ModeInfo_Multi | undefined; +} +/** + * Single is the mode info for a single signer. It is structured as a message + * to allow for additional fields such as locale for SIGN_MODE_TEXTUAL in the + * future + */ +export interface ModeInfo_Single { + /** + * mode is the signing mode of the single signer + */ + mode: SignMode; +} +/** + * Multi is the mode info for a multisig public key + */ +export interface ModeInfo_Multi { + /** + * bitarray specifies which keys within the multisig are signing + */ + bitarray?: CompactBitArray; + /** + * mode_infos is the corresponding modes of the signers of the multisig + * which could include nested multisig public keys + */ + modeInfos: ModeInfo[]; +} +/** + * Fee includes the amount of coins paid in fees and the maximum + * gas to be used by the transaction. The ratio yields an effective "gasprice", + * which must be above some miminum to be accepted into the mempool. + */ +export interface Fee { + /** + * amount is the amount of coins to be paid as a fee + */ + amount: Coin[]; + /** + * gas_limit is the maximum gas that can be used in transaction processing + * before an out of gas error occurs + */ + gasLimit: Long; + /** + * if unset, the first signer is responsible for paying the fees. If set, the specified account must pay the fees. + * the payer must be a tx signer (and thus have signed this field in AuthInfo). + * setting this field does *not* change the ordering of required signers for the transaction. + */ + payer: string; + /** + * if set, the fee payer (either the first signer or the value of the payer field) requests that a fee grant be used + * to pay fees instead of the fee payer's own balance. If an appropriate fee grant does not exist or the chain does + * not support fee grants, this will fail + */ + granter: string; +} +export declare const protobufPackage = "cosmos.tx.v1beta1"; +export declare const Tx: { + encode(message: Tx, writer?: Writer): Writer; + decode(input: Uint8Array | Reader, length?: number | undefined): Tx; + fromJSON(object: any): Tx; + fromPartial(object: DeepPartial): Tx; + toJSON(message: Tx): unknown; +}; +export declare const TxRaw: { + encode(message: TxRaw, writer?: Writer): Writer; + decode(input: Uint8Array | Reader, length?: number | undefined): TxRaw; + fromJSON(object: any): TxRaw; + fromPartial(object: DeepPartial): TxRaw; + toJSON(message: TxRaw): unknown; +}; +export declare const SignDoc: { + encode(message: SignDoc, writer?: Writer): Writer; + decode(input: Uint8Array | Reader, length?: number | undefined): SignDoc; + fromJSON(object: any): SignDoc; + fromPartial(object: DeepPartial): SignDoc; + toJSON(message: SignDoc): unknown; +}; +export declare const TxBody: { + encode(message: TxBody, writer?: Writer): Writer; + decode(input: Uint8Array | Reader, length?: number | undefined): TxBody; + fromJSON(object: any): TxBody; + fromPartial(object: DeepPartial): TxBody; + toJSON(message: TxBody): unknown; +}; +export declare const AuthInfo: { + encode(message: AuthInfo, writer?: Writer): Writer; + decode(input: Uint8Array | Reader, length?: number | undefined): AuthInfo; + fromJSON(object: any): AuthInfo; + fromPartial(object: DeepPartial): AuthInfo; + toJSON(message: AuthInfo): unknown; +}; +export declare const SignerInfo: { + encode(message: SignerInfo, writer?: Writer): Writer; + decode(input: Uint8Array | Reader, length?: number | undefined): SignerInfo; + fromJSON(object: any): SignerInfo; + fromPartial(object: DeepPartial): SignerInfo; + toJSON(message: SignerInfo): unknown; +}; +export declare const ModeInfo: { + encode(message: ModeInfo, writer?: Writer): Writer; + decode(input: Uint8Array | Reader, length?: number | undefined): ModeInfo; + fromJSON(object: any): ModeInfo; + fromPartial(object: DeepPartial): ModeInfo; + toJSON(message: ModeInfo): unknown; +}; +export declare const ModeInfo_Single: { + encode(message: ModeInfo_Single, writer?: Writer): Writer; + decode(input: Uint8Array | Reader, length?: number | undefined): ModeInfo_Single; + fromJSON(object: any): ModeInfo_Single; + fromPartial(object: DeepPartial): ModeInfo_Single; + toJSON(message: ModeInfo_Single): unknown; +}; +export declare const ModeInfo_Multi: { + encode(message: ModeInfo_Multi, writer?: Writer): Writer; + decode(input: Uint8Array | Reader, length?: number | undefined): ModeInfo_Multi; + fromJSON(object: any): ModeInfo_Multi; + fromPartial(object: DeepPartial): ModeInfo_Multi; + toJSON(message: ModeInfo_Multi): unknown; +}; +export declare const Fee: { + encode(message: Fee, writer?: Writer): Writer; + decode(input: Uint8Array | Reader, length?: number | undefined): Fee; + fromJSON(object: any): Fee; + fromPartial(object: DeepPartial): Fee; + toJSON(message: Fee): unknown; +}; +declare type Builtin = Date | Function | Uint8Array | string | number | undefined; +export declare type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { + [K in keyof T]?: DeepPartial; + } + : Partial; +export {}; diff --git a/packages/proto-signing/types/codec/cosmos_proto/cosmos.d.ts b/packages/proto-signing/types/codec/cosmos_proto/cosmos.d.ts new file mode 100644 index 00000000..ac378148 --- /dev/null +++ b/packages/proto-signing/types/codec/cosmos_proto/cosmos.d.ts @@ -0,0 +1 @@ +export declare const protobufPackage = "cosmos_proto"; diff --git a/packages/proto-signing/types/codec/generated/codecimpl.d.ts b/packages/proto-signing/types/codec/generated/codecimpl.d.ts deleted file mode 100644 index dd187a06..00000000 --- a/packages/proto-signing/types/codec/generated/codecimpl.d.ts +++ /dev/null @@ -1,2016 +0,0 @@ -import * as $protobuf from "protobufjs"; -/** Namespace cosmos. */ -export namespace cosmos { - /** Namespace bank. */ - namespace bank { - /** Namespace v1beta1. */ - namespace v1beta1 { - /** Properties of a Params. */ - interface IParams { - /** Params sendEnabled */ - sendEnabled?: cosmos.bank.v1beta1.ISendEnabled[] | null; - - /** Params defaultSendEnabled */ - defaultSendEnabled?: boolean | null; - } - - /** Represents a Params. */ - class Params implements IParams { - /** - * Constructs a new Params. - * @param [p] Properties to set - */ - constructor(p?: cosmos.bank.v1beta1.IParams); - - /** Params sendEnabled. */ - public sendEnabled: cosmos.bank.v1beta1.ISendEnabled[]; - - /** Params defaultSendEnabled. */ - public defaultSendEnabled: boolean; - - /** - * Creates a new Params instance using the specified properties. - * @param [properties] Properties to set - * @returns Params instance - */ - public static create(properties?: cosmos.bank.v1beta1.IParams): cosmos.bank.v1beta1.Params; - - /** - * Encodes the specified Params message. Does not implicitly {@link cosmos.bank.v1beta1.Params.verify|verify} messages. - * @param m Params message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.bank.v1beta1.IParams, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Params message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Params - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.bank.v1beta1.Params; - } - - /** Properties of a SendEnabled. */ - interface ISendEnabled { - /** SendEnabled denom */ - denom?: string | null; - - /** SendEnabled enabled */ - enabled?: boolean | null; - } - - /** Represents a SendEnabled. */ - class SendEnabled implements ISendEnabled { - /** - * Constructs a new SendEnabled. - * @param [p] Properties to set - */ - constructor(p?: cosmos.bank.v1beta1.ISendEnabled); - - /** SendEnabled denom. */ - public denom: string; - - /** SendEnabled enabled. */ - public enabled: boolean; - - /** - * Creates a new SendEnabled instance using the specified properties. - * @param [properties] Properties to set - * @returns SendEnabled instance - */ - public static create(properties?: cosmos.bank.v1beta1.ISendEnabled): cosmos.bank.v1beta1.SendEnabled; - - /** - * Encodes the specified SendEnabled message. Does not implicitly {@link cosmos.bank.v1beta1.SendEnabled.verify|verify} messages. - * @param m SendEnabled message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.bank.v1beta1.ISendEnabled, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SendEnabled message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns SendEnabled - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.bank.v1beta1.SendEnabled; - } - - /** Properties of an Input. */ - interface IInput { - /** Input address */ - address?: string | null; - - /** Input coins */ - coins?: cosmos.base.v1beta1.ICoin[] | null; - } - - /** Represents an Input. */ - class Input implements IInput { - /** - * Constructs a new Input. - * @param [p] Properties to set - */ - constructor(p?: cosmos.bank.v1beta1.IInput); - - /** Input address. */ - public address: string; - - /** Input coins. */ - public coins: cosmos.base.v1beta1.ICoin[]; - - /** - * Creates a new Input instance using the specified properties. - * @param [properties] Properties to set - * @returns Input instance - */ - public static create(properties?: cosmos.bank.v1beta1.IInput): cosmos.bank.v1beta1.Input; - - /** - * Encodes the specified Input message. Does not implicitly {@link cosmos.bank.v1beta1.Input.verify|verify} messages. - * @param m Input message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.bank.v1beta1.IInput, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Input message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Input - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.bank.v1beta1.Input; - } - - /** Properties of an Output. */ - interface IOutput { - /** Output address */ - address?: string | null; - - /** Output coins */ - coins?: cosmos.base.v1beta1.ICoin[] | null; - } - - /** Represents an Output. */ - class Output implements IOutput { - /** - * Constructs a new Output. - * @param [p] Properties to set - */ - constructor(p?: cosmos.bank.v1beta1.IOutput); - - /** Output address. */ - public address: string; - - /** Output coins. */ - public coins: cosmos.base.v1beta1.ICoin[]; - - /** - * Creates a new Output instance using the specified properties. - * @param [properties] Properties to set - * @returns Output instance - */ - public static create(properties?: cosmos.bank.v1beta1.IOutput): cosmos.bank.v1beta1.Output; - - /** - * Encodes the specified Output message. Does not implicitly {@link cosmos.bank.v1beta1.Output.verify|verify} messages. - * @param m Output message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.bank.v1beta1.IOutput, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Output message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Output - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.bank.v1beta1.Output; - } - - /** Properties of a Supply. */ - interface ISupply { - /** Supply total */ - total?: cosmos.base.v1beta1.ICoin[] | null; - } - - /** Represents a Supply. */ - class Supply implements ISupply { - /** - * Constructs a new Supply. - * @param [p] Properties to set - */ - constructor(p?: cosmos.bank.v1beta1.ISupply); - - /** Supply total. */ - public total: cosmos.base.v1beta1.ICoin[]; - - /** - * Creates a new Supply instance using the specified properties. - * @param [properties] Properties to set - * @returns Supply instance - */ - public static create(properties?: cosmos.bank.v1beta1.ISupply): cosmos.bank.v1beta1.Supply; - - /** - * Encodes the specified Supply message. Does not implicitly {@link cosmos.bank.v1beta1.Supply.verify|verify} messages. - * @param m Supply message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.bank.v1beta1.ISupply, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Supply message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Supply - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.bank.v1beta1.Supply; - } - - /** Properties of a DenomUnit. */ - interface IDenomUnit { - /** DenomUnit denom */ - denom?: string | null; - - /** DenomUnit exponent */ - exponent?: number | null; - - /** DenomUnit aliases */ - aliases?: string[] | null; - } - - /** Represents a DenomUnit. */ - class DenomUnit implements IDenomUnit { - /** - * Constructs a new DenomUnit. - * @param [p] Properties to set - */ - constructor(p?: cosmos.bank.v1beta1.IDenomUnit); - - /** DenomUnit denom. */ - public denom: string; - - /** DenomUnit exponent. */ - public exponent: number; - - /** DenomUnit aliases. */ - public aliases: string[]; - - /** - * Creates a new DenomUnit instance using the specified properties. - * @param [properties] Properties to set - * @returns DenomUnit instance - */ - public static create(properties?: cosmos.bank.v1beta1.IDenomUnit): cosmos.bank.v1beta1.DenomUnit; - - /** - * Encodes the specified DenomUnit message. Does not implicitly {@link cosmos.bank.v1beta1.DenomUnit.verify|verify} messages. - * @param m DenomUnit message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.bank.v1beta1.IDenomUnit, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DenomUnit message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns DenomUnit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.bank.v1beta1.DenomUnit; - } - - /** Properties of a Metadata. */ - interface IMetadata { - /** Metadata description */ - description?: string | null; - - /** Metadata denomUnits */ - denomUnits?: cosmos.bank.v1beta1.IDenomUnit[] | null; - - /** Metadata base */ - base?: string | null; - - /** Metadata display */ - display?: string | null; - } - - /** Represents a Metadata. */ - class Metadata implements IMetadata { - /** - * Constructs a new Metadata. - * @param [p] Properties to set - */ - constructor(p?: cosmos.bank.v1beta1.IMetadata); - - /** Metadata description. */ - public description: string; - - /** Metadata denomUnits. */ - public denomUnits: cosmos.bank.v1beta1.IDenomUnit[]; - - /** Metadata base. */ - public base: string; - - /** Metadata display. */ - public display: string; - - /** - * Creates a new Metadata instance using the specified properties. - * @param [properties] Properties to set - * @returns Metadata instance - */ - public static create(properties?: cosmos.bank.v1beta1.IMetadata): cosmos.bank.v1beta1.Metadata; - - /** - * Encodes the specified Metadata message. Does not implicitly {@link cosmos.bank.v1beta1.Metadata.verify|verify} messages. - * @param m Metadata message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.bank.v1beta1.IMetadata, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Metadata message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Metadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.bank.v1beta1.Metadata; - } - - /** Represents a Msg */ - class Msg extends $protobuf.rpc.Service { - /** - * Constructs a new Msg service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Creates new Msg service using the specified rpc implementation. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - * @returns RPC service. Useful where requests and/or responses are streamed. - */ - public static create( - rpcImpl: $protobuf.RPCImpl, - requestDelimited?: boolean, - responseDelimited?: boolean, - ): Msg; - - /** - * Calls Send. - * @param request MsgSend message or plain object - * @param callback Node-style callback called with the error, if any, and MsgSendResponse - */ - public send( - request: cosmos.bank.v1beta1.IMsgSend, - callback: cosmos.bank.v1beta1.Msg.SendCallback, - ): void; - - /** - * Calls Send. - * @param request MsgSend message or plain object - * @returns Promise - */ - public send(request: cosmos.bank.v1beta1.IMsgSend): Promise; - - /** - * Calls MultiSend. - * @param request MsgMultiSend message or plain object - * @param callback Node-style callback called with the error, if any, and MsgMultiSendResponse - */ - public multiSend( - request: cosmos.bank.v1beta1.IMsgMultiSend, - callback: cosmos.bank.v1beta1.Msg.MultiSendCallback, - ): void; - - /** - * Calls MultiSend. - * @param request MsgMultiSend message or plain object - * @returns Promise - */ - public multiSend( - request: cosmos.bank.v1beta1.IMsgMultiSend, - ): Promise; - } - - namespace Msg { - /** - * Callback as used by {@link cosmos.bank.v1beta1.Msg#send}. - * @param error Error, if any - * @param [response] MsgSendResponse - */ - type SendCallback = (error: Error | null, response?: cosmos.bank.v1beta1.MsgSendResponse) => void; - - /** - * Callback as used by {@link cosmos.bank.v1beta1.Msg#multiSend}. - * @param error Error, if any - * @param [response] MsgMultiSendResponse - */ - type MultiSendCallback = ( - error: Error | null, - response?: cosmos.bank.v1beta1.MsgMultiSendResponse, - ) => void; - } - - /** Properties of a MsgSend. */ - interface IMsgSend { - /** MsgSend fromAddress */ - fromAddress?: string | null; - - /** MsgSend toAddress */ - toAddress?: string | null; - - /** MsgSend amount */ - amount?: cosmos.base.v1beta1.ICoin[] | null; - } - - /** Represents a MsgSend. */ - class MsgSend implements IMsgSend { - /** - * Constructs a new MsgSend. - * @param [p] Properties to set - */ - constructor(p?: cosmos.bank.v1beta1.IMsgSend); - - /** MsgSend fromAddress. */ - public fromAddress: string; - - /** MsgSend toAddress. */ - public toAddress: string; - - /** MsgSend amount. */ - public amount: cosmos.base.v1beta1.ICoin[]; - - /** - * Creates a new MsgSend instance using the specified properties. - * @param [properties] Properties to set - * @returns MsgSend instance - */ - public static create(properties?: cosmos.bank.v1beta1.IMsgSend): cosmos.bank.v1beta1.MsgSend; - - /** - * Encodes the specified MsgSend message. Does not implicitly {@link cosmos.bank.v1beta1.MsgSend.verify|verify} messages. - * @param m MsgSend message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.bank.v1beta1.IMsgSend, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgSend message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns MsgSend - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.bank.v1beta1.MsgSend; - } - - /** Properties of a MsgSendResponse. */ - interface IMsgSendResponse {} - - /** Represents a MsgSendResponse. */ - class MsgSendResponse implements IMsgSendResponse { - /** - * Constructs a new MsgSendResponse. - * @param [p] Properties to set - */ - constructor(p?: cosmos.bank.v1beta1.IMsgSendResponse); - - /** - * Creates a new MsgSendResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns MsgSendResponse instance - */ - public static create( - properties?: cosmos.bank.v1beta1.IMsgSendResponse, - ): cosmos.bank.v1beta1.MsgSendResponse; - - /** - * Encodes the specified MsgSendResponse message. Does not implicitly {@link cosmos.bank.v1beta1.MsgSendResponse.verify|verify} messages. - * @param m MsgSendResponse message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.bank.v1beta1.IMsgSendResponse, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgSendResponse message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns MsgSendResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.bank.v1beta1.MsgSendResponse; - } - - /** Properties of a MsgMultiSend. */ - interface IMsgMultiSend { - /** MsgMultiSend inputs */ - inputs?: cosmos.bank.v1beta1.IInput[] | null; - - /** MsgMultiSend outputs */ - outputs?: cosmos.bank.v1beta1.IOutput[] | null; - } - - /** Represents a MsgMultiSend. */ - class MsgMultiSend implements IMsgMultiSend { - /** - * Constructs a new MsgMultiSend. - * @param [p] Properties to set - */ - constructor(p?: cosmos.bank.v1beta1.IMsgMultiSend); - - /** MsgMultiSend inputs. */ - public inputs: cosmos.bank.v1beta1.IInput[]; - - /** MsgMultiSend outputs. */ - public outputs: cosmos.bank.v1beta1.IOutput[]; - - /** - * Creates a new MsgMultiSend instance using the specified properties. - * @param [properties] Properties to set - * @returns MsgMultiSend instance - */ - public static create( - properties?: cosmos.bank.v1beta1.IMsgMultiSend, - ): cosmos.bank.v1beta1.MsgMultiSend; - - /** - * Encodes the specified MsgMultiSend message. Does not implicitly {@link cosmos.bank.v1beta1.MsgMultiSend.verify|verify} messages. - * @param m MsgMultiSend message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.bank.v1beta1.IMsgMultiSend, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgMultiSend message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns MsgMultiSend - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.bank.v1beta1.MsgMultiSend; - } - - /** Properties of a MsgMultiSendResponse. */ - interface IMsgMultiSendResponse {} - - /** Represents a MsgMultiSendResponse. */ - class MsgMultiSendResponse implements IMsgMultiSendResponse { - /** - * Constructs a new MsgMultiSendResponse. - * @param [p] Properties to set - */ - constructor(p?: cosmos.bank.v1beta1.IMsgMultiSendResponse); - - /** - * Creates a new MsgMultiSendResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns MsgMultiSendResponse instance - */ - public static create( - properties?: cosmos.bank.v1beta1.IMsgMultiSendResponse, - ): cosmos.bank.v1beta1.MsgMultiSendResponse; - - /** - * Encodes the specified MsgMultiSendResponse message. Does not implicitly {@link cosmos.bank.v1beta1.MsgMultiSendResponse.verify|verify} messages. - * @param m MsgMultiSendResponse message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.bank.v1beta1.IMsgMultiSendResponse, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a MsgMultiSendResponse message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns MsgMultiSendResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.bank.v1beta1.MsgMultiSendResponse; - } - } - } - - /** Namespace base. */ - namespace base { - /** Namespace v1beta1. */ - namespace v1beta1 { - /** Properties of a Coin. */ - interface ICoin { - /** Coin denom */ - denom?: string | null; - - /** Coin amount */ - amount?: string | null; - } - - /** Represents a Coin. */ - class Coin implements ICoin { - /** - * Constructs a new Coin. - * @param [p] Properties to set - */ - constructor(p?: cosmos.base.v1beta1.ICoin); - - /** Coin denom. */ - public denom: string; - - /** Coin amount. */ - public amount: string; - - /** - * Creates a new Coin instance using the specified properties. - * @param [properties] Properties to set - * @returns Coin instance - */ - public static create(properties?: cosmos.base.v1beta1.ICoin): cosmos.base.v1beta1.Coin; - - /** - * Encodes the specified Coin message. Does not implicitly {@link cosmos.base.v1beta1.Coin.verify|verify} messages. - * @param m Coin message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.base.v1beta1.ICoin, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Coin message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Coin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.base.v1beta1.Coin; - } - - /** Properties of a DecCoin. */ - interface IDecCoin { - /** DecCoin denom */ - denom?: string | null; - - /** DecCoin amount */ - amount?: string | null; - } - - /** Represents a DecCoin. */ - class DecCoin implements IDecCoin { - /** - * Constructs a new DecCoin. - * @param [p] Properties to set - */ - constructor(p?: cosmos.base.v1beta1.IDecCoin); - - /** DecCoin denom. */ - public denom: string; - - /** DecCoin amount. */ - public amount: string; - - /** - * Creates a new DecCoin instance using the specified properties. - * @param [properties] Properties to set - * @returns DecCoin instance - */ - public static create(properties?: cosmos.base.v1beta1.IDecCoin): cosmos.base.v1beta1.DecCoin; - - /** - * Encodes the specified DecCoin message. Does not implicitly {@link cosmos.base.v1beta1.DecCoin.verify|verify} messages. - * @param m DecCoin message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.base.v1beta1.IDecCoin, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DecCoin message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns DecCoin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.base.v1beta1.DecCoin; - } - - /** Properties of an IntProto. */ - interface IIntProto { - /** IntProto int */ - int?: string | null; - } - - /** Represents an IntProto. */ - class IntProto implements IIntProto { - /** - * Constructs a new IntProto. - * @param [p] Properties to set - */ - constructor(p?: cosmos.base.v1beta1.IIntProto); - - /** IntProto int. */ - public int: string; - - /** - * Creates a new IntProto instance using the specified properties. - * @param [properties] Properties to set - * @returns IntProto instance - */ - public static create(properties?: cosmos.base.v1beta1.IIntProto): cosmos.base.v1beta1.IntProto; - - /** - * Encodes the specified IntProto message. Does not implicitly {@link cosmos.base.v1beta1.IntProto.verify|verify} messages. - * @param m IntProto message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.base.v1beta1.IIntProto, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an IntProto message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns IntProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.base.v1beta1.IntProto; - } - - /** Properties of a DecProto. */ - interface IDecProto { - /** DecProto dec */ - dec?: string | null; - } - - /** Represents a DecProto. */ - class DecProto implements IDecProto { - /** - * Constructs a new DecProto. - * @param [p] Properties to set - */ - constructor(p?: cosmos.base.v1beta1.IDecProto); - - /** DecProto dec. */ - public dec: string; - - /** - * Creates a new DecProto instance using the specified properties. - * @param [properties] Properties to set - * @returns DecProto instance - */ - public static create(properties?: cosmos.base.v1beta1.IDecProto): cosmos.base.v1beta1.DecProto; - - /** - * Encodes the specified DecProto message. Does not implicitly {@link cosmos.base.v1beta1.DecProto.verify|verify} messages. - * @param m DecProto message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.base.v1beta1.IDecProto, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DecProto message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns DecProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.base.v1beta1.DecProto; - } - } - } - - /** Namespace crypto. */ - namespace crypto { - /** Namespace multisig. */ - namespace multisig { - /** Namespace v1beta1. */ - namespace v1beta1 { - /** Properties of a MultiSignature. */ - interface IMultiSignature { - /** MultiSignature signatures */ - signatures?: Uint8Array[] | null; - } - - /** Represents a MultiSignature. */ - class MultiSignature implements IMultiSignature { - /** - * Constructs a new MultiSignature. - * @param [p] Properties to set - */ - constructor(p?: cosmos.crypto.multisig.v1beta1.IMultiSignature); - - /** MultiSignature signatures. */ - public signatures: Uint8Array[]; - - /** - * Creates a new MultiSignature instance using the specified properties. - * @param [properties] Properties to set - * @returns MultiSignature instance - */ - public static create( - properties?: cosmos.crypto.multisig.v1beta1.IMultiSignature, - ): cosmos.crypto.multisig.v1beta1.MultiSignature; - - /** - * Encodes the specified MultiSignature message. Does not implicitly {@link cosmos.crypto.multisig.v1beta1.MultiSignature.verify|verify} messages. - * @param m MultiSignature message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.crypto.multisig.v1beta1.IMultiSignature, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a MultiSignature message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns MultiSignature - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.crypto.multisig.v1beta1.MultiSignature; - } - - /** Properties of a CompactBitArray. */ - interface ICompactBitArray { - /** CompactBitArray extraBitsStored */ - extraBitsStored?: number | null; - - /** CompactBitArray elems */ - elems?: Uint8Array | null; - } - - /** Represents a CompactBitArray. */ - class CompactBitArray implements ICompactBitArray { - /** - * Constructs a new CompactBitArray. - * @param [p] Properties to set - */ - constructor(p?: cosmos.crypto.multisig.v1beta1.ICompactBitArray); - - /** CompactBitArray extraBitsStored. */ - public extraBitsStored: number; - - /** CompactBitArray elems. */ - public elems: Uint8Array; - - /** - * Creates a new CompactBitArray instance using the specified properties. - * @param [properties] Properties to set - * @returns CompactBitArray instance - */ - public static create( - properties?: cosmos.crypto.multisig.v1beta1.ICompactBitArray, - ): cosmos.crypto.multisig.v1beta1.CompactBitArray; - - /** - * Encodes the specified CompactBitArray message. Does not implicitly {@link cosmos.crypto.multisig.v1beta1.CompactBitArray.verify|verify} messages. - * @param m CompactBitArray message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.crypto.multisig.v1beta1.ICompactBitArray, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a CompactBitArray message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns CompactBitArray - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.crypto.multisig.v1beta1.CompactBitArray; - } - } - } - - /** Namespace secp256k1. */ - namespace secp256k1 { - /** Properties of a PubKey. */ - interface IPubKey { - /** PubKey key */ - key?: Uint8Array | null; - } - - /** Represents a PubKey. */ - class PubKey implements IPubKey { - /** - * Constructs a new PubKey. - * @param [p] Properties to set - */ - constructor(p?: cosmos.crypto.secp256k1.IPubKey); - - /** PubKey key. */ - public key: Uint8Array; - - /** - * Creates a new PubKey instance using the specified properties. - * @param [properties] Properties to set - * @returns PubKey instance - */ - public static create(properties?: cosmos.crypto.secp256k1.IPubKey): cosmos.crypto.secp256k1.PubKey; - - /** - * Encodes the specified PubKey message. Does not implicitly {@link cosmos.crypto.secp256k1.PubKey.verify|verify} messages. - * @param m PubKey message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.crypto.secp256k1.IPubKey, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PubKey message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns PubKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.crypto.secp256k1.PubKey; - } - - /** Properties of a PrivKey. */ - interface IPrivKey { - /** PrivKey key */ - key?: Uint8Array | null; - } - - /** Represents a PrivKey. */ - class PrivKey implements IPrivKey { - /** - * Constructs a new PrivKey. - * @param [p] Properties to set - */ - constructor(p?: cosmos.crypto.secp256k1.IPrivKey); - - /** PrivKey key. */ - public key: Uint8Array; - - /** - * Creates a new PrivKey instance using the specified properties. - * @param [properties] Properties to set - * @returns PrivKey instance - */ - public static create(properties?: cosmos.crypto.secp256k1.IPrivKey): cosmos.crypto.secp256k1.PrivKey; - - /** - * Encodes the specified PrivKey message. Does not implicitly {@link cosmos.crypto.secp256k1.PrivKey.verify|verify} messages. - * @param m PrivKey message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.crypto.secp256k1.IPrivKey, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PrivKey message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns PrivKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.crypto.secp256k1.PrivKey; - } - } - } - - /** Namespace tx. */ - namespace tx { - /** Namespace v1beta1. */ - namespace v1beta1 { - /** Properties of a Tx. */ - interface ITx { - /** Tx body */ - body?: cosmos.tx.v1beta1.ITxBody | null; - - /** Tx authInfo */ - authInfo?: cosmos.tx.v1beta1.IAuthInfo | null; - - /** Tx signatures */ - signatures?: Uint8Array[] | null; - } - - /** Represents a Tx. */ - class Tx implements ITx { - /** - * Constructs a new Tx. - * @param [p] Properties to set - */ - constructor(p?: cosmos.tx.v1beta1.ITx); - - /** Tx body. */ - public body?: cosmos.tx.v1beta1.ITxBody | null; - - /** Tx authInfo. */ - public authInfo?: cosmos.tx.v1beta1.IAuthInfo | null; - - /** Tx signatures. */ - public signatures: Uint8Array[]; - - /** - * Creates a new Tx instance using the specified properties. - * @param [properties] Properties to set - * @returns Tx instance - */ - public static create(properties?: cosmos.tx.v1beta1.ITx): cosmos.tx.v1beta1.Tx; - - /** - * Encodes the specified Tx message. Does not implicitly {@link cosmos.tx.v1beta1.Tx.verify|verify} messages. - * @param m Tx message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.tx.v1beta1.ITx, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Tx message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Tx - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.tx.v1beta1.Tx; - } - - /** Properties of a TxRaw. */ - interface ITxRaw { - /** TxRaw bodyBytes */ - bodyBytes?: Uint8Array | null; - - /** TxRaw authInfoBytes */ - authInfoBytes?: Uint8Array | null; - - /** TxRaw signatures */ - signatures?: Uint8Array[] | null; - } - - /** Represents a TxRaw. */ - class TxRaw implements ITxRaw { - /** - * Constructs a new TxRaw. - * @param [p] Properties to set - */ - constructor(p?: cosmos.tx.v1beta1.ITxRaw); - - /** TxRaw bodyBytes. */ - public bodyBytes: Uint8Array; - - /** TxRaw authInfoBytes. */ - public authInfoBytes: Uint8Array; - - /** TxRaw signatures. */ - public signatures: Uint8Array[]; - - /** - * Creates a new TxRaw instance using the specified properties. - * @param [properties] Properties to set - * @returns TxRaw instance - */ - public static create(properties?: cosmos.tx.v1beta1.ITxRaw): cosmos.tx.v1beta1.TxRaw; - - /** - * Encodes the specified TxRaw message. Does not implicitly {@link cosmos.tx.v1beta1.TxRaw.verify|verify} messages. - * @param m TxRaw message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.tx.v1beta1.ITxRaw, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TxRaw message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns TxRaw - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.tx.v1beta1.TxRaw; - } - - /** Properties of a SignDoc. */ - interface ISignDoc { - /** SignDoc bodyBytes */ - bodyBytes?: Uint8Array | null; - - /** SignDoc authInfoBytes */ - authInfoBytes?: Uint8Array | null; - - /** SignDoc chainId */ - chainId?: string | null; - - /** SignDoc accountNumber */ - accountNumber?: Long | null; - } - - /** Represents a SignDoc. */ - class SignDoc implements ISignDoc { - /** - * Constructs a new SignDoc. - * @param [p] Properties to set - */ - constructor(p?: cosmos.tx.v1beta1.ISignDoc); - - /** SignDoc bodyBytes. */ - public bodyBytes: Uint8Array; - - /** SignDoc authInfoBytes. */ - public authInfoBytes: Uint8Array; - - /** SignDoc chainId. */ - public chainId: string; - - /** SignDoc accountNumber. */ - public accountNumber: Long; - - /** - * Creates a new SignDoc instance using the specified properties. - * @param [properties] Properties to set - * @returns SignDoc instance - */ - public static create(properties?: cosmos.tx.v1beta1.ISignDoc): cosmos.tx.v1beta1.SignDoc; - - /** - * Encodes the specified SignDoc message. Does not implicitly {@link cosmos.tx.v1beta1.SignDoc.verify|verify} messages. - * @param m SignDoc message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.tx.v1beta1.ISignDoc, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SignDoc message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns SignDoc - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.tx.v1beta1.SignDoc; - } - - /** Properties of a TxBody. */ - interface ITxBody { - /** TxBody messages */ - messages?: google.protobuf.IAny[] | null; - - /** TxBody memo */ - memo?: string | null; - - /** TxBody timeoutHeight */ - timeoutHeight?: Long | null; - - /** TxBody extensionOptions */ - extensionOptions?: google.protobuf.IAny[] | null; - - /** TxBody nonCriticalExtensionOptions */ - nonCriticalExtensionOptions?: google.protobuf.IAny[] | null; - } - - /** Represents a TxBody. */ - class TxBody implements ITxBody { - /** - * Constructs a new TxBody. - * @param [p] Properties to set - */ - constructor(p?: cosmos.tx.v1beta1.ITxBody); - - /** TxBody messages. */ - public messages: google.protobuf.IAny[]; - - /** TxBody memo. */ - public memo: string; - - /** TxBody timeoutHeight. */ - public timeoutHeight: Long; - - /** TxBody extensionOptions. */ - public extensionOptions: google.protobuf.IAny[]; - - /** TxBody nonCriticalExtensionOptions. */ - public nonCriticalExtensionOptions: google.protobuf.IAny[]; - - /** - * Creates a new TxBody instance using the specified properties. - * @param [properties] Properties to set - * @returns TxBody instance - */ - public static create(properties?: cosmos.tx.v1beta1.ITxBody): cosmos.tx.v1beta1.TxBody; - - /** - * Encodes the specified TxBody message. Does not implicitly {@link cosmos.tx.v1beta1.TxBody.verify|verify} messages. - * @param m TxBody message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.tx.v1beta1.ITxBody, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TxBody message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns TxBody - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.tx.v1beta1.TxBody; - } - - /** Properties of an AuthInfo. */ - interface IAuthInfo { - /** AuthInfo signerInfos */ - signerInfos?: cosmos.tx.v1beta1.ISignerInfo[] | null; - - /** AuthInfo fee */ - fee?: cosmos.tx.v1beta1.IFee | null; - } - - /** Represents an AuthInfo. */ - class AuthInfo implements IAuthInfo { - /** - * Constructs a new AuthInfo. - * @param [p] Properties to set - */ - constructor(p?: cosmos.tx.v1beta1.IAuthInfo); - - /** AuthInfo signerInfos. */ - public signerInfos: cosmos.tx.v1beta1.ISignerInfo[]; - - /** AuthInfo fee. */ - public fee?: cosmos.tx.v1beta1.IFee | null; - - /** - * Creates a new AuthInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns AuthInfo instance - */ - public static create(properties?: cosmos.tx.v1beta1.IAuthInfo): cosmos.tx.v1beta1.AuthInfo; - - /** - * Encodes the specified AuthInfo message. Does not implicitly {@link cosmos.tx.v1beta1.AuthInfo.verify|verify} messages. - * @param m AuthInfo message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.tx.v1beta1.IAuthInfo, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AuthInfo message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns AuthInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.tx.v1beta1.AuthInfo; - } - - /** Properties of a SignerInfo. */ - interface ISignerInfo { - /** SignerInfo publicKey */ - publicKey?: google.protobuf.IAny | null; - - /** SignerInfo modeInfo */ - modeInfo?: cosmos.tx.v1beta1.IModeInfo | null; - - /** SignerInfo sequence */ - sequence?: Long | null; - } - - /** Represents a SignerInfo. */ - class SignerInfo implements ISignerInfo { - /** - * Constructs a new SignerInfo. - * @param [p] Properties to set - */ - constructor(p?: cosmos.tx.v1beta1.ISignerInfo); - - /** SignerInfo publicKey. */ - public publicKey?: google.protobuf.IAny | null; - - /** SignerInfo modeInfo. */ - public modeInfo?: cosmos.tx.v1beta1.IModeInfo | null; - - /** SignerInfo sequence. */ - public sequence: Long; - - /** - * Creates a new SignerInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns SignerInfo instance - */ - public static create(properties?: cosmos.tx.v1beta1.ISignerInfo): cosmos.tx.v1beta1.SignerInfo; - - /** - * Encodes the specified SignerInfo message. Does not implicitly {@link cosmos.tx.v1beta1.SignerInfo.verify|verify} messages. - * @param m SignerInfo message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.tx.v1beta1.ISignerInfo, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SignerInfo message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns SignerInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.tx.v1beta1.SignerInfo; - } - - /** Properties of a ModeInfo. */ - interface IModeInfo { - /** ModeInfo single */ - single?: cosmos.tx.v1beta1.ModeInfo.ISingle | null; - - /** ModeInfo multi */ - multi?: cosmos.tx.v1beta1.ModeInfo.IMulti | null; - } - - /** Represents a ModeInfo. */ - class ModeInfo implements IModeInfo { - /** - * Constructs a new ModeInfo. - * @param [p] Properties to set - */ - constructor(p?: cosmos.tx.v1beta1.IModeInfo); - - /** ModeInfo single. */ - public single?: cosmos.tx.v1beta1.ModeInfo.ISingle | null; - - /** ModeInfo multi. */ - public multi?: cosmos.tx.v1beta1.ModeInfo.IMulti | null; - - /** ModeInfo sum. */ - public sum?: "single" | "multi"; - - /** - * Creates a new ModeInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns ModeInfo instance - */ - public static create(properties?: cosmos.tx.v1beta1.IModeInfo): cosmos.tx.v1beta1.ModeInfo; - - /** - * Encodes the specified ModeInfo message. Does not implicitly {@link cosmos.tx.v1beta1.ModeInfo.verify|verify} messages. - * @param m ModeInfo message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.tx.v1beta1.IModeInfo, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ModeInfo message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns ModeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.tx.v1beta1.ModeInfo; - } - - namespace ModeInfo { - /** Properties of a Single. */ - interface ISingle { - /** Single mode */ - mode?: cosmos.tx.signing.v1beta1.SignMode | null; - } - - /** Represents a Single. */ - class Single implements ISingle { - /** - * Constructs a new Single. - * @param [p] Properties to set - */ - constructor(p?: cosmos.tx.v1beta1.ModeInfo.ISingle); - - /** Single mode. */ - public mode: cosmos.tx.signing.v1beta1.SignMode; - - /** - * Creates a new Single instance using the specified properties. - * @param [properties] Properties to set - * @returns Single instance - */ - public static create( - properties?: cosmos.tx.v1beta1.ModeInfo.ISingle, - ): cosmos.tx.v1beta1.ModeInfo.Single; - - /** - * Encodes the specified Single message. Does not implicitly {@link cosmos.tx.v1beta1.ModeInfo.Single.verify|verify} messages. - * @param m Single message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.tx.v1beta1.ModeInfo.ISingle, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Single message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Single - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.tx.v1beta1.ModeInfo.Single; - } - - /** Properties of a Multi. */ - interface IMulti { - /** Multi bitarray */ - bitarray?: cosmos.crypto.multisig.v1beta1.ICompactBitArray | null; - - /** Multi modeInfos */ - modeInfos?: cosmos.tx.v1beta1.IModeInfo[] | null; - } - - /** Represents a Multi. */ - class Multi implements IMulti { - /** - * Constructs a new Multi. - * @param [p] Properties to set - */ - constructor(p?: cosmos.tx.v1beta1.ModeInfo.IMulti); - - /** Multi bitarray. */ - public bitarray?: cosmos.crypto.multisig.v1beta1.ICompactBitArray | null; - - /** Multi modeInfos. */ - public modeInfos: cosmos.tx.v1beta1.IModeInfo[]; - - /** - * Creates a new Multi instance using the specified properties. - * @param [properties] Properties to set - * @returns Multi instance - */ - public static create( - properties?: cosmos.tx.v1beta1.ModeInfo.IMulti, - ): cosmos.tx.v1beta1.ModeInfo.Multi; - - /** - * Encodes the specified Multi message. Does not implicitly {@link cosmos.tx.v1beta1.ModeInfo.Multi.verify|verify} messages. - * @param m Multi message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.tx.v1beta1.ModeInfo.IMulti, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Multi message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Multi - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.tx.v1beta1.ModeInfo.Multi; - } - } - - /** Properties of a Fee. */ - interface IFee { - /** Fee amount */ - amount?: cosmos.base.v1beta1.ICoin[] | null; - - /** Fee gasLimit */ - gasLimit?: Long | null; - - /** Fee payer */ - payer?: string | null; - - /** Fee granter */ - granter?: string | null; - } - - /** Represents a Fee. */ - class Fee implements IFee { - /** - * Constructs a new Fee. - * @param [p] Properties to set - */ - constructor(p?: cosmos.tx.v1beta1.IFee); - - /** Fee amount. */ - public amount: cosmos.base.v1beta1.ICoin[]; - - /** Fee gasLimit. */ - public gasLimit: Long; - - /** Fee payer. */ - public payer: string; - - /** Fee granter. */ - public granter: string; - - /** - * Creates a new Fee instance using the specified properties. - * @param [properties] Properties to set - * @returns Fee instance - */ - public static create(properties?: cosmos.tx.v1beta1.IFee): cosmos.tx.v1beta1.Fee; - - /** - * Encodes the specified Fee message. Does not implicitly {@link cosmos.tx.v1beta1.Fee.verify|verify} messages. - * @param m Fee message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: cosmos.tx.v1beta1.IFee, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Fee message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Fee - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.tx.v1beta1.Fee; - } - } - - /** Namespace signing. */ - namespace signing { - /** Namespace v1beta1. */ - namespace v1beta1 { - /** SignMode enum. */ - enum SignMode { - SIGN_MODE_UNSPECIFIED = 0, - SIGN_MODE_DIRECT = 1, - SIGN_MODE_TEXTUAL = 2, - SIGN_MODE_LEGACY_AMINO_JSON = 127, - } - - /** Properties of a SignatureDescriptors. */ - interface ISignatureDescriptors { - /** SignatureDescriptors signatures */ - signatures?: cosmos.tx.signing.v1beta1.ISignatureDescriptor[] | null; - } - - /** Represents a SignatureDescriptors. */ - class SignatureDescriptors implements ISignatureDescriptors { - /** - * Constructs a new SignatureDescriptors. - * @param [p] Properties to set - */ - constructor(p?: cosmos.tx.signing.v1beta1.ISignatureDescriptors); - - /** SignatureDescriptors signatures. */ - public signatures: cosmos.tx.signing.v1beta1.ISignatureDescriptor[]; - - /** - * Creates a new SignatureDescriptors instance using the specified properties. - * @param [properties] Properties to set - * @returns SignatureDescriptors instance - */ - public static create( - properties?: cosmos.tx.signing.v1beta1.ISignatureDescriptors, - ): cosmos.tx.signing.v1beta1.SignatureDescriptors; - - /** - * Encodes the specified SignatureDescriptors message. Does not implicitly {@link cosmos.tx.signing.v1beta1.SignatureDescriptors.verify|verify} messages. - * @param m SignatureDescriptors message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.tx.signing.v1beta1.ISignatureDescriptors, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a SignatureDescriptors message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns SignatureDescriptors - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.tx.signing.v1beta1.SignatureDescriptors; - } - - /** Properties of a SignatureDescriptor. */ - interface ISignatureDescriptor { - /** SignatureDescriptor publicKey */ - publicKey?: google.protobuf.IAny | null; - - /** SignatureDescriptor data */ - data?: cosmos.tx.signing.v1beta1.SignatureDescriptor.IData | null; - - /** SignatureDescriptor sequence */ - sequence?: Long | null; - } - - /** Represents a SignatureDescriptor. */ - class SignatureDescriptor implements ISignatureDescriptor { - /** - * Constructs a new SignatureDescriptor. - * @param [p] Properties to set - */ - constructor(p?: cosmos.tx.signing.v1beta1.ISignatureDescriptor); - - /** SignatureDescriptor publicKey. */ - public publicKey?: google.protobuf.IAny | null; - - /** SignatureDescriptor data. */ - public data?: cosmos.tx.signing.v1beta1.SignatureDescriptor.IData | null; - - /** SignatureDescriptor sequence. */ - public sequence: Long; - - /** - * Creates a new SignatureDescriptor instance using the specified properties. - * @param [properties] Properties to set - * @returns SignatureDescriptor instance - */ - public static create( - properties?: cosmos.tx.signing.v1beta1.ISignatureDescriptor, - ): cosmos.tx.signing.v1beta1.SignatureDescriptor; - - /** - * Encodes the specified SignatureDescriptor message. Does not implicitly {@link cosmos.tx.signing.v1beta1.SignatureDescriptor.verify|verify} messages. - * @param m SignatureDescriptor message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.tx.signing.v1beta1.ISignatureDescriptor, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a SignatureDescriptor message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns SignatureDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.tx.signing.v1beta1.SignatureDescriptor; - } - - namespace SignatureDescriptor { - /** Properties of a Data. */ - interface IData { - /** Data single */ - single?: cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.ISingle | null; - - /** Data multi */ - multi?: cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.IMulti | null; - } - - /** Represents a Data. */ - class Data implements IData { - /** - * Constructs a new Data. - * @param [p] Properties to set - */ - constructor(p?: cosmos.tx.signing.v1beta1.SignatureDescriptor.IData); - - /** Data single. */ - public single?: cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.ISingle | null; - - /** Data multi. */ - public multi?: cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.IMulti | null; - - /** Data sum. */ - public sum?: "single" | "multi"; - - /** - * Creates a new Data instance using the specified properties. - * @param [properties] Properties to set - * @returns Data instance - */ - public static create( - properties?: cosmos.tx.signing.v1beta1.SignatureDescriptor.IData, - ): cosmos.tx.signing.v1beta1.SignatureDescriptor.Data; - - /** - * Encodes the specified Data message. Does not implicitly {@link cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.verify|verify} messages. - * @param m Data message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.tx.signing.v1beta1.SignatureDescriptor.IData, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a Data message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Data - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.tx.signing.v1beta1.SignatureDescriptor.Data; - } - - namespace Data { - /** Properties of a Single. */ - interface ISingle { - /** Single mode */ - mode?: cosmos.tx.signing.v1beta1.SignMode | null; - - /** Single signature */ - signature?: Uint8Array | null; - } - - /** Represents a Single. */ - class Single implements ISingle { - /** - * Constructs a new Single. - * @param [p] Properties to set - */ - constructor(p?: cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.ISingle); - - /** Single mode. */ - public mode: cosmos.tx.signing.v1beta1.SignMode; - - /** Single signature. */ - public signature: Uint8Array; - - /** - * Creates a new Single instance using the specified properties. - * @param [properties] Properties to set - * @returns Single instance - */ - public static create( - properties?: cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.ISingle, - ): cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single; - - /** - * Encodes the specified Single message. Does not implicitly {@link cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single.verify|verify} messages. - * @param m Single message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.ISingle, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a Single message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Single - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single; - } - - /** Properties of a Multi. */ - interface IMulti { - /** Multi bitarray */ - bitarray?: cosmos.crypto.multisig.v1beta1.ICompactBitArray | null; - - /** Multi signatures */ - signatures?: cosmos.tx.signing.v1beta1.SignatureDescriptor.IData[] | null; - } - - /** Represents a Multi. */ - class Multi implements IMulti { - /** - * Constructs a new Multi. - * @param [p] Properties to set - */ - constructor(p?: cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.IMulti); - - /** Multi bitarray. */ - public bitarray?: cosmos.crypto.multisig.v1beta1.ICompactBitArray | null; - - /** Multi signatures. */ - public signatures: cosmos.tx.signing.v1beta1.SignatureDescriptor.IData[]; - - /** - * Creates a new Multi instance using the specified properties. - * @param [properties] Properties to set - * @returns Multi instance - */ - public static create( - properties?: cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.IMulti, - ): cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi; - - /** - * Encodes the specified Multi message. Does not implicitly {@link cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi.verify|verify} messages. - * @param m Multi message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode( - m: cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.IMulti, - w?: $protobuf.Writer, - ): $protobuf.Writer; - - /** - * Decodes a Multi message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Multi - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode( - r: $protobuf.Reader | Uint8Array, - l?: number, - ): cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi; - } - } - } - } - } - } -} - -/** Namespace google. */ -export namespace google { - /** Namespace protobuf. */ - namespace protobuf { - /** Properties of an Any. */ - interface IAny { - /** Any type_url */ - type_url?: string | null; - - /** Any value */ - value?: Uint8Array | null; - } - - /** Represents an Any. */ - class Any implements IAny { - /** - * Constructs a new Any. - * @param [p] Properties to set - */ - constructor(p?: google.protobuf.IAny); - - /** Any type_url. */ - public type_url: string; - - /** Any value. */ - public value: Uint8Array; - - /** - * Creates a new Any instance using the specified properties. - * @param [properties] Properties to set - * @returns Any instance - */ - public static create(properties?: google.protobuf.IAny): google.protobuf.Any; - - /** - * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @param m Any message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: google.protobuf.IAny, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Any message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): google.protobuf.Any; - } - } -} - -/** Namespace tendermint. */ -export namespace tendermint { - /** Namespace crypto. */ - namespace crypto { - /** Properties of a PublicKey. */ - interface IPublicKey { - /** PublicKey ed25519 */ - ed25519?: Uint8Array | null; - - /** PublicKey secp256k1 */ - secp256k1?: Uint8Array | null; - } - - /** Represents a PublicKey. */ - class PublicKey implements IPublicKey { - /** - * Constructs a new PublicKey. - * @param [p] Properties to set - */ - constructor(p?: tendermint.crypto.IPublicKey); - - /** PublicKey ed25519. */ - public ed25519: Uint8Array; - - /** PublicKey secp256k1. */ - public secp256k1: Uint8Array; - - /** PublicKey sum. */ - public sum?: "ed25519" | "secp256k1"; - - /** - * Creates a new PublicKey instance using the specified properties. - * @param [properties] Properties to set - * @returns PublicKey instance - */ - public static create(properties?: tendermint.crypto.IPublicKey): tendermint.crypto.PublicKey; - - /** - * Encodes the specified PublicKey message. Does not implicitly {@link tendermint.crypto.PublicKey.verify|verify} messages. - * @param m PublicKey message or plain object to encode - * @param [w] Writer to encode to - * @returns Writer - */ - public static encode(m: tendermint.crypto.IPublicKey, w?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PublicKey message from the specified reader or buffer. - * @param r Reader or buffer to decode from - * @param [l] Message length if known beforehand - * @returns PublicKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(r: $protobuf.Reader | Uint8Array, l?: number): tendermint.crypto.PublicKey; - } - } -} diff --git a/packages/proto-signing/types/codec/gogoproto/gogo.d.ts b/packages/proto-signing/types/codec/gogoproto/gogo.d.ts new file mode 100644 index 00000000..885d30bd --- /dev/null +++ b/packages/proto-signing/types/codec/gogoproto/gogo.d.ts @@ -0,0 +1 @@ +export declare const protobufPackage = "gogoproto"; diff --git a/packages/proto-signing/types/codec/google/protobuf/any.d.ts b/packages/proto-signing/types/codec/google/protobuf/any.d.ts new file mode 100644 index 00000000..75353dac --- /dev/null +++ b/packages/proto-signing/types/codec/google/protobuf/any.d.ts @@ -0,0 +1,141 @@ +import { Writer, Reader } from "protobufjs/minimal"; +/** + * `Any` contains an arbitrary serialized protocol buffer message along with a + * URL that describes the type of the serialized message. + * + * Protobuf library provides support to pack/unpack Any values in the form + * of utility functions or additional generated methods of the Any type. + * + * Example 1: Pack and unpack a message in C++. + * + * Foo foo = ...; + * Any any; + * any.PackFrom(foo); + * ... + * if (any.UnpackTo(&foo)) { + * ... + * } + * + * Example 2: Pack and unpack a message in Java. + * + * Foo foo = ...; + * Any any = Any.pack(foo); + * ... + * if (any.is(Foo.class)) { + * foo = any.unpack(Foo.class); + * } + * + * Example 3: Pack and unpack a message in Python. + * + * foo = Foo(...) + * any = Any() + * any.Pack(foo) + * ... + * if any.Is(Foo.DESCRIPTOR): + * any.Unpack(foo) + * ... + * + * Example 4: Pack and unpack a message in Go + * + * foo := &pb.Foo{...} + * any, err := ptypes.MarshalAny(foo) + * ... + * foo := &pb.Foo{} + * if err := ptypes.UnmarshalAny(any, foo); err != nil { + * ... + * } + * + * The pack methods provided by protobuf library will by default use + * 'type.googleapis.com/full.type.name' as the type URL and the unpack + * methods only use the fully qualified type name after the last '/' + * in the type URL, for example "foo.bar.com/x/y.z" will yield type + * name "y.z". + * + * + * JSON + * ==== + * The JSON representation of an `Any` value uses the regular + * representation of the deserialized, embedded message, with an + * additional field `@type` which contains the type URL. Example: + * + * package google.profile; + * message Person { + * string first_name = 1; + * string last_name = 2; + * } + * + * { + * "@type": "type.googleapis.com/google.profile.Person", + * "firstName": , + * "lastName": + * } + * + * If the embedded message type is well-known and has a custom JSON + * representation, that representation will be embedded adding a field + * `value` which holds the custom JSON in addition to the `@type` + * field. Example (for message [google.protobuf.Duration][]): + * + * { + * "@type": "type.googleapis.com/google.protobuf.Duration", + * "value": "1.212s" + * } + * + */ +export interface Any { + /** + * A URL/resource name that uniquely identifies the type of the serialized + * protocol buffer message. This string must contain at least + * one "/" character. The last segment of the URL's path must represent + * the fully qualified name of the type (as in + * `path/google.protobuf.Duration`). The name should be in a canonical form + * (e.g., leading "." is not accepted). + * + * In practice, teams usually precompile into the binary all types that they + * expect it to use in the context of Any. However, for URLs which use the + * scheme `http`, `https`, or no scheme, one can optionally set up a type + * server that maps type URLs to message definitions as follows: + * + * * If no scheme is provided, `https` is assumed. + * * An HTTP GET on the URL must yield a [google.protobuf.Type][] + * value in binary format, or produce an error. + * * Applications are allowed to cache lookup results based on the + * URL, or have them precompiled into a binary to avoid any + * lookup. Therefore, binary compatibility needs to be preserved + * on changes to types. (Use versioned type names to manage + * breaking changes.) + * + * Note: this functionality is not currently available in the official + * protobuf release, and it is not used for type URLs beginning with + * type.googleapis.com. + * + * Schemes other than `http`, `https` (or the empty scheme) might be + * used with implementation specific semantics. + * + */ + typeUrl: string; + /** + * Must be a valid serialized protocol buffer of the above specified type. + */ + value: Uint8Array; +} +export declare const protobufPackage = "google.protobuf"; +export declare const Any: { + encode(message: Any, writer?: Writer): Writer; + decode(input: Uint8Array | Reader, length?: number | undefined): Any; + fromJSON(object: any): Any; + fromPartial(object: DeepPartial): Any; + toJSON(message: Any): unknown; +}; +declare type Builtin = Date | Function | Uint8Array | string | number | undefined; +export declare type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { + [K in keyof T]?: DeepPartial; + } + : Partial; +export {}; diff --git a/packages/proto-signing/types/codec/google/protobuf/descriptor.d.ts b/packages/proto-signing/types/codec/google/protobuf/descriptor.d.ts new file mode 100644 index 00000000..8f16042e --- /dev/null +++ b/packages/proto-signing/types/codec/google/protobuf/descriptor.d.ts @@ -0,0 +1,1105 @@ +import * as Long from "long"; +import { Writer, Reader } from "protobufjs/minimal"; +/** + * The protocol compiler can output a FileDescriptorSet containing the .proto + * files it parses. + */ +export interface FileDescriptorSet { + file: FileDescriptorProto[]; +} +/** + * Describes a complete .proto file. + */ +export interface FileDescriptorProto { + /** + * file name, relative to root of source tree + */ + name: string; + /** + * e.g. "foo", "foo.bar", etc. + */ + package: string; + /** + * Names of files imported by this file. + */ + dependency: string[]; + /** + * Indexes of the public imported files in the dependency list above. + */ + publicDependency: number[]; + /** + * Indexes of the weak imported files in the dependency list. + * For Google-internal migration only. Do not use. + */ + weakDependency: number[]; + /** + * All top-level definitions in this file. + */ + messageType: DescriptorProto[]; + enumType: EnumDescriptorProto[]; + service: ServiceDescriptorProto[]; + extension: FieldDescriptorProto[]; + options?: FileOptions; + /** + * This field contains optional information about the original source code. + * You may safely remove this entire field without harming runtime + * functionality of the descriptors -- the information is needed only by + * development tools. + */ + sourceCodeInfo?: SourceCodeInfo; + /** + * The syntax of the proto file. + * The supported values are "proto2" and "proto3". + */ + syntax: string; +} +/** + * Describes a message type. + */ +export interface DescriptorProto { + name: string; + field: FieldDescriptorProto[]; + extension: FieldDescriptorProto[]; + nestedType: DescriptorProto[]; + enumType: EnumDescriptorProto[]; + extensionRange: DescriptorProto_ExtensionRange[]; + oneofDecl: OneofDescriptorProto[]; + options?: MessageOptions; + reservedRange: DescriptorProto_ReservedRange[]; + /** + * Reserved field names, which may not be used by fields in the same message. + * A given name may only be reserved once. + */ + reservedName: string[]; +} +export interface DescriptorProto_ExtensionRange { + /** + * Inclusive. + */ + start: number; + /** + * Exclusive. + */ + end: number; + options?: ExtensionRangeOptions; +} +/** + * Range of reserved tag numbers. Reserved tag numbers may not be used by + * fields or extension ranges in the same message. Reserved ranges may + * not overlap. + */ +export interface DescriptorProto_ReservedRange { + /** + * Inclusive. + */ + start: number; + /** + * Exclusive. + */ + end: number; +} +export interface ExtensionRangeOptions { + /** + * The parser stores options it doesn't recognize here. See above. + */ + uninterpretedOption: UninterpretedOption[]; +} +/** + * Describes a field within a message. + */ +export interface FieldDescriptorProto { + name: string; + number: number; + label: FieldDescriptorProto_Label; + /** + * If type_name is set, this need not be set. If both this and type_name + * are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. + */ + type: FieldDescriptorProto_Type; + /** + * For message and enum types, this is the name of the type. If the name + * starts with a '.', it is fully-qualified. Otherwise, C++-like scoping + * rules are used to find the type (i.e. first the nested types within this + * message are searched, then within the parent, on up to the root + * namespace). + */ + typeName: string; + /** + * For extensions, this is the name of the type being extended. It is + * resolved in the same manner as type_name. + */ + extendee: string; + /** + * For numeric types, contains the original text representation of the value. + * For booleans, "true" or "false". + * For strings, contains the default text contents (not escaped in any way). + * For bytes, contains the C escaped value. All bytes >= 128 are escaped. + * TODO(kenton): Base-64 encode? + */ + defaultValue: string; + /** + * If set, gives the index of a oneof in the containing type's oneof_decl + * list. This field is a member of that oneof. + */ + oneofIndex: number; + /** + * JSON name of this field. The value is set by protocol compiler. If the + * user has set a "json_name" option on this field, that option's value + * will be used. Otherwise, it's deduced from the field's name by converting + * it to camelCase. + */ + jsonName: string; + options?: FieldOptions; + /** + * If true, this is a proto3 "optional". When a proto3 field is optional, it + * tracks presence regardless of field type. + * + * When proto3_optional is true, this field must be belong to a oneof to + * signal to old proto3 clients that presence is tracked for this field. This + * oneof is known as a "synthetic" oneof, and this field must be its sole + * member (each proto3 optional field gets its own synthetic oneof). Synthetic + * oneofs exist in the descriptor only, and do not generate any API. Synthetic + * oneofs must be ordered after all "real" oneofs. + * + * For message fields, proto3_optional doesn't create any semantic change, + * since non-repeated message fields always track presence. However it still + * indicates the semantic detail of whether the user wrote "optional" or not. + * This can be useful for round-tripping the .proto file. For consistency we + * give message fields a synthetic oneof also, even though it is not required + * to track presence. This is especially important because the parser can't + * tell if a field is a message or an enum, so it must always create a + * synthetic oneof. + * + * Proto2 optional fields do not set this flag, because they already indicate + * optional with `LABEL_OPTIONAL`. + */ + proto3Optional: boolean; +} +/** + * Describes a oneof. + */ +export interface OneofDescriptorProto { + name: string; + options?: OneofOptions; +} +/** + * Describes an enum type. + */ +export interface EnumDescriptorProto { + name: string; + value: EnumValueDescriptorProto[]; + options?: EnumOptions; + /** + * Range of reserved numeric values. Reserved numeric values may not be used + * by enum values in the same enum declaration. Reserved ranges may not + * overlap. + */ + reservedRange: EnumDescriptorProto_EnumReservedRange[]; + /** + * Reserved enum value names, which may not be reused. A given name may only + * be reserved once. + */ + reservedName: string[]; +} +/** + * Range of reserved numeric values. Reserved values may not be used by + * entries in the same enum. Reserved ranges may not overlap. + * + * Note that this is distinct from DescriptorProto.ReservedRange in that it + * is inclusive such that it can appropriately represent the entire int32 + * domain. + */ +export interface EnumDescriptorProto_EnumReservedRange { + /** + * Inclusive. + */ + start: number; + /** + * Inclusive. + */ + end: number; +} +/** + * Describes a value within an enum. + */ +export interface EnumValueDescriptorProto { + name: string; + number: number; + options?: EnumValueOptions; +} +/** + * Describes a service. + */ +export interface ServiceDescriptorProto { + name: string; + method: MethodDescriptorProto[]; + options?: ServiceOptions; +} +/** + * Describes a method of a service. + */ +export interface MethodDescriptorProto { + name: string; + /** + * Input and output type names. These are resolved in the same way as + * FieldDescriptorProto.type_name, but must refer to a message type. + */ + inputType: string; + outputType: string; + options?: MethodOptions; + /** + * Identifies if client streams multiple client messages + */ + clientStreaming: boolean; + /** + * Identifies if server streams multiple server messages + */ + serverStreaming: boolean; +} +export interface FileOptions { + /** + * Sets the Java package where classes generated from this .proto will be + * placed. By default, the proto package is used, but this is often + * inappropriate because proto packages do not normally start with backwards + * domain names. + */ + javaPackage: string; + /** + * If set, all the classes from the .proto file are wrapped in a single + * outer class with the given name. This applies to both Proto1 + * (equivalent to the old "--one_java_file" option) and Proto2 (where + * a .proto always translates to a single class, but you may want to + * explicitly choose the class name). + */ + javaOuterClassname: string; + /** + * If set true, then the Java code generator will generate a separate .java + * file for each top-level message, enum, and service defined in the .proto + * file. Thus, these types will *not* be nested inside the outer class + * named by java_outer_classname. However, the outer class will still be + * generated to contain the file's getDescriptor() method as well as any + * top-level extensions defined in the file. + */ + javaMultipleFiles: boolean; + /** + * This option does nothing. + */ + javaGenerateEqualsAndHash: boolean; + /** + * If set true, then the Java2 code generator will generate code that + * throws an exception whenever an attempt is made to assign a non-UTF-8 + * byte sequence to a string field. + * Message reflection will do the same. + * However, an extension field still accepts non-UTF-8 byte sequences. + * This option has no effect on when used with the lite runtime. + */ + javaStringCheckUtf8: boolean; + optimizeFor: FileOptions_OptimizeMode; + /** + * Sets the Go package where structs generated from this .proto will be + * placed. If omitted, the Go package will be derived from the following: + * - The basename of the package import path, if provided. + * - Otherwise, the package statement in the .proto file, if present. + * - Otherwise, the basename of the .proto file, without extension. + */ + goPackage: string; + /** + * Should generic services be generated in each language? "Generic" services + * are not specific to any particular RPC system. They are generated by the + * main code generators in each language (without additional plugins). + * Generic services were the only kind of service generation supported by + * early versions of google.protobuf. + * + * Generic services are now considered deprecated in favor of using plugins + * that generate code specific to your particular RPC system. Therefore, + * these default to false. Old code which depends on generic services should + * explicitly set them to true. + */ + ccGenericServices: boolean; + javaGenericServices: boolean; + pyGenericServices: boolean; + phpGenericServices: boolean; + /** + * Is this file deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for everything in the file, or it will be completely ignored; in the very + * least, this is a formalization for deprecating files. + */ + deprecated: boolean; + /** + * Enables the use of arenas for the proto messages in this file. This applies + * only to generated classes for C++. + */ + ccEnableArenas: boolean; + /** + * Sets the objective c class prefix which is prepended to all objective c + * generated classes from this .proto. There is no default. + */ + objcClassPrefix: string; + /** + * Namespace for generated classes; defaults to the package. + */ + csharpNamespace: string; + /** + * By default Swift generators will take the proto package and CamelCase it + * replacing '.' with underscore and use that to prefix the types/symbols + * defined. When this options is provided, they will use this value instead + * to prefix the types/symbols defined. + */ + swiftPrefix: string; + /** + * Sets the php class prefix which is prepended to all php generated classes + * from this .proto. Default is empty. + */ + phpClassPrefix: string; + /** + * Use this option to change the namespace of php generated classes. Default + * is empty. When this option is empty, the package name will be used for + * determining the namespace. + */ + phpNamespace: string; + /** + * Use this option to change the namespace of php generated metadata classes. + * Default is empty. When this option is empty, the proto file name will be + * used for determining the namespace. + */ + phpMetadataNamespace: string; + /** + * Use this option to change the package of ruby generated classes. Default + * is empty. When this option is not set, the package name will be used for + * determining the ruby package. + */ + rubyPackage: string; + /** + * The parser stores options it doesn't recognize here. + * See the documentation for the "Options" section above. + */ + uninterpretedOption: UninterpretedOption[]; +} +export interface MessageOptions { + /** + * Set true to use the old proto1 MessageSet wire format for extensions. + * This is provided for backwards-compatibility with the MessageSet wire + * format. You should not use this for any other reason: It's less + * efficient, has fewer features, and is more complicated. + * + * The message must be defined exactly as follows: + * message Foo { + * option message_set_wire_format = true; + * extensions 4 to max; + * } + * Note that the message cannot have any defined fields; MessageSets only + * have extensions. + * + * All extensions of your type must be singular messages; e.g. they cannot + * be int32s, enums, or repeated messages. + * + * Because this is an option, the above two restrictions are not enforced by + * the protocol compiler. + */ + messageSetWireFormat: boolean; + /** + * Disables the generation of the standard "descriptor()" accessor, which can + * conflict with a field of the same name. This is meant to make migration + * from proto1 easier; new code should avoid fields named "descriptor". + */ + noStandardDescriptorAccessor: boolean; + /** + * Is this message deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the message, or it will be completely ignored; in the very least, + * this is a formalization for deprecating messages. + */ + deprecated: boolean; + /** + * Whether the message is an automatically generated map entry type for the + * maps field. + * + * For maps fields: + * map map_field = 1; + * The parsed descriptor looks like: + * message MapFieldEntry { + * option map_entry = true; + * optional KeyType key = 1; + * optional ValueType value = 2; + * } + * repeated MapFieldEntry map_field = 1; + * + * Implementations may choose not to generate the map_entry=true message, but + * use a native map in the target language to hold the keys and values. + * The reflection APIs in such implementations still need to work as + * if the field is a repeated message field. + * + * NOTE: Do not set the option in .proto files. Always use the maps syntax + * instead. The option should only be implicitly set by the proto compiler + * parser. + */ + mapEntry: boolean; + /** + * The parser stores options it doesn't recognize here. See above. + */ + uninterpretedOption: UninterpretedOption[]; +} +export interface FieldOptions { + /** + * The ctype option instructs the C++ code generator to use a different + * representation of the field than it normally would. See the specific + * options below. This option is not yet implemented in the open source + * release -- sorry, we'll try to include it in a future version! + */ + ctype: FieldOptions_CType; + /** + * The packed option can be enabled for repeated primitive fields to enable + * a more efficient representation on the wire. Rather than repeatedly + * writing the tag and type for each element, the entire array is encoded as + * a single length-delimited blob. In proto3, only explicit setting it to + * false will avoid using packed encoding. + */ + packed: boolean; + /** + * The jstype option determines the JavaScript type used for values of the + * field. The option is permitted only for 64 bit integral and fixed types + * (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING + * is represented as JavaScript string, which avoids loss of precision that + * can happen when a large value is converted to a floating point JavaScript. + * Specifying JS_NUMBER for the jstype causes the generated JavaScript code to + * use the JavaScript "number" type. The behavior of the default option + * JS_NORMAL is implementation dependent. + * + * This option is an enum to permit additional types to be added, e.g. + * goog.math.Integer. + */ + jstype: FieldOptions_JSType; + /** + * Should this field be parsed lazily? Lazy applies only to message-type + * fields. It means that when the outer message is initially parsed, the + * inner message's contents will not be parsed but instead stored in encoded + * form. The inner message will actually be parsed when it is first accessed. + * + * This is only a hint. Implementations are free to choose whether to use + * eager or lazy parsing regardless of the value of this option. However, + * setting this option true suggests that the protocol author believes that + * using lazy parsing on this field is worth the additional bookkeeping + * overhead typically needed to implement it. + * + * This option does not affect the public interface of any generated code; + * all method signatures remain the same. Furthermore, thread-safety of the + * interface is not affected by this option; const methods remain safe to + * call from multiple threads concurrently, while non-const methods continue + * to require exclusive access. + * + * + * Note that implementations may choose not to check required fields within + * a lazy sub-message. That is, calling IsInitialized() on the outer message + * may return true even if the inner message has missing required fields. + * This is necessary because otherwise the inner message would have to be + * parsed in order to perform the check, defeating the purpose of lazy + * parsing. An implementation which chooses not to check required fields + * must be consistent about it. That is, for any particular sub-message, the + * implementation must either *always* check its required fields, or *never* + * check its required fields, regardless of whether or not the message has + * been parsed. + */ + lazy: boolean; + /** + * Is this field deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for accessors, or it will be completely ignored; in the very least, this + * is a formalization for deprecating fields. + */ + deprecated: boolean; + /** + * For Google-internal migration only. Do not use. + */ + weak: boolean; + /** + * The parser stores options it doesn't recognize here. See above. + */ + uninterpretedOption: UninterpretedOption[]; +} +export interface OneofOptions { + /** + * The parser stores options it doesn't recognize here. See above. + */ + uninterpretedOption: UninterpretedOption[]; +} +export interface EnumOptions { + /** + * Set this option to true to allow mapping different tag names to the same + * value. + */ + allowAlias: boolean; + /** + * Is this enum deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the enum, or it will be completely ignored; in the very least, this + * is a formalization for deprecating enums. + */ + deprecated: boolean; + /** + * The parser stores options it doesn't recognize here. See above. + */ + uninterpretedOption: UninterpretedOption[]; +} +export interface EnumValueOptions { + /** + * Is this enum value deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the enum value, or it will be completely ignored; in the very least, + * this is a formalization for deprecating enum values. + */ + deprecated: boolean; + /** + * The parser stores options it doesn't recognize here. See above. + */ + uninterpretedOption: UninterpretedOption[]; +} +export interface ServiceOptions { + /** + * Is this service deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the service, or it will be completely ignored; in the very least, + * this is a formalization for deprecating services. + */ + deprecated: boolean; + /** + * The parser stores options it doesn't recognize here. See above. + */ + uninterpretedOption: UninterpretedOption[]; +} +export interface MethodOptions { + /** + * Is this method deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the method, or it will be completely ignored; in the very least, + * this is a formalization for deprecating methods. + */ + deprecated: boolean; + idempotencyLevel: MethodOptions_IdempotencyLevel; + /** + * The parser stores options it doesn't recognize here. See above. + */ + uninterpretedOption: UninterpretedOption[]; +} +/** + * A message representing a option the parser does not recognize. This only + * appears in options protos created by the compiler::Parser class. + * DescriptorPool resolves these when building Descriptor objects. Therefore, + * options protos in descriptor objects (e.g. returned by Descriptor::options(), + * or produced by Descriptor::CopyTo()) will never have UninterpretedOptions + * in them. + */ +export interface UninterpretedOption { + name: UninterpretedOption_NamePart[]; + /** + * The value of the uninterpreted option, in whatever type the tokenizer + * identified it as during parsing. Exactly one of these should be set. + */ + identifierValue: string; + positiveIntValue: Long; + negativeIntValue: Long; + doubleValue: number; + stringValue: Uint8Array; + aggregateValue: string; +} +/** + * The name of the uninterpreted option. Each string represents a segment in + * a dot-separated name. is_extension is true iff a segment represents an + * extension (denoted with parentheses in options specs in .proto files). + * E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents + * "foo.(bar.baz).qux". + */ +export interface UninterpretedOption_NamePart { + namePart: string; + isExtension: boolean; +} +/** + * Encapsulates information about the original source file from which a + * FileDescriptorProto was generated. + */ +export interface SourceCodeInfo { + /** + * A Location identifies a piece of source code in a .proto file which + * corresponds to a particular definition. This information is intended + * to be useful to IDEs, code indexers, documentation generators, and similar + * tools. + * + * For example, say we have a file like: + * message Foo { + * optional string foo = 1; + * } + * Let's look at just the field definition: + * optional string foo = 1; + * ^ ^^ ^^ ^ ^^^ + * a bc de f ghi + * We have the following locations: + * span path represents + * [a,i) [ 4, 0, 2, 0 ] The whole field definition. + * [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). + * [c,d) [ 4, 0, 2, 0, 5 ] The type (string). + * [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). + * [g,h) [ 4, 0, 2, 0, 3 ] The number (1). + * + * Notes: + * - A location may refer to a repeated field itself (i.e. not to any + * particular index within it). This is used whenever a set of elements are + * logically enclosed in a single code segment. For example, an entire + * extend block (possibly containing multiple extension definitions) will + * have an outer location whose path refers to the "extensions" repeated + * field without an index. + * - Multiple locations may have the same path. This happens when a single + * logical declaration is spread out across multiple places. The most + * obvious example is the "extend" block again -- there may be multiple + * extend blocks in the same scope, each of which will have the same path. + * - A location's span is not always a subset of its parent's span. For + * example, the "extendee" of an extension declaration appears at the + * beginning of the "extend" block and is shared by all extensions within + * the block. + * - Just because a location's span is a subset of some other location's span + * does not mean that it is a descendant. For example, a "group" defines + * both a type and a field in a single declaration. Thus, the locations + * corresponding to the type and field and their components will overlap. + * - Code which tries to interpret locations should probably be designed to + * ignore those that it doesn't understand, as more types of locations could + * be recorded in the future. + */ + location: SourceCodeInfo_Location[]; +} +export interface SourceCodeInfo_Location { + /** + * Identifies which part of the FileDescriptorProto was defined at this + * location. + * + * Each element is a field number or an index. They form a path from + * the root FileDescriptorProto to the place where the definition. For + * example, this path: + * [ 4, 3, 2, 7, 1 ] + * refers to: + * file.message_type(3) // 4, 3 + * .field(7) // 2, 7 + * .name() // 1 + * This is because FileDescriptorProto.message_type has field number 4: + * repeated DescriptorProto message_type = 4; + * and DescriptorProto.field has field number 2: + * repeated FieldDescriptorProto field = 2; + * and FieldDescriptorProto.name has field number 1: + * optional string name = 1; + * + * Thus, the above path gives the location of a field name. If we removed + * the last element: + * [ 4, 3, 2, 7 ] + * this path refers to the whole field declaration (from the beginning + * of the label to the terminating semicolon). + */ + path: number[]; + /** + * Always has exactly three or four elements: start line, start column, + * end line (optional, otherwise assumed same as start line), end column. + * These are packed into a single field for efficiency. Note that line + * and column numbers are zero-based -- typically you will want to add + * 1 to each before displaying to a user. + */ + span: number[]; + /** + * If this SourceCodeInfo represents a complete declaration, these are any + * comments appearing before and after the declaration which appear to be + * attached to the declaration. + * + * A series of line comments appearing on consecutive lines, with no other + * tokens appearing on those lines, will be treated as a single comment. + * + * leading_detached_comments will keep paragraphs of comments that appear + * before (but not connected to) the current element. Each paragraph, + * separated by empty lines, will be one comment element in the repeated + * field. + * + * Only the comment content is provided; comment markers (e.g. //) are + * stripped out. For block comments, leading whitespace and an asterisk + * will be stripped from the beginning of each line other than the first. + * Newlines are included in the output. + * + * Examples: + * + * optional int32 foo = 1; // Comment attached to foo. + * // Comment attached to bar. + * optional int32 bar = 2; + * + * optional string baz = 3; + * // Comment attached to baz. + * // Another line attached to baz. + * + * // Comment attached to qux. + * // + * // Another line attached to qux. + * optional double qux = 4; + * + * // Detached comment for corge. This is not leading or trailing comments + * // to qux or corge because there are blank lines separating it from + * // both. + * + * // Detached comment for corge paragraph 2. + * + * optional string corge = 5; + * /* Block comment attached + * * to corge. Leading asterisks + * * will be removed. * / + * /* Block comment attached to + * * grault. * / + * optional int32 grault = 6; + * + * // ignored detached comments. + */ + leadingComments: string; + trailingComments: string; + leadingDetachedComments: string[]; +} +/** + * Describes the relationship between generated code and its original source + * file. A GeneratedCodeInfo message is associated with only one generated + * source file, but may contain references to different source .proto files. + */ +export interface GeneratedCodeInfo { + /** + * An Annotation connects some span of text in generated code to an element + * of its generating .proto file. + */ + annotation: GeneratedCodeInfo_Annotation[]; +} +export interface GeneratedCodeInfo_Annotation { + /** + * Identifies the element in the original source .proto file. This field + * is formatted the same as SourceCodeInfo.Location.path. + */ + path: number[]; + /** + * Identifies the filesystem path to the original source .proto. + */ + sourceFile: string; + /** + * Identifies the starting offset in bytes in the generated code + * that relates to the identified object. + */ + begin: number; + /** + * Identifies the ending offset in bytes in the generated code that + * relates to the identified offset. The end offset should be one past + * the last relevant byte (so the length of the text = end - begin). + */ + end: number; +} +export declare const protobufPackage = "google.protobuf"; +export declare enum FieldDescriptorProto_Type { + /** TYPE_DOUBLE - 0 is reserved for errors. + Order is weird for historical reasons. + */ + TYPE_DOUBLE = 1, + TYPE_FLOAT = 2, + /** TYPE_INT64 - Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if + negative values are likely. + */ + TYPE_INT64 = 3, + TYPE_UINT64 = 4, + /** TYPE_INT32 - Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if + negative values are likely. + */ + TYPE_INT32 = 5, + TYPE_FIXED64 = 6, + TYPE_FIXED32 = 7, + TYPE_BOOL = 8, + TYPE_STRING = 9, + /** TYPE_GROUP - Tag-delimited aggregate. + Group type is deprecated and not supported in proto3. However, Proto3 + implementations should still be able to parse the group wire format and + treat group fields as unknown fields. + */ + TYPE_GROUP = 10, + /** TYPE_MESSAGE - Length-delimited aggregate. + */ + TYPE_MESSAGE = 11, + /** TYPE_BYTES - New in version 2. + */ + TYPE_BYTES = 12, + TYPE_UINT32 = 13, + TYPE_ENUM = 14, + TYPE_SFIXED32 = 15, + TYPE_SFIXED64 = 16, + /** TYPE_SINT32 - Uses ZigZag encoding. + */ + TYPE_SINT32 = 17, + /** TYPE_SINT64 - Uses ZigZag encoding. + */ + TYPE_SINT64 = 18, + UNRECOGNIZED = -1, +} +export declare function fieldDescriptorProto_TypeFromJSON(object: any): FieldDescriptorProto_Type; +export declare function fieldDescriptorProto_TypeToJSON(object: FieldDescriptorProto_Type): string; +export declare enum FieldDescriptorProto_Label { + /** LABEL_OPTIONAL - 0 is reserved for errors + */ + LABEL_OPTIONAL = 1, + LABEL_REQUIRED = 2, + LABEL_REPEATED = 3, + UNRECOGNIZED = -1, +} +export declare function fieldDescriptorProto_LabelFromJSON(object: any): FieldDescriptorProto_Label; +export declare function fieldDescriptorProto_LabelToJSON(object: FieldDescriptorProto_Label): string; +/** Generated classes can be optimized for speed or code size. + */ +export declare enum FileOptions_OptimizeMode { + /** SPEED - Generate complete code for parsing, serialization, + */ + SPEED = 1, + /** CODE_SIZE - etc. + */ + CODE_SIZE = 2, + /** LITE_RUNTIME - Generate code using MessageLite and the lite runtime. + */ + LITE_RUNTIME = 3, + UNRECOGNIZED = -1, +} +export declare function fileOptions_OptimizeModeFromJSON(object: any): FileOptions_OptimizeMode; +export declare function fileOptions_OptimizeModeToJSON(object: FileOptions_OptimizeMode): string; +export declare enum FieldOptions_CType { + /** STRING - Default mode. + */ + STRING = 0, + CORD = 1, + STRING_PIECE = 2, + UNRECOGNIZED = -1, +} +export declare function fieldOptions_CTypeFromJSON(object: any): FieldOptions_CType; +export declare function fieldOptions_CTypeToJSON(object: FieldOptions_CType): string; +export declare enum FieldOptions_JSType { + /** JS_NORMAL - Use the default type. + */ + JS_NORMAL = 0, + /** JS_STRING - Use JavaScript strings. + */ + JS_STRING = 1, + /** JS_NUMBER - Use JavaScript numbers. + */ + JS_NUMBER = 2, + UNRECOGNIZED = -1, +} +export declare function fieldOptions_JSTypeFromJSON(object: any): FieldOptions_JSType; +export declare function fieldOptions_JSTypeToJSON(object: FieldOptions_JSType): string; +/** Is this method side-effect-free (or safe in HTTP parlance), or idempotent, + or neither? HTTP based RPC implementation may choose GET verb for safe + methods, and PUT verb for idempotent methods instead of the default POST. + */ +export declare enum MethodOptions_IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + /** NO_SIDE_EFFECTS - implies idempotent + */ + NO_SIDE_EFFECTS = 1, + /** IDEMPOTENT - idempotent, but may have side effects + */ + IDEMPOTENT = 2, + UNRECOGNIZED = -1, +} +export declare function methodOptions_IdempotencyLevelFromJSON(object: any): MethodOptions_IdempotencyLevel; +export declare function methodOptions_IdempotencyLevelToJSON(object: MethodOptions_IdempotencyLevel): string; +export declare const FileDescriptorSet: { + encode(message: FileDescriptorSet, writer?: Writer): Writer; + decode(input: Uint8Array | Reader, length?: number | undefined): FileDescriptorSet; + fromJSON(object: any): FileDescriptorSet; + fromPartial(object: DeepPartial): FileDescriptorSet; + toJSON(message: FileDescriptorSet): unknown; +}; +export declare const FileDescriptorProto: { + encode(message: FileDescriptorProto, writer?: Writer): Writer; + decode(input: Uint8Array | Reader, length?: number | undefined): FileDescriptorProto; + fromJSON(object: any): FileDescriptorProto; + fromPartial(object: DeepPartial): FileDescriptorProto; + toJSON(message: FileDescriptorProto): unknown; +}; +export declare const DescriptorProto: { + encode(message: DescriptorProto, writer?: Writer): Writer; + decode(input: Uint8Array | Reader, length?: number | undefined): DescriptorProto; + fromJSON(object: any): DescriptorProto; + fromPartial(object: DeepPartial): DescriptorProto; + toJSON(message: DescriptorProto): unknown; +}; +export declare const DescriptorProto_ExtensionRange: { + encode(message: DescriptorProto_ExtensionRange, writer?: Writer): Writer; + decode(input: Uint8Array | Reader, length?: number | undefined): DescriptorProto_ExtensionRange; + fromJSON(object: any): DescriptorProto_ExtensionRange; + fromPartial(object: DeepPartial): DescriptorProto_ExtensionRange; + toJSON(message: DescriptorProto_ExtensionRange): unknown; +}; +export declare const DescriptorProto_ReservedRange: { + encode(message: DescriptorProto_ReservedRange, writer?: Writer): Writer; + decode(input: Uint8Array | Reader, length?: number | undefined): DescriptorProto_ReservedRange; + fromJSON(object: any): DescriptorProto_ReservedRange; + fromPartial(object: DeepPartial): DescriptorProto_ReservedRange; + toJSON(message: DescriptorProto_ReservedRange): unknown; +}; +export declare const ExtensionRangeOptions: { + encode(message: ExtensionRangeOptions, writer?: Writer): Writer; + decode(input: Uint8Array | Reader, length?: number | undefined): ExtensionRangeOptions; + fromJSON(object: any): ExtensionRangeOptions; + fromPartial(object: DeepPartial): ExtensionRangeOptions; + toJSON(message: ExtensionRangeOptions): unknown; +}; +export declare const FieldDescriptorProto: { + encode(message: FieldDescriptorProto, writer?: Writer): Writer; + decode(input: Uint8Array | Reader, length?: number | undefined): FieldDescriptorProto; + fromJSON(object: any): FieldDescriptorProto; + fromPartial(object: DeepPartial): FieldDescriptorProto; + toJSON(message: FieldDescriptorProto): unknown; +}; +export declare const OneofDescriptorProto: { + encode(message: OneofDescriptorProto, writer?: Writer): Writer; + decode(input: Uint8Array | Reader, length?: number | undefined): OneofDescriptorProto; + fromJSON(object: any): OneofDescriptorProto; + fromPartial(object: DeepPartial): OneofDescriptorProto; + toJSON(message: OneofDescriptorProto): unknown; +}; +export declare const EnumDescriptorProto: { + encode(message: EnumDescriptorProto, writer?: Writer): Writer; + decode(input: Uint8Array | Reader, length?: number | undefined): EnumDescriptorProto; + fromJSON(object: any): EnumDescriptorProto; + fromPartial(object: DeepPartial): EnumDescriptorProto; + toJSON(message: EnumDescriptorProto): unknown; +}; +export declare const EnumDescriptorProto_EnumReservedRange: { + encode(message: EnumDescriptorProto_EnumReservedRange, writer?: Writer): Writer; + decode(input: Uint8Array | Reader, length?: number | undefined): EnumDescriptorProto_EnumReservedRange; + fromJSON(object: any): EnumDescriptorProto_EnumReservedRange; + fromPartial( + object: DeepPartial, + ): EnumDescriptorProto_EnumReservedRange; + toJSON(message: EnumDescriptorProto_EnumReservedRange): unknown; +}; +export declare const EnumValueDescriptorProto: { + encode(message: EnumValueDescriptorProto, writer?: Writer): Writer; + decode(input: Uint8Array | Reader, length?: number | undefined): EnumValueDescriptorProto; + fromJSON(object: any): EnumValueDescriptorProto; + fromPartial(object: DeepPartial): EnumValueDescriptorProto; + toJSON(message: EnumValueDescriptorProto): unknown; +}; +export declare const ServiceDescriptorProto: { + encode(message: ServiceDescriptorProto, writer?: Writer): Writer; + decode(input: Uint8Array | Reader, length?: number | undefined): ServiceDescriptorProto; + fromJSON(object: any): ServiceDescriptorProto; + fromPartial(object: DeepPartial): ServiceDescriptorProto; + toJSON(message: ServiceDescriptorProto): unknown; +}; +export declare const MethodDescriptorProto: { + encode(message: MethodDescriptorProto, writer?: Writer): Writer; + decode(input: Uint8Array | Reader, length?: number | undefined): MethodDescriptorProto; + fromJSON(object: any): MethodDescriptorProto; + fromPartial(object: DeepPartial): MethodDescriptorProto; + toJSON(message: MethodDescriptorProto): unknown; +}; +export declare const FileOptions: { + encode(message: FileOptions, writer?: Writer): Writer; + decode(input: Uint8Array | Reader, length?: number | undefined): FileOptions; + fromJSON(object: any): FileOptions; + fromPartial(object: DeepPartial): FileOptions; + toJSON(message: FileOptions): unknown; +}; +export declare const MessageOptions: { + encode(message: MessageOptions, writer?: Writer): Writer; + decode(input: Uint8Array | Reader, length?: number | undefined): MessageOptions; + fromJSON(object: any): MessageOptions; + fromPartial(object: DeepPartial): MessageOptions; + toJSON(message: MessageOptions): unknown; +}; +export declare const FieldOptions: { + encode(message: FieldOptions, writer?: Writer): Writer; + decode(input: Uint8Array | Reader, length?: number | undefined): FieldOptions; + fromJSON(object: any): FieldOptions; + fromPartial(object: DeepPartial): FieldOptions; + toJSON(message: FieldOptions): unknown; +}; +export declare const OneofOptions: { + encode(message: OneofOptions, writer?: Writer): Writer; + decode(input: Uint8Array | Reader, length?: number | undefined): OneofOptions; + fromJSON(object: any): OneofOptions; + fromPartial(object: DeepPartial): OneofOptions; + toJSON(message: OneofOptions): unknown; +}; +export declare const EnumOptions: { + encode(message: EnumOptions, writer?: Writer): Writer; + decode(input: Uint8Array | Reader, length?: number | undefined): EnumOptions; + fromJSON(object: any): EnumOptions; + fromPartial(object: DeepPartial): EnumOptions; + toJSON(message: EnumOptions): unknown; +}; +export declare const EnumValueOptions: { + encode(message: EnumValueOptions, writer?: Writer): Writer; + decode(input: Uint8Array | Reader, length?: number | undefined): EnumValueOptions; + fromJSON(object: any): EnumValueOptions; + fromPartial(object: DeepPartial): EnumValueOptions; + toJSON(message: EnumValueOptions): unknown; +}; +export declare const ServiceOptions: { + encode(message: ServiceOptions, writer?: Writer): Writer; + decode(input: Uint8Array | Reader, length?: number | undefined): ServiceOptions; + fromJSON(object: any): ServiceOptions; + fromPartial(object: DeepPartial): ServiceOptions; + toJSON(message: ServiceOptions): unknown; +}; +export declare const MethodOptions: { + encode(message: MethodOptions, writer?: Writer): Writer; + decode(input: Uint8Array | Reader, length?: number | undefined): MethodOptions; + fromJSON(object: any): MethodOptions; + fromPartial(object: DeepPartial): MethodOptions; + toJSON(message: MethodOptions): unknown; +}; +export declare const UninterpretedOption: { + encode(message: UninterpretedOption, writer?: Writer): Writer; + decode(input: Uint8Array | Reader, length?: number | undefined): UninterpretedOption; + fromJSON(object: any): UninterpretedOption; + fromPartial(object: DeepPartial): UninterpretedOption; + toJSON(message: UninterpretedOption): unknown; +}; +export declare const UninterpretedOption_NamePart: { + encode(message: UninterpretedOption_NamePart, writer?: Writer): Writer; + decode(input: Uint8Array | Reader, length?: number | undefined): UninterpretedOption_NamePart; + fromJSON(object: any): UninterpretedOption_NamePart; + fromPartial(object: DeepPartial): UninterpretedOption_NamePart; + toJSON(message: UninterpretedOption_NamePart): unknown; +}; +export declare const SourceCodeInfo: { + encode(message: SourceCodeInfo, writer?: Writer): Writer; + decode(input: Uint8Array | Reader, length?: number | undefined): SourceCodeInfo; + fromJSON(object: any): SourceCodeInfo; + fromPartial(object: DeepPartial): SourceCodeInfo; + toJSON(message: SourceCodeInfo): unknown; +}; +export declare const SourceCodeInfo_Location: { + encode(message: SourceCodeInfo_Location, writer?: Writer): Writer; + decode(input: Uint8Array | Reader, length?: number | undefined): SourceCodeInfo_Location; + fromJSON(object: any): SourceCodeInfo_Location; + fromPartial(object: DeepPartial): SourceCodeInfo_Location; + toJSON(message: SourceCodeInfo_Location): unknown; +}; +export declare const GeneratedCodeInfo: { + encode(message: GeneratedCodeInfo, writer?: Writer): Writer; + decode(input: Uint8Array | Reader, length?: number | undefined): GeneratedCodeInfo; + fromJSON(object: any): GeneratedCodeInfo; + fromPartial(object: DeepPartial): GeneratedCodeInfo; + toJSON(message: GeneratedCodeInfo): unknown; +}; +export declare const GeneratedCodeInfo_Annotation: { + encode(message: GeneratedCodeInfo_Annotation, writer?: Writer): Writer; + decode(input: Uint8Array | Reader, length?: number | undefined): GeneratedCodeInfo_Annotation; + fromJSON(object: any): GeneratedCodeInfo_Annotation; + fromPartial(object: DeepPartial): GeneratedCodeInfo_Annotation; + toJSON(message: GeneratedCodeInfo_Annotation): unknown; +}; +declare type Builtin = Date | Function | Uint8Array | string | number | undefined; +export declare type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { + [K in keyof T]?: DeepPartial; + } + : Partial; +export {}; diff --git a/packages/proto-signing/types/codec/index.d.ts b/packages/proto-signing/types/codec/index.d.ts deleted file mode 100644 index 7cbb5810..00000000 --- a/packages/proto-signing/types/codec/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./generated/codecimpl"; diff --git a/packages/proto-signing/types/codec/tendermint/crypto/keys.d.ts b/packages/proto-signing/types/codec/tendermint/crypto/keys.d.ts new file mode 100644 index 00000000..662c0b81 --- /dev/null +++ b/packages/proto-signing/types/codec/tendermint/crypto/keys.d.ts @@ -0,0 +1,29 @@ +import { Writer, Reader } from "protobufjs/minimal"; +/** + * PublicKey defines the keys available for use with Tendermint Validators + */ +export interface PublicKey { + ed25519: Uint8Array | undefined; + secp256k1: Uint8Array | undefined; +} +export declare const protobufPackage = "tendermint.crypto"; +export declare const PublicKey: { + encode(message: PublicKey, writer?: Writer): Writer; + decode(input: Uint8Array | Reader, length?: number | undefined): PublicKey; + fromJSON(object: any): PublicKey; + fromPartial(object: DeepPartial): PublicKey; + toJSON(message: PublicKey): unknown; +}; +declare type Builtin = Date | Function | Uint8Array | string | number | undefined; +export declare type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { + [K in keyof T]?: DeepPartial; + } + : Partial; +export {};