diff --git a/package.json b/package.json index b0dce882..ff40b456 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,7 @@ "ts-jest": "^27.0.5", "ts-node": "^10.9.1", "ts-node-dev": "^1.1.8", - "ts-proto": "^1.117.0", + "ts-proto": "1.117.0", "tsconfig-paths": "^4.1.0", "typescript": "^4.4.3" } diff --git a/packages/protojs/package.json b/packages/protojs/package.json index a411a796..325adfac 100644 --- a/packages/protojs/package.json +++ b/packages/protojs/package.json @@ -1,7 +1,7 @@ { "name": "@nibiruchain/protojs", "description": "Protobuf-generated types for Nibiru Chain", - "version": "0.19.0", + "version": "0.19.1", "license": "MIT", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/protojs/src/confio/proofs.ts b/packages/protojs/src/confio/proofs.ts index aa8c6034..faf0dda6 100644 --- a/packages/protojs/src/confio/proofs.ts +++ b/packages/protojs/src/confio/proofs.ts @@ -1,8 +1,8 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "ics23"; +export const protobufPackage = "ics23" export enum HashOp { /** NO_HASH - NO_HASH is the default if no data passed. Note this is an illegal argument some places. */ @@ -20,46 +20,46 @@ export function hashOpFromJSON(object: any): HashOp { switch (object) { case 0: case "NO_HASH": - return HashOp.NO_HASH; + return HashOp.NO_HASH case 1: case "SHA256": - return HashOp.SHA256; + return HashOp.SHA256 case 2: case "SHA512": - return HashOp.SHA512; + return HashOp.SHA512 case 3: case "KECCAK": - return HashOp.KECCAK; + return HashOp.KECCAK case 4: case "RIPEMD160": - return HashOp.RIPEMD160; + return HashOp.RIPEMD160 case 5: case "BITCOIN": - return HashOp.BITCOIN; + return HashOp.BITCOIN case -1: case "UNRECOGNIZED": default: - return HashOp.UNRECOGNIZED; + return HashOp.UNRECOGNIZED } } export function hashOpToJSON(object: HashOp): string { switch (object) { case HashOp.NO_HASH: - return "NO_HASH"; + return "NO_HASH" case HashOp.SHA256: - return "SHA256"; + return "SHA256" case HashOp.SHA512: - return "SHA512"; + return "SHA512" case HashOp.KECCAK: - return "KECCAK"; + return "KECCAK" case HashOp.RIPEMD160: - return "RIPEMD160"; + return "RIPEMD160" case HashOp.BITCOIN: - return "BITCOIN"; + return "BITCOIN" case HashOp.UNRECOGNIZED: default: - return "UNRECOGNIZED"; + return "UNRECOGNIZED" } } @@ -95,61 +95,61 @@ export function lengthOpFromJSON(object: any): LengthOp { switch (object) { case 0: case "NO_PREFIX": - return LengthOp.NO_PREFIX; + return LengthOp.NO_PREFIX case 1: case "VAR_PROTO": - return LengthOp.VAR_PROTO; + return LengthOp.VAR_PROTO case 2: case "VAR_RLP": - return LengthOp.VAR_RLP; + return LengthOp.VAR_RLP case 3: case "FIXED32_BIG": - return LengthOp.FIXED32_BIG; + return LengthOp.FIXED32_BIG case 4: case "FIXED32_LITTLE": - return LengthOp.FIXED32_LITTLE; + return LengthOp.FIXED32_LITTLE case 5: case "FIXED64_BIG": - return LengthOp.FIXED64_BIG; + return LengthOp.FIXED64_BIG case 6: case "FIXED64_LITTLE": - return LengthOp.FIXED64_LITTLE; + return LengthOp.FIXED64_LITTLE case 7: case "REQUIRE_32_BYTES": - return LengthOp.REQUIRE_32_BYTES; + return LengthOp.REQUIRE_32_BYTES case 8: case "REQUIRE_64_BYTES": - return LengthOp.REQUIRE_64_BYTES; + return LengthOp.REQUIRE_64_BYTES case -1: case "UNRECOGNIZED": default: - return LengthOp.UNRECOGNIZED; + return LengthOp.UNRECOGNIZED } } export function lengthOpToJSON(object: LengthOp): string { switch (object) { case LengthOp.NO_PREFIX: - return "NO_PREFIX"; + return "NO_PREFIX" case LengthOp.VAR_PROTO: - return "VAR_PROTO"; + return "VAR_PROTO" case LengthOp.VAR_RLP: - return "VAR_RLP"; + return "VAR_RLP" case LengthOp.FIXED32_BIG: - return "FIXED32_BIG"; + return "FIXED32_BIG" case LengthOp.FIXED32_LITTLE: - return "FIXED32_LITTLE"; + return "FIXED32_LITTLE" case LengthOp.FIXED64_BIG: - return "FIXED64_BIG"; + return "FIXED64_BIG" case LengthOp.FIXED64_LITTLE: - return "FIXED64_LITTLE"; + return "FIXED64_LITTLE" case LengthOp.REQUIRE_32_BYTES: - return "REQUIRE_32_BYTES"; + return "REQUIRE_32_BYTES" case LengthOp.REQUIRE_64_BYTES: - return "REQUIRE_64_BYTES"; + return "REQUIRE_64_BYTES" case LengthOp.UNRECOGNIZED: default: - return "UNRECOGNIZED"; + return "UNRECOGNIZED" } } @@ -175,10 +175,10 @@ export function lengthOpToJSON(object: LengthOp): string { * length-prefix the data before hashing it. */ export interface ExistenceProof { - key: Uint8Array; - value: Uint8Array; - leaf?: LeafOp; - path: InnerOp[]; + key: Uint8Array + value: Uint8Array + leaf?: LeafOp + path: InnerOp[] } /** @@ -188,17 +188,17 @@ export interface ExistenceProof { */ export interface NonExistenceProof { /** TODO: remove this as unnecessary??? we prove a range */ - key: Uint8Array; - left?: ExistenceProof; - right?: ExistenceProof; + key: Uint8Array + left?: ExistenceProof + right?: ExistenceProof } /** CommitmentProof is either an ExistenceProof or a NonExistenceProof, or a Batch of such messages */ export interface CommitmentProof { - exist?: ExistenceProof | undefined; - nonexist?: NonExistenceProof | undefined; - batch?: BatchProof | undefined; - compressed?: CompressedBatchProof | undefined; + exist?: ExistenceProof | undefined + nonexist?: NonExistenceProof | undefined + batch?: BatchProof | undefined + compressed?: CompressedBatchProof | undefined } /** @@ -218,15 +218,15 @@ export interface CommitmentProof { * output = hash(prefix || length(hkey) || hkey || length(hvalue) || hvalue) */ export interface LeafOp { - hash: HashOp; - prehashKey: HashOp; - prehashValue: HashOp; - length: LengthOp; + hash: HashOp + prehashKey: HashOp + prehashValue: HashOp + length: LengthOp /** * prefix is a fixed bytes that may optionally be included at the beginning to differentiate * a leaf node from an inner node. */ - prefix: Uint8Array; + prefix: Uint8Array } /** @@ -247,9 +247,9 @@ export interface LeafOp { * If either of prefix or suffix is empty, we just treat it as an empty string */ export interface InnerOp { - hash: HashOp; - prefix: Uint8Array; - suffix: Uint8Array; + hash: HashOp + prefix: Uint8Array + suffix: Uint8Array } /** @@ -269,12 +269,12 @@ export interface ProofSpec { * any field in the ExistenceProof must be the same as in this spec. * except Prefix, which is just the first bytes of prefix (spec can be longer) */ - leafSpec?: LeafOp; - innerSpec?: InnerSpec; + leafSpec?: LeafOp + innerSpec?: InnerSpec /** max_depth (if > 0) is the maximum number of InnerOps allowed (mainly for fixed-depth tries) */ - maxDepth: number; + maxDepth: number /** min_depth (if > 0) is the minimum number of InnerOps allowed (mainly for fixed-depth tries) */ - minDepth: number; + minDepth: number } /** @@ -293,99 +293,102 @@ export interface InnerSpec { * iavl tree is [0, 1] (left then right) * merk is [0, 2, 1] (left, right, here) */ - childOrder: number[]; - childSize: number; - minPrefixLength: number; - maxPrefixLength: number; + childOrder: number[] + childSize: number + minPrefixLength: number + maxPrefixLength: number /** empty child is the prehash image that is used when one child is nil (eg. 20 bytes of 0) */ - emptyChild: Uint8Array; + emptyChild: Uint8Array /** hash is the algorithm that must be used for each InnerOp */ - hash: HashOp; + hash: HashOp } /** BatchProof is a group of multiple proof types than can be compressed */ export interface BatchProof { - entries: BatchEntry[]; + entries: BatchEntry[] } /** Use BatchEntry not CommitmentProof, to avoid recursion */ export interface BatchEntry { - exist?: ExistenceProof | undefined; - nonexist?: NonExistenceProof | undefined; + exist?: ExistenceProof | undefined + nonexist?: NonExistenceProof | undefined } export interface CompressedBatchProof { - entries: CompressedBatchEntry[]; - lookupInners: InnerOp[]; + entries: CompressedBatchEntry[] + lookupInners: InnerOp[] } /** Use BatchEntry not CommitmentProof, to avoid recursion */ export interface CompressedBatchEntry { - exist?: CompressedExistenceProof | undefined; - nonexist?: CompressedNonExistenceProof | undefined; + exist?: CompressedExistenceProof | undefined + nonexist?: CompressedNonExistenceProof | undefined } export interface CompressedExistenceProof { - key: Uint8Array; - value: Uint8Array; - leaf?: LeafOp; + key: Uint8Array + value: Uint8Array + leaf?: LeafOp /** these are indexes into the lookup_inners table in CompressedBatchProof */ - path: number[]; + path: number[] } export interface CompressedNonExistenceProof { /** TODO: remove this as unnecessary??? we prove a range */ - key: Uint8Array; - left?: CompressedExistenceProof; - right?: CompressedExistenceProof; + key: Uint8Array + left?: CompressedExistenceProof + right?: CompressedExistenceProof } function createBaseExistenceProof(): ExistenceProof { - return { key: new Uint8Array(), value: new Uint8Array(), leaf: undefined, path: [] }; + return { key: new Uint8Array(), value: new Uint8Array(), leaf: undefined, path: [] } } export const ExistenceProof = { - encode(message: ExistenceProof, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: ExistenceProof, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.key.length !== 0) { - writer.uint32(10).bytes(message.key); + writer.uint32(10).bytes(message.key) } if (message.value.length !== 0) { - writer.uint32(18).bytes(message.value); + writer.uint32(18).bytes(message.value) } if (message.leaf !== undefined) { - LeafOp.encode(message.leaf, writer.uint32(26).fork()).ldelim(); + LeafOp.encode(message.leaf, writer.uint32(26).fork()).ldelim() } for (const v of message.path) { - InnerOp.encode(v!, writer.uint32(34).fork()).ldelim(); + InnerOp.encode(v!, writer.uint32(34).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): ExistenceProof { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseExistenceProof(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseExistenceProof() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.key = reader.bytes(); - break; + message.key = reader.bytes() + break case 2: - message.value = reader.bytes(); - break; + message.value = reader.bytes() + break case 3: - message.leaf = LeafOp.decode(reader, reader.uint32()); - break; + message.leaf = LeafOp.decode(reader, reader.uint32()) + break case 4: - message.path.push(InnerOp.decode(reader, reader.uint32())); - break; + message.path.push(InnerOp.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): ExistenceProof { @@ -393,75 +396,90 @@ export const ExistenceProof = { key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array(), value: isSet(object.value) ? bytesFromBase64(object.value) : new Uint8Array(), leaf: isSet(object.leaf) ? LeafOp.fromJSON(object.leaf) : undefined, - path: Array.isArray(object?.path) ? object.path.map((e: any) => InnerOp.fromJSON(e)) : [], - }; + path: Array.isArray(object?.path) + ? object.path.map((e: any) => InnerOp.fromJSON(e)) + : [], + } }, toJSON(message: ExistenceProof): unknown { - const obj: any = {}; + const obj: any = {} message.key !== undefined && - (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); + (obj.key = base64FromBytes( + message.key !== undefined ? message.key : new Uint8Array(), + )) message.value !== undefined && - (obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array())); - message.leaf !== undefined && (obj.leaf = message.leaf ? LeafOp.toJSON(message.leaf) : undefined); + (obj.value = base64FromBytes( + message.value !== undefined ? message.value : new Uint8Array(), + )) + message.leaf !== undefined && + (obj.leaf = message.leaf ? LeafOp.toJSON(message.leaf) : undefined) if (message.path) { - obj.path = message.path.map((e) => e ? InnerOp.toJSON(e) : undefined); + obj.path = message.path.map((e) => (e ? InnerOp.toJSON(e) : undefined)) } else { - obj.path = []; + obj.path = [] } - return obj; - }, - - fromPartial, I>>(object: I): ExistenceProof { - const message = createBaseExistenceProof(); - message.key = object.key ?? new Uint8Array(); - message.value = object.value ?? new Uint8Array(); - message.leaf = (object.leaf !== undefined && object.leaf !== null) ? LeafOp.fromPartial(object.leaf) : undefined; - message.path = object.path?.map((e) => InnerOp.fromPartial(e)) || []; - return message; + return obj + }, + + fromPartial, I>>( + object: I, + ): ExistenceProof { + const message = createBaseExistenceProof() + message.key = object.key ?? new Uint8Array() + message.value = object.value ?? new Uint8Array() + message.leaf = + object.leaf !== undefined && object.leaf !== null + ? LeafOp.fromPartial(object.leaf) + : undefined + message.path = object.path?.map((e) => InnerOp.fromPartial(e)) || [] + return message }, -}; +} function createBaseNonExistenceProof(): NonExistenceProof { - return { key: new Uint8Array(), left: undefined, right: undefined }; + return { key: new Uint8Array(), left: undefined, right: undefined } } export const NonExistenceProof = { - encode(message: NonExistenceProof, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: NonExistenceProof, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.key.length !== 0) { - writer.uint32(10).bytes(message.key); + writer.uint32(10).bytes(message.key) } if (message.left !== undefined) { - ExistenceProof.encode(message.left, writer.uint32(18).fork()).ldelim(); + ExistenceProof.encode(message.left, writer.uint32(18).fork()).ldelim() } if (message.right !== undefined) { - ExistenceProof.encode(message.right, writer.uint32(26).fork()).ldelim(); + ExistenceProof.encode(message.right, writer.uint32(26).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): NonExistenceProof { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseNonExistenceProof(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseNonExistenceProof() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.key = reader.bytes(); - break; + message.key = reader.bytes() + break case 2: - message.left = ExistenceProof.decode(reader, reader.uint32()); - break; + message.left = ExistenceProof.decode(reader, reader.uint32()) + break case 3: - message.right = ExistenceProof.decode(reader, reader.uint32()); - break; + message.right = ExistenceProof.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): NonExistenceProof { @@ -469,243 +487,287 @@ export const NonExistenceProof = { key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array(), left: isSet(object.left) ? ExistenceProof.fromJSON(object.left) : undefined, right: isSet(object.right) ? ExistenceProof.fromJSON(object.right) : undefined, - }; + } }, toJSON(message: NonExistenceProof): unknown { - const obj: any = {}; + const obj: any = {} message.key !== undefined && - (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); - message.left !== undefined && (obj.left = message.left ? ExistenceProof.toJSON(message.left) : undefined); - message.right !== undefined && (obj.right = message.right ? ExistenceProof.toJSON(message.right) : undefined); - return obj; - }, - - fromPartial, I>>(object: I): NonExistenceProof { - const message = createBaseNonExistenceProof(); - message.key = object.key ?? new Uint8Array(); - message.left = (object.left !== undefined && object.left !== null) - ? ExistenceProof.fromPartial(object.left) - : undefined; - message.right = (object.right !== undefined && object.right !== null) - ? ExistenceProof.fromPartial(object.right) - : undefined; - return message; + (obj.key = base64FromBytes( + message.key !== undefined ? message.key : new Uint8Array(), + )) + message.left !== undefined && + (obj.left = message.left ? ExistenceProof.toJSON(message.left) : undefined) + message.right !== undefined && + (obj.right = message.right ? ExistenceProof.toJSON(message.right) : undefined) + return obj + }, + + fromPartial, I>>( + object: I, + ): NonExistenceProof { + const message = createBaseNonExistenceProof() + message.key = object.key ?? new Uint8Array() + message.left = + object.left !== undefined && object.left !== null + ? ExistenceProof.fromPartial(object.left) + : undefined + message.right = + object.right !== undefined && object.right !== null + ? ExistenceProof.fromPartial(object.right) + : undefined + return message }, -}; +} function createBaseCommitmentProof(): CommitmentProof { - return { exist: undefined, nonexist: undefined, batch: undefined, compressed: undefined }; + return { + exist: undefined, + nonexist: undefined, + batch: undefined, + compressed: undefined, + } } export const CommitmentProof = { - encode(message: CommitmentProof, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: CommitmentProof, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.exist !== undefined) { - ExistenceProof.encode(message.exist, writer.uint32(10).fork()).ldelim(); + ExistenceProof.encode(message.exist, writer.uint32(10).fork()).ldelim() } if (message.nonexist !== undefined) { - NonExistenceProof.encode(message.nonexist, writer.uint32(18).fork()).ldelim(); + NonExistenceProof.encode(message.nonexist, writer.uint32(18).fork()).ldelim() } if (message.batch !== undefined) { - BatchProof.encode(message.batch, writer.uint32(26).fork()).ldelim(); + BatchProof.encode(message.batch, writer.uint32(26).fork()).ldelim() } if (message.compressed !== undefined) { - CompressedBatchProof.encode(message.compressed, writer.uint32(34).fork()).ldelim(); + CompressedBatchProof.encode(message.compressed, writer.uint32(34).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): CommitmentProof { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseCommitmentProof(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseCommitmentProof() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.exist = ExistenceProof.decode(reader, reader.uint32()); - break; + message.exist = ExistenceProof.decode(reader, reader.uint32()) + break case 2: - message.nonexist = NonExistenceProof.decode(reader, reader.uint32()); - break; + message.nonexist = NonExistenceProof.decode(reader, reader.uint32()) + break case 3: - message.batch = BatchProof.decode(reader, reader.uint32()); - break; + message.batch = BatchProof.decode(reader, reader.uint32()) + break case 4: - message.compressed = CompressedBatchProof.decode(reader, reader.uint32()); - break; + message.compressed = CompressedBatchProof.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): CommitmentProof { return { exist: isSet(object.exist) ? ExistenceProof.fromJSON(object.exist) : undefined, - nonexist: isSet(object.nonexist) ? NonExistenceProof.fromJSON(object.nonexist) : undefined, + nonexist: isSet(object.nonexist) + ? NonExistenceProof.fromJSON(object.nonexist) + : undefined, batch: isSet(object.batch) ? BatchProof.fromJSON(object.batch) : undefined, - compressed: isSet(object.compressed) ? CompressedBatchProof.fromJSON(object.compressed) : undefined, - }; + compressed: isSet(object.compressed) + ? CompressedBatchProof.fromJSON(object.compressed) + : undefined, + } }, toJSON(message: CommitmentProof): unknown { - const obj: any = {}; - message.exist !== undefined && (obj.exist = message.exist ? ExistenceProof.toJSON(message.exist) : undefined); + const obj: any = {} + message.exist !== undefined && + (obj.exist = message.exist ? ExistenceProof.toJSON(message.exist) : undefined) message.nonexist !== undefined && - (obj.nonexist = message.nonexist ? NonExistenceProof.toJSON(message.nonexist) : undefined); - message.batch !== undefined && (obj.batch = message.batch ? BatchProof.toJSON(message.batch) : undefined); + (obj.nonexist = message.nonexist + ? NonExistenceProof.toJSON(message.nonexist) + : undefined) + message.batch !== undefined && + (obj.batch = message.batch ? BatchProof.toJSON(message.batch) : undefined) message.compressed !== undefined && - (obj.compressed = message.compressed ? CompressedBatchProof.toJSON(message.compressed) : undefined); - return obj; - }, - - fromPartial, I>>(object: I): CommitmentProof { - const message = createBaseCommitmentProof(); - message.exist = (object.exist !== undefined && object.exist !== null) - ? ExistenceProof.fromPartial(object.exist) - : undefined; - message.nonexist = (object.nonexist !== undefined && object.nonexist !== null) - ? NonExistenceProof.fromPartial(object.nonexist) - : undefined; - message.batch = (object.batch !== undefined && object.batch !== null) - ? BatchProof.fromPartial(object.batch) - : undefined; - message.compressed = (object.compressed !== undefined && object.compressed !== null) - ? CompressedBatchProof.fromPartial(object.compressed) - : undefined; - return message; - }, -}; + (obj.compressed = message.compressed + ? CompressedBatchProof.toJSON(message.compressed) + : undefined) + return obj + }, + + fromPartial, I>>( + object: I, + ): CommitmentProof { + const message = createBaseCommitmentProof() + message.exist = + object.exist !== undefined && object.exist !== null + ? ExistenceProof.fromPartial(object.exist) + : undefined + message.nonexist = + object.nonexist !== undefined && object.nonexist !== null + ? NonExistenceProof.fromPartial(object.nonexist) + : undefined + message.batch = + object.batch !== undefined && object.batch !== null + ? BatchProof.fromPartial(object.batch) + : undefined + message.compressed = + object.compressed !== undefined && object.compressed !== null + ? CompressedBatchProof.fromPartial(object.compressed) + : undefined + return message + }, +} function createBaseLeafOp(): LeafOp { - return { hash: 0, prehashKey: 0, prehashValue: 0, length: 0, prefix: new Uint8Array() }; + return { + hash: 0, + prehashKey: 0, + prehashValue: 0, + length: 0, + prefix: new Uint8Array(), + } } export const LeafOp = { encode(message: LeafOp, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.hash !== 0) { - writer.uint32(8).int32(message.hash); + writer.uint32(8).int32(message.hash) } if (message.prehashKey !== 0) { - writer.uint32(16).int32(message.prehashKey); + writer.uint32(16).int32(message.prehashKey) } if (message.prehashValue !== 0) { - writer.uint32(24).int32(message.prehashValue); + writer.uint32(24).int32(message.prehashValue) } if (message.length !== 0) { - writer.uint32(32).int32(message.length); + writer.uint32(32).int32(message.length) } if (message.prefix.length !== 0) { - writer.uint32(42).bytes(message.prefix); + writer.uint32(42).bytes(message.prefix) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): LeafOp { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseLeafOp(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseLeafOp() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.hash = reader.int32() as any; - break; + message.hash = reader.int32() as any + break case 2: - message.prehashKey = reader.int32() as any; - break; + message.prehashKey = reader.int32() as any + break case 3: - message.prehashValue = reader.int32() as any; - break; + message.prehashValue = reader.int32() as any + break case 4: - message.length = reader.int32() as any; - break; + message.length = reader.int32() as any + break case 5: - message.prefix = reader.bytes(); - break; + message.prefix = reader.bytes() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): LeafOp { return { hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : 0, prehashKey: isSet(object.prehashKey) ? hashOpFromJSON(object.prehashKey) : 0, - prehashValue: isSet(object.prehashValue) ? hashOpFromJSON(object.prehashValue) : 0, + prehashValue: isSet(object.prehashValue) + ? hashOpFromJSON(object.prehashValue) + : 0, length: isSet(object.length) ? lengthOpFromJSON(object.length) : 0, prefix: isSet(object.prefix) ? bytesFromBase64(object.prefix) : new Uint8Array(), - }; + } }, toJSON(message: LeafOp): unknown { - const obj: any = {}; - message.hash !== undefined && (obj.hash = hashOpToJSON(message.hash)); - message.prehashKey !== undefined && (obj.prehashKey = hashOpToJSON(message.prehashKey)); - message.prehashValue !== undefined && (obj.prehashValue = hashOpToJSON(message.prehashValue)); - message.length !== undefined && (obj.length = lengthOpToJSON(message.length)); + const obj: any = {} + message.hash !== undefined && (obj.hash = hashOpToJSON(message.hash)) + message.prehashKey !== undefined && + (obj.prehashKey = hashOpToJSON(message.prehashKey)) + message.prehashValue !== undefined && + (obj.prehashValue = hashOpToJSON(message.prehashValue)) + message.length !== undefined && (obj.length = lengthOpToJSON(message.length)) message.prefix !== undefined && - (obj.prefix = base64FromBytes(message.prefix !== undefined ? message.prefix : new Uint8Array())); - return obj; + (obj.prefix = base64FromBytes( + message.prefix !== undefined ? message.prefix : new Uint8Array(), + )) + return obj }, fromPartial, I>>(object: I): LeafOp { - const message = createBaseLeafOp(); - message.hash = object.hash ?? 0; - message.prehashKey = object.prehashKey ?? 0; - message.prehashValue = object.prehashValue ?? 0; - message.length = object.length ?? 0; - message.prefix = object.prefix ?? new Uint8Array(); - return message; + const message = createBaseLeafOp() + message.hash = object.hash ?? 0 + message.prehashKey = object.prehashKey ?? 0 + message.prehashValue = object.prehashValue ?? 0 + message.length = object.length ?? 0 + message.prefix = object.prefix ?? new Uint8Array() + return message }, -}; +} function createBaseInnerOp(): InnerOp { - return { hash: 0, prefix: new Uint8Array(), suffix: new Uint8Array() }; + return { hash: 0, prefix: new Uint8Array(), suffix: new Uint8Array() } } export const InnerOp = { encode(message: InnerOp, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.hash !== 0) { - writer.uint32(8).int32(message.hash); + writer.uint32(8).int32(message.hash) } if (message.prefix.length !== 0) { - writer.uint32(18).bytes(message.prefix); + writer.uint32(18).bytes(message.prefix) } if (message.suffix.length !== 0) { - writer.uint32(26).bytes(message.suffix); + writer.uint32(26).bytes(message.suffix) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): InnerOp { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseInnerOp(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseInnerOp() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.hash = reader.int32() as any; - break; + message.hash = reader.int32() as any + break case 2: - message.prefix = reader.bytes(); - break; + message.prefix = reader.bytes() + break case 3: - message.suffix = reader.bytes(); - break; + message.suffix = reader.bytes() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): InnerOp { @@ -713,108 +775,119 @@ export const InnerOp = { hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : 0, prefix: isSet(object.prefix) ? bytesFromBase64(object.prefix) : new Uint8Array(), suffix: isSet(object.suffix) ? bytesFromBase64(object.suffix) : new Uint8Array(), - }; + } }, toJSON(message: InnerOp): unknown { - const obj: any = {}; - message.hash !== undefined && (obj.hash = hashOpToJSON(message.hash)); + const obj: any = {} + message.hash !== undefined && (obj.hash = hashOpToJSON(message.hash)) message.prefix !== undefined && - (obj.prefix = base64FromBytes(message.prefix !== undefined ? message.prefix : new Uint8Array())); + (obj.prefix = base64FromBytes( + message.prefix !== undefined ? message.prefix : new Uint8Array(), + )) message.suffix !== undefined && - (obj.suffix = base64FromBytes(message.suffix !== undefined ? message.suffix : new Uint8Array())); - return obj; + (obj.suffix = base64FromBytes( + message.suffix !== undefined ? message.suffix : new Uint8Array(), + )) + return obj }, fromPartial, I>>(object: I): InnerOp { - const message = createBaseInnerOp(); - message.hash = object.hash ?? 0; - message.prefix = object.prefix ?? new Uint8Array(); - message.suffix = object.suffix ?? new Uint8Array(); - return message; + const message = createBaseInnerOp() + message.hash = object.hash ?? 0 + message.prefix = object.prefix ?? new Uint8Array() + message.suffix = object.suffix ?? new Uint8Array() + return message }, -}; +} function createBaseProofSpec(): ProofSpec { - return { leafSpec: undefined, innerSpec: undefined, maxDepth: 0, minDepth: 0 }; + return { leafSpec: undefined, innerSpec: undefined, maxDepth: 0, minDepth: 0 } } export const ProofSpec = { encode(message: ProofSpec, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.leafSpec !== undefined) { - LeafOp.encode(message.leafSpec, writer.uint32(10).fork()).ldelim(); + LeafOp.encode(message.leafSpec, writer.uint32(10).fork()).ldelim() } if (message.innerSpec !== undefined) { - InnerSpec.encode(message.innerSpec, writer.uint32(18).fork()).ldelim(); + InnerSpec.encode(message.innerSpec, writer.uint32(18).fork()).ldelim() } if (message.maxDepth !== 0) { - writer.uint32(24).int32(message.maxDepth); + writer.uint32(24).int32(message.maxDepth) } if (message.minDepth !== 0) { - writer.uint32(32).int32(message.minDepth); + writer.uint32(32).int32(message.minDepth) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): ProofSpec { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseProofSpec(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseProofSpec() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.leafSpec = LeafOp.decode(reader, reader.uint32()); - break; + message.leafSpec = LeafOp.decode(reader, reader.uint32()) + break case 2: - message.innerSpec = InnerSpec.decode(reader, reader.uint32()); - break; + message.innerSpec = InnerSpec.decode(reader, reader.uint32()) + break case 3: - message.maxDepth = reader.int32(); - break; + message.maxDepth = reader.int32() + break case 4: - message.minDepth = reader.int32(); - break; + message.minDepth = reader.int32() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): ProofSpec { return { leafSpec: isSet(object.leafSpec) ? LeafOp.fromJSON(object.leafSpec) : undefined, - innerSpec: isSet(object.innerSpec) ? InnerSpec.fromJSON(object.innerSpec) : undefined, + innerSpec: isSet(object.innerSpec) + ? InnerSpec.fromJSON(object.innerSpec) + : undefined, maxDepth: isSet(object.maxDepth) ? Number(object.maxDepth) : 0, minDepth: isSet(object.minDepth) ? Number(object.minDepth) : 0, - }; + } }, toJSON(message: ProofSpec): unknown { - const obj: any = {}; - message.leafSpec !== undefined && (obj.leafSpec = message.leafSpec ? LeafOp.toJSON(message.leafSpec) : undefined); + const obj: any = {} + message.leafSpec !== undefined && + (obj.leafSpec = message.leafSpec ? LeafOp.toJSON(message.leafSpec) : undefined) message.innerSpec !== undefined && - (obj.innerSpec = message.innerSpec ? InnerSpec.toJSON(message.innerSpec) : undefined); - message.maxDepth !== undefined && (obj.maxDepth = Math.round(message.maxDepth)); - message.minDepth !== undefined && (obj.minDepth = Math.round(message.minDepth)); - return obj; + (obj.innerSpec = message.innerSpec + ? InnerSpec.toJSON(message.innerSpec) + : undefined) + message.maxDepth !== undefined && (obj.maxDepth = Math.round(message.maxDepth)) + message.minDepth !== undefined && (obj.minDepth = Math.round(message.minDepth)) + return obj }, fromPartial, I>>(object: I): ProofSpec { - const message = createBaseProofSpec(); - message.leafSpec = (object.leafSpec !== undefined && object.leafSpec !== null) - ? LeafOp.fromPartial(object.leafSpec) - : undefined; - message.innerSpec = (object.innerSpec !== undefined && object.innerSpec !== null) - ? InnerSpec.fromPartial(object.innerSpec) - : undefined; - message.maxDepth = object.maxDepth ?? 0; - message.minDepth = object.minDepth ?? 0; - return message; - }, -}; + const message = createBaseProofSpec() + message.leafSpec = + object.leafSpec !== undefined && object.leafSpec !== null + ? LeafOp.fromPartial(object.leafSpec) + : undefined + message.innerSpec = + object.innerSpec !== undefined && object.innerSpec !== null + ? InnerSpec.fromPartial(object.innerSpec) + : undefined + message.maxDepth = object.maxDepth ?? 0 + message.minDepth = object.minDepth ?? 0 + return message + }, +} function createBaseInnerSpec(): InnerSpec { return { @@ -824,412 +897,470 @@ function createBaseInnerSpec(): InnerSpec { maxPrefixLength: 0, emptyChild: new Uint8Array(), hash: 0, - }; + } } export const InnerSpec = { encode(message: InnerSpec, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - writer.uint32(10).fork(); + writer.uint32(10).fork() for (const v of message.childOrder) { - writer.int32(v); + writer.int32(v) } - writer.ldelim(); + writer.ldelim() if (message.childSize !== 0) { - writer.uint32(16).int32(message.childSize); + writer.uint32(16).int32(message.childSize) } if (message.minPrefixLength !== 0) { - writer.uint32(24).int32(message.minPrefixLength); + writer.uint32(24).int32(message.minPrefixLength) } if (message.maxPrefixLength !== 0) { - writer.uint32(32).int32(message.maxPrefixLength); + writer.uint32(32).int32(message.maxPrefixLength) } if (message.emptyChild.length !== 0) { - writer.uint32(42).bytes(message.emptyChild); + writer.uint32(42).bytes(message.emptyChild) } if (message.hash !== 0) { - writer.uint32(48).int32(message.hash); + writer.uint32(48).int32(message.hash) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): InnerSpec { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseInnerSpec(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseInnerSpec() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: if ((tag & 7) === 2) { - const end2 = reader.uint32() + reader.pos; + const end2 = reader.uint32() + reader.pos while (reader.pos < end2) { - message.childOrder.push(reader.int32()); + message.childOrder.push(reader.int32()) } } else { - message.childOrder.push(reader.int32()); + message.childOrder.push(reader.int32()) } - break; + break case 2: - message.childSize = reader.int32(); - break; + message.childSize = reader.int32() + break case 3: - message.minPrefixLength = reader.int32(); - break; + message.minPrefixLength = reader.int32() + break case 4: - message.maxPrefixLength = reader.int32(); - break; + message.maxPrefixLength = reader.int32() + break case 5: - message.emptyChild = reader.bytes(); - break; + message.emptyChild = reader.bytes() + break case 6: - message.hash = reader.int32() as any; - break; + message.hash = reader.int32() as any + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): InnerSpec { return { - childOrder: Array.isArray(object?.childOrder) ? object.childOrder.map((e: any) => Number(e)) : [], + childOrder: Array.isArray(object?.childOrder) + ? object.childOrder.map((e: any) => Number(e)) + : [], childSize: isSet(object.childSize) ? Number(object.childSize) : 0, - minPrefixLength: isSet(object.minPrefixLength) ? Number(object.minPrefixLength) : 0, - maxPrefixLength: isSet(object.maxPrefixLength) ? Number(object.maxPrefixLength) : 0, - emptyChild: isSet(object.emptyChild) ? bytesFromBase64(object.emptyChild) : new Uint8Array(), + minPrefixLength: isSet(object.minPrefixLength) + ? Number(object.minPrefixLength) + : 0, + maxPrefixLength: isSet(object.maxPrefixLength) + ? Number(object.maxPrefixLength) + : 0, + emptyChild: isSet(object.emptyChild) + ? bytesFromBase64(object.emptyChild) + : new Uint8Array(), hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : 0, - }; + } }, toJSON(message: InnerSpec): unknown { - const obj: any = {}; + const obj: any = {} if (message.childOrder) { - obj.childOrder = message.childOrder.map((e) => Math.round(e)); + obj.childOrder = message.childOrder.map((e) => Math.round(e)) } else { - obj.childOrder = []; + obj.childOrder = [] } - message.childSize !== undefined && (obj.childSize = Math.round(message.childSize)); - message.minPrefixLength !== undefined && (obj.minPrefixLength = Math.round(message.minPrefixLength)); - message.maxPrefixLength !== undefined && (obj.maxPrefixLength = Math.round(message.maxPrefixLength)); + message.childSize !== undefined && (obj.childSize = Math.round(message.childSize)) + message.minPrefixLength !== undefined && + (obj.minPrefixLength = Math.round(message.minPrefixLength)) + message.maxPrefixLength !== undefined && + (obj.maxPrefixLength = Math.round(message.maxPrefixLength)) message.emptyChild !== undefined && - (obj.emptyChild = base64FromBytes(message.emptyChild !== undefined ? message.emptyChild : new Uint8Array())); - message.hash !== undefined && (obj.hash = hashOpToJSON(message.hash)); - return obj; + (obj.emptyChild = base64FromBytes( + message.emptyChild !== undefined ? message.emptyChild : new Uint8Array(), + )) + message.hash !== undefined && (obj.hash = hashOpToJSON(message.hash)) + return obj }, fromPartial, I>>(object: I): InnerSpec { - const message = createBaseInnerSpec(); - message.childOrder = object.childOrder?.map((e) => e) || []; - message.childSize = object.childSize ?? 0; - message.minPrefixLength = object.minPrefixLength ?? 0; - message.maxPrefixLength = object.maxPrefixLength ?? 0; - message.emptyChild = object.emptyChild ?? new Uint8Array(); - message.hash = object.hash ?? 0; - return message; + const message = createBaseInnerSpec() + message.childOrder = object.childOrder?.map((e) => e) || [] + message.childSize = object.childSize ?? 0 + message.minPrefixLength = object.minPrefixLength ?? 0 + message.maxPrefixLength = object.maxPrefixLength ?? 0 + message.emptyChild = object.emptyChild ?? new Uint8Array() + message.hash = object.hash ?? 0 + return message }, -}; +} function createBaseBatchProof(): BatchProof { - return { entries: [] }; + return { entries: [] } } export const BatchProof = { encode(message: BatchProof, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.entries) { - BatchEntry.encode(v!, writer.uint32(10).fork()).ldelim(); + BatchEntry.encode(v!, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): BatchProof { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseBatchProof(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseBatchProof() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.entries.push(BatchEntry.decode(reader, reader.uint32())); - break; + message.entries.push(BatchEntry.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): BatchProof { - return { entries: Array.isArray(object?.entries) ? object.entries.map((e: any) => BatchEntry.fromJSON(e)) : [] }; + return { + entries: Array.isArray(object?.entries) + ? object.entries.map((e: any) => BatchEntry.fromJSON(e)) + : [], + } }, toJSON(message: BatchProof): unknown { - const obj: any = {}; + const obj: any = {} if (message.entries) { - obj.entries = message.entries.map((e) => e ? BatchEntry.toJSON(e) : undefined); + obj.entries = message.entries.map((e) => (e ? BatchEntry.toJSON(e) : undefined)) } else { - obj.entries = []; + obj.entries = [] } - return obj; + return obj }, fromPartial, I>>(object: I): BatchProof { - const message = createBaseBatchProof(); - message.entries = object.entries?.map((e) => BatchEntry.fromPartial(e)) || []; - return message; + const message = createBaseBatchProof() + message.entries = object.entries?.map((e) => BatchEntry.fromPartial(e)) || [] + return message }, -}; +} function createBaseBatchEntry(): BatchEntry { - return { exist: undefined, nonexist: undefined }; + return { exist: undefined, nonexist: undefined } } export const BatchEntry = { encode(message: BatchEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.exist !== undefined) { - ExistenceProof.encode(message.exist, writer.uint32(10).fork()).ldelim(); + ExistenceProof.encode(message.exist, writer.uint32(10).fork()).ldelim() } if (message.nonexist !== undefined) { - NonExistenceProof.encode(message.nonexist, writer.uint32(18).fork()).ldelim(); + NonExistenceProof.encode(message.nonexist, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): BatchEntry { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseBatchEntry(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseBatchEntry() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.exist = ExistenceProof.decode(reader, reader.uint32()); - break; + message.exist = ExistenceProof.decode(reader, reader.uint32()) + break case 2: - message.nonexist = NonExistenceProof.decode(reader, reader.uint32()); - break; + message.nonexist = NonExistenceProof.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): BatchEntry { return { exist: isSet(object.exist) ? ExistenceProof.fromJSON(object.exist) : undefined, - nonexist: isSet(object.nonexist) ? NonExistenceProof.fromJSON(object.nonexist) : undefined, - }; + nonexist: isSet(object.nonexist) + ? NonExistenceProof.fromJSON(object.nonexist) + : undefined, + } }, toJSON(message: BatchEntry): unknown { - const obj: any = {}; - message.exist !== undefined && (obj.exist = message.exist ? ExistenceProof.toJSON(message.exist) : undefined); + const obj: any = {} + message.exist !== undefined && + (obj.exist = message.exist ? ExistenceProof.toJSON(message.exist) : undefined) message.nonexist !== undefined && - (obj.nonexist = message.nonexist ? NonExistenceProof.toJSON(message.nonexist) : undefined); - return obj; + (obj.nonexist = message.nonexist + ? NonExistenceProof.toJSON(message.nonexist) + : undefined) + return obj }, fromPartial, I>>(object: I): BatchEntry { - const message = createBaseBatchEntry(); - message.exist = (object.exist !== undefined && object.exist !== null) - ? ExistenceProof.fromPartial(object.exist) - : undefined; - message.nonexist = (object.nonexist !== undefined && object.nonexist !== null) - ? NonExistenceProof.fromPartial(object.nonexist) - : undefined; - return message; + const message = createBaseBatchEntry() + message.exist = + object.exist !== undefined && object.exist !== null + ? ExistenceProof.fromPartial(object.exist) + : undefined + message.nonexist = + object.nonexist !== undefined && object.nonexist !== null + ? NonExistenceProof.fromPartial(object.nonexist) + : undefined + return message }, -}; +} function createBaseCompressedBatchProof(): CompressedBatchProof { - return { entries: [], lookupInners: [] }; + return { entries: [], lookupInners: [] } } export const CompressedBatchProof = { - encode(message: CompressedBatchProof, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: CompressedBatchProof, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { for (const v of message.entries) { - CompressedBatchEntry.encode(v!, writer.uint32(10).fork()).ldelim(); + CompressedBatchEntry.encode(v!, writer.uint32(10).fork()).ldelim() } for (const v of message.lookupInners) { - InnerOp.encode(v!, writer.uint32(18).fork()).ldelim(); + InnerOp.encode(v!, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): CompressedBatchProof { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseCompressedBatchProof(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseCompressedBatchProof() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.entries.push(CompressedBatchEntry.decode(reader, reader.uint32())); - break; + message.entries.push(CompressedBatchEntry.decode(reader, reader.uint32())) + break case 2: - message.lookupInners.push(InnerOp.decode(reader, reader.uint32())); - break; + message.lookupInners.push(InnerOp.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): CompressedBatchProof { return { - entries: Array.isArray(object?.entries) ? object.entries.map((e: any) => CompressedBatchEntry.fromJSON(e)) : [], - lookupInners: Array.isArray(object?.lookupInners) ? object.lookupInners.map((e: any) => InnerOp.fromJSON(e)) : [], - }; + entries: Array.isArray(object?.entries) + ? object.entries.map((e: any) => CompressedBatchEntry.fromJSON(e)) + : [], + lookupInners: Array.isArray(object?.lookupInners) + ? object.lookupInners.map((e: any) => InnerOp.fromJSON(e)) + : [], + } }, toJSON(message: CompressedBatchProof): unknown { - const obj: any = {}; + const obj: any = {} if (message.entries) { - obj.entries = message.entries.map((e) => e ? CompressedBatchEntry.toJSON(e) : undefined); + obj.entries = message.entries.map((e) => + e ? CompressedBatchEntry.toJSON(e) : undefined, + ) } else { - obj.entries = []; + obj.entries = [] } if (message.lookupInners) { - obj.lookupInners = message.lookupInners.map((e) => e ? InnerOp.toJSON(e) : undefined); + obj.lookupInners = message.lookupInners.map((e) => + e ? InnerOp.toJSON(e) : undefined, + ) } else { - obj.lookupInners = []; + obj.lookupInners = [] } - return obj; + return obj }, - fromPartial, I>>(object: I): CompressedBatchProof { - const message = createBaseCompressedBatchProof(); - message.entries = object.entries?.map((e) => CompressedBatchEntry.fromPartial(e)) || []; - message.lookupInners = object.lookupInners?.map((e) => InnerOp.fromPartial(e)) || []; - return message; + fromPartial, I>>( + object: I, + ): CompressedBatchProof { + const message = createBaseCompressedBatchProof() + message.entries = + object.entries?.map((e) => CompressedBatchEntry.fromPartial(e)) || [] + message.lookupInners = object.lookupInners?.map((e) => InnerOp.fromPartial(e)) || [] + return message }, -}; +} function createBaseCompressedBatchEntry(): CompressedBatchEntry { - return { exist: undefined, nonexist: undefined }; + return { exist: undefined, nonexist: undefined } } export const CompressedBatchEntry = { - encode(message: CompressedBatchEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: CompressedBatchEntry, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.exist !== undefined) { - CompressedExistenceProof.encode(message.exist, writer.uint32(10).fork()).ldelim(); + CompressedExistenceProof.encode(message.exist, writer.uint32(10).fork()).ldelim() } if (message.nonexist !== undefined) { - CompressedNonExistenceProof.encode(message.nonexist, writer.uint32(18).fork()).ldelim(); + CompressedNonExistenceProof.encode( + message.nonexist, + writer.uint32(18).fork(), + ).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): CompressedBatchEntry { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseCompressedBatchEntry(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseCompressedBatchEntry() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.exist = CompressedExistenceProof.decode(reader, reader.uint32()); - break; + message.exist = CompressedExistenceProof.decode(reader, reader.uint32()) + break case 2: - message.nonexist = CompressedNonExistenceProof.decode(reader, reader.uint32()); - break; + message.nonexist = CompressedNonExistenceProof.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): CompressedBatchEntry { return { - exist: isSet(object.exist) ? CompressedExistenceProof.fromJSON(object.exist) : undefined, - nonexist: isSet(object.nonexist) ? CompressedNonExistenceProof.fromJSON(object.nonexist) : undefined, - }; + exist: isSet(object.exist) + ? CompressedExistenceProof.fromJSON(object.exist) + : undefined, + nonexist: isSet(object.nonexist) + ? CompressedNonExistenceProof.fromJSON(object.nonexist) + : undefined, + } }, toJSON(message: CompressedBatchEntry): unknown { - const obj: any = {}; + const obj: any = {} message.exist !== undefined && - (obj.exist = message.exist ? CompressedExistenceProof.toJSON(message.exist) : undefined); + (obj.exist = message.exist + ? CompressedExistenceProof.toJSON(message.exist) + : undefined) message.nonexist !== undefined && - (obj.nonexist = message.nonexist ? CompressedNonExistenceProof.toJSON(message.nonexist) : undefined); - return obj; - }, - - fromPartial, I>>(object: I): CompressedBatchEntry { - const message = createBaseCompressedBatchEntry(); - message.exist = (object.exist !== undefined && object.exist !== null) - ? CompressedExistenceProof.fromPartial(object.exist) - : undefined; - message.nonexist = (object.nonexist !== undefined && object.nonexist !== null) - ? CompressedNonExistenceProof.fromPartial(object.nonexist) - : undefined; - return message; + (obj.nonexist = message.nonexist + ? CompressedNonExistenceProof.toJSON(message.nonexist) + : undefined) + return obj + }, + + fromPartial, I>>( + object: I, + ): CompressedBatchEntry { + const message = createBaseCompressedBatchEntry() + message.exist = + object.exist !== undefined && object.exist !== null + ? CompressedExistenceProof.fromPartial(object.exist) + : undefined + message.nonexist = + object.nonexist !== undefined && object.nonexist !== null + ? CompressedNonExistenceProof.fromPartial(object.nonexist) + : undefined + return message }, -}; +} function createBaseCompressedExistenceProof(): CompressedExistenceProof { - return { key: new Uint8Array(), value: new Uint8Array(), leaf: undefined, path: [] }; + return { key: new Uint8Array(), value: new Uint8Array(), leaf: undefined, path: [] } } export const CompressedExistenceProof = { - encode(message: CompressedExistenceProof, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: CompressedExistenceProof, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.key.length !== 0) { - writer.uint32(10).bytes(message.key); + writer.uint32(10).bytes(message.key) } if (message.value.length !== 0) { - writer.uint32(18).bytes(message.value); + writer.uint32(18).bytes(message.value) } if (message.leaf !== undefined) { - LeafOp.encode(message.leaf, writer.uint32(26).fork()).ldelim(); + LeafOp.encode(message.leaf, writer.uint32(26).fork()).ldelim() } - writer.uint32(34).fork(); + writer.uint32(34).fork() for (const v of message.path) { - writer.int32(v); + writer.int32(v) } - writer.ldelim(); - return writer; + writer.ldelim() + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): CompressedExistenceProof { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseCompressedExistenceProof(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseCompressedExistenceProof() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.key = reader.bytes(); - break; + message.key = reader.bytes() + break case 2: - message.value = reader.bytes(); - break; + message.value = reader.bytes() + break case 3: - message.leaf = LeafOp.decode(reader, reader.uint32()); - break; + message.leaf = LeafOp.decode(reader, reader.uint32()) + break case 4: if ((tag & 7) === 2) { - const end2 = reader.uint32() + reader.pos; + const end2 = reader.uint32() + reader.pos while (reader.pos < end2) { - message.path.push(reader.int32()); + message.path.push(reader.int32()) } } else { - message.path.push(reader.int32()); + message.path.push(reader.int32()) } - break; + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): CompressedExistenceProof { @@ -1238,168 +1369,194 @@ export const CompressedExistenceProof = { value: isSet(object.value) ? bytesFromBase64(object.value) : new Uint8Array(), leaf: isSet(object.leaf) ? LeafOp.fromJSON(object.leaf) : undefined, path: Array.isArray(object?.path) ? object.path.map((e: any) => Number(e)) : [], - }; + } }, toJSON(message: CompressedExistenceProof): unknown { - const obj: any = {}; + const obj: any = {} message.key !== undefined && - (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); + (obj.key = base64FromBytes( + message.key !== undefined ? message.key : new Uint8Array(), + )) message.value !== undefined && - (obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array())); - message.leaf !== undefined && (obj.leaf = message.leaf ? LeafOp.toJSON(message.leaf) : undefined); + (obj.value = base64FromBytes( + message.value !== undefined ? message.value : new Uint8Array(), + )) + message.leaf !== undefined && + (obj.leaf = message.leaf ? LeafOp.toJSON(message.leaf) : undefined) if (message.path) { - obj.path = message.path.map((e) => Math.round(e)); + obj.path = message.path.map((e) => Math.round(e)) } else { - obj.path = []; + obj.path = [] } - return obj; - }, - - fromPartial, I>>(object: I): CompressedExistenceProof { - const message = createBaseCompressedExistenceProof(); - message.key = object.key ?? new Uint8Array(); - message.value = object.value ?? new Uint8Array(); - message.leaf = (object.leaf !== undefined && object.leaf !== null) ? LeafOp.fromPartial(object.leaf) : undefined; - message.path = object.path?.map((e) => e) || []; - return message; + return obj + }, + + fromPartial, I>>( + object: I, + ): CompressedExistenceProof { + const message = createBaseCompressedExistenceProof() + message.key = object.key ?? new Uint8Array() + message.value = object.value ?? new Uint8Array() + message.leaf = + object.leaf !== undefined && object.leaf !== null + ? LeafOp.fromPartial(object.leaf) + : undefined + message.path = object.path?.map((e) => e) || [] + return message }, -}; +} function createBaseCompressedNonExistenceProof(): CompressedNonExistenceProof { - return { key: new Uint8Array(), left: undefined, right: undefined }; + return { key: new Uint8Array(), left: undefined, right: undefined } } export const CompressedNonExistenceProof = { - encode(message: CompressedNonExistenceProof, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: CompressedNonExistenceProof, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.key.length !== 0) { - writer.uint32(10).bytes(message.key); + writer.uint32(10).bytes(message.key) } if (message.left !== undefined) { - CompressedExistenceProof.encode(message.left, writer.uint32(18).fork()).ldelim(); + CompressedExistenceProof.encode(message.left, writer.uint32(18).fork()).ldelim() } if (message.right !== undefined) { - CompressedExistenceProof.encode(message.right, writer.uint32(26).fork()).ldelim(); + CompressedExistenceProof.encode(message.right, writer.uint32(26).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): CompressedNonExistenceProof { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseCompressedNonExistenceProof(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseCompressedNonExistenceProof() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.key = reader.bytes(); - break; + message.key = reader.bytes() + break case 2: - message.left = CompressedExistenceProof.decode(reader, reader.uint32()); - break; + message.left = CompressedExistenceProof.decode(reader, reader.uint32()) + break case 3: - message.right = CompressedExistenceProof.decode(reader, reader.uint32()); - break; + message.right = CompressedExistenceProof.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): CompressedNonExistenceProof { return { key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array(), - left: isSet(object.left) ? CompressedExistenceProof.fromJSON(object.left) : undefined, - right: isSet(object.right) ? CompressedExistenceProof.fromJSON(object.right) : undefined, - }; + left: isSet(object.left) + ? CompressedExistenceProof.fromJSON(object.left) + : undefined, + right: isSet(object.right) + ? CompressedExistenceProof.fromJSON(object.right) + : undefined, + } }, toJSON(message: CompressedNonExistenceProof): unknown { - const obj: any = {}; + const obj: any = {} message.key !== undefined && - (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); - message.left !== undefined && (obj.left = message.left ? CompressedExistenceProof.toJSON(message.left) : undefined); + (obj.key = base64FromBytes( + message.key !== undefined ? message.key : new Uint8Array(), + )) + message.left !== undefined && + (obj.left = message.left + ? CompressedExistenceProof.toJSON(message.left) + : undefined) message.right !== undefined && - (obj.right = message.right ? CompressedExistenceProof.toJSON(message.right) : undefined); - return obj; - }, - - fromPartial, I>>(object: I): CompressedNonExistenceProof { - const message = createBaseCompressedNonExistenceProof(); - message.key = object.key ?? new Uint8Array(); - message.left = (object.left !== undefined && object.left !== null) - ? CompressedExistenceProof.fromPartial(object.left) - : undefined; - message.right = (object.right !== undefined && object.right !== null) - ? CompressedExistenceProof.fromPartial(object.right) - : undefined; - return message; - }, -}; - -declare var self: any | undefined; -declare var window: any | undefined; -declare var global: any | undefined; -var globalThis: any = (() => { - if (typeof globalThis !== "undefined") { - return globalThis; - } - if (typeof self !== "undefined") { - return self; - } - if (typeof window !== "undefined") { - return window; - } - if (typeof global !== "undefined") { - return global; - } - throw "Unable to locate global object"; -})(); + (obj.right = message.right + ? CompressedExistenceProof.toJSON(message.right) + : undefined) + return obj + }, + + fromPartial, I>>( + object: I, + ): CompressedNonExistenceProof { + const message = createBaseCompressedNonExistenceProof() + message.key = object.key ?? new Uint8Array() + message.left = + object.left !== undefined && object.left !== null + ? CompressedExistenceProof.fromPartial(object.left) + : undefined + message.right = + object.right !== undefined && object.right !== null + ? CompressedExistenceProof.fromPartial(object.right) + : undefined + return message + }, +} +declare var self: any | undefined +declare var window: any | undefined +declare var global: any | undefined +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis + if (typeof self !== "undefined") return self + if (typeof window !== "undefined") return window + if (typeof global !== "undefined") return global + throw "Unable to locate global object" +})() + +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")) function bytesFromBase64(b64: string): Uint8Array { - if (globalThis.Buffer) { - return Uint8Array.from(globalThis.Buffer.from(b64, "base64")); - } else { - const bin = globalThis.atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; + 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 } +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")) function base64FromBytes(arr: Uint8Array): string { - if (globalThis.Buffer) { - return globalThis.Buffer.from(arr).toString("base64"); - } else { - const bin: string[] = []; - arr.forEach((byte) => { - bin.push(String.fromCharCode(byte)); - }); - return globalThis.btoa(bin.join("")); - } + const bin: string[] = [] + arr.forEach((byte) => { + bin.push(String.fromCharCode(byte)) + }) + return btoa(bin.join("")) } -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/cosmos/auth/v1beta1/auth.ts b/packages/protojs/src/cosmos/auth/v1beta1/auth.ts index d1559430..8f94096a 100644 --- a/packages/protojs/src/cosmos/auth/v1beta1/auth.ts +++ b/packages/protojs/src/cosmos/auth/v1beta1/auth.ts @@ -1,9 +1,9 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { Any } from "../../../google/protobuf/any"; +import { Any } from "../../../google/protobuf/any" +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "cosmos.auth.v1beta1"; +export const protobufPackage = "cosmos.auth.v1beta1" /** * BaseAccount defines a base account type. It contains all the necessary fields @@ -11,183 +11,205 @@ export const protobufPackage = "cosmos.auth.v1beta1"; * type for additional functionality (e.g. vesting). */ export interface BaseAccount { - address: string; - pubKey?: Any; - accountNumber: Long; - sequence: Long; + address: string + pubKey?: Any + accountNumber: Long + sequence: Long } /** ModuleAccount defines an account for modules that holds coins on a pool. */ export interface ModuleAccount { - baseAccount?: BaseAccount; - name: string; - permissions: string[]; + baseAccount?: BaseAccount + name: string + permissions: string[] } /** Params defines the parameters for the auth module. */ export interface Params { - maxMemoCharacters: Long; - txSigLimit: Long; - txSizeCostPerByte: Long; - sigVerifyCostEd25519: Long; - sigVerifyCostSecp256k1: Long; + maxMemoCharacters: Long + txSigLimit: Long + txSizeCostPerByte: Long + sigVerifyCostEd25519: Long + sigVerifyCostSecp256k1: Long } function createBaseBaseAccount(): BaseAccount { - return { address: "", pubKey: undefined, accountNumber: Long.UZERO, sequence: Long.UZERO }; + return { + address: "", + pubKey: undefined, + accountNumber: Long.UZERO, + sequence: Long.UZERO, + } } export const BaseAccount = { encode(message: BaseAccount, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.address !== "") { - writer.uint32(10).string(message.address); + writer.uint32(10).string(message.address) } if (message.pubKey !== undefined) { - Any.encode(message.pubKey, writer.uint32(18).fork()).ldelim(); + Any.encode(message.pubKey, writer.uint32(18).fork()).ldelim() } if (!message.accountNumber.isZero()) { - writer.uint32(24).uint64(message.accountNumber); + writer.uint32(24).uint64(message.accountNumber) } if (!message.sequence.isZero()) { - writer.uint32(32).uint64(message.sequence); + writer.uint32(32).uint64(message.sequence) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): BaseAccount { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseBaseAccount(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseBaseAccount() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.address = reader.string(); - break; + message.address = reader.string() + break case 2: - message.pubKey = Any.decode(reader, reader.uint32()); - break; + message.pubKey = Any.decode(reader, reader.uint32()) + break case 3: - message.accountNumber = reader.uint64() as Long; - break; + message.accountNumber = reader.uint64() as Long + break case 4: - message.sequence = reader.uint64() as Long; - break; + message.sequence = reader.uint64() as Long + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): BaseAccount { return { address: isSet(object.address) ? String(object.address) : "", pubKey: isSet(object.pubKey) ? Any.fromJSON(object.pubKey) : undefined, - accountNumber: isSet(object.accountNumber) ? Long.fromValue(object.accountNumber) : Long.UZERO, + accountNumber: isSet(object.accountNumber) + ? Long.fromValue(object.accountNumber) + : Long.UZERO, sequence: isSet(object.sequence) ? Long.fromValue(object.sequence) : Long.UZERO, - }; + } }, toJSON(message: BaseAccount): unknown { - const obj: any = {}; - message.address !== undefined && (obj.address = message.address); - message.pubKey !== undefined && (obj.pubKey = message.pubKey ? Any.toJSON(message.pubKey) : undefined); - message.accountNumber !== undefined && (obj.accountNumber = (message.accountNumber || Long.UZERO).toString()); - message.sequence !== undefined && (obj.sequence = (message.sequence || Long.UZERO).toString()); - return obj; + const obj: any = {} + message.address !== undefined && (obj.address = message.address) + message.pubKey !== undefined && + (obj.pubKey = message.pubKey ? Any.toJSON(message.pubKey) : undefined) + message.accountNumber !== undefined && + (obj.accountNumber = (message.accountNumber || Long.UZERO).toString()) + message.sequence !== undefined && + (obj.sequence = (message.sequence || Long.UZERO).toString()) + return obj }, fromPartial, I>>(object: I): BaseAccount { - const message = createBaseBaseAccount(); - message.address = object.address ?? ""; - message.pubKey = (object.pubKey !== undefined && object.pubKey !== null) - ? Any.fromPartial(object.pubKey) - : undefined; - message.accountNumber = (object.accountNumber !== undefined && object.accountNumber !== null) - ? Long.fromValue(object.accountNumber) - : Long.UZERO; - message.sequence = (object.sequence !== undefined && object.sequence !== null) - ? Long.fromValue(object.sequence) - : Long.UZERO; - return message; + const message = createBaseBaseAccount() + message.address = object.address ?? "" + message.pubKey = + object.pubKey !== undefined && object.pubKey !== null + ? Any.fromPartial(object.pubKey) + : undefined + message.accountNumber = + object.accountNumber !== undefined && object.accountNumber !== null + ? Long.fromValue(object.accountNumber) + : Long.UZERO + message.sequence = + object.sequence !== undefined && object.sequence !== null + ? Long.fromValue(object.sequence) + : Long.UZERO + return message }, -}; +} function createBaseModuleAccount(): ModuleAccount { - return { baseAccount: undefined, name: "", permissions: [] }; + return { baseAccount: undefined, name: "", permissions: [] } } export const ModuleAccount = { encode(message: ModuleAccount, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.baseAccount !== undefined) { - BaseAccount.encode(message.baseAccount, writer.uint32(10).fork()).ldelim(); + BaseAccount.encode(message.baseAccount, writer.uint32(10).fork()).ldelim() } if (message.name !== "") { - writer.uint32(18).string(message.name); + writer.uint32(18).string(message.name) } for (const v of message.permissions) { - writer.uint32(26).string(v!); + writer.uint32(26).string(v!) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): ModuleAccount { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseModuleAccount(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseModuleAccount() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.baseAccount = BaseAccount.decode(reader, reader.uint32()); - break; + message.baseAccount = BaseAccount.decode(reader, reader.uint32()) + break case 2: - message.name = reader.string(); - break; + message.name = reader.string() + break case 3: - message.permissions.push(reader.string()); - break; + message.permissions.push(reader.string()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): ModuleAccount { return { - baseAccount: isSet(object.baseAccount) ? BaseAccount.fromJSON(object.baseAccount) : undefined, + baseAccount: isSet(object.baseAccount) + ? BaseAccount.fromJSON(object.baseAccount) + : undefined, name: isSet(object.name) ? String(object.name) : "", - permissions: Array.isArray(object?.permissions) ? object.permissions.map((e: any) => String(e)) : [], - }; + permissions: Array.isArray(object?.permissions) + ? object.permissions.map((e: any) => String(e)) + : [], + } }, toJSON(message: ModuleAccount): unknown { - const obj: any = {}; + const obj: any = {} message.baseAccount !== undefined && - (obj.baseAccount = message.baseAccount ? BaseAccount.toJSON(message.baseAccount) : undefined); - message.name !== undefined && (obj.name = message.name); + (obj.baseAccount = message.baseAccount + ? BaseAccount.toJSON(message.baseAccount) + : undefined) + message.name !== undefined && (obj.name = message.name) if (message.permissions) { - obj.permissions = message.permissions.map((e) => e); + obj.permissions = message.permissions.map((e) => e) } else { - obj.permissions = []; + obj.permissions = [] } - return obj; + return obj }, - fromPartial, I>>(object: I): ModuleAccount { - const message = createBaseModuleAccount(); - message.baseAccount = (object.baseAccount !== undefined && object.baseAccount !== null) - ? BaseAccount.fromPartial(object.baseAccount) - : undefined; - message.name = object.name ?? ""; - message.permissions = object.permissions?.map((e) => e) || []; - return message; + fromPartial, I>>( + object: I, + ): ModuleAccount { + const message = createBaseModuleAccount() + message.baseAccount = + object.baseAccount !== undefined && object.baseAccount !== null + ? BaseAccount.fromPartial(object.baseAccount) + : undefined + message.name = object.name ?? "" + message.permissions = object.permissions?.map((e) => e) || [] + return message }, -}; +} function createBaseParams(): Params { return { @@ -196,126 +218,152 @@ function createBaseParams(): Params { txSizeCostPerByte: Long.UZERO, sigVerifyCostEd25519: Long.UZERO, sigVerifyCostSecp256k1: Long.UZERO, - }; + } } export const Params = { encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (!message.maxMemoCharacters.isZero()) { - writer.uint32(8).uint64(message.maxMemoCharacters); + writer.uint32(8).uint64(message.maxMemoCharacters) } if (!message.txSigLimit.isZero()) { - writer.uint32(16).uint64(message.txSigLimit); + writer.uint32(16).uint64(message.txSigLimit) } if (!message.txSizeCostPerByte.isZero()) { - writer.uint32(24).uint64(message.txSizeCostPerByte); + writer.uint32(24).uint64(message.txSizeCostPerByte) } if (!message.sigVerifyCostEd25519.isZero()) { - writer.uint32(32).uint64(message.sigVerifyCostEd25519); + writer.uint32(32).uint64(message.sigVerifyCostEd25519) } if (!message.sigVerifyCostSecp256k1.isZero()) { - writer.uint32(40).uint64(message.sigVerifyCostSecp256k1); + writer.uint32(40).uint64(message.sigVerifyCostSecp256k1) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Params { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseParams(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseParams() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.maxMemoCharacters = reader.uint64() as Long; - break; + message.maxMemoCharacters = reader.uint64() as Long + break case 2: - message.txSigLimit = reader.uint64() as Long; - break; + message.txSigLimit = reader.uint64() as Long + break case 3: - message.txSizeCostPerByte = reader.uint64() as Long; - break; + message.txSizeCostPerByte = reader.uint64() as Long + break case 4: - message.sigVerifyCostEd25519 = reader.uint64() as Long; - break; + message.sigVerifyCostEd25519 = reader.uint64() as Long + break case 5: - message.sigVerifyCostSecp256k1 = reader.uint64() as Long; - break; + message.sigVerifyCostSecp256k1 = reader.uint64() as Long + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Params { return { - maxMemoCharacters: isSet(object.maxMemoCharacters) ? Long.fromValue(object.maxMemoCharacters) : Long.UZERO, - txSigLimit: isSet(object.txSigLimit) ? Long.fromValue(object.txSigLimit) : Long.UZERO, - txSizeCostPerByte: isSet(object.txSizeCostPerByte) ? Long.fromValue(object.txSizeCostPerByte) : Long.UZERO, + maxMemoCharacters: isSet(object.maxMemoCharacters) + ? Long.fromValue(object.maxMemoCharacters) + : Long.UZERO, + txSigLimit: isSet(object.txSigLimit) + ? Long.fromValue(object.txSigLimit) + : Long.UZERO, + txSizeCostPerByte: isSet(object.txSizeCostPerByte) + ? Long.fromValue(object.txSizeCostPerByte) + : Long.UZERO, sigVerifyCostEd25519: isSet(object.sigVerifyCostEd25519) ? Long.fromValue(object.sigVerifyCostEd25519) : Long.UZERO, sigVerifyCostSecp256k1: isSet(object.sigVerifyCostSecp256k1) ? Long.fromValue(object.sigVerifyCostSecp256k1) : Long.UZERO, - }; + } }, toJSON(message: Params): unknown { - const obj: any = {}; + const obj: any = {} message.maxMemoCharacters !== undefined && - (obj.maxMemoCharacters = (message.maxMemoCharacters || Long.UZERO).toString()); - message.txSigLimit !== undefined && (obj.txSigLimit = (message.txSigLimit || Long.UZERO).toString()); + (obj.maxMemoCharacters = (message.maxMemoCharacters || Long.UZERO).toString()) + message.txSigLimit !== undefined && + (obj.txSigLimit = (message.txSigLimit || Long.UZERO).toString()) message.txSizeCostPerByte !== undefined && - (obj.txSizeCostPerByte = (message.txSizeCostPerByte || Long.UZERO).toString()); + (obj.txSizeCostPerByte = (message.txSizeCostPerByte || Long.UZERO).toString()) message.sigVerifyCostEd25519 !== undefined && - (obj.sigVerifyCostEd25519 = (message.sigVerifyCostEd25519 || Long.UZERO).toString()); + (obj.sigVerifyCostEd25519 = ( + message.sigVerifyCostEd25519 || Long.UZERO + ).toString()) message.sigVerifyCostSecp256k1 !== undefined && - (obj.sigVerifyCostSecp256k1 = (message.sigVerifyCostSecp256k1 || Long.UZERO).toString()); - return obj; + (obj.sigVerifyCostSecp256k1 = ( + message.sigVerifyCostSecp256k1 || Long.UZERO + ).toString()) + return obj }, fromPartial, I>>(object: I): Params { - const message = createBaseParams(); - message.maxMemoCharacters = (object.maxMemoCharacters !== undefined && object.maxMemoCharacters !== null) - ? Long.fromValue(object.maxMemoCharacters) - : Long.UZERO; - message.txSigLimit = (object.txSigLimit !== undefined && object.txSigLimit !== null) - ? Long.fromValue(object.txSigLimit) - : Long.UZERO; - message.txSizeCostPerByte = (object.txSizeCostPerByte !== undefined && object.txSizeCostPerByte !== null) - ? Long.fromValue(object.txSizeCostPerByte) - : Long.UZERO; - message.sigVerifyCostEd25519 = (object.sigVerifyCostEd25519 !== undefined && object.sigVerifyCostEd25519 !== null) - ? Long.fromValue(object.sigVerifyCostEd25519) - : Long.UZERO; + const message = createBaseParams() + message.maxMemoCharacters = + object.maxMemoCharacters !== undefined && object.maxMemoCharacters !== null + ? Long.fromValue(object.maxMemoCharacters) + : Long.UZERO + message.txSigLimit = + object.txSigLimit !== undefined && object.txSigLimit !== null + ? Long.fromValue(object.txSigLimit) + : Long.UZERO + message.txSizeCostPerByte = + object.txSizeCostPerByte !== undefined && object.txSizeCostPerByte !== null + ? Long.fromValue(object.txSizeCostPerByte) + : Long.UZERO + message.sigVerifyCostEd25519 = + object.sigVerifyCostEd25519 !== undefined && object.sigVerifyCostEd25519 !== null + ? Long.fromValue(object.sigVerifyCostEd25519) + : Long.UZERO message.sigVerifyCostSecp256k1 = - (object.sigVerifyCostSecp256k1 !== undefined && object.sigVerifyCostSecp256k1 !== null) + object.sigVerifyCostSecp256k1 !== undefined && + object.sigVerifyCostSecp256k1 !== null ? Long.fromValue(object.sigVerifyCostSecp256k1) - : Long.UZERO; - return message; + : Long.UZERO + return message }, -}; +} -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/cosmos/auth/v1beta1/genesis.ts b/packages/protojs/src/cosmos/auth/v1beta1/genesis.ts index 366c77e2..715752f7 100644 --- a/packages/protojs/src/cosmos/auth/v1beta1/genesis.ts +++ b/packages/protojs/src/cosmos/auth/v1beta1/genesis.ts @@ -1,100 +1,114 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { Any } from "../../../google/protobuf/any"; -import { Params } from "./auth"; +import { Params } from "./auth" +import Long from "long" +import { Any } from "../../../google/protobuf/any" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "cosmos.auth.v1beta1"; +export const protobufPackage = "cosmos.auth.v1beta1" /** GenesisState defines the auth module's genesis state. */ export interface GenesisState { /** params defines all the paramaters of the module. */ - params?: Params; + params?: Params /** accounts are the accounts present at genesis. */ - accounts: Any[]; + accounts: Any[] } function createBaseGenesisState(): GenesisState { - return { params: undefined, accounts: [] }; + return { params: undefined, accounts: [] } } export const GenesisState = { encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.params !== undefined) { - Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + Params.encode(message.params, writer.uint32(10).fork()).ldelim() } for (const v of message.accounts) { - Any.encode(v!, writer.uint32(18).fork()).ldelim(); + Any.encode(v!, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGenesisState(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseGenesisState() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.params = Params.decode(reader, reader.uint32()); - break; + message.params = Params.decode(reader, reader.uint32()) + break case 2: - message.accounts.push(Any.decode(reader, reader.uint32())); - break; + message.accounts.push(Any.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): GenesisState { return { params: isSet(object.params) ? Params.fromJSON(object.params) : undefined, - accounts: Array.isArray(object?.accounts) ? object.accounts.map((e: any) => Any.fromJSON(e)) : [], - }; + accounts: Array.isArray(object?.accounts) + ? object.accounts.map((e: any) => Any.fromJSON(e)) + : [], + } }, toJSON(message: GenesisState): unknown { - const obj: any = {}; - message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + const obj: any = {} + message.params !== undefined && + (obj.params = message.params ? Params.toJSON(message.params) : undefined) if (message.accounts) { - obj.accounts = message.accounts.map((e) => e ? Any.toJSON(e) : undefined); + obj.accounts = message.accounts.map((e) => (e ? Any.toJSON(e) : undefined)) } else { - obj.accounts = []; + obj.accounts = [] } - return obj; + return obj }, fromPartial, I>>(object: I): GenesisState { - const message = createBaseGenesisState(); - message.params = (object.params !== undefined && object.params !== null) - ? Params.fromPartial(object.params) - : undefined; - message.accounts = object.accounts?.map((e) => Any.fromPartial(e)) || []; - return message; + const message = createBaseGenesisState() + message.params = + object.params !== undefined && object.params !== null + ? Params.fromPartial(object.params) + : undefined + message.accounts = object.accounts?.map((e) => Any.fromPartial(e)) || [] + return message }, -}; +} -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/cosmos/auth/v1beta1/query.ts b/packages/protojs/src/cosmos/auth/v1beta1/query.ts index 79593c1e..7f4c5d8d 100644 --- a/packages/protojs/src/cosmos/auth/v1beta1/query.ts +++ b/packages/protojs/src/cosmos/auth/v1beta1/query.ts @@ -1,11 +1,11 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { Any } from "../../../google/protobuf/any"; -import { PageRequest, PageResponse } from "../../base/query/v1beta1/pagination"; -import { Params } from "./auth"; +import { PageRequest, PageResponse } from "../../base/query/v1beta1/pagination" +import { Any } from "../../../google/protobuf/any" +import { Params } from "./auth" +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "cosmos.auth.v1beta1"; +export const protobufPackage = "cosmos.auth.v1beta1" /** * QueryAccountsRequest is the request type for the Query/Accounts RPC method. @@ -14,7 +14,7 @@ export const protobufPackage = "cosmos.auth.v1beta1"; */ export interface QueryAccountsRequest { /** pagination defines an optional pagination for the request. */ - pagination?: PageRequest; + pagination?: PageRequest } /** @@ -24,441 +24,509 @@ export interface QueryAccountsRequest { */ export interface QueryAccountsResponse { /** accounts are the existing accounts */ - accounts: Any[]; + accounts: Any[] /** pagination defines the pagination in the response. */ - pagination?: PageResponse; + pagination?: PageResponse } /** QueryAccountRequest is the request type for the Query/Account RPC method. */ export interface QueryAccountRequest { /** address defines the address to query for. */ - address: string; + address: string } /** QueryAccountResponse is the response type for the Query/Account RPC method. */ export interface QueryAccountResponse { /** account defines the account of the corresponding address. */ - account?: Any; + account?: Any } /** QueryParamsRequest is the request type for the Query/Params RPC method. */ -export interface QueryParamsRequest { -} +export interface QueryParamsRequest {} /** QueryParamsResponse is the response type for the Query/Params RPC method. */ export interface QueryParamsResponse { /** params defines the parameters of the module. */ - params?: Params; + params?: Params } /** QueryModuleAccountByNameRequest is the request type for the Query/ModuleAccountByName RPC method. */ export interface QueryModuleAccountByNameRequest { - name: string; + name: string } /** QueryModuleAccountByNameResponse is the response type for the Query/ModuleAccountByName RPC method. */ export interface QueryModuleAccountByNameResponse { - account?: Any; + account?: Any } function createBaseQueryAccountsRequest(): QueryAccountsRequest { - return { pagination: undefined }; + return { pagination: undefined } } export const QueryAccountsRequest = { - encode(message: QueryAccountsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryAccountsRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryAccountsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryAccountsRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryAccountsRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; + message.pagination = PageRequest.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryAccountsRequest { - return { pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined }; + return { + pagination: isSet(object.pagination) + ? PageRequest.fromJSON(object.pagination) + : undefined, + } }, toJSON(message: QueryAccountsRequest): unknown { - const obj: any = {}; + const obj: any = {} message.pagination !== undefined && - (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); - return obj; + (obj.pagination = message.pagination + ? PageRequest.toJSON(message.pagination) + : undefined) + return obj }, - fromPartial, I>>(object: I): QueryAccountsRequest { - const message = createBaseQueryAccountsRequest(); - message.pagination = (object.pagination !== undefined && object.pagination !== null) - ? PageRequest.fromPartial(object.pagination) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): QueryAccountsRequest { + const message = createBaseQueryAccountsRequest() + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageRequest.fromPartial(object.pagination) + : undefined + return message }, -}; +} function createBaseQueryAccountsResponse(): QueryAccountsResponse { - return { accounts: [], pagination: undefined }; + return { accounts: [], pagination: undefined } } export const QueryAccountsResponse = { - encode(message: QueryAccountsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryAccountsResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { for (const v of message.accounts) { - Any.encode(v!, writer.uint32(10).fork()).ldelim(); + Any.encode(v!, writer.uint32(10).fork()).ldelim() } if (message.pagination !== undefined) { - PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryAccountsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryAccountsResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryAccountsResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.accounts.push(Any.decode(reader, reader.uint32())); - break; + message.accounts.push(Any.decode(reader, reader.uint32())) + break case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; + message.pagination = PageResponse.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryAccountsResponse { return { - accounts: Array.isArray(object?.accounts) ? object.accounts.map((e: any) => Any.fromJSON(e)) : [], - pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, - }; + accounts: Array.isArray(object?.accounts) + ? object.accounts.map((e: any) => Any.fromJSON(e)) + : [], + pagination: isSet(object.pagination) + ? PageResponse.fromJSON(object.pagination) + : undefined, + } }, toJSON(message: QueryAccountsResponse): unknown { - const obj: any = {}; + const obj: any = {} if (message.accounts) { - obj.accounts = message.accounts.map((e) => e ? Any.toJSON(e) : undefined); + obj.accounts = message.accounts.map((e) => (e ? Any.toJSON(e) : undefined)) } else { - obj.accounts = []; + obj.accounts = [] } message.pagination !== undefined && - (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); - return obj; + (obj.pagination = message.pagination + ? PageResponse.toJSON(message.pagination) + : undefined) + return obj }, - fromPartial, I>>(object: I): QueryAccountsResponse { - const message = createBaseQueryAccountsResponse(); - message.accounts = object.accounts?.map((e) => Any.fromPartial(e)) || []; - message.pagination = (object.pagination !== undefined && object.pagination !== null) - ? PageResponse.fromPartial(object.pagination) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): QueryAccountsResponse { + const message = createBaseQueryAccountsResponse() + message.accounts = object.accounts?.map((e) => Any.fromPartial(e)) || [] + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageResponse.fromPartial(object.pagination) + : undefined + return message }, -}; +} function createBaseQueryAccountRequest(): QueryAccountRequest { - return { address: "" }; + return { address: "" } } export const QueryAccountRequest = { - encode(message: QueryAccountRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryAccountRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.address !== "") { - writer.uint32(10).string(message.address); + writer.uint32(10).string(message.address) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryAccountRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryAccountRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryAccountRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.address = reader.string(); - break; + message.address = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryAccountRequest { - return { address: isSet(object.address) ? String(object.address) : "" }; + return { + address: isSet(object.address) ? String(object.address) : "", + } }, toJSON(message: QueryAccountRequest): unknown { - const obj: any = {}; - message.address !== undefined && (obj.address = message.address); - return obj; + const obj: any = {} + message.address !== undefined && (obj.address = message.address) + return obj }, - fromPartial, I>>(object: I): QueryAccountRequest { - const message = createBaseQueryAccountRequest(); - message.address = object.address ?? ""; - return message; + fromPartial, I>>( + object: I, + ): QueryAccountRequest { + const message = createBaseQueryAccountRequest() + message.address = object.address ?? "" + return message }, -}; +} function createBaseQueryAccountResponse(): QueryAccountResponse { - return { account: undefined }; + return { account: undefined } } export const QueryAccountResponse = { - encode(message: QueryAccountResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryAccountResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.account !== undefined) { - Any.encode(message.account, writer.uint32(10).fork()).ldelim(); + Any.encode(message.account, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryAccountResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryAccountResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryAccountResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.account = Any.decode(reader, reader.uint32()); - break; + message.account = Any.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryAccountResponse { - return { account: isSet(object.account) ? Any.fromJSON(object.account) : undefined }; + return { + account: isSet(object.account) ? Any.fromJSON(object.account) : undefined, + } }, toJSON(message: QueryAccountResponse): unknown { - const obj: any = {}; - message.account !== undefined && (obj.account = message.account ? Any.toJSON(message.account) : undefined); - return obj; + const obj: any = {} + message.account !== undefined && + (obj.account = message.account ? Any.toJSON(message.account) : undefined) + return obj }, - fromPartial, I>>(object: I): QueryAccountResponse { - const message = createBaseQueryAccountResponse(); - message.account = (object.account !== undefined && object.account !== null) - ? Any.fromPartial(object.account) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): QueryAccountResponse { + const message = createBaseQueryAccountResponse() + message.account = + object.account !== undefined && object.account !== null + ? Any.fromPartial(object.account) + : undefined + return message }, -}; +} function createBaseQueryParamsRequest(): QueryParamsRequest { - return {}; + return {} } export const QueryParamsRequest = { encode(_: QueryParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryParamsRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryParamsRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(_: any): QueryParamsRequest { - return {}; + return {} }, toJSON(_: QueryParamsRequest): unknown { - const obj: any = {}; - return obj; + const obj: any = {} + return obj }, - fromPartial, I>>(_: I): QueryParamsRequest { - const message = createBaseQueryParamsRequest(); - return message; + fromPartial, I>>( + _: I, + ): QueryParamsRequest { + const message = createBaseQueryParamsRequest() + return message }, -}; +} function createBaseQueryParamsResponse(): QueryParamsResponse { - return { params: undefined }; + return { params: undefined } } export const QueryParamsResponse = { - encode(message: QueryParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryParamsResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.params !== undefined) { - Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + Params.encode(message.params, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryParamsResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryParamsResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.params = Params.decode(reader, reader.uint32()); - break; + message.params = Params.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryParamsResponse { - return { params: isSet(object.params) ? Params.fromJSON(object.params) : undefined }; + return { + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined, + } }, toJSON(message: QueryParamsResponse): unknown { - const obj: any = {}; - message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); - return obj; + const obj: any = {} + message.params !== undefined && + (obj.params = message.params ? Params.toJSON(message.params) : undefined) + return obj }, - fromPartial, I>>(object: I): QueryParamsResponse { - const message = createBaseQueryParamsResponse(); - message.params = (object.params !== undefined && object.params !== null) - ? Params.fromPartial(object.params) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): QueryParamsResponse { + const message = createBaseQueryParamsResponse() + message.params = + object.params !== undefined && object.params !== null + ? Params.fromPartial(object.params) + : undefined + return message }, -}; +} function createBaseQueryModuleAccountByNameRequest(): QueryModuleAccountByNameRequest { - return { name: "" }; + return { name: "" } } export const QueryModuleAccountByNameRequest = { - encode(message: QueryModuleAccountByNameRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryModuleAccountByNameRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.name !== "") { - writer.uint32(10).string(message.name); + writer.uint32(10).string(message.name) } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryModuleAccountByNameRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryModuleAccountByNameRequest(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryModuleAccountByNameRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryModuleAccountByNameRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.name = reader.string(); - break; + message.name = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryModuleAccountByNameRequest { - return { name: isSet(object.name) ? String(object.name) : "" }; + return { + name: isSet(object.name) ? String(object.name) : "", + } }, toJSON(message: QueryModuleAccountByNameRequest): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - return obj; + const obj: any = {} + message.name !== undefined && (obj.name = message.name) + return obj }, fromPartial, I>>( object: I, ): QueryModuleAccountByNameRequest { - const message = createBaseQueryModuleAccountByNameRequest(); - message.name = object.name ?? ""; - return message; + const message = createBaseQueryModuleAccountByNameRequest() + message.name = object.name ?? "" + return message }, -}; +} function createBaseQueryModuleAccountByNameResponse(): QueryModuleAccountByNameResponse { - return { account: undefined }; + return { account: undefined } } export const QueryModuleAccountByNameResponse = { - encode(message: QueryModuleAccountByNameResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryModuleAccountByNameResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.account !== undefined) { - Any.encode(message.account, writer.uint32(10).fork()).ldelim(); + Any.encode(message.account, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryModuleAccountByNameResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryModuleAccountByNameResponse(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryModuleAccountByNameResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryModuleAccountByNameResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.account = Any.decode(reader, reader.uint32()); - break; + message.account = Any.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryModuleAccountByNameResponse { - return { account: isSet(object.account) ? Any.fromJSON(object.account) : undefined }; + return { + account: isSet(object.account) ? Any.fromJSON(object.account) : undefined, + } }, toJSON(message: QueryModuleAccountByNameResponse): unknown { - const obj: any = {}; - message.account !== undefined && (obj.account = message.account ? Any.toJSON(message.account) : undefined); - return obj; + const obj: any = {} + message.account !== undefined && + (obj.account = message.account ? Any.toJSON(message.account) : undefined) + return obj }, fromPartial, I>>( object: I, ): QueryModuleAccountByNameResponse { - const message = createBaseQueryModuleAccountByNameResponse(); - message.account = (object.account !== undefined && object.account !== null) - ? Any.fromPartial(object.account) - : undefined; - return message; + const message = createBaseQueryModuleAccountByNameResponse() + message.account = + object.account !== undefined && object.account !== null + ? Any.fromPartial(object.account) + : undefined + return message }, -}; +} /** Query defines the gRPC querier service. */ export interface Query { @@ -467,70 +535,90 @@ export interface Query { * * Since: cosmos-sdk 0.43 */ - Accounts(request: QueryAccountsRequest): Promise; + Accounts(request: QueryAccountsRequest): Promise /** Account returns account details based on address. */ - Account(request: QueryAccountRequest): Promise; + Account(request: QueryAccountRequest): Promise /** Params queries all parameters. */ - Params(request: QueryParamsRequest): Promise; + Params(request: QueryParamsRequest): Promise /** ModuleAccountByName returns the module account info by module name */ - ModuleAccountByName(request: QueryModuleAccountByNameRequest): Promise; + ModuleAccountByName( + request: QueryModuleAccountByNameRequest, + ): Promise } export class QueryClientImpl implements Query { - private readonly rpc: Rpc; + private readonly rpc: Rpc constructor(rpc: Rpc) { - this.rpc = rpc; - this.Accounts = this.Accounts.bind(this); - this.Account = this.Account.bind(this); - this.Params = this.Params.bind(this); - this.ModuleAccountByName = this.ModuleAccountByName.bind(this); + this.rpc = rpc + this.Accounts = this.Accounts.bind(this) + this.Account = this.Account.bind(this) + this.Params = this.Params.bind(this) + this.ModuleAccountByName = this.ModuleAccountByName.bind(this) } Accounts(request: QueryAccountsRequest): Promise { - const data = QueryAccountsRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "Accounts", data); - return promise.then((data) => QueryAccountsResponse.decode(new _m0.Reader(data))); + const data = QueryAccountsRequest.encode(request).finish() + const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "Accounts", data) + return promise.then((data) => QueryAccountsResponse.decode(new _m0.Reader(data))) } Account(request: QueryAccountRequest): Promise { - const data = QueryAccountRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "Account", data); - return promise.then((data) => QueryAccountResponse.decode(new _m0.Reader(data))); + const data = QueryAccountRequest.encode(request).finish() + const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "Account", data) + return promise.then((data) => QueryAccountResponse.decode(new _m0.Reader(data))) } Params(request: QueryParamsRequest): Promise { - const data = QueryParamsRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "Params", data); - return promise.then((data) => QueryParamsResponse.decode(new _m0.Reader(data))); + const data = QueryParamsRequest.encode(request).finish() + const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "Params", data) + return promise.then((data) => QueryParamsResponse.decode(new _m0.Reader(data))) } - ModuleAccountByName(request: QueryModuleAccountByNameRequest): Promise { - const data = QueryModuleAccountByNameRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "ModuleAccountByName", data); - return promise.then((data) => QueryModuleAccountByNameResponse.decode(new _m0.Reader(data))); + ModuleAccountByName( + request: QueryModuleAccountByNameRequest, + ): Promise { + const data = QueryModuleAccountByNameRequest.encode(request).finish() + const promise = this.rpc.request( + "cosmos.auth.v1beta1.Query", + "ModuleAccountByName", + data, + ) + return promise.then((data) => + QueryModuleAccountByNameResponse.decode(new _m0.Reader(data)), + ) } } interface Rpc { - request(service: string, method: string, data: Uint8Array): Promise; + request(service: string, method: string, data: Uint8Array): Promise } -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/cosmos/authz/v1beta1/authz.ts b/packages/protojs/src/cosmos/authz/v1beta1/authz.ts index 00e622ab..c152379e 100644 --- a/packages/protojs/src/cosmos/authz/v1beta1/authz.ts +++ b/packages/protojs/src/cosmos/authz/v1beta1/authz.ts @@ -1,10 +1,10 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { Any } from "../../../google/protobuf/any"; -import { Timestamp } from "../../../google/protobuf/timestamp"; +import { Any } from "../../../google/protobuf/any" +import { Timestamp } from "../../../google/protobuf/timestamp" +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "cosmos.authz.v1beta1"; +export const protobufPackage = "cosmos.authz.v1beta1" /** Since: cosmos-sdk 0.43 */ @@ -14,7 +14,7 @@ export const protobufPackage = "cosmos.authz.v1beta1"; */ export interface GenericAuthorization { /** Msg, identified by it's type URL, to grant unrestricted permissions to execute */ - msg: string; + msg: string } /** @@ -22,8 +22,8 @@ export interface GenericAuthorization { * the provide method with expiration time. */ export interface Grant { - authorization?: Any; - expiration?: Date; + authorization?: Any + expiration?: Date } /** @@ -33,242 +33,286 @@ export interface Grant { * Since: cosmos-sdk 0.45.2 */ export interface GrantAuthorization { - granter: string; - grantee: string; - authorization?: Any; - expiration?: Date; + granter: string + grantee: string + authorization?: Any + expiration?: Date } function createBaseGenericAuthorization(): GenericAuthorization { - return { msg: "" }; + return { msg: "" } } export const GenericAuthorization = { - encode(message: GenericAuthorization, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: GenericAuthorization, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.msg !== "") { - writer.uint32(10).string(message.msg); + writer.uint32(10).string(message.msg) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): GenericAuthorization { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGenericAuthorization(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseGenericAuthorization() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.msg = reader.string(); - break; + message.msg = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): GenericAuthorization { - return { msg: isSet(object.msg) ? String(object.msg) : "" }; + return { + msg: isSet(object.msg) ? String(object.msg) : "", + } }, toJSON(message: GenericAuthorization): unknown { - const obj: any = {}; - message.msg !== undefined && (obj.msg = message.msg); - return obj; + const obj: any = {} + message.msg !== undefined && (obj.msg = message.msg) + return obj }, - fromPartial, I>>(object: I): GenericAuthorization { - const message = createBaseGenericAuthorization(); - message.msg = object.msg ?? ""; - return message; + fromPartial, I>>( + object: I, + ): GenericAuthorization { + const message = createBaseGenericAuthorization() + message.msg = object.msg ?? "" + return message }, -}; +} function createBaseGrant(): Grant { - return { authorization: undefined, expiration: undefined }; + return { authorization: undefined, expiration: undefined } } export const Grant = { encode(message: Grant, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.authorization !== undefined) { - Any.encode(message.authorization, writer.uint32(10).fork()).ldelim(); + Any.encode(message.authorization, writer.uint32(10).fork()).ldelim() } if (message.expiration !== undefined) { - Timestamp.encode(toTimestamp(message.expiration), writer.uint32(18).fork()).ldelim(); + Timestamp.encode( + toTimestamp(message.expiration), + writer.uint32(18).fork(), + ).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Grant { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGrant(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseGrant() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.authorization = Any.decode(reader, reader.uint32()); - break; + message.authorization = Any.decode(reader, reader.uint32()) + break case 2: - message.expiration = fromTimestamp(Timestamp.decode(reader, reader.uint32())); - break; + message.expiration = fromTimestamp(Timestamp.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Grant { return { - authorization: isSet(object.authorization) ? Any.fromJSON(object.authorization) : undefined, - expiration: isSet(object.expiration) ? fromJsonTimestamp(object.expiration) : undefined, - }; + authorization: isSet(object.authorization) + ? Any.fromJSON(object.authorization) + : undefined, + expiration: isSet(object.expiration) + ? fromJsonTimestamp(object.expiration) + : undefined, + } }, toJSON(message: Grant): unknown { - const obj: any = {}; + const obj: any = {} message.authorization !== undefined && - (obj.authorization = message.authorization ? Any.toJSON(message.authorization) : undefined); - message.expiration !== undefined && (obj.expiration = message.expiration.toISOString()); - return obj; + (obj.authorization = message.authorization + ? Any.toJSON(message.authorization) + : undefined) + message.expiration !== undefined && + (obj.expiration = message.expiration.toISOString()) + return obj }, fromPartial, I>>(object: I): Grant { - const message = createBaseGrant(); - message.authorization = (object.authorization !== undefined && object.authorization !== null) - ? Any.fromPartial(object.authorization) - : undefined; - message.expiration = object.expiration ?? undefined; - return message; + const message = createBaseGrant() + message.authorization = + object.authorization !== undefined && object.authorization !== null + ? Any.fromPartial(object.authorization) + : undefined + message.expiration = object.expiration ?? undefined + return message }, -}; +} function createBaseGrantAuthorization(): GrantAuthorization { - return { granter: "", grantee: "", authorization: undefined, expiration: undefined }; + return { granter: "", grantee: "", authorization: undefined, expiration: undefined } } export const GrantAuthorization = { - encode(message: GrantAuthorization, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: GrantAuthorization, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.granter !== "") { - writer.uint32(10).string(message.granter); + writer.uint32(10).string(message.granter) } if (message.grantee !== "") { - writer.uint32(18).string(message.grantee); + writer.uint32(18).string(message.grantee) } if (message.authorization !== undefined) { - Any.encode(message.authorization, writer.uint32(26).fork()).ldelim(); + Any.encode(message.authorization, writer.uint32(26).fork()).ldelim() } if (message.expiration !== undefined) { - Timestamp.encode(toTimestamp(message.expiration), writer.uint32(34).fork()).ldelim(); + Timestamp.encode( + toTimestamp(message.expiration), + writer.uint32(34).fork(), + ).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): GrantAuthorization { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGrantAuthorization(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseGrantAuthorization() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.granter = reader.string(); - break; + message.granter = reader.string() + break case 2: - message.grantee = reader.string(); - break; + message.grantee = reader.string() + break case 3: - message.authorization = Any.decode(reader, reader.uint32()); - break; + message.authorization = Any.decode(reader, reader.uint32()) + break case 4: - message.expiration = fromTimestamp(Timestamp.decode(reader, reader.uint32())); - break; + message.expiration = fromTimestamp(Timestamp.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): GrantAuthorization { return { granter: isSet(object.granter) ? String(object.granter) : "", grantee: isSet(object.grantee) ? String(object.grantee) : "", - authorization: isSet(object.authorization) ? Any.fromJSON(object.authorization) : undefined, - expiration: isSet(object.expiration) ? fromJsonTimestamp(object.expiration) : undefined, - }; + authorization: isSet(object.authorization) + ? Any.fromJSON(object.authorization) + : undefined, + expiration: isSet(object.expiration) + ? fromJsonTimestamp(object.expiration) + : undefined, + } }, toJSON(message: GrantAuthorization): unknown { - const obj: any = {}; - message.granter !== undefined && (obj.granter = message.granter); - message.grantee !== undefined && (obj.grantee = message.grantee); + const obj: any = {} + message.granter !== undefined && (obj.granter = message.granter) + message.grantee !== undefined && (obj.grantee = message.grantee) message.authorization !== undefined && - (obj.authorization = message.authorization ? Any.toJSON(message.authorization) : undefined); - message.expiration !== undefined && (obj.expiration = message.expiration.toISOString()); - return obj; + (obj.authorization = message.authorization + ? Any.toJSON(message.authorization) + : undefined) + message.expiration !== undefined && + (obj.expiration = message.expiration.toISOString()) + return obj }, - fromPartial, I>>(object: I): GrantAuthorization { - const message = createBaseGrantAuthorization(); - message.granter = object.granter ?? ""; - message.grantee = object.grantee ?? ""; - message.authorization = (object.authorization !== undefined && object.authorization !== null) - ? Any.fromPartial(object.authorization) - : undefined; - message.expiration = object.expiration ?? undefined; - return message; + fromPartial, I>>( + object: I, + ): GrantAuthorization { + const message = createBaseGrantAuthorization() + message.granter = object.granter ?? "" + message.grantee = object.grantee ?? "" + message.authorization = + object.authorization !== undefined && object.authorization !== null + ? Any.fromPartial(object.authorization) + : undefined + message.expiration = object.expiration ?? undefined + return message }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; +} -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > function toTimestamp(date: Date): Timestamp { - const seconds = numberToLong(date.getTime() / 1_000); - const nanos = (date.getTime() % 1_000) * 1_000_000; - return { seconds, nanos }; + const seconds = numberToLong(date.getTime() / 1_000) + const nanos = (date.getTime() % 1_000) * 1_000_000 + return { seconds, nanos } } function fromTimestamp(t: Timestamp): Date { - let millis = t.seconds.toNumber() * 1_000; - millis += t.nanos / 1_000_000; - return new Date(millis); + let millis = t.seconds.toNumber() * 1_000 + millis += t.nanos / 1_000_000 + return new Date(millis) } function fromJsonTimestamp(o: any): Date { if (o instanceof Date) { - return o; + return o } else if (typeof o === "string") { - return new Date(o); + return new Date(o) } else { - return fromTimestamp(Timestamp.fromJSON(o)); + return fromTimestamp(Timestamp.fromJSON(o)) } } function numberToLong(number: number) { - return Long.fromNumber(number); + return Long.fromNumber(number) } if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/cosmos/authz/v1beta1/event.ts b/packages/protojs/src/cosmos/authz/v1beta1/event.ts index bdd36a74..714ea416 100644 --- a/packages/protojs/src/cosmos/authz/v1beta1/event.ts +++ b/packages/protojs/src/cosmos/authz/v1beta1/event.ts @@ -1,71 +1,71 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "cosmos.authz.v1beta1"; +export const protobufPackage = "cosmos.authz.v1beta1" /** Since: cosmos-sdk 0.43 */ /** EventGrant is emitted on Msg/Grant */ export interface EventGrant { /** Msg type URL for which an autorization is granted */ - msgTypeUrl: string; + msgTypeUrl: string /** Granter account address */ - granter: string; + granter: string /** Grantee account address */ - grantee: string; + grantee: string } /** EventRevoke is emitted on Msg/Revoke */ export interface EventRevoke { /** Msg type URL for which an autorization is revoked */ - msgTypeUrl: string; + msgTypeUrl: string /** Granter account address */ - granter: string; + granter: string /** Grantee account address */ - grantee: string; + grantee: string } function createBaseEventGrant(): EventGrant { - return { msgTypeUrl: "", granter: "", grantee: "" }; + return { msgTypeUrl: "", granter: "", grantee: "" } } export const EventGrant = { encode(message: EventGrant, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.msgTypeUrl !== "") { - writer.uint32(18).string(message.msgTypeUrl); + writer.uint32(18).string(message.msgTypeUrl) } if (message.granter !== "") { - writer.uint32(26).string(message.granter); + writer.uint32(26).string(message.granter) } if (message.grantee !== "") { - writer.uint32(34).string(message.grantee); + writer.uint32(34).string(message.grantee) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): EventGrant { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseEventGrant(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseEventGrant() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 2: - message.msgTypeUrl = reader.string(); - break; + message.msgTypeUrl = reader.string() + break case 3: - message.granter = reader.string(); - break; + message.granter = reader.string() + break case 4: - message.grantee = reader.string(); - break; + message.grantee = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): EventGrant { @@ -73,66 +73,66 @@ export const EventGrant = { msgTypeUrl: isSet(object.msgTypeUrl) ? String(object.msgTypeUrl) : "", granter: isSet(object.granter) ? String(object.granter) : "", grantee: isSet(object.grantee) ? String(object.grantee) : "", - }; + } }, toJSON(message: EventGrant): unknown { - const obj: any = {}; - message.msgTypeUrl !== undefined && (obj.msgTypeUrl = message.msgTypeUrl); - message.granter !== undefined && (obj.granter = message.granter); - message.grantee !== undefined && (obj.grantee = message.grantee); - return obj; + const obj: any = {} + message.msgTypeUrl !== undefined && (obj.msgTypeUrl = message.msgTypeUrl) + message.granter !== undefined && (obj.granter = message.granter) + message.grantee !== undefined && (obj.grantee = message.grantee) + return obj }, fromPartial, I>>(object: I): EventGrant { - const message = createBaseEventGrant(); - message.msgTypeUrl = object.msgTypeUrl ?? ""; - message.granter = object.granter ?? ""; - message.grantee = object.grantee ?? ""; - return message; + const message = createBaseEventGrant() + message.msgTypeUrl = object.msgTypeUrl ?? "" + message.granter = object.granter ?? "" + message.grantee = object.grantee ?? "" + return message }, -}; +} function createBaseEventRevoke(): EventRevoke { - return { msgTypeUrl: "", granter: "", grantee: "" }; + return { msgTypeUrl: "", granter: "", grantee: "" } } export const EventRevoke = { encode(message: EventRevoke, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.msgTypeUrl !== "") { - writer.uint32(18).string(message.msgTypeUrl); + writer.uint32(18).string(message.msgTypeUrl) } if (message.granter !== "") { - writer.uint32(26).string(message.granter); + writer.uint32(26).string(message.granter) } if (message.grantee !== "") { - writer.uint32(34).string(message.grantee); + writer.uint32(34).string(message.grantee) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): EventRevoke { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseEventRevoke(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseEventRevoke() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 2: - message.msgTypeUrl = reader.string(); - break; + message.msgTypeUrl = reader.string() + break case 3: - message.granter = reader.string(); - break; + message.granter = reader.string() + break case 4: - message.grantee = reader.string(); - break; + message.grantee = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): EventRevoke { @@ -140,43 +140,53 @@ export const EventRevoke = { msgTypeUrl: isSet(object.msgTypeUrl) ? String(object.msgTypeUrl) : "", granter: isSet(object.granter) ? String(object.granter) : "", grantee: isSet(object.grantee) ? String(object.grantee) : "", - }; + } }, toJSON(message: EventRevoke): unknown { - const obj: any = {}; - message.msgTypeUrl !== undefined && (obj.msgTypeUrl = message.msgTypeUrl); - message.granter !== undefined && (obj.granter = message.granter); - message.grantee !== undefined && (obj.grantee = message.grantee); - return obj; + const obj: any = {} + message.msgTypeUrl !== undefined && (obj.msgTypeUrl = message.msgTypeUrl) + message.granter !== undefined && (obj.granter = message.granter) + message.grantee !== undefined && (obj.grantee = message.grantee) + return obj }, fromPartial, I>>(object: I): EventRevoke { - const message = createBaseEventRevoke(); - message.msgTypeUrl = object.msgTypeUrl ?? ""; - message.granter = object.granter ?? ""; - message.grantee = object.grantee ?? ""; - return message; + const message = createBaseEventRevoke() + message.msgTypeUrl = object.msgTypeUrl ?? "" + message.granter = object.granter ?? "" + message.grantee = object.grantee ?? "" + return message }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; +} -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/cosmos/authz/v1beta1/genesis.ts b/packages/protojs/src/cosmos/authz/v1beta1/genesis.ts index ee70a686..418b6eba 100644 --- a/packages/protojs/src/cosmos/authz/v1beta1/genesis.ts +++ b/packages/protojs/src/cosmos/authz/v1beta1/genesis.ts @@ -1,45 +1,45 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { GrantAuthorization } from "./authz"; +import Long from "long" +import { GrantAuthorization } from "./authz" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "cosmos.authz.v1beta1"; +export const protobufPackage = "cosmos.authz.v1beta1" /** Since: cosmos-sdk 0.43 */ /** GenesisState defines the authz module's genesis state. */ export interface GenesisState { - authorization: GrantAuthorization[]; + authorization: GrantAuthorization[] } function createBaseGenesisState(): GenesisState { - return { authorization: [] }; + return { authorization: [] } } export const GenesisState = { encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.authorization) { - GrantAuthorization.encode(v!, writer.uint32(10).fork()).ldelim(); + GrantAuthorization.encode(v!, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGenesisState(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseGenesisState() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.authorization.push(GrantAuthorization.decode(reader, reader.uint32())); - break; + message.authorization.push(GrantAuthorization.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): GenesisState { @@ -47,39 +47,52 @@ export const GenesisState = { authorization: Array.isArray(object?.authorization) ? object.authorization.map((e: any) => GrantAuthorization.fromJSON(e)) : [], - }; + } }, toJSON(message: GenesisState): unknown { - const obj: any = {}; + const obj: any = {} if (message.authorization) { - obj.authorization = message.authorization.map((e) => e ? GrantAuthorization.toJSON(e) : undefined); + obj.authorization = message.authorization.map((e) => + e ? GrantAuthorization.toJSON(e) : undefined, + ) } else { - obj.authorization = []; + obj.authorization = [] } - return obj; + return obj }, fromPartial, I>>(object: I): GenesisState { - const message = createBaseGenesisState(); - message.authorization = object.authorization?.map((e) => GrantAuthorization.fromPartial(e)) || []; - return message; + const message = createBaseGenesisState() + message.authorization = + object.authorization?.map((e) => GrantAuthorization.fromPartial(e)) || [] + return message }, -}; +} -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } diff --git a/packages/protojs/src/cosmos/authz/v1beta1/query.ts b/packages/protojs/src/cosmos/authz/v1beta1/query.ts index 5250f701..4f3d6b45 100644 --- a/packages/protojs/src/cosmos/authz/v1beta1/query.ts +++ b/packages/protojs/src/cosmos/authz/v1beta1/query.ts @@ -1,107 +1,110 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { PageRequest, PageResponse } from "../../base/query/v1beta1/pagination"; -import { Grant, GrantAuthorization } from "./authz"; +import { PageRequest, PageResponse } from "../../base/query/v1beta1/pagination" +import Long from "long" +import { Grant, GrantAuthorization } from "./authz" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "cosmos.authz.v1beta1"; +export const protobufPackage = "cosmos.authz.v1beta1" /** Since: cosmos-sdk 0.43 */ /** QueryGrantsRequest is the request type for the Query/Grants RPC method. */ export interface QueryGrantsRequest { - granter: string; - grantee: string; + granter: string + grantee: string /** Optional, msg_type_url, when set, will query only grants matching given msg type. */ - msgTypeUrl: string; + msgTypeUrl: string /** pagination defines an pagination for the request. */ - pagination?: PageRequest; + pagination?: PageRequest } /** QueryGrantsResponse is the response type for the Query/Authorizations RPC method. */ export interface QueryGrantsResponse { /** authorizations is a list of grants granted for grantee by granter. */ - grants: Grant[]; + grants: Grant[] /** pagination defines an pagination for the response. */ - pagination?: PageResponse; + pagination?: PageResponse } /** QueryGranterGrantsRequest is the request type for the Query/GranterGrants RPC method. */ export interface QueryGranterGrantsRequest { - granter: string; + granter: string /** pagination defines an pagination for the request. */ - pagination?: PageRequest; + pagination?: PageRequest } /** QueryGranterGrantsResponse is the response type for the Query/GranterGrants RPC method. */ export interface QueryGranterGrantsResponse { /** grants is a list of grants granted by the granter. */ - grants: GrantAuthorization[]; + grants: GrantAuthorization[] /** pagination defines an pagination for the response. */ - pagination?: PageResponse; + pagination?: PageResponse } /** QueryGranteeGrantsRequest is the request type for the Query/IssuedGrants RPC method. */ export interface QueryGranteeGrantsRequest { - grantee: string; + grantee: string /** pagination defines an pagination for the request. */ - pagination?: PageRequest; + pagination?: PageRequest } /** QueryGranteeGrantsResponse is the response type for the Query/GranteeGrants RPC method. */ export interface QueryGranteeGrantsResponse { /** grants is a list of grants granted to the grantee. */ - grants: GrantAuthorization[]; + grants: GrantAuthorization[] /** pagination defines an pagination for the response. */ - pagination?: PageResponse; + pagination?: PageResponse } function createBaseQueryGrantsRequest(): QueryGrantsRequest { - return { granter: "", grantee: "", msgTypeUrl: "", pagination: undefined }; + return { granter: "", grantee: "", msgTypeUrl: "", pagination: undefined } } export const QueryGrantsRequest = { - encode(message: QueryGrantsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryGrantsRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.granter !== "") { - writer.uint32(10).string(message.granter); + writer.uint32(10).string(message.granter) } if (message.grantee !== "") { - writer.uint32(18).string(message.grantee); + writer.uint32(18).string(message.grantee) } if (message.msgTypeUrl !== "") { - writer.uint32(26).string(message.msgTypeUrl); + writer.uint32(26).string(message.msgTypeUrl) } if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(34).fork()).ldelim(); + PageRequest.encode(message.pagination, writer.uint32(34).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryGrantsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryGrantsRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryGrantsRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.granter = reader.string(); - break; + message.granter = reader.string() + break case 2: - message.grantee = reader.string(); - break; + message.grantee = reader.string() + break case 3: - message.msgTypeUrl = reader.string(); - break; + message.msgTypeUrl = reader.string() + break case 4: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; + message.pagination = PageRequest.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryGrantsRequest { @@ -109,415 +112,508 @@ export const QueryGrantsRequest = { granter: isSet(object.granter) ? String(object.granter) : "", grantee: isSet(object.grantee) ? String(object.grantee) : "", msgTypeUrl: isSet(object.msgTypeUrl) ? String(object.msgTypeUrl) : "", - pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined, - }; + pagination: isSet(object.pagination) + ? PageRequest.fromJSON(object.pagination) + : undefined, + } }, toJSON(message: QueryGrantsRequest): unknown { - const obj: any = {}; - message.granter !== undefined && (obj.granter = message.granter); - message.grantee !== undefined && (obj.grantee = message.grantee); - message.msgTypeUrl !== undefined && (obj.msgTypeUrl = message.msgTypeUrl); + const obj: any = {} + message.granter !== undefined && (obj.granter = message.granter) + message.grantee !== undefined && (obj.grantee = message.grantee) + message.msgTypeUrl !== undefined && (obj.msgTypeUrl = message.msgTypeUrl) message.pagination !== undefined && - (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); - return obj; + (obj.pagination = message.pagination + ? PageRequest.toJSON(message.pagination) + : undefined) + return obj }, - fromPartial, I>>(object: I): QueryGrantsRequest { - const message = createBaseQueryGrantsRequest(); - message.granter = object.granter ?? ""; - message.grantee = object.grantee ?? ""; - message.msgTypeUrl = object.msgTypeUrl ?? ""; - message.pagination = (object.pagination !== undefined && object.pagination !== null) - ? PageRequest.fromPartial(object.pagination) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): QueryGrantsRequest { + const message = createBaseQueryGrantsRequest() + message.granter = object.granter ?? "" + message.grantee = object.grantee ?? "" + message.msgTypeUrl = object.msgTypeUrl ?? "" + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageRequest.fromPartial(object.pagination) + : undefined + return message }, -}; +} function createBaseQueryGrantsResponse(): QueryGrantsResponse { - return { grants: [], pagination: undefined }; + return { grants: [], pagination: undefined } } export const QueryGrantsResponse = { - encode(message: QueryGrantsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryGrantsResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { for (const v of message.grants) { - Grant.encode(v!, writer.uint32(10).fork()).ldelim(); + Grant.encode(v!, writer.uint32(10).fork()).ldelim() } if (message.pagination !== undefined) { - PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryGrantsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryGrantsResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryGrantsResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.grants.push(Grant.decode(reader, reader.uint32())); - break; + message.grants.push(Grant.decode(reader, reader.uint32())) + break case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; + message.pagination = PageResponse.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryGrantsResponse { return { - grants: Array.isArray(object?.grants) ? object.grants.map((e: any) => Grant.fromJSON(e)) : [], - pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, - }; + grants: Array.isArray(object?.grants) + ? object.grants.map((e: any) => Grant.fromJSON(e)) + : [], + pagination: isSet(object.pagination) + ? PageResponse.fromJSON(object.pagination) + : undefined, + } }, toJSON(message: QueryGrantsResponse): unknown { - const obj: any = {}; + const obj: any = {} if (message.grants) { - obj.grants = message.grants.map((e) => e ? Grant.toJSON(e) : undefined); + obj.grants = message.grants.map((e) => (e ? Grant.toJSON(e) : undefined)) } else { - obj.grants = []; + obj.grants = [] } message.pagination !== undefined && - (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); - return obj; + (obj.pagination = message.pagination + ? PageResponse.toJSON(message.pagination) + : undefined) + return obj }, - fromPartial, I>>(object: I): QueryGrantsResponse { - const message = createBaseQueryGrantsResponse(); - message.grants = object.grants?.map((e) => Grant.fromPartial(e)) || []; - message.pagination = (object.pagination !== undefined && object.pagination !== null) - ? PageResponse.fromPartial(object.pagination) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): QueryGrantsResponse { + const message = createBaseQueryGrantsResponse() + message.grants = object.grants?.map((e) => Grant.fromPartial(e)) || [] + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageResponse.fromPartial(object.pagination) + : undefined + return message }, -}; +} function createBaseQueryGranterGrantsRequest(): QueryGranterGrantsRequest { - return { granter: "", pagination: undefined }; + return { granter: "", pagination: undefined } } export const QueryGranterGrantsRequest = { - encode(message: QueryGranterGrantsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryGranterGrantsRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.granter !== "") { - writer.uint32(10).string(message.granter); + writer.uint32(10).string(message.granter) } if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryGranterGrantsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryGranterGrantsRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryGranterGrantsRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.granter = reader.string(); - break; + message.granter = reader.string() + break case 2: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; + message.pagination = PageRequest.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryGranterGrantsRequest { return { granter: isSet(object.granter) ? String(object.granter) : "", - pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined, - }; + pagination: isSet(object.pagination) + ? PageRequest.fromJSON(object.pagination) + : undefined, + } }, toJSON(message: QueryGranterGrantsRequest): unknown { - const obj: any = {}; - message.granter !== undefined && (obj.granter = message.granter); + const obj: any = {} + message.granter !== undefined && (obj.granter = message.granter) message.pagination !== undefined && - (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); - return obj; + (obj.pagination = message.pagination + ? PageRequest.toJSON(message.pagination) + : undefined) + return obj }, - fromPartial, I>>(object: I): QueryGranterGrantsRequest { - const message = createBaseQueryGranterGrantsRequest(); - message.granter = object.granter ?? ""; - message.pagination = (object.pagination !== undefined && object.pagination !== null) - ? PageRequest.fromPartial(object.pagination) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): QueryGranterGrantsRequest { + const message = createBaseQueryGranterGrantsRequest() + message.granter = object.granter ?? "" + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageRequest.fromPartial(object.pagination) + : undefined + return message }, -}; +} function createBaseQueryGranterGrantsResponse(): QueryGranterGrantsResponse { - return { grants: [], pagination: undefined }; + return { grants: [], pagination: undefined } } export const QueryGranterGrantsResponse = { - encode(message: QueryGranterGrantsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryGranterGrantsResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { for (const v of message.grants) { - GrantAuthorization.encode(v!, writer.uint32(10).fork()).ldelim(); + GrantAuthorization.encode(v!, writer.uint32(10).fork()).ldelim() } if (message.pagination !== undefined) { - PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryGranterGrantsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryGranterGrantsResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryGranterGrantsResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.grants.push(GrantAuthorization.decode(reader, reader.uint32())); - break; + message.grants.push(GrantAuthorization.decode(reader, reader.uint32())) + break case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; + message.pagination = PageResponse.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryGranterGrantsResponse { return { - grants: Array.isArray(object?.grants) ? object.grants.map((e: any) => GrantAuthorization.fromJSON(e)) : [], - pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, - }; + grants: Array.isArray(object?.grants) + ? object.grants.map((e: any) => GrantAuthorization.fromJSON(e)) + : [], + pagination: isSet(object.pagination) + ? PageResponse.fromJSON(object.pagination) + : undefined, + } }, toJSON(message: QueryGranterGrantsResponse): unknown { - const obj: any = {}; + const obj: any = {} if (message.grants) { - obj.grants = message.grants.map((e) => e ? GrantAuthorization.toJSON(e) : undefined); + obj.grants = message.grants.map((e) => + e ? GrantAuthorization.toJSON(e) : undefined, + ) } else { - obj.grants = []; + obj.grants = [] } message.pagination !== undefined && - (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); - return obj; + (obj.pagination = message.pagination + ? PageResponse.toJSON(message.pagination) + : undefined) + return obj }, - fromPartial, I>>(object: I): QueryGranterGrantsResponse { - const message = createBaseQueryGranterGrantsResponse(); - message.grants = object.grants?.map((e) => GrantAuthorization.fromPartial(e)) || []; - message.pagination = (object.pagination !== undefined && object.pagination !== null) - ? PageResponse.fromPartial(object.pagination) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): QueryGranterGrantsResponse { + const message = createBaseQueryGranterGrantsResponse() + message.grants = object.grants?.map((e) => GrantAuthorization.fromPartial(e)) || [] + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageResponse.fromPartial(object.pagination) + : undefined + return message }, -}; +} function createBaseQueryGranteeGrantsRequest(): QueryGranteeGrantsRequest { - return { grantee: "", pagination: undefined }; + return { grantee: "", pagination: undefined } } export const QueryGranteeGrantsRequest = { - encode(message: QueryGranteeGrantsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryGranteeGrantsRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.grantee !== "") { - writer.uint32(10).string(message.grantee); + writer.uint32(10).string(message.grantee) } if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryGranteeGrantsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryGranteeGrantsRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryGranteeGrantsRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.grantee = reader.string(); - break; + message.grantee = reader.string() + break case 2: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; + message.pagination = PageRequest.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryGranteeGrantsRequest { return { grantee: isSet(object.grantee) ? String(object.grantee) : "", - pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined, - }; + pagination: isSet(object.pagination) + ? PageRequest.fromJSON(object.pagination) + : undefined, + } }, toJSON(message: QueryGranteeGrantsRequest): unknown { - const obj: any = {}; - message.grantee !== undefined && (obj.grantee = message.grantee); + const obj: any = {} + message.grantee !== undefined && (obj.grantee = message.grantee) message.pagination !== undefined && - (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); - return obj; + (obj.pagination = message.pagination + ? PageRequest.toJSON(message.pagination) + : undefined) + return obj }, - fromPartial, I>>(object: I): QueryGranteeGrantsRequest { - const message = createBaseQueryGranteeGrantsRequest(); - message.grantee = object.grantee ?? ""; - message.pagination = (object.pagination !== undefined && object.pagination !== null) - ? PageRequest.fromPartial(object.pagination) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): QueryGranteeGrantsRequest { + const message = createBaseQueryGranteeGrantsRequest() + message.grantee = object.grantee ?? "" + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageRequest.fromPartial(object.pagination) + : undefined + return message }, -}; +} function createBaseQueryGranteeGrantsResponse(): QueryGranteeGrantsResponse { - return { grants: [], pagination: undefined }; + return { grants: [], pagination: undefined } } export const QueryGranteeGrantsResponse = { - encode(message: QueryGranteeGrantsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryGranteeGrantsResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { for (const v of message.grants) { - GrantAuthorization.encode(v!, writer.uint32(10).fork()).ldelim(); + GrantAuthorization.encode(v!, writer.uint32(10).fork()).ldelim() } if (message.pagination !== undefined) { - PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryGranteeGrantsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryGranteeGrantsResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryGranteeGrantsResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.grants.push(GrantAuthorization.decode(reader, reader.uint32())); - break; + message.grants.push(GrantAuthorization.decode(reader, reader.uint32())) + break case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; + message.pagination = PageResponse.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryGranteeGrantsResponse { return { - grants: Array.isArray(object?.grants) ? object.grants.map((e: any) => GrantAuthorization.fromJSON(e)) : [], - pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, - }; + grants: Array.isArray(object?.grants) + ? object.grants.map((e: any) => GrantAuthorization.fromJSON(e)) + : [], + pagination: isSet(object.pagination) + ? PageResponse.fromJSON(object.pagination) + : undefined, + } }, toJSON(message: QueryGranteeGrantsResponse): unknown { - const obj: any = {}; + const obj: any = {} if (message.grants) { - obj.grants = message.grants.map((e) => e ? GrantAuthorization.toJSON(e) : undefined); + obj.grants = message.grants.map((e) => + e ? GrantAuthorization.toJSON(e) : undefined, + ) } else { - obj.grants = []; + obj.grants = [] } message.pagination !== undefined && - (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); - return obj; + (obj.pagination = message.pagination + ? PageResponse.toJSON(message.pagination) + : undefined) + return obj }, - fromPartial, I>>(object: I): QueryGranteeGrantsResponse { - const message = createBaseQueryGranteeGrantsResponse(); - message.grants = object.grants?.map((e) => GrantAuthorization.fromPartial(e)) || []; - message.pagination = (object.pagination !== undefined && object.pagination !== null) - ? PageResponse.fromPartial(object.pagination) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): QueryGranteeGrantsResponse { + const message = createBaseQueryGranteeGrantsResponse() + message.grants = object.grants?.map((e) => GrantAuthorization.fromPartial(e)) || [] + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageResponse.fromPartial(object.pagination) + : undefined + return message }, -}; +} /** Query defines the gRPC querier service. */ export interface Query { /** Returns list of `Authorization`, granted to the grantee by the granter. */ - Grants(request: QueryGrantsRequest): Promise; + Grants(request: QueryGrantsRequest): Promise /** * GranterGrants returns list of `GrantAuthorization`, granted by granter. * * Since: cosmos-sdk 0.45.2 */ - GranterGrants(request: QueryGranterGrantsRequest): Promise; + GranterGrants(request: QueryGranterGrantsRequest): Promise /** * GranteeGrants returns a list of `GrantAuthorization` by grantee. * * Since: cosmos-sdk 0.45.2 */ - GranteeGrants(request: QueryGranteeGrantsRequest): Promise; + GranteeGrants(request: QueryGranteeGrantsRequest): Promise } export class QueryClientImpl implements Query { - private readonly rpc: Rpc; + private readonly rpc: Rpc constructor(rpc: Rpc) { - this.rpc = rpc; - this.Grants = this.Grants.bind(this); - this.GranterGrants = this.GranterGrants.bind(this); - this.GranteeGrants = this.GranteeGrants.bind(this); + this.rpc = rpc + this.Grants = this.Grants.bind(this) + this.GranterGrants = this.GranterGrants.bind(this) + this.GranteeGrants = this.GranteeGrants.bind(this) } Grants(request: QueryGrantsRequest): Promise { - const data = QueryGrantsRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.authz.v1beta1.Query", "Grants", data); - return promise.then((data) => QueryGrantsResponse.decode(new _m0.Reader(data))); + const data = QueryGrantsRequest.encode(request).finish() + const promise = this.rpc.request("cosmos.authz.v1beta1.Query", "Grants", data) + return promise.then((data) => QueryGrantsResponse.decode(new _m0.Reader(data))) } - GranterGrants(request: QueryGranterGrantsRequest): Promise { - const data = QueryGranterGrantsRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.authz.v1beta1.Query", "GranterGrants", data); - return promise.then((data) => QueryGranterGrantsResponse.decode(new _m0.Reader(data))); + GranterGrants( + request: QueryGranterGrantsRequest, + ): Promise { + const data = QueryGranterGrantsRequest.encode(request).finish() + const promise = this.rpc.request( + "cosmos.authz.v1beta1.Query", + "GranterGrants", + data, + ) + return promise.then((data) => + QueryGranterGrantsResponse.decode(new _m0.Reader(data)), + ) } - GranteeGrants(request: QueryGranteeGrantsRequest): Promise { - const data = QueryGranteeGrantsRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.authz.v1beta1.Query", "GranteeGrants", data); - return promise.then((data) => QueryGranteeGrantsResponse.decode(new _m0.Reader(data))); + GranteeGrants( + request: QueryGranteeGrantsRequest, + ): Promise { + const data = QueryGranteeGrantsRequest.encode(request).finish() + const promise = this.rpc.request( + "cosmos.authz.v1beta1.Query", + "GranteeGrants", + data, + ) + return promise.then((data) => + QueryGranteeGrantsResponse.decode(new _m0.Reader(data)), + ) } } interface Rpc { - request(service: string, method: string, data: Uint8Array): Promise; + request(service: string, method: string, data: Uint8Array): Promise } -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/cosmos/authz/v1beta1/tx.ts b/packages/protojs/src/cosmos/authz/v1beta1/tx.ts index ce192c93..b0062136 100644 --- a/packages/protojs/src/cosmos/authz/v1beta1/tx.ts +++ b/packages/protojs/src/cosmos/authz/v1beta1/tx.ts @@ -1,10 +1,10 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { Any } from "../../../google/protobuf/any"; -import { Grant } from "./authz"; +import { Grant } from "./authz" +import Long from "long" +import { Any } from "../../../google/protobuf/any" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "cosmos.authz.v1beta1"; +export const protobufPackage = "cosmos.authz.v1beta1" /** Since: cosmos-sdk 0.43 */ @@ -13,14 +13,14 @@ export const protobufPackage = "cosmos.authz.v1beta1"; * on behalf of the granter with the provided expiration time. */ export interface MsgGrant { - granter: string; - grantee: string; - grant?: Grant; + granter: string + grantee: string + grant?: Grant } /** MsgExecResponse defines the Msg/MsgExecResponse response type. */ export interface MsgExecResponse { - results: Uint8Array[]; + results: Uint8Array[] } /** @@ -29,73 +29,71 @@ export interface MsgExecResponse { * one signer corresponding to the granter of the authorization. */ export interface MsgExec { - grantee: string; + grantee: string /** * Authorization Msg requests to execute. Each msg must implement Authorization interface * The x/authz will try to find a grant matching (msg.signers[0], grantee, MsgTypeURL(msg)) * triple and validate it. */ - msgs: Any[]; + msgs: Any[] } /** MsgGrantResponse defines the Msg/MsgGrant response type. */ -export interface MsgGrantResponse { -} +export interface MsgGrantResponse {} /** * MsgRevoke revokes any authorization with the provided sdk.Msg type on the * granter's account with that has been granted to the grantee. */ export interface MsgRevoke { - granter: string; - grantee: string; - msgTypeUrl: string; + granter: string + grantee: string + msgTypeUrl: string } /** MsgRevokeResponse defines the Msg/MsgRevokeResponse response type. */ -export interface MsgRevokeResponse { -} +export interface MsgRevokeResponse {} function createBaseMsgGrant(): MsgGrant { - return { granter: "", grantee: "", grant: undefined }; + return { granter: "", grantee: "", grant: undefined } } export const MsgGrant = { encode(message: MsgGrant, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.granter !== "") { - writer.uint32(10).string(message.granter); + writer.uint32(10).string(message.granter) } if (message.grantee !== "") { - writer.uint32(18).string(message.grantee); + writer.uint32(18).string(message.grantee) } if (message.grant !== undefined) { - Grant.encode(message.grant, writer.uint32(26).fork()).ldelim(); + Grant.encode(message.grant, writer.uint32(26).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MsgGrant { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgGrant(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgGrant() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.granter = reader.string(); - break; + message.granter = reader.string() + break case 2: - message.grantee = reader.string(); - break; + message.grantee = reader.string() + break case 3: - message.grant = Grant.decode(reader, reader.uint32()); - break; + message.grant = Grant.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): MsgGrant { @@ -103,218 +101,237 @@ export const MsgGrant = { granter: isSet(object.granter) ? String(object.granter) : "", grantee: isSet(object.grantee) ? String(object.grantee) : "", grant: isSet(object.grant) ? Grant.fromJSON(object.grant) : undefined, - }; + } }, toJSON(message: MsgGrant): unknown { - const obj: any = {}; - message.granter !== undefined && (obj.granter = message.granter); - message.grantee !== undefined && (obj.grantee = message.grantee); - message.grant !== undefined && (obj.grant = message.grant ? Grant.toJSON(message.grant) : undefined); - return obj; + const obj: any = {} + message.granter !== undefined && (obj.granter = message.granter) + message.grantee !== undefined && (obj.grantee = message.grantee) + message.grant !== undefined && + (obj.grant = message.grant ? Grant.toJSON(message.grant) : undefined) + return obj }, fromPartial, I>>(object: I): MsgGrant { - const message = createBaseMsgGrant(); - message.granter = object.granter ?? ""; - message.grantee = object.grantee ?? ""; - message.grant = (object.grant !== undefined && object.grant !== null) ? Grant.fromPartial(object.grant) : undefined; - return message; + const message = createBaseMsgGrant() + message.granter = object.granter ?? "" + message.grantee = object.grantee ?? "" + message.grant = + object.grant !== undefined && object.grant !== null + ? Grant.fromPartial(object.grant) + : undefined + return message }, -}; +} function createBaseMsgExecResponse(): MsgExecResponse { - return { results: [] }; + return { results: [] } } export const MsgExecResponse = { - encode(message: MsgExecResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: MsgExecResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { for (const v of message.results) { - writer.uint32(10).bytes(v!); + writer.uint32(10).bytes(v!) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MsgExecResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgExecResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgExecResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.results.push(reader.bytes()); - break; + message.results.push(reader.bytes()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): MsgExecResponse { - return { results: Array.isArray(object?.results) ? object.results.map((e: any) => bytesFromBase64(e)) : [] }; + return { + results: Array.isArray(object?.results) + ? object.results.map((e: any) => bytesFromBase64(e)) + : [], + } }, toJSON(message: MsgExecResponse): unknown { - const obj: any = {}; + const obj: any = {} if (message.results) { - obj.results = message.results.map((e) => base64FromBytes(e !== undefined ? e : new Uint8Array())); + obj.results = message.results.map((e) => + base64FromBytes(e !== undefined ? e : new Uint8Array()), + ) } else { - obj.results = []; + obj.results = [] } - return obj; + return obj }, - fromPartial, I>>(object: I): MsgExecResponse { - const message = createBaseMsgExecResponse(); - message.results = object.results?.map((e) => e) || []; - return message; + fromPartial, I>>( + object: I, + ): MsgExecResponse { + const message = createBaseMsgExecResponse() + message.results = object.results?.map((e) => e) || [] + return message }, -}; +} function createBaseMsgExec(): MsgExec { - return { grantee: "", msgs: [] }; + return { grantee: "", msgs: [] } } export const MsgExec = { encode(message: MsgExec, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.grantee !== "") { - writer.uint32(10).string(message.grantee); + writer.uint32(10).string(message.grantee) } for (const v of message.msgs) { - Any.encode(v!, writer.uint32(18).fork()).ldelim(); + Any.encode(v!, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MsgExec { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgExec(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgExec() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.grantee = reader.string(); - break; + message.grantee = reader.string() + break case 2: - message.msgs.push(Any.decode(reader, reader.uint32())); - break; + message.msgs.push(Any.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): MsgExec { return { grantee: isSet(object.grantee) ? String(object.grantee) : "", - msgs: Array.isArray(object?.msgs) ? object.msgs.map((e: any) => Any.fromJSON(e)) : [], - }; + msgs: Array.isArray(object?.msgs) + ? object.msgs.map((e: any) => Any.fromJSON(e)) + : [], + } }, toJSON(message: MsgExec): unknown { - const obj: any = {}; - message.grantee !== undefined && (obj.grantee = message.grantee); + const obj: any = {} + message.grantee !== undefined && (obj.grantee = message.grantee) if (message.msgs) { - obj.msgs = message.msgs.map((e) => e ? Any.toJSON(e) : undefined); + obj.msgs = message.msgs.map((e) => (e ? Any.toJSON(e) : undefined)) } else { - obj.msgs = []; + obj.msgs = [] } - return obj; + return obj }, fromPartial, I>>(object: I): MsgExec { - const message = createBaseMsgExec(); - message.grantee = object.grantee ?? ""; - message.msgs = object.msgs?.map((e) => Any.fromPartial(e)) || []; - return message; + const message = createBaseMsgExec() + message.grantee = object.grantee ?? "" + message.msgs = object.msgs?.map((e) => Any.fromPartial(e)) || [] + return message }, -}; +} function createBaseMsgGrantResponse(): MsgGrantResponse { - return {}; + return {} } export const MsgGrantResponse = { encode(_: MsgGrantResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MsgGrantResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgGrantResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgGrantResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(_: any): MsgGrantResponse { - return {}; + return {} }, toJSON(_: MsgGrantResponse): unknown { - const obj: any = {}; - return obj; + const obj: any = {} + return obj }, - fromPartial, I>>(_: I): MsgGrantResponse { - const message = createBaseMsgGrantResponse(); - return message; + fromPartial, I>>( + _: I, + ): MsgGrantResponse { + const message = createBaseMsgGrantResponse() + return message }, -}; +} function createBaseMsgRevoke(): MsgRevoke { - return { granter: "", grantee: "", msgTypeUrl: "" }; + return { granter: "", grantee: "", msgTypeUrl: "" } } export const MsgRevoke = { encode(message: MsgRevoke, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.granter !== "") { - writer.uint32(10).string(message.granter); + writer.uint32(10).string(message.granter) } if (message.grantee !== "") { - writer.uint32(18).string(message.grantee); + writer.uint32(18).string(message.grantee) } if (message.msgTypeUrl !== "") { - writer.uint32(26).string(message.msgTypeUrl); + writer.uint32(26).string(message.msgTypeUrl) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MsgRevoke { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgRevoke(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgRevoke() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.granter = reader.string(); - break; + message.granter = reader.string() + break case 2: - message.grantee = reader.string(); - break; + message.grantee = reader.string() + break case 3: - message.msgTypeUrl = reader.string(); - break; + message.msgTypeUrl = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): MsgRevoke { @@ -322,64 +339,66 @@ export const MsgRevoke = { granter: isSet(object.granter) ? String(object.granter) : "", grantee: isSet(object.grantee) ? String(object.grantee) : "", msgTypeUrl: isSet(object.msgTypeUrl) ? String(object.msgTypeUrl) : "", - }; + } }, toJSON(message: MsgRevoke): unknown { - const obj: any = {}; - message.granter !== undefined && (obj.granter = message.granter); - message.grantee !== undefined && (obj.grantee = message.grantee); - message.msgTypeUrl !== undefined && (obj.msgTypeUrl = message.msgTypeUrl); - return obj; + const obj: any = {} + message.granter !== undefined && (obj.granter = message.granter) + message.grantee !== undefined && (obj.grantee = message.grantee) + message.msgTypeUrl !== undefined && (obj.msgTypeUrl = message.msgTypeUrl) + return obj }, fromPartial, I>>(object: I): MsgRevoke { - const message = createBaseMsgRevoke(); - message.granter = object.granter ?? ""; - message.grantee = object.grantee ?? ""; - message.msgTypeUrl = object.msgTypeUrl ?? ""; - return message; + const message = createBaseMsgRevoke() + message.granter = object.granter ?? "" + message.grantee = object.grantee ?? "" + message.msgTypeUrl = object.msgTypeUrl ?? "" + return message }, -}; +} function createBaseMsgRevokeResponse(): MsgRevokeResponse { - return {}; + return {} } export const MsgRevokeResponse = { encode(_: MsgRevokeResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MsgRevokeResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgRevokeResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgRevokeResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(_: any): MsgRevokeResponse { - return {}; + return {} }, toJSON(_: MsgRevokeResponse): unknown { - const obj: any = {}; - return obj; + const obj: any = {} + return obj }, - fromPartial, I>>(_: I): MsgRevokeResponse { - const message = createBaseMsgRevokeResponse(); - return message; + fromPartial, I>>( + _: I, + ): MsgRevokeResponse { + const message = createBaseMsgRevokeResponse() + return message }, -}; +} /** Msg defines the authz Msg service. */ export interface Msg { @@ -389,112 +408,110 @@ export interface Msg { * for the given (granter, grantee, Authorization) triple, then the grant * will be overwritten. */ - Grant(request: MsgGrant): Promise; + Grant(request: MsgGrant): Promise /** * Exec attempts to execute the provided messages using * authorizations granted to the grantee. Each message should have only * one signer corresponding to the granter of the authorization. */ - Exec(request: MsgExec): Promise; + Exec(request: MsgExec): Promise /** * Revoke revokes any authorization corresponding to the provided method name on the * granter's account that has been granted to the grantee. */ - Revoke(request: MsgRevoke): Promise; + Revoke(request: MsgRevoke): Promise } export class MsgClientImpl implements Msg { - private readonly rpc: Rpc; + private readonly rpc: Rpc constructor(rpc: Rpc) { - this.rpc = rpc; - this.Grant = this.Grant.bind(this); - this.Exec = this.Exec.bind(this); - this.Revoke = this.Revoke.bind(this); + this.rpc = rpc + this.Grant = this.Grant.bind(this) + this.Exec = this.Exec.bind(this) + this.Revoke = this.Revoke.bind(this) } Grant(request: MsgGrant): Promise { - const data = MsgGrant.encode(request).finish(); - const promise = this.rpc.request("cosmos.authz.v1beta1.Msg", "Grant", data); - return promise.then((data) => MsgGrantResponse.decode(new _m0.Reader(data))); + const data = MsgGrant.encode(request).finish() + const promise = this.rpc.request("cosmos.authz.v1beta1.Msg", "Grant", data) + return promise.then((data) => MsgGrantResponse.decode(new _m0.Reader(data))) } Exec(request: MsgExec): Promise { - const data = MsgExec.encode(request).finish(); - const promise = this.rpc.request("cosmos.authz.v1beta1.Msg", "Exec", data); - return promise.then((data) => MsgExecResponse.decode(new _m0.Reader(data))); + const data = MsgExec.encode(request).finish() + const promise = this.rpc.request("cosmos.authz.v1beta1.Msg", "Exec", data) + return promise.then((data) => MsgExecResponse.decode(new _m0.Reader(data))) } Revoke(request: MsgRevoke): Promise { - const data = MsgRevoke.encode(request).finish(); - const promise = this.rpc.request("cosmos.authz.v1beta1.Msg", "Revoke", data); - return promise.then((data) => MsgRevokeResponse.decode(new _m0.Reader(data))); + const data = MsgRevoke.encode(request).finish() + const promise = this.rpc.request("cosmos.authz.v1beta1.Msg", "Revoke", data) + return promise.then((data) => MsgRevokeResponse.decode(new _m0.Reader(data))) } } interface Rpc { - request(service: string, method: string, data: Uint8Array): Promise; + request(service: string, method: string, data: Uint8Array): Promise } -declare var self: any | undefined; -declare var window: any | undefined; -declare var global: any | undefined; +declare var self: any | undefined +declare var window: any | undefined +declare var global: any | undefined var globalThis: any = (() => { - if (typeof globalThis !== "undefined") { - return globalThis; - } - if (typeof self !== "undefined") { - return self; - } - if (typeof window !== "undefined") { - return window; - } - if (typeof global !== "undefined") { - return global; - } - throw "Unable to locate global object"; -})(); - + if (typeof globalThis !== "undefined") return globalThis + if (typeof self !== "undefined") return self + if (typeof window !== "undefined") return window + if (typeof global !== "undefined") return global + throw "Unable to locate global object" +})() + +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")) function bytesFromBase64(b64: string): Uint8Array { - if (globalThis.Buffer) { - return Uint8Array.from(globalThis.Buffer.from(b64, "base64")); - } else { - const bin = globalThis.atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; + 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 } +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")) function base64FromBytes(arr: Uint8Array): string { - if (globalThis.Buffer) { - return globalThis.Buffer.from(arr).toString("base64"); - } else { - const bin: string[] = []; - arr.forEach((byte) => { - bin.push(String.fromCharCode(byte)); - }); - return globalThis.btoa(bin.join("")); - } + const bin: string[] = [] + arr.forEach((byte) => { + bin.push(String.fromCharCode(byte)) + }) + return btoa(bin.join("")) } -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/cosmos/bank/v1beta1/authz.ts b/packages/protojs/src/cosmos/bank/v1beta1/authz.ts index e7b1ad99..8c271b4e 100644 --- a/packages/protojs/src/cosmos/bank/v1beta1/authz.ts +++ b/packages/protojs/src/cosmos/bank/v1beta1/authz.ts @@ -1,9 +1,9 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { Coin } from "../../base/v1beta1/coin"; +import Long from "long" +import { Coin } from "../../base/v1beta1/coin" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "cosmos.bank.v1beta1"; +export const protobufPackage = "cosmos.bank.v1beta1" /** * SendAuthorization allows the grantee to spend up to spend_limit coins from @@ -12,73 +12,92 @@ export const protobufPackage = "cosmos.bank.v1beta1"; * Since: cosmos-sdk 0.43 */ export interface SendAuthorization { - spendLimit: Coin[]; + spendLimit: Coin[] } function createBaseSendAuthorization(): SendAuthorization { - return { spendLimit: [] }; + return { spendLimit: [] } } export const SendAuthorization = { - encode(message: SendAuthorization, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: SendAuthorization, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { for (const v of message.spendLimit) { - Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + Coin.encode(v!, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): SendAuthorization { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSendAuthorization(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseSendAuthorization() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.spendLimit.push(Coin.decode(reader, reader.uint32())); - break; + message.spendLimit.push(Coin.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): SendAuthorization { - return { spendLimit: Array.isArray(object?.spendLimit) ? object.spendLimit.map((e: any) => Coin.fromJSON(e)) : [] }; + return { + spendLimit: Array.isArray(object?.spendLimit) + ? object.spendLimit.map((e: any) => Coin.fromJSON(e)) + : [], + } }, toJSON(message: SendAuthorization): unknown { - const obj: any = {}; + const obj: any = {} if (message.spendLimit) { - obj.spendLimit = message.spendLimit.map((e) => e ? Coin.toJSON(e) : undefined); + obj.spendLimit = message.spendLimit.map((e) => (e ? Coin.toJSON(e) : undefined)) } else { - obj.spendLimit = []; + obj.spendLimit = [] } - return obj; + return obj }, - fromPartial, I>>(object: I): SendAuthorization { - const message = createBaseSendAuthorization(); - message.spendLimit = object.spendLimit?.map((e) => Coin.fromPartial(e)) || []; - return message; + fromPartial, I>>( + object: I, + ): SendAuthorization { + const message = createBaseSendAuthorization() + message.spendLimit = object.spendLimit?.map((e) => Coin.fromPartial(e)) || [] + return message }, -}; +} -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } diff --git a/packages/protojs/src/cosmos/bank/v1beta1/bank.ts b/packages/protojs/src/cosmos/bank/v1beta1/bank.ts index b25f08eb..4e84f388 100644 --- a/packages/protojs/src/cosmos/bank/v1beta1/bank.ts +++ b/packages/protojs/src/cosmos/bank/v1beta1/bank.ts @@ -1,14 +1,14 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { Coin } from "../../base/v1beta1/coin"; +import Long from "long" +import { Coin } from "../../base/v1beta1/coin" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "cosmos.bank.v1beta1"; +export const protobufPackage = "cosmos.bank.v1beta1" /** Params defines the parameters for the bank module. */ export interface Params { - sendEnabled: SendEnabled[]; - defaultSendEnabled: boolean; + sendEnabled: SendEnabled[] + defaultSendEnabled: boolean } /** @@ -16,20 +16,20 @@ export interface Params { * sendable). */ export interface SendEnabled { - denom: string; - enabled: boolean; + denom: string + enabled: boolean } /** Input models transaction input. */ export interface Input { - address: string; - coins: Coin[]; + address: string + coins: Coin[] } /** Output models transaction outputs. */ export interface Output { - address: string; - coins: Coin[]; + address: string + coins: Coin[] } /** @@ -40,7 +40,7 @@ export interface Output { * @deprecated */ export interface Supply { - total: Coin[]; + total: Coin[] } /** @@ -49,7 +49,7 @@ export interface Supply { */ export interface DenomUnit { /** denom represents the string name of the given denom unit (e.g uatom). */ - denom: string; + 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 @@ -57,9 +57,9 @@ export interface DenomUnit { * (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; + exponent: number /** aliases is a list of string aliases for the given denom */ - aliases: string[]; + aliases: string[] } /** @@ -67,65 +67,65 @@ export interface DenomUnit { * a basic token. */ export interface Metadata { - description: string; + description: string /** denom_units represents the list of DenomUnit's for a given coin */ - denomUnits: DenomUnit[]; + denomUnits: DenomUnit[] /** base represents the base denom (should be the DenomUnit with exponent = 0). */ - base: string; + base: string /** * display indicates the suggested denom that should be * displayed in clients. */ - display: string; + display: string /** * name defines the name of the token (eg: Cosmos Atom) * * Since: cosmos-sdk 0.43 */ - name: string; + name: string /** * symbol is the token symbol usually shown on exchanges (eg: ATOM). This can * be the same as the display. * * Since: cosmos-sdk 0.43 */ - symbol: string; + symbol: string } function createBaseParams(): Params { - return { sendEnabled: [], defaultSendEnabled: false }; + return { sendEnabled: [], defaultSendEnabled: false } } export const Params = { encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.sendEnabled) { - SendEnabled.encode(v!, writer.uint32(10).fork()).ldelim(); + SendEnabled.encode(v!, writer.uint32(10).fork()).ldelim() } if (message.defaultSendEnabled === true) { - writer.uint32(16).bool(message.defaultSendEnabled); + writer.uint32(16).bool(message.defaultSendEnabled) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Params { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseParams(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseParams() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.sendEnabled.push(SendEnabled.decode(reader, reader.uint32())); - break; + message.sendEnabled.push(SendEnabled.decode(reader, reader.uint32())) + break case 2: - message.defaultSendEnabled = reader.bool(); - break; + message.defaultSendEnabled = reader.bool() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Params { @@ -133,448 +133,485 @@ export const Params = { sendEnabled: Array.isArray(object?.sendEnabled) ? object.sendEnabled.map((e: any) => SendEnabled.fromJSON(e)) : [], - defaultSendEnabled: isSet(object.defaultSendEnabled) ? Boolean(object.defaultSendEnabled) : false, - }; + defaultSendEnabled: isSet(object.defaultSendEnabled) + ? Boolean(object.defaultSendEnabled) + : false, + } }, toJSON(message: Params): unknown { - const obj: any = {}; + const obj: any = {} if (message.sendEnabled) { - obj.sendEnabled = message.sendEnabled.map((e) => e ? SendEnabled.toJSON(e) : undefined); + obj.sendEnabled = message.sendEnabled.map((e) => + e ? SendEnabled.toJSON(e) : undefined, + ) } else { - obj.sendEnabled = []; + obj.sendEnabled = [] } - message.defaultSendEnabled !== undefined && (obj.defaultSendEnabled = message.defaultSendEnabled); - return obj; + message.defaultSendEnabled !== undefined && + (obj.defaultSendEnabled = message.defaultSendEnabled) + return obj }, fromPartial, I>>(object: I): Params { - const message = createBaseParams(); - message.sendEnabled = object.sendEnabled?.map((e) => SendEnabled.fromPartial(e)) || []; - message.defaultSendEnabled = object.defaultSendEnabled ?? false; - return message; + const message = createBaseParams() + message.sendEnabled = + object.sendEnabled?.map((e) => SendEnabled.fromPartial(e)) || [] + message.defaultSendEnabled = object.defaultSendEnabled ?? false + return message }, -}; +} function createBaseSendEnabled(): SendEnabled { - return { denom: "", enabled: false }; + return { denom: "", enabled: false } } export const SendEnabled = { encode(message: SendEnabled, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.denom !== "") { - writer.uint32(10).string(message.denom); + writer.uint32(10).string(message.denom) } if (message.enabled === true) { - writer.uint32(16).bool(message.enabled); + writer.uint32(16).bool(message.enabled) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): SendEnabled { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSendEnabled(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseSendEnabled() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.denom = reader.string(); - break; + message.denom = reader.string() + break case 2: - message.enabled = reader.bool(); - break; + message.enabled = reader.bool() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): SendEnabled { return { denom: isSet(object.denom) ? String(object.denom) : "", enabled: isSet(object.enabled) ? Boolean(object.enabled) : false, - }; + } }, toJSON(message: SendEnabled): unknown { - const obj: any = {}; - message.denom !== undefined && (obj.denom = message.denom); - message.enabled !== undefined && (obj.enabled = message.enabled); - return obj; + const obj: any = {} + message.denom !== undefined && (obj.denom = message.denom) + message.enabled !== undefined && (obj.enabled = message.enabled) + return obj }, fromPartial, I>>(object: I): SendEnabled { - const message = createBaseSendEnabled(); - message.denom = object.denom ?? ""; - message.enabled = object.enabled ?? false; - return message; + const message = createBaseSendEnabled() + message.denom = object.denom ?? "" + message.enabled = object.enabled ?? false + return message }, -}; +} function createBaseInput(): Input { - return { address: "", coins: [] }; + return { address: "", coins: [] } } export const Input = { encode(message: Input, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.address !== "") { - writer.uint32(10).string(message.address); + writer.uint32(10).string(message.address) } for (const v of message.coins) { - Coin.encode(v!, writer.uint32(18).fork()).ldelim(); + Coin.encode(v!, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Input { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseInput(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseInput() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.address = reader.string(); - break; + message.address = reader.string() + break case 2: - message.coins.push(Coin.decode(reader, reader.uint32())); - break; + message.coins.push(Coin.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Input { return { address: isSet(object.address) ? String(object.address) : "", - coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromJSON(e)) : [], - }; + coins: Array.isArray(object?.coins) + ? object.coins.map((e: any) => Coin.fromJSON(e)) + : [], + } }, toJSON(message: Input): unknown { - const obj: any = {}; - message.address !== undefined && (obj.address = message.address); + const obj: any = {} + message.address !== undefined && (obj.address = message.address) if (message.coins) { - obj.coins = message.coins.map((e) => e ? Coin.toJSON(e) : undefined); + obj.coins = message.coins.map((e) => (e ? Coin.toJSON(e) : undefined)) } else { - obj.coins = []; + obj.coins = [] } - return obj; + return obj }, fromPartial, I>>(object: I): Input { - const message = createBaseInput(); - message.address = object.address ?? ""; - message.coins = object.coins?.map((e) => Coin.fromPartial(e)) || []; - return message; + const message = createBaseInput() + message.address = object.address ?? "" + message.coins = object.coins?.map((e) => Coin.fromPartial(e)) || [] + return message }, -}; +} function createBaseOutput(): Output { - return { address: "", coins: [] }; + return { address: "", coins: [] } } export const Output = { encode(message: Output, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.address !== "") { - writer.uint32(10).string(message.address); + writer.uint32(10).string(message.address) } for (const v of message.coins) { - Coin.encode(v!, writer.uint32(18).fork()).ldelim(); + Coin.encode(v!, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Output { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseOutput(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseOutput() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.address = reader.string(); - break; + message.address = reader.string() + break case 2: - message.coins.push(Coin.decode(reader, reader.uint32())); - break; + message.coins.push(Coin.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Output { return { address: isSet(object.address) ? String(object.address) : "", - coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromJSON(e)) : [], - }; + coins: Array.isArray(object?.coins) + ? object.coins.map((e: any) => Coin.fromJSON(e)) + : [], + } }, toJSON(message: Output): unknown { - const obj: any = {}; - message.address !== undefined && (obj.address = message.address); + const obj: any = {} + message.address !== undefined && (obj.address = message.address) if (message.coins) { - obj.coins = message.coins.map((e) => e ? Coin.toJSON(e) : undefined); + obj.coins = message.coins.map((e) => (e ? Coin.toJSON(e) : undefined)) } else { - obj.coins = []; + obj.coins = [] } - return obj; + return obj }, fromPartial, I>>(object: I): Output { - const message = createBaseOutput(); - message.address = object.address ?? ""; - message.coins = object.coins?.map((e) => Coin.fromPartial(e)) || []; - return message; + const message = createBaseOutput() + message.address = object.address ?? "" + message.coins = object.coins?.map((e) => Coin.fromPartial(e)) || [] + return message }, -}; +} function createBaseSupply(): Supply { - return { total: [] }; + return { total: [] } } export const Supply = { encode(message: Supply, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.total) { - Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + Coin.encode(v!, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Supply { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSupply(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseSupply() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.total.push(Coin.decode(reader, reader.uint32())); - break; + message.total.push(Coin.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Supply { - return { total: Array.isArray(object?.total) ? object.total.map((e: any) => Coin.fromJSON(e)) : [] }; + return { + total: Array.isArray(object?.total) + ? object.total.map((e: any) => Coin.fromJSON(e)) + : [], + } }, toJSON(message: Supply): unknown { - const obj: any = {}; + const obj: any = {} if (message.total) { - obj.total = message.total.map((e) => e ? Coin.toJSON(e) : undefined); + obj.total = message.total.map((e) => (e ? Coin.toJSON(e) : undefined)) } else { - obj.total = []; + obj.total = [] } - return obj; + return obj }, fromPartial, I>>(object: I): Supply { - const message = createBaseSupply(); - message.total = object.total?.map((e) => Coin.fromPartial(e)) || []; - return message; + const message = createBaseSupply() + message.total = object.total?.map((e) => Coin.fromPartial(e)) || [] + return message }, -}; +} function createBaseDenomUnit(): DenomUnit { - return { denom: "", exponent: 0, aliases: [] }; + return { denom: "", exponent: 0, aliases: [] } } export const DenomUnit = { encode(message: DenomUnit, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.denom !== "") { - writer.uint32(10).string(message.denom); + writer.uint32(10).string(message.denom) } if (message.exponent !== 0) { - writer.uint32(16).uint32(message.exponent); + writer.uint32(16).uint32(message.exponent) } for (const v of message.aliases) { - writer.uint32(26).string(v!); + writer.uint32(26).string(v!) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): DenomUnit { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDenomUnit(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseDenomUnit() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.denom = reader.string(); - break; + message.denom = reader.string() + break case 2: - message.exponent = reader.uint32(); - break; + message.exponent = reader.uint32() + break case 3: - message.aliases.push(reader.string()); - break; + message.aliases.push(reader.string()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): DenomUnit { return { denom: isSet(object.denom) ? String(object.denom) : "", exponent: isSet(object.exponent) ? Number(object.exponent) : 0, - aliases: Array.isArray(object?.aliases) ? object.aliases.map((e: any) => String(e)) : [], - }; + aliases: Array.isArray(object?.aliases) + ? object.aliases.map((e: any) => String(e)) + : [], + } }, toJSON(message: DenomUnit): unknown { - const obj: any = {}; - message.denom !== undefined && (obj.denom = message.denom); - message.exponent !== undefined && (obj.exponent = Math.round(message.exponent)); + const obj: any = {} + message.denom !== undefined && (obj.denom = message.denom) + message.exponent !== undefined && (obj.exponent = Math.round(message.exponent)) if (message.aliases) { - obj.aliases = message.aliases.map((e) => e); + obj.aliases = message.aliases.map((e) => e) } else { - obj.aliases = []; + obj.aliases = [] } - return obj; + return obj }, fromPartial, I>>(object: I): DenomUnit { - const message = createBaseDenomUnit(); - message.denom = object.denom ?? ""; - message.exponent = object.exponent ?? 0; - message.aliases = object.aliases?.map((e) => e) || []; - return message; + const message = createBaseDenomUnit() + message.denom = object.denom ?? "" + message.exponent = object.exponent ?? 0 + message.aliases = object.aliases?.map((e) => e) || [] + return message }, -}; +} function createBaseMetadata(): Metadata { - return { description: "", denomUnits: [], base: "", display: "", name: "", symbol: "" }; + return { + description: "", + denomUnits: [], + base: "", + display: "", + name: "", + symbol: "", + } } export const Metadata = { encode(message: Metadata, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.description !== "") { - writer.uint32(10).string(message.description); + writer.uint32(10).string(message.description) } for (const v of message.denomUnits) { - DenomUnit.encode(v!, writer.uint32(18).fork()).ldelim(); + DenomUnit.encode(v!, writer.uint32(18).fork()).ldelim() } if (message.base !== "") { - writer.uint32(26).string(message.base); + writer.uint32(26).string(message.base) } if (message.display !== "") { - writer.uint32(34).string(message.display); + writer.uint32(34).string(message.display) } if (message.name !== "") { - writer.uint32(42).string(message.name); + writer.uint32(42).string(message.name) } if (message.symbol !== "") { - writer.uint32(50).string(message.symbol); + writer.uint32(50).string(message.symbol) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Metadata { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMetadata(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMetadata() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.description = reader.string(); - break; + message.description = reader.string() + break case 2: - message.denomUnits.push(DenomUnit.decode(reader, reader.uint32())); - break; + message.denomUnits.push(DenomUnit.decode(reader, reader.uint32())) + break case 3: - message.base = reader.string(); - break; + message.base = reader.string() + break case 4: - message.display = reader.string(); - break; + message.display = reader.string() + break case 5: - message.name = reader.string(); - break; + message.name = reader.string() + break case 6: - message.symbol = reader.string(); - break; + message.symbol = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Metadata { return { description: isSet(object.description) ? String(object.description) : "", - denomUnits: Array.isArray(object?.denomUnits) ? object.denomUnits.map((e: any) => DenomUnit.fromJSON(e)) : [], + denomUnits: Array.isArray(object?.denomUnits) + ? object.denomUnits.map((e: any) => DenomUnit.fromJSON(e)) + : [], base: isSet(object.base) ? String(object.base) : "", display: isSet(object.display) ? String(object.display) : "", name: isSet(object.name) ? String(object.name) : "", symbol: isSet(object.symbol) ? String(object.symbol) : "", - }; + } }, toJSON(message: Metadata): unknown { - const obj: any = {}; - message.description !== undefined && (obj.description = message.description); + const obj: any = {} + message.description !== undefined && (obj.description = message.description) if (message.denomUnits) { - obj.denomUnits = message.denomUnits.map((e) => e ? DenomUnit.toJSON(e) : undefined); + obj.denomUnits = message.denomUnits.map((e) => + e ? DenomUnit.toJSON(e) : undefined, + ) } else { - obj.denomUnits = []; + obj.denomUnits = [] } - message.base !== undefined && (obj.base = message.base); - message.display !== undefined && (obj.display = message.display); - message.name !== undefined && (obj.name = message.name); - message.symbol !== undefined && (obj.symbol = message.symbol); - return obj; + message.base !== undefined && (obj.base = message.base) + message.display !== undefined && (obj.display = message.display) + message.name !== undefined && (obj.name = message.name) + message.symbol !== undefined && (obj.symbol = message.symbol) + return obj }, fromPartial, I>>(object: I): Metadata { - const message = createBaseMetadata(); - message.description = object.description ?? ""; - message.denomUnits = object.denomUnits?.map((e) => DenomUnit.fromPartial(e)) || []; - message.base = object.base ?? ""; - message.display = object.display ?? ""; - message.name = object.name ?? ""; - message.symbol = object.symbol ?? ""; - return message; + const message = createBaseMetadata() + message.description = object.description ?? "" + message.denomUnits = object.denomUnits?.map((e) => DenomUnit.fromPartial(e)) || [] + message.base = object.base ?? "" + message.display = object.display ?? "" + message.name = object.name ?? "" + message.symbol = object.symbol ?? "" + return message }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; +} -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/cosmos/bank/v1beta1/genesis.ts b/packages/protojs/src/cosmos/bank/v1beta1/genesis.ts index 3e4441a5..5369bd9c 100644 --- a/packages/protojs/src/cosmos/bank/v1beta1/genesis.ts +++ b/packages/protojs/src/cosmos/bank/v1beta1/genesis.ts @@ -1,24 +1,24 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { Coin } from "../../base/v1beta1/coin"; -import { Metadata, Params } from "./bank"; +import { Params, Metadata } from "./bank" +import Long from "long" +import { Coin } from "../../base/v1beta1/coin" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "cosmos.bank.v1beta1"; +export const protobufPackage = "cosmos.bank.v1beta1" /** GenesisState defines the bank module's genesis state. */ export interface GenesisState { /** params defines all the paramaters of the module. */ - params?: Params; + params?: Params /** balances is an array containing the balances of all the accounts. */ - balances: Balance[]; + balances: Balance[] /** * supply represents the total supply. If it is left empty, then supply will be calculated based on the provided * balances. Otherwise, it will be used to validate that the sum of the balances equals this amount. */ - supply: Coin[]; + supply: Coin[] /** denom_metadata defines the metadata of the differents coins. */ - denomMetadata: Metadata[]; + denomMetadata: Metadata[] } /** @@ -27,182 +27,203 @@ export interface GenesisState { */ export interface Balance { /** address is the address of the balance holder. */ - address: string; + address: string /** coins defines the different coins this balance holds. */ - coins: Coin[]; + coins: Coin[] } function createBaseGenesisState(): GenesisState { - return { params: undefined, balances: [], supply: [], denomMetadata: [] }; + return { params: undefined, balances: [], supply: [], denomMetadata: [] } } export const GenesisState = { encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.params !== undefined) { - Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + Params.encode(message.params, writer.uint32(10).fork()).ldelim() } for (const v of message.balances) { - Balance.encode(v!, writer.uint32(18).fork()).ldelim(); + Balance.encode(v!, writer.uint32(18).fork()).ldelim() } for (const v of message.supply) { - Coin.encode(v!, writer.uint32(26).fork()).ldelim(); + Coin.encode(v!, writer.uint32(26).fork()).ldelim() } for (const v of message.denomMetadata) { - Metadata.encode(v!, writer.uint32(34).fork()).ldelim(); + Metadata.encode(v!, writer.uint32(34).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGenesisState(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseGenesisState() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.params = Params.decode(reader, reader.uint32()); - break; + message.params = Params.decode(reader, reader.uint32()) + break case 2: - message.balances.push(Balance.decode(reader, reader.uint32())); - break; + message.balances.push(Balance.decode(reader, reader.uint32())) + break case 3: - message.supply.push(Coin.decode(reader, reader.uint32())); - break; + message.supply.push(Coin.decode(reader, reader.uint32())) + break case 4: - message.denomMetadata.push(Metadata.decode(reader, reader.uint32())); - break; + message.denomMetadata.push(Metadata.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): GenesisState { return { params: isSet(object.params) ? Params.fromJSON(object.params) : undefined, - balances: Array.isArray(object?.balances) ? object.balances.map((e: any) => Balance.fromJSON(e)) : [], - supply: Array.isArray(object?.supply) ? object.supply.map((e: any) => Coin.fromJSON(e)) : [], + balances: Array.isArray(object?.balances) + ? object.balances.map((e: any) => Balance.fromJSON(e)) + : [], + supply: Array.isArray(object?.supply) + ? object.supply.map((e: any) => Coin.fromJSON(e)) + : [], denomMetadata: Array.isArray(object?.denomMetadata) ? object.denomMetadata.map((e: any) => Metadata.fromJSON(e)) : [], - }; + } }, toJSON(message: GenesisState): unknown { - const obj: any = {}; - message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + const obj: any = {} + message.params !== undefined && + (obj.params = message.params ? Params.toJSON(message.params) : undefined) if (message.balances) { - obj.balances = message.balances.map((e) => e ? Balance.toJSON(e) : undefined); + obj.balances = message.balances.map((e) => (e ? Balance.toJSON(e) : undefined)) } else { - obj.balances = []; + obj.balances = [] } if (message.supply) { - obj.supply = message.supply.map((e) => e ? Coin.toJSON(e) : undefined); + obj.supply = message.supply.map((e) => (e ? Coin.toJSON(e) : undefined)) } else { - obj.supply = []; + obj.supply = [] } if (message.denomMetadata) { - obj.denomMetadata = message.denomMetadata.map((e) => e ? Metadata.toJSON(e) : undefined); + obj.denomMetadata = message.denomMetadata.map((e) => + e ? Metadata.toJSON(e) : undefined, + ) } else { - obj.denomMetadata = []; + obj.denomMetadata = [] } - return obj; + return obj }, fromPartial, I>>(object: I): GenesisState { - const message = createBaseGenesisState(); - message.params = (object.params !== undefined && object.params !== null) - ? Params.fromPartial(object.params) - : undefined; - message.balances = object.balances?.map((e) => Balance.fromPartial(e)) || []; - message.supply = object.supply?.map((e) => Coin.fromPartial(e)) || []; - message.denomMetadata = object.denomMetadata?.map((e) => Metadata.fromPartial(e)) || []; - return message; + const message = createBaseGenesisState() + message.params = + object.params !== undefined && object.params !== null + ? Params.fromPartial(object.params) + : undefined + message.balances = object.balances?.map((e) => Balance.fromPartial(e)) || [] + message.supply = object.supply?.map((e) => Coin.fromPartial(e)) || [] + message.denomMetadata = + object.denomMetadata?.map((e) => Metadata.fromPartial(e)) || [] + return message }, -}; +} function createBaseBalance(): Balance { - return { address: "", coins: [] }; + return { address: "", coins: [] } } export const Balance = { encode(message: Balance, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.address !== "") { - writer.uint32(10).string(message.address); + writer.uint32(10).string(message.address) } for (const v of message.coins) { - Coin.encode(v!, writer.uint32(18).fork()).ldelim(); + Coin.encode(v!, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Balance { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseBalance(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseBalance() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.address = reader.string(); - break; + message.address = reader.string() + break case 2: - message.coins.push(Coin.decode(reader, reader.uint32())); - break; + message.coins.push(Coin.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Balance { return { address: isSet(object.address) ? String(object.address) : "", - coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromJSON(e)) : [], - }; + coins: Array.isArray(object?.coins) + ? object.coins.map((e: any) => Coin.fromJSON(e)) + : [], + } }, toJSON(message: Balance): unknown { - const obj: any = {}; - message.address !== undefined && (obj.address = message.address); + const obj: any = {} + message.address !== undefined && (obj.address = message.address) if (message.coins) { - obj.coins = message.coins.map((e) => e ? Coin.toJSON(e) : undefined); + obj.coins = message.coins.map((e) => (e ? Coin.toJSON(e) : undefined)) } else { - obj.coins = []; + obj.coins = [] } - return obj; + return obj }, fromPartial, I>>(object: I): Balance { - const message = createBaseBalance(); - message.address = object.address ?? ""; - message.coins = object.coins?.map((e) => Coin.fromPartial(e)) || []; - return message; + const message = createBaseBalance() + message.address = object.address ?? "" + message.coins = object.coins?.map((e) => Coin.fromPartial(e)) || [] + return message }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; +} -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/cosmos/bank/v1beta1/query.ts b/packages/protojs/src/cosmos/bank/v1beta1/query.ts index 02ef38ea..eb8cd674 100644 --- a/packages/protojs/src/cosmos/bank/v1beta1/query.ts +++ b/packages/protojs/src/cosmos/bank/v1beta1/query.ts @@ -1,32 +1,32 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { PageRequest, PageResponse } from "../../base/query/v1beta1/pagination"; -import { Coin } from "../../base/v1beta1/coin"; -import { Metadata, Params } from "./bank"; +import { Coin } from "../../base/v1beta1/coin" +import { PageRequest, PageResponse } from "../../base/query/v1beta1/pagination" +import { Params, Metadata } from "./bank" +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "cosmos.bank.v1beta1"; +export const protobufPackage = "cosmos.bank.v1beta1" /** QueryBalanceRequest is the request type for the Query/Balance RPC method. */ export interface QueryBalanceRequest { /** address is the address to query balances for. */ - address: string; + address: string /** denom is the coin denom to query balances for. */ - denom: string; + denom: string } /** QueryBalanceResponse is the response type for the Query/Balance RPC method. */ export interface QueryBalanceResponse { /** balance is the balance of the coin. */ - balance?: Coin; + balance?: Coin } /** QueryBalanceRequest is the request type for the Query/AllBalances RPC method. */ export interface QueryAllBalancesRequest { /** address is the address to query balances for. */ - address: string; + address: string /** pagination defines an optional pagination for the request. */ - pagination?: PageRequest; + pagination?: PageRequest } /** @@ -35,9 +35,9 @@ export interface QueryAllBalancesRequest { */ export interface QueryAllBalancesResponse { /** balances is the balances of all the coins. */ - balances: Coin[]; + balances: Coin[] /** pagination defines the pagination in the response. */ - pagination?: PageResponse; + pagination?: PageResponse } /** @@ -46,9 +46,9 @@ export interface QueryAllBalancesResponse { */ export interface QuerySpendableBalancesRequest { /** address is the address to query spendable balances for. */ - address: string; + address: string /** pagination defines an optional pagination for the request. */ - pagination?: PageRequest; + pagination?: PageRequest } /** @@ -57,9 +57,9 @@ export interface QuerySpendableBalancesRequest { */ export interface QuerySpendableBalancesResponse { /** balances is the spendable balances of all the coins. */ - balances: Coin[]; + balances: Coin[] /** pagination defines the pagination in the response. */ - pagination?: PageResponse; + pagination?: PageResponse } /** @@ -72,7 +72,7 @@ export interface QueryTotalSupplyRequest { * * Since: cosmos-sdk 0.43 */ - pagination?: PageRequest; + pagination?: PageRequest } /** @@ -81,40 +81,39 @@ export interface QueryTotalSupplyRequest { */ export interface QueryTotalSupplyResponse { /** supply is the supply of the coins */ - supply: Coin[]; + supply: Coin[] /** * pagination defines the pagination in the response. * * Since: cosmos-sdk 0.43 */ - pagination?: PageResponse; + pagination?: PageResponse } /** QuerySupplyOfRequest is the request type for the Query/SupplyOf RPC method. */ export interface QuerySupplyOfRequest { /** denom is the coin denom to query balances for. */ - denom: string; + denom: string } /** QuerySupplyOfResponse is the response type for the Query/SupplyOf RPC method. */ export interface QuerySupplyOfResponse { /** amount is the supply of the coin. */ - amount?: Coin; + amount?: Coin } /** QueryParamsRequest defines the request type for querying x/bank parameters. */ -export interface QueryParamsRequest { -} +export interface QueryParamsRequest {} /** QueryParamsResponse defines the response type for querying x/bank parameters. */ export interface QueryParamsResponse { - params?: Params; + params?: Params } /** QueryDenomsMetadataRequest is the request type for the Query/DenomsMetadata RPC method. */ export interface QueryDenomsMetadataRequest { /** pagination defines an optional pagination for the request. */ - pagination?: PageRequest; + pagination?: PageRequest } /** @@ -123,15 +122,15 @@ export interface QueryDenomsMetadataRequest { */ export interface QueryDenomsMetadataResponse { /** metadata provides the client information for all the registered tokens. */ - metadatas: Metadata[]; + metadatas: Metadata[] /** pagination defines the pagination in the response. */ - pagination?: PageResponse; + pagination?: PageResponse } /** QueryDenomMetadataRequest is the request type for the Query/DenomMetadata RPC method. */ export interface QueryDenomMetadataRequest { /** denom is the coin denom to query the metadata for. */ - denom: string; + denom: string } /** @@ -140,988 +139,1173 @@ export interface QueryDenomMetadataRequest { */ export interface QueryDenomMetadataResponse { /** metadata describes and provides all the client information for the requested token. */ - metadata?: Metadata; + metadata?: Metadata } function createBaseQueryBalanceRequest(): QueryBalanceRequest { - return { address: "", denom: "" }; + return { address: "", denom: "" } } export const QueryBalanceRequest = { - encode(message: QueryBalanceRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryBalanceRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.address !== "") { - writer.uint32(10).string(message.address); + writer.uint32(10).string(message.address) } if (message.denom !== "") { - writer.uint32(18).string(message.denom); + writer.uint32(18).string(message.denom) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryBalanceRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryBalanceRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryBalanceRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.address = reader.string(); - break; + message.address = reader.string() + break case 2: - message.denom = reader.string(); - break; + message.denom = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryBalanceRequest { return { address: isSet(object.address) ? String(object.address) : "", denom: isSet(object.denom) ? String(object.denom) : "", - }; + } }, toJSON(message: QueryBalanceRequest): unknown { - const obj: any = {}; - message.address !== undefined && (obj.address = message.address); - message.denom !== undefined && (obj.denom = message.denom); - return obj; + const obj: any = {} + message.address !== undefined && (obj.address = message.address) + message.denom !== undefined && (obj.denom = message.denom) + return obj }, - fromPartial, I>>(object: I): QueryBalanceRequest { - const message = createBaseQueryBalanceRequest(); - message.address = object.address ?? ""; - message.denom = object.denom ?? ""; - return message; + fromPartial, I>>( + object: I, + ): QueryBalanceRequest { + const message = createBaseQueryBalanceRequest() + message.address = object.address ?? "" + message.denom = object.denom ?? "" + return message }, -}; +} function createBaseQueryBalanceResponse(): QueryBalanceResponse { - return { balance: undefined }; + return { balance: undefined } } export const QueryBalanceResponse = { - encode(message: QueryBalanceResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryBalanceResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.balance !== undefined) { - Coin.encode(message.balance, writer.uint32(10).fork()).ldelim(); + Coin.encode(message.balance, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryBalanceResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryBalanceResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryBalanceResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.balance = Coin.decode(reader, reader.uint32()); - break; + message.balance = Coin.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryBalanceResponse { - return { balance: isSet(object.balance) ? Coin.fromJSON(object.balance) : undefined }; + return { + balance: isSet(object.balance) ? Coin.fromJSON(object.balance) : undefined, + } }, toJSON(message: QueryBalanceResponse): unknown { - const obj: any = {}; - message.balance !== undefined && (obj.balance = message.balance ? Coin.toJSON(message.balance) : undefined); - return obj; + const obj: any = {} + message.balance !== undefined && + (obj.balance = message.balance ? Coin.toJSON(message.balance) : undefined) + return obj }, - fromPartial, I>>(object: I): QueryBalanceResponse { - const message = createBaseQueryBalanceResponse(); - message.balance = (object.balance !== undefined && object.balance !== null) - ? Coin.fromPartial(object.balance) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): QueryBalanceResponse { + const message = createBaseQueryBalanceResponse() + message.balance = + object.balance !== undefined && object.balance !== null + ? Coin.fromPartial(object.balance) + : undefined + return message }, -}; +} function createBaseQueryAllBalancesRequest(): QueryAllBalancesRequest { - return { address: "", pagination: undefined }; + return { address: "", pagination: undefined } } export const QueryAllBalancesRequest = { - encode(message: QueryAllBalancesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryAllBalancesRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.address !== "") { - writer.uint32(10).string(message.address); + writer.uint32(10).string(message.address) } if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllBalancesRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryAllBalancesRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryAllBalancesRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.address = reader.string(); - break; + message.address = reader.string() + break case 2: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; + message.pagination = PageRequest.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryAllBalancesRequest { return { address: isSet(object.address) ? String(object.address) : "", - pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined, - }; + pagination: isSet(object.pagination) + ? PageRequest.fromJSON(object.pagination) + : undefined, + } }, toJSON(message: QueryAllBalancesRequest): unknown { - const obj: any = {}; - message.address !== undefined && (obj.address = message.address); + const obj: any = {} + message.address !== undefined && (obj.address = message.address) message.pagination !== undefined && - (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); - return obj; + (obj.pagination = message.pagination + ? PageRequest.toJSON(message.pagination) + : undefined) + return obj }, - fromPartial, I>>(object: I): QueryAllBalancesRequest { - const message = createBaseQueryAllBalancesRequest(); - message.address = object.address ?? ""; - message.pagination = (object.pagination !== undefined && object.pagination !== null) - ? PageRequest.fromPartial(object.pagination) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): QueryAllBalancesRequest { + const message = createBaseQueryAllBalancesRequest() + message.address = object.address ?? "" + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageRequest.fromPartial(object.pagination) + : undefined + return message }, -}; +} function createBaseQueryAllBalancesResponse(): QueryAllBalancesResponse { - return { balances: [], pagination: undefined }; + return { balances: [], pagination: undefined } } export const QueryAllBalancesResponse = { - encode(message: QueryAllBalancesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryAllBalancesResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { for (const v of message.balances) { - Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + Coin.encode(v!, writer.uint32(10).fork()).ldelim() } if (message.pagination !== undefined) { - PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllBalancesResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryAllBalancesResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryAllBalancesResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.balances.push(Coin.decode(reader, reader.uint32())); - break; + message.balances.push(Coin.decode(reader, reader.uint32())) + break case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; + message.pagination = PageResponse.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryAllBalancesResponse { return { - balances: Array.isArray(object?.balances) ? object.balances.map((e: any) => Coin.fromJSON(e)) : [], - pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, - }; + balances: Array.isArray(object?.balances) + ? object.balances.map((e: any) => Coin.fromJSON(e)) + : [], + pagination: isSet(object.pagination) + ? PageResponse.fromJSON(object.pagination) + : undefined, + } }, toJSON(message: QueryAllBalancesResponse): unknown { - const obj: any = {}; + const obj: any = {} if (message.balances) { - obj.balances = message.balances.map((e) => e ? Coin.toJSON(e) : undefined); + obj.balances = message.balances.map((e) => (e ? Coin.toJSON(e) : undefined)) } else { - obj.balances = []; + obj.balances = [] } message.pagination !== undefined && - (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); - return obj; + (obj.pagination = message.pagination + ? PageResponse.toJSON(message.pagination) + : undefined) + return obj }, - fromPartial, I>>(object: I): QueryAllBalancesResponse { - const message = createBaseQueryAllBalancesResponse(); - message.balances = object.balances?.map((e) => Coin.fromPartial(e)) || []; - message.pagination = (object.pagination !== undefined && object.pagination !== null) - ? PageResponse.fromPartial(object.pagination) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): QueryAllBalancesResponse { + const message = createBaseQueryAllBalancesResponse() + message.balances = object.balances?.map((e) => Coin.fromPartial(e)) || [] + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageResponse.fromPartial(object.pagination) + : undefined + return message }, -}; +} function createBaseQuerySpendableBalancesRequest(): QuerySpendableBalancesRequest { - return { address: "", pagination: undefined }; + return { address: "", pagination: undefined } } export const QuerySpendableBalancesRequest = { - encode(message: QuerySpendableBalancesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QuerySpendableBalancesRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.address !== "") { - writer.uint32(10).string(message.address); + writer.uint32(10).string(message.address) } if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): QuerySpendableBalancesRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQuerySpendableBalancesRequest(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QuerySpendableBalancesRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQuerySpendableBalancesRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.address = reader.string(); - break; + message.address = reader.string() + break case 2: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; + message.pagination = PageRequest.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QuerySpendableBalancesRequest { return { address: isSet(object.address) ? String(object.address) : "", - pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined, - }; + pagination: isSet(object.pagination) + ? PageRequest.fromJSON(object.pagination) + : undefined, + } }, toJSON(message: QuerySpendableBalancesRequest): unknown { - const obj: any = {}; - message.address !== undefined && (obj.address = message.address); + const obj: any = {} + message.address !== undefined && (obj.address = message.address) message.pagination !== undefined && - (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); - return obj; + (obj.pagination = message.pagination + ? PageRequest.toJSON(message.pagination) + : undefined) + return obj }, fromPartial, I>>( object: I, ): QuerySpendableBalancesRequest { - const message = createBaseQuerySpendableBalancesRequest(); - message.address = object.address ?? ""; - message.pagination = (object.pagination !== undefined && object.pagination !== null) - ? PageRequest.fromPartial(object.pagination) - : undefined; - return message; + const message = createBaseQuerySpendableBalancesRequest() + message.address = object.address ?? "" + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageRequest.fromPartial(object.pagination) + : undefined + return message }, -}; +} function createBaseQuerySpendableBalancesResponse(): QuerySpendableBalancesResponse { - return { balances: [], pagination: undefined }; + return { balances: [], pagination: undefined } } export const QuerySpendableBalancesResponse = { - encode(message: QuerySpendableBalancesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QuerySpendableBalancesResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { for (const v of message.balances) { - Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + Coin.encode(v!, writer.uint32(10).fork()).ldelim() } if (message.pagination !== undefined) { - PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): QuerySpendableBalancesResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQuerySpendableBalancesResponse(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QuerySpendableBalancesResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQuerySpendableBalancesResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.balances.push(Coin.decode(reader, reader.uint32())); - break; + message.balances.push(Coin.decode(reader, reader.uint32())) + break case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; + message.pagination = PageResponse.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QuerySpendableBalancesResponse { return { - balances: Array.isArray(object?.balances) ? object.balances.map((e: any) => Coin.fromJSON(e)) : [], - pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, - }; + balances: Array.isArray(object?.balances) + ? object.balances.map((e: any) => Coin.fromJSON(e)) + : [], + pagination: isSet(object.pagination) + ? PageResponse.fromJSON(object.pagination) + : undefined, + } }, toJSON(message: QuerySpendableBalancesResponse): unknown { - const obj: any = {}; + const obj: any = {} if (message.balances) { - obj.balances = message.balances.map((e) => e ? Coin.toJSON(e) : undefined); + obj.balances = message.balances.map((e) => (e ? Coin.toJSON(e) : undefined)) } else { - obj.balances = []; + obj.balances = [] } message.pagination !== undefined && - (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); - return obj; + (obj.pagination = message.pagination + ? PageResponse.toJSON(message.pagination) + : undefined) + return obj }, fromPartial, I>>( object: I, ): QuerySpendableBalancesResponse { - const message = createBaseQuerySpendableBalancesResponse(); - message.balances = object.balances?.map((e) => Coin.fromPartial(e)) || []; - message.pagination = (object.pagination !== undefined && object.pagination !== null) - ? PageResponse.fromPartial(object.pagination) - : undefined; - return message; + const message = createBaseQuerySpendableBalancesResponse() + message.balances = object.balances?.map((e) => Coin.fromPartial(e)) || [] + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageResponse.fromPartial(object.pagination) + : undefined + return message }, -}; +} function createBaseQueryTotalSupplyRequest(): QueryTotalSupplyRequest { - return { pagination: undefined }; + return { pagination: undefined } } export const QueryTotalSupplyRequest = { - encode(message: QueryTotalSupplyRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryTotalSupplyRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryTotalSupplyRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryTotalSupplyRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryTotalSupplyRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; + message.pagination = PageRequest.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryTotalSupplyRequest { - return { pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined }; + return { + pagination: isSet(object.pagination) + ? PageRequest.fromJSON(object.pagination) + : undefined, + } }, toJSON(message: QueryTotalSupplyRequest): unknown { - const obj: any = {}; + const obj: any = {} message.pagination !== undefined && - (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); - return obj; + (obj.pagination = message.pagination + ? PageRequest.toJSON(message.pagination) + : undefined) + return obj }, - fromPartial, I>>(object: I): QueryTotalSupplyRequest { - const message = createBaseQueryTotalSupplyRequest(); - message.pagination = (object.pagination !== undefined && object.pagination !== null) - ? PageRequest.fromPartial(object.pagination) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): QueryTotalSupplyRequest { + const message = createBaseQueryTotalSupplyRequest() + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageRequest.fromPartial(object.pagination) + : undefined + return message }, -}; +} function createBaseQueryTotalSupplyResponse(): QueryTotalSupplyResponse { - return { supply: [], pagination: undefined }; + return { supply: [], pagination: undefined } } export const QueryTotalSupplyResponse = { - encode(message: QueryTotalSupplyResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryTotalSupplyResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { for (const v of message.supply) { - Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + Coin.encode(v!, writer.uint32(10).fork()).ldelim() } if (message.pagination !== undefined) { - PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryTotalSupplyResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryTotalSupplyResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryTotalSupplyResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.supply.push(Coin.decode(reader, reader.uint32())); - break; + message.supply.push(Coin.decode(reader, reader.uint32())) + break case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; + message.pagination = PageResponse.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryTotalSupplyResponse { return { - supply: Array.isArray(object?.supply) ? object.supply.map((e: any) => Coin.fromJSON(e)) : [], - pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, - }; + supply: Array.isArray(object?.supply) + ? object.supply.map((e: any) => Coin.fromJSON(e)) + : [], + pagination: isSet(object.pagination) + ? PageResponse.fromJSON(object.pagination) + : undefined, + } }, toJSON(message: QueryTotalSupplyResponse): unknown { - const obj: any = {}; + const obj: any = {} if (message.supply) { - obj.supply = message.supply.map((e) => e ? Coin.toJSON(e) : undefined); + obj.supply = message.supply.map((e) => (e ? Coin.toJSON(e) : undefined)) } else { - obj.supply = []; + obj.supply = [] } message.pagination !== undefined && - (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); - return obj; + (obj.pagination = message.pagination + ? PageResponse.toJSON(message.pagination) + : undefined) + return obj }, - fromPartial, I>>(object: I): QueryTotalSupplyResponse { - const message = createBaseQueryTotalSupplyResponse(); - message.supply = object.supply?.map((e) => Coin.fromPartial(e)) || []; - message.pagination = (object.pagination !== undefined && object.pagination !== null) - ? PageResponse.fromPartial(object.pagination) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): QueryTotalSupplyResponse { + const message = createBaseQueryTotalSupplyResponse() + message.supply = object.supply?.map((e) => Coin.fromPartial(e)) || [] + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageResponse.fromPartial(object.pagination) + : undefined + return message }, -}; +} function createBaseQuerySupplyOfRequest(): QuerySupplyOfRequest { - return { denom: "" }; + return { denom: "" } } export const QuerySupplyOfRequest = { - encode(message: QuerySupplyOfRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QuerySupplyOfRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.denom !== "") { - writer.uint32(10).string(message.denom); + writer.uint32(10).string(message.denom) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QuerySupplyOfRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQuerySupplyOfRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQuerySupplyOfRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.denom = reader.string(); - break; + message.denom = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QuerySupplyOfRequest { - return { denom: isSet(object.denom) ? String(object.denom) : "" }; + return { + denom: isSet(object.denom) ? String(object.denom) : "", + } }, toJSON(message: QuerySupplyOfRequest): unknown { - const obj: any = {}; - message.denom !== undefined && (obj.denom = message.denom); - return obj; + const obj: any = {} + message.denom !== undefined && (obj.denom = message.denom) + return obj }, - fromPartial, I>>(object: I): QuerySupplyOfRequest { - const message = createBaseQuerySupplyOfRequest(); - message.denom = object.denom ?? ""; - return message; + fromPartial, I>>( + object: I, + ): QuerySupplyOfRequest { + const message = createBaseQuerySupplyOfRequest() + message.denom = object.denom ?? "" + return message }, -}; +} function createBaseQuerySupplyOfResponse(): QuerySupplyOfResponse { - return { amount: undefined }; + return { amount: undefined } } export const QuerySupplyOfResponse = { - encode(message: QuerySupplyOfResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QuerySupplyOfResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.amount !== undefined) { - Coin.encode(message.amount, writer.uint32(10).fork()).ldelim(); + Coin.encode(message.amount, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QuerySupplyOfResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQuerySupplyOfResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQuerySupplyOfResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.amount = Coin.decode(reader, reader.uint32()); - break; + message.amount = Coin.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QuerySupplyOfResponse { - return { amount: isSet(object.amount) ? Coin.fromJSON(object.amount) : undefined }; + return { + amount: isSet(object.amount) ? Coin.fromJSON(object.amount) : undefined, + } }, toJSON(message: QuerySupplyOfResponse): unknown { - const obj: any = {}; - message.amount !== undefined && (obj.amount = message.amount ? Coin.toJSON(message.amount) : undefined); - return obj; + const obj: any = {} + message.amount !== undefined && + (obj.amount = message.amount ? Coin.toJSON(message.amount) : undefined) + return obj }, - fromPartial, I>>(object: I): QuerySupplyOfResponse { - const message = createBaseQuerySupplyOfResponse(); - message.amount = (object.amount !== undefined && object.amount !== null) - ? Coin.fromPartial(object.amount) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): QuerySupplyOfResponse { + const message = createBaseQuerySupplyOfResponse() + message.amount = + object.amount !== undefined && object.amount !== null + ? Coin.fromPartial(object.amount) + : undefined + return message }, -}; +} function createBaseQueryParamsRequest(): QueryParamsRequest { - return {}; + return {} } export const QueryParamsRequest = { encode(_: QueryParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryParamsRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryParamsRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(_: any): QueryParamsRequest { - return {}; + return {} }, toJSON(_: QueryParamsRequest): unknown { - const obj: any = {}; - return obj; + const obj: any = {} + return obj }, - fromPartial, I>>(_: I): QueryParamsRequest { - const message = createBaseQueryParamsRequest(); - return message; + fromPartial, I>>( + _: I, + ): QueryParamsRequest { + const message = createBaseQueryParamsRequest() + return message }, -}; +} function createBaseQueryParamsResponse(): QueryParamsResponse { - return { params: undefined }; + return { params: undefined } } export const QueryParamsResponse = { - encode(message: QueryParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryParamsResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.params !== undefined) { - Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + Params.encode(message.params, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryParamsResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryParamsResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.params = Params.decode(reader, reader.uint32()); - break; + message.params = Params.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryParamsResponse { - return { params: isSet(object.params) ? Params.fromJSON(object.params) : undefined }; + return { + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined, + } }, toJSON(message: QueryParamsResponse): unknown { - const obj: any = {}; - message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); - return obj; + const obj: any = {} + message.params !== undefined && + (obj.params = message.params ? Params.toJSON(message.params) : undefined) + return obj }, - fromPartial, I>>(object: I): QueryParamsResponse { - const message = createBaseQueryParamsResponse(); - message.params = (object.params !== undefined && object.params !== null) - ? Params.fromPartial(object.params) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): QueryParamsResponse { + const message = createBaseQueryParamsResponse() + message.params = + object.params !== undefined && object.params !== null + ? Params.fromPartial(object.params) + : undefined + return message }, -}; +} function createBaseQueryDenomsMetadataRequest(): QueryDenomsMetadataRequest { - return { pagination: undefined }; + return { pagination: undefined } } export const QueryDenomsMetadataRequest = { - encode(message: QueryDenomsMetadataRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryDenomsMetadataRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryDenomsMetadataRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryDenomsMetadataRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryDenomsMetadataRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; + message.pagination = PageRequest.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryDenomsMetadataRequest { - return { pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined }; + return { + pagination: isSet(object.pagination) + ? PageRequest.fromJSON(object.pagination) + : undefined, + } }, toJSON(message: QueryDenomsMetadataRequest): unknown { - const obj: any = {}; + const obj: any = {} message.pagination !== undefined && - (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); - return obj; + (obj.pagination = message.pagination + ? PageRequest.toJSON(message.pagination) + : undefined) + return obj }, - fromPartial, I>>(object: I): QueryDenomsMetadataRequest { - const message = createBaseQueryDenomsMetadataRequest(); - message.pagination = (object.pagination !== undefined && object.pagination !== null) - ? PageRequest.fromPartial(object.pagination) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): QueryDenomsMetadataRequest { + const message = createBaseQueryDenomsMetadataRequest() + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageRequest.fromPartial(object.pagination) + : undefined + return message }, -}; +} function createBaseQueryDenomsMetadataResponse(): QueryDenomsMetadataResponse { - return { metadatas: [], pagination: undefined }; + return { metadatas: [], pagination: undefined } } export const QueryDenomsMetadataResponse = { - encode(message: QueryDenomsMetadataResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryDenomsMetadataResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { for (const v of message.metadatas) { - Metadata.encode(v!, writer.uint32(10).fork()).ldelim(); + Metadata.encode(v!, writer.uint32(10).fork()).ldelim() } if (message.pagination !== undefined) { - PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryDenomsMetadataResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryDenomsMetadataResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryDenomsMetadataResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.metadatas.push(Metadata.decode(reader, reader.uint32())); - break; + message.metadatas.push(Metadata.decode(reader, reader.uint32())) + break case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; + message.pagination = PageResponse.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryDenomsMetadataResponse { return { - metadatas: Array.isArray(object?.metadatas) ? object.metadatas.map((e: any) => Metadata.fromJSON(e)) : [], - pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, - }; + metadatas: Array.isArray(object?.metadatas) + ? object.metadatas.map((e: any) => Metadata.fromJSON(e)) + : [], + pagination: isSet(object.pagination) + ? PageResponse.fromJSON(object.pagination) + : undefined, + } }, toJSON(message: QueryDenomsMetadataResponse): unknown { - const obj: any = {}; + const obj: any = {} if (message.metadatas) { - obj.metadatas = message.metadatas.map((e) => e ? Metadata.toJSON(e) : undefined); + obj.metadatas = message.metadatas.map((e) => (e ? Metadata.toJSON(e) : undefined)) } else { - obj.metadatas = []; + obj.metadatas = [] } message.pagination !== undefined && - (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); - return obj; + (obj.pagination = message.pagination + ? PageResponse.toJSON(message.pagination) + : undefined) + return obj }, - fromPartial, I>>(object: I): QueryDenomsMetadataResponse { - const message = createBaseQueryDenomsMetadataResponse(); - message.metadatas = object.metadatas?.map((e) => Metadata.fromPartial(e)) || []; - message.pagination = (object.pagination !== undefined && object.pagination !== null) - ? PageResponse.fromPartial(object.pagination) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): QueryDenomsMetadataResponse { + const message = createBaseQueryDenomsMetadataResponse() + message.metadatas = object.metadatas?.map((e) => Metadata.fromPartial(e)) || [] + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageResponse.fromPartial(object.pagination) + : undefined + return message }, -}; +} function createBaseQueryDenomMetadataRequest(): QueryDenomMetadataRequest { - return { denom: "" }; + return { denom: "" } } export const QueryDenomMetadataRequest = { - encode(message: QueryDenomMetadataRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryDenomMetadataRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.denom !== "") { - writer.uint32(10).string(message.denom); + writer.uint32(10).string(message.denom) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryDenomMetadataRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryDenomMetadataRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryDenomMetadataRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.denom = reader.string(); - break; + message.denom = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryDenomMetadataRequest { - return { denom: isSet(object.denom) ? String(object.denom) : "" }; + return { + denom: isSet(object.denom) ? String(object.denom) : "", + } }, toJSON(message: QueryDenomMetadataRequest): unknown { - const obj: any = {}; - message.denom !== undefined && (obj.denom = message.denom); - return obj; + const obj: any = {} + message.denom !== undefined && (obj.denom = message.denom) + return obj }, - fromPartial, I>>(object: I): QueryDenomMetadataRequest { - const message = createBaseQueryDenomMetadataRequest(); - message.denom = object.denom ?? ""; - return message; + fromPartial, I>>( + object: I, + ): QueryDenomMetadataRequest { + const message = createBaseQueryDenomMetadataRequest() + message.denom = object.denom ?? "" + return message }, -}; +} function createBaseQueryDenomMetadataResponse(): QueryDenomMetadataResponse { - return { metadata: undefined }; + return { metadata: undefined } } export const QueryDenomMetadataResponse = { - encode(message: QueryDenomMetadataResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryDenomMetadataResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.metadata !== undefined) { - Metadata.encode(message.metadata, writer.uint32(10).fork()).ldelim(); + Metadata.encode(message.metadata, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryDenomMetadataResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryDenomMetadataResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryDenomMetadataResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.metadata = Metadata.decode(reader, reader.uint32()); - break; + message.metadata = Metadata.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryDenomMetadataResponse { - return { metadata: isSet(object.metadata) ? Metadata.fromJSON(object.metadata) : undefined }; + return { + metadata: isSet(object.metadata) ? Metadata.fromJSON(object.metadata) : undefined, + } }, toJSON(message: QueryDenomMetadataResponse): unknown { - const obj: any = {}; - message.metadata !== undefined && (obj.metadata = message.metadata ? Metadata.toJSON(message.metadata) : undefined); - return obj; + const obj: any = {} + message.metadata !== undefined && + (obj.metadata = message.metadata ? Metadata.toJSON(message.metadata) : undefined) + return obj }, - fromPartial, I>>(object: I): QueryDenomMetadataResponse { - const message = createBaseQueryDenomMetadataResponse(); - message.metadata = (object.metadata !== undefined && object.metadata !== null) - ? Metadata.fromPartial(object.metadata) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): QueryDenomMetadataResponse { + const message = createBaseQueryDenomMetadataResponse() + message.metadata = + object.metadata !== undefined && object.metadata !== null + ? Metadata.fromPartial(object.metadata) + : undefined + return message }, -}; +} /** Query defines the gRPC querier service. */ export interface Query { /** Balance queries the balance of a single coin for a single account. */ - Balance(request: QueryBalanceRequest): Promise; + Balance(request: QueryBalanceRequest): Promise /** AllBalances queries the balance of all coins for a single account. */ - AllBalances(request: QueryAllBalancesRequest): Promise; + AllBalances(request: QueryAllBalancesRequest): Promise /** * SpendableBalances queries the spenable balance of all coins for a single * account. */ - SpendableBalances(request: QuerySpendableBalancesRequest): Promise; + SpendableBalances( + request: QuerySpendableBalancesRequest, + ): Promise /** TotalSupply queries the total supply of all coins. */ - TotalSupply(request: QueryTotalSupplyRequest): Promise; + TotalSupply(request: QueryTotalSupplyRequest): Promise /** SupplyOf queries the supply of a single coin. */ - SupplyOf(request: QuerySupplyOfRequest): Promise; + SupplyOf(request: QuerySupplyOfRequest): Promise /** Params queries the parameters of x/bank module. */ - Params(request: QueryParamsRequest): Promise; + Params(request: QueryParamsRequest): Promise /** DenomsMetadata queries the client metadata of a given coin denomination. */ - DenomMetadata(request: QueryDenomMetadataRequest): Promise; + DenomMetadata(request: QueryDenomMetadataRequest): Promise /** DenomsMetadata queries the client metadata for all registered coin denominations. */ - DenomsMetadata(request: QueryDenomsMetadataRequest): Promise; + DenomsMetadata( + request: QueryDenomsMetadataRequest, + ): Promise } export class QueryClientImpl implements Query { - private readonly rpc: Rpc; + private readonly rpc: Rpc constructor(rpc: Rpc) { - this.rpc = rpc; - this.Balance = this.Balance.bind(this); - this.AllBalances = this.AllBalances.bind(this); - this.SpendableBalances = this.SpendableBalances.bind(this); - this.TotalSupply = this.TotalSupply.bind(this); - this.SupplyOf = this.SupplyOf.bind(this); - this.Params = this.Params.bind(this); - this.DenomMetadata = this.DenomMetadata.bind(this); - this.DenomsMetadata = this.DenomsMetadata.bind(this); + this.rpc = rpc + this.Balance = this.Balance.bind(this) + this.AllBalances = this.AllBalances.bind(this) + this.SpendableBalances = this.SpendableBalances.bind(this) + this.TotalSupply = this.TotalSupply.bind(this) + this.SupplyOf = this.SupplyOf.bind(this) + this.Params = this.Params.bind(this) + this.DenomMetadata = this.DenomMetadata.bind(this) + this.DenomsMetadata = this.DenomsMetadata.bind(this) } Balance(request: QueryBalanceRequest): Promise { - const data = QueryBalanceRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "Balance", data); - return promise.then((data) => QueryBalanceResponse.decode(new _m0.Reader(data))); + const data = QueryBalanceRequest.encode(request).finish() + const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "Balance", data) + return promise.then((data) => QueryBalanceResponse.decode(new _m0.Reader(data))) } AllBalances(request: QueryAllBalancesRequest): Promise { - const data = QueryAllBalancesRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "AllBalances", data); - return promise.then((data) => QueryAllBalancesResponse.decode(new _m0.Reader(data))); + const data = QueryAllBalancesRequest.encode(request).finish() + const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "AllBalances", data) + return promise.then((data) => QueryAllBalancesResponse.decode(new _m0.Reader(data))) } - SpendableBalances(request: QuerySpendableBalancesRequest): Promise { - const data = QuerySpendableBalancesRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "SpendableBalances", data); - return promise.then((data) => QuerySpendableBalancesResponse.decode(new _m0.Reader(data))); + SpendableBalances( + request: QuerySpendableBalancesRequest, + ): Promise { + const data = QuerySpendableBalancesRequest.encode(request).finish() + const promise = this.rpc.request( + "cosmos.bank.v1beta1.Query", + "SpendableBalances", + data, + ) + return promise.then((data) => + QuerySpendableBalancesResponse.decode(new _m0.Reader(data)), + ) } TotalSupply(request: QueryTotalSupplyRequest): Promise { - const data = QueryTotalSupplyRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "TotalSupply", data); - return promise.then((data) => QueryTotalSupplyResponse.decode(new _m0.Reader(data))); + const data = QueryTotalSupplyRequest.encode(request).finish() + const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "TotalSupply", data) + return promise.then((data) => QueryTotalSupplyResponse.decode(new _m0.Reader(data))) } SupplyOf(request: QuerySupplyOfRequest): Promise { - const data = QuerySupplyOfRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "SupplyOf", data); - return promise.then((data) => QuerySupplyOfResponse.decode(new _m0.Reader(data))); + const data = QuerySupplyOfRequest.encode(request).finish() + const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "SupplyOf", data) + return promise.then((data) => QuerySupplyOfResponse.decode(new _m0.Reader(data))) } Params(request: QueryParamsRequest): Promise { - const data = QueryParamsRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "Params", data); - return promise.then((data) => QueryParamsResponse.decode(new _m0.Reader(data))); + const data = QueryParamsRequest.encode(request).finish() + const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "Params", data) + return promise.then((data) => QueryParamsResponse.decode(new _m0.Reader(data))) } - DenomMetadata(request: QueryDenomMetadataRequest): Promise { - const data = QueryDenomMetadataRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "DenomMetadata", data); - return promise.then((data) => QueryDenomMetadataResponse.decode(new _m0.Reader(data))); + DenomMetadata( + request: QueryDenomMetadataRequest, + ): Promise { + const data = QueryDenomMetadataRequest.encode(request).finish() + const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "DenomMetadata", data) + return promise.then((data) => + QueryDenomMetadataResponse.decode(new _m0.Reader(data)), + ) } - DenomsMetadata(request: QueryDenomsMetadataRequest): Promise { - const data = QueryDenomsMetadataRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "DenomsMetadata", data); - return promise.then((data) => QueryDenomsMetadataResponse.decode(new _m0.Reader(data))); + DenomsMetadata( + request: QueryDenomsMetadataRequest, + ): Promise { + const data = QueryDenomsMetadataRequest.encode(request).finish() + const promise = this.rpc.request( + "cosmos.bank.v1beta1.Query", + "DenomsMetadata", + data, + ) + return promise.then((data) => + QueryDenomsMetadataResponse.decode(new _m0.Reader(data)), + ) } } interface Rpc { - request(service: string, method: string, data: Uint8Array): Promise; + request(service: string, method: string, data: Uint8Array): Promise } -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/cosmos/bank/v1beta1/tx.ts b/packages/protojs/src/cosmos/bank/v1beta1/tx.ts index 59e5b3c1..adb4e6bd 100644 --- a/packages/protojs/src/cosmos/bank/v1beta1/tx.ts +++ b/packages/protojs/src/cosmos/bank/v1beta1/tx.ts @@ -1,296 +1,315 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { Coin } from "../../base/v1beta1/coin"; -import { Input, Output } from "./bank"; +import Long from "long" +import { Coin } from "../../base/v1beta1/coin" +import { Input, Output } from "./bank" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "cosmos.bank.v1beta1"; +export const protobufPackage = "cosmos.bank.v1beta1" /** MsgSend represents a message to send coins from one account to another. */ export interface MsgSend { - fromAddress: string; - toAddress: string; - amount: Coin[]; + fromAddress: string + toAddress: string + amount: Coin[] } /** MsgSendResponse defines the Msg/Send response type. */ -export interface MsgSendResponse { -} +export interface MsgSendResponse {} /** MsgMultiSend represents an arbitrary multi-in, multi-out send message. */ export interface MsgMultiSend { - inputs: Input[]; - outputs: Output[]; + inputs: Input[] + outputs: Output[] } /** MsgMultiSendResponse defines the Msg/MultiSend response type. */ -export interface MsgMultiSendResponse { -} +export interface MsgMultiSendResponse {} function createBaseMsgSend(): MsgSend { - return { fromAddress: "", toAddress: "", amount: [] }; + return { fromAddress: "", toAddress: "", amount: [] } } export const MsgSend = { encode(message: MsgSend, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.fromAddress !== "") { - writer.uint32(10).string(message.fromAddress); + writer.uint32(10).string(message.fromAddress) } if (message.toAddress !== "") { - writer.uint32(18).string(message.toAddress); + writer.uint32(18).string(message.toAddress) } for (const v of message.amount) { - Coin.encode(v!, writer.uint32(26).fork()).ldelim(); + Coin.encode(v!, writer.uint32(26).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MsgSend { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgSend(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgSend() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.fromAddress = reader.string(); - break; + message.fromAddress = reader.string() + break case 2: - message.toAddress = reader.string(); - break; + message.toAddress = reader.string() + break case 3: - message.amount.push(Coin.decode(reader, reader.uint32())); - break; + message.amount.push(Coin.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): MsgSend { return { fromAddress: isSet(object.fromAddress) ? String(object.fromAddress) : "", toAddress: isSet(object.toAddress) ? String(object.toAddress) : "", - amount: Array.isArray(object?.amount) ? object.amount.map((e: any) => Coin.fromJSON(e)) : [], - }; + amount: Array.isArray(object?.amount) + ? object.amount.map((e: any) => Coin.fromJSON(e)) + : [], + } }, toJSON(message: MsgSend): unknown { - const obj: any = {}; - message.fromAddress !== undefined && (obj.fromAddress = message.fromAddress); - message.toAddress !== undefined && (obj.toAddress = message.toAddress); + 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); + obj.amount = message.amount.map((e) => (e ? Coin.toJSON(e) : undefined)) } else { - obj.amount = []; + obj.amount = [] } - return obj; + return obj }, fromPartial, I>>(object: I): MsgSend { - const message = createBaseMsgSend(); - message.fromAddress = object.fromAddress ?? ""; - message.toAddress = object.toAddress ?? ""; - message.amount = object.amount?.map((e) => Coin.fromPartial(e)) || []; - return message; + const message = createBaseMsgSend() + message.fromAddress = object.fromAddress ?? "" + message.toAddress = object.toAddress ?? "" + message.amount = object.amount?.map((e) => Coin.fromPartial(e)) || [] + return message }, -}; +} function createBaseMsgSendResponse(): MsgSendResponse { - return {}; + return {} } export const MsgSendResponse = { encode(_: MsgSendResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MsgSendResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgSendResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgSendResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(_: any): MsgSendResponse { - return {}; + return {} }, toJSON(_: MsgSendResponse): unknown { - const obj: any = {}; - return obj; + const obj: any = {} + return obj }, fromPartial, I>>(_: I): MsgSendResponse { - const message = createBaseMsgSendResponse(); - return message; + const message = createBaseMsgSendResponse() + return message }, -}; +} function createBaseMsgMultiSend(): MsgMultiSend { - return { inputs: [], outputs: [] }; + return { inputs: [], outputs: [] } } export const MsgMultiSend = { encode(message: MsgMultiSend, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.inputs) { - Input.encode(v!, writer.uint32(10).fork()).ldelim(); + Input.encode(v!, writer.uint32(10).fork()).ldelim() } for (const v of message.outputs) { - Output.encode(v!, writer.uint32(18).fork()).ldelim(); + Output.encode(v!, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MsgMultiSend { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgMultiSend(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgMultiSend() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.inputs.push(Input.decode(reader, reader.uint32())); - break; + message.inputs.push(Input.decode(reader, reader.uint32())) + break case 2: - message.outputs.push(Output.decode(reader, reader.uint32())); - break; + message.outputs.push(Output.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): MsgMultiSend { return { - inputs: Array.isArray(object?.inputs) ? object.inputs.map((e: any) => Input.fromJSON(e)) : [], - outputs: Array.isArray(object?.outputs) ? object.outputs.map((e: any) => Output.fromJSON(e)) : [], - }; + inputs: Array.isArray(object?.inputs) + ? object.inputs.map((e: any) => Input.fromJSON(e)) + : [], + outputs: Array.isArray(object?.outputs) + ? object.outputs.map((e: any) => Output.fromJSON(e)) + : [], + } }, toJSON(message: MsgMultiSend): unknown { - const obj: any = {}; + const obj: any = {} if (message.inputs) { - obj.inputs = message.inputs.map((e) => e ? Input.toJSON(e) : undefined); + obj.inputs = message.inputs.map((e) => (e ? Input.toJSON(e) : undefined)) } else { - obj.inputs = []; + obj.inputs = [] } if (message.outputs) { - obj.outputs = message.outputs.map((e) => e ? Output.toJSON(e) : undefined); + obj.outputs = message.outputs.map((e) => (e ? Output.toJSON(e) : undefined)) } else { - obj.outputs = []; + obj.outputs = [] } - return obj; + return obj }, fromPartial, I>>(object: I): MsgMultiSend { - const message = createBaseMsgMultiSend(); - message.inputs = object.inputs?.map((e) => Input.fromPartial(e)) || []; - message.outputs = object.outputs?.map((e) => Output.fromPartial(e)) || []; - return message; + const message = createBaseMsgMultiSend() + message.inputs = object.inputs?.map((e) => Input.fromPartial(e)) || [] + message.outputs = object.outputs?.map((e) => Output.fromPartial(e)) || [] + return message }, -}; +} function createBaseMsgMultiSendResponse(): MsgMultiSendResponse { - return {}; + return {} } export const MsgMultiSendResponse = { - encode(_: MsgMultiSendResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; + encode( + _: MsgMultiSendResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MsgMultiSendResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgMultiSendResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgMultiSendResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(_: any): MsgMultiSendResponse { - return {}; + return {} }, toJSON(_: MsgMultiSendResponse): unknown { - const obj: any = {}; - return obj; + const obj: any = {} + return obj }, - fromPartial, I>>(_: I): MsgMultiSendResponse { - const message = createBaseMsgMultiSendResponse(); - return message; + fromPartial, I>>( + _: I, + ): MsgMultiSendResponse { + const message = createBaseMsgMultiSendResponse() + return message }, -}; +} /** 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; + Send(request: MsgSend): Promise /** MultiSend defines a method for sending coins from some accounts to other accounts. */ - MultiSend(request: MsgMultiSend): Promise; + MultiSend(request: MsgMultiSend): Promise } export class MsgClientImpl implements Msg { - private readonly rpc: Rpc; + private readonly rpc: Rpc constructor(rpc: Rpc) { - this.rpc = rpc; - this.Send = this.Send.bind(this); - this.MultiSend = this.MultiSend.bind(this); + this.rpc = rpc + this.Send = this.Send.bind(this) + this.MultiSend = this.MultiSend.bind(this) } 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 _m0.Reader(data))); + const data = MsgSend.encode(request).finish() + const promise = this.rpc.request("cosmos.bank.v1beta1.Msg", "Send", data) + return promise.then((data) => MsgSendResponse.decode(new _m0.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 _m0.Reader(data))); + const data = MsgMultiSend.encode(request).finish() + const promise = this.rpc.request("cosmos.bank.v1beta1.Msg", "MultiSend", data) + return promise.then((data) => MsgMultiSendResponse.decode(new _m0.Reader(data))) } } interface Rpc { - request(service: string, method: string, data: Uint8Array): Promise; + request(service: string, method: string, data: Uint8Array): Promise } -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/cosmos/base/abci/v1beta1/abci.ts b/packages/protojs/src/cosmos/base/abci/v1beta1/abci.ts index e0ea93a4..0258f721 100644 --- a/packages/protojs/src/cosmos/base/abci/v1beta1/abci.ts +++ b/packages/protojs/src/cosmos/base/abci/v1beta1/abci.ts @@ -1,10 +1,10 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { Any } from "../../../../google/protobuf/any"; -import { Event } from "../../../../tendermint/abci/types"; +import { Any } from "../../../../google/protobuf/any" +import Long from "long" +import { Event } from "../../../../tendermint/abci/types" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "cosmos.base.abci.v1beta1"; +export const protobufPackage = "cosmos.base.abci.v1beta1" /** * TxResponse defines a structure containing relevant tx data and metadata. The @@ -12,36 +12,36 @@ export const protobufPackage = "cosmos.base.abci.v1beta1"; */ export interface TxResponse { /** The block height */ - height: Long; + height: Long /** The transaction hash. */ - txhash: string; + txhash: string /** Namespace for the Code */ - codespace: string; + codespace: string /** Response code. */ - code: number; + code: number /** Result bytes, if any. */ - data: string; + data: string /** * The output of the application's logger (raw string). May be * non-deterministic. */ - rawLog: string; + rawLog: string /** The output of the application's logger (typed). May be non-deterministic. */ - logs: ABCIMessageLog[]; + logs: ABCIMessageLog[] /** Additional information. May be non-deterministic. */ - info: string; + info: string /** Amount of gas requested for transaction. */ - gasWanted: Long; + gasWanted: Long /** Amount of gas consumed by transaction. */ - gasUsed: Long; + gasUsed: Long /** The request transaction bytes. */ - tx?: Any; + tx?: Any /** * Time of the previous block. For heights > 1, it's the weighted median of * the timestamps of the valid votes in the block.LastCommit. For height == 1, * it's genesis time. */ - timestamp: string; + timestamp: string /** * Events defines all the events emitted by processing a transaction. Note, * these events include those emitted by processing all the messages and those @@ -50,18 +50,18 @@ export interface TxResponse { * * Since: cosmos-sdk 0.42.11, 0.44.5, 0.45 */ - events: Event[]; + events: Event[] } /** ABCIMessageLog defines a structure containing an indexed tx ABCI message log. */ export interface ABCIMessageLog { - msgIndex: number; - log: string; + msgIndex: number + log: string /** * Events contains a slice of Event objects that were emitted during some * execution. */ - events: StringEvent[]; + events: StringEvent[] } /** @@ -69,8 +69,8 @@ export interface ABCIMessageLog { * contain key/value pairs that are strings instead of raw bytes. */ export interface StringEvent { - type: string; - attributes: Attribute[]; + type: string + attributes: Attribute[] } /** @@ -78,16 +78,16 @@ export interface StringEvent { * strings instead of raw bytes. */ export interface Attribute { - key: string; - value: string; + key: string + value: string } /** GasInfo defines tx execution gas context. */ export interface GasInfo { /** GasWanted is the maximum units of work we allow this tx to perform. */ - gasWanted: Long; + gasWanted: Long /** GasUsed is the amount of gas actually consumed. */ - gasUsed: Long; + gasUsed: Long } /** Result is the union of ResponseFormat and ResponseCheckTx. */ @@ -96,14 +96,14 @@ export interface Result { * Data is any data returned from message or handler execution. It MUST be * length prefixed in order to separate data from multiple message executions. */ - data: Uint8Array; + data: Uint8Array /** Log contains the log information from message or handler execution. */ - log: string; + log: string /** * Events contains a slice of Event objects that were emitted during message * or handler execution. */ - events: Event[]; + events: Event[] } /** @@ -111,8 +111,8 @@ export interface Result { * successfully simulated. */ export interface SimulationResponse { - gasInfo?: GasInfo; - result?: Result; + gasInfo?: GasInfo + result?: Result } /** @@ -120,8 +120,8 @@ export interface SimulationResponse { * execution. */ export interface MsgData { - msgType: string; - data: Uint8Array; + msgType: string + data: Uint8Array } /** @@ -129,23 +129,23 @@ export interface MsgData { * for each message. */ export interface TxMsgData { - data: MsgData[]; + data: MsgData[] } /** SearchTxsResult defines a structure for querying txs pageable */ export interface SearchTxsResult { /** Count of all txs */ - totalCount: Long; + totalCount: Long /** Count of txs in current page */ - count: Long; + count: Long /** Index of current page, start from 1 */ - pageNumber: Long; + pageNumber: Long /** Count of total pages */ - pageTotal: Long; + pageTotal: Long /** Max count txs per page */ - limit: Long; + limit: Long /** List of txs in current page */ - txs: TxResponse[]; + txs: TxResponse[] } function createBaseTxResponse(): TxResponse { @@ -163,105 +163,105 @@ function createBaseTxResponse(): TxResponse { tx: undefined, timestamp: "", events: [], - }; + } } export const TxResponse = { encode(message: TxResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (!message.height.isZero()) { - writer.uint32(8).int64(message.height); + writer.uint32(8).int64(message.height) } if (message.txhash !== "") { - writer.uint32(18).string(message.txhash); + writer.uint32(18).string(message.txhash) } if (message.codespace !== "") { - writer.uint32(26).string(message.codespace); + writer.uint32(26).string(message.codespace) } if (message.code !== 0) { - writer.uint32(32).uint32(message.code); + writer.uint32(32).uint32(message.code) } if (message.data !== "") { - writer.uint32(42).string(message.data); + writer.uint32(42).string(message.data) } if (message.rawLog !== "") { - writer.uint32(50).string(message.rawLog); + writer.uint32(50).string(message.rawLog) } for (const v of message.logs) { - ABCIMessageLog.encode(v!, writer.uint32(58).fork()).ldelim(); + ABCIMessageLog.encode(v!, writer.uint32(58).fork()).ldelim() } if (message.info !== "") { - writer.uint32(66).string(message.info); + writer.uint32(66).string(message.info) } if (!message.gasWanted.isZero()) { - writer.uint32(72).int64(message.gasWanted); + writer.uint32(72).int64(message.gasWanted) } if (!message.gasUsed.isZero()) { - writer.uint32(80).int64(message.gasUsed); + writer.uint32(80).int64(message.gasUsed) } if (message.tx !== undefined) { - Any.encode(message.tx, writer.uint32(90).fork()).ldelim(); + Any.encode(message.tx, writer.uint32(90).fork()).ldelim() } if (message.timestamp !== "") { - writer.uint32(98).string(message.timestamp); + writer.uint32(98).string(message.timestamp) } for (const v of message.events) { - Event.encode(v!, writer.uint32(106).fork()).ldelim(); + Event.encode(v!, writer.uint32(106).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): TxResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseTxResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseTxResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.height = reader.int64() as Long; - break; + message.height = reader.int64() as Long + break case 2: - message.txhash = reader.string(); - break; + message.txhash = reader.string() + break case 3: - message.codespace = reader.string(); - break; + message.codespace = reader.string() + break case 4: - message.code = reader.uint32(); - break; + message.code = reader.uint32() + break case 5: - message.data = reader.string(); - break; + message.data = reader.string() + break case 6: - message.rawLog = reader.string(); - break; + message.rawLog = reader.string() + break case 7: - message.logs.push(ABCIMessageLog.decode(reader, reader.uint32())); - break; + message.logs.push(ABCIMessageLog.decode(reader, reader.uint32())) + break case 8: - message.info = reader.string(); - break; + message.info = reader.string() + break case 9: - message.gasWanted = reader.int64() as Long; - break; + message.gasWanted = reader.int64() as Long + break case 10: - message.gasUsed = reader.int64() as Long; - break; + message.gasUsed = reader.int64() as Long + break case 11: - message.tx = Any.decode(reader, reader.uint32()); - break; + message.tx = Any.decode(reader, reader.uint32()) + break case 12: - message.timestamp = reader.string(); - break; + message.timestamp = reader.string() + break case 13: - message.events.push(Event.decode(reader, reader.uint32())); - break; + message.events.push(Event.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): TxResponse { @@ -272,560 +272,613 @@ export const TxResponse = { code: isSet(object.code) ? Number(object.code) : 0, data: isSet(object.data) ? String(object.data) : "", rawLog: isSet(object.rawLog) ? String(object.rawLog) : "", - logs: Array.isArray(object?.logs) ? object.logs.map((e: any) => ABCIMessageLog.fromJSON(e)) : [], + logs: Array.isArray(object?.logs) + ? object.logs.map((e: any) => ABCIMessageLog.fromJSON(e)) + : [], info: isSet(object.info) ? String(object.info) : "", gasWanted: isSet(object.gasWanted) ? Long.fromValue(object.gasWanted) : Long.ZERO, gasUsed: isSet(object.gasUsed) ? Long.fromValue(object.gasUsed) : Long.ZERO, tx: isSet(object.tx) ? Any.fromJSON(object.tx) : undefined, timestamp: isSet(object.timestamp) ? String(object.timestamp) : "", - events: Array.isArray(object?.events) ? object.events.map((e: any) => Event.fromJSON(e)) : [], - }; + events: Array.isArray(object?.events) + ? object.events.map((e: any) => Event.fromJSON(e)) + : [], + } }, toJSON(message: TxResponse): unknown { - const obj: any = {}; - message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); - message.txhash !== undefined && (obj.txhash = message.txhash); - message.codespace !== undefined && (obj.codespace = message.codespace); - message.code !== undefined && (obj.code = Math.round(message.code)); - message.data !== undefined && (obj.data = message.data); - message.rawLog !== undefined && (obj.rawLog = message.rawLog); + const obj: any = {} + message.height !== undefined && + (obj.height = (message.height || Long.ZERO).toString()) + message.txhash !== undefined && (obj.txhash = message.txhash) + message.codespace !== undefined && (obj.codespace = message.codespace) + message.code !== undefined && (obj.code = Math.round(message.code)) + message.data !== undefined && (obj.data = message.data) + message.rawLog !== undefined && (obj.rawLog = message.rawLog) if (message.logs) { - obj.logs = message.logs.map((e) => e ? ABCIMessageLog.toJSON(e) : undefined); + obj.logs = message.logs.map((e) => (e ? ABCIMessageLog.toJSON(e) : undefined)) } else { - obj.logs = []; + obj.logs = [] } - message.info !== undefined && (obj.info = message.info); - message.gasWanted !== undefined && (obj.gasWanted = (message.gasWanted || Long.ZERO).toString()); - message.gasUsed !== undefined && (obj.gasUsed = (message.gasUsed || Long.ZERO).toString()); - message.tx !== undefined && (obj.tx = message.tx ? Any.toJSON(message.tx) : undefined); - message.timestamp !== undefined && (obj.timestamp = message.timestamp); + message.info !== undefined && (obj.info = message.info) + message.gasWanted !== undefined && + (obj.gasWanted = (message.gasWanted || Long.ZERO).toString()) + message.gasUsed !== undefined && + (obj.gasUsed = (message.gasUsed || Long.ZERO).toString()) + message.tx !== undefined && + (obj.tx = message.tx ? Any.toJSON(message.tx) : undefined) + message.timestamp !== undefined && (obj.timestamp = message.timestamp) if (message.events) { - obj.events = message.events.map((e) => e ? Event.toJSON(e) : undefined); + obj.events = message.events.map((e) => (e ? Event.toJSON(e) : undefined)) } else { - obj.events = []; + obj.events = [] } - return obj; + return obj }, fromPartial, I>>(object: I): TxResponse { - const message = createBaseTxResponse(); - message.height = (object.height !== undefined && object.height !== null) - ? Long.fromValue(object.height) - : Long.ZERO; - message.txhash = object.txhash ?? ""; - message.codespace = object.codespace ?? ""; - message.code = object.code ?? 0; - message.data = object.data ?? ""; - message.rawLog = object.rawLog ?? ""; - message.logs = object.logs?.map((e) => ABCIMessageLog.fromPartial(e)) || []; - message.info = object.info ?? ""; - message.gasWanted = (object.gasWanted !== undefined && object.gasWanted !== null) - ? Long.fromValue(object.gasWanted) - : Long.ZERO; - message.gasUsed = (object.gasUsed !== undefined && object.gasUsed !== null) - ? Long.fromValue(object.gasUsed) - : Long.ZERO; - message.tx = (object.tx !== undefined && object.tx !== null) ? Any.fromPartial(object.tx) : undefined; - message.timestamp = object.timestamp ?? ""; - message.events = object.events?.map((e) => Event.fromPartial(e)) || []; - return message; - }, -}; + const message = createBaseTxResponse() + message.height = + object.height !== undefined && object.height !== null + ? Long.fromValue(object.height) + : Long.ZERO + message.txhash = object.txhash ?? "" + message.codespace = object.codespace ?? "" + message.code = object.code ?? 0 + message.data = object.data ?? "" + message.rawLog = object.rawLog ?? "" + message.logs = object.logs?.map((e) => ABCIMessageLog.fromPartial(e)) || [] + message.info = object.info ?? "" + message.gasWanted = + object.gasWanted !== undefined && object.gasWanted !== null + ? Long.fromValue(object.gasWanted) + : Long.ZERO + message.gasUsed = + object.gasUsed !== undefined && object.gasUsed !== null + ? Long.fromValue(object.gasUsed) + : Long.ZERO + message.tx = + object.tx !== undefined && object.tx !== null + ? Any.fromPartial(object.tx) + : undefined + message.timestamp = object.timestamp ?? "" + message.events = object.events?.map((e) => Event.fromPartial(e)) || [] + return message + }, +} function createBaseABCIMessageLog(): ABCIMessageLog { - return { msgIndex: 0, log: "", events: [] }; + return { msgIndex: 0, log: "", events: [] } } export const ABCIMessageLog = { - encode(message: ABCIMessageLog, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: ABCIMessageLog, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.msgIndex !== 0) { - writer.uint32(8).uint32(message.msgIndex); + writer.uint32(8).uint32(message.msgIndex) } if (message.log !== "") { - writer.uint32(18).string(message.log); + writer.uint32(18).string(message.log) } for (const v of message.events) { - StringEvent.encode(v!, writer.uint32(26).fork()).ldelim(); + StringEvent.encode(v!, writer.uint32(26).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): ABCIMessageLog { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseABCIMessageLog(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseABCIMessageLog() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.msgIndex = reader.uint32(); - break; + message.msgIndex = reader.uint32() + break case 2: - message.log = reader.string(); - break; + message.log = reader.string() + break case 3: - message.events.push(StringEvent.decode(reader, reader.uint32())); - break; + message.events.push(StringEvent.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): ABCIMessageLog { return { msgIndex: isSet(object.msgIndex) ? Number(object.msgIndex) : 0, log: isSet(object.log) ? String(object.log) : "", - events: Array.isArray(object?.events) ? object.events.map((e: any) => StringEvent.fromJSON(e)) : [], - }; + events: Array.isArray(object?.events) + ? object.events.map((e: any) => StringEvent.fromJSON(e)) + : [], + } }, toJSON(message: ABCIMessageLog): unknown { - const obj: any = {}; - message.msgIndex !== undefined && (obj.msgIndex = Math.round(message.msgIndex)); - message.log !== undefined && (obj.log = message.log); + const obj: any = {} + message.msgIndex !== undefined && (obj.msgIndex = Math.round(message.msgIndex)) + message.log !== undefined && (obj.log = message.log) if (message.events) { - obj.events = message.events.map((e) => e ? StringEvent.toJSON(e) : undefined); + obj.events = message.events.map((e) => (e ? StringEvent.toJSON(e) : undefined)) } else { - obj.events = []; + obj.events = [] } - return obj; + return obj }, - fromPartial, I>>(object: I): ABCIMessageLog { - const message = createBaseABCIMessageLog(); - message.msgIndex = object.msgIndex ?? 0; - message.log = object.log ?? ""; - message.events = object.events?.map((e) => StringEvent.fromPartial(e)) || []; - return message; + fromPartial, I>>( + object: I, + ): ABCIMessageLog { + const message = createBaseABCIMessageLog() + message.msgIndex = object.msgIndex ?? 0 + message.log = object.log ?? "" + message.events = object.events?.map((e) => StringEvent.fromPartial(e)) || [] + return message }, -}; +} function createBaseStringEvent(): StringEvent { - return { type: "", attributes: [] }; + return { type: "", attributes: [] } } export const StringEvent = { encode(message: StringEvent, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.type !== "") { - writer.uint32(10).string(message.type); + writer.uint32(10).string(message.type) } for (const v of message.attributes) { - Attribute.encode(v!, writer.uint32(18).fork()).ldelim(); + Attribute.encode(v!, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): StringEvent { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseStringEvent(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseStringEvent() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.type = reader.string(); - break; + message.type = reader.string() + break case 2: - message.attributes.push(Attribute.decode(reader, reader.uint32())); - break; + message.attributes.push(Attribute.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): StringEvent { return { type: isSet(object.type) ? String(object.type) : "", - attributes: Array.isArray(object?.attributes) ? object.attributes.map((e: any) => Attribute.fromJSON(e)) : [], - }; + attributes: Array.isArray(object?.attributes) + ? object.attributes.map((e: any) => Attribute.fromJSON(e)) + : [], + } }, toJSON(message: StringEvent): unknown { - const obj: any = {}; - message.type !== undefined && (obj.type = message.type); + const obj: any = {} + message.type !== undefined && (obj.type = message.type) if (message.attributes) { - obj.attributes = message.attributes.map((e) => e ? Attribute.toJSON(e) : undefined); + obj.attributes = message.attributes.map((e) => + e ? Attribute.toJSON(e) : undefined, + ) } else { - obj.attributes = []; + obj.attributes = [] } - return obj; + return obj }, fromPartial, I>>(object: I): StringEvent { - const message = createBaseStringEvent(); - message.type = object.type ?? ""; - message.attributes = object.attributes?.map((e) => Attribute.fromPartial(e)) || []; - return message; + const message = createBaseStringEvent() + message.type = object.type ?? "" + message.attributes = object.attributes?.map((e) => Attribute.fromPartial(e)) || [] + return message }, -}; +} function createBaseAttribute(): Attribute { - return { key: "", value: "" }; + return { key: "", value: "" } } export const Attribute = { encode(message: Attribute, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.key !== "") { - writer.uint32(10).string(message.key); + writer.uint32(10).string(message.key) } if (message.value !== "") { - writer.uint32(18).string(message.value); + writer.uint32(18).string(message.value) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Attribute { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseAttribute(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseAttribute() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.key = reader.string(); - break; + message.key = reader.string() + break case 2: - message.value = reader.string(); - break; + message.value = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Attribute { - return { key: isSet(object.key) ? String(object.key) : "", value: isSet(object.value) ? String(object.value) : "" }; + return { + key: isSet(object.key) ? String(object.key) : "", + value: isSet(object.value) ? String(object.value) : "", + } }, toJSON(message: Attribute): unknown { - const obj: any = {}; - message.key !== undefined && (obj.key = message.key); - message.value !== undefined && (obj.value = message.value); - return obj; + const obj: any = {} + message.key !== undefined && (obj.key = message.key) + message.value !== undefined && (obj.value = message.value) + return obj }, fromPartial, I>>(object: I): Attribute { - const message = createBaseAttribute(); - message.key = object.key ?? ""; - message.value = object.value ?? ""; - return message; + const message = createBaseAttribute() + message.key = object.key ?? "" + message.value = object.value ?? "" + return message }, -}; +} function createBaseGasInfo(): GasInfo { - return { gasWanted: Long.UZERO, gasUsed: Long.UZERO }; + return { gasWanted: Long.UZERO, gasUsed: Long.UZERO } } export const GasInfo = { encode(message: GasInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (!message.gasWanted.isZero()) { - writer.uint32(8).uint64(message.gasWanted); + writer.uint32(8).uint64(message.gasWanted) } if (!message.gasUsed.isZero()) { - writer.uint32(16).uint64(message.gasUsed); + writer.uint32(16).uint64(message.gasUsed) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): GasInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGasInfo(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseGasInfo() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.gasWanted = reader.uint64() as Long; - break; + message.gasWanted = reader.uint64() as Long + break case 2: - message.gasUsed = reader.uint64() as Long; - break; + message.gasUsed = reader.uint64() as Long + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): GasInfo { return { - gasWanted: isSet(object.gasWanted) ? Long.fromValue(object.gasWanted) : Long.UZERO, + gasWanted: isSet(object.gasWanted) + ? Long.fromValue(object.gasWanted) + : Long.UZERO, gasUsed: isSet(object.gasUsed) ? Long.fromValue(object.gasUsed) : Long.UZERO, - }; + } }, toJSON(message: GasInfo): unknown { - const obj: any = {}; - message.gasWanted !== undefined && (obj.gasWanted = (message.gasWanted || Long.UZERO).toString()); - message.gasUsed !== undefined && (obj.gasUsed = (message.gasUsed || Long.UZERO).toString()); - return obj; + const obj: any = {} + message.gasWanted !== undefined && + (obj.gasWanted = (message.gasWanted || Long.UZERO).toString()) + message.gasUsed !== undefined && + (obj.gasUsed = (message.gasUsed || Long.UZERO).toString()) + return obj }, fromPartial, I>>(object: I): GasInfo { - const message = createBaseGasInfo(); - message.gasWanted = (object.gasWanted !== undefined && object.gasWanted !== null) - ? Long.fromValue(object.gasWanted) - : Long.UZERO; - message.gasUsed = (object.gasUsed !== undefined && object.gasUsed !== null) - ? Long.fromValue(object.gasUsed) - : Long.UZERO; - return message; + const message = createBaseGasInfo() + message.gasWanted = + object.gasWanted !== undefined && object.gasWanted !== null + ? Long.fromValue(object.gasWanted) + : Long.UZERO + message.gasUsed = + object.gasUsed !== undefined && object.gasUsed !== null + ? Long.fromValue(object.gasUsed) + : Long.UZERO + return message }, -}; +} function createBaseResult(): Result { - return { data: new Uint8Array(), log: "", events: [] }; + return { data: new Uint8Array(), log: "", events: [] } } export const Result = { encode(message: Result, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.data.length !== 0) { - writer.uint32(10).bytes(message.data); + writer.uint32(10).bytes(message.data) } if (message.log !== "") { - writer.uint32(18).string(message.log); + writer.uint32(18).string(message.log) } for (const v of message.events) { - Event.encode(v!, writer.uint32(26).fork()).ldelim(); + Event.encode(v!, writer.uint32(26).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Result { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseResult(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseResult() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.data = reader.bytes(); - break; + message.data = reader.bytes() + break case 2: - message.log = reader.string(); - break; + message.log = reader.string() + break case 3: - message.events.push(Event.decode(reader, reader.uint32())); - break; + message.events.push(Event.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Result { return { data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(), log: isSet(object.log) ? String(object.log) : "", - events: Array.isArray(object?.events) ? object.events.map((e: any) => Event.fromJSON(e)) : [], - }; + events: Array.isArray(object?.events) + ? object.events.map((e: any) => Event.fromJSON(e)) + : [], + } }, toJSON(message: Result): unknown { - const obj: any = {}; + const obj: any = {} message.data !== undefined && - (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); - message.log !== undefined && (obj.log = message.log); + (obj.data = base64FromBytes( + message.data !== undefined ? message.data : new Uint8Array(), + )) + message.log !== undefined && (obj.log = message.log) if (message.events) { - obj.events = message.events.map((e) => e ? Event.toJSON(e) : undefined); + obj.events = message.events.map((e) => (e ? Event.toJSON(e) : undefined)) } else { - obj.events = []; + obj.events = [] } - return obj; + return obj }, fromPartial, I>>(object: I): Result { - const message = createBaseResult(); - message.data = object.data ?? new Uint8Array(); - message.log = object.log ?? ""; - message.events = object.events?.map((e) => Event.fromPartial(e)) || []; - return message; + const message = createBaseResult() + message.data = object.data ?? new Uint8Array() + message.log = object.log ?? "" + message.events = object.events?.map((e) => Event.fromPartial(e)) || [] + return message }, -}; +} function createBaseSimulationResponse(): SimulationResponse { - return { gasInfo: undefined, result: undefined }; + return { gasInfo: undefined, result: undefined } } export const SimulationResponse = { - encode(message: SimulationResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: SimulationResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.gasInfo !== undefined) { - GasInfo.encode(message.gasInfo, writer.uint32(10).fork()).ldelim(); + GasInfo.encode(message.gasInfo, writer.uint32(10).fork()).ldelim() } if (message.result !== undefined) { - Result.encode(message.result, writer.uint32(18).fork()).ldelim(); + Result.encode(message.result, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): SimulationResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSimulationResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseSimulationResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.gasInfo = GasInfo.decode(reader, reader.uint32()); - break; + message.gasInfo = GasInfo.decode(reader, reader.uint32()) + break case 2: - message.result = Result.decode(reader, reader.uint32()); - break; + message.result = Result.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): SimulationResponse { return { gasInfo: isSet(object.gasInfo) ? GasInfo.fromJSON(object.gasInfo) : undefined, result: isSet(object.result) ? Result.fromJSON(object.result) : undefined, - }; + } }, toJSON(message: SimulationResponse): unknown { - const obj: any = {}; - message.gasInfo !== undefined && (obj.gasInfo = message.gasInfo ? GasInfo.toJSON(message.gasInfo) : undefined); - message.result !== undefined && (obj.result = message.result ? Result.toJSON(message.result) : undefined); - return obj; + const obj: any = {} + message.gasInfo !== undefined && + (obj.gasInfo = message.gasInfo ? GasInfo.toJSON(message.gasInfo) : undefined) + message.result !== undefined && + (obj.result = message.result ? Result.toJSON(message.result) : undefined) + return obj }, - fromPartial, I>>(object: I): SimulationResponse { - const message = createBaseSimulationResponse(); - message.gasInfo = (object.gasInfo !== undefined && object.gasInfo !== null) - ? GasInfo.fromPartial(object.gasInfo) - : undefined; - message.result = (object.result !== undefined && object.result !== null) - ? Result.fromPartial(object.result) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): SimulationResponse { + const message = createBaseSimulationResponse() + message.gasInfo = + object.gasInfo !== undefined && object.gasInfo !== null + ? GasInfo.fromPartial(object.gasInfo) + : undefined + message.result = + object.result !== undefined && object.result !== null + ? Result.fromPartial(object.result) + : undefined + return message }, -}; +} function createBaseMsgData(): MsgData { - return { msgType: "", data: new Uint8Array() }; + return { msgType: "", data: new Uint8Array() } } export const MsgData = { encode(message: MsgData, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.msgType !== "") { - writer.uint32(10).string(message.msgType); + writer.uint32(10).string(message.msgType) } if (message.data.length !== 0) { - writer.uint32(18).bytes(message.data); + writer.uint32(18).bytes(message.data) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MsgData { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgData(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgData() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.msgType = reader.string(); - break; + message.msgType = reader.string() + break case 2: - message.data = reader.bytes(); - break; + message.data = reader.bytes() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): MsgData { return { msgType: isSet(object.msgType) ? String(object.msgType) : "", data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(), - }; + } }, toJSON(message: MsgData): unknown { - const obj: any = {}; - message.msgType !== undefined && (obj.msgType = message.msgType); + const obj: any = {} + message.msgType !== undefined && (obj.msgType = message.msgType) message.data !== undefined && - (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); - return obj; + (obj.data = base64FromBytes( + message.data !== undefined ? message.data : new Uint8Array(), + )) + return obj }, fromPartial, I>>(object: I): MsgData { - const message = createBaseMsgData(); - message.msgType = object.msgType ?? ""; - message.data = object.data ?? new Uint8Array(); - return message; + const message = createBaseMsgData() + message.msgType = object.msgType ?? "" + message.data = object.data ?? new Uint8Array() + return message }, -}; +} function createBaseTxMsgData(): TxMsgData { - return { data: [] }; + return { data: [] } } export const TxMsgData = { encode(message: TxMsgData, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.data) { - MsgData.encode(v!, writer.uint32(10).fork()).ldelim(); + MsgData.encode(v!, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): TxMsgData { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseTxMsgData(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseTxMsgData() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.data.push(MsgData.decode(reader, reader.uint32())); - break; + message.data.push(MsgData.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): TxMsgData { - return { data: Array.isArray(object?.data) ? object.data.map((e: any) => MsgData.fromJSON(e)) : [] }; + return { + data: Array.isArray(object?.data) + ? object.data.map((e: any) => MsgData.fromJSON(e)) + : [], + } }, toJSON(message: TxMsgData): unknown { - const obj: any = {}; + const obj: any = {} if (message.data) { - obj.data = message.data.map((e) => e ? MsgData.toJSON(e) : undefined); + obj.data = message.data.map((e) => (e ? MsgData.toJSON(e) : undefined)) } else { - obj.data = []; + obj.data = [] } - return obj; + return obj }, fromPartial, I>>(object: I): TxMsgData { - const message = createBaseTxMsgData(); - message.data = object.data?.map((e) => MsgData.fromPartial(e)) || []; - return message; + const message = createBaseTxMsgData() + message.data = object.data?.map((e) => MsgData.fromPartial(e)) || [] + return message }, -}; +} function createBaseSearchTxsResult(): SearchTxsResult { return { @@ -835,170 +888,195 @@ function createBaseSearchTxsResult(): SearchTxsResult { pageTotal: Long.UZERO, limit: Long.UZERO, txs: [], - }; + } } export const SearchTxsResult = { - encode(message: SearchTxsResult, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: SearchTxsResult, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (!message.totalCount.isZero()) { - writer.uint32(8).uint64(message.totalCount); + writer.uint32(8).uint64(message.totalCount) } if (!message.count.isZero()) { - writer.uint32(16).uint64(message.count); + writer.uint32(16).uint64(message.count) } if (!message.pageNumber.isZero()) { - writer.uint32(24).uint64(message.pageNumber); + writer.uint32(24).uint64(message.pageNumber) } if (!message.pageTotal.isZero()) { - writer.uint32(32).uint64(message.pageTotal); + writer.uint32(32).uint64(message.pageTotal) } if (!message.limit.isZero()) { - writer.uint32(40).uint64(message.limit); + writer.uint32(40).uint64(message.limit) } for (const v of message.txs) { - TxResponse.encode(v!, writer.uint32(50).fork()).ldelim(); + TxResponse.encode(v!, writer.uint32(50).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): SearchTxsResult { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSearchTxsResult(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseSearchTxsResult() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.totalCount = reader.uint64() as Long; - break; + message.totalCount = reader.uint64() as Long + break case 2: - message.count = reader.uint64() as Long; - break; + message.count = reader.uint64() as Long + break case 3: - message.pageNumber = reader.uint64() as Long; - break; + message.pageNumber = reader.uint64() as Long + break case 4: - message.pageTotal = reader.uint64() as Long; - break; + message.pageTotal = reader.uint64() as Long + break case 5: - message.limit = reader.uint64() as Long; - break; + message.limit = reader.uint64() as Long + break case 6: - message.txs.push(TxResponse.decode(reader, reader.uint32())); - break; + message.txs.push(TxResponse.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): SearchTxsResult { return { - totalCount: isSet(object.totalCount) ? Long.fromValue(object.totalCount) : Long.UZERO, + totalCount: isSet(object.totalCount) + ? Long.fromValue(object.totalCount) + : Long.UZERO, count: isSet(object.count) ? Long.fromValue(object.count) : Long.UZERO, - pageNumber: isSet(object.pageNumber) ? Long.fromValue(object.pageNumber) : Long.UZERO, - pageTotal: isSet(object.pageTotal) ? Long.fromValue(object.pageTotal) : Long.UZERO, + pageNumber: isSet(object.pageNumber) + ? Long.fromValue(object.pageNumber) + : Long.UZERO, + pageTotal: isSet(object.pageTotal) + ? Long.fromValue(object.pageTotal) + : Long.UZERO, limit: isSet(object.limit) ? Long.fromValue(object.limit) : Long.UZERO, - txs: Array.isArray(object?.txs) ? object.txs.map((e: any) => TxResponse.fromJSON(e)) : [], - }; + txs: Array.isArray(object?.txs) + ? object.txs.map((e: any) => TxResponse.fromJSON(e)) + : [], + } }, toJSON(message: SearchTxsResult): unknown { - const obj: any = {}; - message.totalCount !== undefined && (obj.totalCount = (message.totalCount || Long.UZERO).toString()); - message.count !== undefined && (obj.count = (message.count || Long.UZERO).toString()); - message.pageNumber !== undefined && (obj.pageNumber = (message.pageNumber || Long.UZERO).toString()); - message.pageTotal !== undefined && (obj.pageTotal = (message.pageTotal || Long.UZERO).toString()); - message.limit !== undefined && (obj.limit = (message.limit || Long.UZERO).toString()); + const obj: any = {} + message.totalCount !== undefined && + (obj.totalCount = (message.totalCount || Long.UZERO).toString()) + message.count !== undefined && + (obj.count = (message.count || Long.UZERO).toString()) + message.pageNumber !== undefined && + (obj.pageNumber = (message.pageNumber || Long.UZERO).toString()) + message.pageTotal !== undefined && + (obj.pageTotal = (message.pageTotal || Long.UZERO).toString()) + message.limit !== undefined && + (obj.limit = (message.limit || Long.UZERO).toString()) if (message.txs) { - obj.txs = message.txs.map((e) => e ? TxResponse.toJSON(e) : undefined); + obj.txs = message.txs.map((e) => (e ? TxResponse.toJSON(e) : undefined)) } else { - obj.txs = []; - } - return obj; - }, - - fromPartial, I>>(object: I): SearchTxsResult { - const message = createBaseSearchTxsResult(); - message.totalCount = (object.totalCount !== undefined && object.totalCount !== null) - ? Long.fromValue(object.totalCount) - : Long.UZERO; - message.count = (object.count !== undefined && object.count !== null) ? Long.fromValue(object.count) : Long.UZERO; - message.pageNumber = (object.pageNumber !== undefined && object.pageNumber !== null) - ? Long.fromValue(object.pageNumber) - : Long.UZERO; - message.pageTotal = (object.pageTotal !== undefined && object.pageTotal !== null) - ? Long.fromValue(object.pageTotal) - : Long.UZERO; - message.limit = (object.limit !== undefined && object.limit !== null) ? Long.fromValue(object.limit) : Long.UZERO; - message.txs = object.txs?.map((e) => TxResponse.fromPartial(e)) || []; - return message; - }, -}; - -declare var self: any | undefined; -declare var window: any | undefined; -declare var global: any | undefined; -var globalThis: any = (() => { - if (typeof globalThis !== "undefined") { - return globalThis; - } - if (typeof self !== "undefined") { - return self; - } - if (typeof window !== "undefined") { - return window; - } - if (typeof global !== "undefined") { - return global; - } - throw "Unable to locate global object"; -})(); + obj.txs = [] + } + return obj + }, + + fromPartial, I>>( + object: I, + ): SearchTxsResult { + const message = createBaseSearchTxsResult() + message.totalCount = + object.totalCount !== undefined && object.totalCount !== null + ? Long.fromValue(object.totalCount) + : Long.UZERO + message.count = + object.count !== undefined && object.count !== null + ? Long.fromValue(object.count) + : Long.UZERO + message.pageNumber = + object.pageNumber !== undefined && object.pageNumber !== null + ? Long.fromValue(object.pageNumber) + : Long.UZERO + message.pageTotal = + object.pageTotal !== undefined && object.pageTotal !== null + ? Long.fromValue(object.pageTotal) + : Long.UZERO + message.limit = + object.limit !== undefined && object.limit !== null + ? Long.fromValue(object.limit) + : Long.UZERO + message.txs = object.txs?.map((e) => TxResponse.fromPartial(e)) || [] + return message + }, +} +declare var self: any | undefined +declare var window: any | undefined +declare var global: any | undefined +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis + if (typeof self !== "undefined") return self + if (typeof window !== "undefined") return window + if (typeof global !== "undefined") return global + throw "Unable to locate global object" +})() + +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")) function bytesFromBase64(b64: string): Uint8Array { - if (globalThis.Buffer) { - return Uint8Array.from(globalThis.Buffer.from(b64, "base64")); - } else { - const bin = globalThis.atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; + 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 } +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")) function base64FromBytes(arr: Uint8Array): string { - if (globalThis.Buffer) { - return globalThis.Buffer.from(arr).toString("base64"); - } else { - const bin: string[] = []; - arr.forEach((byte) => { - bin.push(String.fromCharCode(byte)); - }); - return globalThis.btoa(bin.join("")); - } + const bin: string[] = [] + arr.forEach((byte) => { + bin.push(String.fromCharCode(byte)) + }) + return btoa(bin.join("")) } -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/cosmos/base/kv/v1beta1/kv.ts b/packages/protojs/src/cosmos/base/kv/v1beta1/kv.ts index cbe4b2ef..86070117 100644 --- a/packages/protojs/src/cosmos/base/kv/v1beta1/kv.ts +++ b/packages/protojs/src/cosmos/base/kv/v1beta1/kv.ts @@ -1,192 +1,198 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "cosmos.base.kv.v1beta1"; +export const protobufPackage = "cosmos.base.kv.v1beta1" /** Pairs defines a repeated slice of Pair objects. */ export interface Pairs { - pairs: Pair[]; + pairs: Pair[] } /** Pair defines a key/value bytes tuple. */ export interface Pair { - key: Uint8Array; - value: Uint8Array; + key: Uint8Array + value: Uint8Array } function createBasePairs(): Pairs { - return { pairs: [] }; + return { pairs: [] } } export const Pairs = { encode(message: Pairs, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.pairs) { - Pair.encode(v!, writer.uint32(10).fork()).ldelim(); + Pair.encode(v!, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Pairs { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBasePairs(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBasePairs() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.pairs.push(Pair.decode(reader, reader.uint32())); - break; + message.pairs.push(Pair.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Pairs { - return { pairs: Array.isArray(object?.pairs) ? object.pairs.map((e: any) => Pair.fromJSON(e)) : [] }; + return { + pairs: Array.isArray(object?.pairs) + ? object.pairs.map((e: any) => Pair.fromJSON(e)) + : [], + } }, toJSON(message: Pairs): unknown { - const obj: any = {}; + const obj: any = {} if (message.pairs) { - obj.pairs = message.pairs.map((e) => e ? Pair.toJSON(e) : undefined); + obj.pairs = message.pairs.map((e) => (e ? Pair.toJSON(e) : undefined)) } else { - obj.pairs = []; + obj.pairs = [] } - return obj; + return obj }, fromPartial, I>>(object: I): Pairs { - const message = createBasePairs(); - message.pairs = object.pairs?.map((e) => Pair.fromPartial(e)) || []; - return message; + const message = createBasePairs() + message.pairs = object.pairs?.map((e) => Pair.fromPartial(e)) || [] + return message }, -}; +} function createBasePair(): Pair { - return { key: new Uint8Array(), value: new Uint8Array() }; + return { key: new Uint8Array(), value: new Uint8Array() } } export const Pair = { encode(message: Pair, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.key.length !== 0) { - writer.uint32(10).bytes(message.key); + writer.uint32(10).bytes(message.key) } if (message.value.length !== 0) { - writer.uint32(18).bytes(message.value); + writer.uint32(18).bytes(message.value) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Pair { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBasePair(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBasePair() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.key = reader.bytes(); - break; + message.key = reader.bytes() + break case 2: - message.value = reader.bytes(); - break; + message.value = reader.bytes() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Pair { return { key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array(), value: isSet(object.value) ? bytesFromBase64(object.value) : new Uint8Array(), - }; + } }, toJSON(message: Pair): unknown { - const obj: any = {}; + const obj: any = {} message.key !== undefined && - (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); + (obj.key = base64FromBytes( + message.key !== undefined ? message.key : new Uint8Array(), + )) message.value !== undefined && - (obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array())); - return obj; + (obj.value = base64FromBytes( + message.value !== undefined ? message.value : new Uint8Array(), + )) + return obj }, fromPartial, I>>(object: I): Pair { - const message = createBasePair(); - message.key = object.key ?? new Uint8Array(); - message.value = object.value ?? new Uint8Array(); - return message; + const message = createBasePair() + message.key = object.key ?? new Uint8Array() + message.value = object.value ?? new Uint8Array() + return message }, -}; +} -declare var self: any | undefined; -declare var window: any | undefined; -declare var global: any | undefined; +declare var self: any | undefined +declare var window: any | undefined +declare var global: any | undefined var globalThis: any = (() => { - if (typeof globalThis !== "undefined") { - return globalThis; - } - if (typeof self !== "undefined") { - return self; - } - if (typeof window !== "undefined") { - return window; - } - if (typeof global !== "undefined") { - return global; - } - throw "Unable to locate global object"; -})(); - + if (typeof globalThis !== "undefined") return globalThis + if (typeof self !== "undefined") return self + if (typeof window !== "undefined") return window + if (typeof global !== "undefined") return global + throw "Unable to locate global object" +})() + +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")) function bytesFromBase64(b64: string): Uint8Array { - if (globalThis.Buffer) { - return Uint8Array.from(globalThis.Buffer.from(b64, "base64")); - } else { - const bin = globalThis.atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; + 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 } +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")) function base64FromBytes(arr: Uint8Array): string { - if (globalThis.Buffer) { - return globalThis.Buffer.from(arr).toString("base64"); - } else { - const bin: string[] = []; - arr.forEach((byte) => { - bin.push(String.fromCharCode(byte)); - }); - return globalThis.btoa(bin.join("")); - } + const bin: string[] = [] + arr.forEach((byte) => { + bin.push(String.fromCharCode(byte)) + }) + return btoa(bin.join("")) } -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/cosmos/base/node/v1beta1/query.ts b/packages/protojs/src/cosmos/base/node/v1beta1/query.ts index d05db911..0c29ec9f 100644 --- a/packages/protojs/src/cosmos/base/node/v1beta1/query.ts +++ b/packages/protojs/src/cosmos/base/node/v1beta1/query.ts @@ -1,144 +1,163 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "cosmos.base.node.v1beta1"; +export const protobufPackage = "cosmos.base.node.v1beta1" /** ConfigRequest defines the request structure for the Config gRPC query. */ -export interface ConfigRequest { -} +export interface ConfigRequest {} /** ConfigResponse defines the response structure for the Config gRPC query. */ export interface ConfigResponse { - minimumGasPrice: string; + minimumGasPrice: string } function createBaseConfigRequest(): ConfigRequest { - return {}; + return {} } export const ConfigRequest = { encode(_: ConfigRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): ConfigRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseConfigRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseConfigRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(_: any): ConfigRequest { - return {}; + return {} }, toJSON(_: ConfigRequest): unknown { - const obj: any = {}; - return obj; + const obj: any = {} + return obj }, fromPartial, I>>(_: I): ConfigRequest { - const message = createBaseConfigRequest(); - return message; + const message = createBaseConfigRequest() + return message }, -}; +} function createBaseConfigResponse(): ConfigResponse { - return { minimumGasPrice: "" }; + return { minimumGasPrice: "" } } export const ConfigResponse = { - encode(message: ConfigResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: ConfigResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.minimumGasPrice !== "") { - writer.uint32(10).string(message.minimumGasPrice); + writer.uint32(10).string(message.minimumGasPrice) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): ConfigResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseConfigResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseConfigResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.minimumGasPrice = reader.string(); - break; + message.minimumGasPrice = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): ConfigResponse { - return { minimumGasPrice: isSet(object.minimumGasPrice) ? String(object.minimumGasPrice) : "" }; + return { + minimumGasPrice: isSet(object.minimumGasPrice) + ? String(object.minimumGasPrice) + : "", + } }, toJSON(message: ConfigResponse): unknown { - const obj: any = {}; - message.minimumGasPrice !== undefined && (obj.minimumGasPrice = message.minimumGasPrice); - return obj; + const obj: any = {} + message.minimumGasPrice !== undefined && + (obj.minimumGasPrice = message.minimumGasPrice) + return obj }, - fromPartial, I>>(object: I): ConfigResponse { - const message = createBaseConfigResponse(); - message.minimumGasPrice = object.minimumGasPrice ?? ""; - return message; + fromPartial, I>>( + object: I, + ): ConfigResponse { + const message = createBaseConfigResponse() + message.minimumGasPrice = object.minimumGasPrice ?? "" + return message }, -}; +} /** Service defines the gRPC querier service for node related queries. */ export interface Service { /** Config queries for the operator configuration. */ - Config(request: ConfigRequest): Promise; + Config(request: ConfigRequest): Promise } export class ServiceClientImpl implements Service { - private readonly rpc: Rpc; + private readonly rpc: Rpc constructor(rpc: Rpc) { - this.rpc = rpc; - this.Config = this.Config.bind(this); + this.rpc = rpc + this.Config = this.Config.bind(this) } Config(request: ConfigRequest): Promise { - const data = ConfigRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.base.node.v1beta1.Service", "Config", data); - return promise.then((data) => ConfigResponse.decode(new _m0.Reader(data))); + const data = ConfigRequest.encode(request).finish() + const promise = this.rpc.request("cosmos.base.node.v1beta1.Service", "Config", data) + return promise.then((data) => ConfigResponse.decode(new _m0.Reader(data))) } } interface Rpc { - request(service: string, method: string, data: Uint8Array): Promise; + request(service: string, method: string, data: Uint8Array): Promise } -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/cosmos/base/query/v1beta1/pagination.ts b/packages/protojs/src/cosmos/base/query/v1beta1/pagination.ts index 0aa1c461..52309a43 100644 --- a/packages/protojs/src/cosmos/base/query/v1beta1/pagination.ts +++ b/packages/protojs/src/cosmos/base/query/v1beta1/pagination.ts @@ -1,8 +1,8 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "cosmos.base.query.v1beta1"; +export const protobufPackage = "cosmos.base.query.v1beta1" /** * PageRequest is to be embedded in gRPC request messages for efficient @@ -19,31 +19,31 @@ export interface PageRequest { * querying the next page most efficiently. Only one of offset or key * should be set. */ - key: Uint8Array; + key: Uint8Array /** * offset is a numeric offset that can be used when key is unavailable. * It is less efficient than using key. Only one of offset or key should * be set. */ - offset: Long; + offset: Long /** * limit is the total number of results to be returned in the result page. * If left empty it will default to a value to be set by each app. */ - limit: Long; + limit: Long /** * count_total is set to true to indicate that the result set should include * a count of the total number of items available for pagination in UIs. * count_total is only respected when offset is used. It is ignored when key * is set. */ - countTotal: boolean; + countTotal: boolean /** * reverse is set to true if results are to be returned in the descending order. * * Since: cosmos-sdk 0.43 */ - reverse: boolean; + reverse: boolean } /** @@ -60,66 +60,72 @@ export interface PageResponse { * next_key is the key to be passed to PageRequest.key to * query the next page most efficiently */ - nextKey: Uint8Array; + nextKey: Uint8Array /** * total is total number of results available if PageRequest.count_total * was set, its value is undefined otherwise */ - total: Long; + total: Long } function createBasePageRequest(): PageRequest { - return { key: new Uint8Array(), offset: Long.UZERO, limit: Long.UZERO, countTotal: false, reverse: false }; + return { + key: new Uint8Array(), + offset: Long.UZERO, + limit: Long.UZERO, + countTotal: false, + reverse: false, + } } export const PageRequest = { encode(message: PageRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.key.length !== 0) { - writer.uint32(10).bytes(message.key); + writer.uint32(10).bytes(message.key) } if (!message.offset.isZero()) { - writer.uint32(16).uint64(message.offset); + writer.uint32(16).uint64(message.offset) } if (!message.limit.isZero()) { - writer.uint32(24).uint64(message.limit); + writer.uint32(24).uint64(message.limit) } if (message.countTotal === true) { - writer.uint32(32).bool(message.countTotal); + writer.uint32(32).bool(message.countTotal) } if (message.reverse === true) { - writer.uint32(40).bool(message.reverse); + writer.uint32(40).bool(message.reverse) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): PageRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBasePageRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBasePageRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.key = reader.bytes(); - break; + message.key = reader.bytes() + break case 2: - message.offset = reader.uint64() as Long; - break; + message.offset = reader.uint64() as Long + break case 3: - message.limit = reader.uint64() as Long; - break; + message.limit = reader.uint64() as Long + break case 4: - message.countTotal = reader.bool(); - break; + message.countTotal = reader.bool() + break case 5: - message.reverse = reader.bool(); - break; + message.reverse = reader.bool() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): PageRequest { @@ -129,153 +135,167 @@ export const PageRequest = { limit: isSet(object.limit) ? Long.fromValue(object.limit) : Long.UZERO, countTotal: isSet(object.countTotal) ? Boolean(object.countTotal) : false, reverse: isSet(object.reverse) ? Boolean(object.reverse) : false, - }; + } }, toJSON(message: PageRequest): unknown { - const obj: any = {}; + const obj: any = {} message.key !== undefined && - (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); - message.offset !== undefined && (obj.offset = (message.offset || Long.UZERO).toString()); - message.limit !== undefined && (obj.limit = (message.limit || Long.UZERO).toString()); - message.countTotal !== undefined && (obj.countTotal = message.countTotal); - message.reverse !== undefined && (obj.reverse = message.reverse); - return obj; + (obj.key = base64FromBytes( + message.key !== undefined ? message.key : new Uint8Array(), + )) + message.offset !== undefined && + (obj.offset = (message.offset || Long.UZERO).toString()) + message.limit !== undefined && + (obj.limit = (message.limit || Long.UZERO).toString()) + message.countTotal !== undefined && (obj.countTotal = message.countTotal) + message.reverse !== undefined && (obj.reverse = message.reverse) + return obj }, fromPartial, I>>(object: I): PageRequest { - const message = createBasePageRequest(); - message.key = object.key ?? new Uint8Array(); - message.offset = (object.offset !== undefined && object.offset !== null) - ? Long.fromValue(object.offset) - : Long.UZERO; - message.limit = (object.limit !== undefined && object.limit !== null) ? Long.fromValue(object.limit) : Long.UZERO; - message.countTotal = object.countTotal ?? false; - message.reverse = object.reverse ?? false; - return message; + const message = createBasePageRequest() + message.key = object.key ?? new Uint8Array() + message.offset = + object.offset !== undefined && object.offset !== null + ? Long.fromValue(object.offset) + : Long.UZERO + message.limit = + object.limit !== undefined && object.limit !== null + ? Long.fromValue(object.limit) + : Long.UZERO + message.countTotal = object.countTotal ?? false + message.reverse = object.reverse ?? false + return message }, -}; +} function createBasePageResponse(): PageResponse { - return { nextKey: new Uint8Array(), total: Long.UZERO }; + return { nextKey: new Uint8Array(), total: Long.UZERO } } export const PageResponse = { encode(message: PageResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.nextKey.length !== 0) { - writer.uint32(10).bytes(message.nextKey); + writer.uint32(10).bytes(message.nextKey) } if (!message.total.isZero()) { - writer.uint32(16).uint64(message.total); + writer.uint32(16).uint64(message.total) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): PageResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBasePageResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBasePageResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.nextKey = reader.bytes(); - break; + message.nextKey = reader.bytes() + break case 2: - message.total = reader.uint64() as Long; - break; + message.total = reader.uint64() as Long + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): PageResponse { return { - nextKey: isSet(object.nextKey) ? bytesFromBase64(object.nextKey) : new Uint8Array(), + nextKey: isSet(object.nextKey) + ? bytesFromBase64(object.nextKey) + : new Uint8Array(), total: isSet(object.total) ? Long.fromValue(object.total) : Long.UZERO, - }; + } }, toJSON(message: PageResponse): unknown { - const obj: any = {}; + const obj: any = {} message.nextKey !== undefined && - (obj.nextKey = base64FromBytes(message.nextKey !== undefined ? message.nextKey : new Uint8Array())); - message.total !== undefined && (obj.total = (message.total || Long.UZERO).toString()); - return obj; + (obj.nextKey = base64FromBytes( + message.nextKey !== undefined ? message.nextKey : new Uint8Array(), + )) + message.total !== undefined && + (obj.total = (message.total || Long.UZERO).toString()) + return obj }, fromPartial, I>>(object: I): PageResponse { - const message = createBasePageResponse(); - message.nextKey = object.nextKey ?? new Uint8Array(); - message.total = (object.total !== undefined && object.total !== null) ? Long.fromValue(object.total) : Long.UZERO; - return message; + const message = createBasePageResponse() + message.nextKey = object.nextKey ?? new Uint8Array() + message.total = + object.total !== undefined && object.total !== null + ? Long.fromValue(object.total) + : Long.UZERO + return message }, -}; +} -declare var self: any | undefined; -declare var window: any | undefined; -declare var global: any | undefined; +declare var self: any | undefined +declare var window: any | undefined +declare var global: any | undefined var globalThis: any = (() => { - if (typeof globalThis !== "undefined") { - return globalThis; - } - if (typeof self !== "undefined") { - return self; - } - if (typeof window !== "undefined") { - return window; - } - if (typeof global !== "undefined") { - return global; - } - throw "Unable to locate global object"; -})(); + if (typeof globalThis !== "undefined") return globalThis + if (typeof self !== "undefined") return self + if (typeof window !== "undefined") return window + if (typeof global !== "undefined") return global + throw "Unable to locate global object" +})() +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")) function bytesFromBase64(b64: string): Uint8Array { - if (globalThis.Buffer) { - return Uint8Array.from(globalThis.Buffer.from(b64, "base64")); - } else { - const bin = globalThis.atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; + 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 } +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")) function base64FromBytes(arr: Uint8Array): string { - if (globalThis.Buffer) { - return globalThis.Buffer.from(arr).toString("base64"); - } else { - const bin: string[] = []; - arr.forEach((byte) => { - bin.push(String.fromCharCode(byte)); - }); - return globalThis.btoa(bin.join("")); - } + const bin: string[] = [] + arr.forEach((byte) => { + bin.push(String.fromCharCode(byte)) + }) + return btoa(bin.join("")) } -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/cosmos/base/reflection/v1beta1/reflection.ts b/packages/protojs/src/cosmos/base/reflection/v1beta1/reflection.ts index 5954edee..d6a6eab4 100644 --- a/packages/protojs/src/cosmos/base/reflection/v1beta1/reflection.ts +++ b/packages/protojs/src/cosmos/base/reflection/v1beta1/reflection.ts @@ -1,17 +1,16 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "cosmos.base.reflection.v1beta1"; +export const protobufPackage = "cosmos.base.reflection.v1beta1" /** ListAllInterfacesRequest is the request type of the ListAllInterfaces RPC. */ -export interface ListAllInterfacesRequest { -} +export interface ListAllInterfacesRequest {} /** ListAllInterfacesResponse is the response type of the ListAllInterfaces RPC. */ export interface ListAllInterfacesResponse { /** interface_names is an array of all the registered interfaces. */ - interfaceNames: string[]; + interfaceNames: string[] } /** @@ -20,7 +19,7 @@ export interface ListAllInterfacesResponse { */ export interface ListImplementationsRequest { /** interface_name defines the interface to query the implementations for. */ - interfaceName: string; + interfaceName: string } /** @@ -28,176 +27,198 @@ export interface ListImplementationsRequest { * RPC. */ export interface ListImplementationsResponse { - implementationMessageNames: string[]; + implementationMessageNames: string[] } function createBaseListAllInterfacesRequest(): ListAllInterfacesRequest { - return {}; + return {} } export const ListAllInterfacesRequest = { - encode(_: ListAllInterfacesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; + encode( + _: ListAllInterfacesRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): ListAllInterfacesRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseListAllInterfacesRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseListAllInterfacesRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(_: any): ListAllInterfacesRequest { - return {}; + return {} }, toJSON(_: ListAllInterfacesRequest): unknown { - const obj: any = {}; - return obj; + const obj: any = {} + return obj }, - fromPartial, I>>(_: I): ListAllInterfacesRequest { - const message = createBaseListAllInterfacesRequest(); - return message; + fromPartial, I>>( + _: I, + ): ListAllInterfacesRequest { + const message = createBaseListAllInterfacesRequest() + return message }, -}; +} function createBaseListAllInterfacesResponse(): ListAllInterfacesResponse { - return { interfaceNames: [] }; + return { interfaceNames: [] } } export const ListAllInterfacesResponse = { - encode(message: ListAllInterfacesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: ListAllInterfacesResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { for (const v of message.interfaceNames) { - writer.uint32(10).string(v!); + writer.uint32(10).string(v!) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): ListAllInterfacesResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseListAllInterfacesResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseListAllInterfacesResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.interfaceNames.push(reader.string()); - break; + message.interfaceNames.push(reader.string()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): ListAllInterfacesResponse { return { - interfaceNames: Array.isArray(object?.interfaceNames) ? object.interfaceNames.map((e: any) => String(e)) : [], - }; + interfaceNames: Array.isArray(object?.interfaceNames) + ? object.interfaceNames.map((e: any) => String(e)) + : [], + } }, toJSON(message: ListAllInterfacesResponse): unknown { - const obj: any = {}; + const obj: any = {} if (message.interfaceNames) { - obj.interfaceNames = message.interfaceNames.map((e) => e); + obj.interfaceNames = message.interfaceNames.map((e) => e) } else { - obj.interfaceNames = []; + obj.interfaceNames = [] } - return obj; + return obj }, - fromPartial, I>>(object: I): ListAllInterfacesResponse { - const message = createBaseListAllInterfacesResponse(); - message.interfaceNames = object.interfaceNames?.map((e) => e) || []; - return message; + fromPartial, I>>( + object: I, + ): ListAllInterfacesResponse { + const message = createBaseListAllInterfacesResponse() + message.interfaceNames = object.interfaceNames?.map((e) => e) || [] + return message }, -}; +} function createBaseListImplementationsRequest(): ListImplementationsRequest { - return { interfaceName: "" }; + return { interfaceName: "" } } export const ListImplementationsRequest = { - encode(message: ListImplementationsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: ListImplementationsRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.interfaceName !== "") { - writer.uint32(10).string(message.interfaceName); + writer.uint32(10).string(message.interfaceName) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): ListImplementationsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseListImplementationsRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseListImplementationsRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.interfaceName = reader.string(); - break; + message.interfaceName = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): ListImplementationsRequest { - return { interfaceName: isSet(object.interfaceName) ? String(object.interfaceName) : "" }; + return { + interfaceName: isSet(object.interfaceName) ? String(object.interfaceName) : "", + } }, toJSON(message: ListImplementationsRequest): unknown { - const obj: any = {}; - message.interfaceName !== undefined && (obj.interfaceName = message.interfaceName); - return obj; + const obj: any = {} + message.interfaceName !== undefined && (obj.interfaceName = message.interfaceName) + return obj }, - fromPartial, I>>(object: I): ListImplementationsRequest { - const message = createBaseListImplementationsRequest(); - message.interfaceName = object.interfaceName ?? ""; - return message; + fromPartial, I>>( + object: I, + ): ListImplementationsRequest { + const message = createBaseListImplementationsRequest() + message.interfaceName = object.interfaceName ?? "" + return message }, -}; +} function createBaseListImplementationsResponse(): ListImplementationsResponse { - return { implementationMessageNames: [] }; + return { implementationMessageNames: [] } } export const ListImplementationsResponse = { - encode(message: ListImplementationsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: ListImplementationsResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { for (const v of message.implementationMessageNames) { - writer.uint32(10).string(v!); + writer.uint32(10).string(v!) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): ListImplementationsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseListImplementationsResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseListImplementationsResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.implementationMessageNames.push(reader.string()); - break; + message.implementationMessageNames.push(reader.string()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): ListImplementationsResponse { @@ -205,25 +226,28 @@ export const ListImplementationsResponse = { implementationMessageNames: Array.isArray(object?.implementationMessageNames) ? object.implementationMessageNames.map((e: any) => String(e)) : [], - }; + } }, toJSON(message: ListImplementationsResponse): unknown { - const obj: any = {}; + const obj: any = {} if (message.implementationMessageNames) { - obj.implementationMessageNames = message.implementationMessageNames.map((e) => e); + obj.implementationMessageNames = message.implementationMessageNames.map((e) => e) } else { - obj.implementationMessageNames = []; + obj.implementationMessageNames = [] } - return obj; + return obj }, - fromPartial, I>>(object: I): ListImplementationsResponse { - const message = createBaseListImplementationsResponse(); - message.implementationMessageNames = object.implementationMessageNames?.map((e) => e) || []; - return message; + fromPartial, I>>( + object: I, + ): ListImplementationsResponse { + const message = createBaseListImplementationsResponse() + message.implementationMessageNames = + object.implementationMessageNames?.map((e) => e) || [] + return message }, -}; +} /** ReflectionService defines a service for interface reflection. */ export interface ReflectionService { @@ -231,55 +255,85 @@ export interface ReflectionService { * ListAllInterfaces lists all the interfaces registered in the interface * registry. */ - ListAllInterfaces(request: ListAllInterfacesRequest): Promise; + ListAllInterfaces( + request: ListAllInterfacesRequest, + ): Promise /** * ListImplementations list all the concrete types that implement a given * interface. */ - ListImplementations(request: ListImplementationsRequest): Promise; + ListImplementations( + request: ListImplementationsRequest, + ): Promise } export class ReflectionServiceClientImpl implements ReflectionService { - private readonly rpc: Rpc; + private readonly rpc: Rpc constructor(rpc: Rpc) { - this.rpc = rpc; - this.ListAllInterfaces = this.ListAllInterfaces.bind(this); - this.ListImplementations = this.ListImplementations.bind(this); + this.rpc = rpc + this.ListAllInterfaces = this.ListAllInterfaces.bind(this) + this.ListImplementations = this.ListImplementations.bind(this) } - ListAllInterfaces(request: ListAllInterfacesRequest): Promise { - const data = ListAllInterfacesRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.base.reflection.v1beta1.ReflectionService", "ListAllInterfaces", data); - return promise.then((data) => ListAllInterfacesResponse.decode(new _m0.Reader(data))); + ListAllInterfaces( + request: ListAllInterfacesRequest, + ): Promise { + const data = ListAllInterfacesRequest.encode(request).finish() + const promise = this.rpc.request( + "cosmos.base.reflection.v1beta1.ReflectionService", + "ListAllInterfaces", + data, + ) + return promise.then((data) => + ListAllInterfacesResponse.decode(new _m0.Reader(data)), + ) } - ListImplementations(request: ListImplementationsRequest): Promise { - const data = ListImplementationsRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.base.reflection.v1beta1.ReflectionService", "ListImplementations", data); - return promise.then((data) => ListImplementationsResponse.decode(new _m0.Reader(data))); + ListImplementations( + request: ListImplementationsRequest, + ): Promise { + const data = ListImplementationsRequest.encode(request).finish() + const promise = this.rpc.request( + "cosmos.base.reflection.v1beta1.ReflectionService", + "ListImplementations", + data, + ) + return promise.then((data) => + ListImplementationsResponse.decode(new _m0.Reader(data)), + ) } } interface Rpc { - request(service: string, method: string, data: Uint8Array): Promise; + request(service: string, method: string, data: Uint8Array): Promise } -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/cosmos/base/reflection/v2alpha1/reflection.ts b/packages/protojs/src/cosmos/base/reflection/v2alpha1/reflection.ts index 788b6bf1..a39dafba 100644 --- a/packages/protojs/src/cosmos/base/reflection/v2alpha1/reflection.ts +++ b/packages/protojs/src/cosmos/base/reflection/v2alpha1/reflection.ts @@ -1,8 +1,8 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "cosmos.base.reflection.v2alpha1"; +export const protobufPackage = "cosmos.base.reflection.v2alpha1" /** Since: cosmos-sdk 0.43 */ @@ -12,17 +12,17 @@ export interface AppDescriptor { * AuthnDescriptor provides information on how to authenticate transactions on the application * NOTE: experimental and subject to change in future releases. */ - authn?: AuthnDescriptor; + authn?: AuthnDescriptor /** chain provides the chain descriptor */ - chain?: ChainDescriptor; + chain?: ChainDescriptor /** codec provides metadata information regarding codec related types */ - codec?: CodecDescriptor; + codec?: CodecDescriptor /** configuration provides metadata information regarding the sdk.Config type */ - configuration?: ConfigurationDescriptor; + configuration?: ConfigurationDescriptor /** query_services provides metadata information regarding the available queriable endpoints */ - queryServices?: QueryServicesDescriptor; + queryServices?: QueryServicesDescriptor /** tx provides metadata information regarding how to send transactions to the given application */ - tx?: TxDescriptor; + tx?: TxDescriptor } /** TxDescriptor describes the accepted transaction type */ @@ -32,9 +32,9 @@ export interface TxDescriptor { * it is not meant to support polymorphism of transaction types, it is supposed to be used by * reflection clients to understand if they can handle a specific transaction type in an application. */ - fullname: string; + fullname: string /** msgs lists the accepted application messages (sdk.Msg) */ - msgs: MsgDescriptor[]; + msgs: MsgDescriptor[] } /** @@ -43,7 +43,7 @@ export interface TxDescriptor { */ export interface AuthnDescriptor { /** sign_modes defines the supported signature algorithm */ - signModes: SigningModeDescriptor[]; + signModes: SigningModeDescriptor[] } /** @@ -54,52 +54,52 @@ export interface AuthnDescriptor { */ export interface SigningModeDescriptor { /** name defines the unique name of the signing mode */ - name: string; + name: string /** number is the unique int32 identifier for the sign_mode enum */ - number: number; + number: number /** * authn_info_provider_method_fullname defines the fullname of the method to call to get * the metadata required to authenticate using the provided sign_modes */ - authnInfoProviderMethodFullname: string; + authnInfoProviderMethodFullname: string } /** ChainDescriptor describes chain information of the application */ export interface ChainDescriptor { /** id is the chain id */ - id: string; + id: string } /** CodecDescriptor describes the registered interfaces and provides metadata information on the types */ export interface CodecDescriptor { /** interfaces is a list of the registerted interfaces descriptors */ - interfaces: InterfaceDescriptor[]; + interfaces: InterfaceDescriptor[] } /** InterfaceDescriptor describes the implementation of an interface */ export interface InterfaceDescriptor { /** fullname is the name of the interface */ - fullname: string; + fullname: string /** * interface_accepting_messages contains information regarding the proto messages which contain the interface as * google.protobuf.Any field */ - interfaceAcceptingMessages: InterfaceAcceptingMessageDescriptor[]; + interfaceAcceptingMessages: InterfaceAcceptingMessageDescriptor[] /** interface_implementers is a list of the descriptors of the interface implementers */ - interfaceImplementers: InterfaceImplementerDescriptor[]; + interfaceImplementers: InterfaceImplementerDescriptor[] } /** InterfaceImplementerDescriptor describes an interface implementer */ export interface InterfaceImplementerDescriptor { /** fullname is the protobuf queryable name of the interface implementer */ - fullname: string; + fullname: string /** * type_url defines the type URL used when marshalling the type as any * this is required so we can provide type safe google.protobuf.Any marshalling and * unmarshalling, making sure that we don't accept just 'any' type * in our interface fields */ - typeUrl: string; + typeUrl: string } /** @@ -108,80 +108,74 @@ export interface InterfaceImplementerDescriptor { */ export interface InterfaceAcceptingMessageDescriptor { /** fullname is the protobuf fullname of the type containing the interface */ - fullname: string; + fullname: string /** * field_descriptor_names is a list of the protobuf name (not fullname) of the field * which contains the interface as google.protobuf.Any (the interface is the same, but * it can be in multiple fields of the same proto message) */ - fieldDescriptorNames: string[]; + fieldDescriptorNames: string[] } /** ConfigurationDescriptor contains metadata information on the sdk.Config */ export interface ConfigurationDescriptor { /** bech32_account_address_prefix is the account address prefix */ - bech32AccountAddressPrefix: string; + bech32AccountAddressPrefix: string } /** MsgDescriptor describes a cosmos-sdk message that can be delivered with a transaction */ export interface MsgDescriptor { /** msg_type_url contains the TypeURL of a sdk.Msg. */ - msgTypeUrl: string; + msgTypeUrl: string } /** GetAuthnDescriptorRequest is the request used for the GetAuthnDescriptor RPC */ -export interface GetAuthnDescriptorRequest { -} +export interface GetAuthnDescriptorRequest {} /** GetAuthnDescriptorResponse is the response returned by the GetAuthnDescriptor RPC */ export interface GetAuthnDescriptorResponse { /** authn describes how to authenticate to the application when sending transactions */ - authn?: AuthnDescriptor; + authn?: AuthnDescriptor } /** GetChainDescriptorRequest is the request used for the GetChainDescriptor RPC */ -export interface GetChainDescriptorRequest { -} +export interface GetChainDescriptorRequest {} /** GetChainDescriptorResponse is the response returned by the GetChainDescriptor RPC */ export interface GetChainDescriptorResponse { /** chain describes application chain information */ - chain?: ChainDescriptor; + chain?: ChainDescriptor } /** GetCodecDescriptorRequest is the request used for the GetCodecDescriptor RPC */ -export interface GetCodecDescriptorRequest { -} +export interface GetCodecDescriptorRequest {} /** GetCodecDescriptorResponse is the response returned by the GetCodecDescriptor RPC */ export interface GetCodecDescriptorResponse { /** codec describes the application codec such as registered interfaces and implementations */ - codec?: CodecDescriptor; + codec?: CodecDescriptor } /** GetConfigurationDescriptorRequest is the request used for the GetConfigurationDescriptor RPC */ -export interface GetConfigurationDescriptorRequest { -} +export interface GetConfigurationDescriptorRequest {} /** GetConfigurationDescriptorResponse is the response returned by the GetConfigurationDescriptor RPC */ export interface GetConfigurationDescriptorResponse { /** config describes the application's sdk.Config */ - config?: ConfigurationDescriptor; + config?: ConfigurationDescriptor } /** GetQueryServicesDescriptorRequest is the request used for the GetQueryServicesDescriptor RPC */ -export interface GetQueryServicesDescriptorRequest { -} +export interface GetQueryServicesDescriptorRequest {} /** GetQueryServicesDescriptorResponse is the response returned by the GetQueryServicesDescriptor RPC */ export interface GetQueryServicesDescriptorResponse { /** queries provides information on the available queryable services */ - queries?: QueryServicesDescriptor; + queries?: QueryServicesDescriptor } /** GetTxDescriptorRequest is the request used for the GetTxDescriptor RPC */ -export interface GetTxDescriptorRequest { -} +export interface GetTxDescriptorRequest {} /** GetTxDescriptorResponse is the response returned by the GetTxDescriptor RPC */ export interface GetTxDescriptorResponse { @@ -189,23 +183,23 @@ export interface GetTxDescriptorResponse { * tx provides information on msgs that can be forwarded to the application * alongside the accepted transaction protobuf type */ - tx?: TxDescriptor; + tx?: TxDescriptor } /** QueryServicesDescriptor contains the list of cosmos-sdk queriable services */ export interface QueryServicesDescriptor { /** query_services is a list of cosmos-sdk QueryServiceDescriptor */ - queryServices: QueryServiceDescriptor[]; + queryServices: QueryServiceDescriptor[] } /** QueryServiceDescriptor describes a cosmos-sdk queryable service */ export interface QueryServiceDescriptor { /** fullname is the protobuf fullname of the service descriptor */ - fullname: string; + fullname: string /** is_module describes if this service is actually exposed by an application's module */ - isModule: boolean; + isModule: boolean /** methods provides a list of query service methods */ - methods: QueryMethodDescriptor[]; + methods: QueryMethodDescriptor[] } /** @@ -215,12 +209,12 @@ export interface QueryServiceDescriptor { */ export interface QueryMethodDescriptor { /** name is the protobuf name (not fullname) of the method */ - name: string; + name: string /** * full_query_path is the path that can be used to query * this method via tendermint abci.Query */ - fullQueryPath: string; + fullQueryPath: string } function createBaseAppDescriptor(): AppDescriptor { @@ -231,63 +225,75 @@ function createBaseAppDescriptor(): AppDescriptor { configuration: undefined, queryServices: undefined, tx: undefined, - }; + } } export const AppDescriptor = { encode(message: AppDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.authn !== undefined) { - AuthnDescriptor.encode(message.authn, writer.uint32(10).fork()).ldelim(); + AuthnDescriptor.encode(message.authn, writer.uint32(10).fork()).ldelim() } if (message.chain !== undefined) { - ChainDescriptor.encode(message.chain, writer.uint32(18).fork()).ldelim(); + ChainDescriptor.encode(message.chain, writer.uint32(18).fork()).ldelim() } if (message.codec !== undefined) { - CodecDescriptor.encode(message.codec, writer.uint32(26).fork()).ldelim(); + CodecDescriptor.encode(message.codec, writer.uint32(26).fork()).ldelim() } if (message.configuration !== undefined) { - ConfigurationDescriptor.encode(message.configuration, writer.uint32(34).fork()).ldelim(); + ConfigurationDescriptor.encode( + message.configuration, + writer.uint32(34).fork(), + ).ldelim() } if (message.queryServices !== undefined) { - QueryServicesDescriptor.encode(message.queryServices, writer.uint32(42).fork()).ldelim(); + QueryServicesDescriptor.encode( + message.queryServices, + writer.uint32(42).fork(), + ).ldelim() } if (message.tx !== undefined) { - TxDescriptor.encode(message.tx, writer.uint32(50).fork()).ldelim(); + TxDescriptor.encode(message.tx, writer.uint32(50).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): AppDescriptor { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseAppDescriptor(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseAppDescriptor() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.authn = AuthnDescriptor.decode(reader, reader.uint32()); - break; + message.authn = AuthnDescriptor.decode(reader, reader.uint32()) + break case 2: - message.chain = ChainDescriptor.decode(reader, reader.uint32()); - break; + message.chain = ChainDescriptor.decode(reader, reader.uint32()) + break case 3: - message.codec = CodecDescriptor.decode(reader, reader.uint32()); - break; + message.codec = CodecDescriptor.decode(reader, reader.uint32()) + break case 4: - message.configuration = ConfigurationDescriptor.decode(reader, reader.uint32()); - break; + message.configuration = ConfigurationDescriptor.decode( + reader, + reader.uint32(), + ) + break case 5: - message.queryServices = QueryServicesDescriptor.decode(reader, reader.uint32()); - break; + message.queryServices = QueryServicesDescriptor.decode( + reader, + reader.uint32(), + ) + break case 6: - message.tx = TxDescriptor.decode(reader, reader.uint32()); - break; + message.tx = TxDescriptor.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): AppDescriptor { @@ -295,137 +301,164 @@ export const AppDescriptor = { authn: isSet(object.authn) ? AuthnDescriptor.fromJSON(object.authn) : undefined, chain: isSet(object.chain) ? ChainDescriptor.fromJSON(object.chain) : undefined, codec: isSet(object.codec) ? CodecDescriptor.fromJSON(object.codec) : undefined, - configuration: isSet(object.configuration) ? ConfigurationDescriptor.fromJSON(object.configuration) : undefined, - queryServices: isSet(object.queryServices) ? QueryServicesDescriptor.fromJSON(object.queryServices) : undefined, + configuration: isSet(object.configuration) + ? ConfigurationDescriptor.fromJSON(object.configuration) + : undefined, + queryServices: isSet(object.queryServices) + ? QueryServicesDescriptor.fromJSON(object.queryServices) + : undefined, tx: isSet(object.tx) ? TxDescriptor.fromJSON(object.tx) : undefined, - }; + } }, toJSON(message: AppDescriptor): unknown { - const obj: any = {}; - message.authn !== undefined && (obj.authn = message.authn ? AuthnDescriptor.toJSON(message.authn) : undefined); - message.chain !== undefined && (obj.chain = message.chain ? ChainDescriptor.toJSON(message.chain) : undefined); - message.codec !== undefined && (obj.codec = message.codec ? CodecDescriptor.toJSON(message.codec) : undefined); + const obj: any = {} + message.authn !== undefined && + (obj.authn = message.authn ? AuthnDescriptor.toJSON(message.authn) : undefined) + message.chain !== undefined && + (obj.chain = message.chain ? ChainDescriptor.toJSON(message.chain) : undefined) + message.codec !== undefined && + (obj.codec = message.codec ? CodecDescriptor.toJSON(message.codec) : undefined) message.configuration !== undefined && - (obj.configuration = message.configuration ? ConfigurationDescriptor.toJSON(message.configuration) : undefined); + (obj.configuration = message.configuration + ? ConfigurationDescriptor.toJSON(message.configuration) + : undefined) message.queryServices !== undefined && - (obj.queryServices = message.queryServices ? QueryServicesDescriptor.toJSON(message.queryServices) : undefined); - message.tx !== undefined && (obj.tx = message.tx ? TxDescriptor.toJSON(message.tx) : undefined); - return obj; - }, - - fromPartial, I>>(object: I): AppDescriptor { - const message = createBaseAppDescriptor(); - message.authn = (object.authn !== undefined && object.authn !== null) - ? AuthnDescriptor.fromPartial(object.authn) - : undefined; - message.chain = (object.chain !== undefined && object.chain !== null) - ? ChainDescriptor.fromPartial(object.chain) - : undefined; - message.codec = (object.codec !== undefined && object.codec !== null) - ? CodecDescriptor.fromPartial(object.codec) - : undefined; - message.configuration = (object.configuration !== undefined && object.configuration !== null) - ? ConfigurationDescriptor.fromPartial(object.configuration) - : undefined; - message.queryServices = (object.queryServices !== undefined && object.queryServices !== null) - ? QueryServicesDescriptor.fromPartial(object.queryServices) - : undefined; - message.tx = (object.tx !== undefined && object.tx !== null) ? TxDescriptor.fromPartial(object.tx) : undefined; - return message; - }, -}; + (obj.queryServices = message.queryServices + ? QueryServicesDescriptor.toJSON(message.queryServices) + : undefined) + message.tx !== undefined && + (obj.tx = message.tx ? TxDescriptor.toJSON(message.tx) : undefined) + return obj + }, + + fromPartial, I>>( + object: I, + ): AppDescriptor { + const message = createBaseAppDescriptor() + message.authn = + object.authn !== undefined && object.authn !== null + ? AuthnDescriptor.fromPartial(object.authn) + : undefined + message.chain = + object.chain !== undefined && object.chain !== null + ? ChainDescriptor.fromPartial(object.chain) + : undefined + message.codec = + object.codec !== undefined && object.codec !== null + ? CodecDescriptor.fromPartial(object.codec) + : undefined + message.configuration = + object.configuration !== undefined && object.configuration !== null + ? ConfigurationDescriptor.fromPartial(object.configuration) + : undefined + message.queryServices = + object.queryServices !== undefined && object.queryServices !== null + ? QueryServicesDescriptor.fromPartial(object.queryServices) + : undefined + message.tx = + object.tx !== undefined && object.tx !== null + ? TxDescriptor.fromPartial(object.tx) + : undefined + return message + }, +} function createBaseTxDescriptor(): TxDescriptor { - return { fullname: "", msgs: [] }; + return { fullname: "", msgs: [] } } export const TxDescriptor = { encode(message: TxDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.fullname !== "") { - writer.uint32(10).string(message.fullname); + writer.uint32(10).string(message.fullname) } for (const v of message.msgs) { - MsgDescriptor.encode(v!, writer.uint32(18).fork()).ldelim(); + MsgDescriptor.encode(v!, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): TxDescriptor { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseTxDescriptor(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseTxDescriptor() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.fullname = reader.string(); - break; + message.fullname = reader.string() + break case 2: - message.msgs.push(MsgDescriptor.decode(reader, reader.uint32())); - break; + message.msgs.push(MsgDescriptor.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): TxDescriptor { return { fullname: isSet(object.fullname) ? String(object.fullname) : "", - msgs: Array.isArray(object?.msgs) ? object.msgs.map((e: any) => MsgDescriptor.fromJSON(e)) : [], - }; + msgs: Array.isArray(object?.msgs) + ? object.msgs.map((e: any) => MsgDescriptor.fromJSON(e)) + : [], + } }, toJSON(message: TxDescriptor): unknown { - const obj: any = {}; - message.fullname !== undefined && (obj.fullname = message.fullname); + const obj: any = {} + message.fullname !== undefined && (obj.fullname = message.fullname) if (message.msgs) { - obj.msgs = message.msgs.map((e) => e ? MsgDescriptor.toJSON(e) : undefined); + obj.msgs = message.msgs.map((e) => (e ? MsgDescriptor.toJSON(e) : undefined)) } else { - obj.msgs = []; + obj.msgs = [] } - return obj; + return obj }, fromPartial, I>>(object: I): TxDescriptor { - const message = createBaseTxDescriptor(); - message.fullname = object.fullname ?? ""; - message.msgs = object.msgs?.map((e) => MsgDescriptor.fromPartial(e)) || []; - return message; + const message = createBaseTxDescriptor() + message.fullname = object.fullname ?? "" + message.msgs = object.msgs?.map((e) => MsgDescriptor.fromPartial(e)) || [] + return message }, -}; +} function createBaseAuthnDescriptor(): AuthnDescriptor { - return { signModes: [] }; + return { signModes: [] } } export const AuthnDescriptor = { - encode(message: AuthnDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: AuthnDescriptor, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { for (const v of message.signModes) { - SigningModeDescriptor.encode(v!, writer.uint32(10).fork()).ldelim(); + SigningModeDescriptor.encode(v!, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): AuthnDescriptor { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseAuthnDescriptor(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseAuthnDescriptor() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.signModes.push(SigningModeDescriptor.decode(reader, reader.uint32())); - break; + message.signModes.push(SigningModeDescriptor.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): AuthnDescriptor { @@ -433,66 +466,74 @@ export const AuthnDescriptor = { signModes: Array.isArray(object?.signModes) ? object.signModes.map((e: any) => SigningModeDescriptor.fromJSON(e)) : [], - }; + } }, toJSON(message: AuthnDescriptor): unknown { - const obj: any = {}; + const obj: any = {} if (message.signModes) { - obj.signModes = message.signModes.map((e) => e ? SigningModeDescriptor.toJSON(e) : undefined); + obj.signModes = message.signModes.map((e) => + e ? SigningModeDescriptor.toJSON(e) : undefined, + ) } else { - obj.signModes = []; + obj.signModes = [] } - return obj; + return obj }, - fromPartial, I>>(object: I): AuthnDescriptor { - const message = createBaseAuthnDescriptor(); - message.signModes = object.signModes?.map((e) => SigningModeDescriptor.fromPartial(e)) || []; - return message; + fromPartial, I>>( + object: I, + ): AuthnDescriptor { + const message = createBaseAuthnDescriptor() + message.signModes = + object.signModes?.map((e) => SigningModeDescriptor.fromPartial(e)) || [] + return message }, -}; +} function createBaseSigningModeDescriptor(): SigningModeDescriptor { - return { name: "", number: 0, authnInfoProviderMethodFullname: "" }; + return { name: "", number: 0, authnInfoProviderMethodFullname: "" } } export const SigningModeDescriptor = { - encode(message: SigningModeDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: SigningModeDescriptor, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.name !== "") { - writer.uint32(10).string(message.name); + writer.uint32(10).string(message.name) } if (message.number !== 0) { - writer.uint32(16).int32(message.number); + writer.uint32(16).int32(message.number) } if (message.authnInfoProviderMethodFullname !== "") { - writer.uint32(26).string(message.authnInfoProviderMethodFullname); + writer.uint32(26).string(message.authnInfoProviderMethodFullname) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): SigningModeDescriptor { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSigningModeDescriptor(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseSigningModeDescriptor() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.name = reader.string(); - break; + message.name = reader.string() + break case 2: - message.number = reader.int32(); - break; + message.number = reader.int32() + break case 3: - message.authnInfoProviderMethodFullname = reader.string(); - break; + message.authnInfoProviderMethodFullname = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): SigningModeDescriptor { @@ -502,102 +543,115 @@ export const SigningModeDescriptor = { authnInfoProviderMethodFullname: isSet(object.authnInfoProviderMethodFullname) ? String(object.authnInfoProviderMethodFullname) : "", - }; + } }, toJSON(message: SigningModeDescriptor): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.number !== undefined && (obj.number = Math.round(message.number)); + const obj: any = {} + message.name !== undefined && (obj.name = message.name) + message.number !== undefined && (obj.number = Math.round(message.number)) message.authnInfoProviderMethodFullname !== undefined && - (obj.authnInfoProviderMethodFullname = message.authnInfoProviderMethodFullname); - return obj; + (obj.authnInfoProviderMethodFullname = message.authnInfoProviderMethodFullname) + return obj }, - fromPartial, I>>(object: I): SigningModeDescriptor { - const message = createBaseSigningModeDescriptor(); - message.name = object.name ?? ""; - message.number = object.number ?? 0; - message.authnInfoProviderMethodFullname = object.authnInfoProviderMethodFullname ?? ""; - return message; + fromPartial, I>>( + object: I, + ): SigningModeDescriptor { + const message = createBaseSigningModeDescriptor() + message.name = object.name ?? "" + message.number = object.number ?? 0 + message.authnInfoProviderMethodFullname = + object.authnInfoProviderMethodFullname ?? "" + return message }, -}; +} function createBaseChainDescriptor(): ChainDescriptor { - return { id: "" }; + return { id: "" } } export const ChainDescriptor = { - encode(message: ChainDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: ChainDescriptor, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.id !== "") { - writer.uint32(10).string(message.id); + writer.uint32(10).string(message.id) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): ChainDescriptor { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseChainDescriptor(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseChainDescriptor() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.id = reader.string(); - break; + message.id = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): ChainDescriptor { - return { id: isSet(object.id) ? String(object.id) : "" }; + return { + id: isSet(object.id) ? String(object.id) : "", + } }, toJSON(message: ChainDescriptor): unknown { - const obj: any = {}; - message.id !== undefined && (obj.id = message.id); - return obj; + const obj: any = {} + message.id !== undefined && (obj.id = message.id) + return obj }, - fromPartial, I>>(object: I): ChainDescriptor { - const message = createBaseChainDescriptor(); - message.id = object.id ?? ""; - return message; + fromPartial, I>>( + object: I, + ): ChainDescriptor { + const message = createBaseChainDescriptor() + message.id = object.id ?? "" + return message }, -}; +} function createBaseCodecDescriptor(): CodecDescriptor { - return { interfaces: [] }; + return { interfaces: [] } } export const CodecDescriptor = { - encode(message: CodecDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: CodecDescriptor, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { for (const v of message.interfaces) { - InterfaceDescriptor.encode(v!, writer.uint32(10).fork()).ldelim(); + InterfaceDescriptor.encode(v!, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): CodecDescriptor { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseCodecDescriptor(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseCodecDescriptor() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.interfaces.push(InterfaceDescriptor.decode(reader, reader.uint32())); - break; + message.interfaces.push(InterfaceDescriptor.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): CodecDescriptor { @@ -605,205 +659,239 @@ export const CodecDescriptor = { interfaces: Array.isArray(object?.interfaces) ? object.interfaces.map((e: any) => InterfaceDescriptor.fromJSON(e)) : [], - }; + } }, toJSON(message: CodecDescriptor): unknown { - const obj: any = {}; + const obj: any = {} if (message.interfaces) { - obj.interfaces = message.interfaces.map((e) => e ? InterfaceDescriptor.toJSON(e) : undefined); + obj.interfaces = message.interfaces.map((e) => + e ? InterfaceDescriptor.toJSON(e) : undefined, + ) } else { - obj.interfaces = []; + obj.interfaces = [] } - return obj; + return obj }, - fromPartial, I>>(object: I): CodecDescriptor { - const message = createBaseCodecDescriptor(); - message.interfaces = object.interfaces?.map((e) => InterfaceDescriptor.fromPartial(e)) || []; - return message; + fromPartial, I>>( + object: I, + ): CodecDescriptor { + const message = createBaseCodecDescriptor() + message.interfaces = + object.interfaces?.map((e) => InterfaceDescriptor.fromPartial(e)) || [] + return message }, -}; +} function createBaseInterfaceDescriptor(): InterfaceDescriptor { - return { fullname: "", interfaceAcceptingMessages: [], interfaceImplementers: [] }; + return { fullname: "", interfaceAcceptingMessages: [], interfaceImplementers: [] } } export const InterfaceDescriptor = { - encode(message: InterfaceDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: InterfaceDescriptor, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.fullname !== "") { - writer.uint32(10).string(message.fullname); + writer.uint32(10).string(message.fullname) } for (const v of message.interfaceAcceptingMessages) { - InterfaceAcceptingMessageDescriptor.encode(v!, writer.uint32(18).fork()).ldelim(); + InterfaceAcceptingMessageDescriptor.encode(v!, writer.uint32(18).fork()).ldelim() } for (const v of message.interfaceImplementers) { - InterfaceImplementerDescriptor.encode(v!, writer.uint32(26).fork()).ldelim(); + InterfaceImplementerDescriptor.encode(v!, writer.uint32(26).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): InterfaceDescriptor { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseInterfaceDescriptor(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseInterfaceDescriptor() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.fullname = reader.string(); - break; + message.fullname = reader.string() + break case 2: - message.interfaceAcceptingMessages.push(InterfaceAcceptingMessageDescriptor.decode(reader, reader.uint32())); - break; + message.interfaceAcceptingMessages.push( + InterfaceAcceptingMessageDescriptor.decode(reader, reader.uint32()), + ) + break case 3: - message.interfaceImplementers.push(InterfaceImplementerDescriptor.decode(reader, reader.uint32())); - break; + message.interfaceImplementers.push( + InterfaceImplementerDescriptor.decode(reader, reader.uint32()), + ) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): InterfaceDescriptor { return { fullname: isSet(object.fullname) ? String(object.fullname) : "", interfaceAcceptingMessages: Array.isArray(object?.interfaceAcceptingMessages) - ? object.interfaceAcceptingMessages.map((e: any) => InterfaceAcceptingMessageDescriptor.fromJSON(e)) + ? object.interfaceAcceptingMessages.map((e: any) => + InterfaceAcceptingMessageDescriptor.fromJSON(e), + ) : [], interfaceImplementers: Array.isArray(object?.interfaceImplementers) - ? object.interfaceImplementers.map((e: any) => InterfaceImplementerDescriptor.fromJSON(e)) + ? object.interfaceImplementers.map((e: any) => + InterfaceImplementerDescriptor.fromJSON(e), + ) : [], - }; + } }, toJSON(message: InterfaceDescriptor): unknown { - const obj: any = {}; - message.fullname !== undefined && (obj.fullname = message.fullname); + const obj: any = {} + message.fullname !== undefined && (obj.fullname = message.fullname) if (message.interfaceAcceptingMessages) { obj.interfaceAcceptingMessages = message.interfaceAcceptingMessages.map((e) => - e ? InterfaceAcceptingMessageDescriptor.toJSON(e) : undefined - ); + e ? InterfaceAcceptingMessageDescriptor.toJSON(e) : undefined, + ) } else { - obj.interfaceAcceptingMessages = []; + obj.interfaceAcceptingMessages = [] } if (message.interfaceImplementers) { obj.interfaceImplementers = message.interfaceImplementers.map((e) => - e ? InterfaceImplementerDescriptor.toJSON(e) : undefined - ); + e ? InterfaceImplementerDescriptor.toJSON(e) : undefined, + ) } else { - obj.interfaceImplementers = []; + obj.interfaceImplementers = [] } - return obj; + return obj }, - fromPartial, I>>(object: I): InterfaceDescriptor { - const message = createBaseInterfaceDescriptor(); - message.fullname = object.fullname ?? ""; + fromPartial, I>>( + object: I, + ): InterfaceDescriptor { + const message = createBaseInterfaceDescriptor() + message.fullname = object.fullname ?? "" message.interfaceAcceptingMessages = - object.interfaceAcceptingMessages?.map((e) => InterfaceAcceptingMessageDescriptor.fromPartial(e)) || []; + object.interfaceAcceptingMessages?.map((e) => + InterfaceAcceptingMessageDescriptor.fromPartial(e), + ) || [] message.interfaceImplementers = - object.interfaceImplementers?.map((e) => InterfaceImplementerDescriptor.fromPartial(e)) || []; - return message; + object.interfaceImplementers?.map((e) => + InterfaceImplementerDescriptor.fromPartial(e), + ) || [] + return message }, -}; +} function createBaseInterfaceImplementerDescriptor(): InterfaceImplementerDescriptor { - return { fullname: "", typeUrl: "" }; + return { fullname: "", typeUrl: "" } } export const InterfaceImplementerDescriptor = { - encode(message: InterfaceImplementerDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: InterfaceImplementerDescriptor, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.fullname !== "") { - writer.uint32(10).string(message.fullname); + writer.uint32(10).string(message.fullname) } if (message.typeUrl !== "") { - writer.uint32(18).string(message.typeUrl); + writer.uint32(18).string(message.typeUrl) } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): InterfaceImplementerDescriptor { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseInterfaceImplementerDescriptor(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): InterfaceImplementerDescriptor { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseInterfaceImplementerDescriptor() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.fullname = reader.string(); - break; + message.fullname = reader.string() + break case 2: - message.typeUrl = reader.string(); - break; + message.typeUrl = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): InterfaceImplementerDescriptor { return { fullname: isSet(object.fullname) ? String(object.fullname) : "", typeUrl: isSet(object.typeUrl) ? String(object.typeUrl) : "", - }; + } }, toJSON(message: InterfaceImplementerDescriptor): unknown { - const obj: any = {}; - message.fullname !== undefined && (obj.fullname = message.fullname); - message.typeUrl !== undefined && (obj.typeUrl = message.typeUrl); - return obj; + const obj: any = {} + message.fullname !== undefined && (obj.fullname = message.fullname) + message.typeUrl !== undefined && (obj.typeUrl = message.typeUrl) + return obj }, fromPartial, I>>( object: I, ): InterfaceImplementerDescriptor { - const message = createBaseInterfaceImplementerDescriptor(); - message.fullname = object.fullname ?? ""; - message.typeUrl = object.typeUrl ?? ""; - return message; + const message = createBaseInterfaceImplementerDescriptor() + message.fullname = object.fullname ?? "" + message.typeUrl = object.typeUrl ?? "" + return message }, -}; +} function createBaseInterfaceAcceptingMessageDescriptor(): InterfaceAcceptingMessageDescriptor { - return { fullname: "", fieldDescriptorNames: [] }; + return { fullname: "", fieldDescriptorNames: [] } } export const InterfaceAcceptingMessageDescriptor = { - encode(message: InterfaceAcceptingMessageDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: InterfaceAcceptingMessageDescriptor, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.fullname !== "") { - writer.uint32(10).string(message.fullname); + writer.uint32(10).string(message.fullname) } for (const v of message.fieldDescriptorNames) { - writer.uint32(18).string(v!); + writer.uint32(18).string(v!) } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): InterfaceAcceptingMessageDescriptor { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseInterfaceAcceptingMessageDescriptor(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): InterfaceAcceptingMessageDescriptor { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseInterfaceAcceptingMessageDescriptor() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.fullname = reader.string(); - break; + message.fullname = reader.string() + break case 2: - message.fieldDescriptorNames.push(reader.string()); - break; + message.fieldDescriptorNames.push(reader.string()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): InterfaceAcceptingMessageDescriptor { @@ -812,58 +900,61 @@ export const InterfaceAcceptingMessageDescriptor = { fieldDescriptorNames: Array.isArray(object?.fieldDescriptorNames) ? object.fieldDescriptorNames.map((e: any) => String(e)) : [], - }; + } }, toJSON(message: InterfaceAcceptingMessageDescriptor): unknown { - const obj: any = {}; - message.fullname !== undefined && (obj.fullname = message.fullname); + const obj: any = {} + message.fullname !== undefined && (obj.fullname = message.fullname) if (message.fieldDescriptorNames) { - obj.fieldDescriptorNames = message.fieldDescriptorNames.map((e) => e); + obj.fieldDescriptorNames = message.fieldDescriptorNames.map((e) => e) } else { - obj.fieldDescriptorNames = []; + obj.fieldDescriptorNames = [] } - return obj; + return obj }, fromPartial, I>>( object: I, ): InterfaceAcceptingMessageDescriptor { - const message = createBaseInterfaceAcceptingMessageDescriptor(); - message.fullname = object.fullname ?? ""; - message.fieldDescriptorNames = object.fieldDescriptorNames?.map((e) => e) || []; - return message; + const message = createBaseInterfaceAcceptingMessageDescriptor() + message.fullname = object.fullname ?? "" + message.fieldDescriptorNames = object.fieldDescriptorNames?.map((e) => e) || [] + return message }, -}; +} function createBaseConfigurationDescriptor(): ConfigurationDescriptor { - return { bech32AccountAddressPrefix: "" }; + return { bech32AccountAddressPrefix: "" } } export const ConfigurationDescriptor = { - encode(message: ConfigurationDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: ConfigurationDescriptor, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.bech32AccountAddressPrefix !== "") { - writer.uint32(10).string(message.bech32AccountAddressPrefix); + writer.uint32(10).string(message.bech32AccountAddressPrefix) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): ConfigurationDescriptor { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseConfigurationDescriptor(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseConfigurationDescriptor() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.bech32AccountAddressPrefix = reader.string(); - break; + message.bech32AccountAddressPrefix = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): ConfigurationDescriptor { @@ -871,634 +962,741 @@ export const ConfigurationDescriptor = { bech32AccountAddressPrefix: isSet(object.bech32AccountAddressPrefix) ? String(object.bech32AccountAddressPrefix) : "", - }; + } }, toJSON(message: ConfigurationDescriptor): unknown { - const obj: any = {}; + const obj: any = {} message.bech32AccountAddressPrefix !== undefined && - (obj.bech32AccountAddressPrefix = message.bech32AccountAddressPrefix); - return obj; + (obj.bech32AccountAddressPrefix = message.bech32AccountAddressPrefix) + return obj }, - fromPartial, I>>(object: I): ConfigurationDescriptor { - const message = createBaseConfigurationDescriptor(); - message.bech32AccountAddressPrefix = object.bech32AccountAddressPrefix ?? ""; - return message; + fromPartial, I>>( + object: I, + ): ConfigurationDescriptor { + const message = createBaseConfigurationDescriptor() + message.bech32AccountAddressPrefix = object.bech32AccountAddressPrefix ?? "" + return message }, -}; +} function createBaseMsgDescriptor(): MsgDescriptor { - return { msgTypeUrl: "" }; + return { msgTypeUrl: "" } } export const MsgDescriptor = { encode(message: MsgDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.msgTypeUrl !== "") { - writer.uint32(10).string(message.msgTypeUrl); + writer.uint32(10).string(message.msgTypeUrl) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MsgDescriptor { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgDescriptor(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgDescriptor() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.msgTypeUrl = reader.string(); - break; + message.msgTypeUrl = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): MsgDescriptor { - return { msgTypeUrl: isSet(object.msgTypeUrl) ? String(object.msgTypeUrl) : "" }; + return { + msgTypeUrl: isSet(object.msgTypeUrl) ? String(object.msgTypeUrl) : "", + } }, toJSON(message: MsgDescriptor): unknown { - const obj: any = {}; - message.msgTypeUrl !== undefined && (obj.msgTypeUrl = message.msgTypeUrl); - return obj; + const obj: any = {} + message.msgTypeUrl !== undefined && (obj.msgTypeUrl = message.msgTypeUrl) + return obj }, - fromPartial, I>>(object: I): MsgDescriptor { - const message = createBaseMsgDescriptor(); - message.msgTypeUrl = object.msgTypeUrl ?? ""; - return message; + fromPartial, I>>( + object: I, + ): MsgDescriptor { + const message = createBaseMsgDescriptor() + message.msgTypeUrl = object.msgTypeUrl ?? "" + return message }, -}; +} function createBaseGetAuthnDescriptorRequest(): GetAuthnDescriptorRequest { - return {}; + return {} } export const GetAuthnDescriptorRequest = { - encode(_: GetAuthnDescriptorRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; + encode( + _: GetAuthnDescriptorRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): GetAuthnDescriptorRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetAuthnDescriptorRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseGetAuthnDescriptorRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(_: any): GetAuthnDescriptorRequest { - return {}; + return {} }, toJSON(_: GetAuthnDescriptorRequest): unknown { - const obj: any = {}; - return obj; + const obj: any = {} + return obj }, - fromPartial, I>>(_: I): GetAuthnDescriptorRequest { - const message = createBaseGetAuthnDescriptorRequest(); - return message; + fromPartial, I>>( + _: I, + ): GetAuthnDescriptorRequest { + const message = createBaseGetAuthnDescriptorRequest() + return message }, -}; +} function createBaseGetAuthnDescriptorResponse(): GetAuthnDescriptorResponse { - return { authn: undefined }; + return { authn: undefined } } export const GetAuthnDescriptorResponse = { - encode(message: GetAuthnDescriptorResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: GetAuthnDescriptorResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.authn !== undefined) { - AuthnDescriptor.encode(message.authn, writer.uint32(10).fork()).ldelim(); + AuthnDescriptor.encode(message.authn, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): GetAuthnDescriptorResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetAuthnDescriptorResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseGetAuthnDescriptorResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.authn = AuthnDescriptor.decode(reader, reader.uint32()); - break; + message.authn = AuthnDescriptor.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): GetAuthnDescriptorResponse { - return { authn: isSet(object.authn) ? AuthnDescriptor.fromJSON(object.authn) : undefined }; + return { + authn: isSet(object.authn) ? AuthnDescriptor.fromJSON(object.authn) : undefined, + } }, toJSON(message: GetAuthnDescriptorResponse): unknown { - const obj: any = {}; - message.authn !== undefined && (obj.authn = message.authn ? AuthnDescriptor.toJSON(message.authn) : undefined); - return obj; + const obj: any = {} + message.authn !== undefined && + (obj.authn = message.authn ? AuthnDescriptor.toJSON(message.authn) : undefined) + return obj }, - fromPartial, I>>(object: I): GetAuthnDescriptorResponse { - const message = createBaseGetAuthnDescriptorResponse(); - message.authn = (object.authn !== undefined && object.authn !== null) - ? AuthnDescriptor.fromPartial(object.authn) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): GetAuthnDescriptorResponse { + const message = createBaseGetAuthnDescriptorResponse() + message.authn = + object.authn !== undefined && object.authn !== null + ? AuthnDescriptor.fromPartial(object.authn) + : undefined + return message }, -}; +} function createBaseGetChainDescriptorRequest(): GetChainDescriptorRequest { - return {}; + return {} } export const GetChainDescriptorRequest = { - encode(_: GetChainDescriptorRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; + encode( + _: GetChainDescriptorRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): GetChainDescriptorRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetChainDescriptorRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseGetChainDescriptorRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(_: any): GetChainDescriptorRequest { - return {}; + return {} }, toJSON(_: GetChainDescriptorRequest): unknown { - const obj: any = {}; - return obj; + const obj: any = {} + return obj }, - fromPartial, I>>(_: I): GetChainDescriptorRequest { - const message = createBaseGetChainDescriptorRequest(); - return message; + fromPartial, I>>( + _: I, + ): GetChainDescriptorRequest { + const message = createBaseGetChainDescriptorRequest() + return message }, -}; +} function createBaseGetChainDescriptorResponse(): GetChainDescriptorResponse { - return { chain: undefined }; + return { chain: undefined } } export const GetChainDescriptorResponse = { - encode(message: GetChainDescriptorResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: GetChainDescriptorResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.chain !== undefined) { - ChainDescriptor.encode(message.chain, writer.uint32(10).fork()).ldelim(); + ChainDescriptor.encode(message.chain, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): GetChainDescriptorResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetChainDescriptorResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseGetChainDescriptorResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.chain = ChainDescriptor.decode(reader, reader.uint32()); - break; + message.chain = ChainDescriptor.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): GetChainDescriptorResponse { - return { chain: isSet(object.chain) ? ChainDescriptor.fromJSON(object.chain) : undefined }; + return { + chain: isSet(object.chain) ? ChainDescriptor.fromJSON(object.chain) : undefined, + } }, toJSON(message: GetChainDescriptorResponse): unknown { - const obj: any = {}; - message.chain !== undefined && (obj.chain = message.chain ? ChainDescriptor.toJSON(message.chain) : undefined); - return obj; + const obj: any = {} + message.chain !== undefined && + (obj.chain = message.chain ? ChainDescriptor.toJSON(message.chain) : undefined) + return obj }, - fromPartial, I>>(object: I): GetChainDescriptorResponse { - const message = createBaseGetChainDescriptorResponse(); - message.chain = (object.chain !== undefined && object.chain !== null) - ? ChainDescriptor.fromPartial(object.chain) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): GetChainDescriptorResponse { + const message = createBaseGetChainDescriptorResponse() + message.chain = + object.chain !== undefined && object.chain !== null + ? ChainDescriptor.fromPartial(object.chain) + : undefined + return message }, -}; +} function createBaseGetCodecDescriptorRequest(): GetCodecDescriptorRequest { - return {}; + return {} } export const GetCodecDescriptorRequest = { - encode(_: GetCodecDescriptorRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; + encode( + _: GetCodecDescriptorRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): GetCodecDescriptorRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetCodecDescriptorRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseGetCodecDescriptorRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(_: any): GetCodecDescriptorRequest { - return {}; + return {} }, toJSON(_: GetCodecDescriptorRequest): unknown { - const obj: any = {}; - return obj; + const obj: any = {} + return obj }, - fromPartial, I>>(_: I): GetCodecDescriptorRequest { - const message = createBaseGetCodecDescriptorRequest(); - return message; + fromPartial, I>>( + _: I, + ): GetCodecDescriptorRequest { + const message = createBaseGetCodecDescriptorRequest() + return message }, -}; +} function createBaseGetCodecDescriptorResponse(): GetCodecDescriptorResponse { - return { codec: undefined }; + return { codec: undefined } } export const GetCodecDescriptorResponse = { - encode(message: GetCodecDescriptorResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: GetCodecDescriptorResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.codec !== undefined) { - CodecDescriptor.encode(message.codec, writer.uint32(10).fork()).ldelim(); + CodecDescriptor.encode(message.codec, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): GetCodecDescriptorResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetCodecDescriptorResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseGetCodecDescriptorResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.codec = CodecDescriptor.decode(reader, reader.uint32()); - break; + message.codec = CodecDescriptor.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): GetCodecDescriptorResponse { - return { codec: isSet(object.codec) ? CodecDescriptor.fromJSON(object.codec) : undefined }; + return { + codec: isSet(object.codec) ? CodecDescriptor.fromJSON(object.codec) : undefined, + } }, toJSON(message: GetCodecDescriptorResponse): unknown { - const obj: any = {}; - message.codec !== undefined && (obj.codec = message.codec ? CodecDescriptor.toJSON(message.codec) : undefined); - return obj; + const obj: any = {} + message.codec !== undefined && + (obj.codec = message.codec ? CodecDescriptor.toJSON(message.codec) : undefined) + return obj }, - fromPartial, I>>(object: I): GetCodecDescriptorResponse { - const message = createBaseGetCodecDescriptorResponse(); - message.codec = (object.codec !== undefined && object.codec !== null) - ? CodecDescriptor.fromPartial(object.codec) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): GetCodecDescriptorResponse { + const message = createBaseGetCodecDescriptorResponse() + message.codec = + object.codec !== undefined && object.codec !== null + ? CodecDescriptor.fromPartial(object.codec) + : undefined + return message }, -}; +} function createBaseGetConfigurationDescriptorRequest(): GetConfigurationDescriptorRequest { - return {}; + return {} } export const GetConfigurationDescriptorRequest = { - encode(_: GetConfigurationDescriptorRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; + encode( + _: GetConfigurationDescriptorRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): GetConfigurationDescriptorRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetConfigurationDescriptorRequest(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): GetConfigurationDescriptorRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseGetConfigurationDescriptorRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(_: any): GetConfigurationDescriptorRequest { - return {}; + return {} }, toJSON(_: GetConfigurationDescriptorRequest): unknown { - const obj: any = {}; - return obj; + const obj: any = {} + return obj }, fromPartial, I>>( _: I, ): GetConfigurationDescriptorRequest { - const message = createBaseGetConfigurationDescriptorRequest(); - return message; + const message = createBaseGetConfigurationDescriptorRequest() + return message }, -}; +} function createBaseGetConfigurationDescriptorResponse(): GetConfigurationDescriptorResponse { - return { config: undefined }; + return { config: undefined } } export const GetConfigurationDescriptorResponse = { - encode(message: GetConfigurationDescriptorResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: GetConfigurationDescriptorResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.config !== undefined) { - ConfigurationDescriptor.encode(message.config, writer.uint32(10).fork()).ldelim(); + ConfigurationDescriptor.encode(message.config, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): GetConfigurationDescriptorResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetConfigurationDescriptorResponse(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): GetConfigurationDescriptorResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseGetConfigurationDescriptorResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.config = ConfigurationDescriptor.decode(reader, reader.uint32()); - break; + message.config = ConfigurationDescriptor.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): GetConfigurationDescriptorResponse { - return { config: isSet(object.config) ? ConfigurationDescriptor.fromJSON(object.config) : undefined }; + return { + config: isSet(object.config) + ? ConfigurationDescriptor.fromJSON(object.config) + : undefined, + } }, toJSON(message: GetConfigurationDescriptorResponse): unknown { - const obj: any = {}; + const obj: any = {} message.config !== undefined && - (obj.config = message.config ? ConfigurationDescriptor.toJSON(message.config) : undefined); - return obj; + (obj.config = message.config + ? ConfigurationDescriptor.toJSON(message.config) + : undefined) + return obj }, fromPartial, I>>( object: I, ): GetConfigurationDescriptorResponse { - const message = createBaseGetConfigurationDescriptorResponse(); - message.config = (object.config !== undefined && object.config !== null) - ? ConfigurationDescriptor.fromPartial(object.config) - : undefined; - return message; + const message = createBaseGetConfigurationDescriptorResponse() + message.config = + object.config !== undefined && object.config !== null + ? ConfigurationDescriptor.fromPartial(object.config) + : undefined + return message }, -}; +} function createBaseGetQueryServicesDescriptorRequest(): GetQueryServicesDescriptorRequest { - return {}; + return {} } export const GetQueryServicesDescriptorRequest = { - encode(_: GetQueryServicesDescriptorRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; + encode( + _: GetQueryServicesDescriptorRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): GetQueryServicesDescriptorRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetQueryServicesDescriptorRequest(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): GetQueryServicesDescriptorRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseGetQueryServicesDescriptorRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(_: any): GetQueryServicesDescriptorRequest { - return {}; + return {} }, toJSON(_: GetQueryServicesDescriptorRequest): unknown { - const obj: any = {}; - return obj; + const obj: any = {} + return obj }, fromPartial, I>>( _: I, ): GetQueryServicesDescriptorRequest { - const message = createBaseGetQueryServicesDescriptorRequest(); - return message; + const message = createBaseGetQueryServicesDescriptorRequest() + return message }, -}; +} function createBaseGetQueryServicesDescriptorResponse(): GetQueryServicesDescriptorResponse { - return { queries: undefined }; + return { queries: undefined } } export const GetQueryServicesDescriptorResponse = { - encode(message: GetQueryServicesDescriptorResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: GetQueryServicesDescriptorResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.queries !== undefined) { - QueryServicesDescriptor.encode(message.queries, writer.uint32(10).fork()).ldelim(); + QueryServicesDescriptor.encode(message.queries, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): GetQueryServicesDescriptorResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetQueryServicesDescriptorResponse(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): GetQueryServicesDescriptorResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseGetQueryServicesDescriptorResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.queries = QueryServicesDescriptor.decode(reader, reader.uint32()); - break; + message.queries = QueryServicesDescriptor.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): GetQueryServicesDescriptorResponse { - return { queries: isSet(object.queries) ? QueryServicesDescriptor.fromJSON(object.queries) : undefined }; + return { + queries: isSet(object.queries) + ? QueryServicesDescriptor.fromJSON(object.queries) + : undefined, + } }, toJSON(message: GetQueryServicesDescriptorResponse): unknown { - const obj: any = {}; + const obj: any = {} message.queries !== undefined && - (obj.queries = message.queries ? QueryServicesDescriptor.toJSON(message.queries) : undefined); - return obj; + (obj.queries = message.queries + ? QueryServicesDescriptor.toJSON(message.queries) + : undefined) + return obj }, fromPartial, I>>( object: I, ): GetQueryServicesDescriptorResponse { - const message = createBaseGetQueryServicesDescriptorResponse(); - message.queries = (object.queries !== undefined && object.queries !== null) - ? QueryServicesDescriptor.fromPartial(object.queries) - : undefined; - return message; + const message = createBaseGetQueryServicesDescriptorResponse() + message.queries = + object.queries !== undefined && object.queries !== null + ? QueryServicesDescriptor.fromPartial(object.queries) + : undefined + return message }, -}; +} function createBaseGetTxDescriptorRequest(): GetTxDescriptorRequest { - return {}; + return {} } export const GetTxDescriptorRequest = { - encode(_: GetTxDescriptorRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; + encode( + _: GetTxDescriptorRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): GetTxDescriptorRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetTxDescriptorRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseGetTxDescriptorRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(_: any): GetTxDescriptorRequest { - return {}; + return {} }, toJSON(_: GetTxDescriptorRequest): unknown { - const obj: any = {}; - return obj; + const obj: any = {} + return obj }, - fromPartial, I>>(_: I): GetTxDescriptorRequest { - const message = createBaseGetTxDescriptorRequest(); - return message; + fromPartial, I>>( + _: I, + ): GetTxDescriptorRequest { + const message = createBaseGetTxDescriptorRequest() + return message }, -}; +} function createBaseGetTxDescriptorResponse(): GetTxDescriptorResponse { - return { tx: undefined }; + return { tx: undefined } } export const GetTxDescriptorResponse = { - encode(message: GetTxDescriptorResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: GetTxDescriptorResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.tx !== undefined) { - TxDescriptor.encode(message.tx, writer.uint32(10).fork()).ldelim(); + TxDescriptor.encode(message.tx, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): GetTxDescriptorResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetTxDescriptorResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseGetTxDescriptorResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.tx = TxDescriptor.decode(reader, reader.uint32()); - break; + message.tx = TxDescriptor.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): GetTxDescriptorResponse { - return { tx: isSet(object.tx) ? TxDescriptor.fromJSON(object.tx) : undefined }; + return { + tx: isSet(object.tx) ? TxDescriptor.fromJSON(object.tx) : undefined, + } }, toJSON(message: GetTxDescriptorResponse): unknown { - const obj: any = {}; - message.tx !== undefined && (obj.tx = message.tx ? TxDescriptor.toJSON(message.tx) : undefined); - return obj; + const obj: any = {} + message.tx !== undefined && + (obj.tx = message.tx ? TxDescriptor.toJSON(message.tx) : undefined) + return obj }, - fromPartial, I>>(object: I): GetTxDescriptorResponse { - const message = createBaseGetTxDescriptorResponse(); - message.tx = (object.tx !== undefined && object.tx !== null) ? TxDescriptor.fromPartial(object.tx) : undefined; - return message; + fromPartial, I>>( + object: I, + ): GetTxDescriptorResponse { + const message = createBaseGetTxDescriptorResponse() + message.tx = + object.tx !== undefined && object.tx !== null + ? TxDescriptor.fromPartial(object.tx) + : undefined + return message }, -}; +} function createBaseQueryServicesDescriptor(): QueryServicesDescriptor { - return { queryServices: [] }; + return { queryServices: [] } } export const QueryServicesDescriptor = { - encode(message: QueryServicesDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryServicesDescriptor, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { for (const v of message.queryServices) { - QueryServiceDescriptor.encode(v!, writer.uint32(10).fork()).ldelim(); + QueryServiceDescriptor.encode(v!, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryServicesDescriptor { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryServicesDescriptor(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryServicesDescriptor() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.queryServices.push(QueryServiceDescriptor.decode(reader, reader.uint32())); - break; + message.queryServices.push( + QueryServiceDescriptor.decode(reader, reader.uint32()), + ) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryServicesDescriptor { @@ -1506,154 +1704,174 @@ export const QueryServicesDescriptor = { queryServices: Array.isArray(object?.queryServices) ? object.queryServices.map((e: any) => QueryServiceDescriptor.fromJSON(e)) : [], - }; + } }, toJSON(message: QueryServicesDescriptor): unknown { - const obj: any = {}; + const obj: any = {} if (message.queryServices) { - obj.queryServices = message.queryServices.map((e) => e ? QueryServiceDescriptor.toJSON(e) : undefined); + obj.queryServices = message.queryServices.map((e) => + e ? QueryServiceDescriptor.toJSON(e) : undefined, + ) } else { - obj.queryServices = []; + obj.queryServices = [] } - return obj; + return obj }, - fromPartial, I>>(object: I): QueryServicesDescriptor { - const message = createBaseQueryServicesDescriptor(); - message.queryServices = object.queryServices?.map((e) => QueryServiceDescriptor.fromPartial(e)) || []; - return message; + fromPartial, I>>( + object: I, + ): QueryServicesDescriptor { + const message = createBaseQueryServicesDescriptor() + message.queryServices = + object.queryServices?.map((e) => QueryServiceDescriptor.fromPartial(e)) || [] + return message }, -}; +} function createBaseQueryServiceDescriptor(): QueryServiceDescriptor { - return { fullname: "", isModule: false, methods: [] }; + return { fullname: "", isModule: false, methods: [] } } export const QueryServiceDescriptor = { - encode(message: QueryServiceDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryServiceDescriptor, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.fullname !== "") { - writer.uint32(10).string(message.fullname); + writer.uint32(10).string(message.fullname) } if (message.isModule === true) { - writer.uint32(16).bool(message.isModule); + writer.uint32(16).bool(message.isModule) } for (const v of message.methods) { - QueryMethodDescriptor.encode(v!, writer.uint32(26).fork()).ldelim(); + QueryMethodDescriptor.encode(v!, writer.uint32(26).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryServiceDescriptor { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryServiceDescriptor(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryServiceDescriptor() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.fullname = reader.string(); - break; + message.fullname = reader.string() + break case 2: - message.isModule = reader.bool(); - break; + message.isModule = reader.bool() + break case 3: - message.methods.push(QueryMethodDescriptor.decode(reader, reader.uint32())); - break; + message.methods.push(QueryMethodDescriptor.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryServiceDescriptor { return { fullname: isSet(object.fullname) ? String(object.fullname) : "", isModule: isSet(object.isModule) ? Boolean(object.isModule) : false, - methods: Array.isArray(object?.methods) ? object.methods.map((e: any) => QueryMethodDescriptor.fromJSON(e)) : [], - }; + methods: Array.isArray(object?.methods) + ? object.methods.map((e: any) => QueryMethodDescriptor.fromJSON(e)) + : [], + } }, toJSON(message: QueryServiceDescriptor): unknown { - const obj: any = {}; - message.fullname !== undefined && (obj.fullname = message.fullname); - message.isModule !== undefined && (obj.isModule = message.isModule); + const obj: any = {} + message.fullname !== undefined && (obj.fullname = message.fullname) + message.isModule !== undefined && (obj.isModule = message.isModule) if (message.methods) { - obj.methods = message.methods.map((e) => e ? QueryMethodDescriptor.toJSON(e) : undefined); + obj.methods = message.methods.map((e) => + e ? QueryMethodDescriptor.toJSON(e) : undefined, + ) } else { - obj.methods = []; + obj.methods = [] } - return obj; + return obj }, - fromPartial, I>>(object: I): QueryServiceDescriptor { - const message = createBaseQueryServiceDescriptor(); - message.fullname = object.fullname ?? ""; - message.isModule = object.isModule ?? false; - message.methods = object.methods?.map((e) => QueryMethodDescriptor.fromPartial(e)) || []; - return message; + fromPartial, I>>( + object: I, + ): QueryServiceDescriptor { + const message = createBaseQueryServiceDescriptor() + message.fullname = object.fullname ?? "" + message.isModule = object.isModule ?? false + message.methods = + object.methods?.map((e) => QueryMethodDescriptor.fromPartial(e)) || [] + return message }, -}; +} function createBaseQueryMethodDescriptor(): QueryMethodDescriptor { - return { name: "", fullQueryPath: "" }; + return { name: "", fullQueryPath: "" } } export const QueryMethodDescriptor = { - encode(message: QueryMethodDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryMethodDescriptor, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.name !== "") { - writer.uint32(10).string(message.name); + writer.uint32(10).string(message.name) } if (message.fullQueryPath !== "") { - writer.uint32(18).string(message.fullQueryPath); + writer.uint32(18).string(message.fullQueryPath) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryMethodDescriptor { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryMethodDescriptor(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryMethodDescriptor() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.name = reader.string(); - break; + message.name = reader.string() + break case 2: - message.fullQueryPath = reader.string(); - break; + message.fullQueryPath = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryMethodDescriptor { return { name: isSet(object.name) ? String(object.name) : "", fullQueryPath: isSet(object.fullQueryPath) ? String(object.fullQueryPath) : "", - }; + } }, toJSON(message: QueryMethodDescriptor): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.fullQueryPath !== undefined && (obj.fullQueryPath = message.fullQueryPath); - return obj; + const obj: any = {} + message.name !== undefined && (obj.name = message.name) + message.fullQueryPath !== undefined && (obj.fullQueryPath = message.fullQueryPath) + return obj }, - fromPartial, I>>(object: I): QueryMethodDescriptor { - const message = createBaseQueryMethodDescriptor(); - message.name = object.name ?? ""; - message.fullQueryPath = object.fullQueryPath ?? ""; - return message; + fromPartial, I>>( + object: I, + ): QueryMethodDescriptor { + const message = createBaseQueryMethodDescriptor() + message.name = object.name ?? "" + message.fullQueryPath = object.fullQueryPath ?? "" + return message }, -}; +} /** ReflectionService defines a service for application reflection. */ export interface ReflectionService { @@ -1662,96 +1880,152 @@ export interface ReflectionService { * NOTE: this RPC is still experimental and might be subject to breaking changes or removal in * future releases of the cosmos-sdk. */ - GetAuthnDescriptor(request: GetAuthnDescriptorRequest): Promise; + GetAuthnDescriptor( + request: GetAuthnDescriptorRequest, + ): Promise /** GetChainDescriptor returns the description of the chain */ - GetChainDescriptor(request: GetChainDescriptorRequest): Promise; + GetChainDescriptor( + request: GetChainDescriptorRequest, + ): Promise /** GetCodecDescriptor returns the descriptor of the codec of the application */ - GetCodecDescriptor(request: GetCodecDescriptorRequest): Promise; + GetCodecDescriptor( + request: GetCodecDescriptorRequest, + ): Promise /** GetConfigurationDescriptor returns the descriptor for the sdk.Config of the application */ - GetConfigurationDescriptor(request: GetConfigurationDescriptorRequest): Promise; + GetConfigurationDescriptor( + request: GetConfigurationDescriptorRequest, + ): Promise /** GetQueryServicesDescriptor returns the available gRPC queryable services of the application */ - GetQueryServicesDescriptor(request: GetQueryServicesDescriptorRequest): Promise; + GetQueryServicesDescriptor( + request: GetQueryServicesDescriptorRequest, + ): Promise /** GetTxDescriptor returns information on the used transaction object and available msgs that can be used */ - GetTxDescriptor(request: GetTxDescriptorRequest): Promise; + GetTxDescriptor(request: GetTxDescriptorRequest): Promise } export class ReflectionServiceClientImpl implements ReflectionService { - private readonly rpc: Rpc; + private readonly rpc: Rpc constructor(rpc: Rpc) { - this.rpc = rpc; - this.GetAuthnDescriptor = this.GetAuthnDescriptor.bind(this); - this.GetChainDescriptor = this.GetChainDescriptor.bind(this); - this.GetCodecDescriptor = this.GetCodecDescriptor.bind(this); - this.GetConfigurationDescriptor = this.GetConfigurationDescriptor.bind(this); - this.GetQueryServicesDescriptor = this.GetQueryServicesDescriptor.bind(this); - this.GetTxDescriptor = this.GetTxDescriptor.bind(this); + this.rpc = rpc + this.GetAuthnDescriptor = this.GetAuthnDescriptor.bind(this) + this.GetChainDescriptor = this.GetChainDescriptor.bind(this) + this.GetCodecDescriptor = this.GetCodecDescriptor.bind(this) + this.GetConfigurationDescriptor = this.GetConfigurationDescriptor.bind(this) + this.GetQueryServicesDescriptor = this.GetQueryServicesDescriptor.bind(this) + this.GetTxDescriptor = this.GetTxDescriptor.bind(this) } - GetAuthnDescriptor(request: GetAuthnDescriptorRequest): Promise { - const data = GetAuthnDescriptorRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.base.reflection.v2alpha1.ReflectionService", "GetAuthnDescriptor", data); - return promise.then((data) => GetAuthnDescriptorResponse.decode(new _m0.Reader(data))); + GetAuthnDescriptor( + request: GetAuthnDescriptorRequest, + ): Promise { + const data = GetAuthnDescriptorRequest.encode(request).finish() + const promise = this.rpc.request( + "cosmos.base.reflection.v2alpha1.ReflectionService", + "GetAuthnDescriptor", + data, + ) + return promise.then((data) => + GetAuthnDescriptorResponse.decode(new _m0.Reader(data)), + ) } - GetChainDescriptor(request: GetChainDescriptorRequest): Promise { - const data = GetChainDescriptorRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.base.reflection.v2alpha1.ReflectionService", "GetChainDescriptor", data); - return promise.then((data) => GetChainDescriptorResponse.decode(new _m0.Reader(data))); + GetChainDescriptor( + request: GetChainDescriptorRequest, + ): Promise { + const data = GetChainDescriptorRequest.encode(request).finish() + const promise = this.rpc.request( + "cosmos.base.reflection.v2alpha1.ReflectionService", + "GetChainDescriptor", + data, + ) + return promise.then((data) => + GetChainDescriptorResponse.decode(new _m0.Reader(data)), + ) } - GetCodecDescriptor(request: GetCodecDescriptorRequest): Promise { - const data = GetCodecDescriptorRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.base.reflection.v2alpha1.ReflectionService", "GetCodecDescriptor", data); - return promise.then((data) => GetCodecDescriptorResponse.decode(new _m0.Reader(data))); + GetCodecDescriptor( + request: GetCodecDescriptorRequest, + ): Promise { + const data = GetCodecDescriptorRequest.encode(request).finish() + const promise = this.rpc.request( + "cosmos.base.reflection.v2alpha1.ReflectionService", + "GetCodecDescriptor", + data, + ) + return promise.then((data) => + GetCodecDescriptorResponse.decode(new _m0.Reader(data)), + ) } - GetConfigurationDescriptor(request: GetConfigurationDescriptorRequest): Promise { - const data = GetConfigurationDescriptorRequest.encode(request).finish(); + GetConfigurationDescriptor( + request: GetConfigurationDescriptorRequest, + ): Promise { + const data = GetConfigurationDescriptorRequest.encode(request).finish() const promise = this.rpc.request( "cosmos.base.reflection.v2alpha1.ReflectionService", "GetConfigurationDescriptor", data, - ); - return promise.then((data) => GetConfigurationDescriptorResponse.decode(new _m0.Reader(data))); + ) + return promise.then((data) => + GetConfigurationDescriptorResponse.decode(new _m0.Reader(data)), + ) } - GetQueryServicesDescriptor(request: GetQueryServicesDescriptorRequest): Promise { - const data = GetQueryServicesDescriptorRequest.encode(request).finish(); + GetQueryServicesDescriptor( + request: GetQueryServicesDescriptorRequest, + ): Promise { + const data = GetQueryServicesDescriptorRequest.encode(request).finish() const promise = this.rpc.request( "cosmos.base.reflection.v2alpha1.ReflectionService", "GetQueryServicesDescriptor", data, - ); - return promise.then((data) => GetQueryServicesDescriptorResponse.decode(new _m0.Reader(data))); + ) + return promise.then((data) => + GetQueryServicesDescriptorResponse.decode(new _m0.Reader(data)), + ) } GetTxDescriptor(request: GetTxDescriptorRequest): Promise { - const data = GetTxDescriptorRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.base.reflection.v2alpha1.ReflectionService", "GetTxDescriptor", data); - return promise.then((data) => GetTxDescriptorResponse.decode(new _m0.Reader(data))); + const data = GetTxDescriptorRequest.encode(request).finish() + const promise = this.rpc.request( + "cosmos.base.reflection.v2alpha1.ReflectionService", + "GetTxDescriptor", + data, + ) + return promise.then((data) => GetTxDescriptorResponse.decode(new _m0.Reader(data))) } } interface Rpc { - request(service: string, method: string, data: Uint8Array): Promise; + request(service: string, method: string, data: Uint8Array): Promise } -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/cosmos/base/snapshots/v1beta1/snapshot.ts b/packages/protojs/src/cosmos/base/snapshots/v1beta1/snapshot.ts index d7fc1da7..0f34d124 100644 --- a/packages/protojs/src/cosmos/base/snapshots/v1beta1/snapshot.ts +++ b/packages/protojs/src/cosmos/base/snapshots/v1beta1/snapshot.ts @@ -1,110 +1,116 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "cosmos.base.snapshots.v1beta1"; +export const protobufPackage = "cosmos.base.snapshots.v1beta1" /** Snapshot contains Tendermint state sync snapshot info. */ export interface Snapshot { - height: Long; - format: number; - chunks: number; - hash: Uint8Array; - metadata?: Metadata; + height: Long + format: number + chunks: number + hash: Uint8Array + metadata?: Metadata } /** Metadata contains SDK-specific snapshot metadata. */ export interface Metadata { /** SHA-256 chunk hashes */ - chunkHashes: Uint8Array[]; + chunkHashes: Uint8Array[] } /** SnapshotItem is an item contained in a rootmulti.Store snapshot. */ export interface SnapshotItem { - store?: SnapshotStoreItem | undefined; - iavl?: SnapshotIAVLItem | undefined; - extension?: SnapshotExtensionMeta | undefined; - extensionPayload?: SnapshotExtensionPayload | undefined; + store?: SnapshotStoreItem | undefined + iavl?: SnapshotIAVLItem | undefined + extension?: SnapshotExtensionMeta | undefined + extensionPayload?: SnapshotExtensionPayload | undefined } /** SnapshotStoreItem contains metadata about a snapshotted store. */ export interface SnapshotStoreItem { - name: string; + name: string } /** SnapshotIAVLItem is an exported IAVL node. */ export interface SnapshotIAVLItem { - key: Uint8Array; - value: Uint8Array; + key: Uint8Array + value: Uint8Array /** version is block height */ - version: Long; + version: Long /** height is depth of the tree. */ - height: number; + height: number } /** SnapshotExtensionMeta contains metadata about an external snapshotter. */ export interface SnapshotExtensionMeta { - name: string; - format: number; + name: string + format: number } /** SnapshotExtensionPayload contains payloads of an external snapshotter. */ export interface SnapshotExtensionPayload { - payload: Uint8Array; + payload: Uint8Array } function createBaseSnapshot(): Snapshot { - return { height: Long.UZERO, format: 0, chunks: 0, hash: new Uint8Array(), metadata: undefined }; + return { + height: Long.UZERO, + format: 0, + chunks: 0, + hash: new Uint8Array(), + metadata: undefined, + } } export const Snapshot = { encode(message: Snapshot, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (!message.height.isZero()) { - writer.uint32(8).uint64(message.height); + writer.uint32(8).uint64(message.height) } if (message.format !== 0) { - writer.uint32(16).uint32(message.format); + writer.uint32(16).uint32(message.format) } if (message.chunks !== 0) { - writer.uint32(24).uint32(message.chunks); + writer.uint32(24).uint32(message.chunks) } if (message.hash.length !== 0) { - writer.uint32(34).bytes(message.hash); + writer.uint32(34).bytes(message.hash) } if (message.metadata !== undefined) { - Metadata.encode(message.metadata, writer.uint32(42).fork()).ldelim(); + Metadata.encode(message.metadata, writer.uint32(42).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Snapshot { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSnapshot(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseSnapshot() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.height = reader.uint64() as Long; - break; + message.height = reader.uint64() as Long + break case 2: - message.format = reader.uint32(); - break; + message.format = reader.uint32() + break case 3: - message.chunks = reader.uint32(); - break; + message.chunks = reader.uint32() + break case 4: - message.hash = reader.bytes(); - break; + message.hash = reader.bytes() + break case 5: - message.metadata = Metadata.decode(reader, reader.uint32()); - break; + message.metadata = Metadata.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Snapshot { @@ -114,270 +120,317 @@ export const Snapshot = { chunks: isSet(object.chunks) ? Number(object.chunks) : 0, hash: isSet(object.hash) ? bytesFromBase64(object.hash) : new Uint8Array(), metadata: isSet(object.metadata) ? Metadata.fromJSON(object.metadata) : undefined, - }; + } }, toJSON(message: Snapshot): unknown { - const obj: any = {}; - message.height !== undefined && (obj.height = (message.height || Long.UZERO).toString()); - message.format !== undefined && (obj.format = Math.round(message.format)); - message.chunks !== undefined && (obj.chunks = Math.round(message.chunks)); + const obj: any = {} + message.height !== undefined && + (obj.height = (message.height || Long.UZERO).toString()) + message.format !== undefined && (obj.format = Math.round(message.format)) + message.chunks !== undefined && (obj.chunks = Math.round(message.chunks)) message.hash !== undefined && - (obj.hash = base64FromBytes(message.hash !== undefined ? message.hash : new Uint8Array())); - message.metadata !== undefined && (obj.metadata = message.metadata ? Metadata.toJSON(message.metadata) : undefined); - return obj; + (obj.hash = base64FromBytes( + message.hash !== undefined ? message.hash : new Uint8Array(), + )) + message.metadata !== undefined && + (obj.metadata = message.metadata ? Metadata.toJSON(message.metadata) : undefined) + return obj }, fromPartial, I>>(object: I): Snapshot { - const message = createBaseSnapshot(); - message.height = (object.height !== undefined && object.height !== null) - ? Long.fromValue(object.height) - : Long.UZERO; - message.format = object.format ?? 0; - message.chunks = object.chunks ?? 0; - message.hash = object.hash ?? new Uint8Array(); - message.metadata = (object.metadata !== undefined && object.metadata !== null) - ? Metadata.fromPartial(object.metadata) - : undefined; - return message; - }, -}; + const message = createBaseSnapshot() + message.height = + object.height !== undefined && object.height !== null + ? Long.fromValue(object.height) + : Long.UZERO + message.format = object.format ?? 0 + message.chunks = object.chunks ?? 0 + message.hash = object.hash ?? new Uint8Array() + message.metadata = + object.metadata !== undefined && object.metadata !== null + ? Metadata.fromPartial(object.metadata) + : undefined + return message + }, +} function createBaseMetadata(): Metadata { - return { chunkHashes: [] }; + return { chunkHashes: [] } } export const Metadata = { encode(message: Metadata, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.chunkHashes) { - writer.uint32(10).bytes(v!); + writer.uint32(10).bytes(v!) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Metadata { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMetadata(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMetadata() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.chunkHashes.push(reader.bytes()); - break; + message.chunkHashes.push(reader.bytes()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Metadata { return { - chunkHashes: Array.isArray(object?.chunkHashes) ? object.chunkHashes.map((e: any) => bytesFromBase64(e)) : [], - }; + chunkHashes: Array.isArray(object?.chunkHashes) + ? object.chunkHashes.map((e: any) => bytesFromBase64(e)) + : [], + } }, toJSON(message: Metadata): unknown { - const obj: any = {}; + const obj: any = {} if (message.chunkHashes) { - obj.chunkHashes = message.chunkHashes.map((e) => base64FromBytes(e !== undefined ? e : new Uint8Array())); + obj.chunkHashes = message.chunkHashes.map((e) => + base64FromBytes(e !== undefined ? e : new Uint8Array()), + ) } else { - obj.chunkHashes = []; + obj.chunkHashes = [] } - return obj; + return obj }, fromPartial, I>>(object: I): Metadata { - const message = createBaseMetadata(); - message.chunkHashes = object.chunkHashes?.map((e) => e) || []; - return message; + const message = createBaseMetadata() + message.chunkHashes = object.chunkHashes?.map((e) => e) || [] + return message }, -}; +} function createBaseSnapshotItem(): SnapshotItem { - return { store: undefined, iavl: undefined, extension: undefined, extensionPayload: undefined }; + return { + store: undefined, + iavl: undefined, + extension: undefined, + extensionPayload: undefined, + } } export const SnapshotItem = { encode(message: SnapshotItem, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.store !== undefined) { - SnapshotStoreItem.encode(message.store, writer.uint32(10).fork()).ldelim(); + SnapshotStoreItem.encode(message.store, writer.uint32(10).fork()).ldelim() } if (message.iavl !== undefined) { - SnapshotIAVLItem.encode(message.iavl, writer.uint32(18).fork()).ldelim(); + SnapshotIAVLItem.encode(message.iavl, writer.uint32(18).fork()).ldelim() } if (message.extension !== undefined) { - SnapshotExtensionMeta.encode(message.extension, writer.uint32(26).fork()).ldelim(); + SnapshotExtensionMeta.encode(message.extension, writer.uint32(26).fork()).ldelim() } if (message.extensionPayload !== undefined) { - SnapshotExtensionPayload.encode(message.extensionPayload, writer.uint32(34).fork()).ldelim(); + SnapshotExtensionPayload.encode( + message.extensionPayload, + writer.uint32(34).fork(), + ).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): SnapshotItem { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSnapshotItem(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseSnapshotItem() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.store = SnapshotStoreItem.decode(reader, reader.uint32()); - break; + message.store = SnapshotStoreItem.decode(reader, reader.uint32()) + break case 2: - message.iavl = SnapshotIAVLItem.decode(reader, reader.uint32()); - break; + message.iavl = SnapshotIAVLItem.decode(reader, reader.uint32()) + break case 3: - message.extension = SnapshotExtensionMeta.decode(reader, reader.uint32()); - break; + message.extension = SnapshotExtensionMeta.decode(reader, reader.uint32()) + break case 4: - message.extensionPayload = SnapshotExtensionPayload.decode(reader, reader.uint32()); - break; + message.extensionPayload = SnapshotExtensionPayload.decode( + reader, + reader.uint32(), + ) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): SnapshotItem { return { store: isSet(object.store) ? SnapshotStoreItem.fromJSON(object.store) : undefined, iavl: isSet(object.iavl) ? SnapshotIAVLItem.fromJSON(object.iavl) : undefined, - extension: isSet(object.extension) ? SnapshotExtensionMeta.fromJSON(object.extension) : undefined, + extension: isSet(object.extension) + ? SnapshotExtensionMeta.fromJSON(object.extension) + : undefined, extensionPayload: isSet(object.extensionPayload) ? SnapshotExtensionPayload.fromJSON(object.extensionPayload) : undefined, - }; + } }, toJSON(message: SnapshotItem): unknown { - const obj: any = {}; - message.store !== undefined && (obj.store = message.store ? SnapshotStoreItem.toJSON(message.store) : undefined); - message.iavl !== undefined && (obj.iavl = message.iavl ? SnapshotIAVLItem.toJSON(message.iavl) : undefined); + const obj: any = {} + message.store !== undefined && + (obj.store = message.store ? SnapshotStoreItem.toJSON(message.store) : undefined) + message.iavl !== undefined && + (obj.iavl = message.iavl ? SnapshotIAVLItem.toJSON(message.iavl) : undefined) message.extension !== undefined && - (obj.extension = message.extension ? SnapshotExtensionMeta.toJSON(message.extension) : undefined); - message.extensionPayload !== undefined && (obj.extensionPayload = message.extensionPayload - ? SnapshotExtensionPayload.toJSON(message.extensionPayload) - : undefined); - return obj; + (obj.extension = message.extension + ? SnapshotExtensionMeta.toJSON(message.extension) + : undefined) + message.extensionPayload !== undefined && + (obj.extensionPayload = message.extensionPayload + ? SnapshotExtensionPayload.toJSON(message.extensionPayload) + : undefined) + return obj }, fromPartial, I>>(object: I): SnapshotItem { - const message = createBaseSnapshotItem(); - message.store = (object.store !== undefined && object.store !== null) - ? SnapshotStoreItem.fromPartial(object.store) - : undefined; - message.iavl = (object.iavl !== undefined && object.iavl !== null) - ? SnapshotIAVLItem.fromPartial(object.iavl) - : undefined; - message.extension = (object.extension !== undefined && object.extension !== null) - ? SnapshotExtensionMeta.fromPartial(object.extension) - : undefined; - message.extensionPayload = (object.extensionPayload !== undefined && object.extensionPayload !== null) - ? SnapshotExtensionPayload.fromPartial(object.extensionPayload) - : undefined; - return message; - }, -}; + const message = createBaseSnapshotItem() + message.store = + object.store !== undefined && object.store !== null + ? SnapshotStoreItem.fromPartial(object.store) + : undefined + message.iavl = + object.iavl !== undefined && object.iavl !== null + ? SnapshotIAVLItem.fromPartial(object.iavl) + : undefined + message.extension = + object.extension !== undefined && object.extension !== null + ? SnapshotExtensionMeta.fromPartial(object.extension) + : undefined + message.extensionPayload = + object.extensionPayload !== undefined && object.extensionPayload !== null + ? SnapshotExtensionPayload.fromPartial(object.extensionPayload) + : undefined + return message + }, +} function createBaseSnapshotStoreItem(): SnapshotStoreItem { - return { name: "" }; + return { name: "" } } export const SnapshotStoreItem = { - encode(message: SnapshotStoreItem, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: SnapshotStoreItem, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.name !== "") { - writer.uint32(10).string(message.name); + writer.uint32(10).string(message.name) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): SnapshotStoreItem { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSnapshotStoreItem(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseSnapshotStoreItem() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.name = reader.string(); - break; + message.name = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): SnapshotStoreItem { - return { name: isSet(object.name) ? String(object.name) : "" }; + return { + name: isSet(object.name) ? String(object.name) : "", + } }, toJSON(message: SnapshotStoreItem): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - return obj; + const obj: any = {} + message.name !== undefined && (obj.name = message.name) + return obj }, - fromPartial, I>>(object: I): SnapshotStoreItem { - const message = createBaseSnapshotStoreItem(); - message.name = object.name ?? ""; - return message; + fromPartial, I>>( + object: I, + ): SnapshotStoreItem { + const message = createBaseSnapshotStoreItem() + message.name = object.name ?? "" + return message }, -}; +} function createBaseSnapshotIAVLItem(): SnapshotIAVLItem { - return { key: new Uint8Array(), value: new Uint8Array(), version: Long.ZERO, height: 0 }; + return { + key: new Uint8Array(), + value: new Uint8Array(), + version: Long.ZERO, + height: 0, + } } export const SnapshotIAVLItem = { - encode(message: SnapshotIAVLItem, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: SnapshotIAVLItem, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.key.length !== 0) { - writer.uint32(10).bytes(message.key); + writer.uint32(10).bytes(message.key) } if (message.value.length !== 0) { - writer.uint32(18).bytes(message.value); + writer.uint32(18).bytes(message.value) } if (!message.version.isZero()) { - writer.uint32(24).int64(message.version); + writer.uint32(24).int64(message.version) } if (message.height !== 0) { - writer.uint32(32).int32(message.height); + writer.uint32(32).int32(message.height) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): SnapshotIAVLItem { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSnapshotIAVLItem(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseSnapshotIAVLItem() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.key = reader.bytes(); - break; + message.key = reader.bytes() + break case 2: - message.value = reader.bytes(); - break; + message.value = reader.bytes() + break case 3: - message.version = reader.int64() as Long; - break; + message.version = reader.int64() as Long + break case 4: - message.height = reader.int32(); - break; + message.height = reader.int32() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): SnapshotIAVLItem { @@ -386,199 +439,221 @@ export const SnapshotIAVLItem = { value: isSet(object.value) ? bytesFromBase64(object.value) : new Uint8Array(), version: isSet(object.version) ? Long.fromValue(object.version) : Long.ZERO, height: isSet(object.height) ? Number(object.height) : 0, - }; + } }, toJSON(message: SnapshotIAVLItem): unknown { - const obj: any = {}; + const obj: any = {} message.key !== undefined && - (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); + (obj.key = base64FromBytes( + message.key !== undefined ? message.key : new Uint8Array(), + )) message.value !== undefined && - (obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array())); - message.version !== undefined && (obj.version = (message.version || Long.ZERO).toString()); - message.height !== undefined && (obj.height = Math.round(message.height)); - return obj; + (obj.value = base64FromBytes( + message.value !== undefined ? message.value : new Uint8Array(), + )) + message.version !== undefined && + (obj.version = (message.version || Long.ZERO).toString()) + message.height !== undefined && (obj.height = Math.round(message.height)) + return obj + }, + + fromPartial, I>>( + object: I, + ): SnapshotIAVLItem { + const message = createBaseSnapshotIAVLItem() + message.key = object.key ?? new Uint8Array() + message.value = object.value ?? new Uint8Array() + message.version = + object.version !== undefined && object.version !== null + ? Long.fromValue(object.version) + : Long.ZERO + message.height = object.height ?? 0 + return message }, - - fromPartial, I>>(object: I): SnapshotIAVLItem { - const message = createBaseSnapshotIAVLItem(); - message.key = object.key ?? new Uint8Array(); - message.value = object.value ?? new Uint8Array(); - message.version = (object.version !== undefined && object.version !== null) - ? Long.fromValue(object.version) - : Long.ZERO; - message.height = object.height ?? 0; - return message; - }, -}; +} function createBaseSnapshotExtensionMeta(): SnapshotExtensionMeta { - return { name: "", format: 0 }; + return { name: "", format: 0 } } export const SnapshotExtensionMeta = { - encode(message: SnapshotExtensionMeta, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: SnapshotExtensionMeta, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.name !== "") { - writer.uint32(10).string(message.name); + writer.uint32(10).string(message.name) } if (message.format !== 0) { - writer.uint32(16).uint32(message.format); + writer.uint32(16).uint32(message.format) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): SnapshotExtensionMeta { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSnapshotExtensionMeta(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseSnapshotExtensionMeta() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.name = reader.string(); - break; + message.name = reader.string() + break case 2: - message.format = reader.uint32(); - break; + message.format = reader.uint32() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): SnapshotExtensionMeta { return { name: isSet(object.name) ? String(object.name) : "", format: isSet(object.format) ? Number(object.format) : 0, - }; + } }, toJSON(message: SnapshotExtensionMeta): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.format !== undefined && (obj.format = Math.round(message.format)); - return obj; + const obj: any = {} + message.name !== undefined && (obj.name = message.name) + message.format !== undefined && (obj.format = Math.round(message.format)) + return obj }, - fromPartial, I>>(object: I): SnapshotExtensionMeta { - const message = createBaseSnapshotExtensionMeta(); - message.name = object.name ?? ""; - message.format = object.format ?? 0; - return message; + fromPartial, I>>( + object: I, + ): SnapshotExtensionMeta { + const message = createBaseSnapshotExtensionMeta() + message.name = object.name ?? "" + message.format = object.format ?? 0 + return message }, -}; +} function createBaseSnapshotExtensionPayload(): SnapshotExtensionPayload { - return { payload: new Uint8Array() }; + return { payload: new Uint8Array() } } export const SnapshotExtensionPayload = { - encode(message: SnapshotExtensionPayload, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: SnapshotExtensionPayload, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.payload.length !== 0) { - writer.uint32(10).bytes(message.payload); + writer.uint32(10).bytes(message.payload) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): SnapshotExtensionPayload { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSnapshotExtensionPayload(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseSnapshotExtensionPayload() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.payload = reader.bytes(); - break; + message.payload = reader.bytes() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): SnapshotExtensionPayload { - return { payload: isSet(object.payload) ? bytesFromBase64(object.payload) : new Uint8Array() }; + return { + payload: isSet(object.payload) + ? bytesFromBase64(object.payload) + : new Uint8Array(), + } }, toJSON(message: SnapshotExtensionPayload): unknown { - const obj: any = {}; + const obj: any = {} message.payload !== undefined && - (obj.payload = base64FromBytes(message.payload !== undefined ? message.payload : new Uint8Array())); - return obj; + (obj.payload = base64FromBytes( + message.payload !== undefined ? message.payload : new Uint8Array(), + )) + return obj }, - fromPartial, I>>(object: I): SnapshotExtensionPayload { - const message = createBaseSnapshotExtensionPayload(); - message.payload = object.payload ?? new Uint8Array(); - return message; + fromPartial, I>>( + object: I, + ): SnapshotExtensionPayload { + const message = createBaseSnapshotExtensionPayload() + message.payload = object.payload ?? new Uint8Array() + return message }, -}; +} -declare var self: any | undefined; -declare var window: any | undefined; -declare var global: any | undefined; +declare var self: any | undefined +declare var window: any | undefined +declare var global: any | undefined var globalThis: any = (() => { - if (typeof globalThis !== "undefined") { - return globalThis; - } - if (typeof self !== "undefined") { - return self; - } - if (typeof window !== "undefined") { - return window; - } - if (typeof global !== "undefined") { - return global; - } - throw "Unable to locate global object"; -})(); - + if (typeof globalThis !== "undefined") return globalThis + if (typeof self !== "undefined") return self + if (typeof window !== "undefined") return window + if (typeof global !== "undefined") return global + throw "Unable to locate global object" +})() + +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")) function bytesFromBase64(b64: string): Uint8Array { - if (globalThis.Buffer) { - return Uint8Array.from(globalThis.Buffer.from(b64, "base64")); - } else { - const bin = globalThis.atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; + 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 } +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")) function base64FromBytes(arr: Uint8Array): string { - if (globalThis.Buffer) { - return globalThis.Buffer.from(arr).toString("base64"); - } else { - const bin: string[] = []; - arr.forEach((byte) => { - bin.push(String.fromCharCode(byte)); - }); - return globalThis.btoa(bin.join("")); - } + const bin: string[] = [] + arr.forEach((byte) => { + bin.push(String.fromCharCode(byte)) + }) + return btoa(bin.join("")) } -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/cosmos/base/store/v1beta1/commit_info.ts b/packages/protojs/src/cosmos/base/store/v1beta1/commit_info.ts index cd903a73..ea26cc22 100644 --- a/packages/protojs/src/cosmos/base/store/v1beta1/commit_info.ts +++ b/packages/protojs/src/cosmos/base/store/v1beta1/commit_info.ts @@ -1,16 +1,16 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "cosmos.base.store.v1beta1"; +export const protobufPackage = "cosmos.base.store.v1beta1" /** * CommitInfo defines commit information used by the multi-store when committing * a version/height. */ export interface CommitInfo { - version: Long; - storeInfos: StoreInfo[]; + version: Long + storeInfos: StoreInfo[] } /** @@ -18,8 +18,8 @@ export interface CommitInfo { * between a store name and the commit ID. */ export interface StoreInfo { - name: string; - commitId?: CommitID; + name: string + commitId?: CommitID } /** @@ -27,256 +27,266 @@ export interface StoreInfo { * committed. */ export interface CommitID { - version: Long; - hash: Uint8Array; + version: Long + hash: Uint8Array } function createBaseCommitInfo(): CommitInfo { - return { version: Long.ZERO, storeInfos: [] }; + return { version: Long.ZERO, storeInfos: [] } } export const CommitInfo = { encode(message: CommitInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (!message.version.isZero()) { - writer.uint32(8).int64(message.version); + writer.uint32(8).int64(message.version) } for (const v of message.storeInfos) { - StoreInfo.encode(v!, writer.uint32(18).fork()).ldelim(); + StoreInfo.encode(v!, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): CommitInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseCommitInfo(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseCommitInfo() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.version = reader.int64() as Long; - break; + message.version = reader.int64() as Long + break case 2: - message.storeInfos.push(StoreInfo.decode(reader, reader.uint32())); - break; + message.storeInfos.push(StoreInfo.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): CommitInfo { return { version: isSet(object.version) ? Long.fromValue(object.version) : Long.ZERO, - storeInfos: Array.isArray(object?.storeInfos) ? object.storeInfos.map((e: any) => StoreInfo.fromJSON(e)) : [], - }; + storeInfos: Array.isArray(object?.storeInfos) + ? object.storeInfos.map((e: any) => StoreInfo.fromJSON(e)) + : [], + } }, toJSON(message: CommitInfo): unknown { - const obj: any = {}; - message.version !== undefined && (obj.version = (message.version || Long.ZERO).toString()); + const obj: any = {} + message.version !== undefined && + (obj.version = (message.version || Long.ZERO).toString()) if (message.storeInfos) { - obj.storeInfos = message.storeInfos.map((e) => e ? StoreInfo.toJSON(e) : undefined); + obj.storeInfos = message.storeInfos.map((e) => + e ? StoreInfo.toJSON(e) : undefined, + ) } else { - obj.storeInfos = []; + obj.storeInfos = [] } - return obj; + return obj }, fromPartial, I>>(object: I): CommitInfo { - const message = createBaseCommitInfo(); - message.version = (object.version !== undefined && object.version !== null) - ? Long.fromValue(object.version) - : Long.ZERO; - message.storeInfos = object.storeInfos?.map((e) => StoreInfo.fromPartial(e)) || []; - return message; + const message = createBaseCommitInfo() + message.version = + object.version !== undefined && object.version !== null + ? Long.fromValue(object.version) + : Long.ZERO + message.storeInfos = object.storeInfos?.map((e) => StoreInfo.fromPartial(e)) || [] + return message }, -}; +} function createBaseStoreInfo(): StoreInfo { - return { name: "", commitId: undefined }; + return { name: "", commitId: undefined } } export const StoreInfo = { encode(message: StoreInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { - writer.uint32(10).string(message.name); + writer.uint32(10).string(message.name) } if (message.commitId !== undefined) { - CommitID.encode(message.commitId, writer.uint32(18).fork()).ldelim(); + CommitID.encode(message.commitId, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): StoreInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseStoreInfo(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseStoreInfo() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.name = reader.string(); - break; + message.name = reader.string() + break case 2: - message.commitId = CommitID.decode(reader, reader.uint32()); - break; + message.commitId = CommitID.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): StoreInfo { return { name: isSet(object.name) ? String(object.name) : "", commitId: isSet(object.commitId) ? CommitID.fromJSON(object.commitId) : undefined, - }; + } }, toJSON(message: StoreInfo): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.commitId !== undefined && (obj.commitId = message.commitId ? CommitID.toJSON(message.commitId) : undefined); - return obj; + const obj: any = {} + message.name !== undefined && (obj.name = message.name) + message.commitId !== undefined && + (obj.commitId = message.commitId ? CommitID.toJSON(message.commitId) : undefined) + return obj }, fromPartial, I>>(object: I): StoreInfo { - const message = createBaseStoreInfo(); - message.name = object.name ?? ""; - message.commitId = (object.commitId !== undefined && object.commitId !== null) - ? CommitID.fromPartial(object.commitId) - : undefined; - return message; + const message = createBaseStoreInfo() + message.name = object.name ?? "" + message.commitId = + object.commitId !== undefined && object.commitId !== null + ? CommitID.fromPartial(object.commitId) + : undefined + return message }, -}; +} function createBaseCommitID(): CommitID { - return { version: Long.ZERO, hash: new Uint8Array() }; + return { version: Long.ZERO, hash: new Uint8Array() } } export const CommitID = { encode(message: CommitID, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (!message.version.isZero()) { - writer.uint32(8).int64(message.version); + writer.uint32(8).int64(message.version) } if (message.hash.length !== 0) { - writer.uint32(18).bytes(message.hash); + writer.uint32(18).bytes(message.hash) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): CommitID { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseCommitID(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseCommitID() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.version = reader.int64() as Long; - break; + message.version = reader.int64() as Long + break case 2: - message.hash = reader.bytes(); - break; + message.hash = reader.bytes() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): CommitID { return { version: isSet(object.version) ? Long.fromValue(object.version) : Long.ZERO, hash: isSet(object.hash) ? bytesFromBase64(object.hash) : new Uint8Array(), - }; + } }, toJSON(message: CommitID): unknown { - const obj: any = {}; - message.version !== undefined && (obj.version = (message.version || Long.ZERO).toString()); + const obj: any = {} + message.version !== undefined && + (obj.version = (message.version || Long.ZERO).toString()) message.hash !== undefined && - (obj.hash = base64FromBytes(message.hash !== undefined ? message.hash : new Uint8Array())); - return obj; + (obj.hash = base64FromBytes( + message.hash !== undefined ? message.hash : new Uint8Array(), + )) + return obj }, fromPartial, I>>(object: I): CommitID { - const message = createBaseCommitID(); - message.version = (object.version !== undefined && object.version !== null) - ? Long.fromValue(object.version) - : Long.ZERO; - message.hash = object.hash ?? new Uint8Array(); - return message; + const message = createBaseCommitID() + message.version = + object.version !== undefined && object.version !== null + ? Long.fromValue(object.version) + : Long.ZERO + message.hash = object.hash ?? new Uint8Array() + return message }, -}; +} -declare var self: any | undefined; -declare var window: any | undefined; -declare var global: any | undefined; +declare var self: any | undefined +declare var window: any | undefined +declare var global: any | undefined var globalThis: any = (() => { - if (typeof globalThis !== "undefined") { - return globalThis; - } - if (typeof self !== "undefined") { - return self; - } - if (typeof window !== "undefined") { - return window; - } - if (typeof global !== "undefined") { - return global; - } - throw "Unable to locate global object"; -})(); + if (typeof globalThis !== "undefined") return globalThis + if (typeof self !== "undefined") return self + if (typeof window !== "undefined") return window + if (typeof global !== "undefined") return global + throw "Unable to locate global object" +})() +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")) function bytesFromBase64(b64: string): Uint8Array { - if (globalThis.Buffer) { - return Uint8Array.from(globalThis.Buffer.from(b64, "base64")); - } else { - const bin = globalThis.atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; + 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 } +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")) function base64FromBytes(arr: Uint8Array): string { - if (globalThis.Buffer) { - return globalThis.Buffer.from(arr).toString("base64"); - } else { - const bin: string[] = []; - arr.forEach((byte) => { - bin.push(String.fromCharCode(byte)); - }); - return globalThis.btoa(bin.join("")); - } + const bin: string[] = [] + arr.forEach((byte) => { + bin.push(String.fromCharCode(byte)) + }) + return btoa(bin.join("")) } -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/cosmos/base/store/v1beta1/listening.ts b/packages/protojs/src/cosmos/base/store/v1beta1/listening.ts index e280f5ed..ba75f7ea 100644 --- a/packages/protojs/src/cosmos/base/store/v1beta1/listening.ts +++ b/packages/protojs/src/cosmos/base/store/v1beta1/listening.ts @@ -1,8 +1,8 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "cosmos.base.store.v1beta1"; +export const protobufPackage = "cosmos.base.store.v1beta1" /** * StoreKVPair is a KVStore KVPair used for listening to state changes (Sets and Deletes) @@ -13,59 +13,59 @@ export const protobufPackage = "cosmos.base.store.v1beta1"; */ export interface StoreKVPair { /** the store key for the KVStore this pair originates from */ - storeKey: string; + storeKey: string /** true indicates a delete operation, false indicates a set operation */ - delete: boolean; - key: Uint8Array; - value: Uint8Array; + delete: boolean + key: Uint8Array + value: Uint8Array } function createBaseStoreKVPair(): StoreKVPair { - return { storeKey: "", delete: false, key: new Uint8Array(), value: new Uint8Array() }; + return { storeKey: "", delete: false, key: new Uint8Array(), value: new Uint8Array() } } export const StoreKVPair = { encode(message: StoreKVPair, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.storeKey !== "") { - writer.uint32(10).string(message.storeKey); + writer.uint32(10).string(message.storeKey) } if (message.delete === true) { - writer.uint32(16).bool(message.delete); + writer.uint32(16).bool(message.delete) } if (message.key.length !== 0) { - writer.uint32(26).bytes(message.key); + writer.uint32(26).bytes(message.key) } if (message.value.length !== 0) { - writer.uint32(34).bytes(message.value); + writer.uint32(34).bytes(message.value) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): StoreKVPair { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseStoreKVPair(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseStoreKVPair() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.storeKey = reader.string(); - break; + message.storeKey = reader.string() + break case 2: - message.delete = reader.bool(); - break; + message.delete = reader.bool() + break case 3: - message.key = reader.bytes(); - break; + message.key = reader.bytes() + break case 4: - message.value = reader.bytes(); - break; + message.value = reader.bytes() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): StoreKVPair { @@ -74,91 +74,93 @@ export const StoreKVPair = { delete: isSet(object.delete) ? Boolean(object.delete) : false, key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array(), value: isSet(object.value) ? bytesFromBase64(object.value) : new Uint8Array(), - }; + } }, toJSON(message: StoreKVPair): unknown { - const obj: any = {}; - message.storeKey !== undefined && (obj.storeKey = message.storeKey); - message.delete !== undefined && (obj.delete = message.delete); + const obj: any = {} + message.storeKey !== undefined && (obj.storeKey = message.storeKey) + message.delete !== undefined && (obj.delete = message.delete) message.key !== undefined && - (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); + (obj.key = base64FromBytes( + message.key !== undefined ? message.key : new Uint8Array(), + )) message.value !== undefined && - (obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array())); - return obj; + (obj.value = base64FromBytes( + message.value !== undefined ? message.value : new Uint8Array(), + )) + return obj }, fromPartial, I>>(object: I): StoreKVPair { - const message = createBaseStoreKVPair(); - message.storeKey = object.storeKey ?? ""; - message.delete = object.delete ?? false; - message.key = object.key ?? new Uint8Array(); - message.value = object.value ?? new Uint8Array(); - return message; + const message = createBaseStoreKVPair() + message.storeKey = object.storeKey ?? "" + message.delete = object.delete ?? false + message.key = object.key ?? new Uint8Array() + message.value = object.value ?? new Uint8Array() + return message }, -}; +} -declare var self: any | undefined; -declare var window: any | undefined; -declare var global: any | undefined; +declare var self: any | undefined +declare var window: any | undefined +declare var global: any | undefined var globalThis: any = (() => { - if (typeof globalThis !== "undefined") { - return globalThis; - } - if (typeof self !== "undefined") { - return self; - } - if (typeof window !== "undefined") { - return window; - } - if (typeof global !== "undefined") { - return global; - } - throw "Unable to locate global object"; -})(); - + if (typeof globalThis !== "undefined") return globalThis + if (typeof self !== "undefined") return self + if (typeof window !== "undefined") return window + if (typeof global !== "undefined") return global + throw "Unable to locate global object" +})() + +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")) function bytesFromBase64(b64: string): Uint8Array { - if (globalThis.Buffer) { - return Uint8Array.from(globalThis.Buffer.from(b64, "base64")); - } else { - const bin = globalThis.atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; + 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 } +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")) function base64FromBytes(arr: Uint8Array): string { - if (globalThis.Buffer) { - return globalThis.Buffer.from(arr).toString("base64"); - } else { - const bin: string[] = []; - arr.forEach((byte) => { - bin.push(String.fromCharCode(byte)); - }); - return globalThis.btoa(bin.join("")); - } + const bin: string[] = [] + arr.forEach((byte) => { + bin.push(String.fromCharCode(byte)) + }) + return btoa(bin.join("")) } -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/cosmos/base/tendermint/v1beta1/query.ts b/packages/protojs/src/cosmos/base/tendermint/v1beta1/query.ts index ca427db5..691dd00a 100644 --- a/packages/protojs/src/cosmos/base/tendermint/v1beta1/query.ts +++ b/packages/protojs/src/cosmos/base/tendermint/v1beta1/query.ts @@ -1,868 +1,1003 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { Any } from "../../../../google/protobuf/any"; -import { DefaultNodeInfo } from "../../../../tendermint/p2p/types"; -import { Block } from "../../../../tendermint/types/block"; -import { BlockID } from "../../../../tendermint/types/types"; -import { PageRequest, PageResponse } from "../../query/v1beta1/pagination"; +import { PageRequest, PageResponse } from "../../query/v1beta1/pagination" +import { Any } from "../../../../google/protobuf/any" +import { BlockID } from "../../../../tendermint/types/types" +import { Block } from "../../../../tendermint/types/block" +import { DefaultNodeInfo } from "../../../../tendermint/p2p/types" +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "cosmos.base.tendermint.v1beta1"; +export const protobufPackage = "cosmos.base.tendermint.v1beta1" /** GetValidatorSetByHeightRequest is the request type for the Query/GetValidatorSetByHeight RPC method. */ export interface GetValidatorSetByHeightRequest { - height: Long; + height: Long /** pagination defines an pagination for the request. */ - pagination?: PageRequest; + pagination?: PageRequest } /** GetValidatorSetByHeightResponse is the response type for the Query/GetValidatorSetByHeight RPC method. */ export interface GetValidatorSetByHeightResponse { - blockHeight: Long; - validators: Validator[]; + blockHeight: Long + validators: Validator[] /** pagination defines an pagination for the response. */ - pagination?: PageResponse; + pagination?: PageResponse } /** GetLatestValidatorSetRequest is the request type for the Query/GetValidatorSetByHeight RPC method. */ export interface GetLatestValidatorSetRequest { /** pagination defines an pagination for the request. */ - pagination?: PageRequest; + pagination?: PageRequest } /** GetLatestValidatorSetResponse is the response type for the Query/GetValidatorSetByHeight RPC method. */ export interface GetLatestValidatorSetResponse { - blockHeight: Long; - validators: Validator[]; + blockHeight: Long + validators: Validator[] /** pagination defines an pagination for the response. */ - pagination?: PageResponse; + pagination?: PageResponse } /** Validator is the type for the validator-set. */ export interface Validator { - address: string; - pubKey?: Any; - votingPower: Long; - proposerPriority: Long; + address: string + pubKey?: Any + votingPower: Long + proposerPriority: Long } /** GetBlockByHeightRequest is the request type for the Query/GetBlockByHeight RPC method. */ export interface GetBlockByHeightRequest { - height: Long; + height: Long } /** GetBlockByHeightResponse is the response type for the Query/GetBlockByHeight RPC method. */ export interface GetBlockByHeightResponse { - blockId?: BlockID; - block?: Block; + blockId?: BlockID + block?: Block } /** GetLatestBlockRequest is the request type for the Query/GetLatestBlock RPC method. */ -export interface GetLatestBlockRequest { -} +export interface GetLatestBlockRequest {} /** GetLatestBlockResponse is the response type for the Query/GetLatestBlock RPC method. */ export interface GetLatestBlockResponse { - blockId?: BlockID; - block?: Block; + blockId?: BlockID + block?: Block } /** GetSyncingRequest is the request type for the Query/GetSyncing RPC method. */ -export interface GetSyncingRequest { -} +export interface GetSyncingRequest {} /** GetSyncingResponse is the response type for the Query/GetSyncing RPC method. */ export interface GetSyncingResponse { - syncing: boolean; + syncing: boolean } /** GetNodeInfoRequest is the request type for the Query/GetNodeInfo RPC method. */ -export interface GetNodeInfoRequest { -} +export interface GetNodeInfoRequest {} /** GetNodeInfoResponse is the request type for the Query/GetNodeInfo RPC method. */ export interface GetNodeInfoResponse { - defaultNodeInfo?: DefaultNodeInfo; - applicationVersion?: VersionInfo; + defaultNodeInfo?: DefaultNodeInfo + applicationVersion?: VersionInfo } /** VersionInfo is the type for the GetNodeInfoResponse message. */ export interface VersionInfo { - name: string; - appName: string; - version: string; - gitCommit: string; - buildTags: string; - goVersion: string; - buildDeps: Module[]; + name: string + appName: string + version: string + gitCommit: string + buildTags: string + goVersion: string + buildDeps: Module[] /** Since: cosmos-sdk 0.43 */ - cosmosSdkVersion: string; + cosmosSdkVersion: string } /** Module is the type for VersionInfo */ export interface Module { /** module path */ - path: string; + path: string /** module version */ - version: string; + version: string /** checksum */ - sum: string; + sum: string } function createBaseGetValidatorSetByHeightRequest(): GetValidatorSetByHeightRequest { - return { height: Long.ZERO, pagination: undefined }; + return { height: Long.ZERO, pagination: undefined } } export const GetValidatorSetByHeightRequest = { - encode(message: GetValidatorSetByHeightRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: GetValidatorSetByHeightRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (!message.height.isZero()) { - writer.uint32(8).int64(message.height); + writer.uint32(8).int64(message.height) } if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): GetValidatorSetByHeightRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetValidatorSetByHeightRequest(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): GetValidatorSetByHeightRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseGetValidatorSetByHeightRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.height = reader.int64() as Long; - break; + message.height = reader.int64() as Long + break case 2: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; + message.pagination = PageRequest.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): GetValidatorSetByHeightRequest { return { height: isSet(object.height) ? Long.fromValue(object.height) : Long.ZERO, - pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined, - }; + pagination: isSet(object.pagination) + ? PageRequest.fromJSON(object.pagination) + : undefined, + } }, toJSON(message: GetValidatorSetByHeightRequest): unknown { - const obj: any = {}; - message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); + const obj: any = {} + message.height !== undefined && + (obj.height = (message.height || Long.ZERO).toString()) message.pagination !== undefined && - (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); - return obj; + (obj.pagination = message.pagination + ? PageRequest.toJSON(message.pagination) + : undefined) + return obj }, fromPartial, I>>( object: I, ): GetValidatorSetByHeightRequest { - const message = createBaseGetValidatorSetByHeightRequest(); - message.height = (object.height !== undefined && object.height !== null) - ? Long.fromValue(object.height) - : Long.ZERO; - message.pagination = (object.pagination !== undefined && object.pagination !== null) - ? PageRequest.fromPartial(object.pagination) - : undefined; - return message; + const message = createBaseGetValidatorSetByHeightRequest() + message.height = + object.height !== undefined && object.height !== null + ? Long.fromValue(object.height) + : Long.ZERO + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageRequest.fromPartial(object.pagination) + : undefined + return message }, -}; +} function createBaseGetValidatorSetByHeightResponse(): GetValidatorSetByHeightResponse { - return { blockHeight: Long.ZERO, validators: [], pagination: undefined }; + return { blockHeight: Long.ZERO, validators: [], pagination: undefined } } export const GetValidatorSetByHeightResponse = { - encode(message: GetValidatorSetByHeightResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: GetValidatorSetByHeightResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (!message.blockHeight.isZero()) { - writer.uint32(8).int64(message.blockHeight); + writer.uint32(8).int64(message.blockHeight) } for (const v of message.validators) { - Validator.encode(v!, writer.uint32(18).fork()).ldelim(); + Validator.encode(v!, writer.uint32(18).fork()).ldelim() } if (message.pagination !== undefined) { - PageResponse.encode(message.pagination, writer.uint32(26).fork()).ldelim(); + PageResponse.encode(message.pagination, writer.uint32(26).fork()).ldelim() } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): GetValidatorSetByHeightResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetValidatorSetByHeightResponse(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): GetValidatorSetByHeightResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseGetValidatorSetByHeightResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.blockHeight = reader.int64() as Long; - break; + message.blockHeight = reader.int64() as Long + break case 2: - message.validators.push(Validator.decode(reader, reader.uint32())); - break; + message.validators.push(Validator.decode(reader, reader.uint32())) + break case 3: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; + message.pagination = PageResponse.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): GetValidatorSetByHeightResponse { return { - blockHeight: isSet(object.blockHeight) ? Long.fromValue(object.blockHeight) : Long.ZERO, - validators: Array.isArray(object?.validators) ? object.validators.map((e: any) => Validator.fromJSON(e)) : [], - pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, - }; + blockHeight: isSet(object.blockHeight) + ? Long.fromValue(object.blockHeight) + : Long.ZERO, + validators: Array.isArray(object?.validators) + ? object.validators.map((e: any) => Validator.fromJSON(e)) + : [], + pagination: isSet(object.pagination) + ? PageResponse.fromJSON(object.pagination) + : undefined, + } }, toJSON(message: GetValidatorSetByHeightResponse): unknown { - const obj: any = {}; - message.blockHeight !== undefined && (obj.blockHeight = (message.blockHeight || Long.ZERO).toString()); + const obj: any = {} + message.blockHeight !== undefined && + (obj.blockHeight = (message.blockHeight || Long.ZERO).toString()) if (message.validators) { - obj.validators = message.validators.map((e) => e ? Validator.toJSON(e) : undefined); + obj.validators = message.validators.map((e) => + e ? Validator.toJSON(e) : undefined, + ) } else { - obj.validators = []; + obj.validators = [] } message.pagination !== undefined && - (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); - return obj; + (obj.pagination = message.pagination + ? PageResponse.toJSON(message.pagination) + : undefined) + return obj }, fromPartial, I>>( object: I, ): GetValidatorSetByHeightResponse { - const message = createBaseGetValidatorSetByHeightResponse(); - message.blockHeight = (object.blockHeight !== undefined && object.blockHeight !== null) - ? Long.fromValue(object.blockHeight) - : Long.ZERO; - message.validators = object.validators?.map((e) => Validator.fromPartial(e)) || []; - message.pagination = (object.pagination !== undefined && object.pagination !== null) - ? PageResponse.fromPartial(object.pagination) - : undefined; - return message; - }, -}; + const message = createBaseGetValidatorSetByHeightResponse() + message.blockHeight = + object.blockHeight !== undefined && object.blockHeight !== null + ? Long.fromValue(object.blockHeight) + : Long.ZERO + message.validators = object.validators?.map((e) => Validator.fromPartial(e)) || [] + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageResponse.fromPartial(object.pagination) + : undefined + return message + }, +} function createBaseGetLatestValidatorSetRequest(): GetLatestValidatorSetRequest { - return { pagination: undefined }; + return { pagination: undefined } } export const GetLatestValidatorSetRequest = { - encode(message: GetLatestValidatorSetRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: GetLatestValidatorSetRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): GetLatestValidatorSetRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetLatestValidatorSetRequest(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): GetLatestValidatorSetRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseGetLatestValidatorSetRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; + message.pagination = PageRequest.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): GetLatestValidatorSetRequest { - return { pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined }; + return { + pagination: isSet(object.pagination) + ? PageRequest.fromJSON(object.pagination) + : undefined, + } }, toJSON(message: GetLatestValidatorSetRequest): unknown { - const obj: any = {}; + const obj: any = {} message.pagination !== undefined && - (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); - return obj; + (obj.pagination = message.pagination + ? PageRequest.toJSON(message.pagination) + : undefined) + return obj }, - fromPartial, I>>(object: I): GetLatestValidatorSetRequest { - const message = createBaseGetLatestValidatorSetRequest(); - message.pagination = (object.pagination !== undefined && object.pagination !== null) - ? PageRequest.fromPartial(object.pagination) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): GetLatestValidatorSetRequest { + const message = createBaseGetLatestValidatorSetRequest() + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageRequest.fromPartial(object.pagination) + : undefined + return message }, -}; +} function createBaseGetLatestValidatorSetResponse(): GetLatestValidatorSetResponse { - return { blockHeight: Long.ZERO, validators: [], pagination: undefined }; + return { blockHeight: Long.ZERO, validators: [], pagination: undefined } } export const GetLatestValidatorSetResponse = { - encode(message: GetLatestValidatorSetResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: GetLatestValidatorSetResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (!message.blockHeight.isZero()) { - writer.uint32(8).int64(message.blockHeight); + writer.uint32(8).int64(message.blockHeight) } for (const v of message.validators) { - Validator.encode(v!, writer.uint32(18).fork()).ldelim(); + Validator.encode(v!, writer.uint32(18).fork()).ldelim() } if (message.pagination !== undefined) { - PageResponse.encode(message.pagination, writer.uint32(26).fork()).ldelim(); + PageResponse.encode(message.pagination, writer.uint32(26).fork()).ldelim() } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): GetLatestValidatorSetResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetLatestValidatorSetResponse(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): GetLatestValidatorSetResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseGetLatestValidatorSetResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.blockHeight = reader.int64() as Long; - break; + message.blockHeight = reader.int64() as Long + break case 2: - message.validators.push(Validator.decode(reader, reader.uint32())); - break; + message.validators.push(Validator.decode(reader, reader.uint32())) + break case 3: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; + message.pagination = PageResponse.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): GetLatestValidatorSetResponse { return { - blockHeight: isSet(object.blockHeight) ? Long.fromValue(object.blockHeight) : Long.ZERO, - validators: Array.isArray(object?.validators) ? object.validators.map((e: any) => Validator.fromJSON(e)) : [], - pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, - }; + blockHeight: isSet(object.blockHeight) + ? Long.fromValue(object.blockHeight) + : Long.ZERO, + validators: Array.isArray(object?.validators) + ? object.validators.map((e: any) => Validator.fromJSON(e)) + : [], + pagination: isSet(object.pagination) + ? PageResponse.fromJSON(object.pagination) + : undefined, + } }, toJSON(message: GetLatestValidatorSetResponse): unknown { - const obj: any = {}; - message.blockHeight !== undefined && (obj.blockHeight = (message.blockHeight || Long.ZERO).toString()); + const obj: any = {} + message.blockHeight !== undefined && + (obj.blockHeight = (message.blockHeight || Long.ZERO).toString()) if (message.validators) { - obj.validators = message.validators.map((e) => e ? Validator.toJSON(e) : undefined); + obj.validators = message.validators.map((e) => + e ? Validator.toJSON(e) : undefined, + ) } else { - obj.validators = []; + obj.validators = [] } message.pagination !== undefined && - (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); - return obj; + (obj.pagination = message.pagination + ? PageResponse.toJSON(message.pagination) + : undefined) + return obj }, fromPartial, I>>( object: I, ): GetLatestValidatorSetResponse { - const message = createBaseGetLatestValidatorSetResponse(); - message.blockHeight = (object.blockHeight !== undefined && object.blockHeight !== null) - ? Long.fromValue(object.blockHeight) - : Long.ZERO; - message.validators = object.validators?.map((e) => Validator.fromPartial(e)) || []; - message.pagination = (object.pagination !== undefined && object.pagination !== null) - ? PageResponse.fromPartial(object.pagination) - : undefined; - return message; - }, -}; + const message = createBaseGetLatestValidatorSetResponse() + message.blockHeight = + object.blockHeight !== undefined && object.blockHeight !== null + ? Long.fromValue(object.blockHeight) + : Long.ZERO + message.validators = object.validators?.map((e) => Validator.fromPartial(e)) || [] + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageResponse.fromPartial(object.pagination) + : undefined + return message + }, +} function createBaseValidator(): Validator { - return { address: "", pubKey: undefined, votingPower: Long.ZERO, proposerPriority: Long.ZERO }; + return { + address: "", + pubKey: undefined, + votingPower: Long.ZERO, + proposerPriority: Long.ZERO, + } } export const Validator = { encode(message: Validator, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.address !== "") { - writer.uint32(10).string(message.address); + writer.uint32(10).string(message.address) } if (message.pubKey !== undefined) { - Any.encode(message.pubKey, writer.uint32(18).fork()).ldelim(); + Any.encode(message.pubKey, writer.uint32(18).fork()).ldelim() } if (!message.votingPower.isZero()) { - writer.uint32(24).int64(message.votingPower); + writer.uint32(24).int64(message.votingPower) } if (!message.proposerPriority.isZero()) { - writer.uint32(32).int64(message.proposerPriority); + writer.uint32(32).int64(message.proposerPriority) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Validator { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseValidator(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseValidator() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.address = reader.string(); - break; + message.address = reader.string() + break case 2: - message.pubKey = Any.decode(reader, reader.uint32()); - break; + message.pubKey = Any.decode(reader, reader.uint32()) + break case 3: - message.votingPower = reader.int64() as Long; - break; + message.votingPower = reader.int64() as Long + break case 4: - message.proposerPriority = reader.int64() as Long; - break; + message.proposerPriority = reader.int64() as Long + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Validator { return { address: isSet(object.address) ? String(object.address) : "", pubKey: isSet(object.pubKey) ? Any.fromJSON(object.pubKey) : undefined, - votingPower: isSet(object.votingPower) ? Long.fromValue(object.votingPower) : Long.ZERO, - proposerPriority: isSet(object.proposerPriority) ? Long.fromValue(object.proposerPriority) : Long.ZERO, - }; + votingPower: isSet(object.votingPower) + ? Long.fromValue(object.votingPower) + : Long.ZERO, + proposerPriority: isSet(object.proposerPriority) + ? Long.fromValue(object.proposerPriority) + : Long.ZERO, + } }, toJSON(message: Validator): unknown { - const obj: any = {}; - message.address !== undefined && (obj.address = message.address); - message.pubKey !== undefined && (obj.pubKey = message.pubKey ? Any.toJSON(message.pubKey) : undefined); - message.votingPower !== undefined && (obj.votingPower = (message.votingPower || Long.ZERO).toString()); + const obj: any = {} + message.address !== undefined && (obj.address = message.address) + message.pubKey !== undefined && + (obj.pubKey = message.pubKey ? Any.toJSON(message.pubKey) : undefined) + message.votingPower !== undefined && + (obj.votingPower = (message.votingPower || Long.ZERO).toString()) message.proposerPriority !== undefined && - (obj.proposerPriority = (message.proposerPriority || Long.ZERO).toString()); - return obj; + (obj.proposerPriority = (message.proposerPriority || Long.ZERO).toString()) + return obj }, fromPartial, I>>(object: I): Validator { - const message = createBaseValidator(); - message.address = object.address ?? ""; - message.pubKey = (object.pubKey !== undefined && object.pubKey !== null) - ? Any.fromPartial(object.pubKey) - : undefined; - message.votingPower = (object.votingPower !== undefined && object.votingPower !== null) - ? Long.fromValue(object.votingPower) - : Long.ZERO; - message.proposerPriority = (object.proposerPriority !== undefined && object.proposerPriority !== null) - ? Long.fromValue(object.proposerPriority) - : Long.ZERO; - return message; - }, -}; + const message = createBaseValidator() + message.address = object.address ?? "" + message.pubKey = + object.pubKey !== undefined && object.pubKey !== null + ? Any.fromPartial(object.pubKey) + : undefined + message.votingPower = + object.votingPower !== undefined && object.votingPower !== null + ? Long.fromValue(object.votingPower) + : Long.ZERO + message.proposerPriority = + object.proposerPriority !== undefined && object.proposerPriority !== null + ? Long.fromValue(object.proposerPriority) + : Long.ZERO + return message + }, +} function createBaseGetBlockByHeightRequest(): GetBlockByHeightRequest { - return { height: Long.ZERO }; + return { height: Long.ZERO } } export const GetBlockByHeightRequest = { - encode(message: GetBlockByHeightRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: GetBlockByHeightRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (!message.height.isZero()) { - writer.uint32(8).int64(message.height); + writer.uint32(8).int64(message.height) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): GetBlockByHeightRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetBlockByHeightRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseGetBlockByHeightRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.height = reader.int64() as Long; - break; + message.height = reader.int64() as Long + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): GetBlockByHeightRequest { - return { height: isSet(object.height) ? Long.fromValue(object.height) : Long.ZERO }; + return { + height: isSet(object.height) ? Long.fromValue(object.height) : Long.ZERO, + } }, toJSON(message: GetBlockByHeightRequest): unknown { - const obj: any = {}; - message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); - return obj; + const obj: any = {} + message.height !== undefined && + (obj.height = (message.height || Long.ZERO).toString()) + return obj }, - fromPartial, I>>(object: I): GetBlockByHeightRequest { - const message = createBaseGetBlockByHeightRequest(); - message.height = (object.height !== undefined && object.height !== null) - ? Long.fromValue(object.height) - : Long.ZERO; - return message; + fromPartial, I>>( + object: I, + ): GetBlockByHeightRequest { + const message = createBaseGetBlockByHeightRequest() + message.height = + object.height !== undefined && object.height !== null + ? Long.fromValue(object.height) + : Long.ZERO + return message }, -}; +} function createBaseGetBlockByHeightResponse(): GetBlockByHeightResponse { - return { blockId: undefined, block: undefined }; + return { blockId: undefined, block: undefined } } export const GetBlockByHeightResponse = { - encode(message: GetBlockByHeightResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: GetBlockByHeightResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.blockId !== undefined) { - BlockID.encode(message.blockId, writer.uint32(10).fork()).ldelim(); + BlockID.encode(message.blockId, writer.uint32(10).fork()).ldelim() } if (message.block !== undefined) { - Block.encode(message.block, writer.uint32(18).fork()).ldelim(); + Block.encode(message.block, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): GetBlockByHeightResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetBlockByHeightResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseGetBlockByHeightResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.blockId = BlockID.decode(reader, reader.uint32()); - break; + message.blockId = BlockID.decode(reader, reader.uint32()) + break case 2: - message.block = Block.decode(reader, reader.uint32()); - break; + message.block = Block.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): GetBlockByHeightResponse { return { blockId: isSet(object.blockId) ? BlockID.fromJSON(object.blockId) : undefined, block: isSet(object.block) ? Block.fromJSON(object.block) : undefined, - }; + } }, toJSON(message: GetBlockByHeightResponse): unknown { - const obj: any = {}; - message.blockId !== undefined && (obj.blockId = message.blockId ? BlockID.toJSON(message.blockId) : undefined); - message.block !== undefined && (obj.block = message.block ? Block.toJSON(message.block) : undefined); - return obj; + const obj: any = {} + message.blockId !== undefined && + (obj.blockId = message.blockId ? BlockID.toJSON(message.blockId) : undefined) + message.block !== undefined && + (obj.block = message.block ? Block.toJSON(message.block) : undefined) + return obj }, - fromPartial, I>>(object: I): GetBlockByHeightResponse { - const message = createBaseGetBlockByHeightResponse(); - message.blockId = (object.blockId !== undefined && object.blockId !== null) - ? BlockID.fromPartial(object.blockId) - : undefined; - message.block = (object.block !== undefined && object.block !== null) ? Block.fromPartial(object.block) : undefined; - return message; + fromPartial, I>>( + object: I, + ): GetBlockByHeightResponse { + const message = createBaseGetBlockByHeightResponse() + message.blockId = + object.blockId !== undefined && object.blockId !== null + ? BlockID.fromPartial(object.blockId) + : undefined + message.block = + object.block !== undefined && object.block !== null + ? Block.fromPartial(object.block) + : undefined + return message }, -}; +} function createBaseGetLatestBlockRequest(): GetLatestBlockRequest { - return {}; + return {} } export const GetLatestBlockRequest = { - encode(_: GetLatestBlockRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; + encode( + _: GetLatestBlockRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): GetLatestBlockRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetLatestBlockRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseGetLatestBlockRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(_: any): GetLatestBlockRequest { - return {}; + return {} }, toJSON(_: GetLatestBlockRequest): unknown { - const obj: any = {}; - return obj; + const obj: any = {} + return obj }, - fromPartial, I>>(_: I): GetLatestBlockRequest { - const message = createBaseGetLatestBlockRequest(); - return message; + fromPartial, I>>( + _: I, + ): GetLatestBlockRequest { + const message = createBaseGetLatestBlockRequest() + return message }, -}; +} function createBaseGetLatestBlockResponse(): GetLatestBlockResponse { - return { blockId: undefined, block: undefined }; + return { blockId: undefined, block: undefined } } export const GetLatestBlockResponse = { - encode(message: GetLatestBlockResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: GetLatestBlockResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.blockId !== undefined) { - BlockID.encode(message.blockId, writer.uint32(10).fork()).ldelim(); + BlockID.encode(message.blockId, writer.uint32(10).fork()).ldelim() } if (message.block !== undefined) { - Block.encode(message.block, writer.uint32(18).fork()).ldelim(); + Block.encode(message.block, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): GetLatestBlockResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetLatestBlockResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseGetLatestBlockResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.blockId = BlockID.decode(reader, reader.uint32()); - break; + message.blockId = BlockID.decode(reader, reader.uint32()) + break case 2: - message.block = Block.decode(reader, reader.uint32()); - break; + message.block = Block.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): GetLatestBlockResponse { return { blockId: isSet(object.blockId) ? BlockID.fromJSON(object.blockId) : undefined, block: isSet(object.block) ? Block.fromJSON(object.block) : undefined, - }; + } }, toJSON(message: GetLatestBlockResponse): unknown { - const obj: any = {}; - message.blockId !== undefined && (obj.blockId = message.blockId ? BlockID.toJSON(message.blockId) : undefined); - message.block !== undefined && (obj.block = message.block ? Block.toJSON(message.block) : undefined); - return obj; + const obj: any = {} + message.blockId !== undefined && + (obj.blockId = message.blockId ? BlockID.toJSON(message.blockId) : undefined) + message.block !== undefined && + (obj.block = message.block ? Block.toJSON(message.block) : undefined) + return obj }, - fromPartial, I>>(object: I): GetLatestBlockResponse { - const message = createBaseGetLatestBlockResponse(); - message.blockId = (object.blockId !== undefined && object.blockId !== null) - ? BlockID.fromPartial(object.blockId) - : undefined; - message.block = (object.block !== undefined && object.block !== null) ? Block.fromPartial(object.block) : undefined; - return message; + fromPartial, I>>( + object: I, + ): GetLatestBlockResponse { + const message = createBaseGetLatestBlockResponse() + message.blockId = + object.blockId !== undefined && object.blockId !== null + ? BlockID.fromPartial(object.blockId) + : undefined + message.block = + object.block !== undefined && object.block !== null + ? Block.fromPartial(object.block) + : undefined + return message }, -}; +} function createBaseGetSyncingRequest(): GetSyncingRequest { - return {}; + return {} } export const GetSyncingRequest = { encode(_: GetSyncingRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): GetSyncingRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetSyncingRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseGetSyncingRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(_: any): GetSyncingRequest { - return {}; + return {} }, toJSON(_: GetSyncingRequest): unknown { - const obj: any = {}; - return obj; + const obj: any = {} + return obj }, - fromPartial, I>>(_: I): GetSyncingRequest { - const message = createBaseGetSyncingRequest(); - return message; + fromPartial, I>>( + _: I, + ): GetSyncingRequest { + const message = createBaseGetSyncingRequest() + return message }, -}; +} function createBaseGetSyncingResponse(): GetSyncingResponse { - return { syncing: false }; + return { syncing: false } } export const GetSyncingResponse = { - encode(message: GetSyncingResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: GetSyncingResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.syncing === true) { - writer.uint32(8).bool(message.syncing); + writer.uint32(8).bool(message.syncing) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): GetSyncingResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetSyncingResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseGetSyncingResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.syncing = reader.bool(); - break; + message.syncing = reader.bool() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): GetSyncingResponse { - return { syncing: isSet(object.syncing) ? Boolean(object.syncing) : false }; + return { + syncing: isSet(object.syncing) ? Boolean(object.syncing) : false, + } }, toJSON(message: GetSyncingResponse): unknown { - const obj: any = {}; - message.syncing !== undefined && (obj.syncing = message.syncing); - return obj; + const obj: any = {} + message.syncing !== undefined && (obj.syncing = message.syncing) + return obj }, - fromPartial, I>>(object: I): GetSyncingResponse { - const message = createBaseGetSyncingResponse(); - message.syncing = object.syncing ?? false; - return message; + fromPartial, I>>( + object: I, + ): GetSyncingResponse { + const message = createBaseGetSyncingResponse() + message.syncing = object.syncing ?? false + return message }, -}; +} function createBaseGetNodeInfoRequest(): GetNodeInfoRequest { - return {}; + return {} } export const GetNodeInfoRequest = { encode(_: GetNodeInfoRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): GetNodeInfoRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetNodeInfoRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseGetNodeInfoRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(_: any): GetNodeInfoRequest { - return {}; + return {} }, toJSON(_: GetNodeInfoRequest): unknown { - const obj: any = {}; - return obj; + const obj: any = {} + return obj }, - fromPartial, I>>(_: I): GetNodeInfoRequest { - const message = createBaseGetNodeInfoRequest(); - return message; + fromPartial, I>>( + _: I, + ): GetNodeInfoRequest { + const message = createBaseGetNodeInfoRequest() + return message }, -}; +} function createBaseGetNodeInfoResponse(): GetNodeInfoResponse { - return { defaultNodeInfo: undefined, applicationVersion: undefined }; + return { defaultNodeInfo: undefined, applicationVersion: undefined } } export const GetNodeInfoResponse = { - encode(message: GetNodeInfoResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: GetNodeInfoResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.defaultNodeInfo !== undefined) { - DefaultNodeInfo.encode(message.defaultNodeInfo, writer.uint32(10).fork()).ldelim(); + DefaultNodeInfo.encode(message.defaultNodeInfo, writer.uint32(10).fork()).ldelim() } if (message.applicationVersion !== undefined) { - VersionInfo.encode(message.applicationVersion, writer.uint32(18).fork()).ldelim(); + VersionInfo.encode(message.applicationVersion, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): GetNodeInfoResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetNodeInfoResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseGetNodeInfoResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.defaultNodeInfo = DefaultNodeInfo.decode(reader, reader.uint32()); - break; + message.defaultNodeInfo = DefaultNodeInfo.decode(reader, reader.uint32()) + break case 2: - message.applicationVersion = VersionInfo.decode(reader, reader.uint32()); - break; + message.applicationVersion = VersionInfo.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): GetNodeInfoResponse { return { - defaultNodeInfo: isSet(object.defaultNodeInfo) ? DefaultNodeInfo.fromJSON(object.defaultNodeInfo) : undefined, + defaultNodeInfo: isSet(object.defaultNodeInfo) + ? DefaultNodeInfo.fromJSON(object.defaultNodeInfo) + : undefined, applicationVersion: isSet(object.applicationVersion) ? VersionInfo.fromJSON(object.applicationVersion) : undefined, - }; + } }, toJSON(message: GetNodeInfoResponse): unknown { - const obj: any = {}; + const obj: any = {} message.defaultNodeInfo !== undefined && - (obj.defaultNodeInfo = message.defaultNodeInfo ? DefaultNodeInfo.toJSON(message.defaultNodeInfo) : undefined); + (obj.defaultNodeInfo = message.defaultNodeInfo + ? DefaultNodeInfo.toJSON(message.defaultNodeInfo) + : undefined) message.applicationVersion !== undefined && (obj.applicationVersion = message.applicationVersion ? VersionInfo.toJSON(message.applicationVersion) - : undefined); - return obj; + : undefined) + return obj }, - fromPartial, I>>(object: I): GetNodeInfoResponse { - const message = createBaseGetNodeInfoResponse(); - message.defaultNodeInfo = (object.defaultNodeInfo !== undefined && object.defaultNodeInfo !== null) - ? DefaultNodeInfo.fromPartial(object.defaultNodeInfo) - : undefined; - message.applicationVersion = (object.applicationVersion !== undefined && object.applicationVersion !== null) - ? VersionInfo.fromPartial(object.applicationVersion) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): GetNodeInfoResponse { + const message = createBaseGetNodeInfoResponse() + message.defaultNodeInfo = + object.defaultNodeInfo !== undefined && object.defaultNodeInfo !== null + ? DefaultNodeInfo.fromPartial(object.defaultNodeInfo) + : undefined + message.applicationVersion = + object.applicationVersion !== undefined && object.applicationVersion !== null + ? VersionInfo.fromPartial(object.applicationVersion) + : undefined + return message }, -}; +} function createBaseVersionInfo(): VersionInfo { return { @@ -874,75 +1009,75 @@ function createBaseVersionInfo(): VersionInfo { goVersion: "", buildDeps: [], cosmosSdkVersion: "", - }; + } } export const VersionInfo = { encode(message: VersionInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { - writer.uint32(10).string(message.name); + writer.uint32(10).string(message.name) } if (message.appName !== "") { - writer.uint32(18).string(message.appName); + writer.uint32(18).string(message.appName) } if (message.version !== "") { - writer.uint32(26).string(message.version); + writer.uint32(26).string(message.version) } if (message.gitCommit !== "") { - writer.uint32(34).string(message.gitCommit); + writer.uint32(34).string(message.gitCommit) } if (message.buildTags !== "") { - writer.uint32(42).string(message.buildTags); + writer.uint32(42).string(message.buildTags) } if (message.goVersion !== "") { - writer.uint32(50).string(message.goVersion); + writer.uint32(50).string(message.goVersion) } for (const v of message.buildDeps) { - Module.encode(v!, writer.uint32(58).fork()).ldelim(); + Module.encode(v!, writer.uint32(58).fork()).ldelim() } if (message.cosmosSdkVersion !== "") { - writer.uint32(66).string(message.cosmosSdkVersion); + writer.uint32(66).string(message.cosmosSdkVersion) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): VersionInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseVersionInfo(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseVersionInfo() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.name = reader.string(); - break; + message.name = reader.string() + break case 2: - message.appName = reader.string(); - break; + message.appName = reader.string() + break case 3: - message.version = reader.string(); - break; + message.version = reader.string() + break case 4: - message.gitCommit = reader.string(); - break; + message.gitCommit = reader.string() + break case 5: - message.buildTags = reader.string(); - break; + message.buildTags = reader.string() + break case 6: - message.goVersion = reader.string(); - break; + message.goVersion = reader.string() + break case 7: - message.buildDeps.push(Module.decode(reader, reader.uint32())); - break; + message.buildDeps.push(Module.decode(reader, reader.uint32())) + break case 8: - message.cosmosSdkVersion = reader.string(); - break; + message.cosmosSdkVersion = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): VersionInfo { @@ -953,82 +1088,87 @@ export const VersionInfo = { gitCommit: isSet(object.gitCommit) ? String(object.gitCommit) : "", buildTags: isSet(object.buildTags) ? String(object.buildTags) : "", goVersion: isSet(object.goVersion) ? String(object.goVersion) : "", - buildDeps: Array.isArray(object?.buildDeps) ? object.buildDeps.map((e: any) => Module.fromJSON(e)) : [], - cosmosSdkVersion: isSet(object.cosmosSdkVersion) ? String(object.cosmosSdkVersion) : "", - }; + buildDeps: Array.isArray(object?.buildDeps) + ? object.buildDeps.map((e: any) => Module.fromJSON(e)) + : [], + cosmosSdkVersion: isSet(object.cosmosSdkVersion) + ? String(object.cosmosSdkVersion) + : "", + } }, toJSON(message: VersionInfo): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.appName !== undefined && (obj.appName = message.appName); - message.version !== undefined && (obj.version = message.version); - message.gitCommit !== undefined && (obj.gitCommit = message.gitCommit); - message.buildTags !== undefined && (obj.buildTags = message.buildTags); - message.goVersion !== undefined && (obj.goVersion = message.goVersion); + const obj: any = {} + message.name !== undefined && (obj.name = message.name) + message.appName !== undefined && (obj.appName = message.appName) + message.version !== undefined && (obj.version = message.version) + message.gitCommit !== undefined && (obj.gitCommit = message.gitCommit) + message.buildTags !== undefined && (obj.buildTags = message.buildTags) + message.goVersion !== undefined && (obj.goVersion = message.goVersion) if (message.buildDeps) { - obj.buildDeps = message.buildDeps.map((e) => e ? Module.toJSON(e) : undefined); + obj.buildDeps = message.buildDeps.map((e) => (e ? Module.toJSON(e) : undefined)) } else { - obj.buildDeps = []; + obj.buildDeps = [] } - message.cosmosSdkVersion !== undefined && (obj.cosmosSdkVersion = message.cosmosSdkVersion); - return obj; + message.cosmosSdkVersion !== undefined && + (obj.cosmosSdkVersion = message.cosmosSdkVersion) + return obj }, fromPartial, I>>(object: I): VersionInfo { - const message = createBaseVersionInfo(); - message.name = object.name ?? ""; - message.appName = object.appName ?? ""; - message.version = object.version ?? ""; - message.gitCommit = object.gitCommit ?? ""; - message.buildTags = object.buildTags ?? ""; - message.goVersion = object.goVersion ?? ""; - message.buildDeps = object.buildDeps?.map((e) => Module.fromPartial(e)) || []; - message.cosmosSdkVersion = object.cosmosSdkVersion ?? ""; - return message; - }, -}; + const message = createBaseVersionInfo() + message.name = object.name ?? "" + message.appName = object.appName ?? "" + message.version = object.version ?? "" + message.gitCommit = object.gitCommit ?? "" + message.buildTags = object.buildTags ?? "" + message.goVersion = object.goVersion ?? "" + message.buildDeps = object.buildDeps?.map((e) => Module.fromPartial(e)) || [] + message.cosmosSdkVersion = object.cosmosSdkVersion ?? "" + return message + }, +} function createBaseModule(): Module { - return { path: "", version: "", sum: "" }; + return { path: "", version: "", sum: "" } } export const Module = { encode(message: Module, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.path !== "") { - writer.uint32(10).string(message.path); + writer.uint32(10).string(message.path) } if (message.version !== "") { - writer.uint32(18).string(message.version); + writer.uint32(18).string(message.version) } if (message.sum !== "") { - writer.uint32(26).string(message.sum); + writer.uint32(26).string(message.sum) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Module { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseModule(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseModule() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.path = reader.string(); - break; + message.path = reader.string() + break case 2: - message.version = reader.string(); - break; + message.version = reader.string() + break case 3: - message.sum = reader.string(); - break; + message.sum = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Module { @@ -1036,111 +1176,159 @@ export const Module = { path: isSet(object.path) ? String(object.path) : "", version: isSet(object.version) ? String(object.version) : "", sum: isSet(object.sum) ? String(object.sum) : "", - }; + } }, toJSON(message: Module): unknown { - const obj: any = {}; - message.path !== undefined && (obj.path = message.path); - message.version !== undefined && (obj.version = message.version); - message.sum !== undefined && (obj.sum = message.sum); - return obj; + const obj: any = {} + message.path !== undefined && (obj.path = message.path) + message.version !== undefined && (obj.version = message.version) + message.sum !== undefined && (obj.sum = message.sum) + return obj }, fromPartial, I>>(object: I): Module { - const message = createBaseModule(); - message.path = object.path ?? ""; - message.version = object.version ?? ""; - message.sum = object.sum ?? ""; - return message; + const message = createBaseModule() + message.path = object.path ?? "" + message.version = object.version ?? "" + message.sum = object.sum ?? "" + return message }, -}; +} /** Service defines the gRPC querier service for tendermint queries. */ export interface Service { /** GetNodeInfo queries the current node info. */ - GetNodeInfo(request: GetNodeInfoRequest): Promise; + GetNodeInfo(request: GetNodeInfoRequest): Promise /** GetSyncing queries node syncing. */ - GetSyncing(request: GetSyncingRequest): Promise; + GetSyncing(request: GetSyncingRequest): Promise /** GetLatestBlock returns the latest block. */ - GetLatestBlock(request: GetLatestBlockRequest): Promise; + GetLatestBlock(request: GetLatestBlockRequest): Promise /** GetBlockByHeight queries block for given height. */ - GetBlockByHeight(request: GetBlockByHeightRequest): Promise; + GetBlockByHeight(request: GetBlockByHeightRequest): Promise /** GetLatestValidatorSet queries latest validator-set. */ - GetLatestValidatorSet(request: GetLatestValidatorSetRequest): Promise; + GetLatestValidatorSet( + request: GetLatestValidatorSetRequest, + ): Promise /** GetValidatorSetByHeight queries validator-set at a given height. */ - GetValidatorSetByHeight(request: GetValidatorSetByHeightRequest): Promise; + GetValidatorSetByHeight( + request: GetValidatorSetByHeightRequest, + ): Promise } export class ServiceClientImpl implements Service { - private readonly rpc: Rpc; + private readonly rpc: Rpc constructor(rpc: Rpc) { - this.rpc = rpc; - this.GetNodeInfo = this.GetNodeInfo.bind(this); - this.GetSyncing = this.GetSyncing.bind(this); - this.GetLatestBlock = this.GetLatestBlock.bind(this); - this.GetBlockByHeight = this.GetBlockByHeight.bind(this); - this.GetLatestValidatorSet = this.GetLatestValidatorSet.bind(this); - this.GetValidatorSetByHeight = this.GetValidatorSetByHeight.bind(this); + this.rpc = rpc + this.GetNodeInfo = this.GetNodeInfo.bind(this) + this.GetSyncing = this.GetSyncing.bind(this) + this.GetLatestBlock = this.GetLatestBlock.bind(this) + this.GetBlockByHeight = this.GetBlockByHeight.bind(this) + this.GetLatestValidatorSet = this.GetLatestValidatorSet.bind(this) + this.GetValidatorSetByHeight = this.GetValidatorSetByHeight.bind(this) } GetNodeInfo(request: GetNodeInfoRequest): Promise { - const data = GetNodeInfoRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.base.tendermint.v1beta1.Service", "GetNodeInfo", data); - return promise.then((data) => GetNodeInfoResponse.decode(new _m0.Reader(data))); + const data = GetNodeInfoRequest.encode(request).finish() + const promise = this.rpc.request( + "cosmos.base.tendermint.v1beta1.Service", + "GetNodeInfo", + data, + ) + return promise.then((data) => GetNodeInfoResponse.decode(new _m0.Reader(data))) } GetSyncing(request: GetSyncingRequest): Promise { - const data = GetSyncingRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.base.tendermint.v1beta1.Service", "GetSyncing", data); - return promise.then((data) => GetSyncingResponse.decode(new _m0.Reader(data))); + const data = GetSyncingRequest.encode(request).finish() + const promise = this.rpc.request( + "cosmos.base.tendermint.v1beta1.Service", + "GetSyncing", + data, + ) + return promise.then((data) => GetSyncingResponse.decode(new _m0.Reader(data))) } GetLatestBlock(request: GetLatestBlockRequest): Promise { - const data = GetLatestBlockRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.base.tendermint.v1beta1.Service", "GetLatestBlock", data); - return promise.then((data) => GetLatestBlockResponse.decode(new _m0.Reader(data))); + const data = GetLatestBlockRequest.encode(request).finish() + const promise = this.rpc.request( + "cosmos.base.tendermint.v1beta1.Service", + "GetLatestBlock", + data, + ) + return promise.then((data) => GetLatestBlockResponse.decode(new _m0.Reader(data))) } - GetBlockByHeight(request: GetBlockByHeightRequest): Promise { - const data = GetBlockByHeightRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.base.tendermint.v1beta1.Service", "GetBlockByHeight", data); - return promise.then((data) => GetBlockByHeightResponse.decode(new _m0.Reader(data))); + GetBlockByHeight( + request: GetBlockByHeightRequest, + ): Promise { + const data = GetBlockByHeightRequest.encode(request).finish() + const promise = this.rpc.request( + "cosmos.base.tendermint.v1beta1.Service", + "GetBlockByHeight", + data, + ) + return promise.then((data) => GetBlockByHeightResponse.decode(new _m0.Reader(data))) } - GetLatestValidatorSet(request: GetLatestValidatorSetRequest): Promise { - const data = GetLatestValidatorSetRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.base.tendermint.v1beta1.Service", "GetLatestValidatorSet", data); - return promise.then((data) => GetLatestValidatorSetResponse.decode(new _m0.Reader(data))); + GetLatestValidatorSet( + request: GetLatestValidatorSetRequest, + ): Promise { + const data = GetLatestValidatorSetRequest.encode(request).finish() + const promise = this.rpc.request( + "cosmos.base.tendermint.v1beta1.Service", + "GetLatestValidatorSet", + data, + ) + return promise.then((data) => + GetLatestValidatorSetResponse.decode(new _m0.Reader(data)), + ) } - GetValidatorSetByHeight(request: GetValidatorSetByHeightRequest): Promise { - const data = GetValidatorSetByHeightRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.base.tendermint.v1beta1.Service", "GetValidatorSetByHeight", data); - return promise.then((data) => GetValidatorSetByHeightResponse.decode(new _m0.Reader(data))); + GetValidatorSetByHeight( + request: GetValidatorSetByHeightRequest, + ): Promise { + const data = GetValidatorSetByHeightRequest.encode(request).finish() + const promise = this.rpc.request( + "cosmos.base.tendermint.v1beta1.Service", + "GetValidatorSetByHeight", + data, + ) + return promise.then((data) => + GetValidatorSetByHeightResponse.decode(new _m0.Reader(data)), + ) } } interface Rpc { - request(service: string, method: string, data: Uint8Array): Promise; + request(service: string, method: string, data: Uint8Array): Promise } -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/cosmos/base/v1beta1/coin.ts b/packages/protojs/src/cosmos/base/v1beta1/coin.ts index 8e1dfaff..f80a2cde 100644 --- a/packages/protojs/src/cosmos/base/v1beta1/coin.ts +++ b/packages/protojs/src/cosmos/base/v1beta1/coin.ts @@ -1,8 +1,8 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "cosmos.base.v1beta1"; +export const protobufPackage = "cosmos.base.v1beta1" /** * Coin defines a token with a denomination and an amount. @@ -11,8 +11,8 @@ export const protobufPackage = "cosmos.base.v1beta1"; * signatures required by gogoproto. */ export interface Coin { - denom: string; - amount: string; + denom: string + amount: string } /** @@ -22,247 +22,261 @@ export interface Coin { * signatures required by gogoproto. */ export interface DecCoin { - denom: string; - amount: string; + denom: string + amount: string } /** IntProto defines a Protobuf wrapper around an Int object. */ export interface IntProto { - int: string; + int: string } /** DecProto defines a Protobuf wrapper around a Dec object. */ export interface DecProto { - dec: string; + dec: string } function createBaseCoin(): Coin { - return { denom: "", amount: "" }; + return { denom: "", amount: "" } } export const Coin = { encode(message: Coin, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.denom !== "") { - writer.uint32(10).string(message.denom); + writer.uint32(10).string(message.denom) } if (message.amount !== "") { - writer.uint32(18).string(message.amount); + writer.uint32(18).string(message.amount) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Coin { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseCoin(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseCoin() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.denom = reader.string(); - break; + message.denom = reader.string() + break case 2: - message.amount = reader.string(); - break; + message.amount = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Coin { return { denom: isSet(object.denom) ? String(object.denom) : "", amount: isSet(object.amount) ? String(object.amount) : "", - }; + } }, toJSON(message: Coin): unknown { - const obj: any = {}; - message.denom !== undefined && (obj.denom = message.denom); - message.amount !== undefined && (obj.amount = message.amount); - return obj; + const obj: any = {} + message.denom !== undefined && (obj.denom = message.denom) + message.amount !== undefined && (obj.amount = message.amount) + return obj }, fromPartial, I>>(object: I): Coin { - const message = createBaseCoin(); - message.denom = object.denom ?? ""; - message.amount = object.amount ?? ""; - return message; + const message = createBaseCoin() + message.denom = object.denom ?? "" + message.amount = object.amount ?? "" + return message }, -}; +} function createBaseDecCoin(): DecCoin { - return { denom: "", amount: "" }; + return { denom: "", amount: "" } } export const DecCoin = { encode(message: DecCoin, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.denom !== "") { - writer.uint32(10).string(message.denom); + writer.uint32(10).string(message.denom) } if (message.amount !== "") { - writer.uint32(18).string(message.amount); + writer.uint32(18).string(message.amount) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): DecCoin { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDecCoin(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseDecCoin() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.denom = reader.string(); - break; + message.denom = reader.string() + break case 2: - message.amount = reader.string(); - break; + message.amount = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): DecCoin { return { denom: isSet(object.denom) ? String(object.denom) : "", amount: isSet(object.amount) ? String(object.amount) : "", - }; + } }, toJSON(message: DecCoin): unknown { - const obj: any = {}; - message.denom !== undefined && (obj.denom = message.denom); - message.amount !== undefined && (obj.amount = message.amount); - return obj; + const obj: any = {} + message.denom !== undefined && (obj.denom = message.denom) + message.amount !== undefined && (obj.amount = message.amount) + return obj }, fromPartial, I>>(object: I): DecCoin { - const message = createBaseDecCoin(); - message.denom = object.denom ?? ""; - message.amount = object.amount ?? ""; - return message; + const message = createBaseDecCoin() + message.denom = object.denom ?? "" + message.amount = object.amount ?? "" + return message }, -}; +} function createBaseIntProto(): IntProto { - return { int: "" }; + return { int: "" } } export const IntProto = { encode(message: IntProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.int !== "") { - writer.uint32(10).string(message.int); + writer.uint32(10).string(message.int) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): IntProto { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseIntProto(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseIntProto() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.int = reader.string(); - break; + message.int = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): IntProto { - return { int: isSet(object.int) ? String(object.int) : "" }; + return { + int: isSet(object.int) ? String(object.int) : "", + } }, toJSON(message: IntProto): unknown { - const obj: any = {}; - message.int !== undefined && (obj.int = message.int); - return obj; + const obj: any = {} + message.int !== undefined && (obj.int = message.int) + return obj }, fromPartial, I>>(object: I): IntProto { - const message = createBaseIntProto(); - message.int = object.int ?? ""; - return message; + const message = createBaseIntProto() + message.int = object.int ?? "" + return message }, -}; +} function createBaseDecProto(): DecProto { - return { dec: "" }; + return { dec: "" } } export const DecProto = { encode(message: DecProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.dec !== "") { - writer.uint32(10).string(message.dec); + writer.uint32(10).string(message.dec) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): DecProto { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDecProto(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseDecProto() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.dec = reader.string(); - break; + message.dec = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): DecProto { - return { dec: isSet(object.dec) ? String(object.dec) : "" }; + return { + dec: isSet(object.dec) ? String(object.dec) : "", + } }, toJSON(message: DecProto): unknown { - const obj: any = {}; - message.dec !== undefined && (obj.dec = message.dec); - return obj; + const obj: any = {} + message.dec !== undefined && (obj.dec = message.dec) + return obj }, fromPartial, I>>(object: I): DecProto { - const message = createBaseDecProto(); - message.dec = object.dec ?? ""; - return message; + const message = createBaseDecProto() + message.dec = object.dec ?? "" + return message }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; +} -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/cosmos/capability/v1beta1/capability.ts b/packages/protojs/src/cosmos/capability/v1beta1/capability.ts index 3e78a079..8da5503a 100644 --- a/packages/protojs/src/cosmos/capability/v1beta1/capability.ts +++ b/packages/protojs/src/cosmos/capability/v1beta1/capability.ts @@ -1,15 +1,15 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "cosmos.capability.v1beta1"; +export const protobufPackage = "cosmos.capability.v1beta1" /** * Capability defines an implementation of an object capability. The index * provided to a Capability must be globally unique. */ export interface Capability { - index: Long; + index: Long } /** @@ -17,8 +17,8 @@ export interface Capability { * capability and the module name. */ export interface Owner { - module: string; - name: string; + module: string + name: string } /** @@ -26,182 +26,207 @@ export interface Owner { * owners must be unique. */ export interface CapabilityOwners { - owners: Owner[]; + owners: Owner[] } function createBaseCapability(): Capability { - return { index: Long.UZERO }; + return { index: Long.UZERO } } export const Capability = { encode(message: Capability, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (!message.index.isZero()) { - writer.uint32(8).uint64(message.index); + writer.uint32(8).uint64(message.index) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Capability { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseCapability(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseCapability() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.index = reader.uint64() as Long; - break; + message.index = reader.uint64() as Long + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Capability { - return { index: isSet(object.index) ? Long.fromValue(object.index) : Long.UZERO }; + return { + index: isSet(object.index) ? Long.fromValue(object.index) : Long.UZERO, + } }, toJSON(message: Capability): unknown { - const obj: any = {}; - message.index !== undefined && (obj.index = (message.index || Long.UZERO).toString()); - return obj; + const obj: any = {} + message.index !== undefined && + (obj.index = (message.index || Long.UZERO).toString()) + return obj }, fromPartial, I>>(object: I): Capability { - const message = createBaseCapability(); - message.index = (object.index !== undefined && object.index !== null) ? Long.fromValue(object.index) : Long.UZERO; - return message; + const message = createBaseCapability() + message.index = + object.index !== undefined && object.index !== null + ? Long.fromValue(object.index) + : Long.UZERO + return message }, -}; +} function createBaseOwner(): Owner { - return { module: "", name: "" }; + return { module: "", name: "" } } export const Owner = { encode(message: Owner, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.module !== "") { - writer.uint32(10).string(message.module); + writer.uint32(10).string(message.module) } if (message.name !== "") { - writer.uint32(18).string(message.name); + writer.uint32(18).string(message.name) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Owner { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseOwner(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseOwner() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.module = reader.string(); - break; + message.module = reader.string() + break case 2: - message.name = reader.string(); - break; + message.name = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Owner { return { module: isSet(object.module) ? String(object.module) : "", name: isSet(object.name) ? String(object.name) : "", - }; + } }, toJSON(message: Owner): unknown { - const obj: any = {}; - message.module !== undefined && (obj.module = message.module); - message.name !== undefined && (obj.name = message.name); - return obj; + const obj: any = {} + message.module !== undefined && (obj.module = message.module) + message.name !== undefined && (obj.name = message.name) + return obj }, fromPartial, I>>(object: I): Owner { - const message = createBaseOwner(); - message.module = object.module ?? ""; - message.name = object.name ?? ""; - return message; + const message = createBaseOwner() + message.module = object.module ?? "" + message.name = object.name ?? "" + return message }, -}; +} function createBaseCapabilityOwners(): CapabilityOwners { - return { owners: [] }; + return { owners: [] } } export const CapabilityOwners = { - encode(message: CapabilityOwners, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: CapabilityOwners, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { for (const v of message.owners) { - Owner.encode(v!, writer.uint32(10).fork()).ldelim(); + Owner.encode(v!, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): CapabilityOwners { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseCapabilityOwners(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseCapabilityOwners() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.owners.push(Owner.decode(reader, reader.uint32())); - break; + message.owners.push(Owner.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): CapabilityOwners { - return { owners: Array.isArray(object?.owners) ? object.owners.map((e: any) => Owner.fromJSON(e)) : [] }; + return { + owners: Array.isArray(object?.owners) + ? object.owners.map((e: any) => Owner.fromJSON(e)) + : [], + } }, toJSON(message: CapabilityOwners): unknown { - const obj: any = {}; + const obj: any = {} if (message.owners) { - obj.owners = message.owners.map((e) => e ? Owner.toJSON(e) : undefined); + obj.owners = message.owners.map((e) => (e ? Owner.toJSON(e) : undefined)) } else { - obj.owners = []; + obj.owners = [] } - return obj; + return obj }, - fromPartial, I>>(object: I): CapabilityOwners { - const message = createBaseCapabilityOwners(); - message.owners = object.owners?.map((e) => Owner.fromPartial(e)) || []; - return message; + fromPartial, I>>( + object: I, + ): CapabilityOwners { + const message = createBaseCapabilityOwners() + message.owners = object.owners?.map((e) => Owner.fromPartial(e)) || [] + return message }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; +} -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/cosmos/capability/v1beta1/genesis.ts b/packages/protojs/src/cosmos/capability/v1beta1/genesis.ts index 50a317c2..d141fe45 100644 --- a/packages/protojs/src/cosmos/capability/v1beta1/genesis.ts +++ b/packages/protojs/src/cosmos/capability/v1beta1/genesis.ts @@ -1,169 +1,196 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { CapabilityOwners } from "./capability"; +import { CapabilityOwners } from "./capability" +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "cosmos.capability.v1beta1"; +export const protobufPackage = "cosmos.capability.v1beta1" /** GenesisOwners defines the capability owners with their corresponding index. */ export interface GenesisOwners { /** index is the index of the capability owner. */ - index: Long; + index: Long /** index_owners are the owners at the given index. */ - indexOwners?: CapabilityOwners; + indexOwners?: CapabilityOwners } /** GenesisState defines the capability module's genesis state. */ export interface GenesisState { /** index is the capability global index. */ - index: Long; + index: Long /** * owners represents a map from index to owners of the capability index * index key is string to allow amino marshalling. */ - owners: GenesisOwners[]; + owners: GenesisOwners[] } function createBaseGenesisOwners(): GenesisOwners { - return { index: Long.UZERO, indexOwners: undefined }; + return { index: Long.UZERO, indexOwners: undefined } } export const GenesisOwners = { encode(message: GenesisOwners, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (!message.index.isZero()) { - writer.uint32(8).uint64(message.index); + writer.uint32(8).uint64(message.index) } if (message.indexOwners !== undefined) { - CapabilityOwners.encode(message.indexOwners, writer.uint32(18).fork()).ldelim(); + CapabilityOwners.encode(message.indexOwners, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): GenesisOwners { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGenesisOwners(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseGenesisOwners() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.index = reader.uint64() as Long; - break; + message.index = reader.uint64() as Long + break case 2: - message.indexOwners = CapabilityOwners.decode(reader, reader.uint32()); - break; + message.indexOwners = CapabilityOwners.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): GenesisOwners { return { index: isSet(object.index) ? Long.fromValue(object.index) : Long.UZERO, - indexOwners: isSet(object.indexOwners) ? CapabilityOwners.fromJSON(object.indexOwners) : undefined, - }; + indexOwners: isSet(object.indexOwners) + ? CapabilityOwners.fromJSON(object.indexOwners) + : undefined, + } }, toJSON(message: GenesisOwners): unknown { - const obj: any = {}; - message.index !== undefined && (obj.index = (message.index || Long.UZERO).toString()); + const obj: any = {} + message.index !== undefined && + (obj.index = (message.index || Long.UZERO).toString()) message.indexOwners !== undefined && - (obj.indexOwners = message.indexOwners ? CapabilityOwners.toJSON(message.indexOwners) : undefined); - return obj; + (obj.indexOwners = message.indexOwners + ? CapabilityOwners.toJSON(message.indexOwners) + : undefined) + return obj }, - fromPartial, I>>(object: I): GenesisOwners { - const message = createBaseGenesisOwners(); - message.index = (object.index !== undefined && object.index !== null) ? Long.fromValue(object.index) : Long.UZERO; - message.indexOwners = (object.indexOwners !== undefined && object.indexOwners !== null) - ? CapabilityOwners.fromPartial(object.indexOwners) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): GenesisOwners { + const message = createBaseGenesisOwners() + message.index = + object.index !== undefined && object.index !== null + ? Long.fromValue(object.index) + : Long.UZERO + message.indexOwners = + object.indexOwners !== undefined && object.indexOwners !== null + ? CapabilityOwners.fromPartial(object.indexOwners) + : undefined + return message }, -}; +} function createBaseGenesisState(): GenesisState { - return { index: Long.UZERO, owners: [] }; + return { index: Long.UZERO, owners: [] } } export const GenesisState = { encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (!message.index.isZero()) { - writer.uint32(8).uint64(message.index); + writer.uint32(8).uint64(message.index) } for (const v of message.owners) { - GenesisOwners.encode(v!, writer.uint32(18).fork()).ldelim(); + GenesisOwners.encode(v!, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGenesisState(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseGenesisState() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.index = reader.uint64() as Long; - break; + message.index = reader.uint64() as Long + break case 2: - message.owners.push(GenesisOwners.decode(reader, reader.uint32())); - break; + message.owners.push(GenesisOwners.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): GenesisState { return { index: isSet(object.index) ? Long.fromValue(object.index) : Long.UZERO, - owners: Array.isArray(object?.owners) ? object.owners.map((e: any) => GenesisOwners.fromJSON(e)) : [], - }; + owners: Array.isArray(object?.owners) + ? object.owners.map((e: any) => GenesisOwners.fromJSON(e)) + : [], + } }, toJSON(message: GenesisState): unknown { - const obj: any = {}; - message.index !== undefined && (obj.index = (message.index || Long.UZERO).toString()); + const obj: any = {} + message.index !== undefined && + (obj.index = (message.index || Long.UZERO).toString()) if (message.owners) { - obj.owners = message.owners.map((e) => e ? GenesisOwners.toJSON(e) : undefined); + obj.owners = message.owners.map((e) => (e ? GenesisOwners.toJSON(e) : undefined)) } else { - obj.owners = []; + obj.owners = [] } - return obj; + return obj }, fromPartial, I>>(object: I): GenesisState { - const message = createBaseGenesisState(); - message.index = (object.index !== undefined && object.index !== null) ? Long.fromValue(object.index) : Long.UZERO; - message.owners = object.owners?.map((e) => GenesisOwners.fromPartial(e)) || []; - return message; + const message = createBaseGenesisState() + message.index = + object.index !== undefined && object.index !== null + ? Long.fromValue(object.index) + : Long.UZERO + message.owners = object.owners?.map((e) => GenesisOwners.fromPartial(e)) || [] + return message }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; +} -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/cosmos/crisis/v1beta1/genesis.ts b/packages/protojs/src/cosmos/crisis/v1beta1/genesis.ts index 68af0863..f231b20d 100644 --- a/packages/protojs/src/cosmos/crisis/v1beta1/genesis.ts +++ b/packages/protojs/src/cosmos/crisis/v1beta1/genesis.ts @@ -1,9 +1,9 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { Coin } from "../../base/v1beta1/coin"; +import { Coin } from "../../base/v1beta1/coin" +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "cosmos.crisis.v1beta1"; +export const protobufPackage = "cosmos.crisis.v1beta1" /** GenesisState defines the crisis module's genesis state. */ export interface GenesisState { @@ -11,76 +11,93 @@ export interface GenesisState { * constant_fee is the fee used to verify the invariant in the crisis * module. */ - constantFee?: Coin; + constantFee?: Coin } function createBaseGenesisState(): GenesisState { - return { constantFee: undefined }; + return { constantFee: undefined } } export const GenesisState = { encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.constantFee !== undefined) { - Coin.encode(message.constantFee, writer.uint32(26).fork()).ldelim(); + Coin.encode(message.constantFee, writer.uint32(26).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGenesisState(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseGenesisState() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 3: - message.constantFee = Coin.decode(reader, reader.uint32()); - break; + message.constantFee = Coin.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): GenesisState { - return { constantFee: isSet(object.constantFee) ? Coin.fromJSON(object.constantFee) : undefined }; + return { + constantFee: isSet(object.constantFee) + ? Coin.fromJSON(object.constantFee) + : undefined, + } }, toJSON(message: GenesisState): unknown { - const obj: any = {}; + const obj: any = {} message.constantFee !== undefined && - (obj.constantFee = message.constantFee ? Coin.toJSON(message.constantFee) : undefined); - return obj; + (obj.constantFee = message.constantFee + ? Coin.toJSON(message.constantFee) + : undefined) + return obj }, fromPartial, I>>(object: I): GenesisState { - const message = createBaseGenesisState(); - message.constantFee = (object.constantFee !== undefined && object.constantFee !== null) - ? Coin.fromPartial(object.constantFee) - : undefined; - return message; + const message = createBaseGenesisState() + message.constantFee = + object.constantFee !== undefined && object.constantFee !== null + ? Coin.fromPartial(object.constantFee) + : undefined + return message }, -}; +} -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/cosmos/crisis/v1beta1/tx.ts b/packages/protojs/src/cosmos/crisis/v1beta1/tx.ts index 5be722b2..1f5049df 100644 --- a/packages/protojs/src/cosmos/crisis/v1beta1/tx.ts +++ b/packages/protojs/src/cosmos/crisis/v1beta1/tx.ts @@ -1,166 +1,195 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "cosmos.crisis.v1beta1"; +export const protobufPackage = "cosmos.crisis.v1beta1" /** MsgVerifyInvariant represents a message to verify a particular invariance. */ export interface MsgVerifyInvariant { - sender: string; - invariantModuleName: string; - invariantRoute: string; + sender: string + invariantModuleName: string + invariantRoute: string } /** MsgVerifyInvariantResponse defines the Msg/VerifyInvariant response type. */ -export interface MsgVerifyInvariantResponse { -} +export interface MsgVerifyInvariantResponse {} function createBaseMsgVerifyInvariant(): MsgVerifyInvariant { - return { sender: "", invariantModuleName: "", invariantRoute: "" }; + return { sender: "", invariantModuleName: "", invariantRoute: "" } } export const MsgVerifyInvariant = { - encode(message: MsgVerifyInvariant, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: MsgVerifyInvariant, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.sender !== "") { - writer.uint32(10).string(message.sender); + writer.uint32(10).string(message.sender) } if (message.invariantModuleName !== "") { - writer.uint32(18).string(message.invariantModuleName); + writer.uint32(18).string(message.invariantModuleName) } if (message.invariantRoute !== "") { - writer.uint32(26).string(message.invariantRoute); + writer.uint32(26).string(message.invariantRoute) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MsgVerifyInvariant { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgVerifyInvariant(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgVerifyInvariant() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.sender = reader.string(); - break; + message.sender = reader.string() + break case 2: - message.invariantModuleName = reader.string(); - break; + message.invariantModuleName = reader.string() + break case 3: - message.invariantRoute = reader.string(); - break; + message.invariantRoute = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): MsgVerifyInvariant { return { sender: isSet(object.sender) ? String(object.sender) : "", - invariantModuleName: isSet(object.invariantModuleName) ? String(object.invariantModuleName) : "", + invariantModuleName: isSet(object.invariantModuleName) + ? String(object.invariantModuleName) + : "", invariantRoute: isSet(object.invariantRoute) ? String(object.invariantRoute) : "", - }; + } }, toJSON(message: MsgVerifyInvariant): unknown { - const obj: any = {}; - message.sender !== undefined && (obj.sender = message.sender); - message.invariantModuleName !== undefined && (obj.invariantModuleName = message.invariantModuleName); - message.invariantRoute !== undefined && (obj.invariantRoute = message.invariantRoute); - return obj; + const obj: any = {} + message.sender !== undefined && (obj.sender = message.sender) + message.invariantModuleName !== undefined && + (obj.invariantModuleName = message.invariantModuleName) + message.invariantRoute !== undefined && + (obj.invariantRoute = message.invariantRoute) + return obj }, - fromPartial, I>>(object: I): MsgVerifyInvariant { - const message = createBaseMsgVerifyInvariant(); - message.sender = object.sender ?? ""; - message.invariantModuleName = object.invariantModuleName ?? ""; - message.invariantRoute = object.invariantRoute ?? ""; - return message; + fromPartial, I>>( + object: I, + ): MsgVerifyInvariant { + const message = createBaseMsgVerifyInvariant() + message.sender = object.sender ?? "" + message.invariantModuleName = object.invariantModuleName ?? "" + message.invariantRoute = object.invariantRoute ?? "" + return message }, -}; +} function createBaseMsgVerifyInvariantResponse(): MsgVerifyInvariantResponse { - return {}; + return {} } export const MsgVerifyInvariantResponse = { - encode(_: MsgVerifyInvariantResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; + encode( + _: MsgVerifyInvariantResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MsgVerifyInvariantResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgVerifyInvariantResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgVerifyInvariantResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(_: any): MsgVerifyInvariantResponse { - return {}; + return {} }, toJSON(_: MsgVerifyInvariantResponse): unknown { - const obj: any = {}; - return obj; + const obj: any = {} + return obj }, - fromPartial, I>>(_: I): MsgVerifyInvariantResponse { - const message = createBaseMsgVerifyInvariantResponse(); - return message; + fromPartial, I>>( + _: I, + ): MsgVerifyInvariantResponse { + const message = createBaseMsgVerifyInvariantResponse() + return message }, -}; +} /** Msg defines the bank Msg service. */ export interface Msg { /** VerifyInvariant defines a method to verify a particular invariance. */ - VerifyInvariant(request: MsgVerifyInvariant): Promise; + VerifyInvariant(request: MsgVerifyInvariant): Promise } export class MsgClientImpl implements Msg { - private readonly rpc: Rpc; + private readonly rpc: Rpc constructor(rpc: Rpc) { - this.rpc = rpc; - this.VerifyInvariant = this.VerifyInvariant.bind(this); + this.rpc = rpc + this.VerifyInvariant = this.VerifyInvariant.bind(this) } VerifyInvariant(request: MsgVerifyInvariant): Promise { - const data = MsgVerifyInvariant.encode(request).finish(); - const promise = this.rpc.request("cosmos.crisis.v1beta1.Msg", "VerifyInvariant", data); - return promise.then((data) => MsgVerifyInvariantResponse.decode(new _m0.Reader(data))); + const data = MsgVerifyInvariant.encode(request).finish() + const promise = this.rpc.request( + "cosmos.crisis.v1beta1.Msg", + "VerifyInvariant", + data, + ) + return promise.then((data) => + MsgVerifyInvariantResponse.decode(new _m0.Reader(data)), + ) } } interface Rpc { - request(service: string, method: string, data: Uint8Array): Promise; + request(service: string, method: string, data: Uint8Array): Promise } -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/cosmos/crypto/ed25519/keys.ts b/packages/protojs/src/cosmos/crypto/ed25519/keys.ts index 0b60253a..bddc3d4e 100644 --- a/packages/protojs/src/cosmos/crypto/ed25519/keys.ts +++ b/packages/protojs/src/cosmos/crypto/ed25519/keys.ts @@ -1,8 +1,8 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "cosmos.crypto.ed25519"; +export const protobufPackage = "cosmos.crypto.ed25519" /** * PubKey is an ed25519 public key for handling Tendermint keys in SDK. @@ -12,7 +12,7 @@ export const protobufPackage = "cosmos.crypto.ed25519"; * then you must create a new proto message and follow ADR-28 for Address construction. */ export interface PubKey { - key: Uint8Array; + key: Uint8Array } /** @@ -20,166 +20,172 @@ export interface PubKey { * NOTE: ed25519 keys must not be used in SDK apps except in a tendermint validator context. */ export interface PrivKey { - key: Uint8Array; + key: Uint8Array } function createBasePubKey(): PubKey { - return { key: new Uint8Array() }; + return { key: new Uint8Array() } } export const PubKey = { encode(message: PubKey, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.key.length !== 0) { - writer.uint32(10).bytes(message.key); + writer.uint32(10).bytes(message.key) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): PubKey { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBasePubKey(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBasePubKey() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.key = reader.bytes(); - break; + message.key = reader.bytes() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): PubKey { - return { key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array() }; + return { + key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array(), + } }, toJSON(message: PubKey): unknown { - const obj: any = {}; + const obj: any = {} message.key !== undefined && - (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); - return obj; + (obj.key = base64FromBytes( + message.key !== undefined ? message.key : new Uint8Array(), + )) + return obj }, fromPartial, I>>(object: I): PubKey { - const message = createBasePubKey(); - message.key = object.key ?? new Uint8Array(); - return message; + const message = createBasePubKey() + message.key = object.key ?? new Uint8Array() + return message }, -}; +} function createBasePrivKey(): PrivKey { - return { key: new Uint8Array() }; + return { key: new Uint8Array() } } export const PrivKey = { encode(message: PrivKey, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.key.length !== 0) { - writer.uint32(10).bytes(message.key); + writer.uint32(10).bytes(message.key) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): PrivKey { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBasePrivKey(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBasePrivKey() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.key = reader.bytes(); - break; + message.key = reader.bytes() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): PrivKey { - return { key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array() }; + return { + key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array(), + } }, toJSON(message: PrivKey): unknown { - const obj: any = {}; + const obj: any = {} message.key !== undefined && - (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); - return obj; + (obj.key = base64FromBytes( + message.key !== undefined ? message.key : new Uint8Array(), + )) + return obj }, fromPartial, I>>(object: I): PrivKey { - const message = createBasePrivKey(); - message.key = object.key ?? new Uint8Array(); - return message; + const message = createBasePrivKey() + message.key = object.key ?? new Uint8Array() + return message }, -}; +} -declare var self: any | undefined; -declare var window: any | undefined; -declare var global: any | undefined; +declare var self: any | undefined +declare var window: any | undefined +declare var global: any | undefined var globalThis: any = (() => { - if (typeof globalThis !== "undefined") { - return globalThis; - } - if (typeof self !== "undefined") { - return self; - } - if (typeof window !== "undefined") { - return window; - } - if (typeof global !== "undefined") { - return global; - } - throw "Unable to locate global object"; -})(); - + if (typeof globalThis !== "undefined") return globalThis + if (typeof self !== "undefined") return self + if (typeof window !== "undefined") return window + if (typeof global !== "undefined") return global + throw "Unable to locate global object" +})() + +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")) function bytesFromBase64(b64: string): Uint8Array { - if (globalThis.Buffer) { - return Uint8Array.from(globalThis.Buffer.from(b64, "base64")); - } else { - const bin = globalThis.atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; + 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 } +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")) function base64FromBytes(arr: Uint8Array): string { - if (globalThis.Buffer) { - return globalThis.Buffer.from(arr).toString("base64"); - } else { - const bin: string[] = []; - arr.forEach((byte) => { - bin.push(String.fromCharCode(byte)); - }); - return globalThis.btoa(bin.join("")); - } + const bin: string[] = [] + arr.forEach((byte) => { + bin.push(String.fromCharCode(byte)) + }) + return btoa(bin.join("")) } -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/cosmos/crypto/multisig/keys.ts b/packages/protojs/src/cosmos/crypto/multisig/keys.ts index 5872697c..c2dbb509 100644 --- a/packages/protojs/src/cosmos/crypto/multisig/keys.ts +++ b/packages/protojs/src/cosmos/crypto/multisig/keys.ts @@ -1,9 +1,9 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { Any } from "../../../google/protobuf/any"; +import Long from "long" +import { Any } from "../../../google/protobuf/any" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "cosmos.crypto.multisig"; +export const protobufPackage = "cosmos.crypto.multisig" /** * LegacyAminoPubKey specifies a public key type @@ -11,89 +11,106 @@ export const protobufPackage = "cosmos.crypto.multisig"; * it uses legacy amino address rules. */ export interface LegacyAminoPubKey { - threshold: number; - publicKeys: Any[]; + threshold: number + publicKeys: Any[] } function createBaseLegacyAminoPubKey(): LegacyAminoPubKey { - return { threshold: 0, publicKeys: [] }; + return { threshold: 0, publicKeys: [] } } export const LegacyAminoPubKey = { - encode(message: LegacyAminoPubKey, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: LegacyAminoPubKey, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.threshold !== 0) { - writer.uint32(8).uint32(message.threshold); + writer.uint32(8).uint32(message.threshold) } for (const v of message.publicKeys) { - Any.encode(v!, writer.uint32(18).fork()).ldelim(); + Any.encode(v!, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): LegacyAminoPubKey { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseLegacyAminoPubKey(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseLegacyAminoPubKey() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.threshold = reader.uint32(); - break; + message.threshold = reader.uint32() + break case 2: - message.publicKeys.push(Any.decode(reader, reader.uint32())); - break; + message.publicKeys.push(Any.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): LegacyAminoPubKey { return { threshold: isSet(object.threshold) ? Number(object.threshold) : 0, - publicKeys: Array.isArray(object?.publicKeys) ? object.publicKeys.map((e: any) => Any.fromJSON(e)) : [], - }; + publicKeys: Array.isArray(object?.publicKeys) + ? object.publicKeys.map((e: any) => Any.fromJSON(e)) + : [], + } }, toJSON(message: LegacyAminoPubKey): unknown { - const obj: any = {}; - message.threshold !== undefined && (obj.threshold = Math.round(message.threshold)); + const obj: any = {} + message.threshold !== undefined && (obj.threshold = Math.round(message.threshold)) if (message.publicKeys) { - obj.publicKeys = message.publicKeys.map((e) => e ? Any.toJSON(e) : undefined); + obj.publicKeys = message.publicKeys.map((e) => (e ? Any.toJSON(e) : undefined)) } else { - obj.publicKeys = []; + obj.publicKeys = [] } - return obj; + return obj }, - fromPartial, I>>(object: I): LegacyAminoPubKey { - const message = createBaseLegacyAminoPubKey(); - message.threshold = object.threshold ?? 0; - message.publicKeys = object.publicKeys?.map((e) => Any.fromPartial(e)) || []; - return message; + fromPartial, I>>( + object: I, + ): LegacyAminoPubKey { + const message = createBaseLegacyAminoPubKey() + message.threshold = object.threshold ?? 0 + message.publicKeys = object.publicKeys?.map((e) => Any.fromPartial(e)) || [] + return message }, -}; +} -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/cosmos/crypto/multisig/v1beta1/multisig.ts b/packages/protojs/src/cosmos/crypto/multisig/v1beta1/multisig.ts index 82f95e72..859916bc 100644 --- a/packages/protojs/src/cosmos/crypto/multisig/v1beta1/multisig.ts +++ b/packages/protojs/src/cosmos/crypto/multisig/v1beta1/multisig.ts @@ -1,8 +1,8 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "cosmos.crypto.multisig.v1beta1"; +export const protobufPackage = "cosmos.crypto.multisig.v1beta1" /** * MultiSignature wraps the signatures from a multisig.LegacyAminoPubKey. @@ -10,7 +10,7 @@ export const protobufPackage = "cosmos.crypto.multisig.v1beta1"; * signed and with which modes. */ export interface MultiSignature { - signatures: Uint8Array[]; + signatures: Uint8Array[] } /** @@ -20,183 +20,200 @@ export interface MultiSignature { * This is not thread safe, and is not intended for concurrent usage. */ export interface CompactBitArray { - extraBitsStored: number; - elems: Uint8Array; + extraBitsStored: number + elems: Uint8Array } function createBaseMultiSignature(): MultiSignature { - return { signatures: [] }; + return { signatures: [] } } export const MultiSignature = { - encode(message: MultiSignature, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: MultiSignature, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { for (const v of message.signatures) { - writer.uint32(10).bytes(v!); + writer.uint32(10).bytes(v!) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MultiSignature { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMultiSignature(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMultiSignature() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.signatures.push(reader.bytes()); - break; + message.signatures.push(reader.bytes()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): MultiSignature { return { - signatures: Array.isArray(object?.signatures) ? object.signatures.map((e: any) => bytesFromBase64(e)) : [], - }; + signatures: Array.isArray(object?.signatures) + ? object.signatures.map((e: any) => bytesFromBase64(e)) + : [], + } }, toJSON(message: MultiSignature): unknown { - const obj: any = {}; + const obj: any = {} if (message.signatures) { - obj.signatures = message.signatures.map((e) => base64FromBytes(e !== undefined ? e : new Uint8Array())); + obj.signatures = message.signatures.map((e) => + base64FromBytes(e !== undefined ? e : new Uint8Array()), + ) } else { - obj.signatures = []; + obj.signatures = [] } - return obj; + return obj }, - fromPartial, I>>(object: I): MultiSignature { - const message = createBaseMultiSignature(); - message.signatures = object.signatures?.map((e) => e) || []; - return message; + fromPartial, I>>( + object: I, + ): MultiSignature { + const message = createBaseMultiSignature() + message.signatures = object.signatures?.map((e) => e) || [] + return message }, -}; +} function createBaseCompactBitArray(): CompactBitArray { - return { extraBitsStored: 0, elems: new Uint8Array() }; + return { extraBitsStored: 0, elems: new Uint8Array() } } export const CompactBitArray = { - encode(message: CompactBitArray, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: CompactBitArray, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.extraBitsStored !== 0) { - writer.uint32(8).uint32(message.extraBitsStored); + writer.uint32(8).uint32(message.extraBitsStored) } if (message.elems.length !== 0) { - writer.uint32(18).bytes(message.elems); + writer.uint32(18).bytes(message.elems) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): CompactBitArray { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseCompactBitArray(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseCompactBitArray() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.extraBitsStored = reader.uint32(); - break; + message.extraBitsStored = reader.uint32() + break case 2: - message.elems = reader.bytes(); - break; + message.elems = reader.bytes() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): CompactBitArray { return { - extraBitsStored: isSet(object.extraBitsStored) ? Number(object.extraBitsStored) : 0, + extraBitsStored: isSet(object.extraBitsStored) + ? Number(object.extraBitsStored) + : 0, elems: isSet(object.elems) ? bytesFromBase64(object.elems) : new Uint8Array(), - }; + } }, toJSON(message: CompactBitArray): unknown { - const obj: any = {}; - message.extraBitsStored !== undefined && (obj.extraBitsStored = Math.round(message.extraBitsStored)); + const obj: any = {} + message.extraBitsStored !== undefined && + (obj.extraBitsStored = Math.round(message.extraBitsStored)) message.elems !== undefined && - (obj.elems = base64FromBytes(message.elems !== undefined ? message.elems : new Uint8Array())); - return obj; + (obj.elems = base64FromBytes( + message.elems !== undefined ? message.elems : new Uint8Array(), + )) + return obj }, - fromPartial, I>>(object: I): CompactBitArray { - const message = createBaseCompactBitArray(); - message.extraBitsStored = object.extraBitsStored ?? 0; - message.elems = object.elems ?? new Uint8Array(); - return message; + fromPartial, I>>( + object: I, + ): CompactBitArray { + const message = createBaseCompactBitArray() + message.extraBitsStored = object.extraBitsStored ?? 0 + message.elems = object.elems ?? new Uint8Array() + return message }, -}; +} -declare var self: any | undefined; -declare var window: any | undefined; -declare var global: any | undefined; +declare var self: any | undefined +declare var window: any | undefined +declare var global: any | undefined var globalThis: any = (() => { - if (typeof globalThis !== "undefined") { - return globalThis; - } - if (typeof self !== "undefined") { - return self; - } - if (typeof window !== "undefined") { - return window; - } - if (typeof global !== "undefined") { - return global; - } - throw "Unable to locate global object"; -})(); - + if (typeof globalThis !== "undefined") return globalThis + if (typeof self !== "undefined") return self + if (typeof window !== "undefined") return window + if (typeof global !== "undefined") return global + throw "Unable to locate global object" +})() + +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")) function bytesFromBase64(b64: string): Uint8Array { - if (globalThis.Buffer) { - return Uint8Array.from(globalThis.Buffer.from(b64, "base64")); - } else { - const bin = globalThis.atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; + 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 } +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")) function base64FromBytes(arr: Uint8Array): string { - if (globalThis.Buffer) { - return globalThis.Buffer.from(arr).toString("base64"); - } else { - const bin: string[] = []; - arr.forEach((byte) => { - bin.push(String.fromCharCode(byte)); - }); - return globalThis.btoa(bin.join("")); - } + const bin: string[] = [] + arr.forEach((byte) => { + bin.push(String.fromCharCode(byte)) + }) + return btoa(bin.join("")) } -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/cosmos/crypto/secp256k1/keys.ts b/packages/protojs/src/cosmos/crypto/secp256k1/keys.ts index 381b5e47..e3531879 100644 --- a/packages/protojs/src/cosmos/crypto/secp256k1/keys.ts +++ b/packages/protojs/src/cosmos/crypto/secp256k1/keys.ts @@ -1,8 +1,8 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "cosmos.crypto.secp256k1"; +export const protobufPackage = "cosmos.crypto.secp256k1" /** * PubKey defines a secp256k1 public key @@ -12,171 +12,177 @@ export const protobufPackage = "cosmos.crypto.secp256k1"; * This prefix is followed with the x-coordinate. */ export interface PubKey { - key: Uint8Array; + key: Uint8Array } /** PrivKey defines a secp256k1 private key. */ export interface PrivKey { - key: Uint8Array; + key: Uint8Array } function createBasePubKey(): PubKey { - return { key: new Uint8Array() }; + return { key: new Uint8Array() } } export const PubKey = { encode(message: PubKey, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.key.length !== 0) { - writer.uint32(10).bytes(message.key); + writer.uint32(10).bytes(message.key) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): PubKey { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBasePubKey(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBasePubKey() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.key = reader.bytes(); - break; + message.key = reader.bytes() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): PubKey { - return { key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array() }; + return { + key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array(), + } }, toJSON(message: PubKey): unknown { - const obj: any = {}; + const obj: any = {} message.key !== undefined && - (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); - return obj; + (obj.key = base64FromBytes( + message.key !== undefined ? message.key : new Uint8Array(), + )) + return obj }, fromPartial, I>>(object: I): PubKey { - const message = createBasePubKey(); - message.key = object.key ?? new Uint8Array(); - return message; + const message = createBasePubKey() + message.key = object.key ?? new Uint8Array() + return message }, -}; +} function createBasePrivKey(): PrivKey { - return { key: new Uint8Array() }; + return { key: new Uint8Array() } } export const PrivKey = { encode(message: PrivKey, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.key.length !== 0) { - writer.uint32(10).bytes(message.key); + writer.uint32(10).bytes(message.key) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): PrivKey { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBasePrivKey(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBasePrivKey() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.key = reader.bytes(); - break; + message.key = reader.bytes() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): PrivKey { - return { key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array() }; + return { + key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array(), + } }, toJSON(message: PrivKey): unknown { - const obj: any = {}; + const obj: any = {} message.key !== undefined && - (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); - return obj; + (obj.key = base64FromBytes( + message.key !== undefined ? message.key : new Uint8Array(), + )) + return obj }, fromPartial, I>>(object: I): PrivKey { - const message = createBasePrivKey(); - message.key = object.key ?? new Uint8Array(); - return message; + const message = createBasePrivKey() + message.key = object.key ?? new Uint8Array() + return message }, -}; +} -declare var self: any | undefined; -declare var window: any | undefined; -declare var global: any | undefined; +declare var self: any | undefined +declare var window: any | undefined +declare var global: any | undefined var globalThis: any = (() => { - if (typeof globalThis !== "undefined") { - return globalThis; - } - if (typeof self !== "undefined") { - return self; - } - if (typeof window !== "undefined") { - return window; - } - if (typeof global !== "undefined") { - return global; - } - throw "Unable to locate global object"; -})(); - + if (typeof globalThis !== "undefined") return globalThis + if (typeof self !== "undefined") return self + if (typeof window !== "undefined") return window + if (typeof global !== "undefined") return global + throw "Unable to locate global object" +})() + +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")) function bytesFromBase64(b64: string): Uint8Array { - if (globalThis.Buffer) { - return Uint8Array.from(globalThis.Buffer.from(b64, "base64")); - } else { - const bin = globalThis.atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; + 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 } +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")) function base64FromBytes(arr: Uint8Array): string { - if (globalThis.Buffer) { - return globalThis.Buffer.from(arr).toString("base64"); - } else { - const bin: string[] = []; - arr.forEach((byte) => { - bin.push(String.fromCharCode(byte)); - }); - return globalThis.btoa(bin.join("")); - } + const bin: string[] = [] + arr.forEach((byte) => { + bin.push(String.fromCharCode(byte)) + }) + return btoa(bin.join("")) } -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/cosmos/crypto/secp256r1/keys.ts b/packages/protojs/src/cosmos/crypto/secp256r1/keys.ts index 52f55353..5638d3aa 100644 --- a/packages/protojs/src/cosmos/crypto/secp256r1/keys.ts +++ b/packages/protojs/src/cosmos/crypto/secp256r1/keys.ts @@ -1,8 +1,8 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "cosmos.crypto.secp256r1"; +export const protobufPackage = "cosmos.crypto.secp256r1" /** Since: cosmos-sdk 0.43 */ @@ -12,172 +12,178 @@ export interface PubKey { * Point on secp256r1 curve in a compressed representation as specified in section * 4.3.6 of ANSI X9.62: https://webstore.ansi.org/standards/ascx9/ansix9621998 */ - key: Uint8Array; + key: Uint8Array } /** PrivKey defines a secp256r1 ECDSA private key. */ export interface PrivKey { /** secret number serialized using big-endian encoding */ - secret: Uint8Array; + secret: Uint8Array } function createBasePubKey(): PubKey { - return { key: new Uint8Array() }; + return { key: new Uint8Array() } } export const PubKey = { encode(message: PubKey, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.key.length !== 0) { - writer.uint32(10).bytes(message.key); + writer.uint32(10).bytes(message.key) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): PubKey { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBasePubKey(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBasePubKey() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.key = reader.bytes(); - break; + message.key = reader.bytes() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): PubKey { - return { key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array() }; + return { + key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array(), + } }, toJSON(message: PubKey): unknown { - const obj: any = {}; + const obj: any = {} message.key !== undefined && - (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); - return obj; + (obj.key = base64FromBytes( + message.key !== undefined ? message.key : new Uint8Array(), + )) + return obj }, fromPartial, I>>(object: I): PubKey { - const message = createBasePubKey(); - message.key = object.key ?? new Uint8Array(); - return message; + const message = createBasePubKey() + message.key = object.key ?? new Uint8Array() + return message }, -}; +} function createBasePrivKey(): PrivKey { - return { secret: new Uint8Array() }; + return { secret: new Uint8Array() } } export const PrivKey = { encode(message: PrivKey, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.secret.length !== 0) { - writer.uint32(10).bytes(message.secret); + writer.uint32(10).bytes(message.secret) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): PrivKey { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBasePrivKey(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBasePrivKey() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.secret = reader.bytes(); - break; + message.secret = reader.bytes() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): PrivKey { - return { secret: isSet(object.secret) ? bytesFromBase64(object.secret) : new Uint8Array() }; + return { + secret: isSet(object.secret) ? bytesFromBase64(object.secret) : new Uint8Array(), + } }, toJSON(message: PrivKey): unknown { - const obj: any = {}; + const obj: any = {} message.secret !== undefined && - (obj.secret = base64FromBytes(message.secret !== undefined ? message.secret : new Uint8Array())); - return obj; + (obj.secret = base64FromBytes( + message.secret !== undefined ? message.secret : new Uint8Array(), + )) + return obj }, fromPartial, I>>(object: I): PrivKey { - const message = createBasePrivKey(); - message.secret = object.secret ?? new Uint8Array(); - return message; + const message = createBasePrivKey() + message.secret = object.secret ?? new Uint8Array() + return message }, -}; +} -declare var self: any | undefined; -declare var window: any | undefined; -declare var global: any | undefined; +declare var self: any | undefined +declare var window: any | undefined +declare var global: any | undefined var globalThis: any = (() => { - if (typeof globalThis !== "undefined") { - return globalThis; - } - if (typeof self !== "undefined") { - return self; - } - if (typeof window !== "undefined") { - return window; - } - if (typeof global !== "undefined") { - return global; - } - throw "Unable to locate global object"; -})(); - + if (typeof globalThis !== "undefined") return globalThis + if (typeof self !== "undefined") return self + if (typeof window !== "undefined") return window + if (typeof global !== "undefined") return global + throw "Unable to locate global object" +})() + +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")) function bytesFromBase64(b64: string): Uint8Array { - if (globalThis.Buffer) { - return Uint8Array.from(globalThis.Buffer.from(b64, "base64")); - } else { - const bin = globalThis.atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; + 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 } +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")) function base64FromBytes(arr: Uint8Array): string { - if (globalThis.Buffer) { - return globalThis.Buffer.from(arr).toString("base64"); - } else { - const bin: string[] = []; - arr.forEach((byte) => { - bin.push(String.fromCharCode(byte)); - }); - return globalThis.btoa(bin.join("")); - } + const bin: string[] = [] + arr.forEach((byte) => { + bin.push(String.fromCharCode(byte)) + }) + return btoa(bin.join("")) } -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/cosmos/distribution/v1beta1/distribution.ts b/packages/protojs/src/cosmos/distribution/v1beta1/distribution.ts index 6074c2c5..bccf6d2c 100644 --- a/packages/protojs/src/cosmos/distribution/v1beta1/distribution.ts +++ b/packages/protojs/src/cosmos/distribution/v1beta1/distribution.ts @@ -1,16 +1,16 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { Coin, DecCoin } from "../../base/v1beta1/coin"; +import Long from "long" +import { DecCoin, Coin } from "../../base/v1beta1/coin" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "cosmos.distribution.v1beta1"; +export const protobufPackage = "cosmos.distribution.v1beta1" /** Params defines the set of params for the distribution module. */ export interface Params { - communityTax: string; - baseProposerReward: string; - bonusProposerReward: string; - withdrawAddrEnabled: boolean; + communityTax: string + baseProposerReward: string + bonusProposerReward: string + withdrawAddrEnabled: boolean } /** @@ -28,8 +28,8 @@ export interface Params { * + one per validator for the zeroeth period, set on initialization */ export interface ValidatorHistoricalRewards { - cumulativeRewardRatio: DecCoin[]; - referenceCount: number; + cumulativeRewardRatio: DecCoin[] + referenceCount: number } /** @@ -38,8 +38,8 @@ export interface ValidatorHistoricalRewards { * each block as long as the validator's tokens remain constant. */ export interface ValidatorCurrentRewards { - rewards: DecCoin[]; - period: Long; + rewards: DecCoin[] + period: Long } /** @@ -47,7 +47,7 @@ export interface ValidatorCurrentRewards { * for a validator kept as a running counter, can be withdrawn at any time. */ export interface ValidatorAccumulatedCommission { - commission: DecCoin[]; + commission: DecCoin[] } /** @@ -55,7 +55,7 @@ export interface ValidatorAccumulatedCommission { * for a validator inexpensive to track, allows simple sanity checks. */ export interface ValidatorOutstandingRewards { - rewards: DecCoin[]; + rewards: DecCoin[] } /** @@ -65,18 +65,18 @@ export interface ValidatorOutstandingRewards { * for delegations which are withdrawn after a slash has occurred. */ export interface ValidatorSlashEvent { - validatorPeriod: Long; - fraction: string; + validatorPeriod: Long + fraction: string } /** ValidatorSlashEvents is a collection of ValidatorSlashEvent messages. */ export interface ValidatorSlashEvents { - validatorSlashEvents: ValidatorSlashEvent[]; + validatorSlashEvents: ValidatorSlashEvent[] } /** FeePool is the global fee pool for distribution. */ export interface FeePool { - communityPool: DecCoin[]; + communityPool: DecCoin[] } /** @@ -85,10 +85,10 @@ export interface FeePool { * recipient account. */ export interface CommunityPoolSpendProposal { - title: string; - description: string; - recipient: string; - amount: Coin[]; + title: string + description: string + recipient: string + amount: Coin[] } /** @@ -100,9 +100,9 @@ export interface CommunityPoolSpendProposal { * thus sdk.Dec is used. */ export interface DelegatorStartingInfo { - previousPeriod: Long; - stake: string; - height: Long; + previousPeriod: Long + stake: string + height: Long } /** @@ -110,8 +110,8 @@ export interface DelegatorStartingInfo { * of a delegator's delegation reward. */ export interface DelegationDelegatorReward { - validatorAddress: string; - reward: DecCoin[]; + validatorAddress: string + reward: DecCoin[] } /** @@ -119,123 +119,140 @@ export interface DelegationDelegatorReward { * with a deposit */ export interface CommunityPoolSpendProposalWithDeposit { - title: string; - description: string; - recipient: string; - amount: string; - deposit: string; + title: string + description: string + recipient: string + amount: string + deposit: string } function createBaseParams(): Params { - return { communityTax: "", baseProposerReward: "", bonusProposerReward: "", withdrawAddrEnabled: false }; + return { + communityTax: "", + baseProposerReward: "", + bonusProposerReward: "", + withdrawAddrEnabled: false, + } } export const Params = { encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.communityTax !== "") { - writer.uint32(10).string(message.communityTax); + writer.uint32(10).string(message.communityTax) } if (message.baseProposerReward !== "") { - writer.uint32(18).string(message.baseProposerReward); + writer.uint32(18).string(message.baseProposerReward) } if (message.bonusProposerReward !== "") { - writer.uint32(26).string(message.bonusProposerReward); + writer.uint32(26).string(message.bonusProposerReward) } if (message.withdrawAddrEnabled === true) { - writer.uint32(32).bool(message.withdrawAddrEnabled); + writer.uint32(32).bool(message.withdrawAddrEnabled) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Params { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseParams(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseParams() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.communityTax = reader.string(); - break; + message.communityTax = reader.string() + break case 2: - message.baseProposerReward = reader.string(); - break; + message.baseProposerReward = reader.string() + break case 3: - message.bonusProposerReward = reader.string(); - break; + message.bonusProposerReward = reader.string() + break case 4: - message.withdrawAddrEnabled = reader.bool(); - break; + message.withdrawAddrEnabled = reader.bool() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Params { return { communityTax: isSet(object.communityTax) ? String(object.communityTax) : "", - baseProposerReward: isSet(object.baseProposerReward) ? String(object.baseProposerReward) : "", - bonusProposerReward: isSet(object.bonusProposerReward) ? String(object.bonusProposerReward) : "", - withdrawAddrEnabled: isSet(object.withdrawAddrEnabled) ? Boolean(object.withdrawAddrEnabled) : false, - }; + baseProposerReward: isSet(object.baseProposerReward) + ? String(object.baseProposerReward) + : "", + bonusProposerReward: isSet(object.bonusProposerReward) + ? String(object.bonusProposerReward) + : "", + withdrawAddrEnabled: isSet(object.withdrawAddrEnabled) + ? Boolean(object.withdrawAddrEnabled) + : false, + } }, toJSON(message: Params): unknown { - const obj: any = {}; - message.communityTax !== undefined && (obj.communityTax = message.communityTax); - message.baseProposerReward !== undefined && (obj.baseProposerReward = message.baseProposerReward); - message.bonusProposerReward !== undefined && (obj.bonusProposerReward = message.bonusProposerReward); - message.withdrawAddrEnabled !== undefined && (obj.withdrawAddrEnabled = message.withdrawAddrEnabled); - return obj; + const obj: any = {} + message.communityTax !== undefined && (obj.communityTax = message.communityTax) + message.baseProposerReward !== undefined && + (obj.baseProposerReward = message.baseProposerReward) + message.bonusProposerReward !== undefined && + (obj.bonusProposerReward = message.bonusProposerReward) + message.withdrawAddrEnabled !== undefined && + (obj.withdrawAddrEnabled = message.withdrawAddrEnabled) + return obj }, fromPartial, I>>(object: I): Params { - const message = createBaseParams(); - message.communityTax = object.communityTax ?? ""; - message.baseProposerReward = object.baseProposerReward ?? ""; - message.bonusProposerReward = object.bonusProposerReward ?? ""; - message.withdrawAddrEnabled = object.withdrawAddrEnabled ?? false; - return message; + const message = createBaseParams() + message.communityTax = object.communityTax ?? "" + message.baseProposerReward = object.baseProposerReward ?? "" + message.bonusProposerReward = object.bonusProposerReward ?? "" + message.withdrawAddrEnabled = object.withdrawAddrEnabled ?? false + return message }, -}; +} function createBaseValidatorHistoricalRewards(): ValidatorHistoricalRewards { - return { cumulativeRewardRatio: [], referenceCount: 0 }; + return { cumulativeRewardRatio: [], referenceCount: 0 } } export const ValidatorHistoricalRewards = { - encode(message: ValidatorHistoricalRewards, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: ValidatorHistoricalRewards, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { for (const v of message.cumulativeRewardRatio) { - DecCoin.encode(v!, writer.uint32(10).fork()).ldelim(); + DecCoin.encode(v!, writer.uint32(10).fork()).ldelim() } if (message.referenceCount !== 0) { - writer.uint32(16).uint32(message.referenceCount); + writer.uint32(16).uint32(message.referenceCount) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorHistoricalRewards { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseValidatorHistoricalRewards(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseValidatorHistoricalRewards() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.cumulativeRewardRatio.push(DecCoin.decode(reader, reader.uint32())); - break; + message.cumulativeRewardRatio.push(DecCoin.decode(reader, reader.uint32())) + break case 2: - message.referenceCount = reader.uint32(); - break; + message.referenceCount = reader.uint32() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): ValidatorHistoricalRewards { @@ -244,286 +261,334 @@ export const ValidatorHistoricalRewards = { ? object.cumulativeRewardRatio.map((e: any) => DecCoin.fromJSON(e)) : [], referenceCount: isSet(object.referenceCount) ? Number(object.referenceCount) : 0, - }; + } }, toJSON(message: ValidatorHistoricalRewards): unknown { - const obj: any = {}; + const obj: any = {} if (message.cumulativeRewardRatio) { - obj.cumulativeRewardRatio = message.cumulativeRewardRatio.map((e) => e ? DecCoin.toJSON(e) : undefined); + obj.cumulativeRewardRatio = message.cumulativeRewardRatio.map((e) => + e ? DecCoin.toJSON(e) : undefined, + ) } else { - obj.cumulativeRewardRatio = []; + obj.cumulativeRewardRatio = [] } - message.referenceCount !== undefined && (obj.referenceCount = Math.round(message.referenceCount)); - return obj; + message.referenceCount !== undefined && + (obj.referenceCount = Math.round(message.referenceCount)) + return obj }, - fromPartial, I>>(object: I): ValidatorHistoricalRewards { - const message = createBaseValidatorHistoricalRewards(); - message.cumulativeRewardRatio = object.cumulativeRewardRatio?.map((e) => DecCoin.fromPartial(e)) || []; - message.referenceCount = object.referenceCount ?? 0; - return message; + fromPartial, I>>( + object: I, + ): ValidatorHistoricalRewards { + const message = createBaseValidatorHistoricalRewards() + message.cumulativeRewardRatio = + object.cumulativeRewardRatio?.map((e) => DecCoin.fromPartial(e)) || [] + message.referenceCount = object.referenceCount ?? 0 + return message }, -}; +} function createBaseValidatorCurrentRewards(): ValidatorCurrentRewards { - return { rewards: [], period: Long.UZERO }; + return { rewards: [], period: Long.UZERO } } export const ValidatorCurrentRewards = { - encode(message: ValidatorCurrentRewards, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: ValidatorCurrentRewards, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { for (const v of message.rewards) { - DecCoin.encode(v!, writer.uint32(10).fork()).ldelim(); + DecCoin.encode(v!, writer.uint32(10).fork()).ldelim() } if (!message.period.isZero()) { - writer.uint32(16).uint64(message.period); + writer.uint32(16).uint64(message.period) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorCurrentRewards { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseValidatorCurrentRewards(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseValidatorCurrentRewards() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.rewards.push(DecCoin.decode(reader, reader.uint32())); - break; + message.rewards.push(DecCoin.decode(reader, reader.uint32())) + break case 2: - message.period = reader.uint64() as Long; - break; + message.period = reader.uint64() as Long + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): ValidatorCurrentRewards { return { - rewards: Array.isArray(object?.rewards) ? object.rewards.map((e: any) => DecCoin.fromJSON(e)) : [], + rewards: Array.isArray(object?.rewards) + ? object.rewards.map((e: any) => DecCoin.fromJSON(e)) + : [], period: isSet(object.period) ? Long.fromValue(object.period) : Long.UZERO, - }; + } }, toJSON(message: ValidatorCurrentRewards): unknown { - const obj: any = {}; + const obj: any = {} if (message.rewards) { - obj.rewards = message.rewards.map((e) => e ? DecCoin.toJSON(e) : undefined); + obj.rewards = message.rewards.map((e) => (e ? DecCoin.toJSON(e) : undefined)) } else { - obj.rewards = []; + obj.rewards = [] } - message.period !== undefined && (obj.period = (message.period || Long.UZERO).toString()); - return obj; + message.period !== undefined && + (obj.period = (message.period || Long.UZERO).toString()) + return obj }, - fromPartial, I>>(object: I): ValidatorCurrentRewards { - const message = createBaseValidatorCurrentRewards(); - message.rewards = object.rewards?.map((e) => DecCoin.fromPartial(e)) || []; - message.period = (object.period !== undefined && object.period !== null) - ? Long.fromValue(object.period) - : Long.UZERO; - return message; + fromPartial, I>>( + object: I, + ): ValidatorCurrentRewards { + const message = createBaseValidatorCurrentRewards() + message.rewards = object.rewards?.map((e) => DecCoin.fromPartial(e)) || [] + message.period = + object.period !== undefined && object.period !== null + ? Long.fromValue(object.period) + : Long.UZERO + return message }, -}; +} function createBaseValidatorAccumulatedCommission(): ValidatorAccumulatedCommission { - return { commission: [] }; + return { commission: [] } } export const ValidatorAccumulatedCommission = { - encode(message: ValidatorAccumulatedCommission, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: ValidatorAccumulatedCommission, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { for (const v of message.commission) { - DecCoin.encode(v!, writer.uint32(10).fork()).ldelim(); + DecCoin.encode(v!, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorAccumulatedCommission { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseValidatorAccumulatedCommission(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): ValidatorAccumulatedCommission { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseValidatorAccumulatedCommission() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.commission.push(DecCoin.decode(reader, reader.uint32())); - break; + message.commission.push(DecCoin.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): ValidatorAccumulatedCommission { return { - commission: Array.isArray(object?.commission) ? object.commission.map((e: any) => DecCoin.fromJSON(e)) : [], - }; + commission: Array.isArray(object?.commission) + ? object.commission.map((e: any) => DecCoin.fromJSON(e)) + : [], + } }, toJSON(message: ValidatorAccumulatedCommission): unknown { - const obj: any = {}; + const obj: any = {} if (message.commission) { - obj.commission = message.commission.map((e) => e ? DecCoin.toJSON(e) : undefined); + obj.commission = message.commission.map((e) => + e ? DecCoin.toJSON(e) : undefined, + ) } else { - obj.commission = []; + obj.commission = [] } - return obj; + return obj }, fromPartial, I>>( object: I, ): ValidatorAccumulatedCommission { - const message = createBaseValidatorAccumulatedCommission(); - message.commission = object.commission?.map((e) => DecCoin.fromPartial(e)) || []; - return message; + const message = createBaseValidatorAccumulatedCommission() + message.commission = object.commission?.map((e) => DecCoin.fromPartial(e)) || [] + return message }, -}; +} function createBaseValidatorOutstandingRewards(): ValidatorOutstandingRewards { - return { rewards: [] }; + return { rewards: [] } } export const ValidatorOutstandingRewards = { - encode(message: ValidatorOutstandingRewards, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: ValidatorOutstandingRewards, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { for (const v of message.rewards) { - DecCoin.encode(v!, writer.uint32(10).fork()).ldelim(); + DecCoin.encode(v!, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorOutstandingRewards { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseValidatorOutstandingRewards(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseValidatorOutstandingRewards() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.rewards.push(DecCoin.decode(reader, reader.uint32())); - break; + message.rewards.push(DecCoin.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): ValidatorOutstandingRewards { - return { rewards: Array.isArray(object?.rewards) ? object.rewards.map((e: any) => DecCoin.fromJSON(e)) : [] }; + return { + rewards: Array.isArray(object?.rewards) + ? object.rewards.map((e: any) => DecCoin.fromJSON(e)) + : [], + } }, toJSON(message: ValidatorOutstandingRewards): unknown { - const obj: any = {}; + const obj: any = {} if (message.rewards) { - obj.rewards = message.rewards.map((e) => e ? DecCoin.toJSON(e) : undefined); + obj.rewards = message.rewards.map((e) => (e ? DecCoin.toJSON(e) : undefined)) } else { - obj.rewards = []; + obj.rewards = [] } - return obj; + return obj }, - fromPartial, I>>(object: I): ValidatorOutstandingRewards { - const message = createBaseValidatorOutstandingRewards(); - message.rewards = object.rewards?.map((e) => DecCoin.fromPartial(e)) || []; - return message; + fromPartial, I>>( + object: I, + ): ValidatorOutstandingRewards { + const message = createBaseValidatorOutstandingRewards() + message.rewards = object.rewards?.map((e) => DecCoin.fromPartial(e)) || [] + return message }, -}; +} function createBaseValidatorSlashEvent(): ValidatorSlashEvent { - return { validatorPeriod: Long.UZERO, fraction: "" }; + return { validatorPeriod: Long.UZERO, fraction: "" } } export const ValidatorSlashEvent = { - encode(message: ValidatorSlashEvent, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: ValidatorSlashEvent, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (!message.validatorPeriod.isZero()) { - writer.uint32(8).uint64(message.validatorPeriod); + writer.uint32(8).uint64(message.validatorPeriod) } if (message.fraction !== "") { - writer.uint32(18).string(message.fraction); + writer.uint32(18).string(message.fraction) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorSlashEvent { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseValidatorSlashEvent(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseValidatorSlashEvent() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.validatorPeriod = reader.uint64() as Long; - break; + message.validatorPeriod = reader.uint64() as Long + break case 2: - message.fraction = reader.string(); - break; + message.fraction = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): ValidatorSlashEvent { return { - validatorPeriod: isSet(object.validatorPeriod) ? Long.fromValue(object.validatorPeriod) : Long.UZERO, + validatorPeriod: isSet(object.validatorPeriod) + ? Long.fromValue(object.validatorPeriod) + : Long.UZERO, fraction: isSet(object.fraction) ? String(object.fraction) : "", - }; + } }, toJSON(message: ValidatorSlashEvent): unknown { - const obj: any = {}; - message.validatorPeriod !== undefined && (obj.validatorPeriod = (message.validatorPeriod || Long.UZERO).toString()); - message.fraction !== undefined && (obj.fraction = message.fraction); - return obj; + const obj: any = {} + message.validatorPeriod !== undefined && + (obj.validatorPeriod = (message.validatorPeriod || Long.UZERO).toString()) + message.fraction !== undefined && (obj.fraction = message.fraction) + return obj }, - fromPartial, I>>(object: I): ValidatorSlashEvent { - const message = createBaseValidatorSlashEvent(); - message.validatorPeriod = (object.validatorPeriod !== undefined && object.validatorPeriod !== null) - ? Long.fromValue(object.validatorPeriod) - : Long.UZERO; - message.fraction = object.fraction ?? ""; - return message; + fromPartial, I>>( + object: I, + ): ValidatorSlashEvent { + const message = createBaseValidatorSlashEvent() + message.validatorPeriod = + object.validatorPeriod !== undefined && object.validatorPeriod !== null + ? Long.fromValue(object.validatorPeriod) + : Long.UZERO + message.fraction = object.fraction ?? "" + return message }, -}; +} function createBaseValidatorSlashEvents(): ValidatorSlashEvents { - return { validatorSlashEvents: [] }; + return { validatorSlashEvents: [] } } export const ValidatorSlashEvents = { - encode(message: ValidatorSlashEvents, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: ValidatorSlashEvents, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { for (const v of message.validatorSlashEvents) { - ValidatorSlashEvent.encode(v!, writer.uint32(10).fork()).ldelim(); + ValidatorSlashEvent.encode(v!, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorSlashEvents { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseValidatorSlashEvents(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseValidatorSlashEvents() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.validatorSlashEvents.push(ValidatorSlashEvent.decode(reader, reader.uint32())); - break; + message.validatorSlashEvents.push( + ValidatorSlashEvent.decode(reader, reader.uint32()), + ) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): ValidatorSlashEvents { @@ -531,54 +596,59 @@ export const ValidatorSlashEvents = { validatorSlashEvents: Array.isArray(object?.validatorSlashEvents) ? object.validatorSlashEvents.map((e: any) => ValidatorSlashEvent.fromJSON(e)) : [], - }; + } }, toJSON(message: ValidatorSlashEvents): unknown { - const obj: any = {}; + const obj: any = {} if (message.validatorSlashEvents) { - obj.validatorSlashEvents = message.validatorSlashEvents.map((e) => e ? ValidatorSlashEvent.toJSON(e) : undefined); + obj.validatorSlashEvents = message.validatorSlashEvents.map((e) => + e ? ValidatorSlashEvent.toJSON(e) : undefined, + ) } else { - obj.validatorSlashEvents = []; + obj.validatorSlashEvents = [] } - return obj; + return obj }, - fromPartial, I>>(object: I): ValidatorSlashEvents { - const message = createBaseValidatorSlashEvents(); - message.validatorSlashEvents = object.validatorSlashEvents?.map((e) => ValidatorSlashEvent.fromPartial(e)) || []; - return message; + fromPartial, I>>( + object: I, + ): ValidatorSlashEvents { + const message = createBaseValidatorSlashEvents() + message.validatorSlashEvents = + object.validatorSlashEvents?.map((e) => ValidatorSlashEvent.fromPartial(e)) || [] + return message }, -}; +} function createBaseFeePool(): FeePool { - return { communityPool: [] }; + return { communityPool: [] } } export const FeePool = { encode(message: FeePool, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.communityPool) { - DecCoin.encode(v!, writer.uint32(10).fork()).ldelim(); + DecCoin.encode(v!, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): FeePool { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseFeePool(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseFeePool() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.communityPool.push(DecCoin.decode(reader, reader.uint32())); - break; + message.communityPool.push(DecCoin.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): FeePool { @@ -586,72 +656,78 @@ export const FeePool = { communityPool: Array.isArray(object?.communityPool) ? object.communityPool.map((e: any) => DecCoin.fromJSON(e)) : [], - }; + } }, toJSON(message: FeePool): unknown { - const obj: any = {}; + const obj: any = {} if (message.communityPool) { - obj.communityPool = message.communityPool.map((e) => e ? DecCoin.toJSON(e) : undefined); + obj.communityPool = message.communityPool.map((e) => + e ? DecCoin.toJSON(e) : undefined, + ) } else { - obj.communityPool = []; + obj.communityPool = [] } - return obj; + return obj }, fromPartial, I>>(object: I): FeePool { - const message = createBaseFeePool(); - message.communityPool = object.communityPool?.map((e) => DecCoin.fromPartial(e)) || []; - return message; + const message = createBaseFeePool() + message.communityPool = + object.communityPool?.map((e) => DecCoin.fromPartial(e)) || [] + return message }, -}; +} function createBaseCommunityPoolSpendProposal(): CommunityPoolSpendProposal { - return { title: "", description: "", recipient: "", amount: [] }; + return { title: "", description: "", recipient: "", amount: [] } } export const CommunityPoolSpendProposal = { - encode(message: CommunityPoolSpendProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: CommunityPoolSpendProposal, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.title !== "") { - writer.uint32(10).string(message.title); + writer.uint32(10).string(message.title) } if (message.description !== "") { - writer.uint32(18).string(message.description); + writer.uint32(18).string(message.description) } if (message.recipient !== "") { - writer.uint32(26).string(message.recipient); + writer.uint32(26).string(message.recipient) } for (const v of message.amount) { - Coin.encode(v!, writer.uint32(34).fork()).ldelim(); + Coin.encode(v!, writer.uint32(34).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): CommunityPoolSpendProposal { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseCommunityPoolSpendProposal(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseCommunityPoolSpendProposal() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.title = reader.string(); - break; + message.title = reader.string() + break case 2: - message.description = reader.string(); - break; + message.description = reader.string() + break case 3: - message.recipient = reader.string(); - break; + message.recipient = reader.string() + break case 4: - message.amount.push(Coin.decode(reader, reader.uint32())); - break; + message.amount.push(Coin.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): CommunityPoolSpendProposal { @@ -659,218 +735,249 @@ export const CommunityPoolSpendProposal = { title: isSet(object.title) ? String(object.title) : "", description: isSet(object.description) ? String(object.description) : "", recipient: isSet(object.recipient) ? String(object.recipient) : "", - amount: Array.isArray(object?.amount) ? object.amount.map((e: any) => Coin.fromJSON(e)) : [], - }; + amount: Array.isArray(object?.amount) + ? object.amount.map((e: any) => Coin.fromJSON(e)) + : [], + } }, toJSON(message: CommunityPoolSpendProposal): unknown { - const obj: any = {}; - message.title !== undefined && (obj.title = message.title); - message.description !== undefined && (obj.description = message.description); - message.recipient !== undefined && (obj.recipient = message.recipient); + const obj: any = {} + message.title !== undefined && (obj.title = message.title) + message.description !== undefined && (obj.description = message.description) + message.recipient !== undefined && (obj.recipient = message.recipient) if (message.amount) { - obj.amount = message.amount.map((e) => e ? Coin.toJSON(e) : undefined); + obj.amount = message.amount.map((e) => (e ? Coin.toJSON(e) : undefined)) } else { - obj.amount = []; + obj.amount = [] } - return obj; + return obj }, - fromPartial, I>>(object: I): CommunityPoolSpendProposal { - const message = createBaseCommunityPoolSpendProposal(); - message.title = object.title ?? ""; - message.description = object.description ?? ""; - message.recipient = object.recipient ?? ""; - message.amount = object.amount?.map((e) => Coin.fromPartial(e)) || []; - return message; + fromPartial, I>>( + object: I, + ): CommunityPoolSpendProposal { + const message = createBaseCommunityPoolSpendProposal() + message.title = object.title ?? "" + message.description = object.description ?? "" + message.recipient = object.recipient ?? "" + message.amount = object.amount?.map((e) => Coin.fromPartial(e)) || [] + return message }, -}; +} function createBaseDelegatorStartingInfo(): DelegatorStartingInfo { - return { previousPeriod: Long.UZERO, stake: "", height: Long.UZERO }; + return { previousPeriod: Long.UZERO, stake: "", height: Long.UZERO } } export const DelegatorStartingInfo = { - encode(message: DelegatorStartingInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: DelegatorStartingInfo, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (!message.previousPeriod.isZero()) { - writer.uint32(8).uint64(message.previousPeriod); + writer.uint32(8).uint64(message.previousPeriod) } if (message.stake !== "") { - writer.uint32(18).string(message.stake); + writer.uint32(18).string(message.stake) } if (!message.height.isZero()) { - writer.uint32(24).uint64(message.height); + writer.uint32(24).uint64(message.height) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): DelegatorStartingInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDelegatorStartingInfo(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseDelegatorStartingInfo() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.previousPeriod = reader.uint64() as Long; - break; + message.previousPeriod = reader.uint64() as Long + break case 2: - message.stake = reader.string(); - break; + message.stake = reader.string() + break case 3: - message.height = reader.uint64() as Long; - break; + message.height = reader.uint64() as Long + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): DelegatorStartingInfo { return { - previousPeriod: isSet(object.previousPeriod) ? Long.fromValue(object.previousPeriod) : Long.UZERO, + previousPeriod: isSet(object.previousPeriod) + ? Long.fromValue(object.previousPeriod) + : Long.UZERO, stake: isSet(object.stake) ? String(object.stake) : "", height: isSet(object.height) ? Long.fromValue(object.height) : Long.UZERO, - }; + } }, toJSON(message: DelegatorStartingInfo): unknown { - const obj: any = {}; - message.previousPeriod !== undefined && (obj.previousPeriod = (message.previousPeriod || Long.UZERO).toString()); - message.stake !== undefined && (obj.stake = message.stake); - message.height !== undefined && (obj.height = (message.height || Long.UZERO).toString()); - return obj; - }, - - fromPartial, I>>(object: I): DelegatorStartingInfo { - const message = createBaseDelegatorStartingInfo(); - message.previousPeriod = (object.previousPeriod !== undefined && object.previousPeriod !== null) - ? Long.fromValue(object.previousPeriod) - : Long.UZERO; - message.stake = object.stake ?? ""; - message.height = (object.height !== undefined && object.height !== null) - ? Long.fromValue(object.height) - : Long.UZERO; - return message; - }, -}; + const obj: any = {} + message.previousPeriod !== undefined && + (obj.previousPeriod = (message.previousPeriod || Long.UZERO).toString()) + message.stake !== undefined && (obj.stake = message.stake) + message.height !== undefined && + (obj.height = (message.height || Long.UZERO).toString()) + return obj + }, + + fromPartial, I>>( + object: I, + ): DelegatorStartingInfo { + const message = createBaseDelegatorStartingInfo() + message.previousPeriod = + object.previousPeriod !== undefined && object.previousPeriod !== null + ? Long.fromValue(object.previousPeriod) + : Long.UZERO + message.stake = object.stake ?? "" + message.height = + object.height !== undefined && object.height !== null + ? Long.fromValue(object.height) + : Long.UZERO + return message + }, +} function createBaseDelegationDelegatorReward(): DelegationDelegatorReward { - return { validatorAddress: "", reward: [] }; + return { validatorAddress: "", reward: [] } } export const DelegationDelegatorReward = { - encode(message: DelegationDelegatorReward, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: DelegationDelegatorReward, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.validatorAddress !== "") { - writer.uint32(10).string(message.validatorAddress); + writer.uint32(10).string(message.validatorAddress) } for (const v of message.reward) { - DecCoin.encode(v!, writer.uint32(18).fork()).ldelim(); + DecCoin.encode(v!, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): DelegationDelegatorReward { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDelegationDelegatorReward(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseDelegationDelegatorReward() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.validatorAddress = reader.string(); - break; + message.validatorAddress = reader.string() + break case 2: - message.reward.push(DecCoin.decode(reader, reader.uint32())); - break; + message.reward.push(DecCoin.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): DelegationDelegatorReward { return { - validatorAddress: isSet(object.validatorAddress) ? String(object.validatorAddress) : "", - reward: Array.isArray(object?.reward) ? object.reward.map((e: any) => DecCoin.fromJSON(e)) : [], - }; + validatorAddress: isSet(object.validatorAddress) + ? String(object.validatorAddress) + : "", + reward: Array.isArray(object?.reward) + ? object.reward.map((e: any) => DecCoin.fromJSON(e)) + : [], + } }, toJSON(message: DelegationDelegatorReward): unknown { - const obj: any = {}; - message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); + const obj: any = {} + message.validatorAddress !== undefined && + (obj.validatorAddress = message.validatorAddress) if (message.reward) { - obj.reward = message.reward.map((e) => e ? DecCoin.toJSON(e) : undefined); + obj.reward = message.reward.map((e) => (e ? DecCoin.toJSON(e) : undefined)) } else { - obj.reward = []; + obj.reward = [] } - return obj; + return obj }, - fromPartial, I>>(object: I): DelegationDelegatorReward { - const message = createBaseDelegationDelegatorReward(); - message.validatorAddress = object.validatorAddress ?? ""; - message.reward = object.reward?.map((e) => DecCoin.fromPartial(e)) || []; - return message; + fromPartial, I>>( + object: I, + ): DelegationDelegatorReward { + const message = createBaseDelegationDelegatorReward() + message.validatorAddress = object.validatorAddress ?? "" + message.reward = object.reward?.map((e) => DecCoin.fromPartial(e)) || [] + return message }, -}; +} function createBaseCommunityPoolSpendProposalWithDeposit(): CommunityPoolSpendProposalWithDeposit { - return { title: "", description: "", recipient: "", amount: "", deposit: "" }; + return { title: "", description: "", recipient: "", amount: "", deposit: "" } } export const CommunityPoolSpendProposalWithDeposit = { - encode(message: CommunityPoolSpendProposalWithDeposit, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: CommunityPoolSpendProposalWithDeposit, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.title !== "") { - writer.uint32(10).string(message.title); + writer.uint32(10).string(message.title) } if (message.description !== "") { - writer.uint32(18).string(message.description); + writer.uint32(18).string(message.description) } if (message.recipient !== "") { - writer.uint32(26).string(message.recipient); + writer.uint32(26).string(message.recipient) } if (message.amount !== "") { - writer.uint32(34).string(message.amount); + writer.uint32(34).string(message.amount) } if (message.deposit !== "") { - writer.uint32(42).string(message.deposit); + writer.uint32(42).string(message.deposit) } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): CommunityPoolSpendProposalWithDeposit { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseCommunityPoolSpendProposalWithDeposit(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): CommunityPoolSpendProposalWithDeposit { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseCommunityPoolSpendProposalWithDeposit() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.title = reader.string(); - break; + message.title = reader.string() + break case 2: - message.description = reader.string(); - break; + message.description = reader.string() + break case 3: - message.recipient = reader.string(); - break; + message.recipient = reader.string() + break case 4: - message.amount = reader.string(); - break; + message.amount = reader.string() + break case 5: - message.deposit = reader.string(); - break; + message.deposit = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): CommunityPoolSpendProposalWithDeposit { @@ -880,49 +987,59 @@ export const CommunityPoolSpendProposalWithDeposit = { recipient: isSet(object.recipient) ? String(object.recipient) : "", amount: isSet(object.amount) ? String(object.amount) : "", deposit: isSet(object.deposit) ? String(object.deposit) : "", - }; + } }, toJSON(message: CommunityPoolSpendProposalWithDeposit): unknown { - const obj: any = {}; - message.title !== undefined && (obj.title = message.title); - message.description !== undefined && (obj.description = message.description); - message.recipient !== undefined && (obj.recipient = message.recipient); - message.amount !== undefined && (obj.amount = message.amount); - message.deposit !== undefined && (obj.deposit = message.deposit); - return obj; + const obj: any = {} + message.title !== undefined && (obj.title = message.title) + message.description !== undefined && (obj.description = message.description) + message.recipient !== undefined && (obj.recipient = message.recipient) + message.amount !== undefined && (obj.amount = message.amount) + message.deposit !== undefined && (obj.deposit = message.deposit) + return obj }, fromPartial, I>>( object: I, ): CommunityPoolSpendProposalWithDeposit { - const message = createBaseCommunityPoolSpendProposalWithDeposit(); - message.title = object.title ?? ""; - message.description = object.description ?? ""; - message.recipient = object.recipient ?? ""; - message.amount = object.amount ?? ""; - message.deposit = object.deposit ?? ""; - return message; + const message = createBaseCommunityPoolSpendProposalWithDeposit() + message.title = object.title ?? "" + message.description = object.description ?? "" + message.recipient = object.recipient ?? "" + message.amount = object.amount ?? "" + message.deposit = object.deposit ?? "" + return message }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; +} -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/cosmos/distribution/v1beta1/genesis.ts b/packages/protojs/src/cosmos/distribution/v1beta1/genesis.ts index 54216887..521d75bd 100644 --- a/packages/protojs/src/cosmos/distribution/v1beta1/genesis.ts +++ b/packages/protojs/src/cosmos/distribution/v1beta1/genesis.ts @@ -1,18 +1,18 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { DecCoin } from "../../base/v1beta1/coin"; import { - DelegatorStartingInfo, - FeePool, - Params, ValidatorAccumulatedCommission, - ValidatorCurrentRewards, ValidatorHistoricalRewards, + ValidatorCurrentRewards, + DelegatorStartingInfo, ValidatorSlashEvent, -} from "./distribution"; + Params, + FeePool, +} from "./distribution" +import Long from "long" +import { DecCoin } from "../../base/v1beta1/coin" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "cosmos.distribution.v1beta1"; +export const protobufPackage = "cosmos.distribution.v1beta1" /** * DelegatorWithdrawInfo is the address for where distributions rewards are @@ -21,17 +21,17 @@ export const protobufPackage = "cosmos.distribution.v1beta1"; */ export interface DelegatorWithdrawInfo { /** delegator_address is the address of the delegator. */ - delegatorAddress: string; + delegatorAddress: string /** withdraw_address is the address to withdraw the delegation rewards to. */ - withdrawAddress: string; + withdrawAddress: string } /** ValidatorOutstandingRewardsRecord is used for import/export via genesis json. */ export interface ValidatorOutstandingRewardsRecord { /** validator_address is the address of the validator. */ - validatorAddress: string; + validatorAddress: string /** outstanding_rewards represents the oustanding rewards of a validator. */ - outstandingRewards: DecCoin[]; + outstandingRewards: DecCoin[] } /** @@ -40,9 +40,9 @@ export interface ValidatorOutstandingRewardsRecord { */ export interface ValidatorAccumulatedCommissionRecord { /** validator_address is the address of the validator. */ - validatorAddress: string; + validatorAddress: string /** accumulated is the accumulated commission of a validator. */ - accumulated?: ValidatorAccumulatedCommission; + accumulated?: ValidatorAccumulatedCommission } /** @@ -51,546 +51,666 @@ export interface ValidatorAccumulatedCommissionRecord { */ export interface ValidatorHistoricalRewardsRecord { /** validator_address is the address of the validator. */ - validatorAddress: string; + validatorAddress: string /** period defines the period the historical rewards apply to. */ - period: Long; + period: Long /** rewards defines the historical rewards of a validator. */ - rewards?: ValidatorHistoricalRewards; + rewards?: ValidatorHistoricalRewards } /** ValidatorCurrentRewardsRecord is used for import / export via genesis json. */ export interface ValidatorCurrentRewardsRecord { /** validator_address is the address of the validator. */ - validatorAddress: string; + validatorAddress: string /** rewards defines the current rewards of a validator. */ - rewards?: ValidatorCurrentRewards; + rewards?: ValidatorCurrentRewards } /** DelegatorStartingInfoRecord used for import / export via genesis json. */ export interface DelegatorStartingInfoRecord { /** delegator_address is the address of the delegator. */ - delegatorAddress: string; + delegatorAddress: string /** validator_address is the address of the validator. */ - validatorAddress: string; + validatorAddress: string /** starting_info defines the starting info of a delegator. */ - startingInfo?: DelegatorStartingInfo; + startingInfo?: DelegatorStartingInfo } /** ValidatorSlashEventRecord is used for import / export via genesis json. */ export interface ValidatorSlashEventRecord { /** validator_address is the address of the validator. */ - validatorAddress: string; + validatorAddress: string /** height defines the block height at which the slash event occured. */ - height: Long; + height: Long /** period is the period of the slash event. */ - period: Long; + period: Long /** validator_slash_event describes the slash event. */ - validatorSlashEvent?: ValidatorSlashEvent; + validatorSlashEvent?: ValidatorSlashEvent } /** GenesisState defines the distribution module's genesis state. */ export interface GenesisState { /** params defines all the paramaters of the module. */ - params?: Params; + params?: Params /** fee_pool defines the fee pool at genesis. */ - feePool?: FeePool; + feePool?: FeePool /** fee_pool defines the delegator withdraw infos at genesis. */ - delegatorWithdrawInfos: DelegatorWithdrawInfo[]; + delegatorWithdrawInfos: DelegatorWithdrawInfo[] /** fee_pool defines the previous proposer at genesis. */ - previousProposer: string; + previousProposer: string /** fee_pool defines the outstanding rewards of all validators at genesis. */ - outstandingRewards: ValidatorOutstandingRewardsRecord[]; + outstandingRewards: ValidatorOutstandingRewardsRecord[] /** fee_pool defines the accumulated commisions of all validators at genesis. */ - validatorAccumulatedCommissions: ValidatorAccumulatedCommissionRecord[]; + validatorAccumulatedCommissions: ValidatorAccumulatedCommissionRecord[] /** fee_pool defines the historical rewards of all validators at genesis. */ - validatorHistoricalRewards: ValidatorHistoricalRewardsRecord[]; + validatorHistoricalRewards: ValidatorHistoricalRewardsRecord[] /** fee_pool defines the current rewards of all validators at genesis. */ - validatorCurrentRewards: ValidatorCurrentRewardsRecord[]; + validatorCurrentRewards: ValidatorCurrentRewardsRecord[] /** fee_pool defines the delegator starting infos at genesis. */ - delegatorStartingInfos: DelegatorStartingInfoRecord[]; + delegatorStartingInfos: DelegatorStartingInfoRecord[] /** fee_pool defines the validator slash events at genesis. */ - validatorSlashEvents: ValidatorSlashEventRecord[]; + validatorSlashEvents: ValidatorSlashEventRecord[] } function createBaseDelegatorWithdrawInfo(): DelegatorWithdrawInfo { - return { delegatorAddress: "", withdrawAddress: "" }; + return { delegatorAddress: "", withdrawAddress: "" } } export const DelegatorWithdrawInfo = { - encode(message: DelegatorWithdrawInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: DelegatorWithdrawInfo, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.delegatorAddress !== "") { - writer.uint32(10).string(message.delegatorAddress); + writer.uint32(10).string(message.delegatorAddress) } if (message.withdrawAddress !== "") { - writer.uint32(18).string(message.withdrawAddress); + writer.uint32(18).string(message.withdrawAddress) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): DelegatorWithdrawInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDelegatorWithdrawInfo(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseDelegatorWithdrawInfo() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.delegatorAddress = reader.string(); - break; + message.delegatorAddress = reader.string() + break case 2: - message.withdrawAddress = reader.string(); - break; + message.withdrawAddress = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): DelegatorWithdrawInfo { return { - delegatorAddress: isSet(object.delegatorAddress) ? String(object.delegatorAddress) : "", - withdrawAddress: isSet(object.withdrawAddress) ? String(object.withdrawAddress) : "", - }; + delegatorAddress: isSet(object.delegatorAddress) + ? String(object.delegatorAddress) + : "", + withdrawAddress: isSet(object.withdrawAddress) + ? String(object.withdrawAddress) + : "", + } }, toJSON(message: DelegatorWithdrawInfo): unknown { - const obj: any = {}; - message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); - message.withdrawAddress !== undefined && (obj.withdrawAddress = message.withdrawAddress); - return obj; + const obj: any = {} + message.delegatorAddress !== undefined && + (obj.delegatorAddress = message.delegatorAddress) + message.withdrawAddress !== undefined && + (obj.withdrawAddress = message.withdrawAddress) + return obj }, - fromPartial, I>>(object: I): DelegatorWithdrawInfo { - const message = createBaseDelegatorWithdrawInfo(); - message.delegatorAddress = object.delegatorAddress ?? ""; - message.withdrawAddress = object.withdrawAddress ?? ""; - return message; + fromPartial, I>>( + object: I, + ): DelegatorWithdrawInfo { + const message = createBaseDelegatorWithdrawInfo() + message.delegatorAddress = object.delegatorAddress ?? "" + message.withdrawAddress = object.withdrawAddress ?? "" + return message }, -}; +} function createBaseValidatorOutstandingRewardsRecord(): ValidatorOutstandingRewardsRecord { - return { validatorAddress: "", outstandingRewards: [] }; + return { validatorAddress: "", outstandingRewards: [] } } export const ValidatorOutstandingRewardsRecord = { - encode(message: ValidatorOutstandingRewardsRecord, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: ValidatorOutstandingRewardsRecord, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.validatorAddress !== "") { - writer.uint32(10).string(message.validatorAddress); + writer.uint32(10).string(message.validatorAddress) } for (const v of message.outstandingRewards) { - DecCoin.encode(v!, writer.uint32(18).fork()).ldelim(); + DecCoin.encode(v!, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorOutstandingRewardsRecord { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseValidatorOutstandingRewardsRecord(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): ValidatorOutstandingRewardsRecord { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseValidatorOutstandingRewardsRecord() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.validatorAddress = reader.string(); - break; + message.validatorAddress = reader.string() + break case 2: - message.outstandingRewards.push(DecCoin.decode(reader, reader.uint32())); - break; + message.outstandingRewards.push(DecCoin.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): ValidatorOutstandingRewardsRecord { return { - validatorAddress: isSet(object.validatorAddress) ? String(object.validatorAddress) : "", + validatorAddress: isSet(object.validatorAddress) + ? String(object.validatorAddress) + : "", outstandingRewards: Array.isArray(object?.outstandingRewards) ? object.outstandingRewards.map((e: any) => DecCoin.fromJSON(e)) : [], - }; + } }, toJSON(message: ValidatorOutstandingRewardsRecord): unknown { - const obj: any = {}; - message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); + const obj: any = {} + message.validatorAddress !== undefined && + (obj.validatorAddress = message.validatorAddress) if (message.outstandingRewards) { - obj.outstandingRewards = message.outstandingRewards.map((e) => e ? DecCoin.toJSON(e) : undefined); + obj.outstandingRewards = message.outstandingRewards.map((e) => + e ? DecCoin.toJSON(e) : undefined, + ) } else { - obj.outstandingRewards = []; + obj.outstandingRewards = [] } - return obj; + return obj }, fromPartial, I>>( object: I, ): ValidatorOutstandingRewardsRecord { - const message = createBaseValidatorOutstandingRewardsRecord(); - message.validatorAddress = object.validatorAddress ?? ""; - message.outstandingRewards = object.outstandingRewards?.map((e) => DecCoin.fromPartial(e)) || []; - return message; + const message = createBaseValidatorOutstandingRewardsRecord() + message.validatorAddress = object.validatorAddress ?? "" + message.outstandingRewards = + object.outstandingRewards?.map((e) => DecCoin.fromPartial(e)) || [] + return message }, -}; +} function createBaseValidatorAccumulatedCommissionRecord(): ValidatorAccumulatedCommissionRecord { - return { validatorAddress: "", accumulated: undefined }; + return { validatorAddress: "", accumulated: undefined } } export const ValidatorAccumulatedCommissionRecord = { - encode(message: ValidatorAccumulatedCommissionRecord, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: ValidatorAccumulatedCommissionRecord, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.validatorAddress !== "") { - writer.uint32(10).string(message.validatorAddress); + writer.uint32(10).string(message.validatorAddress) } if (message.accumulated !== undefined) { - ValidatorAccumulatedCommission.encode(message.accumulated, writer.uint32(18).fork()).ldelim(); + ValidatorAccumulatedCommission.encode( + message.accumulated, + writer.uint32(18).fork(), + ).ldelim() } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorAccumulatedCommissionRecord { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseValidatorAccumulatedCommissionRecord(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): ValidatorAccumulatedCommissionRecord { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseValidatorAccumulatedCommissionRecord() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.validatorAddress = reader.string(); - break; + message.validatorAddress = reader.string() + break case 2: - message.accumulated = ValidatorAccumulatedCommission.decode(reader, reader.uint32()); - break; + message.accumulated = ValidatorAccumulatedCommission.decode( + reader, + reader.uint32(), + ) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): ValidatorAccumulatedCommissionRecord { return { - validatorAddress: isSet(object.validatorAddress) ? String(object.validatorAddress) : "", - accumulated: isSet(object.accumulated) ? ValidatorAccumulatedCommission.fromJSON(object.accumulated) : undefined, - }; + validatorAddress: isSet(object.validatorAddress) + ? String(object.validatorAddress) + : "", + accumulated: isSet(object.accumulated) + ? ValidatorAccumulatedCommission.fromJSON(object.accumulated) + : undefined, + } }, toJSON(message: ValidatorAccumulatedCommissionRecord): unknown { - const obj: any = {}; - message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); + const obj: any = {} + message.validatorAddress !== undefined && + (obj.validatorAddress = message.validatorAddress) message.accumulated !== undefined && - (obj.accumulated = message.accumulated ? ValidatorAccumulatedCommission.toJSON(message.accumulated) : undefined); - return obj; + (obj.accumulated = message.accumulated + ? ValidatorAccumulatedCommission.toJSON(message.accumulated) + : undefined) + return obj }, fromPartial, I>>( object: I, ): ValidatorAccumulatedCommissionRecord { - const message = createBaseValidatorAccumulatedCommissionRecord(); - message.validatorAddress = object.validatorAddress ?? ""; - message.accumulated = (object.accumulated !== undefined && object.accumulated !== null) - ? ValidatorAccumulatedCommission.fromPartial(object.accumulated) - : undefined; - return message; + const message = createBaseValidatorAccumulatedCommissionRecord() + message.validatorAddress = object.validatorAddress ?? "" + message.accumulated = + object.accumulated !== undefined && object.accumulated !== null + ? ValidatorAccumulatedCommission.fromPartial(object.accumulated) + : undefined + return message }, -}; +} function createBaseValidatorHistoricalRewardsRecord(): ValidatorHistoricalRewardsRecord { - return { validatorAddress: "", period: Long.UZERO, rewards: undefined }; + return { validatorAddress: "", period: Long.UZERO, rewards: undefined } } export const ValidatorHistoricalRewardsRecord = { - encode(message: ValidatorHistoricalRewardsRecord, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: ValidatorHistoricalRewardsRecord, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.validatorAddress !== "") { - writer.uint32(10).string(message.validatorAddress); + writer.uint32(10).string(message.validatorAddress) } if (!message.period.isZero()) { - writer.uint32(16).uint64(message.period); + writer.uint32(16).uint64(message.period) } if (message.rewards !== undefined) { - ValidatorHistoricalRewards.encode(message.rewards, writer.uint32(26).fork()).ldelim(); + ValidatorHistoricalRewards.encode( + message.rewards, + writer.uint32(26).fork(), + ).ldelim() } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorHistoricalRewardsRecord { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseValidatorHistoricalRewardsRecord(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): ValidatorHistoricalRewardsRecord { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseValidatorHistoricalRewardsRecord() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.validatorAddress = reader.string(); - break; + message.validatorAddress = reader.string() + break case 2: - message.period = reader.uint64() as Long; - break; + message.period = reader.uint64() as Long + break case 3: - message.rewards = ValidatorHistoricalRewards.decode(reader, reader.uint32()); - break; + message.rewards = ValidatorHistoricalRewards.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): ValidatorHistoricalRewardsRecord { return { - validatorAddress: isSet(object.validatorAddress) ? String(object.validatorAddress) : "", + validatorAddress: isSet(object.validatorAddress) + ? String(object.validatorAddress) + : "", period: isSet(object.period) ? Long.fromValue(object.period) : Long.UZERO, - rewards: isSet(object.rewards) ? ValidatorHistoricalRewards.fromJSON(object.rewards) : undefined, - }; + rewards: isSet(object.rewards) + ? ValidatorHistoricalRewards.fromJSON(object.rewards) + : undefined, + } }, toJSON(message: ValidatorHistoricalRewardsRecord): unknown { - const obj: any = {}; - message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); - message.period !== undefined && (obj.period = (message.period || Long.UZERO).toString()); + const obj: any = {} + message.validatorAddress !== undefined && + (obj.validatorAddress = message.validatorAddress) + message.period !== undefined && + (obj.period = (message.period || Long.UZERO).toString()) message.rewards !== undefined && - (obj.rewards = message.rewards ? ValidatorHistoricalRewards.toJSON(message.rewards) : undefined); - return obj; + (obj.rewards = message.rewards + ? ValidatorHistoricalRewards.toJSON(message.rewards) + : undefined) + return obj }, fromPartial, I>>( object: I, ): ValidatorHistoricalRewardsRecord { - const message = createBaseValidatorHistoricalRewardsRecord(); - message.validatorAddress = object.validatorAddress ?? ""; - message.period = (object.period !== undefined && object.period !== null) - ? Long.fromValue(object.period) - : Long.UZERO; - message.rewards = (object.rewards !== undefined && object.rewards !== null) - ? ValidatorHistoricalRewards.fromPartial(object.rewards) - : undefined; - return message; - }, -}; + const message = createBaseValidatorHistoricalRewardsRecord() + message.validatorAddress = object.validatorAddress ?? "" + message.period = + object.period !== undefined && object.period !== null + ? Long.fromValue(object.period) + : Long.UZERO + message.rewards = + object.rewards !== undefined && object.rewards !== null + ? ValidatorHistoricalRewards.fromPartial(object.rewards) + : undefined + return message + }, +} function createBaseValidatorCurrentRewardsRecord(): ValidatorCurrentRewardsRecord { - return { validatorAddress: "", rewards: undefined }; + return { validatorAddress: "", rewards: undefined } } export const ValidatorCurrentRewardsRecord = { - encode(message: ValidatorCurrentRewardsRecord, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: ValidatorCurrentRewardsRecord, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.validatorAddress !== "") { - writer.uint32(10).string(message.validatorAddress); + writer.uint32(10).string(message.validatorAddress) } if (message.rewards !== undefined) { - ValidatorCurrentRewards.encode(message.rewards, writer.uint32(18).fork()).ldelim(); + ValidatorCurrentRewards.encode(message.rewards, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorCurrentRewardsRecord { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseValidatorCurrentRewardsRecord(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): ValidatorCurrentRewardsRecord { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseValidatorCurrentRewardsRecord() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.validatorAddress = reader.string(); - break; + message.validatorAddress = reader.string() + break case 2: - message.rewards = ValidatorCurrentRewards.decode(reader, reader.uint32()); - break; + message.rewards = ValidatorCurrentRewards.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): ValidatorCurrentRewardsRecord { return { - validatorAddress: isSet(object.validatorAddress) ? String(object.validatorAddress) : "", - rewards: isSet(object.rewards) ? ValidatorCurrentRewards.fromJSON(object.rewards) : undefined, - }; + validatorAddress: isSet(object.validatorAddress) + ? String(object.validatorAddress) + : "", + rewards: isSet(object.rewards) + ? ValidatorCurrentRewards.fromJSON(object.rewards) + : undefined, + } }, toJSON(message: ValidatorCurrentRewardsRecord): unknown { - const obj: any = {}; - message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); + const obj: any = {} + message.validatorAddress !== undefined && + (obj.validatorAddress = message.validatorAddress) message.rewards !== undefined && - (obj.rewards = message.rewards ? ValidatorCurrentRewards.toJSON(message.rewards) : undefined); - return obj; + (obj.rewards = message.rewards + ? ValidatorCurrentRewards.toJSON(message.rewards) + : undefined) + return obj }, fromPartial, I>>( object: I, ): ValidatorCurrentRewardsRecord { - const message = createBaseValidatorCurrentRewardsRecord(); - message.validatorAddress = object.validatorAddress ?? ""; - message.rewards = (object.rewards !== undefined && object.rewards !== null) - ? ValidatorCurrentRewards.fromPartial(object.rewards) - : undefined; - return message; + const message = createBaseValidatorCurrentRewardsRecord() + message.validatorAddress = object.validatorAddress ?? "" + message.rewards = + object.rewards !== undefined && object.rewards !== null + ? ValidatorCurrentRewards.fromPartial(object.rewards) + : undefined + return message }, -}; +} function createBaseDelegatorStartingInfoRecord(): DelegatorStartingInfoRecord { - return { delegatorAddress: "", validatorAddress: "", startingInfo: undefined }; + return { delegatorAddress: "", validatorAddress: "", startingInfo: undefined } } export const DelegatorStartingInfoRecord = { - encode(message: DelegatorStartingInfoRecord, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: DelegatorStartingInfoRecord, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.delegatorAddress !== "") { - writer.uint32(10).string(message.delegatorAddress); + writer.uint32(10).string(message.delegatorAddress) } if (message.validatorAddress !== "") { - writer.uint32(18).string(message.validatorAddress); + writer.uint32(18).string(message.validatorAddress) } if (message.startingInfo !== undefined) { - DelegatorStartingInfo.encode(message.startingInfo, writer.uint32(26).fork()).ldelim(); + DelegatorStartingInfo.encode( + message.startingInfo, + writer.uint32(26).fork(), + ).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): DelegatorStartingInfoRecord { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDelegatorStartingInfoRecord(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseDelegatorStartingInfoRecord() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.delegatorAddress = reader.string(); - break; + message.delegatorAddress = reader.string() + break case 2: - message.validatorAddress = reader.string(); - break; + message.validatorAddress = reader.string() + break case 3: - message.startingInfo = DelegatorStartingInfo.decode(reader, reader.uint32()); - break; + message.startingInfo = DelegatorStartingInfo.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): DelegatorStartingInfoRecord { return { - delegatorAddress: isSet(object.delegatorAddress) ? String(object.delegatorAddress) : "", - validatorAddress: isSet(object.validatorAddress) ? String(object.validatorAddress) : "", - startingInfo: isSet(object.startingInfo) ? DelegatorStartingInfo.fromJSON(object.startingInfo) : undefined, - }; + delegatorAddress: isSet(object.delegatorAddress) + ? String(object.delegatorAddress) + : "", + validatorAddress: isSet(object.validatorAddress) + ? String(object.validatorAddress) + : "", + startingInfo: isSet(object.startingInfo) + ? DelegatorStartingInfo.fromJSON(object.startingInfo) + : undefined, + } }, toJSON(message: DelegatorStartingInfoRecord): unknown { - const obj: any = {}; - message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); - message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); + const obj: any = {} + message.delegatorAddress !== undefined && + (obj.delegatorAddress = message.delegatorAddress) + message.validatorAddress !== undefined && + (obj.validatorAddress = message.validatorAddress) message.startingInfo !== undefined && - (obj.startingInfo = message.startingInfo ? DelegatorStartingInfo.toJSON(message.startingInfo) : undefined); - return obj; + (obj.startingInfo = message.startingInfo + ? DelegatorStartingInfo.toJSON(message.startingInfo) + : undefined) + return obj }, - fromPartial, I>>(object: I): DelegatorStartingInfoRecord { - const message = createBaseDelegatorStartingInfoRecord(); - message.delegatorAddress = object.delegatorAddress ?? ""; - message.validatorAddress = object.validatorAddress ?? ""; - message.startingInfo = (object.startingInfo !== undefined && object.startingInfo !== null) - ? DelegatorStartingInfo.fromPartial(object.startingInfo) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): DelegatorStartingInfoRecord { + const message = createBaseDelegatorStartingInfoRecord() + message.delegatorAddress = object.delegatorAddress ?? "" + message.validatorAddress = object.validatorAddress ?? "" + message.startingInfo = + object.startingInfo !== undefined && object.startingInfo !== null + ? DelegatorStartingInfo.fromPartial(object.startingInfo) + : undefined + return message }, -}; +} function createBaseValidatorSlashEventRecord(): ValidatorSlashEventRecord { - return { validatorAddress: "", height: Long.UZERO, period: Long.UZERO, validatorSlashEvent: undefined }; + return { + validatorAddress: "", + height: Long.UZERO, + period: Long.UZERO, + validatorSlashEvent: undefined, + } } export const ValidatorSlashEventRecord = { - encode(message: ValidatorSlashEventRecord, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: ValidatorSlashEventRecord, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.validatorAddress !== "") { - writer.uint32(10).string(message.validatorAddress); + writer.uint32(10).string(message.validatorAddress) } if (!message.height.isZero()) { - writer.uint32(16).uint64(message.height); + writer.uint32(16).uint64(message.height) } if (!message.period.isZero()) { - writer.uint32(24).uint64(message.period); + writer.uint32(24).uint64(message.period) } if (message.validatorSlashEvent !== undefined) { - ValidatorSlashEvent.encode(message.validatorSlashEvent, writer.uint32(34).fork()).ldelim(); + ValidatorSlashEvent.encode( + message.validatorSlashEvent, + writer.uint32(34).fork(), + ).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorSlashEventRecord { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseValidatorSlashEventRecord(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseValidatorSlashEventRecord() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.validatorAddress = reader.string(); - break; + message.validatorAddress = reader.string() + break case 2: - message.height = reader.uint64() as Long; - break; + message.height = reader.uint64() as Long + break case 3: - message.period = reader.uint64() as Long; - break; + message.period = reader.uint64() as Long + break case 4: - message.validatorSlashEvent = ValidatorSlashEvent.decode(reader, reader.uint32()); - break; + message.validatorSlashEvent = ValidatorSlashEvent.decode( + reader, + reader.uint32(), + ) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): ValidatorSlashEventRecord { return { - validatorAddress: isSet(object.validatorAddress) ? String(object.validatorAddress) : "", + validatorAddress: isSet(object.validatorAddress) + ? String(object.validatorAddress) + : "", height: isSet(object.height) ? Long.fromValue(object.height) : Long.UZERO, period: isSet(object.period) ? Long.fromValue(object.period) : Long.UZERO, validatorSlashEvent: isSet(object.validatorSlashEvent) ? ValidatorSlashEvent.fromJSON(object.validatorSlashEvent) : undefined, - }; + } }, toJSON(message: ValidatorSlashEventRecord): unknown { - const obj: any = {}; - message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); - message.height !== undefined && (obj.height = (message.height || Long.UZERO).toString()); - message.period !== undefined && (obj.period = (message.period || Long.UZERO).toString()); - message.validatorSlashEvent !== undefined && (obj.validatorSlashEvent = message.validatorSlashEvent - ? ValidatorSlashEvent.toJSON(message.validatorSlashEvent) - : undefined); - return obj; - }, - - fromPartial, I>>(object: I): ValidatorSlashEventRecord { - const message = createBaseValidatorSlashEventRecord(); - message.validatorAddress = object.validatorAddress ?? ""; - message.height = (object.height !== undefined && object.height !== null) - ? Long.fromValue(object.height) - : Long.UZERO; - message.period = (object.period !== undefined && object.period !== null) - ? Long.fromValue(object.period) - : Long.UZERO; - message.validatorSlashEvent = (object.validatorSlashEvent !== undefined && object.validatorSlashEvent !== null) - ? ValidatorSlashEvent.fromPartial(object.validatorSlashEvent) - : undefined; - return message; - }, -}; + const obj: any = {} + message.validatorAddress !== undefined && + (obj.validatorAddress = message.validatorAddress) + message.height !== undefined && + (obj.height = (message.height || Long.UZERO).toString()) + message.period !== undefined && + (obj.period = (message.period || Long.UZERO).toString()) + message.validatorSlashEvent !== undefined && + (obj.validatorSlashEvent = message.validatorSlashEvent + ? ValidatorSlashEvent.toJSON(message.validatorSlashEvent) + : undefined) + return obj + }, + + fromPartial, I>>( + object: I, + ): ValidatorSlashEventRecord { + const message = createBaseValidatorSlashEventRecord() + message.validatorAddress = object.validatorAddress ?? "" + message.height = + object.height !== undefined && object.height !== null + ? Long.fromValue(object.height) + : Long.UZERO + message.period = + object.period !== undefined && object.period !== null + ? Long.fromValue(object.period) + : Long.UZERO + message.validatorSlashEvent = + object.validatorSlashEvent !== undefined && object.validatorSlashEvent !== null + ? ValidatorSlashEvent.fromPartial(object.validatorSlashEvent) + : undefined + return message + }, +} function createBaseGenesisState(): GenesisState { return { @@ -604,89 +724,101 @@ function createBaseGenesisState(): GenesisState { validatorCurrentRewards: [], delegatorStartingInfos: [], validatorSlashEvents: [], - }; + } } export const GenesisState = { encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.params !== undefined) { - Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + Params.encode(message.params, writer.uint32(10).fork()).ldelim() } if (message.feePool !== undefined) { - FeePool.encode(message.feePool, writer.uint32(18).fork()).ldelim(); + FeePool.encode(message.feePool, writer.uint32(18).fork()).ldelim() } for (const v of message.delegatorWithdrawInfos) { - DelegatorWithdrawInfo.encode(v!, writer.uint32(26).fork()).ldelim(); + DelegatorWithdrawInfo.encode(v!, writer.uint32(26).fork()).ldelim() } if (message.previousProposer !== "") { - writer.uint32(34).string(message.previousProposer); + writer.uint32(34).string(message.previousProposer) } for (const v of message.outstandingRewards) { - ValidatorOutstandingRewardsRecord.encode(v!, writer.uint32(42).fork()).ldelim(); + ValidatorOutstandingRewardsRecord.encode(v!, writer.uint32(42).fork()).ldelim() } for (const v of message.validatorAccumulatedCommissions) { - ValidatorAccumulatedCommissionRecord.encode(v!, writer.uint32(50).fork()).ldelim(); + ValidatorAccumulatedCommissionRecord.encode(v!, writer.uint32(50).fork()).ldelim() } for (const v of message.validatorHistoricalRewards) { - ValidatorHistoricalRewardsRecord.encode(v!, writer.uint32(58).fork()).ldelim(); + ValidatorHistoricalRewardsRecord.encode(v!, writer.uint32(58).fork()).ldelim() } for (const v of message.validatorCurrentRewards) { - ValidatorCurrentRewardsRecord.encode(v!, writer.uint32(66).fork()).ldelim(); + ValidatorCurrentRewardsRecord.encode(v!, writer.uint32(66).fork()).ldelim() } for (const v of message.delegatorStartingInfos) { - DelegatorStartingInfoRecord.encode(v!, writer.uint32(74).fork()).ldelim(); + DelegatorStartingInfoRecord.encode(v!, writer.uint32(74).fork()).ldelim() } for (const v of message.validatorSlashEvents) { - ValidatorSlashEventRecord.encode(v!, writer.uint32(82).fork()).ldelim(); + ValidatorSlashEventRecord.encode(v!, writer.uint32(82).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGenesisState(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseGenesisState() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.params = Params.decode(reader, reader.uint32()); - break; + message.params = Params.decode(reader, reader.uint32()) + break case 2: - message.feePool = FeePool.decode(reader, reader.uint32()); - break; + message.feePool = FeePool.decode(reader, reader.uint32()) + break case 3: - message.delegatorWithdrawInfos.push(DelegatorWithdrawInfo.decode(reader, reader.uint32())); - break; + message.delegatorWithdrawInfos.push( + DelegatorWithdrawInfo.decode(reader, reader.uint32()), + ) + break case 4: - message.previousProposer = reader.string(); - break; + message.previousProposer = reader.string() + break case 5: - message.outstandingRewards.push(ValidatorOutstandingRewardsRecord.decode(reader, reader.uint32())); - break; + message.outstandingRewards.push( + ValidatorOutstandingRewardsRecord.decode(reader, reader.uint32()), + ) + break case 6: message.validatorAccumulatedCommissions.push( ValidatorAccumulatedCommissionRecord.decode(reader, reader.uint32()), - ); - break; + ) + break case 7: - message.validatorHistoricalRewards.push(ValidatorHistoricalRewardsRecord.decode(reader, reader.uint32())); - break; + message.validatorHistoricalRewards.push( + ValidatorHistoricalRewardsRecord.decode(reader, reader.uint32()), + ) + break case 8: - message.validatorCurrentRewards.push(ValidatorCurrentRewardsRecord.decode(reader, reader.uint32())); - break; + message.validatorCurrentRewards.push( + ValidatorCurrentRewardsRecord.decode(reader, reader.uint32()), + ) + break case 9: - message.delegatorStartingInfos.push(DelegatorStartingInfoRecord.decode(reader, reader.uint32())); - break; + message.delegatorStartingInfos.push( + DelegatorStartingInfoRecord.decode(reader, reader.uint32()), + ) + break case 10: - message.validatorSlashEvents.push(ValidatorSlashEventRecord.decode(reader, reader.uint32())); - break; + message.validatorSlashEvents.push( + ValidatorSlashEventRecord.decode(reader, reader.uint32()), + ) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): GenesisState { @@ -694,131 +826,177 @@ export const GenesisState = { params: isSet(object.params) ? Params.fromJSON(object.params) : undefined, feePool: isSet(object.feePool) ? FeePool.fromJSON(object.feePool) : undefined, delegatorWithdrawInfos: Array.isArray(object?.delegatorWithdrawInfos) - ? object.delegatorWithdrawInfos.map((e: any) => DelegatorWithdrawInfo.fromJSON(e)) + ? object.delegatorWithdrawInfos.map((e: any) => + DelegatorWithdrawInfo.fromJSON(e), + ) : [], - previousProposer: isSet(object.previousProposer) ? String(object.previousProposer) : "", + previousProposer: isSet(object.previousProposer) + ? String(object.previousProposer) + : "", outstandingRewards: Array.isArray(object?.outstandingRewards) - ? object.outstandingRewards.map((e: any) => ValidatorOutstandingRewardsRecord.fromJSON(e)) + ? object.outstandingRewards.map((e: any) => + ValidatorOutstandingRewardsRecord.fromJSON(e), + ) : [], - validatorAccumulatedCommissions: Array.isArray(object?.validatorAccumulatedCommissions) - ? object.validatorAccumulatedCommissions.map((e: any) => ValidatorAccumulatedCommissionRecord.fromJSON(e)) + validatorAccumulatedCommissions: Array.isArray( + object?.validatorAccumulatedCommissions, + ) + ? object.validatorAccumulatedCommissions.map((e: any) => + ValidatorAccumulatedCommissionRecord.fromJSON(e), + ) : [], validatorHistoricalRewards: Array.isArray(object?.validatorHistoricalRewards) - ? object.validatorHistoricalRewards.map((e: any) => ValidatorHistoricalRewardsRecord.fromJSON(e)) + ? object.validatorHistoricalRewards.map((e: any) => + ValidatorHistoricalRewardsRecord.fromJSON(e), + ) : [], validatorCurrentRewards: Array.isArray(object?.validatorCurrentRewards) - ? object.validatorCurrentRewards.map((e: any) => ValidatorCurrentRewardsRecord.fromJSON(e)) + ? object.validatorCurrentRewards.map((e: any) => + ValidatorCurrentRewardsRecord.fromJSON(e), + ) : [], delegatorStartingInfos: Array.isArray(object?.delegatorStartingInfos) - ? object.delegatorStartingInfos.map((e: any) => DelegatorStartingInfoRecord.fromJSON(e)) + ? object.delegatorStartingInfos.map((e: any) => + DelegatorStartingInfoRecord.fromJSON(e), + ) : [], validatorSlashEvents: Array.isArray(object?.validatorSlashEvents) - ? object.validatorSlashEvents.map((e: any) => ValidatorSlashEventRecord.fromJSON(e)) + ? object.validatorSlashEvents.map((e: any) => + ValidatorSlashEventRecord.fromJSON(e), + ) : [], - }; + } }, toJSON(message: GenesisState): unknown { - const obj: any = {}; - message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); - message.feePool !== undefined && (obj.feePool = message.feePool ? FeePool.toJSON(message.feePool) : undefined); + const obj: any = {} + message.params !== undefined && + (obj.params = message.params ? Params.toJSON(message.params) : undefined) + message.feePool !== undefined && + (obj.feePool = message.feePool ? FeePool.toJSON(message.feePool) : undefined) if (message.delegatorWithdrawInfos) { obj.delegatorWithdrawInfos = message.delegatorWithdrawInfos.map((e) => - e ? DelegatorWithdrawInfo.toJSON(e) : undefined - ); + e ? DelegatorWithdrawInfo.toJSON(e) : undefined, + ) } else { - obj.delegatorWithdrawInfos = []; + obj.delegatorWithdrawInfos = [] } - message.previousProposer !== undefined && (obj.previousProposer = message.previousProposer); + message.previousProposer !== undefined && + (obj.previousProposer = message.previousProposer) if (message.outstandingRewards) { obj.outstandingRewards = message.outstandingRewards.map((e) => - e ? ValidatorOutstandingRewardsRecord.toJSON(e) : undefined - ); + e ? ValidatorOutstandingRewardsRecord.toJSON(e) : undefined, + ) } else { - obj.outstandingRewards = []; + obj.outstandingRewards = [] } if (message.validatorAccumulatedCommissions) { - obj.validatorAccumulatedCommissions = message.validatorAccumulatedCommissions.map((e) => - e ? ValidatorAccumulatedCommissionRecord.toJSON(e) : undefined - ); + obj.validatorAccumulatedCommissions = message.validatorAccumulatedCommissions.map( + (e) => (e ? ValidatorAccumulatedCommissionRecord.toJSON(e) : undefined), + ) } else { - obj.validatorAccumulatedCommissions = []; + obj.validatorAccumulatedCommissions = [] } if (message.validatorHistoricalRewards) { obj.validatorHistoricalRewards = message.validatorHistoricalRewards.map((e) => - e ? ValidatorHistoricalRewardsRecord.toJSON(e) : undefined - ); + e ? ValidatorHistoricalRewardsRecord.toJSON(e) : undefined, + ) } else { - obj.validatorHistoricalRewards = []; + obj.validatorHistoricalRewards = [] } if (message.validatorCurrentRewards) { obj.validatorCurrentRewards = message.validatorCurrentRewards.map((e) => - e ? ValidatorCurrentRewardsRecord.toJSON(e) : undefined - ); + e ? ValidatorCurrentRewardsRecord.toJSON(e) : undefined, + ) } else { - obj.validatorCurrentRewards = []; + obj.validatorCurrentRewards = [] } if (message.delegatorStartingInfos) { obj.delegatorStartingInfos = message.delegatorStartingInfos.map((e) => - e ? DelegatorStartingInfoRecord.toJSON(e) : undefined - ); + e ? DelegatorStartingInfoRecord.toJSON(e) : undefined, + ) } else { - obj.delegatorStartingInfos = []; + obj.delegatorStartingInfos = [] } if (message.validatorSlashEvents) { obj.validatorSlashEvents = message.validatorSlashEvents.map((e) => - e ? ValidatorSlashEventRecord.toJSON(e) : undefined - ); + e ? ValidatorSlashEventRecord.toJSON(e) : undefined, + ) } else { - obj.validatorSlashEvents = []; + obj.validatorSlashEvents = [] } - return obj; + return obj }, fromPartial, I>>(object: I): GenesisState { - const message = createBaseGenesisState(); - message.params = (object.params !== undefined && object.params !== null) - ? Params.fromPartial(object.params) - : undefined; - message.feePool = (object.feePool !== undefined && object.feePool !== null) - ? FeePool.fromPartial(object.feePool) - : undefined; - message.delegatorWithdrawInfos = object.delegatorWithdrawInfos?.map((e) => DelegatorWithdrawInfo.fromPartial(e)) || - []; - message.previousProposer = object.previousProposer ?? ""; + const message = createBaseGenesisState() + message.params = + object.params !== undefined && object.params !== null + ? Params.fromPartial(object.params) + : undefined + message.feePool = + object.feePool !== undefined && object.feePool !== null + ? FeePool.fromPartial(object.feePool) + : undefined + message.delegatorWithdrawInfos = + object.delegatorWithdrawInfos?.map((e) => DelegatorWithdrawInfo.fromPartial(e)) || + [] + message.previousProposer = object.previousProposer ?? "" message.outstandingRewards = - object.outstandingRewards?.map((e) => ValidatorOutstandingRewardsRecord.fromPartial(e)) || []; + object.outstandingRewards?.map((e) => + ValidatorOutstandingRewardsRecord.fromPartial(e), + ) || [] message.validatorAccumulatedCommissions = - object.validatorAccumulatedCommissions?.map((e) => ValidatorAccumulatedCommissionRecord.fromPartial(e)) || []; + object.validatorAccumulatedCommissions?.map((e) => + ValidatorAccumulatedCommissionRecord.fromPartial(e), + ) || [] message.validatorHistoricalRewards = - object.validatorHistoricalRewards?.map((e) => ValidatorHistoricalRewardsRecord.fromPartial(e)) || []; + object.validatorHistoricalRewards?.map((e) => + ValidatorHistoricalRewardsRecord.fromPartial(e), + ) || [] message.validatorCurrentRewards = - object.validatorCurrentRewards?.map((e) => ValidatorCurrentRewardsRecord.fromPartial(e)) || []; + object.validatorCurrentRewards?.map((e) => + ValidatorCurrentRewardsRecord.fromPartial(e), + ) || [] message.delegatorStartingInfos = - object.delegatorStartingInfos?.map((e) => DelegatorStartingInfoRecord.fromPartial(e)) || []; - message.validatorSlashEvents = object.validatorSlashEvents?.map((e) => ValidatorSlashEventRecord.fromPartial(e)) || - []; - return message; + object.delegatorStartingInfos?.map((e) => + DelegatorStartingInfoRecord.fromPartial(e), + ) || [] + message.validatorSlashEvents = + object.validatorSlashEvents?.map((e) => + ValidatorSlashEventRecord.fromPartial(e), + ) || [] + return message }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; +} -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/cosmos/distribution/v1beta1/query.ts b/packages/protojs/src/cosmos/distribution/v1beta1/query.ts index abe9a657..495c5fb5 100644 --- a/packages/protojs/src/cosmos/distribution/v1beta1/query.ts +++ b/packages/protojs/src/cosmos/distribution/v1beta1/query.ts @@ -1,26 +1,25 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { PageRequest, PageResponse } from "../../base/query/v1beta1/pagination"; -import { DecCoin } from "../../base/v1beta1/coin"; import { - DelegationDelegatorReward, Params, - ValidatorAccumulatedCommission, ValidatorOutstandingRewards, + ValidatorAccumulatedCommission, ValidatorSlashEvent, -} from "./distribution"; + DelegationDelegatorReward, +} from "./distribution" +import { PageRequest, PageResponse } from "../../base/query/v1beta1/pagination" +import Long from "long" +import { DecCoin } from "../../base/v1beta1/coin" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "cosmos.distribution.v1beta1"; +export const protobufPackage = "cosmos.distribution.v1beta1" /** QueryParamsRequest is the request type for the Query/Params RPC method. */ -export interface QueryParamsRequest { -} +export interface QueryParamsRequest {} /** QueryParamsResponse is the response type for the Query/Params RPC method. */ export interface QueryParamsResponse { /** params defines the parameters of the module. */ - params?: Params; + params?: Params } /** @@ -29,7 +28,7 @@ export interface QueryParamsResponse { */ export interface QueryValidatorOutstandingRewardsRequest { /** validator_address defines the validator address to query for. */ - validatorAddress: string; + validatorAddress: string } /** @@ -37,7 +36,7 @@ export interface QueryValidatorOutstandingRewardsRequest { * Query/ValidatorOutstandingRewards RPC method. */ export interface QueryValidatorOutstandingRewardsResponse { - rewards?: ValidatorOutstandingRewards; + rewards?: ValidatorOutstandingRewards } /** @@ -46,7 +45,7 @@ export interface QueryValidatorOutstandingRewardsResponse { */ export interface QueryValidatorCommissionRequest { /** validator_address defines the validator address to query for. */ - validatorAddress: string; + validatorAddress: string } /** @@ -55,7 +54,7 @@ export interface QueryValidatorCommissionRequest { */ export interface QueryValidatorCommissionResponse { /** commission defines the commision the validator received. */ - commission?: ValidatorAccumulatedCommission; + commission?: ValidatorAccumulatedCommission } /** @@ -64,13 +63,13 @@ export interface QueryValidatorCommissionResponse { */ export interface QueryValidatorSlashesRequest { /** validator_address defines the validator address to query for. */ - validatorAddress: string; + validatorAddress: string /** starting_height defines the optional starting height to query the slashes. */ - startingHeight: Long; + startingHeight: Long /** starting_height defines the optional ending height to query the slashes. */ - endingHeight: Long; + endingHeight: Long /** pagination defines an optional pagination for the request. */ - pagination?: PageRequest; + pagination?: PageRequest } /** @@ -79,9 +78,9 @@ export interface QueryValidatorSlashesRequest { */ export interface QueryValidatorSlashesResponse { /** slashes defines the slashes the validator received. */ - slashes: ValidatorSlashEvent[]; + slashes: ValidatorSlashEvent[] /** pagination defines the pagination in the response. */ - pagination?: PageResponse; + pagination?: PageResponse } /** @@ -90,9 +89,9 @@ export interface QueryValidatorSlashesResponse { */ export interface QueryDelegationRewardsRequest { /** delegator_address defines the delegator address to query for. */ - delegatorAddress: string; + delegatorAddress: string /** validator_address defines the validator address to query for. */ - validatorAddress: string; + validatorAddress: string } /** @@ -101,7 +100,7 @@ export interface QueryDelegationRewardsRequest { */ export interface QueryDelegationRewardsResponse { /** rewards defines the rewards accrued by a delegation. */ - rewards: DecCoin[]; + rewards: DecCoin[] } /** @@ -110,7 +109,7 @@ export interface QueryDelegationRewardsResponse { */ export interface QueryDelegationTotalRewardsRequest { /** delegator_address defines the delegator address to query for. */ - delegatorAddress: string; + delegatorAddress: string } /** @@ -119,9 +118,9 @@ export interface QueryDelegationTotalRewardsRequest { */ export interface QueryDelegationTotalRewardsResponse { /** rewards defines all the rewards accrued by a delegator. */ - rewards: DelegationDelegatorReward[]; + rewards: DelegationDelegatorReward[] /** total defines the sum of all the rewards. */ - total: DecCoin[]; + total: DecCoin[] } /** @@ -130,7 +129,7 @@ export interface QueryDelegationTotalRewardsResponse { */ export interface QueryDelegatorValidatorsRequest { /** delegator_address defines the delegator address to query for. */ - delegatorAddress: string; + delegatorAddress: string } /** @@ -139,7 +138,7 @@ export interface QueryDelegatorValidatorsRequest { */ export interface QueryDelegatorValidatorsResponse { /** validators defines the validators a delegator is delegating for. */ - validators: string[]; + validators: string[] } /** @@ -148,7 +147,7 @@ export interface QueryDelegatorValidatorsResponse { */ export interface QueryDelegatorWithdrawAddressRequest { /** delegator_address defines the delegator address to query for. */ - delegatorAddress: string; + delegatorAddress: string } /** @@ -157,15 +156,14 @@ export interface QueryDelegatorWithdrawAddressRequest { */ export interface QueryDelegatorWithdrawAddressResponse { /** withdraw_address defines the delegator address to query for. */ - withdrawAddress: string; + withdrawAddress: string } /** * QueryCommunityPoolRequest is the request type for the Query/CommunityPool RPC * method. */ -export interface QueryCommunityPoolRequest { -} +export interface QueryCommunityPoolRequest {} /** * QueryCommunityPoolResponse is the response type for the Query/CommunityPool @@ -173,647 +171,799 @@ export interface QueryCommunityPoolRequest { */ export interface QueryCommunityPoolResponse { /** pool defines community pool's coins. */ - pool: DecCoin[]; + pool: DecCoin[] } function createBaseQueryParamsRequest(): QueryParamsRequest { - return {}; + return {} } export const QueryParamsRequest = { encode(_: QueryParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryParamsRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryParamsRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(_: any): QueryParamsRequest { - return {}; + return {} }, toJSON(_: QueryParamsRequest): unknown { - const obj: any = {}; - return obj; + const obj: any = {} + return obj }, - fromPartial, I>>(_: I): QueryParamsRequest { - const message = createBaseQueryParamsRequest(); - return message; + fromPartial, I>>( + _: I, + ): QueryParamsRequest { + const message = createBaseQueryParamsRequest() + return message }, -}; +} function createBaseQueryParamsResponse(): QueryParamsResponse { - return { params: undefined }; + return { params: undefined } } export const QueryParamsResponse = { - encode(message: QueryParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryParamsResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.params !== undefined) { - Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + Params.encode(message.params, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryParamsResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryParamsResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.params = Params.decode(reader, reader.uint32()); - break; + message.params = Params.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryParamsResponse { - return { params: isSet(object.params) ? Params.fromJSON(object.params) : undefined }; + return { + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined, + } }, toJSON(message: QueryParamsResponse): unknown { - const obj: any = {}; - message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); - return obj; + const obj: any = {} + message.params !== undefined && + (obj.params = message.params ? Params.toJSON(message.params) : undefined) + return obj }, - fromPartial, I>>(object: I): QueryParamsResponse { - const message = createBaseQueryParamsResponse(); - message.params = (object.params !== undefined && object.params !== null) - ? Params.fromPartial(object.params) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): QueryParamsResponse { + const message = createBaseQueryParamsResponse() + message.params = + object.params !== undefined && object.params !== null + ? Params.fromPartial(object.params) + : undefined + return message }, -}; +} function createBaseQueryValidatorOutstandingRewardsRequest(): QueryValidatorOutstandingRewardsRequest { - return { validatorAddress: "" }; + return { validatorAddress: "" } } export const QueryValidatorOutstandingRewardsRequest = { - encode(message: QueryValidatorOutstandingRewardsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryValidatorOutstandingRewardsRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.validatorAddress !== "") { - writer.uint32(10).string(message.validatorAddress); + writer.uint32(10).string(message.validatorAddress) } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorOutstandingRewardsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryValidatorOutstandingRewardsRequest(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryValidatorOutstandingRewardsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryValidatorOutstandingRewardsRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.validatorAddress = reader.string(); - break; + message.validatorAddress = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryValidatorOutstandingRewardsRequest { - return { validatorAddress: isSet(object.validatorAddress) ? String(object.validatorAddress) : "" }; + return { + validatorAddress: isSet(object.validatorAddress) + ? String(object.validatorAddress) + : "", + } }, toJSON(message: QueryValidatorOutstandingRewardsRequest): unknown { - const obj: any = {}; - message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); - return obj; + const obj: any = {} + message.validatorAddress !== undefined && + (obj.validatorAddress = message.validatorAddress) + return obj }, fromPartial, I>>( object: I, ): QueryValidatorOutstandingRewardsRequest { - const message = createBaseQueryValidatorOutstandingRewardsRequest(); - message.validatorAddress = object.validatorAddress ?? ""; - return message; + const message = createBaseQueryValidatorOutstandingRewardsRequest() + message.validatorAddress = object.validatorAddress ?? "" + return message }, -}; +} function createBaseQueryValidatorOutstandingRewardsResponse(): QueryValidatorOutstandingRewardsResponse { - return { rewards: undefined }; + return { rewards: undefined } } export const QueryValidatorOutstandingRewardsResponse = { - encode(message: QueryValidatorOutstandingRewardsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryValidatorOutstandingRewardsResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.rewards !== undefined) { - ValidatorOutstandingRewards.encode(message.rewards, writer.uint32(10).fork()).ldelim(); + ValidatorOutstandingRewards.encode( + message.rewards, + writer.uint32(10).fork(), + ).ldelim() } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorOutstandingRewardsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryValidatorOutstandingRewardsResponse(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryValidatorOutstandingRewardsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryValidatorOutstandingRewardsResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.rewards = ValidatorOutstandingRewards.decode(reader, reader.uint32()); - break; + message.rewards = ValidatorOutstandingRewards.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryValidatorOutstandingRewardsResponse { - return { rewards: isSet(object.rewards) ? ValidatorOutstandingRewards.fromJSON(object.rewards) : undefined }; + return { + rewards: isSet(object.rewards) + ? ValidatorOutstandingRewards.fromJSON(object.rewards) + : undefined, + } }, toJSON(message: QueryValidatorOutstandingRewardsResponse): unknown { - const obj: any = {}; + const obj: any = {} message.rewards !== undefined && - (obj.rewards = message.rewards ? ValidatorOutstandingRewards.toJSON(message.rewards) : undefined); - return obj; - }, - - fromPartial, I>>( - object: I, - ): QueryValidatorOutstandingRewardsResponse { - const message = createBaseQueryValidatorOutstandingRewardsResponse(); - message.rewards = (object.rewards !== undefined && object.rewards !== null) - ? ValidatorOutstandingRewards.fromPartial(object.rewards) - : undefined; - return message; + (obj.rewards = message.rewards + ? ValidatorOutstandingRewards.toJSON(message.rewards) + : undefined) + return obj + }, + + fromPartial< + I extends Exact, I>, + >(object: I): QueryValidatorOutstandingRewardsResponse { + const message = createBaseQueryValidatorOutstandingRewardsResponse() + message.rewards = + object.rewards !== undefined && object.rewards !== null + ? ValidatorOutstandingRewards.fromPartial(object.rewards) + : undefined + return message }, -}; +} function createBaseQueryValidatorCommissionRequest(): QueryValidatorCommissionRequest { - return { validatorAddress: "" }; + return { validatorAddress: "" } } export const QueryValidatorCommissionRequest = { - encode(message: QueryValidatorCommissionRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryValidatorCommissionRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.validatorAddress !== "") { - writer.uint32(10).string(message.validatorAddress); + writer.uint32(10).string(message.validatorAddress) } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorCommissionRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryValidatorCommissionRequest(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryValidatorCommissionRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryValidatorCommissionRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.validatorAddress = reader.string(); - break; + message.validatorAddress = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryValidatorCommissionRequest { - return { validatorAddress: isSet(object.validatorAddress) ? String(object.validatorAddress) : "" }; + return { + validatorAddress: isSet(object.validatorAddress) + ? String(object.validatorAddress) + : "", + } }, toJSON(message: QueryValidatorCommissionRequest): unknown { - const obj: any = {}; - message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); - return obj; + const obj: any = {} + message.validatorAddress !== undefined && + (obj.validatorAddress = message.validatorAddress) + return obj }, fromPartial, I>>( object: I, ): QueryValidatorCommissionRequest { - const message = createBaseQueryValidatorCommissionRequest(); - message.validatorAddress = object.validatorAddress ?? ""; - return message; + const message = createBaseQueryValidatorCommissionRequest() + message.validatorAddress = object.validatorAddress ?? "" + return message }, -}; +} function createBaseQueryValidatorCommissionResponse(): QueryValidatorCommissionResponse { - return { commission: undefined }; + return { commission: undefined } } export const QueryValidatorCommissionResponse = { - encode(message: QueryValidatorCommissionResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryValidatorCommissionResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.commission !== undefined) { - ValidatorAccumulatedCommission.encode(message.commission, writer.uint32(10).fork()).ldelim(); + ValidatorAccumulatedCommission.encode( + message.commission, + writer.uint32(10).fork(), + ).ldelim() } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorCommissionResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryValidatorCommissionResponse(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryValidatorCommissionResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryValidatorCommissionResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.commission = ValidatorAccumulatedCommission.decode(reader, reader.uint32()); - break; + message.commission = ValidatorAccumulatedCommission.decode( + reader, + reader.uint32(), + ) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryValidatorCommissionResponse { return { - commission: isSet(object.commission) ? ValidatorAccumulatedCommission.fromJSON(object.commission) : undefined, - }; + commission: isSet(object.commission) + ? ValidatorAccumulatedCommission.fromJSON(object.commission) + : undefined, + } }, toJSON(message: QueryValidatorCommissionResponse): unknown { - const obj: any = {}; + const obj: any = {} message.commission !== undefined && - (obj.commission = message.commission ? ValidatorAccumulatedCommission.toJSON(message.commission) : undefined); - return obj; + (obj.commission = message.commission + ? ValidatorAccumulatedCommission.toJSON(message.commission) + : undefined) + return obj }, fromPartial, I>>( object: I, ): QueryValidatorCommissionResponse { - const message = createBaseQueryValidatorCommissionResponse(); - message.commission = (object.commission !== undefined && object.commission !== null) - ? ValidatorAccumulatedCommission.fromPartial(object.commission) - : undefined; - return message; + const message = createBaseQueryValidatorCommissionResponse() + message.commission = + object.commission !== undefined && object.commission !== null + ? ValidatorAccumulatedCommission.fromPartial(object.commission) + : undefined + return message }, -}; +} function createBaseQueryValidatorSlashesRequest(): QueryValidatorSlashesRequest { - return { validatorAddress: "", startingHeight: Long.UZERO, endingHeight: Long.UZERO, pagination: undefined }; + return { + validatorAddress: "", + startingHeight: Long.UZERO, + endingHeight: Long.UZERO, + pagination: undefined, + } } export const QueryValidatorSlashesRequest = { - encode(message: QueryValidatorSlashesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryValidatorSlashesRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.validatorAddress !== "") { - writer.uint32(10).string(message.validatorAddress); + writer.uint32(10).string(message.validatorAddress) } if (!message.startingHeight.isZero()) { - writer.uint32(16).uint64(message.startingHeight); + writer.uint32(16).uint64(message.startingHeight) } if (!message.endingHeight.isZero()) { - writer.uint32(24).uint64(message.endingHeight); + writer.uint32(24).uint64(message.endingHeight) } if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(34).fork()).ldelim(); + PageRequest.encode(message.pagination, writer.uint32(34).fork()).ldelim() } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorSlashesRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryValidatorSlashesRequest(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryValidatorSlashesRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryValidatorSlashesRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.validatorAddress = reader.string(); - break; + message.validatorAddress = reader.string() + break case 2: - message.startingHeight = reader.uint64() as Long; - break; + message.startingHeight = reader.uint64() as Long + break case 3: - message.endingHeight = reader.uint64() as Long; - break; + message.endingHeight = reader.uint64() as Long + break case 4: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; + message.pagination = PageRequest.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryValidatorSlashesRequest { return { - validatorAddress: isSet(object.validatorAddress) ? String(object.validatorAddress) : "", - startingHeight: isSet(object.startingHeight) ? Long.fromValue(object.startingHeight) : Long.UZERO, - endingHeight: isSet(object.endingHeight) ? Long.fromValue(object.endingHeight) : Long.UZERO, - pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined, - }; + validatorAddress: isSet(object.validatorAddress) + ? String(object.validatorAddress) + : "", + startingHeight: isSet(object.startingHeight) + ? Long.fromValue(object.startingHeight) + : Long.UZERO, + endingHeight: isSet(object.endingHeight) + ? Long.fromValue(object.endingHeight) + : Long.UZERO, + pagination: isSet(object.pagination) + ? PageRequest.fromJSON(object.pagination) + : undefined, + } }, toJSON(message: QueryValidatorSlashesRequest): unknown { - const obj: any = {}; - message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); - message.startingHeight !== undefined && (obj.startingHeight = (message.startingHeight || Long.UZERO).toString()); - message.endingHeight !== undefined && (obj.endingHeight = (message.endingHeight || Long.UZERO).toString()); + const obj: any = {} + message.validatorAddress !== undefined && + (obj.validatorAddress = message.validatorAddress) + message.startingHeight !== undefined && + (obj.startingHeight = (message.startingHeight || Long.UZERO).toString()) + message.endingHeight !== undefined && + (obj.endingHeight = (message.endingHeight || Long.UZERO).toString()) message.pagination !== undefined && - (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); - return obj; - }, - - fromPartial, I>>(object: I): QueryValidatorSlashesRequest { - const message = createBaseQueryValidatorSlashesRequest(); - message.validatorAddress = object.validatorAddress ?? ""; - message.startingHeight = (object.startingHeight !== undefined && object.startingHeight !== null) - ? Long.fromValue(object.startingHeight) - : Long.UZERO; - message.endingHeight = (object.endingHeight !== undefined && object.endingHeight !== null) - ? Long.fromValue(object.endingHeight) - : Long.UZERO; - message.pagination = (object.pagination !== undefined && object.pagination !== null) - ? PageRequest.fromPartial(object.pagination) - : undefined; - return message; - }, -}; + (obj.pagination = message.pagination + ? PageRequest.toJSON(message.pagination) + : undefined) + return obj + }, + + fromPartial, I>>( + object: I, + ): QueryValidatorSlashesRequest { + const message = createBaseQueryValidatorSlashesRequest() + message.validatorAddress = object.validatorAddress ?? "" + message.startingHeight = + object.startingHeight !== undefined && object.startingHeight !== null + ? Long.fromValue(object.startingHeight) + : Long.UZERO + message.endingHeight = + object.endingHeight !== undefined && object.endingHeight !== null + ? Long.fromValue(object.endingHeight) + : Long.UZERO + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageRequest.fromPartial(object.pagination) + : undefined + return message + }, +} function createBaseQueryValidatorSlashesResponse(): QueryValidatorSlashesResponse { - return { slashes: [], pagination: undefined }; + return { slashes: [], pagination: undefined } } export const QueryValidatorSlashesResponse = { - encode(message: QueryValidatorSlashesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryValidatorSlashesResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { for (const v of message.slashes) { - ValidatorSlashEvent.encode(v!, writer.uint32(10).fork()).ldelim(); + ValidatorSlashEvent.encode(v!, writer.uint32(10).fork()).ldelim() } if (message.pagination !== undefined) { - PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorSlashesResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryValidatorSlashesResponse(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryValidatorSlashesResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryValidatorSlashesResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.slashes.push(ValidatorSlashEvent.decode(reader, reader.uint32())); - break; + message.slashes.push(ValidatorSlashEvent.decode(reader, reader.uint32())) + break case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; + message.pagination = PageResponse.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryValidatorSlashesResponse { return { - slashes: Array.isArray(object?.slashes) ? object.slashes.map((e: any) => ValidatorSlashEvent.fromJSON(e)) : [], - pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, - }; + slashes: Array.isArray(object?.slashes) + ? object.slashes.map((e: any) => ValidatorSlashEvent.fromJSON(e)) + : [], + pagination: isSet(object.pagination) + ? PageResponse.fromJSON(object.pagination) + : undefined, + } }, toJSON(message: QueryValidatorSlashesResponse): unknown { - const obj: any = {}; + const obj: any = {} if (message.slashes) { - obj.slashes = message.slashes.map((e) => e ? ValidatorSlashEvent.toJSON(e) : undefined); + obj.slashes = message.slashes.map((e) => + e ? ValidatorSlashEvent.toJSON(e) : undefined, + ) } else { - obj.slashes = []; + obj.slashes = [] } message.pagination !== undefined && - (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); - return obj; + (obj.pagination = message.pagination + ? PageResponse.toJSON(message.pagination) + : undefined) + return obj }, fromPartial, I>>( object: I, ): QueryValidatorSlashesResponse { - const message = createBaseQueryValidatorSlashesResponse(); - message.slashes = object.slashes?.map((e) => ValidatorSlashEvent.fromPartial(e)) || []; - message.pagination = (object.pagination !== undefined && object.pagination !== null) - ? PageResponse.fromPartial(object.pagination) - : undefined; - return message; + const message = createBaseQueryValidatorSlashesResponse() + message.slashes = + object.slashes?.map((e) => ValidatorSlashEvent.fromPartial(e)) || [] + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageResponse.fromPartial(object.pagination) + : undefined + return message }, -}; +} function createBaseQueryDelegationRewardsRequest(): QueryDelegationRewardsRequest { - return { delegatorAddress: "", validatorAddress: "" }; + return { delegatorAddress: "", validatorAddress: "" } } export const QueryDelegationRewardsRequest = { - encode(message: QueryDelegationRewardsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryDelegationRewardsRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.delegatorAddress !== "") { - writer.uint32(10).string(message.delegatorAddress); + writer.uint32(10).string(message.delegatorAddress) } if (message.validatorAddress !== "") { - writer.uint32(18).string(message.validatorAddress); + writer.uint32(18).string(message.validatorAddress) } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegationRewardsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryDelegationRewardsRequest(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryDelegationRewardsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryDelegationRewardsRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.delegatorAddress = reader.string(); - break; + message.delegatorAddress = reader.string() + break case 2: - message.validatorAddress = reader.string(); - break; + message.validatorAddress = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryDelegationRewardsRequest { return { - delegatorAddress: isSet(object.delegatorAddress) ? String(object.delegatorAddress) : "", - validatorAddress: isSet(object.validatorAddress) ? String(object.validatorAddress) : "", - }; + delegatorAddress: isSet(object.delegatorAddress) + ? String(object.delegatorAddress) + : "", + validatorAddress: isSet(object.validatorAddress) + ? String(object.validatorAddress) + : "", + } }, toJSON(message: QueryDelegationRewardsRequest): unknown { - const obj: any = {}; - message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); - message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); - return obj; + const obj: any = {} + message.delegatorAddress !== undefined && + (obj.delegatorAddress = message.delegatorAddress) + message.validatorAddress !== undefined && + (obj.validatorAddress = message.validatorAddress) + return obj }, fromPartial, I>>( object: I, ): QueryDelegationRewardsRequest { - const message = createBaseQueryDelegationRewardsRequest(); - message.delegatorAddress = object.delegatorAddress ?? ""; - message.validatorAddress = object.validatorAddress ?? ""; - return message; + const message = createBaseQueryDelegationRewardsRequest() + message.delegatorAddress = object.delegatorAddress ?? "" + message.validatorAddress = object.validatorAddress ?? "" + return message }, -}; +} function createBaseQueryDelegationRewardsResponse(): QueryDelegationRewardsResponse { - return { rewards: [] }; + return { rewards: [] } } export const QueryDelegationRewardsResponse = { - encode(message: QueryDelegationRewardsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryDelegationRewardsResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { for (const v of message.rewards) { - DecCoin.encode(v!, writer.uint32(10).fork()).ldelim(); + DecCoin.encode(v!, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegationRewardsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryDelegationRewardsResponse(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryDelegationRewardsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryDelegationRewardsResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.rewards.push(DecCoin.decode(reader, reader.uint32())); - break; + message.rewards.push(DecCoin.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryDelegationRewardsResponse { - return { rewards: Array.isArray(object?.rewards) ? object.rewards.map((e: any) => DecCoin.fromJSON(e)) : [] }; + return { + rewards: Array.isArray(object?.rewards) + ? object.rewards.map((e: any) => DecCoin.fromJSON(e)) + : [], + } }, toJSON(message: QueryDelegationRewardsResponse): unknown { - const obj: any = {}; + const obj: any = {} if (message.rewards) { - obj.rewards = message.rewards.map((e) => e ? DecCoin.toJSON(e) : undefined); + obj.rewards = message.rewards.map((e) => (e ? DecCoin.toJSON(e) : undefined)) } else { - obj.rewards = []; + obj.rewards = [] } - return obj; + return obj }, fromPartial, I>>( object: I, ): QueryDelegationRewardsResponse { - const message = createBaseQueryDelegationRewardsResponse(); - message.rewards = object.rewards?.map((e) => DecCoin.fromPartial(e)) || []; - return message; + const message = createBaseQueryDelegationRewardsResponse() + message.rewards = object.rewards?.map((e) => DecCoin.fromPartial(e)) || [] + return message }, -}; +} function createBaseQueryDelegationTotalRewardsRequest(): QueryDelegationTotalRewardsRequest { - return { delegatorAddress: "" }; + return { delegatorAddress: "" } } export const QueryDelegationTotalRewardsRequest = { - encode(message: QueryDelegationTotalRewardsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryDelegationTotalRewardsRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.delegatorAddress !== "") { - writer.uint32(10).string(message.delegatorAddress); + writer.uint32(10).string(message.delegatorAddress) } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegationTotalRewardsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryDelegationTotalRewardsRequest(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryDelegationTotalRewardsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryDelegationTotalRewardsRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.delegatorAddress = reader.string(); - break; + message.delegatorAddress = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryDelegationTotalRewardsRequest { - return { delegatorAddress: isSet(object.delegatorAddress) ? String(object.delegatorAddress) : "" }; + return { + delegatorAddress: isSet(object.delegatorAddress) + ? String(object.delegatorAddress) + : "", + } }, toJSON(message: QueryDelegationTotalRewardsRequest): unknown { - const obj: any = {}; - message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); - return obj; + const obj: any = {} + message.delegatorAddress !== undefined && + (obj.delegatorAddress = message.delegatorAddress) + return obj }, fromPartial, I>>( object: I, ): QueryDelegationTotalRewardsRequest { - const message = createBaseQueryDelegationTotalRewardsRequest(); - message.delegatorAddress = object.delegatorAddress ?? ""; - return message; + const message = createBaseQueryDelegationTotalRewardsRequest() + message.delegatorAddress = object.delegatorAddress ?? "" + return message }, -}; +} function createBaseQueryDelegationTotalRewardsResponse(): QueryDelegationTotalRewardsResponse { - return { rewards: [], total: [] }; + return { rewards: [], total: [] } } export const QueryDelegationTotalRewardsResponse = { - encode(message: QueryDelegationTotalRewardsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryDelegationTotalRewardsResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { for (const v of message.rewards) { - DelegationDelegatorReward.encode(v!, writer.uint32(10).fork()).ldelim(); + DelegationDelegatorReward.encode(v!, writer.uint32(10).fork()).ldelim() } for (const v of message.total) { - DecCoin.encode(v!, writer.uint32(18).fork()).ldelim(); + DecCoin.encode(v!, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegationTotalRewardsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryDelegationTotalRewardsResponse(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryDelegationTotalRewardsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryDelegationTotalRewardsResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.rewards.push(DelegationDelegatorReward.decode(reader, reader.uint32())); - break; + message.rewards.push( + DelegationDelegatorReward.decode(reader, reader.uint32()), + ) + break case 2: - message.total.push(DecCoin.decode(reader, reader.uint32())); - break; + message.total.push(DecCoin.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryDelegationTotalRewardsResponse { @@ -821,448 +971,594 @@ export const QueryDelegationTotalRewardsResponse = { rewards: Array.isArray(object?.rewards) ? object.rewards.map((e: any) => DelegationDelegatorReward.fromJSON(e)) : [], - total: Array.isArray(object?.total) ? object.total.map((e: any) => DecCoin.fromJSON(e)) : [], - }; + total: Array.isArray(object?.total) + ? object.total.map((e: any) => DecCoin.fromJSON(e)) + : [], + } }, toJSON(message: QueryDelegationTotalRewardsResponse): unknown { - const obj: any = {}; + const obj: any = {} if (message.rewards) { - obj.rewards = message.rewards.map((e) => e ? DelegationDelegatorReward.toJSON(e) : undefined); + obj.rewards = message.rewards.map((e) => + e ? DelegationDelegatorReward.toJSON(e) : undefined, + ) } else { - obj.rewards = []; + obj.rewards = [] } if (message.total) { - obj.total = message.total.map((e) => e ? DecCoin.toJSON(e) : undefined); + obj.total = message.total.map((e) => (e ? DecCoin.toJSON(e) : undefined)) } else { - obj.total = []; + obj.total = [] } - return obj; + return obj }, fromPartial, I>>( object: I, ): QueryDelegationTotalRewardsResponse { - const message = createBaseQueryDelegationTotalRewardsResponse(); - message.rewards = object.rewards?.map((e) => DelegationDelegatorReward.fromPartial(e)) || []; - message.total = object.total?.map((e) => DecCoin.fromPartial(e)) || []; - return message; + const message = createBaseQueryDelegationTotalRewardsResponse() + message.rewards = + object.rewards?.map((e) => DelegationDelegatorReward.fromPartial(e)) || [] + message.total = object.total?.map((e) => DecCoin.fromPartial(e)) || [] + return message }, -}; +} function createBaseQueryDelegatorValidatorsRequest(): QueryDelegatorValidatorsRequest { - return { delegatorAddress: "" }; + return { delegatorAddress: "" } } export const QueryDelegatorValidatorsRequest = { - encode(message: QueryDelegatorValidatorsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryDelegatorValidatorsRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.delegatorAddress !== "") { - writer.uint32(10).string(message.delegatorAddress); + writer.uint32(10).string(message.delegatorAddress) } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegatorValidatorsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryDelegatorValidatorsRequest(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryDelegatorValidatorsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryDelegatorValidatorsRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.delegatorAddress = reader.string(); - break; + message.delegatorAddress = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryDelegatorValidatorsRequest { - return { delegatorAddress: isSet(object.delegatorAddress) ? String(object.delegatorAddress) : "" }; + return { + delegatorAddress: isSet(object.delegatorAddress) + ? String(object.delegatorAddress) + : "", + } }, toJSON(message: QueryDelegatorValidatorsRequest): unknown { - const obj: any = {}; - message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); - return obj; + const obj: any = {} + message.delegatorAddress !== undefined && + (obj.delegatorAddress = message.delegatorAddress) + return obj }, fromPartial, I>>( object: I, ): QueryDelegatorValidatorsRequest { - const message = createBaseQueryDelegatorValidatorsRequest(); - message.delegatorAddress = object.delegatorAddress ?? ""; - return message; + const message = createBaseQueryDelegatorValidatorsRequest() + message.delegatorAddress = object.delegatorAddress ?? "" + return message }, -}; +} function createBaseQueryDelegatorValidatorsResponse(): QueryDelegatorValidatorsResponse { - return { validators: [] }; + return { validators: [] } } export const QueryDelegatorValidatorsResponse = { - encode(message: QueryDelegatorValidatorsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryDelegatorValidatorsResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { for (const v of message.validators) { - writer.uint32(10).string(v!); + writer.uint32(10).string(v!) } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegatorValidatorsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryDelegatorValidatorsResponse(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryDelegatorValidatorsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryDelegatorValidatorsResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.validators.push(reader.string()); - break; + message.validators.push(reader.string()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryDelegatorValidatorsResponse { - return { validators: Array.isArray(object?.validators) ? object.validators.map((e: any) => String(e)) : [] }; + return { + validators: Array.isArray(object?.validators) + ? object.validators.map((e: any) => String(e)) + : [], + } }, toJSON(message: QueryDelegatorValidatorsResponse): unknown { - const obj: any = {}; + const obj: any = {} if (message.validators) { - obj.validators = message.validators.map((e) => e); + obj.validators = message.validators.map((e) => e) } else { - obj.validators = []; + obj.validators = [] } - return obj; + return obj }, fromPartial, I>>( object: I, ): QueryDelegatorValidatorsResponse { - const message = createBaseQueryDelegatorValidatorsResponse(); - message.validators = object.validators?.map((e) => e) || []; - return message; + const message = createBaseQueryDelegatorValidatorsResponse() + message.validators = object.validators?.map((e) => e) || [] + return message }, -}; +} function createBaseQueryDelegatorWithdrawAddressRequest(): QueryDelegatorWithdrawAddressRequest { - return { delegatorAddress: "" }; + return { delegatorAddress: "" } } export const QueryDelegatorWithdrawAddressRequest = { - encode(message: QueryDelegatorWithdrawAddressRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryDelegatorWithdrawAddressRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.delegatorAddress !== "") { - writer.uint32(10).string(message.delegatorAddress); + writer.uint32(10).string(message.delegatorAddress) } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegatorWithdrawAddressRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryDelegatorWithdrawAddressRequest(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryDelegatorWithdrawAddressRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryDelegatorWithdrawAddressRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.delegatorAddress = reader.string(); - break; + message.delegatorAddress = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryDelegatorWithdrawAddressRequest { - return { delegatorAddress: isSet(object.delegatorAddress) ? String(object.delegatorAddress) : "" }; + return { + delegatorAddress: isSet(object.delegatorAddress) + ? String(object.delegatorAddress) + : "", + } }, toJSON(message: QueryDelegatorWithdrawAddressRequest): unknown { - const obj: any = {}; - message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); - return obj; + const obj: any = {} + message.delegatorAddress !== undefined && + (obj.delegatorAddress = message.delegatorAddress) + return obj }, fromPartial, I>>( object: I, ): QueryDelegatorWithdrawAddressRequest { - const message = createBaseQueryDelegatorWithdrawAddressRequest(); - message.delegatorAddress = object.delegatorAddress ?? ""; - return message; + const message = createBaseQueryDelegatorWithdrawAddressRequest() + message.delegatorAddress = object.delegatorAddress ?? "" + return message }, -}; +} function createBaseQueryDelegatorWithdrawAddressResponse(): QueryDelegatorWithdrawAddressResponse { - return { withdrawAddress: "" }; + return { withdrawAddress: "" } } export const QueryDelegatorWithdrawAddressResponse = { - encode(message: QueryDelegatorWithdrawAddressResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryDelegatorWithdrawAddressResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.withdrawAddress !== "") { - writer.uint32(10).string(message.withdrawAddress); + writer.uint32(10).string(message.withdrawAddress) } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegatorWithdrawAddressResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryDelegatorWithdrawAddressResponse(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryDelegatorWithdrawAddressResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryDelegatorWithdrawAddressResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.withdrawAddress = reader.string(); - break; + message.withdrawAddress = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryDelegatorWithdrawAddressResponse { - return { withdrawAddress: isSet(object.withdrawAddress) ? String(object.withdrawAddress) : "" }; + return { + withdrawAddress: isSet(object.withdrawAddress) + ? String(object.withdrawAddress) + : "", + } }, toJSON(message: QueryDelegatorWithdrawAddressResponse): unknown { - const obj: any = {}; - message.withdrawAddress !== undefined && (obj.withdrawAddress = message.withdrawAddress); - return obj; + const obj: any = {} + message.withdrawAddress !== undefined && + (obj.withdrawAddress = message.withdrawAddress) + return obj }, fromPartial, I>>( object: I, ): QueryDelegatorWithdrawAddressResponse { - const message = createBaseQueryDelegatorWithdrawAddressResponse(); - message.withdrawAddress = object.withdrawAddress ?? ""; - return message; + const message = createBaseQueryDelegatorWithdrawAddressResponse() + message.withdrawAddress = object.withdrawAddress ?? "" + return message }, -}; +} function createBaseQueryCommunityPoolRequest(): QueryCommunityPoolRequest { - return {}; + return {} } export const QueryCommunityPoolRequest = { - encode(_: QueryCommunityPoolRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; + encode( + _: QueryCommunityPoolRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryCommunityPoolRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryCommunityPoolRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryCommunityPoolRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(_: any): QueryCommunityPoolRequest { - return {}; + return {} }, toJSON(_: QueryCommunityPoolRequest): unknown { - const obj: any = {}; - return obj; + const obj: any = {} + return obj }, - fromPartial, I>>(_: I): QueryCommunityPoolRequest { - const message = createBaseQueryCommunityPoolRequest(); - return message; + fromPartial, I>>( + _: I, + ): QueryCommunityPoolRequest { + const message = createBaseQueryCommunityPoolRequest() + return message }, -}; +} function createBaseQueryCommunityPoolResponse(): QueryCommunityPoolResponse { - return { pool: [] }; + return { pool: [] } } export const QueryCommunityPoolResponse = { - encode(message: QueryCommunityPoolResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryCommunityPoolResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { for (const v of message.pool) { - DecCoin.encode(v!, writer.uint32(10).fork()).ldelim(); + DecCoin.encode(v!, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryCommunityPoolResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryCommunityPoolResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryCommunityPoolResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.pool.push(DecCoin.decode(reader, reader.uint32())); - break; + message.pool.push(DecCoin.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryCommunityPoolResponse { - return { pool: Array.isArray(object?.pool) ? object.pool.map((e: any) => DecCoin.fromJSON(e)) : [] }; + return { + pool: Array.isArray(object?.pool) + ? object.pool.map((e: any) => DecCoin.fromJSON(e)) + : [], + } }, toJSON(message: QueryCommunityPoolResponse): unknown { - const obj: any = {}; + const obj: any = {} if (message.pool) { - obj.pool = message.pool.map((e) => e ? DecCoin.toJSON(e) : undefined); + obj.pool = message.pool.map((e) => (e ? DecCoin.toJSON(e) : undefined)) } else { - obj.pool = []; + obj.pool = [] } - return obj; + return obj }, - fromPartial, I>>(object: I): QueryCommunityPoolResponse { - const message = createBaseQueryCommunityPoolResponse(); - message.pool = object.pool?.map((e) => DecCoin.fromPartial(e)) || []; - return message; + fromPartial, I>>( + object: I, + ): QueryCommunityPoolResponse { + const message = createBaseQueryCommunityPoolResponse() + message.pool = object.pool?.map((e) => DecCoin.fromPartial(e)) || [] + return message }, -}; +} /** Query defines the gRPC querier service for distribution module. */ export interface Query { /** Params queries params of the distribution module. */ - Params(request: QueryParamsRequest): Promise; + Params(request: QueryParamsRequest): Promise /** ValidatorOutstandingRewards queries rewards of a validator address. */ ValidatorOutstandingRewards( request: QueryValidatorOutstandingRewardsRequest, - ): Promise; + ): Promise /** ValidatorCommission queries accumulated commission for a validator. */ - ValidatorCommission(request: QueryValidatorCommissionRequest): Promise; + ValidatorCommission( + request: QueryValidatorCommissionRequest, + ): Promise /** ValidatorSlashes queries slash events of a validator. */ - ValidatorSlashes(request: QueryValidatorSlashesRequest): Promise; + ValidatorSlashes( + request: QueryValidatorSlashesRequest, + ): Promise /** DelegationRewards queries the total rewards accrued by a delegation. */ - DelegationRewards(request: QueryDelegationRewardsRequest): Promise; + DelegationRewards( + request: QueryDelegationRewardsRequest, + ): Promise /** * DelegationTotalRewards queries the total rewards accrued by a each * validator. */ - DelegationTotalRewards(request: QueryDelegationTotalRewardsRequest): Promise; + DelegationTotalRewards( + request: QueryDelegationTotalRewardsRequest, + ): Promise /** DelegatorValidators queries the validators of a delegator. */ - DelegatorValidators(request: QueryDelegatorValidatorsRequest): Promise; + DelegatorValidators( + request: QueryDelegatorValidatorsRequest, + ): Promise /** DelegatorWithdrawAddress queries withdraw address of a delegator. */ DelegatorWithdrawAddress( request: QueryDelegatorWithdrawAddressRequest, - ): Promise; + ): Promise /** CommunityPool queries the community pool coins. */ - CommunityPool(request: QueryCommunityPoolRequest): Promise; + CommunityPool(request: QueryCommunityPoolRequest): Promise } export class QueryClientImpl implements Query { - private readonly rpc: Rpc; + private readonly rpc: Rpc constructor(rpc: Rpc) { - this.rpc = rpc; - this.Params = this.Params.bind(this); - this.ValidatorOutstandingRewards = this.ValidatorOutstandingRewards.bind(this); - this.ValidatorCommission = this.ValidatorCommission.bind(this); - this.ValidatorSlashes = this.ValidatorSlashes.bind(this); - this.DelegationRewards = this.DelegationRewards.bind(this); - this.DelegationTotalRewards = this.DelegationTotalRewards.bind(this); - this.DelegatorValidators = this.DelegatorValidators.bind(this); - this.DelegatorWithdrawAddress = this.DelegatorWithdrawAddress.bind(this); - this.CommunityPool = this.CommunityPool.bind(this); + this.rpc = rpc + this.Params = this.Params.bind(this) + this.ValidatorOutstandingRewards = this.ValidatorOutstandingRewards.bind(this) + this.ValidatorCommission = this.ValidatorCommission.bind(this) + this.ValidatorSlashes = this.ValidatorSlashes.bind(this) + this.DelegationRewards = this.DelegationRewards.bind(this) + this.DelegationTotalRewards = this.DelegationTotalRewards.bind(this) + this.DelegatorValidators = this.DelegatorValidators.bind(this) + this.DelegatorWithdrawAddress = this.DelegatorWithdrawAddress.bind(this) + this.CommunityPool = this.CommunityPool.bind(this) } Params(request: QueryParamsRequest): Promise { - const data = QueryParamsRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.distribution.v1beta1.Query", "Params", data); - return promise.then((data) => QueryParamsResponse.decode(new _m0.Reader(data))); + const data = QueryParamsRequest.encode(request).finish() + const promise = this.rpc.request( + "cosmos.distribution.v1beta1.Query", + "Params", + data, + ) + return promise.then((data) => QueryParamsResponse.decode(new _m0.Reader(data))) } ValidatorOutstandingRewards( request: QueryValidatorOutstandingRewardsRequest, ): Promise { - const data = QueryValidatorOutstandingRewardsRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.distribution.v1beta1.Query", "ValidatorOutstandingRewards", data); - return promise.then((data) => QueryValidatorOutstandingRewardsResponse.decode(new _m0.Reader(data))); + const data = QueryValidatorOutstandingRewardsRequest.encode(request).finish() + const promise = this.rpc.request( + "cosmos.distribution.v1beta1.Query", + "ValidatorOutstandingRewards", + data, + ) + return promise.then((data) => + QueryValidatorOutstandingRewardsResponse.decode(new _m0.Reader(data)), + ) } - ValidatorCommission(request: QueryValidatorCommissionRequest): Promise { - const data = QueryValidatorCommissionRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.distribution.v1beta1.Query", "ValidatorCommission", data); - return promise.then((data) => QueryValidatorCommissionResponse.decode(new _m0.Reader(data))); + ValidatorCommission( + request: QueryValidatorCommissionRequest, + ): Promise { + const data = QueryValidatorCommissionRequest.encode(request).finish() + const promise = this.rpc.request( + "cosmos.distribution.v1beta1.Query", + "ValidatorCommission", + data, + ) + return promise.then((data) => + QueryValidatorCommissionResponse.decode(new _m0.Reader(data)), + ) } - ValidatorSlashes(request: QueryValidatorSlashesRequest): Promise { - const data = QueryValidatorSlashesRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.distribution.v1beta1.Query", "ValidatorSlashes", data); - return promise.then((data) => QueryValidatorSlashesResponse.decode(new _m0.Reader(data))); + ValidatorSlashes( + request: QueryValidatorSlashesRequest, + ): Promise { + const data = QueryValidatorSlashesRequest.encode(request).finish() + const promise = this.rpc.request( + "cosmos.distribution.v1beta1.Query", + "ValidatorSlashes", + data, + ) + return promise.then((data) => + QueryValidatorSlashesResponse.decode(new _m0.Reader(data)), + ) } - DelegationRewards(request: QueryDelegationRewardsRequest): Promise { - const data = QueryDelegationRewardsRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.distribution.v1beta1.Query", "DelegationRewards", data); - return promise.then((data) => QueryDelegationRewardsResponse.decode(new _m0.Reader(data))); + DelegationRewards( + request: QueryDelegationRewardsRequest, + ): Promise { + const data = QueryDelegationRewardsRequest.encode(request).finish() + const promise = this.rpc.request( + "cosmos.distribution.v1beta1.Query", + "DelegationRewards", + data, + ) + return promise.then((data) => + QueryDelegationRewardsResponse.decode(new _m0.Reader(data)), + ) } - DelegationTotalRewards(request: QueryDelegationTotalRewardsRequest): Promise { - const data = QueryDelegationTotalRewardsRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.distribution.v1beta1.Query", "DelegationTotalRewards", data); - return promise.then((data) => QueryDelegationTotalRewardsResponse.decode(new _m0.Reader(data))); + DelegationTotalRewards( + request: QueryDelegationTotalRewardsRequest, + ): Promise { + const data = QueryDelegationTotalRewardsRequest.encode(request).finish() + const promise = this.rpc.request( + "cosmos.distribution.v1beta1.Query", + "DelegationTotalRewards", + data, + ) + return promise.then((data) => + QueryDelegationTotalRewardsResponse.decode(new _m0.Reader(data)), + ) } - DelegatorValidators(request: QueryDelegatorValidatorsRequest): Promise { - const data = QueryDelegatorValidatorsRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.distribution.v1beta1.Query", "DelegatorValidators", data); - return promise.then((data) => QueryDelegatorValidatorsResponse.decode(new _m0.Reader(data))); + DelegatorValidators( + request: QueryDelegatorValidatorsRequest, + ): Promise { + const data = QueryDelegatorValidatorsRequest.encode(request).finish() + const promise = this.rpc.request( + "cosmos.distribution.v1beta1.Query", + "DelegatorValidators", + data, + ) + return promise.then((data) => + QueryDelegatorValidatorsResponse.decode(new _m0.Reader(data)), + ) } DelegatorWithdrawAddress( request: QueryDelegatorWithdrawAddressRequest, ): Promise { - const data = QueryDelegatorWithdrawAddressRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.distribution.v1beta1.Query", "DelegatorWithdrawAddress", data); - return promise.then((data) => QueryDelegatorWithdrawAddressResponse.decode(new _m0.Reader(data))); + const data = QueryDelegatorWithdrawAddressRequest.encode(request).finish() + const promise = this.rpc.request( + "cosmos.distribution.v1beta1.Query", + "DelegatorWithdrawAddress", + data, + ) + return promise.then((data) => + QueryDelegatorWithdrawAddressResponse.decode(new _m0.Reader(data)), + ) } - CommunityPool(request: QueryCommunityPoolRequest): Promise { - const data = QueryCommunityPoolRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.distribution.v1beta1.Query", "CommunityPool", data); - return promise.then((data) => QueryCommunityPoolResponse.decode(new _m0.Reader(data))); + CommunityPool( + request: QueryCommunityPoolRequest, + ): Promise { + const data = QueryCommunityPoolRequest.encode(request).finish() + const promise = this.rpc.request( + "cosmos.distribution.v1beta1.Query", + "CommunityPool", + data, + ) + return promise.then((data) => + QueryCommunityPoolResponse.decode(new _m0.Reader(data)), + ) } } interface Rpc { - request(service: string, method: string, data: Uint8Array): Promise; + request(service: string, method: string, data: Uint8Array): Promise } -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/cosmos/distribution/v1beta1/tx.ts b/packages/protojs/src/cosmos/distribution/v1beta1/tx.ts index 3d92a1ac..4678f9c7 100644 --- a/packages/protojs/src/cosmos/distribution/v1beta1/tx.ts +++ b/packages/protojs/src/cosmos/distribution/v1beta1/tx.ts @@ -1,447 +1,511 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { Coin } from "../../base/v1beta1/coin"; +import Long from "long" +import { Coin } from "../../base/v1beta1/coin" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "cosmos.distribution.v1beta1"; +export const protobufPackage = "cosmos.distribution.v1beta1" /** * MsgSetWithdrawAddress sets the withdraw address for * a delegator (or validator self-delegation). */ export interface MsgSetWithdrawAddress { - delegatorAddress: string; - withdrawAddress: string; + delegatorAddress: string + withdrawAddress: string } /** MsgSetWithdrawAddressResponse defines the Msg/SetWithdrawAddress response type. */ -export interface MsgSetWithdrawAddressResponse { -} +export interface MsgSetWithdrawAddressResponse {} /** * MsgWithdrawDelegatorReward represents delegation withdrawal to a delegator * from a single validator. */ export interface MsgWithdrawDelegatorReward { - delegatorAddress: string; - validatorAddress: string; + delegatorAddress: string + validatorAddress: string } /** MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward response type. */ -export interface MsgWithdrawDelegatorRewardResponse { -} +export interface MsgWithdrawDelegatorRewardResponse {} /** * MsgWithdrawValidatorCommission withdraws the full commission to the validator * address. */ export interface MsgWithdrawValidatorCommission { - validatorAddress: string; + validatorAddress: string } /** MsgWithdrawValidatorCommissionResponse defines the Msg/WithdrawValidatorCommission response type. */ -export interface MsgWithdrawValidatorCommissionResponse { -} +export interface MsgWithdrawValidatorCommissionResponse {} /** * MsgFundCommunityPool allows an account to directly * fund the community pool. */ export interface MsgFundCommunityPool { - amount: Coin[]; - depositor: string; + amount: Coin[] + depositor: string } /** MsgFundCommunityPoolResponse defines the Msg/FundCommunityPool response type. */ -export interface MsgFundCommunityPoolResponse { -} +export interface MsgFundCommunityPoolResponse {} function createBaseMsgSetWithdrawAddress(): MsgSetWithdrawAddress { - return { delegatorAddress: "", withdrawAddress: "" }; + return { delegatorAddress: "", withdrawAddress: "" } } export const MsgSetWithdrawAddress = { - encode(message: MsgSetWithdrawAddress, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: MsgSetWithdrawAddress, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.delegatorAddress !== "") { - writer.uint32(10).string(message.delegatorAddress); + writer.uint32(10).string(message.delegatorAddress) } if (message.withdrawAddress !== "") { - writer.uint32(18).string(message.withdrawAddress); + writer.uint32(18).string(message.withdrawAddress) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MsgSetWithdrawAddress { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgSetWithdrawAddress(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgSetWithdrawAddress() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.delegatorAddress = reader.string(); - break; + message.delegatorAddress = reader.string() + break case 2: - message.withdrawAddress = reader.string(); - break; + message.withdrawAddress = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): MsgSetWithdrawAddress { return { - delegatorAddress: isSet(object.delegatorAddress) ? String(object.delegatorAddress) : "", - withdrawAddress: isSet(object.withdrawAddress) ? String(object.withdrawAddress) : "", - }; + delegatorAddress: isSet(object.delegatorAddress) + ? String(object.delegatorAddress) + : "", + withdrawAddress: isSet(object.withdrawAddress) + ? String(object.withdrawAddress) + : "", + } }, toJSON(message: MsgSetWithdrawAddress): unknown { - const obj: any = {}; - message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); - message.withdrawAddress !== undefined && (obj.withdrawAddress = message.withdrawAddress); - return obj; + const obj: any = {} + message.delegatorAddress !== undefined && + (obj.delegatorAddress = message.delegatorAddress) + message.withdrawAddress !== undefined && + (obj.withdrawAddress = message.withdrawAddress) + return obj }, - fromPartial, I>>(object: I): MsgSetWithdrawAddress { - const message = createBaseMsgSetWithdrawAddress(); - message.delegatorAddress = object.delegatorAddress ?? ""; - message.withdrawAddress = object.withdrawAddress ?? ""; - return message; + fromPartial, I>>( + object: I, + ): MsgSetWithdrawAddress { + const message = createBaseMsgSetWithdrawAddress() + message.delegatorAddress = object.delegatorAddress ?? "" + message.withdrawAddress = object.withdrawAddress ?? "" + return message }, -}; +} function createBaseMsgSetWithdrawAddressResponse(): MsgSetWithdrawAddressResponse { - return {}; + return {} } export const MsgSetWithdrawAddressResponse = { - encode(_: MsgSetWithdrawAddressResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): MsgSetWithdrawAddressResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgSetWithdrawAddressResponse(); + encode( + _: MsgSetWithdrawAddressResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgSetWithdrawAddressResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgSetWithdrawAddressResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(_: any): MsgSetWithdrawAddressResponse { - return {}; + return {} }, toJSON(_: MsgSetWithdrawAddressResponse): unknown { - const obj: any = {}; - return obj; + const obj: any = {} + return obj }, - fromPartial, I>>(_: I): MsgSetWithdrawAddressResponse { - const message = createBaseMsgSetWithdrawAddressResponse(); - return message; + fromPartial, I>>( + _: I, + ): MsgSetWithdrawAddressResponse { + const message = createBaseMsgSetWithdrawAddressResponse() + return message }, -}; +} function createBaseMsgWithdrawDelegatorReward(): MsgWithdrawDelegatorReward { - return { delegatorAddress: "", validatorAddress: "" }; + return { delegatorAddress: "", validatorAddress: "" } } export const MsgWithdrawDelegatorReward = { - encode(message: MsgWithdrawDelegatorReward, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: MsgWithdrawDelegatorReward, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.delegatorAddress !== "") { - writer.uint32(10).string(message.delegatorAddress); + writer.uint32(10).string(message.delegatorAddress) } if (message.validatorAddress !== "") { - writer.uint32(18).string(message.validatorAddress); + writer.uint32(18).string(message.validatorAddress) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MsgWithdrawDelegatorReward { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgWithdrawDelegatorReward(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgWithdrawDelegatorReward() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.delegatorAddress = reader.string(); - break; + message.delegatorAddress = reader.string() + break case 2: - message.validatorAddress = reader.string(); - break; + message.validatorAddress = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): MsgWithdrawDelegatorReward { return { - delegatorAddress: isSet(object.delegatorAddress) ? String(object.delegatorAddress) : "", - validatorAddress: isSet(object.validatorAddress) ? String(object.validatorAddress) : "", - }; + delegatorAddress: isSet(object.delegatorAddress) + ? String(object.delegatorAddress) + : "", + validatorAddress: isSet(object.validatorAddress) + ? String(object.validatorAddress) + : "", + } }, toJSON(message: MsgWithdrawDelegatorReward): unknown { - const obj: any = {}; - message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); - message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); - return obj; + const obj: any = {} + message.delegatorAddress !== undefined && + (obj.delegatorAddress = message.delegatorAddress) + message.validatorAddress !== undefined && + (obj.validatorAddress = message.validatorAddress) + return obj }, - fromPartial, I>>(object: I): MsgWithdrawDelegatorReward { - const message = createBaseMsgWithdrawDelegatorReward(); - message.delegatorAddress = object.delegatorAddress ?? ""; - message.validatorAddress = object.validatorAddress ?? ""; - return message; + fromPartial, I>>( + object: I, + ): MsgWithdrawDelegatorReward { + const message = createBaseMsgWithdrawDelegatorReward() + message.delegatorAddress = object.delegatorAddress ?? "" + message.validatorAddress = object.validatorAddress ?? "" + return message }, -}; +} function createBaseMsgWithdrawDelegatorRewardResponse(): MsgWithdrawDelegatorRewardResponse { - return {}; + return {} } export const MsgWithdrawDelegatorRewardResponse = { - encode(_: MsgWithdrawDelegatorRewardResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; + encode( + _: MsgWithdrawDelegatorRewardResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgWithdrawDelegatorRewardResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgWithdrawDelegatorRewardResponse(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgWithdrawDelegatorRewardResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgWithdrawDelegatorRewardResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(_: any): MsgWithdrawDelegatorRewardResponse { - return {}; + return {} }, toJSON(_: MsgWithdrawDelegatorRewardResponse): unknown { - const obj: any = {}; - return obj; + const obj: any = {} + return obj }, fromPartial, I>>( _: I, ): MsgWithdrawDelegatorRewardResponse { - const message = createBaseMsgWithdrawDelegatorRewardResponse(); - return message; + const message = createBaseMsgWithdrawDelegatorRewardResponse() + return message }, -}; +} function createBaseMsgWithdrawValidatorCommission(): MsgWithdrawValidatorCommission { - return { validatorAddress: "" }; + return { validatorAddress: "" } } export const MsgWithdrawValidatorCommission = { - encode(message: MsgWithdrawValidatorCommission, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: MsgWithdrawValidatorCommission, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.validatorAddress !== "") { - writer.uint32(10).string(message.validatorAddress); + writer.uint32(10).string(message.validatorAddress) } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgWithdrawValidatorCommission { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgWithdrawValidatorCommission(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgWithdrawValidatorCommission { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgWithdrawValidatorCommission() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.validatorAddress = reader.string(); - break; + message.validatorAddress = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): MsgWithdrawValidatorCommission { - return { validatorAddress: isSet(object.validatorAddress) ? String(object.validatorAddress) : "" }; + return { + validatorAddress: isSet(object.validatorAddress) + ? String(object.validatorAddress) + : "", + } }, toJSON(message: MsgWithdrawValidatorCommission): unknown { - const obj: any = {}; - message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); - return obj; + const obj: any = {} + message.validatorAddress !== undefined && + (obj.validatorAddress = message.validatorAddress) + return obj }, fromPartial, I>>( object: I, ): MsgWithdrawValidatorCommission { - const message = createBaseMsgWithdrawValidatorCommission(); - message.validatorAddress = object.validatorAddress ?? ""; - return message; + const message = createBaseMsgWithdrawValidatorCommission() + message.validatorAddress = object.validatorAddress ?? "" + return message }, -}; +} function createBaseMsgWithdrawValidatorCommissionResponse(): MsgWithdrawValidatorCommissionResponse { - return {}; + return {} } export const MsgWithdrawValidatorCommissionResponse = { - encode(_: MsgWithdrawValidatorCommissionResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; + encode( + _: MsgWithdrawValidatorCommissionResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgWithdrawValidatorCommissionResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgWithdrawValidatorCommissionResponse(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgWithdrawValidatorCommissionResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgWithdrawValidatorCommissionResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(_: any): MsgWithdrawValidatorCommissionResponse { - return {}; + return {} }, toJSON(_: MsgWithdrawValidatorCommissionResponse): unknown { - const obj: any = {}; - return obj; + const obj: any = {} + return obj }, fromPartial, I>>( _: I, ): MsgWithdrawValidatorCommissionResponse { - const message = createBaseMsgWithdrawValidatorCommissionResponse(); - return message; + const message = createBaseMsgWithdrawValidatorCommissionResponse() + return message }, -}; +} function createBaseMsgFundCommunityPool(): MsgFundCommunityPool { - return { amount: [], depositor: "" }; + return { amount: [], depositor: "" } } export const MsgFundCommunityPool = { - encode(message: MsgFundCommunityPool, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: MsgFundCommunityPool, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { for (const v of message.amount) { - Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + Coin.encode(v!, writer.uint32(10).fork()).ldelim() } if (message.depositor !== "") { - writer.uint32(18).string(message.depositor); + writer.uint32(18).string(message.depositor) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MsgFundCommunityPool { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgFundCommunityPool(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgFundCommunityPool() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.amount.push(Coin.decode(reader, reader.uint32())); - break; + message.amount.push(Coin.decode(reader, reader.uint32())) + break case 2: - message.depositor = reader.string(); - break; + message.depositor = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): MsgFundCommunityPool { return { - amount: Array.isArray(object?.amount) ? object.amount.map((e: any) => Coin.fromJSON(e)) : [], + amount: Array.isArray(object?.amount) + ? object.amount.map((e: any) => Coin.fromJSON(e)) + : [], depositor: isSet(object.depositor) ? String(object.depositor) : "", - }; + } }, toJSON(message: MsgFundCommunityPool): unknown { - const obj: any = {}; + const obj: any = {} if (message.amount) { - obj.amount = message.amount.map((e) => e ? Coin.toJSON(e) : undefined); + obj.amount = message.amount.map((e) => (e ? Coin.toJSON(e) : undefined)) } else { - obj.amount = []; + obj.amount = [] } - message.depositor !== undefined && (obj.depositor = message.depositor); - return obj; + message.depositor !== undefined && (obj.depositor = message.depositor) + return obj }, - fromPartial, I>>(object: I): MsgFundCommunityPool { - const message = createBaseMsgFundCommunityPool(); - message.amount = object.amount?.map((e) => Coin.fromPartial(e)) || []; - message.depositor = object.depositor ?? ""; - return message; + fromPartial, I>>( + object: I, + ): MsgFundCommunityPool { + const message = createBaseMsgFundCommunityPool() + message.amount = object.amount?.map((e) => Coin.fromPartial(e)) || [] + message.depositor = object.depositor ?? "" + return message }, -}; +} function createBaseMsgFundCommunityPoolResponse(): MsgFundCommunityPoolResponse { - return {}; + return {} } export const MsgFundCommunityPoolResponse = { - encode(_: MsgFundCommunityPoolResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): MsgFundCommunityPoolResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgFundCommunityPoolResponse(); + encode( + _: MsgFundCommunityPoolResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgFundCommunityPoolResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgFundCommunityPoolResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(_: any): MsgFundCommunityPoolResponse { - return {}; + return {} }, toJSON(_: MsgFundCommunityPoolResponse): unknown { - const obj: any = {}; - return obj; + const obj: any = {} + return obj }, - fromPartial, I>>(_: I): MsgFundCommunityPoolResponse { - const message = createBaseMsgFundCommunityPoolResponse(); - return message; + fromPartial, I>>( + _: I, + ): MsgFundCommunityPoolResponse { + const message = createBaseMsgFundCommunityPoolResponse() + return message }, -}; +} /** Msg defines the distribution Msg service. */ export interface Msg { @@ -449,81 +513,129 @@ export interface Msg { * SetWithdrawAddress defines a method to change the withdraw address * for a delegator (or validator self-delegation). */ - SetWithdrawAddress(request: MsgSetWithdrawAddress): Promise; + SetWithdrawAddress( + request: MsgSetWithdrawAddress, + ): Promise /** * WithdrawDelegatorReward defines a method to withdraw rewards of delegator * from a single validator. */ - WithdrawDelegatorReward(request: MsgWithdrawDelegatorReward): Promise; + WithdrawDelegatorReward( + request: MsgWithdrawDelegatorReward, + ): Promise /** * WithdrawValidatorCommission defines a method to withdraw the * full commission to the validator address. */ - WithdrawValidatorCommission(request: MsgWithdrawValidatorCommission): Promise; + WithdrawValidatorCommission( + request: MsgWithdrawValidatorCommission, + ): Promise /** * FundCommunityPool defines a method to allow an account to directly * fund the community pool. */ - FundCommunityPool(request: MsgFundCommunityPool): Promise; + FundCommunityPool( + request: MsgFundCommunityPool, + ): Promise } export class MsgClientImpl implements Msg { - private readonly rpc: Rpc; + private readonly rpc: Rpc constructor(rpc: Rpc) { - this.rpc = rpc; - this.SetWithdrawAddress = this.SetWithdrawAddress.bind(this); - this.WithdrawDelegatorReward = this.WithdrawDelegatorReward.bind(this); - this.WithdrawValidatorCommission = this.WithdrawValidatorCommission.bind(this); - this.FundCommunityPool = this.FundCommunityPool.bind(this); + this.rpc = rpc + this.SetWithdrawAddress = this.SetWithdrawAddress.bind(this) + this.WithdrawDelegatorReward = this.WithdrawDelegatorReward.bind(this) + this.WithdrawValidatorCommission = this.WithdrawValidatorCommission.bind(this) + this.FundCommunityPool = this.FundCommunityPool.bind(this) } - SetWithdrawAddress(request: MsgSetWithdrawAddress): Promise { - const data = MsgSetWithdrawAddress.encode(request).finish(); - const promise = this.rpc.request("cosmos.distribution.v1beta1.Msg", "SetWithdrawAddress", data); - return promise.then((data) => MsgSetWithdrawAddressResponse.decode(new _m0.Reader(data))); + SetWithdrawAddress( + request: MsgSetWithdrawAddress, + ): Promise { + const data = MsgSetWithdrawAddress.encode(request).finish() + const promise = this.rpc.request( + "cosmos.distribution.v1beta1.Msg", + "SetWithdrawAddress", + data, + ) + return promise.then((data) => + MsgSetWithdrawAddressResponse.decode(new _m0.Reader(data)), + ) } - WithdrawDelegatorReward(request: MsgWithdrawDelegatorReward): Promise { - const data = MsgWithdrawDelegatorReward.encode(request).finish(); - const promise = this.rpc.request("cosmos.distribution.v1beta1.Msg", "WithdrawDelegatorReward", data); - return promise.then((data) => MsgWithdrawDelegatorRewardResponse.decode(new _m0.Reader(data))); + WithdrawDelegatorReward( + request: MsgWithdrawDelegatorReward, + ): Promise { + const data = MsgWithdrawDelegatorReward.encode(request).finish() + const promise = this.rpc.request( + "cosmos.distribution.v1beta1.Msg", + "WithdrawDelegatorReward", + data, + ) + return promise.then((data) => + MsgWithdrawDelegatorRewardResponse.decode(new _m0.Reader(data)), + ) } WithdrawValidatorCommission( request: MsgWithdrawValidatorCommission, ): Promise { - const data = MsgWithdrawValidatorCommission.encode(request).finish(); - const promise = this.rpc.request("cosmos.distribution.v1beta1.Msg", "WithdrawValidatorCommission", data); - return promise.then((data) => MsgWithdrawValidatorCommissionResponse.decode(new _m0.Reader(data))); + const data = MsgWithdrawValidatorCommission.encode(request).finish() + const promise = this.rpc.request( + "cosmos.distribution.v1beta1.Msg", + "WithdrawValidatorCommission", + data, + ) + return promise.then((data) => + MsgWithdrawValidatorCommissionResponse.decode(new _m0.Reader(data)), + ) } - FundCommunityPool(request: MsgFundCommunityPool): Promise { - const data = MsgFundCommunityPool.encode(request).finish(); - const promise = this.rpc.request("cosmos.distribution.v1beta1.Msg", "FundCommunityPool", data); - return promise.then((data) => MsgFundCommunityPoolResponse.decode(new _m0.Reader(data))); + FundCommunityPool( + request: MsgFundCommunityPool, + ): Promise { + const data = MsgFundCommunityPool.encode(request).finish() + const promise = this.rpc.request( + "cosmos.distribution.v1beta1.Msg", + "FundCommunityPool", + data, + ) + return promise.then((data) => + MsgFundCommunityPoolResponse.decode(new _m0.Reader(data)), + ) } } interface Rpc { - request(service: string, method: string, data: Uint8Array): Promise; + request(service: string, method: string, data: Uint8Array): Promise } -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/cosmos/evidence/v1beta1/evidence.ts b/packages/protojs/src/cosmos/evidence/v1beta1/evidence.ts index 2bf6ed60..b1437cfb 100644 --- a/packages/protojs/src/cosmos/evidence/v1beta1/evidence.ts +++ b/packages/protojs/src/cosmos/evidence/v1beta1/evidence.ts @@ -1,67 +1,67 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { Timestamp } from "../../../google/protobuf/timestamp"; +import { Timestamp } from "../../../google/protobuf/timestamp" +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "cosmos.evidence.v1beta1"; +export const protobufPackage = "cosmos.evidence.v1beta1" /** * Equivocation implements the Evidence interface and defines evidence of double * signing misbehavior. */ export interface Equivocation { - height: Long; - time?: Date; - power: Long; - consensusAddress: string; + height: Long + time?: Date + power: Long + consensusAddress: string } function createBaseEquivocation(): Equivocation { - return { height: Long.ZERO, time: undefined, power: Long.ZERO, consensusAddress: "" }; + return { height: Long.ZERO, time: undefined, power: Long.ZERO, consensusAddress: "" } } export const Equivocation = { encode(message: Equivocation, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (!message.height.isZero()) { - writer.uint32(8).int64(message.height); + writer.uint32(8).int64(message.height) } if (message.time !== undefined) { - Timestamp.encode(toTimestamp(message.time), writer.uint32(18).fork()).ldelim(); + Timestamp.encode(toTimestamp(message.time), writer.uint32(18).fork()).ldelim() } if (!message.power.isZero()) { - writer.uint32(24).int64(message.power); + writer.uint32(24).int64(message.power) } if (message.consensusAddress !== "") { - writer.uint32(34).string(message.consensusAddress); + writer.uint32(34).string(message.consensusAddress) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Equivocation { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseEquivocation(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseEquivocation() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.height = reader.int64() as Long; - break; + message.height = reader.int64() as Long + break case 2: - message.time = fromTimestamp(Timestamp.decode(reader, reader.uint32())); - break; + message.time = fromTimestamp(Timestamp.decode(reader, reader.uint32())) + break case 3: - message.power = reader.int64() as Long; - break; + message.power = reader.int64() as Long + break case 4: - message.consensusAddress = reader.string(); - break; + message.consensusAddress = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Equivocation { @@ -69,74 +69,92 @@ export const Equivocation = { height: isSet(object.height) ? Long.fromValue(object.height) : Long.ZERO, time: isSet(object.time) ? fromJsonTimestamp(object.time) : undefined, power: isSet(object.power) ? Long.fromValue(object.power) : Long.ZERO, - consensusAddress: isSet(object.consensusAddress) ? String(object.consensusAddress) : "", - }; + consensusAddress: isSet(object.consensusAddress) + ? String(object.consensusAddress) + : "", + } }, toJSON(message: Equivocation): unknown { - const obj: any = {}; - message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); - message.time !== undefined && (obj.time = message.time.toISOString()); - message.power !== undefined && (obj.power = (message.power || Long.ZERO).toString()); - message.consensusAddress !== undefined && (obj.consensusAddress = message.consensusAddress); - return obj; + const obj: any = {} + message.height !== undefined && + (obj.height = (message.height || Long.ZERO).toString()) + message.time !== undefined && (obj.time = message.time.toISOString()) + message.power !== undefined && (obj.power = (message.power || Long.ZERO).toString()) + message.consensusAddress !== undefined && + (obj.consensusAddress = message.consensusAddress) + return obj }, fromPartial, I>>(object: I): Equivocation { - const message = createBaseEquivocation(); - message.height = (object.height !== undefined && object.height !== null) - ? Long.fromValue(object.height) - : Long.ZERO; - message.time = object.time ?? undefined; - message.power = (object.power !== undefined && object.power !== null) ? Long.fromValue(object.power) : Long.ZERO; - message.consensusAddress = object.consensusAddress ?? ""; - return message; + const message = createBaseEquivocation() + message.height = + object.height !== undefined && object.height !== null + ? Long.fromValue(object.height) + : Long.ZERO + message.time = object.time ?? undefined + message.power = + object.power !== undefined && object.power !== null + ? Long.fromValue(object.power) + : Long.ZERO + message.consensusAddress = object.consensusAddress ?? "" + return message }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; +} -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > function toTimestamp(date: Date): Timestamp { - const seconds = numberToLong(date.getTime() / 1_000); - const nanos = (date.getTime() % 1_000) * 1_000_000; - return { seconds, nanos }; + const seconds = numberToLong(date.getTime() / 1_000) + const nanos = (date.getTime() % 1_000) * 1_000_000 + return { seconds, nanos } } function fromTimestamp(t: Timestamp): Date { - let millis = t.seconds.toNumber() * 1_000; - millis += t.nanos / 1_000_000; - return new Date(millis); + let millis = t.seconds.toNumber() * 1_000 + millis += t.nanos / 1_000_000 + return new Date(millis) } function fromJsonTimestamp(o: any): Date { if (o instanceof Date) { - return o; + return o } else if (typeof o === "string") { - return new Date(o); + return new Date(o) } else { - return fromTimestamp(Timestamp.fromJSON(o)); + return fromTimestamp(Timestamp.fromJSON(o)) } } function numberToLong(number: number) { - return Long.fromNumber(number); + return Long.fromNumber(number) } if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/cosmos/evidence/v1beta1/genesis.ts b/packages/protojs/src/cosmos/evidence/v1beta1/genesis.ts index 8e2dadf8..3b1782be 100644 --- a/packages/protojs/src/cosmos/evidence/v1beta1/genesis.ts +++ b/packages/protojs/src/cosmos/evidence/v1beta1/genesis.ts @@ -1,80 +1,94 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { Any } from "../../../google/protobuf/any"; +import Long from "long" +import { Any } from "../../../google/protobuf/any" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "cosmos.evidence.v1beta1"; +export const protobufPackage = "cosmos.evidence.v1beta1" /** GenesisState defines the evidence module's genesis state. */ export interface GenesisState { /** evidence defines all the evidence at genesis. */ - evidence: Any[]; + evidence: Any[] } function createBaseGenesisState(): GenesisState { - return { evidence: [] }; + return { evidence: [] } } export const GenesisState = { encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.evidence) { - Any.encode(v!, writer.uint32(10).fork()).ldelim(); + Any.encode(v!, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGenesisState(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseGenesisState() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.evidence.push(Any.decode(reader, reader.uint32())); - break; + message.evidence.push(Any.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): GenesisState { - return { evidence: Array.isArray(object?.evidence) ? object.evidence.map((e: any) => Any.fromJSON(e)) : [] }; + return { + evidence: Array.isArray(object?.evidence) + ? object.evidence.map((e: any) => Any.fromJSON(e)) + : [], + } }, toJSON(message: GenesisState): unknown { - const obj: any = {}; + const obj: any = {} if (message.evidence) { - obj.evidence = message.evidence.map((e) => e ? Any.toJSON(e) : undefined); + obj.evidence = message.evidence.map((e) => (e ? Any.toJSON(e) : undefined)) } else { - obj.evidence = []; + obj.evidence = [] } - return obj; + return obj }, fromPartial, I>>(object: I): GenesisState { - const message = createBaseGenesisState(); - message.evidence = object.evidence?.map((e) => Any.fromPartial(e)) || []; - return message; + const message = createBaseGenesisState() + message.evidence = object.evidence?.map((e) => Any.fromPartial(e)) || [] + return message }, -}; +} -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } diff --git a/packages/protojs/src/cosmos/evidence/v1beta1/query.ts b/packages/protojs/src/cosmos/evidence/v1beta1/query.ts index 12e36b6c..84b94120 100644 --- a/packages/protojs/src/cosmos/evidence/v1beta1/query.ts +++ b/packages/protojs/src/cosmos/evidence/v1beta1/query.ts @@ -1,21 +1,21 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { Any } from "../../../google/protobuf/any"; -import { PageRequest, PageResponse } from "../../base/query/v1beta1/pagination"; +import { Any } from "../../../google/protobuf/any" +import { PageRequest, PageResponse } from "../../base/query/v1beta1/pagination" +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "cosmos.evidence.v1beta1"; +export const protobufPackage = "cosmos.evidence.v1beta1" /** QueryEvidenceRequest is the request type for the Query/Evidence RPC method. */ export interface QueryEvidenceRequest { /** evidence_hash defines the hash of the requested evidence. */ - evidenceHash: Uint8Array; + evidenceHash: Uint8Array } /** QueryEvidenceResponse is the response type for the Query/Evidence RPC method. */ export interface QueryEvidenceResponse { /** evidence returns the requested evidence. */ - evidence?: Any; + evidence?: Any } /** @@ -24,7 +24,7 @@ export interface QueryEvidenceResponse { */ export interface QueryAllEvidenceRequest { /** pagination defines an optional pagination for the request. */ - pagination?: PageRequest; + pagination?: PageRequest } /** @@ -33,318 +33,362 @@ export interface QueryAllEvidenceRequest { */ export interface QueryAllEvidenceResponse { /** evidence returns all evidences. */ - evidence: Any[]; + evidence: Any[] /** pagination defines the pagination in the response. */ - pagination?: PageResponse; + pagination?: PageResponse } function createBaseQueryEvidenceRequest(): QueryEvidenceRequest { - return { evidenceHash: new Uint8Array() }; + return { evidenceHash: new Uint8Array() } } export const QueryEvidenceRequest = { - encode(message: QueryEvidenceRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryEvidenceRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.evidenceHash.length !== 0) { - writer.uint32(10).bytes(message.evidenceHash); + writer.uint32(10).bytes(message.evidenceHash) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryEvidenceRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryEvidenceRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryEvidenceRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.evidenceHash = reader.bytes(); - break; + message.evidenceHash = reader.bytes() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryEvidenceRequest { - return { evidenceHash: isSet(object.evidenceHash) ? bytesFromBase64(object.evidenceHash) : new Uint8Array() }; + return { + evidenceHash: isSet(object.evidenceHash) + ? bytesFromBase64(object.evidenceHash) + : new Uint8Array(), + } }, toJSON(message: QueryEvidenceRequest): unknown { - const obj: any = {}; + const obj: any = {} message.evidenceHash !== undefined && (obj.evidenceHash = base64FromBytes( message.evidenceHash !== undefined ? message.evidenceHash : new Uint8Array(), - )); - return obj; + )) + return obj }, - fromPartial, I>>(object: I): QueryEvidenceRequest { - const message = createBaseQueryEvidenceRequest(); - message.evidenceHash = object.evidenceHash ?? new Uint8Array(); - return message; + fromPartial, I>>( + object: I, + ): QueryEvidenceRequest { + const message = createBaseQueryEvidenceRequest() + message.evidenceHash = object.evidenceHash ?? new Uint8Array() + return message }, -}; +} function createBaseQueryEvidenceResponse(): QueryEvidenceResponse { - return { evidence: undefined }; + return { evidence: undefined } } export const QueryEvidenceResponse = { - encode(message: QueryEvidenceResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryEvidenceResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.evidence !== undefined) { - Any.encode(message.evidence, writer.uint32(10).fork()).ldelim(); + Any.encode(message.evidence, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryEvidenceResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryEvidenceResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryEvidenceResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.evidence = Any.decode(reader, reader.uint32()); - break; + message.evidence = Any.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryEvidenceResponse { - return { evidence: isSet(object.evidence) ? Any.fromJSON(object.evidence) : undefined }; + return { + evidence: isSet(object.evidence) ? Any.fromJSON(object.evidence) : undefined, + } }, toJSON(message: QueryEvidenceResponse): unknown { - const obj: any = {}; - message.evidence !== undefined && (obj.evidence = message.evidence ? Any.toJSON(message.evidence) : undefined); - return obj; + const obj: any = {} + message.evidence !== undefined && + (obj.evidence = message.evidence ? Any.toJSON(message.evidence) : undefined) + return obj }, - fromPartial, I>>(object: I): QueryEvidenceResponse { - const message = createBaseQueryEvidenceResponse(); - message.evidence = (object.evidence !== undefined && object.evidence !== null) - ? Any.fromPartial(object.evidence) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): QueryEvidenceResponse { + const message = createBaseQueryEvidenceResponse() + message.evidence = + object.evidence !== undefined && object.evidence !== null + ? Any.fromPartial(object.evidence) + : undefined + return message }, -}; +} function createBaseQueryAllEvidenceRequest(): QueryAllEvidenceRequest { - return { pagination: undefined }; + return { pagination: undefined } } export const QueryAllEvidenceRequest = { - encode(message: QueryAllEvidenceRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryAllEvidenceRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllEvidenceRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryAllEvidenceRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryAllEvidenceRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; + message.pagination = PageRequest.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryAllEvidenceRequest { - return { pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined }; + return { + pagination: isSet(object.pagination) + ? PageRequest.fromJSON(object.pagination) + : undefined, + } }, toJSON(message: QueryAllEvidenceRequest): unknown { - const obj: any = {}; + const obj: any = {} message.pagination !== undefined && - (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); - return obj; + (obj.pagination = message.pagination + ? PageRequest.toJSON(message.pagination) + : undefined) + return obj }, - fromPartial, I>>(object: I): QueryAllEvidenceRequest { - const message = createBaseQueryAllEvidenceRequest(); - message.pagination = (object.pagination !== undefined && object.pagination !== null) - ? PageRequest.fromPartial(object.pagination) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): QueryAllEvidenceRequest { + const message = createBaseQueryAllEvidenceRequest() + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageRequest.fromPartial(object.pagination) + : undefined + return message }, -}; +} function createBaseQueryAllEvidenceResponse(): QueryAllEvidenceResponse { - return { evidence: [], pagination: undefined }; + return { evidence: [], pagination: undefined } } export const QueryAllEvidenceResponse = { - encode(message: QueryAllEvidenceResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryAllEvidenceResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { for (const v of message.evidence) { - Any.encode(v!, writer.uint32(10).fork()).ldelim(); + Any.encode(v!, writer.uint32(10).fork()).ldelim() } if (message.pagination !== undefined) { - PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllEvidenceResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryAllEvidenceResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryAllEvidenceResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.evidence.push(Any.decode(reader, reader.uint32())); - break; + message.evidence.push(Any.decode(reader, reader.uint32())) + break case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; + message.pagination = PageResponse.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryAllEvidenceResponse { return { - evidence: Array.isArray(object?.evidence) ? object.evidence.map((e: any) => Any.fromJSON(e)) : [], - pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, - }; + evidence: Array.isArray(object?.evidence) + ? object.evidence.map((e: any) => Any.fromJSON(e)) + : [], + pagination: isSet(object.pagination) + ? PageResponse.fromJSON(object.pagination) + : undefined, + } }, toJSON(message: QueryAllEvidenceResponse): unknown { - const obj: any = {}; + const obj: any = {} if (message.evidence) { - obj.evidence = message.evidence.map((e) => e ? Any.toJSON(e) : undefined); + obj.evidence = message.evidence.map((e) => (e ? Any.toJSON(e) : undefined)) } else { - obj.evidence = []; + obj.evidence = [] } message.pagination !== undefined && - (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); - return obj; + (obj.pagination = message.pagination + ? PageResponse.toJSON(message.pagination) + : undefined) + return obj }, - fromPartial, I>>(object: I): QueryAllEvidenceResponse { - const message = createBaseQueryAllEvidenceResponse(); - message.evidence = object.evidence?.map((e) => Any.fromPartial(e)) || []; - message.pagination = (object.pagination !== undefined && object.pagination !== null) - ? PageResponse.fromPartial(object.pagination) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): QueryAllEvidenceResponse { + const message = createBaseQueryAllEvidenceResponse() + message.evidence = object.evidence?.map((e) => Any.fromPartial(e)) || [] + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageResponse.fromPartial(object.pagination) + : undefined + return message }, -}; +} /** Query defines the gRPC querier service. */ export interface Query { /** Evidence queries evidence based on evidence hash. */ - Evidence(request: QueryEvidenceRequest): Promise; + Evidence(request: QueryEvidenceRequest): Promise /** AllEvidence queries all evidence. */ - AllEvidence(request: QueryAllEvidenceRequest): Promise; + AllEvidence(request: QueryAllEvidenceRequest): Promise } export class QueryClientImpl implements Query { - private readonly rpc: Rpc; + private readonly rpc: Rpc constructor(rpc: Rpc) { - this.rpc = rpc; - this.Evidence = this.Evidence.bind(this); - this.AllEvidence = this.AllEvidence.bind(this); + this.rpc = rpc + this.Evidence = this.Evidence.bind(this) + this.AllEvidence = this.AllEvidence.bind(this) } Evidence(request: QueryEvidenceRequest): Promise { - const data = QueryEvidenceRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.evidence.v1beta1.Query", "Evidence", data); - return promise.then((data) => QueryEvidenceResponse.decode(new _m0.Reader(data))); + const data = QueryEvidenceRequest.encode(request).finish() + const promise = this.rpc.request("cosmos.evidence.v1beta1.Query", "Evidence", data) + return promise.then((data) => QueryEvidenceResponse.decode(new _m0.Reader(data))) } AllEvidence(request: QueryAllEvidenceRequest): Promise { - const data = QueryAllEvidenceRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.evidence.v1beta1.Query", "AllEvidence", data); - return promise.then((data) => QueryAllEvidenceResponse.decode(new _m0.Reader(data))); + const data = QueryAllEvidenceRequest.encode(request).finish() + const promise = this.rpc.request( + "cosmos.evidence.v1beta1.Query", + "AllEvidence", + data, + ) + return promise.then((data) => QueryAllEvidenceResponse.decode(new _m0.Reader(data))) } } interface Rpc { - request(service: string, method: string, data: Uint8Array): Promise; + request(service: string, method: string, data: Uint8Array): Promise } -declare var self: any | undefined; -declare var window: any | undefined; -declare var global: any | undefined; +declare var self: any | undefined +declare var window: any | undefined +declare var global: any | undefined var globalThis: any = (() => { - if (typeof globalThis !== "undefined") { - return globalThis; - } - if (typeof self !== "undefined") { - return self; - } - if (typeof window !== "undefined") { - return window; - } - if (typeof global !== "undefined") { - return global; - } - throw "Unable to locate global object"; -})(); - + if (typeof globalThis !== "undefined") return globalThis + if (typeof self !== "undefined") return self + if (typeof window !== "undefined") return window + if (typeof global !== "undefined") return global + throw "Unable to locate global object" +})() + +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")) function bytesFromBase64(b64: string): Uint8Array { - if (globalThis.Buffer) { - return Uint8Array.from(globalThis.Buffer.from(b64, "base64")); - } else { - const bin = globalThis.atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; + 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 } +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")) function base64FromBytes(arr: Uint8Array): string { - if (globalThis.Buffer) { - return globalThis.Buffer.from(arr).toString("base64"); - } else { - const bin: string[] = []; - arr.forEach((byte) => { - bin.push(String.fromCharCode(byte)); - }); - return globalThis.btoa(bin.join("")); - } + const bin: string[] = [] + arr.forEach((byte) => { + bin.push(String.fromCharCode(byte)) + }) + return btoa(bin.join("")) } -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/cosmos/evidence/v1beta1/tx.ts b/packages/protojs/src/cosmos/evidence/v1beta1/tx.ts index 030701ec..231d5288 100644 --- a/packages/protojs/src/cosmos/evidence/v1beta1/tx.ts +++ b/packages/protojs/src/cosmos/evidence/v1beta1/tx.ts @@ -1,132 +1,148 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { Any } from "../../../google/protobuf/any"; +import { Any } from "../../../google/protobuf/any" +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "cosmos.evidence.v1beta1"; +export const protobufPackage = "cosmos.evidence.v1beta1" /** * MsgSubmitEvidence represents a message that supports submitting arbitrary * Evidence of misbehavior such as equivocation or counterfactual signing. */ export interface MsgSubmitEvidence { - submitter: string; - evidence?: Any; + submitter: string + evidence?: Any } /** MsgSubmitEvidenceResponse defines the Msg/SubmitEvidence response type. */ export interface MsgSubmitEvidenceResponse { /** hash defines the hash of the evidence. */ - hash: Uint8Array; + hash: Uint8Array } function createBaseMsgSubmitEvidence(): MsgSubmitEvidence { - return { submitter: "", evidence: undefined }; + return { submitter: "", evidence: undefined } } export const MsgSubmitEvidence = { - encode(message: MsgSubmitEvidence, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: MsgSubmitEvidence, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.submitter !== "") { - writer.uint32(10).string(message.submitter); + writer.uint32(10).string(message.submitter) } if (message.evidence !== undefined) { - Any.encode(message.evidence, writer.uint32(18).fork()).ldelim(); + Any.encode(message.evidence, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MsgSubmitEvidence { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgSubmitEvidence(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgSubmitEvidence() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.submitter = reader.string(); - break; + message.submitter = reader.string() + break case 2: - message.evidence = Any.decode(reader, reader.uint32()); - break; + message.evidence = Any.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): MsgSubmitEvidence { return { submitter: isSet(object.submitter) ? String(object.submitter) : "", evidence: isSet(object.evidence) ? Any.fromJSON(object.evidence) : undefined, - }; + } }, toJSON(message: MsgSubmitEvidence): unknown { - const obj: any = {}; - message.submitter !== undefined && (obj.submitter = message.submitter); - message.evidence !== undefined && (obj.evidence = message.evidence ? Any.toJSON(message.evidence) : undefined); - return obj; + const obj: any = {} + message.submitter !== undefined && (obj.submitter = message.submitter) + message.evidence !== undefined && + (obj.evidence = message.evidence ? Any.toJSON(message.evidence) : undefined) + return obj }, - fromPartial, I>>(object: I): MsgSubmitEvidence { - const message = createBaseMsgSubmitEvidence(); - message.submitter = object.submitter ?? ""; - message.evidence = (object.evidence !== undefined && object.evidence !== null) - ? Any.fromPartial(object.evidence) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): MsgSubmitEvidence { + const message = createBaseMsgSubmitEvidence() + message.submitter = object.submitter ?? "" + message.evidence = + object.evidence !== undefined && object.evidence !== null + ? Any.fromPartial(object.evidence) + : undefined + return message }, -}; +} function createBaseMsgSubmitEvidenceResponse(): MsgSubmitEvidenceResponse { - return { hash: new Uint8Array() }; + return { hash: new Uint8Array() } } export const MsgSubmitEvidenceResponse = { - encode(message: MsgSubmitEvidenceResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: MsgSubmitEvidenceResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.hash.length !== 0) { - writer.uint32(34).bytes(message.hash); + writer.uint32(34).bytes(message.hash) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MsgSubmitEvidenceResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgSubmitEvidenceResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgSubmitEvidenceResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 4: - message.hash = reader.bytes(); - break; + message.hash = reader.bytes() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): MsgSubmitEvidenceResponse { - return { hash: isSet(object.hash) ? bytesFromBase64(object.hash) : new Uint8Array() }; + return { + hash: isSet(object.hash) ? bytesFromBase64(object.hash) : new Uint8Array(), + } }, toJSON(message: MsgSubmitEvidenceResponse): unknown { - const obj: any = {}; + const obj: any = {} message.hash !== undefined && - (obj.hash = base64FromBytes(message.hash !== undefined ? message.hash : new Uint8Array())); - return obj; + (obj.hash = base64FromBytes( + message.hash !== undefined ? message.hash : new Uint8Array(), + )) + return obj }, - fromPartial, I>>(object: I): MsgSubmitEvidenceResponse { - const message = createBaseMsgSubmitEvidenceResponse(); - message.hash = object.hash ?? new Uint8Array(); - return message; + fromPartial, I>>( + object: I, + ): MsgSubmitEvidenceResponse { + const message = createBaseMsgSubmitEvidenceResponse() + message.hash = object.hash ?? new Uint8Array() + return message }, -}; +} /** Msg defines the evidence Msg service. */ export interface Msg { @@ -134,87 +150,91 @@ export interface Msg { * SubmitEvidence submits an arbitrary Evidence of misbehavior such as equivocation or * counterfactual signing. */ - SubmitEvidence(request: MsgSubmitEvidence): Promise; + SubmitEvidence(request: MsgSubmitEvidence): Promise } export class MsgClientImpl implements Msg { - private readonly rpc: Rpc; + private readonly rpc: Rpc constructor(rpc: Rpc) { - this.rpc = rpc; - this.SubmitEvidence = this.SubmitEvidence.bind(this); + this.rpc = rpc + this.SubmitEvidence = this.SubmitEvidence.bind(this) } SubmitEvidence(request: MsgSubmitEvidence): Promise { - const data = MsgSubmitEvidence.encode(request).finish(); - const promise = this.rpc.request("cosmos.evidence.v1beta1.Msg", "SubmitEvidence", data); - return promise.then((data) => MsgSubmitEvidenceResponse.decode(new _m0.Reader(data))); + const data = MsgSubmitEvidence.encode(request).finish() + const promise = this.rpc.request( + "cosmos.evidence.v1beta1.Msg", + "SubmitEvidence", + data, + ) + return promise.then((data) => + MsgSubmitEvidenceResponse.decode(new _m0.Reader(data)), + ) } } interface Rpc { - request(service: string, method: string, data: Uint8Array): Promise; + request(service: string, method: string, data: Uint8Array): Promise } -declare var self: any | undefined; -declare var window: any | undefined; -declare var global: any | undefined; +declare var self: any | undefined +declare var window: any | undefined +declare var global: any | undefined var globalThis: any = (() => { - if (typeof globalThis !== "undefined") { - return globalThis; - } - if (typeof self !== "undefined") { - return self; - } - if (typeof window !== "undefined") { - return window; - } - if (typeof global !== "undefined") { - return global; - } - throw "Unable to locate global object"; -})(); - + if (typeof globalThis !== "undefined") return globalThis + if (typeof self !== "undefined") return self + if (typeof window !== "undefined") return window + if (typeof global !== "undefined") return global + throw "Unable to locate global object" +})() + +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")) function bytesFromBase64(b64: string): Uint8Array { - if (globalThis.Buffer) { - return Uint8Array.from(globalThis.Buffer.from(b64, "base64")); - } else { - const bin = globalThis.atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; + 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 } +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")) function base64FromBytes(arr: Uint8Array): string { - if (globalThis.Buffer) { - return globalThis.Buffer.from(arr).toString("base64"); - } else { - const bin: string[] = []; - arr.forEach((byte) => { - bin.push(String.fromCharCode(byte)); - }); - return globalThis.btoa(bin.join("")); - } + const bin: string[] = [] + arr.forEach((byte) => { + bin.push(String.fromCharCode(byte)) + }) + return btoa(bin.join("")) } -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/cosmos/feegrant/v1beta1/feegrant.ts b/packages/protojs/src/cosmos/feegrant/v1beta1/feegrant.ts index e3814c6d..1248953e 100644 --- a/packages/protojs/src/cosmos/feegrant/v1beta1/feegrant.ts +++ b/packages/protojs/src/cosmos/feegrant/v1beta1/feegrant.ts @@ -1,12 +1,12 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { Any } from "../../../google/protobuf/any"; -import { Duration } from "../../../google/protobuf/duration"; -import { Timestamp } from "../../../google/protobuf/timestamp"; -import { Coin } from "../../base/v1beta1/coin"; +import { Duration } from "../../../google/protobuf/duration" +import { Any } from "../../../google/protobuf/any" +import { Timestamp } from "../../../google/protobuf/timestamp" +import Long from "long" +import { Coin } from "../../base/v1beta1/coin" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "cosmos.feegrant.v1beta1"; +export const protobufPackage = "cosmos.feegrant.v1beta1" /** Since: cosmos-sdk 0.43 */ @@ -20,9 +20,9 @@ export interface BasicAllowance { * by this allowance and will be updated as tokens are spent. If it is * empty, there is no spend limit and any amount of coins can be spent. */ - spendLimit: Coin[]; + spendLimit: Coin[] /** expiration specifies an optional time when this allowance expires */ - expiration?: Date; + expiration?: Date } /** @@ -31,159 +31,184 @@ export interface BasicAllowance { */ export interface PeriodicAllowance { /** basic specifies a struct of `BasicAllowance` */ - basic?: BasicAllowance; + basic?: BasicAllowance /** * period specifies the time duration in which period_spend_limit coins can * be spent before that allowance is reset */ - period?: Duration; + period?: Duration /** * period_spend_limit specifies the maximum number of coins that can be spent * in the period */ - periodSpendLimit: Coin[]; + periodSpendLimit: Coin[] /** period_can_spend is the number of coins left to be spent before the period_reset time */ - periodCanSpend: Coin[]; + periodCanSpend: Coin[] /** * period_reset is the time at which this period resets and a new one begins, * it is calculated from the start time of the first transaction after the * last period ended */ - periodReset?: Date; + periodReset?: Date } /** AllowedMsgAllowance creates allowance only for specified message types. */ export interface AllowedMsgAllowance { /** allowance can be any of basic and filtered fee allowance. */ - allowance?: Any; + allowance?: Any /** allowed_messages are the messages for which the grantee has the access. */ - allowedMessages: string[]; + allowedMessages: string[] } /** Grant is stored in the KVStore to record a grant with full context */ export interface Grant { /** granter is the address of the user granting an allowance of their funds. */ - granter: string; + granter: string /** grantee is the address of the user being granted an allowance of another user's funds. */ - grantee: string; + grantee: string /** allowance can be any of basic and filtered fee allowance. */ - allowance?: Any; + allowance?: Any } function createBaseBasicAllowance(): BasicAllowance { - return { spendLimit: [], expiration: undefined }; + return { spendLimit: [], expiration: undefined } } export const BasicAllowance = { - encode(message: BasicAllowance, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: BasicAllowance, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { for (const v of message.spendLimit) { - Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + Coin.encode(v!, writer.uint32(10).fork()).ldelim() } if (message.expiration !== undefined) { - Timestamp.encode(toTimestamp(message.expiration), writer.uint32(18).fork()).ldelim(); + Timestamp.encode( + toTimestamp(message.expiration), + writer.uint32(18).fork(), + ).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): BasicAllowance { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseBasicAllowance(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseBasicAllowance() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.spendLimit.push(Coin.decode(reader, reader.uint32())); - break; + message.spendLimit.push(Coin.decode(reader, reader.uint32())) + break case 2: - message.expiration = fromTimestamp(Timestamp.decode(reader, reader.uint32())); - break; + message.expiration = fromTimestamp(Timestamp.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): BasicAllowance { return { - spendLimit: Array.isArray(object?.spendLimit) ? object.spendLimit.map((e: any) => Coin.fromJSON(e)) : [], - expiration: isSet(object.expiration) ? fromJsonTimestamp(object.expiration) : undefined, - }; + spendLimit: Array.isArray(object?.spendLimit) + ? object.spendLimit.map((e: any) => Coin.fromJSON(e)) + : [], + expiration: isSet(object.expiration) + ? fromJsonTimestamp(object.expiration) + : undefined, + } }, toJSON(message: BasicAllowance): unknown { - const obj: any = {}; + const obj: any = {} if (message.spendLimit) { - obj.spendLimit = message.spendLimit.map((e) => e ? Coin.toJSON(e) : undefined); + obj.spendLimit = message.spendLimit.map((e) => (e ? Coin.toJSON(e) : undefined)) } else { - obj.spendLimit = []; + obj.spendLimit = [] } - message.expiration !== undefined && (obj.expiration = message.expiration.toISOString()); - return obj; + message.expiration !== undefined && + (obj.expiration = message.expiration.toISOString()) + return obj }, - fromPartial, I>>(object: I): BasicAllowance { - const message = createBaseBasicAllowance(); - message.spendLimit = object.spendLimit?.map((e) => Coin.fromPartial(e)) || []; - message.expiration = object.expiration ?? undefined; - return message; + fromPartial, I>>( + object: I, + ): BasicAllowance { + const message = createBaseBasicAllowance() + message.spendLimit = object.spendLimit?.map((e) => Coin.fromPartial(e)) || [] + message.expiration = object.expiration ?? undefined + return message }, -}; +} function createBasePeriodicAllowance(): PeriodicAllowance { - return { basic: undefined, period: undefined, periodSpendLimit: [], periodCanSpend: [], periodReset: undefined }; + return { + basic: undefined, + period: undefined, + periodSpendLimit: [], + periodCanSpend: [], + periodReset: undefined, + } } export const PeriodicAllowance = { - encode(message: PeriodicAllowance, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: PeriodicAllowance, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.basic !== undefined) { - BasicAllowance.encode(message.basic, writer.uint32(10).fork()).ldelim(); + BasicAllowance.encode(message.basic, writer.uint32(10).fork()).ldelim() } if (message.period !== undefined) { - Duration.encode(message.period, writer.uint32(18).fork()).ldelim(); + Duration.encode(message.period, writer.uint32(18).fork()).ldelim() } for (const v of message.periodSpendLimit) { - Coin.encode(v!, writer.uint32(26).fork()).ldelim(); + Coin.encode(v!, writer.uint32(26).fork()).ldelim() } for (const v of message.periodCanSpend) { - Coin.encode(v!, writer.uint32(34).fork()).ldelim(); + Coin.encode(v!, writer.uint32(34).fork()).ldelim() } if (message.periodReset !== undefined) { - Timestamp.encode(toTimestamp(message.periodReset), writer.uint32(42).fork()).ldelim(); + Timestamp.encode( + toTimestamp(message.periodReset), + writer.uint32(42).fork(), + ).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): PeriodicAllowance { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBasePeriodicAllowance(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBasePeriodicAllowance() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.basic = BasicAllowance.decode(reader, reader.uint32()); - break; + message.basic = BasicAllowance.decode(reader, reader.uint32()) + break case 2: - message.period = Duration.decode(reader, reader.uint32()); - break; + message.period = Duration.decode(reader, reader.uint32()) + break case 3: - message.periodSpendLimit.push(Coin.decode(reader, reader.uint32())); - break; + message.periodSpendLimit.push(Coin.decode(reader, reader.uint32())) + break case 4: - message.periodCanSpend.push(Coin.decode(reader, reader.uint32())); - break; + message.periodCanSpend.push(Coin.decode(reader, reader.uint32())) + break case 5: - message.periodReset = fromTimestamp(Timestamp.decode(reader, reader.uint32())); - break; + message.periodReset = fromTimestamp(Timestamp.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): PeriodicAllowance { @@ -196,147 +221,171 @@ export const PeriodicAllowance = { periodCanSpend: Array.isArray(object?.periodCanSpend) ? object.periodCanSpend.map((e: any) => Coin.fromJSON(e)) : [], - periodReset: isSet(object.periodReset) ? fromJsonTimestamp(object.periodReset) : undefined, - }; + periodReset: isSet(object.periodReset) + ? fromJsonTimestamp(object.periodReset) + : undefined, + } }, toJSON(message: PeriodicAllowance): unknown { - const obj: any = {}; - message.basic !== undefined && (obj.basic = message.basic ? BasicAllowance.toJSON(message.basic) : undefined); - message.period !== undefined && (obj.period = message.period ? Duration.toJSON(message.period) : undefined); + const obj: any = {} + message.basic !== undefined && + (obj.basic = message.basic ? BasicAllowance.toJSON(message.basic) : undefined) + message.period !== undefined && + (obj.period = message.period ? Duration.toJSON(message.period) : undefined) if (message.periodSpendLimit) { - obj.periodSpendLimit = message.periodSpendLimit.map((e) => e ? Coin.toJSON(e) : undefined); + obj.periodSpendLimit = message.periodSpendLimit.map((e) => + e ? Coin.toJSON(e) : undefined, + ) } else { - obj.periodSpendLimit = []; + obj.periodSpendLimit = [] } if (message.periodCanSpend) { - obj.periodCanSpend = message.periodCanSpend.map((e) => e ? Coin.toJSON(e) : undefined); + obj.periodCanSpend = message.periodCanSpend.map((e) => + e ? Coin.toJSON(e) : undefined, + ) } else { - obj.periodCanSpend = []; + obj.periodCanSpend = [] } - message.periodReset !== undefined && (obj.periodReset = message.periodReset.toISOString()); - return obj; + message.periodReset !== undefined && + (obj.periodReset = message.periodReset.toISOString()) + return obj }, - fromPartial, I>>(object: I): PeriodicAllowance { - const message = createBasePeriodicAllowance(); - message.basic = (object.basic !== undefined && object.basic !== null) - ? BasicAllowance.fromPartial(object.basic) - : undefined; - message.period = (object.period !== undefined && object.period !== null) - ? Duration.fromPartial(object.period) - : undefined; - message.periodSpendLimit = object.periodSpendLimit?.map((e) => Coin.fromPartial(e)) || []; - message.periodCanSpend = object.periodCanSpend?.map((e) => Coin.fromPartial(e)) || []; - message.periodReset = object.periodReset ?? undefined; - return message; + fromPartial, I>>( + object: I, + ): PeriodicAllowance { + const message = createBasePeriodicAllowance() + message.basic = + object.basic !== undefined && object.basic !== null + ? BasicAllowance.fromPartial(object.basic) + : undefined + message.period = + object.period !== undefined && object.period !== null + ? Duration.fromPartial(object.period) + : undefined + message.periodSpendLimit = + object.periodSpendLimit?.map((e) => Coin.fromPartial(e)) || [] + message.periodCanSpend = + object.periodCanSpend?.map((e) => Coin.fromPartial(e)) || [] + message.periodReset = object.periodReset ?? undefined + return message }, -}; +} function createBaseAllowedMsgAllowance(): AllowedMsgAllowance { - return { allowance: undefined, allowedMessages: [] }; + return { allowance: undefined, allowedMessages: [] } } export const AllowedMsgAllowance = { - encode(message: AllowedMsgAllowance, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: AllowedMsgAllowance, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.allowance !== undefined) { - Any.encode(message.allowance, writer.uint32(10).fork()).ldelim(); + Any.encode(message.allowance, writer.uint32(10).fork()).ldelim() } for (const v of message.allowedMessages) { - writer.uint32(18).string(v!); + writer.uint32(18).string(v!) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): AllowedMsgAllowance { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseAllowedMsgAllowance(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseAllowedMsgAllowance() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.allowance = Any.decode(reader, reader.uint32()); - break; + message.allowance = Any.decode(reader, reader.uint32()) + break case 2: - message.allowedMessages.push(reader.string()); - break; + message.allowedMessages.push(reader.string()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): AllowedMsgAllowance { return { allowance: isSet(object.allowance) ? Any.fromJSON(object.allowance) : undefined, - allowedMessages: Array.isArray(object?.allowedMessages) ? object.allowedMessages.map((e: any) => String(e)) : [], - }; + allowedMessages: Array.isArray(object?.allowedMessages) + ? object.allowedMessages.map((e: any) => String(e)) + : [], + } }, toJSON(message: AllowedMsgAllowance): unknown { - const obj: any = {}; - message.allowance !== undefined && (obj.allowance = message.allowance ? Any.toJSON(message.allowance) : undefined); + const obj: any = {} + message.allowance !== undefined && + (obj.allowance = message.allowance ? Any.toJSON(message.allowance) : undefined) if (message.allowedMessages) { - obj.allowedMessages = message.allowedMessages.map((e) => e); + obj.allowedMessages = message.allowedMessages.map((e) => e) } else { - obj.allowedMessages = []; + obj.allowedMessages = [] } - return obj; + return obj }, - fromPartial, I>>(object: I): AllowedMsgAllowance { - const message = createBaseAllowedMsgAllowance(); - message.allowance = (object.allowance !== undefined && object.allowance !== null) - ? Any.fromPartial(object.allowance) - : undefined; - message.allowedMessages = object.allowedMessages?.map((e) => e) || []; - return message; + fromPartial, I>>( + object: I, + ): AllowedMsgAllowance { + const message = createBaseAllowedMsgAllowance() + message.allowance = + object.allowance !== undefined && object.allowance !== null + ? Any.fromPartial(object.allowance) + : undefined + message.allowedMessages = object.allowedMessages?.map((e) => e) || [] + return message }, -}; +} function createBaseGrant(): Grant { - return { granter: "", grantee: "", allowance: undefined }; + return { granter: "", grantee: "", allowance: undefined } } export const Grant = { encode(message: Grant, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.granter !== "") { - writer.uint32(10).string(message.granter); + writer.uint32(10).string(message.granter) } if (message.grantee !== "") { - writer.uint32(18).string(message.grantee); + writer.uint32(18).string(message.grantee) } if (message.allowance !== undefined) { - Any.encode(message.allowance, writer.uint32(26).fork()).ldelim(); + Any.encode(message.allowance, writer.uint32(26).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Grant { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGrant(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseGrant() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.granter = reader.string(); - break; + message.granter = reader.string() + break case 2: - message.grantee = reader.string(); - break; + message.grantee = reader.string() + break case 3: - message.allowance = Any.decode(reader, reader.uint32()); - break; + message.allowance = Any.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Grant { @@ -344,71 +393,83 @@ export const Grant = { granter: isSet(object.granter) ? String(object.granter) : "", grantee: isSet(object.grantee) ? String(object.grantee) : "", allowance: isSet(object.allowance) ? Any.fromJSON(object.allowance) : undefined, - }; + } }, toJSON(message: Grant): unknown { - const obj: any = {}; - message.granter !== undefined && (obj.granter = message.granter); - message.grantee !== undefined && (obj.grantee = message.grantee); - message.allowance !== undefined && (obj.allowance = message.allowance ? Any.toJSON(message.allowance) : undefined); - return obj; + const obj: any = {} + message.granter !== undefined && (obj.granter = message.granter) + message.grantee !== undefined && (obj.grantee = message.grantee) + message.allowance !== undefined && + (obj.allowance = message.allowance ? Any.toJSON(message.allowance) : undefined) + return obj }, fromPartial, I>>(object: I): Grant { - const message = createBaseGrant(); - message.granter = object.granter ?? ""; - message.grantee = object.grantee ?? ""; - message.allowance = (object.allowance !== undefined && object.allowance !== null) - ? Any.fromPartial(object.allowance) - : undefined; - return message; + const message = createBaseGrant() + message.granter = object.granter ?? "" + message.grantee = object.grantee ?? "" + message.allowance = + object.allowance !== undefined && object.allowance !== null + ? Any.fromPartial(object.allowance) + : undefined + return message }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; +} -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > function toTimestamp(date: Date): Timestamp { - const seconds = numberToLong(date.getTime() / 1_000); - const nanos = (date.getTime() % 1_000) * 1_000_000; - return { seconds, nanos }; + const seconds = numberToLong(date.getTime() / 1_000) + const nanos = (date.getTime() % 1_000) * 1_000_000 + return { seconds, nanos } } function fromTimestamp(t: Timestamp): Date { - let millis = t.seconds.toNumber() * 1_000; - millis += t.nanos / 1_000_000; - return new Date(millis); + let millis = t.seconds.toNumber() * 1_000 + millis += t.nanos / 1_000_000 + return new Date(millis) } function fromJsonTimestamp(o: any): Date { if (o instanceof Date) { - return o; + return o } else if (typeof o === "string") { - return new Date(o); + return new Date(o) } else { - return fromTimestamp(Timestamp.fromJSON(o)); + return fromTimestamp(Timestamp.fromJSON(o)) } } function numberToLong(number: number) { - return Long.fromNumber(number); + return Long.fromNumber(number) } if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/cosmos/feegrant/v1beta1/genesis.ts b/packages/protojs/src/cosmos/feegrant/v1beta1/genesis.ts index bf118509..98fc5844 100644 --- a/packages/protojs/src/cosmos/feegrant/v1beta1/genesis.ts +++ b/packages/protojs/src/cosmos/feegrant/v1beta1/genesis.ts @@ -1,83 +1,95 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { Grant } from "./feegrant"; +import Long from "long" +import { Grant } from "./feegrant" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "cosmos.feegrant.v1beta1"; +export const protobufPackage = "cosmos.feegrant.v1beta1" /** Since: cosmos-sdk 0.43 */ /** GenesisState contains a set of fee allowances, persisted from the store */ export interface GenesisState { - allowances: Grant[]; + allowances: Grant[] } function createBaseGenesisState(): GenesisState { - return { allowances: [] }; + return { allowances: [] } } export const GenesisState = { encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.allowances) { - Grant.encode(v!, writer.uint32(10).fork()).ldelim(); + Grant.encode(v!, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGenesisState(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseGenesisState() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.allowances.push(Grant.decode(reader, reader.uint32())); - break; + message.allowances.push(Grant.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): GenesisState { return { - allowances: Array.isArray(object?.allowances) ? object.allowances.map((e: any) => Grant.fromJSON(e)) : [], - }; + allowances: Array.isArray(object?.allowances) + ? object.allowances.map((e: any) => Grant.fromJSON(e)) + : [], + } }, toJSON(message: GenesisState): unknown { - const obj: any = {}; + const obj: any = {} if (message.allowances) { - obj.allowances = message.allowances.map((e) => e ? Grant.toJSON(e) : undefined); + obj.allowances = message.allowances.map((e) => (e ? Grant.toJSON(e) : undefined)) } else { - obj.allowances = []; + obj.allowances = [] } - return obj; + return obj }, fromPartial, I>>(object: I): GenesisState { - const message = createBaseGenesisState(); - message.allowances = object.allowances?.map((e) => Grant.fromPartial(e)) || []; - return message; + const message = createBaseGenesisState() + message.allowances = object.allowances?.map((e) => Grant.fromPartial(e)) || [] + return message }, -}; +} -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } diff --git a/packages/protojs/src/cosmos/feegrant/v1beta1/query.ts b/packages/protojs/src/cosmos/feegrant/v1beta1/query.ts index 0854980a..67678018 100644 --- a/packages/protojs/src/cosmos/feegrant/v1beta1/query.ts +++ b/packages/protojs/src/cosmos/feegrant/v1beta1/query.ts @@ -1,482 +1,565 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { PageRequest, PageResponse } from "../../base/query/v1beta1/pagination"; -import { Grant } from "./feegrant"; +import { Grant } from "./feegrant" +import { PageRequest, PageResponse } from "../../base/query/v1beta1/pagination" +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "cosmos.feegrant.v1beta1"; +export const protobufPackage = "cosmos.feegrant.v1beta1" /** Since: cosmos-sdk 0.43 */ /** QueryAllowanceRequest is the request type for the Query/Allowance RPC method. */ export interface QueryAllowanceRequest { /** granter is the address of the user granting an allowance of their funds. */ - granter: string; + granter: string /** grantee is the address of the user being granted an allowance of another user's funds. */ - grantee: string; + grantee: string } /** QueryAllowanceResponse is the response type for the Query/Allowance RPC method. */ export interface QueryAllowanceResponse { /** allowance is a allowance granted for grantee by granter. */ - allowance?: Grant; + allowance?: Grant } /** QueryAllowancesRequest is the request type for the Query/Allowances RPC method. */ export interface QueryAllowancesRequest { - grantee: string; + grantee: string /** pagination defines an pagination for the request. */ - pagination?: PageRequest; + pagination?: PageRequest } /** QueryAllowancesResponse is the response type for the Query/Allowances RPC method. */ export interface QueryAllowancesResponse { /** allowances are allowance's granted for grantee by granter. */ - allowances: Grant[]; + allowances: Grant[] /** pagination defines an pagination for the response. */ - pagination?: PageResponse; + pagination?: PageResponse } /** QueryAllowancesByGranterRequest is the request type for the Query/AllowancesByGranter RPC method. */ export interface QueryAllowancesByGranterRequest { - granter: string; + granter: string /** pagination defines an pagination for the request. */ - pagination?: PageRequest; + pagination?: PageRequest } /** QueryAllowancesByGranterResponse is the response type for the Query/AllowancesByGranter RPC method. */ export interface QueryAllowancesByGranterResponse { /** allowances that have been issued by the granter. */ - allowances: Grant[]; + allowances: Grant[] /** pagination defines an pagination for the response. */ - pagination?: PageResponse; + pagination?: PageResponse } function createBaseQueryAllowanceRequest(): QueryAllowanceRequest { - return { granter: "", grantee: "" }; + return { granter: "", grantee: "" } } export const QueryAllowanceRequest = { - encode(message: QueryAllowanceRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryAllowanceRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.granter !== "") { - writer.uint32(10).string(message.granter); + writer.uint32(10).string(message.granter) } if (message.grantee !== "") { - writer.uint32(18).string(message.grantee); + writer.uint32(18).string(message.grantee) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllowanceRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryAllowanceRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryAllowanceRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.granter = reader.string(); - break; + message.granter = reader.string() + break case 2: - message.grantee = reader.string(); - break; + message.grantee = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryAllowanceRequest { return { granter: isSet(object.granter) ? String(object.granter) : "", grantee: isSet(object.grantee) ? String(object.grantee) : "", - }; + } }, toJSON(message: QueryAllowanceRequest): unknown { - const obj: any = {}; - message.granter !== undefined && (obj.granter = message.granter); - message.grantee !== undefined && (obj.grantee = message.grantee); - return obj; + const obj: any = {} + message.granter !== undefined && (obj.granter = message.granter) + message.grantee !== undefined && (obj.grantee = message.grantee) + return obj }, - fromPartial, I>>(object: I): QueryAllowanceRequest { - const message = createBaseQueryAllowanceRequest(); - message.granter = object.granter ?? ""; - message.grantee = object.grantee ?? ""; - return message; + fromPartial, I>>( + object: I, + ): QueryAllowanceRequest { + const message = createBaseQueryAllowanceRequest() + message.granter = object.granter ?? "" + message.grantee = object.grantee ?? "" + return message }, -}; +} function createBaseQueryAllowanceResponse(): QueryAllowanceResponse { - return { allowance: undefined }; + return { allowance: undefined } } export const QueryAllowanceResponse = { - encode(message: QueryAllowanceResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryAllowanceResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.allowance !== undefined) { - Grant.encode(message.allowance, writer.uint32(10).fork()).ldelim(); + Grant.encode(message.allowance, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllowanceResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryAllowanceResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryAllowanceResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.allowance = Grant.decode(reader, reader.uint32()); - break; + message.allowance = Grant.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryAllowanceResponse { - return { allowance: isSet(object.allowance) ? Grant.fromJSON(object.allowance) : undefined }; + return { + allowance: isSet(object.allowance) ? Grant.fromJSON(object.allowance) : undefined, + } }, toJSON(message: QueryAllowanceResponse): unknown { - const obj: any = {}; + const obj: any = {} message.allowance !== undefined && - (obj.allowance = message.allowance ? Grant.toJSON(message.allowance) : undefined); - return obj; + (obj.allowance = message.allowance ? Grant.toJSON(message.allowance) : undefined) + return obj }, - fromPartial, I>>(object: I): QueryAllowanceResponse { - const message = createBaseQueryAllowanceResponse(); - message.allowance = (object.allowance !== undefined && object.allowance !== null) - ? Grant.fromPartial(object.allowance) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): QueryAllowanceResponse { + const message = createBaseQueryAllowanceResponse() + message.allowance = + object.allowance !== undefined && object.allowance !== null + ? Grant.fromPartial(object.allowance) + : undefined + return message }, -}; +} function createBaseQueryAllowancesRequest(): QueryAllowancesRequest { - return { grantee: "", pagination: undefined }; + return { grantee: "", pagination: undefined } } export const QueryAllowancesRequest = { - encode(message: QueryAllowancesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryAllowancesRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.grantee !== "") { - writer.uint32(10).string(message.grantee); + writer.uint32(10).string(message.grantee) } if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllowancesRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryAllowancesRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryAllowancesRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.grantee = reader.string(); - break; + message.grantee = reader.string() + break case 2: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; + message.pagination = PageRequest.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryAllowancesRequest { return { grantee: isSet(object.grantee) ? String(object.grantee) : "", - pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined, - }; + pagination: isSet(object.pagination) + ? PageRequest.fromJSON(object.pagination) + : undefined, + } }, toJSON(message: QueryAllowancesRequest): unknown { - const obj: any = {}; - message.grantee !== undefined && (obj.grantee = message.grantee); + const obj: any = {} + message.grantee !== undefined && (obj.grantee = message.grantee) message.pagination !== undefined && - (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); - return obj; + (obj.pagination = message.pagination + ? PageRequest.toJSON(message.pagination) + : undefined) + return obj }, - fromPartial, I>>(object: I): QueryAllowancesRequest { - const message = createBaseQueryAllowancesRequest(); - message.grantee = object.grantee ?? ""; - message.pagination = (object.pagination !== undefined && object.pagination !== null) - ? PageRequest.fromPartial(object.pagination) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): QueryAllowancesRequest { + const message = createBaseQueryAllowancesRequest() + message.grantee = object.grantee ?? "" + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageRequest.fromPartial(object.pagination) + : undefined + return message }, -}; +} function createBaseQueryAllowancesResponse(): QueryAllowancesResponse { - return { allowances: [], pagination: undefined }; + return { allowances: [], pagination: undefined } } export const QueryAllowancesResponse = { - encode(message: QueryAllowancesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryAllowancesResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { for (const v of message.allowances) { - Grant.encode(v!, writer.uint32(10).fork()).ldelim(); + Grant.encode(v!, writer.uint32(10).fork()).ldelim() } if (message.pagination !== undefined) { - PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllowancesResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryAllowancesResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryAllowancesResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.allowances.push(Grant.decode(reader, reader.uint32())); - break; + message.allowances.push(Grant.decode(reader, reader.uint32())) + break case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; + message.pagination = PageResponse.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryAllowancesResponse { return { - allowances: Array.isArray(object?.allowances) ? object.allowances.map((e: any) => Grant.fromJSON(e)) : [], - pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, - }; + allowances: Array.isArray(object?.allowances) + ? object.allowances.map((e: any) => Grant.fromJSON(e)) + : [], + pagination: isSet(object.pagination) + ? PageResponse.fromJSON(object.pagination) + : undefined, + } }, toJSON(message: QueryAllowancesResponse): unknown { - const obj: any = {}; + const obj: any = {} if (message.allowances) { - obj.allowances = message.allowances.map((e) => e ? Grant.toJSON(e) : undefined); + obj.allowances = message.allowances.map((e) => (e ? Grant.toJSON(e) : undefined)) } else { - obj.allowances = []; + obj.allowances = [] } message.pagination !== undefined && - (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); - return obj; + (obj.pagination = message.pagination + ? PageResponse.toJSON(message.pagination) + : undefined) + return obj }, - fromPartial, I>>(object: I): QueryAllowancesResponse { - const message = createBaseQueryAllowancesResponse(); - message.allowances = object.allowances?.map((e) => Grant.fromPartial(e)) || []; - message.pagination = (object.pagination !== undefined && object.pagination !== null) - ? PageResponse.fromPartial(object.pagination) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): QueryAllowancesResponse { + const message = createBaseQueryAllowancesResponse() + message.allowances = object.allowances?.map((e) => Grant.fromPartial(e)) || [] + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageResponse.fromPartial(object.pagination) + : undefined + return message }, -}; +} function createBaseQueryAllowancesByGranterRequest(): QueryAllowancesByGranterRequest { - return { granter: "", pagination: undefined }; + return { granter: "", pagination: undefined } } export const QueryAllowancesByGranterRequest = { - encode(message: QueryAllowancesByGranterRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryAllowancesByGranterRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.granter !== "") { - writer.uint32(10).string(message.granter); + writer.uint32(10).string(message.granter) } if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllowancesByGranterRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryAllowancesByGranterRequest(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryAllowancesByGranterRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryAllowancesByGranterRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.granter = reader.string(); - break; + message.granter = reader.string() + break case 2: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; + message.pagination = PageRequest.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryAllowancesByGranterRequest { return { granter: isSet(object.granter) ? String(object.granter) : "", - pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined, - }; + pagination: isSet(object.pagination) + ? PageRequest.fromJSON(object.pagination) + : undefined, + } }, toJSON(message: QueryAllowancesByGranterRequest): unknown { - const obj: any = {}; - message.granter !== undefined && (obj.granter = message.granter); + const obj: any = {} + message.granter !== undefined && (obj.granter = message.granter) message.pagination !== undefined && - (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); - return obj; + (obj.pagination = message.pagination + ? PageRequest.toJSON(message.pagination) + : undefined) + return obj }, fromPartial, I>>( object: I, ): QueryAllowancesByGranterRequest { - const message = createBaseQueryAllowancesByGranterRequest(); - message.granter = object.granter ?? ""; - message.pagination = (object.pagination !== undefined && object.pagination !== null) - ? PageRequest.fromPartial(object.pagination) - : undefined; - return message; + const message = createBaseQueryAllowancesByGranterRequest() + message.granter = object.granter ?? "" + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageRequest.fromPartial(object.pagination) + : undefined + return message }, -}; +} function createBaseQueryAllowancesByGranterResponse(): QueryAllowancesByGranterResponse { - return { allowances: [], pagination: undefined }; + return { allowances: [], pagination: undefined } } export const QueryAllowancesByGranterResponse = { - encode(message: QueryAllowancesByGranterResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryAllowancesByGranterResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { for (const v of message.allowances) { - Grant.encode(v!, writer.uint32(10).fork()).ldelim(); + Grant.encode(v!, writer.uint32(10).fork()).ldelim() } if (message.pagination !== undefined) { - PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllowancesByGranterResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryAllowancesByGranterResponse(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryAllowancesByGranterResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryAllowancesByGranterResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.allowances.push(Grant.decode(reader, reader.uint32())); - break; + message.allowances.push(Grant.decode(reader, reader.uint32())) + break case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; + message.pagination = PageResponse.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryAllowancesByGranterResponse { return { - allowances: Array.isArray(object?.allowances) ? object.allowances.map((e: any) => Grant.fromJSON(e)) : [], - pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, - }; + allowances: Array.isArray(object?.allowances) + ? object.allowances.map((e: any) => Grant.fromJSON(e)) + : [], + pagination: isSet(object.pagination) + ? PageResponse.fromJSON(object.pagination) + : undefined, + } }, toJSON(message: QueryAllowancesByGranterResponse): unknown { - const obj: any = {}; + const obj: any = {} if (message.allowances) { - obj.allowances = message.allowances.map((e) => e ? Grant.toJSON(e) : undefined); + obj.allowances = message.allowances.map((e) => (e ? Grant.toJSON(e) : undefined)) } else { - obj.allowances = []; + obj.allowances = [] } message.pagination !== undefined && - (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); - return obj; + (obj.pagination = message.pagination + ? PageResponse.toJSON(message.pagination) + : undefined) + return obj }, fromPartial, I>>( object: I, ): QueryAllowancesByGranterResponse { - const message = createBaseQueryAllowancesByGranterResponse(); - message.allowances = object.allowances?.map((e) => Grant.fromPartial(e)) || []; - message.pagination = (object.pagination !== undefined && object.pagination !== null) - ? PageResponse.fromPartial(object.pagination) - : undefined; - return message; + const message = createBaseQueryAllowancesByGranterResponse() + message.allowances = object.allowances?.map((e) => Grant.fromPartial(e)) || [] + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageResponse.fromPartial(object.pagination) + : undefined + return message }, -}; +} /** Query defines the gRPC querier service. */ export interface Query { /** Allowance returns fee granted to the grantee by the granter. */ - Allowance(request: QueryAllowanceRequest): Promise; + Allowance(request: QueryAllowanceRequest): Promise /** Allowances returns all the grants for address. */ - Allowances(request: QueryAllowancesRequest): Promise; + Allowances(request: QueryAllowancesRequest): Promise /** * AllowancesByGranter returns all the grants given by an address * Since v0.46 */ - AllowancesByGranter(request: QueryAllowancesByGranterRequest): Promise; + AllowancesByGranter( + request: QueryAllowancesByGranterRequest, + ): Promise } export class QueryClientImpl implements Query { - private readonly rpc: Rpc; + private readonly rpc: Rpc constructor(rpc: Rpc) { - this.rpc = rpc; - this.Allowance = this.Allowance.bind(this); - this.Allowances = this.Allowances.bind(this); - this.AllowancesByGranter = this.AllowancesByGranter.bind(this); + this.rpc = rpc + this.Allowance = this.Allowance.bind(this) + this.Allowances = this.Allowances.bind(this) + this.AllowancesByGranter = this.AllowancesByGranter.bind(this) } Allowance(request: QueryAllowanceRequest): Promise { - const data = QueryAllowanceRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.feegrant.v1beta1.Query", "Allowance", data); - return promise.then((data) => QueryAllowanceResponse.decode(new _m0.Reader(data))); + const data = QueryAllowanceRequest.encode(request).finish() + const promise = this.rpc.request("cosmos.feegrant.v1beta1.Query", "Allowance", data) + return promise.then((data) => QueryAllowanceResponse.decode(new _m0.Reader(data))) } Allowances(request: QueryAllowancesRequest): Promise { - const data = QueryAllowancesRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.feegrant.v1beta1.Query", "Allowances", data); - return promise.then((data) => QueryAllowancesResponse.decode(new _m0.Reader(data))); + const data = QueryAllowancesRequest.encode(request).finish() + const promise = this.rpc.request( + "cosmos.feegrant.v1beta1.Query", + "Allowances", + data, + ) + return promise.then((data) => QueryAllowancesResponse.decode(new _m0.Reader(data))) } - AllowancesByGranter(request: QueryAllowancesByGranterRequest): Promise { - const data = QueryAllowancesByGranterRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.feegrant.v1beta1.Query", "AllowancesByGranter", data); - return promise.then((data) => QueryAllowancesByGranterResponse.decode(new _m0.Reader(data))); + AllowancesByGranter( + request: QueryAllowancesByGranterRequest, + ): Promise { + const data = QueryAllowancesByGranterRequest.encode(request).finish() + const promise = this.rpc.request( + "cosmos.feegrant.v1beta1.Query", + "AllowancesByGranter", + data, + ) + return promise.then((data) => + QueryAllowancesByGranterResponse.decode(new _m0.Reader(data)), + ) } } interface Rpc { - request(service: string, method: string, data: Uint8Array): Promise; + request(service: string, method: string, data: Uint8Array): Promise } -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/cosmos/feegrant/v1beta1/tx.ts b/packages/protojs/src/cosmos/feegrant/v1beta1/tx.ts index 63fdeba9..5f4c2d7d 100644 --- a/packages/protojs/src/cosmos/feegrant/v1beta1/tx.ts +++ b/packages/protojs/src/cosmos/feegrant/v1beta1/tx.ts @@ -1,9 +1,9 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { Any } from "../../../google/protobuf/any"; +import { Any } from "../../../google/protobuf/any" +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "cosmos.feegrant.v1beta1"; +export const protobufPackage = "cosmos.feegrant.v1beta1" /** Since: cosmos-sdk 0.43 */ @@ -13,69 +13,70 @@ export const protobufPackage = "cosmos.feegrant.v1beta1"; */ export interface MsgGrantAllowance { /** granter is the address of the user granting an allowance of their funds. */ - granter: string; + granter: string /** grantee is the address of the user being granted an allowance of another user's funds. */ - grantee: string; + grantee: string /** allowance can be any of basic and filtered fee allowance. */ - allowance?: Any; + allowance?: Any } /** MsgGrantAllowanceResponse defines the Msg/GrantAllowanceResponse response type. */ -export interface MsgGrantAllowanceResponse { -} +export interface MsgGrantAllowanceResponse {} /** MsgRevokeAllowance removes any existing Allowance from Granter to Grantee. */ export interface MsgRevokeAllowance { /** granter is the address of the user granting an allowance of their funds. */ - granter: string; + granter: string /** grantee is the address of the user being granted an allowance of another user's funds. */ - grantee: string; + grantee: string } /** MsgRevokeAllowanceResponse defines the Msg/RevokeAllowanceResponse response type. */ -export interface MsgRevokeAllowanceResponse { -} +export interface MsgRevokeAllowanceResponse {} function createBaseMsgGrantAllowance(): MsgGrantAllowance { - return { granter: "", grantee: "", allowance: undefined }; + return { granter: "", grantee: "", allowance: undefined } } export const MsgGrantAllowance = { - encode(message: MsgGrantAllowance, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: MsgGrantAllowance, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.granter !== "") { - writer.uint32(10).string(message.granter); + writer.uint32(10).string(message.granter) } if (message.grantee !== "") { - writer.uint32(18).string(message.grantee); + writer.uint32(18).string(message.grantee) } if (message.allowance !== undefined) { - Any.encode(message.allowance, writer.uint32(26).fork()).ldelim(); + Any.encode(message.allowance, writer.uint32(26).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MsgGrantAllowance { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgGrantAllowance(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgGrantAllowance() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.granter = reader.string(); - break; + message.granter = reader.string() + break case 2: - message.grantee = reader.string(); - break; + message.grantee = reader.string() + break case 3: - message.allowance = Any.decode(reader, reader.uint32()); - break; + message.allowance = Any.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): MsgGrantAllowance { @@ -83,163 +84,182 @@ export const MsgGrantAllowance = { granter: isSet(object.granter) ? String(object.granter) : "", grantee: isSet(object.grantee) ? String(object.grantee) : "", allowance: isSet(object.allowance) ? Any.fromJSON(object.allowance) : undefined, - }; + } }, toJSON(message: MsgGrantAllowance): unknown { - const obj: any = {}; - message.granter !== undefined && (obj.granter = message.granter); - message.grantee !== undefined && (obj.grantee = message.grantee); - message.allowance !== undefined && (obj.allowance = message.allowance ? Any.toJSON(message.allowance) : undefined); - return obj; + const obj: any = {} + message.granter !== undefined && (obj.granter = message.granter) + message.grantee !== undefined && (obj.grantee = message.grantee) + message.allowance !== undefined && + (obj.allowance = message.allowance ? Any.toJSON(message.allowance) : undefined) + return obj }, - fromPartial, I>>(object: I): MsgGrantAllowance { - const message = createBaseMsgGrantAllowance(); - message.granter = object.granter ?? ""; - message.grantee = object.grantee ?? ""; - message.allowance = (object.allowance !== undefined && object.allowance !== null) - ? Any.fromPartial(object.allowance) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): MsgGrantAllowance { + const message = createBaseMsgGrantAllowance() + message.granter = object.granter ?? "" + message.grantee = object.grantee ?? "" + message.allowance = + object.allowance !== undefined && object.allowance !== null + ? Any.fromPartial(object.allowance) + : undefined + return message }, -}; +} function createBaseMsgGrantAllowanceResponse(): MsgGrantAllowanceResponse { - return {}; + return {} } export const MsgGrantAllowanceResponse = { - encode(_: MsgGrantAllowanceResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; + encode( + _: MsgGrantAllowanceResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MsgGrantAllowanceResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgGrantAllowanceResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgGrantAllowanceResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(_: any): MsgGrantAllowanceResponse { - return {}; + return {} }, toJSON(_: MsgGrantAllowanceResponse): unknown { - const obj: any = {}; - return obj; + const obj: any = {} + return obj }, - fromPartial, I>>(_: I): MsgGrantAllowanceResponse { - const message = createBaseMsgGrantAllowanceResponse(); - return message; + fromPartial, I>>( + _: I, + ): MsgGrantAllowanceResponse { + const message = createBaseMsgGrantAllowanceResponse() + return message }, -}; +} function createBaseMsgRevokeAllowance(): MsgRevokeAllowance { - return { granter: "", grantee: "" }; + return { granter: "", grantee: "" } } export const MsgRevokeAllowance = { - encode(message: MsgRevokeAllowance, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: MsgRevokeAllowance, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.granter !== "") { - writer.uint32(10).string(message.granter); + writer.uint32(10).string(message.granter) } if (message.grantee !== "") { - writer.uint32(18).string(message.grantee); + writer.uint32(18).string(message.grantee) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MsgRevokeAllowance { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgRevokeAllowance(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgRevokeAllowance() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.granter = reader.string(); - break; + message.granter = reader.string() + break case 2: - message.grantee = reader.string(); - break; + message.grantee = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): MsgRevokeAllowance { return { granter: isSet(object.granter) ? String(object.granter) : "", grantee: isSet(object.grantee) ? String(object.grantee) : "", - }; + } }, toJSON(message: MsgRevokeAllowance): unknown { - const obj: any = {}; - message.granter !== undefined && (obj.granter = message.granter); - message.grantee !== undefined && (obj.grantee = message.grantee); - return obj; + const obj: any = {} + message.granter !== undefined && (obj.granter = message.granter) + message.grantee !== undefined && (obj.grantee = message.grantee) + return obj }, - fromPartial, I>>(object: I): MsgRevokeAllowance { - const message = createBaseMsgRevokeAllowance(); - message.granter = object.granter ?? ""; - message.grantee = object.grantee ?? ""; - return message; + fromPartial, I>>( + object: I, + ): MsgRevokeAllowance { + const message = createBaseMsgRevokeAllowance() + message.granter = object.granter ?? "" + message.grantee = object.grantee ?? "" + return message }, -}; +} function createBaseMsgRevokeAllowanceResponse(): MsgRevokeAllowanceResponse { - return {}; + return {} } export const MsgRevokeAllowanceResponse = { - encode(_: MsgRevokeAllowanceResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; + encode( + _: MsgRevokeAllowanceResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MsgRevokeAllowanceResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgRevokeAllowanceResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgRevokeAllowanceResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(_: any): MsgRevokeAllowanceResponse { - return {}; + return {} }, toJSON(_: MsgRevokeAllowanceResponse): unknown { - const obj: any = {}; - return obj; + const obj: any = {} + return obj }, - fromPartial, I>>(_: I): MsgRevokeAllowanceResponse { - const message = createBaseMsgRevokeAllowanceResponse(); - return message; + fromPartial, I>>( + _: I, + ): MsgRevokeAllowanceResponse { + const message = createBaseMsgRevokeAllowanceResponse() + return message }, -}; +} /** Msg defines the feegrant msg service. */ export interface Msg { @@ -247,55 +267,77 @@ export interface Msg { * GrantAllowance grants fee allowance to the grantee on the granter's * account with the provided expiration time. */ - GrantAllowance(request: MsgGrantAllowance): Promise; + GrantAllowance(request: MsgGrantAllowance): Promise /** * RevokeAllowance revokes any fee allowance of granter's account that * has been granted to the grantee. */ - RevokeAllowance(request: MsgRevokeAllowance): Promise; + RevokeAllowance(request: MsgRevokeAllowance): Promise } export class MsgClientImpl implements Msg { - private readonly rpc: Rpc; + private readonly rpc: Rpc constructor(rpc: Rpc) { - this.rpc = rpc; - this.GrantAllowance = this.GrantAllowance.bind(this); - this.RevokeAllowance = this.RevokeAllowance.bind(this); + this.rpc = rpc + this.GrantAllowance = this.GrantAllowance.bind(this) + this.RevokeAllowance = this.RevokeAllowance.bind(this) } GrantAllowance(request: MsgGrantAllowance): Promise { - const data = MsgGrantAllowance.encode(request).finish(); - const promise = this.rpc.request("cosmos.feegrant.v1beta1.Msg", "GrantAllowance", data); - return promise.then((data) => MsgGrantAllowanceResponse.decode(new _m0.Reader(data))); + const data = MsgGrantAllowance.encode(request).finish() + const promise = this.rpc.request( + "cosmos.feegrant.v1beta1.Msg", + "GrantAllowance", + data, + ) + return promise.then((data) => + MsgGrantAllowanceResponse.decode(new _m0.Reader(data)), + ) } RevokeAllowance(request: MsgRevokeAllowance): Promise { - const data = MsgRevokeAllowance.encode(request).finish(); - const promise = this.rpc.request("cosmos.feegrant.v1beta1.Msg", "RevokeAllowance", data); - return promise.then((data) => MsgRevokeAllowanceResponse.decode(new _m0.Reader(data))); + const data = MsgRevokeAllowance.encode(request).finish() + const promise = this.rpc.request( + "cosmos.feegrant.v1beta1.Msg", + "RevokeAllowance", + data, + ) + return promise.then((data) => + MsgRevokeAllowanceResponse.decode(new _m0.Reader(data)), + ) } } interface Rpc { - request(service: string, method: string, data: Uint8Array): Promise; + request(service: string, method: string, data: Uint8Array): Promise } -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/cosmos/genutil/v1beta1/genesis.ts b/packages/protojs/src/cosmos/genutil/v1beta1/genesis.ts index 0dd8ac7d..0f70220f 100644 --- a/packages/protojs/src/cosmos/genutil/v1beta1/genesis.ts +++ b/packages/protojs/src/cosmos/genutil/v1beta1/genesis.ts @@ -1,123 +1,127 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "cosmos.genutil.v1beta1"; +export const protobufPackage = "cosmos.genutil.v1beta1" /** GenesisState defines the raw genesis transaction in JSON. */ export interface GenesisState { /** gen_txs defines the genesis transactions. */ - genTxs: Uint8Array[]; + genTxs: Uint8Array[] } function createBaseGenesisState(): GenesisState { - return { genTxs: [] }; + return { genTxs: [] } } export const GenesisState = { encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.genTxs) { - writer.uint32(10).bytes(v!); + writer.uint32(10).bytes(v!) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGenesisState(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseGenesisState() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.genTxs.push(reader.bytes()); - break; + message.genTxs.push(reader.bytes()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): GenesisState { - return { genTxs: Array.isArray(object?.genTxs) ? object.genTxs.map((e: any) => bytesFromBase64(e)) : [] }; + return { + genTxs: Array.isArray(object?.genTxs) + ? object.genTxs.map((e: any) => bytesFromBase64(e)) + : [], + } }, toJSON(message: GenesisState): unknown { - const obj: any = {}; + const obj: any = {} if (message.genTxs) { - obj.genTxs = message.genTxs.map((e) => base64FromBytes(e !== undefined ? e : new Uint8Array())); + obj.genTxs = message.genTxs.map((e) => + base64FromBytes(e !== undefined ? e : new Uint8Array()), + ) } else { - obj.genTxs = []; + obj.genTxs = [] } - return obj; + return obj }, fromPartial, I>>(object: I): GenesisState { - const message = createBaseGenesisState(); - message.genTxs = object.genTxs?.map((e) => e) || []; - return message; + const message = createBaseGenesisState() + message.genTxs = object.genTxs?.map((e) => e) || [] + return message }, -}; +} -declare var self: any | undefined; -declare var window: any | undefined; -declare var global: any | undefined; +declare var self: any | undefined +declare var window: any | undefined +declare var global: any | undefined var globalThis: any = (() => { - if (typeof globalThis !== "undefined") { - return globalThis; - } - if (typeof self !== "undefined") { - return self; - } - if (typeof window !== "undefined") { - return window; - } - if (typeof global !== "undefined") { - return global; - } - throw "Unable to locate global object"; -})(); + if (typeof globalThis !== "undefined") return globalThis + if (typeof self !== "undefined") return self + if (typeof window !== "undefined") return window + if (typeof global !== "undefined") return global + throw "Unable to locate global object" +})() +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")) function bytesFromBase64(b64: string): Uint8Array { - if (globalThis.Buffer) { - return Uint8Array.from(globalThis.Buffer.from(b64, "base64")); - } else { - const bin = globalThis.atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; + 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 } +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")) function base64FromBytes(arr: Uint8Array): string { - if (globalThis.Buffer) { - return globalThis.Buffer.from(arr).toString("base64"); - } else { - const bin: string[] = []; - arr.forEach((byte) => { - bin.push(String.fromCharCode(byte)); - }); - return globalThis.btoa(bin.join("")); - } + const bin: string[] = [] + arr.forEach((byte) => { + bin.push(String.fromCharCode(byte)) + }) + return btoa(bin.join("")) } -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } diff --git a/packages/protojs/src/cosmos/gov/v1beta1/genesis.ts b/packages/protojs/src/cosmos/gov/v1beta1/genesis.ts index 47c0d98f..1afb2ee3 100644 --- a/packages/protojs/src/cosmos/gov/v1beta1/genesis.ts +++ b/packages/protojs/src/cosmos/gov/v1beta1/genesis.ts @@ -1,26 +1,33 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { Deposit, DepositParams, Proposal, TallyParams, Vote, VotingParams } from "./gov"; +import { + DepositParams, + VotingParams, + TallyParams, + Deposit, + Vote, + Proposal, +} from "./gov" +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "cosmos.gov.v1beta1"; +export const protobufPackage = "cosmos.gov.v1beta1" /** GenesisState defines the gov module's genesis state. */ export interface GenesisState { /** starting_proposal_id is the ID of the starting proposal. */ - startingProposalId: Long; + startingProposalId: Long /** deposits defines all the deposits present at genesis. */ - deposits: Deposit[]; + deposits: Deposit[] /** votes defines all the votes present at genesis. */ - votes: Vote[]; + votes: Vote[] /** proposals defines all the proposals present at genesis. */ - proposals: Proposal[]; + proposals: Proposal[] /** params defines all the paramaters of related to deposit. */ - depositParams?: DepositParams; + depositParams?: DepositParams /** params defines all the paramaters of related to voting. */ - votingParams?: VotingParams; + votingParams?: VotingParams /** params defines all the paramaters of related to tally. */ - tallyParams?: TallyParams; + tallyParams?: TallyParams } function createBaseGenesisState(): GenesisState { @@ -32,149 +39,183 @@ function createBaseGenesisState(): GenesisState { depositParams: undefined, votingParams: undefined, tallyParams: undefined, - }; + } } export const GenesisState = { encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (!message.startingProposalId.isZero()) { - writer.uint32(8).uint64(message.startingProposalId); + writer.uint32(8).uint64(message.startingProposalId) } for (const v of message.deposits) { - Deposit.encode(v!, writer.uint32(18).fork()).ldelim(); + Deposit.encode(v!, writer.uint32(18).fork()).ldelim() } for (const v of message.votes) { - Vote.encode(v!, writer.uint32(26).fork()).ldelim(); + Vote.encode(v!, writer.uint32(26).fork()).ldelim() } for (const v of message.proposals) { - Proposal.encode(v!, writer.uint32(34).fork()).ldelim(); + Proposal.encode(v!, writer.uint32(34).fork()).ldelim() } if (message.depositParams !== undefined) { - DepositParams.encode(message.depositParams, writer.uint32(42).fork()).ldelim(); + DepositParams.encode(message.depositParams, writer.uint32(42).fork()).ldelim() } if (message.votingParams !== undefined) { - VotingParams.encode(message.votingParams, writer.uint32(50).fork()).ldelim(); + VotingParams.encode(message.votingParams, writer.uint32(50).fork()).ldelim() } if (message.tallyParams !== undefined) { - TallyParams.encode(message.tallyParams, writer.uint32(58).fork()).ldelim(); + TallyParams.encode(message.tallyParams, writer.uint32(58).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGenesisState(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseGenesisState() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.startingProposalId = reader.uint64() as Long; - break; + message.startingProposalId = reader.uint64() as Long + break case 2: - message.deposits.push(Deposit.decode(reader, reader.uint32())); - break; + message.deposits.push(Deposit.decode(reader, reader.uint32())) + break case 3: - message.votes.push(Vote.decode(reader, reader.uint32())); - break; + message.votes.push(Vote.decode(reader, reader.uint32())) + break case 4: - message.proposals.push(Proposal.decode(reader, reader.uint32())); - break; + message.proposals.push(Proposal.decode(reader, reader.uint32())) + break case 5: - message.depositParams = DepositParams.decode(reader, reader.uint32()); - break; + message.depositParams = DepositParams.decode(reader, reader.uint32()) + break case 6: - message.votingParams = VotingParams.decode(reader, reader.uint32()); - break; + message.votingParams = VotingParams.decode(reader, reader.uint32()) + break case 7: - message.tallyParams = TallyParams.decode(reader, reader.uint32()); - break; + message.tallyParams = TallyParams.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): GenesisState { return { - startingProposalId: isSet(object.startingProposalId) ? Long.fromValue(object.startingProposalId) : Long.UZERO, - deposits: Array.isArray(object?.deposits) ? object.deposits.map((e: any) => Deposit.fromJSON(e)) : [], - votes: Array.isArray(object?.votes) ? object.votes.map((e: any) => Vote.fromJSON(e)) : [], - proposals: Array.isArray(object?.proposals) ? object.proposals.map((e: any) => Proposal.fromJSON(e)) : [], - depositParams: isSet(object.depositParams) ? DepositParams.fromJSON(object.depositParams) : undefined, - votingParams: isSet(object.votingParams) ? VotingParams.fromJSON(object.votingParams) : undefined, - tallyParams: isSet(object.tallyParams) ? TallyParams.fromJSON(object.tallyParams) : undefined, - }; + startingProposalId: isSet(object.startingProposalId) + ? Long.fromValue(object.startingProposalId) + : Long.UZERO, + deposits: Array.isArray(object?.deposits) + ? object.deposits.map((e: any) => Deposit.fromJSON(e)) + : [], + votes: Array.isArray(object?.votes) + ? object.votes.map((e: any) => Vote.fromJSON(e)) + : [], + proposals: Array.isArray(object?.proposals) + ? object.proposals.map((e: any) => Proposal.fromJSON(e)) + : [], + depositParams: isSet(object.depositParams) + ? DepositParams.fromJSON(object.depositParams) + : undefined, + votingParams: isSet(object.votingParams) + ? VotingParams.fromJSON(object.votingParams) + : undefined, + tallyParams: isSet(object.tallyParams) + ? TallyParams.fromJSON(object.tallyParams) + : undefined, + } }, toJSON(message: GenesisState): unknown { - const obj: any = {}; + const obj: any = {} message.startingProposalId !== undefined && - (obj.startingProposalId = (message.startingProposalId || Long.UZERO).toString()); + (obj.startingProposalId = (message.startingProposalId || Long.UZERO).toString()) if (message.deposits) { - obj.deposits = message.deposits.map((e) => e ? Deposit.toJSON(e) : undefined); + obj.deposits = message.deposits.map((e) => (e ? Deposit.toJSON(e) : undefined)) } else { - obj.deposits = []; + obj.deposits = [] } if (message.votes) { - obj.votes = message.votes.map((e) => e ? Vote.toJSON(e) : undefined); + obj.votes = message.votes.map((e) => (e ? Vote.toJSON(e) : undefined)) } else { - obj.votes = []; + obj.votes = [] } if (message.proposals) { - obj.proposals = message.proposals.map((e) => e ? Proposal.toJSON(e) : undefined); + obj.proposals = message.proposals.map((e) => (e ? Proposal.toJSON(e) : undefined)) } else { - obj.proposals = []; + obj.proposals = [] } message.depositParams !== undefined && - (obj.depositParams = message.depositParams ? DepositParams.toJSON(message.depositParams) : undefined); + (obj.depositParams = message.depositParams + ? DepositParams.toJSON(message.depositParams) + : undefined) message.votingParams !== undefined && - (obj.votingParams = message.votingParams ? VotingParams.toJSON(message.votingParams) : undefined); + (obj.votingParams = message.votingParams + ? VotingParams.toJSON(message.votingParams) + : undefined) message.tallyParams !== undefined && - (obj.tallyParams = message.tallyParams ? TallyParams.toJSON(message.tallyParams) : undefined); - return obj; + (obj.tallyParams = message.tallyParams + ? TallyParams.toJSON(message.tallyParams) + : undefined) + return obj }, fromPartial, I>>(object: I): GenesisState { - const message = createBaseGenesisState(); - message.startingProposalId = (object.startingProposalId !== undefined && object.startingProposalId !== null) - ? Long.fromValue(object.startingProposalId) - : Long.UZERO; - message.deposits = object.deposits?.map((e) => Deposit.fromPartial(e)) || []; - message.votes = object.votes?.map((e) => Vote.fromPartial(e)) || []; - message.proposals = object.proposals?.map((e) => Proposal.fromPartial(e)) || []; - message.depositParams = (object.depositParams !== undefined && object.depositParams !== null) - ? DepositParams.fromPartial(object.depositParams) - : undefined; - message.votingParams = (object.votingParams !== undefined && object.votingParams !== null) - ? VotingParams.fromPartial(object.votingParams) - : undefined; - message.tallyParams = (object.tallyParams !== undefined && object.tallyParams !== null) - ? TallyParams.fromPartial(object.tallyParams) - : undefined; - return message; + const message = createBaseGenesisState() + message.startingProposalId = + object.startingProposalId !== undefined && object.startingProposalId !== null + ? Long.fromValue(object.startingProposalId) + : Long.UZERO + message.deposits = object.deposits?.map((e) => Deposit.fromPartial(e)) || [] + message.votes = object.votes?.map((e) => Vote.fromPartial(e)) || [] + message.proposals = object.proposals?.map((e) => Proposal.fromPartial(e)) || [] + message.depositParams = + object.depositParams !== undefined && object.depositParams !== null + ? DepositParams.fromPartial(object.depositParams) + : undefined + message.votingParams = + object.votingParams !== undefined && object.votingParams !== null + ? VotingParams.fromPartial(object.votingParams) + : undefined + message.tallyParams = + object.tallyParams !== undefined && object.tallyParams !== null + ? TallyParams.fromPartial(object.tallyParams) + : undefined + return message }, -}; +} -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/cosmos/gov/v1beta1/gov.ts b/packages/protojs/src/cosmos/gov/v1beta1/gov.ts index 1d185ff0..e2f01d51 100644 --- a/packages/protojs/src/cosmos/gov/v1beta1/gov.ts +++ b/packages/protojs/src/cosmos/gov/v1beta1/gov.ts @@ -1,12 +1,12 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { Any } from "../../../google/protobuf/any"; -import { Duration } from "../../../google/protobuf/duration"; -import { Timestamp } from "../../../google/protobuf/timestamp"; -import { Coin } from "../../base/v1beta1/coin"; +import { Any } from "../../../google/protobuf/any" +import { Duration } from "../../../google/protobuf/duration" +import { Timestamp } from "../../../google/protobuf/timestamp" +import Long from "long" +import { Coin } from "../../base/v1beta1/coin" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "cosmos.gov.v1beta1"; +export const protobufPackage = "cosmos.gov.v1beta1" /** VoteOption enumerates the valid vote options for a given governance proposal. */ export enum VoteOption { @@ -27,41 +27,41 @@ export function voteOptionFromJSON(object: any): VoteOption { switch (object) { case 0: case "VOTE_OPTION_UNSPECIFIED": - return VoteOption.VOTE_OPTION_UNSPECIFIED; + return VoteOption.VOTE_OPTION_UNSPECIFIED case 1: case "VOTE_OPTION_YES": - return VoteOption.VOTE_OPTION_YES; + return VoteOption.VOTE_OPTION_YES case 2: case "VOTE_OPTION_ABSTAIN": - return VoteOption.VOTE_OPTION_ABSTAIN; + return VoteOption.VOTE_OPTION_ABSTAIN case 3: case "VOTE_OPTION_NO": - return VoteOption.VOTE_OPTION_NO; + return VoteOption.VOTE_OPTION_NO case 4: case "VOTE_OPTION_NO_WITH_VETO": - return VoteOption.VOTE_OPTION_NO_WITH_VETO; + return VoteOption.VOTE_OPTION_NO_WITH_VETO case -1: case "UNRECOGNIZED": default: - return VoteOption.UNRECOGNIZED; + return VoteOption.UNRECOGNIZED } } export function voteOptionToJSON(object: VoteOption): string { switch (object) { case VoteOption.VOTE_OPTION_UNSPECIFIED: - return "VOTE_OPTION_UNSPECIFIED"; + return "VOTE_OPTION_UNSPECIFIED" case VoteOption.VOTE_OPTION_YES: - return "VOTE_OPTION_YES"; + return "VOTE_OPTION_YES" case VoteOption.VOTE_OPTION_ABSTAIN: - return "VOTE_OPTION_ABSTAIN"; + return "VOTE_OPTION_ABSTAIN" case VoteOption.VOTE_OPTION_NO: - return "VOTE_OPTION_NO"; + return "VOTE_OPTION_NO" case VoteOption.VOTE_OPTION_NO_WITH_VETO: - return "VOTE_OPTION_NO_WITH_VETO"; + return "VOTE_OPTION_NO_WITH_VETO" case VoteOption.UNRECOGNIZED: default: - return "UNRECOGNIZED"; + return "UNRECOGNIZED" } } @@ -101,46 +101,46 @@ export function proposalStatusFromJSON(object: any): ProposalStatus { switch (object) { case 0: case "PROPOSAL_STATUS_UNSPECIFIED": - return ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED; + return ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED case 1: case "PROPOSAL_STATUS_DEPOSIT_PERIOD": - return ProposalStatus.PROPOSAL_STATUS_DEPOSIT_PERIOD; + return ProposalStatus.PROPOSAL_STATUS_DEPOSIT_PERIOD case 2: case "PROPOSAL_STATUS_VOTING_PERIOD": - return ProposalStatus.PROPOSAL_STATUS_VOTING_PERIOD; + return ProposalStatus.PROPOSAL_STATUS_VOTING_PERIOD case 3: case "PROPOSAL_STATUS_PASSED": - return ProposalStatus.PROPOSAL_STATUS_PASSED; + return ProposalStatus.PROPOSAL_STATUS_PASSED case 4: case "PROPOSAL_STATUS_REJECTED": - return ProposalStatus.PROPOSAL_STATUS_REJECTED; + return ProposalStatus.PROPOSAL_STATUS_REJECTED case 5: case "PROPOSAL_STATUS_FAILED": - return ProposalStatus.PROPOSAL_STATUS_FAILED; + return ProposalStatus.PROPOSAL_STATUS_FAILED case -1: case "UNRECOGNIZED": default: - return ProposalStatus.UNRECOGNIZED; + return ProposalStatus.UNRECOGNIZED } } export function proposalStatusToJSON(object: ProposalStatus): string { switch (object) { case ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED: - return "PROPOSAL_STATUS_UNSPECIFIED"; + return "PROPOSAL_STATUS_UNSPECIFIED" case ProposalStatus.PROPOSAL_STATUS_DEPOSIT_PERIOD: - return "PROPOSAL_STATUS_DEPOSIT_PERIOD"; + return "PROPOSAL_STATUS_DEPOSIT_PERIOD" case ProposalStatus.PROPOSAL_STATUS_VOTING_PERIOD: - return "PROPOSAL_STATUS_VOTING_PERIOD"; + return "PROPOSAL_STATUS_VOTING_PERIOD" case ProposalStatus.PROPOSAL_STATUS_PASSED: - return "PROPOSAL_STATUS_PASSED"; + return "PROPOSAL_STATUS_PASSED" case ProposalStatus.PROPOSAL_STATUS_REJECTED: - return "PROPOSAL_STATUS_REJECTED"; + return "PROPOSAL_STATUS_REJECTED" case ProposalStatus.PROPOSAL_STATUS_FAILED: - return "PROPOSAL_STATUS_FAILED"; + return "PROPOSAL_STATUS_FAILED" case ProposalStatus.UNRECOGNIZED: default: - return "UNRECOGNIZED"; + return "UNRECOGNIZED" } } @@ -150,8 +150,8 @@ export function proposalStatusToJSON(object: ProposalStatus): string { * Since: cosmos-sdk 0.43 */ export interface WeightedVoteOption { - option: VoteOption; - weight: string; + option: VoteOption + weight: string } /** @@ -159,8 +159,8 @@ export interface WeightedVoteOption { * manually updated in case of approval. */ export interface TextProposal { - title: string; - description: string; + title: string + description: string } /** @@ -168,30 +168,30 @@ export interface TextProposal { * proposal. */ export interface Deposit { - proposalId: Long; - depositor: string; - amount: Coin[]; + proposalId: Long + depositor: string + amount: Coin[] } /** Proposal defines the core field members of a governance proposal. */ export interface Proposal { - proposalId: Long; - content?: Any; - status: ProposalStatus; - finalTallyResult?: TallyResult; - submitTime?: Date; - depositEndTime?: Date; - totalDeposit: Coin[]; - votingStartTime?: Date; - votingEndTime?: Date; + proposalId: Long + content?: Any + status: ProposalStatus + finalTallyResult?: TallyResult + submitTime?: Date + depositEndTime?: Date + totalDeposit: Coin[] + votingStartTime?: Date + votingEndTime?: Date } /** TallyResult defines a standard tally for a governance proposal. */ export interface TallyResult { - yes: string; - abstain: string; - no: string; - noWithVeto: string; + yes: string + abstain: string + no: string + noWithVeto: string } /** @@ -199,8 +199,8 @@ export interface TallyResult { * A Vote consists of a proposal ID, the voter, and the vote option. */ export interface Vote { - proposalId: Long; - voter: string; + proposalId: Long + voter: string /** * Deprecated: Prefer to use `options` instead. This field is set in queries * if and only if `len(options) == 1` and that option has weight 1. In all @@ -208,26 +208,26 @@ export interface Vote { * * @deprecated */ - option: VoteOption; + option: VoteOption /** Since: cosmos-sdk 0.43 */ - options: WeightedVoteOption[]; + options: WeightedVoteOption[] } /** DepositParams defines the params for deposits on governance proposals. */ export interface DepositParams { /** Minimum deposit for a proposal to enter voting period. */ - minDeposit: Coin[]; + minDeposit: Coin[] /** * Maximum period for Atom holders to deposit on a proposal. Initial value: 2 * months. */ - maxDepositPeriod?: Duration; + maxDepositPeriod?: Duration } /** VotingParams defines the params for voting on governance proposals. */ export interface VotingParams { /** Length of the voting period. */ - votingPeriod?: Duration; + votingPeriod?: Duration } /** TallyParams defines the params for tallying votes on governance proposals. */ @@ -236,204 +236,215 @@ export interface TallyParams { * Minimum percentage of total stake needed to vote for a result to be * considered valid. */ - quorum: Uint8Array; + quorum: Uint8Array /** Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. */ - threshold: Uint8Array; + threshold: Uint8Array /** * Minimum value of Veto votes to Total votes ratio for proposal to be * vetoed. Default value: 1/3. */ - vetoThreshold: Uint8Array; + vetoThreshold: Uint8Array } function createBaseWeightedVoteOption(): WeightedVoteOption { - return { option: 0, weight: "" }; + return { option: 0, weight: "" } } export const WeightedVoteOption = { - encode(message: WeightedVoteOption, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: WeightedVoteOption, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.option !== 0) { - writer.uint32(8).int32(message.option); + writer.uint32(8).int32(message.option) } if (message.weight !== "") { - writer.uint32(18).string(message.weight); + writer.uint32(18).string(message.weight) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): WeightedVoteOption { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseWeightedVoteOption(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseWeightedVoteOption() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.option = reader.int32() as any; - break; + message.option = reader.int32() as any + break case 2: - message.weight = reader.string(); - break; + message.weight = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): WeightedVoteOption { return { option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, weight: isSet(object.weight) ? String(object.weight) : "", - }; + } }, toJSON(message: WeightedVoteOption): unknown { - const obj: any = {}; - message.option !== undefined && (obj.option = voteOptionToJSON(message.option)); - message.weight !== undefined && (obj.weight = message.weight); - return obj; + const obj: any = {} + message.option !== undefined && (obj.option = voteOptionToJSON(message.option)) + message.weight !== undefined && (obj.weight = message.weight) + return obj }, - fromPartial, I>>(object: I): WeightedVoteOption { - const message = createBaseWeightedVoteOption(); - message.option = object.option ?? 0; - message.weight = object.weight ?? ""; - return message; + fromPartial, I>>( + object: I, + ): WeightedVoteOption { + const message = createBaseWeightedVoteOption() + message.option = object.option ?? 0 + message.weight = object.weight ?? "" + return message }, -}; +} function createBaseTextProposal(): TextProposal { - return { title: "", description: "" }; + return { title: "", description: "" } } export const TextProposal = { encode(message: TextProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.title !== "") { - writer.uint32(10).string(message.title); + writer.uint32(10).string(message.title) } if (message.description !== "") { - writer.uint32(18).string(message.description); + writer.uint32(18).string(message.description) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): TextProposal { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseTextProposal(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseTextProposal() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.title = reader.string(); - break; + message.title = reader.string() + break case 2: - message.description = reader.string(); - break; + message.description = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): TextProposal { return { title: isSet(object.title) ? String(object.title) : "", description: isSet(object.description) ? String(object.description) : "", - }; + } }, toJSON(message: TextProposal): unknown { - const obj: any = {}; - message.title !== undefined && (obj.title = message.title); - message.description !== undefined && (obj.description = message.description); - return obj; + const obj: any = {} + message.title !== undefined && (obj.title = message.title) + message.description !== undefined && (obj.description = message.description) + return obj }, fromPartial, I>>(object: I): TextProposal { - const message = createBaseTextProposal(); - message.title = object.title ?? ""; - message.description = object.description ?? ""; - return message; + const message = createBaseTextProposal() + message.title = object.title ?? "" + message.description = object.description ?? "" + return message }, -}; +} function createBaseDeposit(): Deposit { - return { proposalId: Long.UZERO, depositor: "", amount: [] }; + return { proposalId: Long.UZERO, depositor: "", amount: [] } } export const Deposit = { encode(message: Deposit, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (!message.proposalId.isZero()) { - writer.uint32(8).uint64(message.proposalId); + writer.uint32(8).uint64(message.proposalId) } if (message.depositor !== "") { - writer.uint32(18).string(message.depositor); + writer.uint32(18).string(message.depositor) } for (const v of message.amount) { - Coin.encode(v!, writer.uint32(26).fork()).ldelim(); + Coin.encode(v!, writer.uint32(26).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Deposit { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDeposit(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseDeposit() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.proposalId = reader.uint64() as Long; - break; + message.proposalId = reader.uint64() as Long + break case 2: - message.depositor = reader.string(); - break; + message.depositor = reader.string() + break case 3: - message.amount.push(Coin.decode(reader, reader.uint32())); - break; + message.amount.push(Coin.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Deposit { return { - proposalId: isSet(object.proposalId) ? Long.fromValue(object.proposalId) : Long.UZERO, + proposalId: isSet(object.proposalId) + ? Long.fromValue(object.proposalId) + : Long.UZERO, depositor: isSet(object.depositor) ? String(object.depositor) : "", - amount: Array.isArray(object?.amount) ? object.amount.map((e: any) => Coin.fromJSON(e)) : [], - }; + amount: Array.isArray(object?.amount) + ? object.amount.map((e: any) => Coin.fromJSON(e)) + : [], + } }, toJSON(message: Deposit): unknown { - const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); - message.depositor !== undefined && (obj.depositor = message.depositor); + const obj: any = {} + message.proposalId !== undefined && + (obj.proposalId = (message.proposalId || Long.UZERO).toString()) + message.depositor !== undefined && (obj.depositor = message.depositor) if (message.amount) { - obj.amount = message.amount.map((e) => e ? Coin.toJSON(e) : undefined); + obj.amount = message.amount.map((e) => (e ? Coin.toJSON(e) : undefined)) } else { - obj.amount = []; + obj.amount = [] } - return obj; + return obj }, fromPartial, I>>(object: I): Deposit { - const message = createBaseDeposit(); - message.proposalId = (object.proposalId !== undefined && object.proposalId !== null) - ? Long.fromValue(object.proposalId) - : Long.UZERO; - message.depositor = object.depositor ?? ""; - message.amount = object.amount?.map((e) => Coin.fromPartial(e)) || []; - return message; + const message = createBaseDeposit() + message.proposalId = + object.proposalId !== undefined && object.proposalId !== null + ? Long.fromValue(object.proposalId) + : Long.UZERO + message.depositor = object.depositor ?? "" + message.amount = object.amount?.map((e) => Coin.fromPartial(e)) || [] + return message }, -}; +} function createBaseProposal(): Proposal { return { @@ -446,183 +457,228 @@ function createBaseProposal(): Proposal { totalDeposit: [], votingStartTime: undefined, votingEndTime: undefined, - }; + } } export const Proposal = { encode(message: Proposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (!message.proposalId.isZero()) { - writer.uint32(8).uint64(message.proposalId); + writer.uint32(8).uint64(message.proposalId) } if (message.content !== undefined) { - Any.encode(message.content, writer.uint32(18).fork()).ldelim(); + Any.encode(message.content, writer.uint32(18).fork()).ldelim() } if (message.status !== 0) { - writer.uint32(24).int32(message.status); + writer.uint32(24).int32(message.status) } if (message.finalTallyResult !== undefined) { - TallyResult.encode(message.finalTallyResult, writer.uint32(34).fork()).ldelim(); + TallyResult.encode(message.finalTallyResult, writer.uint32(34).fork()).ldelim() } if (message.submitTime !== undefined) { - Timestamp.encode(toTimestamp(message.submitTime), writer.uint32(42).fork()).ldelim(); + Timestamp.encode( + toTimestamp(message.submitTime), + writer.uint32(42).fork(), + ).ldelim() } if (message.depositEndTime !== undefined) { - Timestamp.encode(toTimestamp(message.depositEndTime), writer.uint32(50).fork()).ldelim(); + Timestamp.encode( + toTimestamp(message.depositEndTime), + writer.uint32(50).fork(), + ).ldelim() } for (const v of message.totalDeposit) { - Coin.encode(v!, writer.uint32(58).fork()).ldelim(); + Coin.encode(v!, writer.uint32(58).fork()).ldelim() } if (message.votingStartTime !== undefined) { - Timestamp.encode(toTimestamp(message.votingStartTime), writer.uint32(66).fork()).ldelim(); + Timestamp.encode( + toTimestamp(message.votingStartTime), + writer.uint32(66).fork(), + ).ldelim() } if (message.votingEndTime !== undefined) { - Timestamp.encode(toTimestamp(message.votingEndTime), writer.uint32(74).fork()).ldelim(); + Timestamp.encode( + toTimestamp(message.votingEndTime), + writer.uint32(74).fork(), + ).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Proposal { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseProposal(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseProposal() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.proposalId = reader.uint64() as Long; - break; + message.proposalId = reader.uint64() as Long + break case 2: - message.content = Any.decode(reader, reader.uint32()); - break; + message.content = Any.decode(reader, reader.uint32()) + break case 3: - message.status = reader.int32() as any; - break; + message.status = reader.int32() as any + break case 4: - message.finalTallyResult = TallyResult.decode(reader, reader.uint32()); - break; + message.finalTallyResult = TallyResult.decode(reader, reader.uint32()) + break case 5: - message.submitTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); - break; + message.submitTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())) + break case 6: - message.depositEndTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); - break; + message.depositEndTime = fromTimestamp( + Timestamp.decode(reader, reader.uint32()), + ) + break case 7: - message.totalDeposit.push(Coin.decode(reader, reader.uint32())); - break; + message.totalDeposit.push(Coin.decode(reader, reader.uint32())) + break case 8: - message.votingStartTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); - break; + message.votingStartTime = fromTimestamp( + Timestamp.decode(reader, reader.uint32()), + ) + break case 9: - message.votingEndTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); - break; + message.votingEndTime = fromTimestamp( + Timestamp.decode(reader, reader.uint32()), + ) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Proposal { return { - proposalId: isSet(object.proposalId) ? Long.fromValue(object.proposalId) : Long.UZERO, + proposalId: isSet(object.proposalId) + ? Long.fromValue(object.proposalId) + : Long.UZERO, content: isSet(object.content) ? Any.fromJSON(object.content) : undefined, status: isSet(object.status) ? proposalStatusFromJSON(object.status) : 0, - finalTallyResult: isSet(object.finalTallyResult) ? TallyResult.fromJSON(object.finalTallyResult) : undefined, - submitTime: isSet(object.submitTime) ? fromJsonTimestamp(object.submitTime) : undefined, - depositEndTime: isSet(object.depositEndTime) ? fromJsonTimestamp(object.depositEndTime) : undefined, - totalDeposit: Array.isArray(object?.totalDeposit) ? object.totalDeposit.map((e: any) => Coin.fromJSON(e)) : [], - votingStartTime: isSet(object.votingStartTime) ? fromJsonTimestamp(object.votingStartTime) : undefined, - votingEndTime: isSet(object.votingEndTime) ? fromJsonTimestamp(object.votingEndTime) : undefined, - }; + finalTallyResult: isSet(object.finalTallyResult) + ? TallyResult.fromJSON(object.finalTallyResult) + : undefined, + submitTime: isSet(object.submitTime) + ? fromJsonTimestamp(object.submitTime) + : undefined, + depositEndTime: isSet(object.depositEndTime) + ? fromJsonTimestamp(object.depositEndTime) + : undefined, + totalDeposit: Array.isArray(object?.totalDeposit) + ? object.totalDeposit.map((e: any) => Coin.fromJSON(e)) + : [], + votingStartTime: isSet(object.votingStartTime) + ? fromJsonTimestamp(object.votingStartTime) + : undefined, + votingEndTime: isSet(object.votingEndTime) + ? fromJsonTimestamp(object.votingEndTime) + : undefined, + } }, toJSON(message: Proposal): unknown { - const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); - message.content !== undefined && (obj.content = message.content ? Any.toJSON(message.content) : undefined); - message.status !== undefined && (obj.status = proposalStatusToJSON(message.status)); + const obj: any = {} + message.proposalId !== undefined && + (obj.proposalId = (message.proposalId || Long.UZERO).toString()) + message.content !== undefined && + (obj.content = message.content ? Any.toJSON(message.content) : undefined) + message.status !== undefined && (obj.status = proposalStatusToJSON(message.status)) message.finalTallyResult !== undefined && - (obj.finalTallyResult = message.finalTallyResult ? TallyResult.toJSON(message.finalTallyResult) : undefined); - message.submitTime !== undefined && (obj.submitTime = message.submitTime.toISOString()); - message.depositEndTime !== undefined && (obj.depositEndTime = message.depositEndTime.toISOString()); + (obj.finalTallyResult = message.finalTallyResult + ? TallyResult.toJSON(message.finalTallyResult) + : undefined) + message.submitTime !== undefined && + (obj.submitTime = message.submitTime.toISOString()) + message.depositEndTime !== undefined && + (obj.depositEndTime = message.depositEndTime.toISOString()) if (message.totalDeposit) { - obj.totalDeposit = message.totalDeposit.map((e) => e ? Coin.toJSON(e) : undefined); + obj.totalDeposit = message.totalDeposit.map((e) => + e ? Coin.toJSON(e) : undefined, + ) } else { - obj.totalDeposit = []; + obj.totalDeposit = [] } - message.votingStartTime !== undefined && (obj.votingStartTime = message.votingStartTime.toISOString()); - message.votingEndTime !== undefined && (obj.votingEndTime = message.votingEndTime.toISOString()); - return obj; + message.votingStartTime !== undefined && + (obj.votingStartTime = message.votingStartTime.toISOString()) + message.votingEndTime !== undefined && + (obj.votingEndTime = message.votingEndTime.toISOString()) + return obj }, fromPartial, I>>(object: I): Proposal { - const message = createBaseProposal(); - message.proposalId = (object.proposalId !== undefined && object.proposalId !== null) - ? Long.fromValue(object.proposalId) - : Long.UZERO; - message.content = (object.content !== undefined && object.content !== null) - ? Any.fromPartial(object.content) - : undefined; - message.status = object.status ?? 0; - message.finalTallyResult = (object.finalTallyResult !== undefined && object.finalTallyResult !== null) - ? TallyResult.fromPartial(object.finalTallyResult) - : undefined; - message.submitTime = object.submitTime ?? undefined; - message.depositEndTime = object.depositEndTime ?? undefined; - message.totalDeposit = object.totalDeposit?.map((e) => Coin.fromPartial(e)) || []; - message.votingStartTime = object.votingStartTime ?? undefined; - message.votingEndTime = object.votingEndTime ?? undefined; - return message; - }, -}; + const message = createBaseProposal() + message.proposalId = + object.proposalId !== undefined && object.proposalId !== null + ? Long.fromValue(object.proposalId) + : Long.UZERO + message.content = + object.content !== undefined && object.content !== null + ? Any.fromPartial(object.content) + : undefined + message.status = object.status ?? 0 + message.finalTallyResult = + object.finalTallyResult !== undefined && object.finalTallyResult !== null + ? TallyResult.fromPartial(object.finalTallyResult) + : undefined + message.submitTime = object.submitTime ?? undefined + message.depositEndTime = object.depositEndTime ?? undefined + message.totalDeposit = object.totalDeposit?.map((e) => Coin.fromPartial(e)) || [] + message.votingStartTime = object.votingStartTime ?? undefined + message.votingEndTime = object.votingEndTime ?? undefined + return message + }, +} function createBaseTallyResult(): TallyResult { - return { yes: "", abstain: "", no: "", noWithVeto: "" }; + return { yes: "", abstain: "", no: "", noWithVeto: "" } } export const TallyResult = { encode(message: TallyResult, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.yes !== "") { - writer.uint32(10).string(message.yes); + writer.uint32(10).string(message.yes) } if (message.abstain !== "") { - writer.uint32(18).string(message.abstain); + writer.uint32(18).string(message.abstain) } if (message.no !== "") { - writer.uint32(26).string(message.no); + writer.uint32(26).string(message.no) } if (message.noWithVeto !== "") { - writer.uint32(34).string(message.noWithVeto); + writer.uint32(34).string(message.noWithVeto) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): TallyResult { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseTallyResult(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseTallyResult() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.yes = reader.string(); - break; + message.yes = reader.string() + break case 2: - message.abstain = reader.string(); - break; + message.abstain = reader.string() + break case 3: - message.no = reader.string(); - break; + message.no = reader.string() + break case 4: - message.noWithVeto = reader.string(); - break; + message.noWithVeto = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): TallyResult { @@ -631,384 +687,419 @@ export const TallyResult = { abstain: isSet(object.abstain) ? String(object.abstain) : "", no: isSet(object.no) ? String(object.no) : "", noWithVeto: isSet(object.noWithVeto) ? String(object.noWithVeto) : "", - }; + } }, toJSON(message: TallyResult): unknown { - const obj: any = {}; - message.yes !== undefined && (obj.yes = message.yes); - message.abstain !== undefined && (obj.abstain = message.abstain); - message.no !== undefined && (obj.no = message.no); - message.noWithVeto !== undefined && (obj.noWithVeto = message.noWithVeto); - return obj; + const obj: any = {} + message.yes !== undefined && (obj.yes = message.yes) + message.abstain !== undefined && (obj.abstain = message.abstain) + message.no !== undefined && (obj.no = message.no) + message.noWithVeto !== undefined && (obj.noWithVeto = message.noWithVeto) + return obj }, fromPartial, I>>(object: I): TallyResult { - const message = createBaseTallyResult(); - message.yes = object.yes ?? ""; - message.abstain = object.abstain ?? ""; - message.no = object.no ?? ""; - message.noWithVeto = object.noWithVeto ?? ""; - return message; + const message = createBaseTallyResult() + message.yes = object.yes ?? "" + message.abstain = object.abstain ?? "" + message.no = object.no ?? "" + message.noWithVeto = object.noWithVeto ?? "" + return message }, -}; +} function createBaseVote(): Vote { - return { proposalId: Long.UZERO, voter: "", option: 0, options: [] }; + return { proposalId: Long.UZERO, voter: "", option: 0, options: [] } } export const Vote = { encode(message: Vote, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (!message.proposalId.isZero()) { - writer.uint32(8).uint64(message.proposalId); + writer.uint32(8).uint64(message.proposalId) } if (message.voter !== "") { - writer.uint32(18).string(message.voter); + writer.uint32(18).string(message.voter) } if (message.option !== 0) { - writer.uint32(24).int32(message.option); + writer.uint32(24).int32(message.option) } for (const v of message.options) { - WeightedVoteOption.encode(v!, writer.uint32(34).fork()).ldelim(); + WeightedVoteOption.encode(v!, writer.uint32(34).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Vote { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseVote(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseVote() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.proposalId = reader.uint64() as Long; - break; + message.proposalId = reader.uint64() as Long + break case 2: - message.voter = reader.string(); - break; + message.voter = reader.string() + break case 3: - message.option = reader.int32() as any; - break; + message.option = reader.int32() as any + break case 4: - message.options.push(WeightedVoteOption.decode(reader, reader.uint32())); - break; + message.options.push(WeightedVoteOption.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Vote { return { - proposalId: isSet(object.proposalId) ? Long.fromValue(object.proposalId) : Long.UZERO, + proposalId: isSet(object.proposalId) + ? Long.fromValue(object.proposalId) + : Long.UZERO, voter: isSet(object.voter) ? String(object.voter) : "", option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, - options: Array.isArray(object?.options) ? object.options.map((e: any) => WeightedVoteOption.fromJSON(e)) : [], - }; + options: Array.isArray(object?.options) + ? object.options.map((e: any) => WeightedVoteOption.fromJSON(e)) + : [], + } }, toJSON(message: Vote): unknown { - const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); - message.voter !== undefined && (obj.voter = message.voter); - message.option !== undefined && (obj.option = voteOptionToJSON(message.option)); + const obj: any = {} + message.proposalId !== undefined && + (obj.proposalId = (message.proposalId || Long.UZERO).toString()) + message.voter !== undefined && (obj.voter = message.voter) + message.option !== undefined && (obj.option = voteOptionToJSON(message.option)) if (message.options) { - obj.options = message.options.map((e) => e ? WeightedVoteOption.toJSON(e) : undefined); + obj.options = message.options.map((e) => + e ? WeightedVoteOption.toJSON(e) : undefined, + ) } else { - obj.options = []; + obj.options = [] } - return obj; + return obj }, fromPartial, I>>(object: I): Vote { - const message = createBaseVote(); - message.proposalId = (object.proposalId !== undefined && object.proposalId !== null) - ? Long.fromValue(object.proposalId) - : Long.UZERO; - message.voter = object.voter ?? ""; - message.option = object.option ?? 0; - message.options = object.options?.map((e) => WeightedVoteOption.fromPartial(e)) || []; - return message; + const message = createBaseVote() + message.proposalId = + object.proposalId !== undefined && object.proposalId !== null + ? Long.fromValue(object.proposalId) + : Long.UZERO + message.voter = object.voter ?? "" + message.option = object.option ?? 0 + message.options = + object.options?.map((e) => WeightedVoteOption.fromPartial(e)) || [] + return message }, -}; +} function createBaseDepositParams(): DepositParams { - return { minDeposit: [], maxDepositPeriod: undefined }; + return { minDeposit: [], maxDepositPeriod: undefined } } export const DepositParams = { encode(message: DepositParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.minDeposit) { - Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + Coin.encode(v!, writer.uint32(10).fork()).ldelim() } if (message.maxDepositPeriod !== undefined) { - Duration.encode(message.maxDepositPeriod, writer.uint32(18).fork()).ldelim(); + Duration.encode(message.maxDepositPeriod, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): DepositParams { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDepositParams(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseDepositParams() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.minDeposit.push(Coin.decode(reader, reader.uint32())); - break; + message.minDeposit.push(Coin.decode(reader, reader.uint32())) + break case 2: - message.maxDepositPeriod = Duration.decode(reader, reader.uint32()); - break; + message.maxDepositPeriod = Duration.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): DepositParams { return { - minDeposit: Array.isArray(object?.minDeposit) ? object.minDeposit.map((e: any) => Coin.fromJSON(e)) : [], - maxDepositPeriod: isSet(object.maxDepositPeriod) ? Duration.fromJSON(object.maxDepositPeriod) : undefined, - }; + minDeposit: Array.isArray(object?.minDeposit) + ? object.minDeposit.map((e: any) => Coin.fromJSON(e)) + : [], + maxDepositPeriod: isSet(object.maxDepositPeriod) + ? Duration.fromJSON(object.maxDepositPeriod) + : undefined, + } }, toJSON(message: DepositParams): unknown { - const obj: any = {}; + const obj: any = {} if (message.minDeposit) { - obj.minDeposit = message.minDeposit.map((e) => e ? Coin.toJSON(e) : undefined); + obj.minDeposit = message.minDeposit.map((e) => (e ? Coin.toJSON(e) : undefined)) } else { - obj.minDeposit = []; + obj.minDeposit = [] } message.maxDepositPeriod !== undefined && - (obj.maxDepositPeriod = message.maxDepositPeriod ? Duration.toJSON(message.maxDepositPeriod) : undefined); - return obj; + (obj.maxDepositPeriod = message.maxDepositPeriod + ? Duration.toJSON(message.maxDepositPeriod) + : undefined) + return obj }, - fromPartial, I>>(object: I): DepositParams { - const message = createBaseDepositParams(); - message.minDeposit = object.minDeposit?.map((e) => Coin.fromPartial(e)) || []; - message.maxDepositPeriod = (object.maxDepositPeriod !== undefined && object.maxDepositPeriod !== null) - ? Duration.fromPartial(object.maxDepositPeriod) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): DepositParams { + const message = createBaseDepositParams() + message.minDeposit = object.minDeposit?.map((e) => Coin.fromPartial(e)) || [] + message.maxDepositPeriod = + object.maxDepositPeriod !== undefined && object.maxDepositPeriod !== null + ? Duration.fromPartial(object.maxDepositPeriod) + : undefined + return message }, -}; +} function createBaseVotingParams(): VotingParams { - return { votingPeriod: undefined }; + return { votingPeriod: undefined } } export const VotingParams = { encode(message: VotingParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.votingPeriod !== undefined) { - Duration.encode(message.votingPeriod, writer.uint32(10).fork()).ldelim(); + Duration.encode(message.votingPeriod, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): VotingParams { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseVotingParams(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseVotingParams() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.votingPeriod = Duration.decode(reader, reader.uint32()); - break; + message.votingPeriod = Duration.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): VotingParams { - return { votingPeriod: isSet(object.votingPeriod) ? Duration.fromJSON(object.votingPeriod) : undefined }; + return { + votingPeriod: isSet(object.votingPeriod) + ? Duration.fromJSON(object.votingPeriod) + : undefined, + } }, toJSON(message: VotingParams): unknown { - const obj: any = {}; + const obj: any = {} message.votingPeriod !== undefined && - (obj.votingPeriod = message.votingPeriod ? Duration.toJSON(message.votingPeriod) : undefined); - return obj; + (obj.votingPeriod = message.votingPeriod + ? Duration.toJSON(message.votingPeriod) + : undefined) + return obj }, fromPartial, I>>(object: I): VotingParams { - const message = createBaseVotingParams(); - message.votingPeriod = (object.votingPeriod !== undefined && object.votingPeriod !== null) - ? Duration.fromPartial(object.votingPeriod) - : undefined; - return message; + const message = createBaseVotingParams() + message.votingPeriod = + object.votingPeriod !== undefined && object.votingPeriod !== null + ? Duration.fromPartial(object.votingPeriod) + : undefined + return message }, -}; +} function createBaseTallyParams(): TallyParams { - return { quorum: new Uint8Array(), threshold: new Uint8Array(), vetoThreshold: new Uint8Array() }; + return { + quorum: new Uint8Array(), + threshold: new Uint8Array(), + vetoThreshold: new Uint8Array(), + } } export const TallyParams = { encode(message: TallyParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.quorum.length !== 0) { - writer.uint32(10).bytes(message.quorum); + writer.uint32(10).bytes(message.quorum) } if (message.threshold.length !== 0) { - writer.uint32(18).bytes(message.threshold); + writer.uint32(18).bytes(message.threshold) } if (message.vetoThreshold.length !== 0) { - writer.uint32(26).bytes(message.vetoThreshold); + writer.uint32(26).bytes(message.vetoThreshold) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): TallyParams { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseTallyParams(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseTallyParams() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.quorum = reader.bytes(); - break; + message.quorum = reader.bytes() + break case 2: - message.threshold = reader.bytes(); - break; + message.threshold = reader.bytes() + break case 3: - message.vetoThreshold = reader.bytes(); - break; + message.vetoThreshold = reader.bytes() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): TallyParams { return { quorum: isSet(object.quorum) ? bytesFromBase64(object.quorum) : new Uint8Array(), - threshold: isSet(object.threshold) ? bytesFromBase64(object.threshold) : new Uint8Array(), - vetoThreshold: isSet(object.vetoThreshold) ? bytesFromBase64(object.vetoThreshold) : new Uint8Array(), - }; + threshold: isSet(object.threshold) + ? bytesFromBase64(object.threshold) + : new Uint8Array(), + vetoThreshold: isSet(object.vetoThreshold) + ? bytesFromBase64(object.vetoThreshold) + : new Uint8Array(), + } }, toJSON(message: TallyParams): unknown { - const obj: any = {}; + const obj: any = {} message.quorum !== undefined && - (obj.quorum = base64FromBytes(message.quorum !== undefined ? message.quorum : new Uint8Array())); + (obj.quorum = base64FromBytes( + message.quorum !== undefined ? message.quorum : new Uint8Array(), + )) message.threshold !== undefined && - (obj.threshold = base64FromBytes(message.threshold !== undefined ? message.threshold : new Uint8Array())); + (obj.threshold = base64FromBytes( + message.threshold !== undefined ? message.threshold : new Uint8Array(), + )) message.vetoThreshold !== undefined && (obj.vetoThreshold = base64FromBytes( message.vetoThreshold !== undefined ? message.vetoThreshold : new Uint8Array(), - )); - return obj; + )) + return obj }, fromPartial, I>>(object: I): TallyParams { - const message = createBaseTallyParams(); - message.quorum = object.quorum ?? new Uint8Array(); - message.threshold = object.threshold ?? new Uint8Array(); - message.vetoThreshold = object.vetoThreshold ?? new Uint8Array(); - return message; + const message = createBaseTallyParams() + message.quorum = object.quorum ?? new Uint8Array() + message.threshold = object.threshold ?? new Uint8Array() + message.vetoThreshold = object.vetoThreshold ?? new Uint8Array() + return message }, -}; +} -declare var self: any | undefined; -declare var window: any | undefined; -declare var global: any | undefined; +declare var self: any | undefined +declare var window: any | undefined +declare var global: any | undefined var globalThis: any = (() => { - if (typeof globalThis !== "undefined") { - return globalThis; - } - if (typeof self !== "undefined") { - return self; - } - if (typeof window !== "undefined") { - return window; - } - if (typeof global !== "undefined") { - return global; - } - throw "Unable to locate global object"; -})(); - + if (typeof globalThis !== "undefined") return globalThis + if (typeof self !== "undefined") return self + if (typeof window !== "undefined") return window + if (typeof global !== "undefined") return global + throw "Unable to locate global object" +})() + +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")) function bytesFromBase64(b64: string): Uint8Array { - if (globalThis.Buffer) { - return Uint8Array.from(globalThis.Buffer.from(b64, "base64")); - } else { - const bin = globalThis.atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; + 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 } +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")) function base64FromBytes(arr: Uint8Array): string { - if (globalThis.Buffer) { - return globalThis.Buffer.from(arr).toString("base64"); - } else { - const bin: string[] = []; - arr.forEach((byte) => { - bin.push(String.fromCharCode(byte)); - }); - return globalThis.btoa(bin.join("")); - } + const bin: string[] = [] + arr.forEach((byte) => { + bin.push(String.fromCharCode(byte)) + }) + return btoa(bin.join("")) } -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > function toTimestamp(date: Date): Timestamp { - const seconds = numberToLong(date.getTime() / 1_000); - const nanos = (date.getTime() % 1_000) * 1_000_000; - return { seconds, nanos }; + const seconds = numberToLong(date.getTime() / 1_000) + const nanos = (date.getTime() % 1_000) * 1_000_000 + return { seconds, nanos } } function fromTimestamp(t: Timestamp): Date { - let millis = t.seconds.toNumber() * 1_000; - millis += t.nanos / 1_000_000; - return new Date(millis); + let millis = t.seconds.toNumber() * 1_000 + millis += t.nanos / 1_000_000 + return new Date(millis) } function fromJsonTimestamp(o: any): Date { if (o instanceof Date) { - return o; + return o } else if (typeof o === "string") { - return new Date(o); + return new Date(o) } else { - return fromTimestamp(Timestamp.fromJSON(o)); + return fromTimestamp(Timestamp.fromJSON(o)) } } function numberToLong(number: number) { - return Long.fromNumber(number); + return Long.fromNumber(number) } if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/cosmos/gov/v1beta1/query.ts b/packages/protojs/src/cosmos/gov/v1beta1/query.ts index 3c5f7f18..09d5abb8 100644 --- a/packages/protojs/src/cosmos/gov/v1beta1/query.ts +++ b/packages/protojs/src/cosmos/gov/v1beta1/query.ts @@ -1,43 +1,43 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { PageRequest, PageResponse } from "../../base/query/v1beta1/pagination"; import { - Deposit, - DepositParams, Proposal, ProposalStatus, - proposalStatusFromJSON, - proposalStatusToJSON, - TallyParams, - TallyResult, Vote, VotingParams, -} from "./gov"; + DepositParams, + TallyParams, + Deposit, + TallyResult, + proposalStatusFromJSON, + proposalStatusToJSON, +} from "./gov" +import { PageRequest, PageResponse } from "../../base/query/v1beta1/pagination" +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "cosmos.gov.v1beta1"; +export const protobufPackage = "cosmos.gov.v1beta1" /** QueryProposalRequest is the request type for the Query/Proposal RPC method. */ export interface QueryProposalRequest { /** proposal_id defines the unique id of the proposal. */ - proposalId: Long; + proposalId: Long } /** QueryProposalResponse is the response type for the Query/Proposal RPC method. */ export interface QueryProposalResponse { - proposal?: Proposal; + proposal?: Proposal } /** QueryProposalsRequest is the request type for the Query/Proposals RPC method. */ export interface QueryProposalsRequest { /** proposal_status defines the status of the proposals. */ - proposalStatus: ProposalStatus; + proposalStatus: ProposalStatus /** voter defines the voter address for the proposals. */ - voter: string; + voter: string /** depositor defines the deposit addresses from the proposals. */ - depositor: string; + depositor: string /** pagination defines an optional pagination for the request. */ - pagination?: PageRequest; + pagination?: PageRequest } /** @@ -45,39 +45,39 @@ export interface QueryProposalsRequest { * method. */ export interface QueryProposalsResponse { - proposals: Proposal[]; + proposals: Proposal[] /** pagination defines the pagination in the response. */ - pagination?: PageResponse; + pagination?: PageResponse } /** QueryVoteRequest is the request type for the Query/Vote RPC method. */ export interface QueryVoteRequest { /** proposal_id defines the unique id of the proposal. */ - proposalId: Long; + proposalId: Long /** voter defines the oter address for the proposals. */ - voter: string; + voter: string } /** QueryVoteResponse is the response type for the Query/Vote RPC method. */ export interface QueryVoteResponse { /** vote defined the queried vote. */ - vote?: Vote; + vote?: Vote } /** QueryVotesRequest is the request type for the Query/Votes RPC method. */ export interface QueryVotesRequest { /** proposal_id defines the unique id of the proposal. */ - proposalId: Long; + proposalId: Long /** pagination defines an optional pagination for the request. */ - pagination?: PageRequest; + pagination?: PageRequest } /** QueryVotesResponse is the response type for the Query/Votes RPC method. */ export interface QueryVotesResponse { /** votes defined the queried votes. */ - votes: Vote[]; + votes: Vote[] /** pagination defines the pagination in the response. */ - pagination?: PageResponse; + pagination?: PageResponse } /** QueryParamsRequest is the request type for the Query/Params RPC method. */ @@ -86,1098 +86,1290 @@ export interface QueryParamsRequest { * params_type defines which parameters to query for, can be one of "voting", * "tallying" or "deposit". */ - paramsType: string; + paramsType: string } /** QueryParamsResponse is the response type for the Query/Params RPC method. */ export interface QueryParamsResponse { /** voting_params defines the parameters related to voting. */ - votingParams?: VotingParams; + votingParams?: VotingParams /** deposit_params defines the parameters related to deposit. */ - depositParams?: DepositParams; + depositParams?: DepositParams /** tally_params defines the parameters related to tally. */ - tallyParams?: TallyParams; + tallyParams?: TallyParams } /** QueryDepositRequest is the request type for the Query/Deposit RPC method. */ export interface QueryDepositRequest { /** proposal_id defines the unique id of the proposal. */ - proposalId: Long; + proposalId: Long /** depositor defines the deposit addresses from the proposals. */ - depositor: string; + depositor: string } /** QueryDepositResponse is the response type for the Query/Deposit RPC method. */ export interface QueryDepositResponse { /** deposit defines the requested deposit. */ - deposit?: Deposit; + deposit?: Deposit } /** QueryDepositsRequest is the request type for the Query/Deposits RPC method. */ export interface QueryDepositsRequest { /** proposal_id defines the unique id of the proposal. */ - proposalId: Long; + proposalId: Long /** pagination defines an optional pagination for the request. */ - pagination?: PageRequest; + pagination?: PageRequest } /** QueryDepositsResponse is the response type for the Query/Deposits RPC method. */ export interface QueryDepositsResponse { - deposits: Deposit[]; + deposits: Deposit[] /** pagination defines the pagination in the response. */ - pagination?: PageResponse; + pagination?: PageResponse } /** QueryTallyResultRequest is the request type for the Query/Tally RPC method. */ export interface QueryTallyResultRequest { /** proposal_id defines the unique id of the proposal. */ - proposalId: Long; + proposalId: Long } /** QueryTallyResultResponse is the response type for the Query/Tally RPC method. */ export interface QueryTallyResultResponse { /** tally defines the requested tally. */ - tally?: TallyResult; + tally?: TallyResult } function createBaseQueryProposalRequest(): QueryProposalRequest { - return { proposalId: Long.UZERO }; + return { proposalId: Long.UZERO } } export const QueryProposalRequest = { - encode(message: QueryProposalRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryProposalRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (!message.proposalId.isZero()) { - writer.uint32(8).uint64(message.proposalId); + writer.uint32(8).uint64(message.proposalId) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryProposalRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryProposalRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryProposalRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.proposalId = reader.uint64() as Long; - break; + message.proposalId = reader.uint64() as Long + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryProposalRequest { - return { proposalId: isSet(object.proposalId) ? Long.fromValue(object.proposalId) : Long.UZERO }; + return { + proposalId: isSet(object.proposalId) + ? Long.fromValue(object.proposalId) + : Long.UZERO, + } }, toJSON(message: QueryProposalRequest): unknown { - const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); - return obj; - }, - - fromPartial, I>>(object: I): QueryProposalRequest { - const message = createBaseQueryProposalRequest(); - message.proposalId = (object.proposalId !== undefined && object.proposalId !== null) - ? Long.fromValue(object.proposalId) - : Long.UZERO; - return message; + const obj: any = {} + message.proposalId !== undefined && + (obj.proposalId = (message.proposalId || Long.UZERO).toString()) + return obj + }, + + fromPartial, I>>( + object: I, + ): QueryProposalRequest { + const message = createBaseQueryProposalRequest() + message.proposalId = + object.proposalId !== undefined && object.proposalId !== null + ? Long.fromValue(object.proposalId) + : Long.UZERO + return message }, -}; +} function createBaseQueryProposalResponse(): QueryProposalResponse { - return { proposal: undefined }; + return { proposal: undefined } } export const QueryProposalResponse = { - encode(message: QueryProposalResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryProposalResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.proposal !== undefined) { - Proposal.encode(message.proposal, writer.uint32(10).fork()).ldelim(); + Proposal.encode(message.proposal, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryProposalResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryProposalResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryProposalResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.proposal = Proposal.decode(reader, reader.uint32()); - break; + message.proposal = Proposal.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryProposalResponse { - return { proposal: isSet(object.proposal) ? Proposal.fromJSON(object.proposal) : undefined }; + return { + proposal: isSet(object.proposal) ? Proposal.fromJSON(object.proposal) : undefined, + } }, toJSON(message: QueryProposalResponse): unknown { - const obj: any = {}; - message.proposal !== undefined && (obj.proposal = message.proposal ? Proposal.toJSON(message.proposal) : undefined); - return obj; - }, - - fromPartial, I>>(object: I): QueryProposalResponse { - const message = createBaseQueryProposalResponse(); - message.proposal = (object.proposal !== undefined && object.proposal !== null) - ? Proposal.fromPartial(object.proposal) - : undefined; - return message; + const obj: any = {} + message.proposal !== undefined && + (obj.proposal = message.proposal ? Proposal.toJSON(message.proposal) : undefined) + return obj + }, + + fromPartial, I>>( + object: I, + ): QueryProposalResponse { + const message = createBaseQueryProposalResponse() + message.proposal = + object.proposal !== undefined && object.proposal !== null + ? Proposal.fromPartial(object.proposal) + : undefined + return message }, -}; +} function createBaseQueryProposalsRequest(): QueryProposalsRequest { - return { proposalStatus: 0, voter: "", depositor: "", pagination: undefined }; + return { proposalStatus: 0, voter: "", depositor: "", pagination: undefined } } export const QueryProposalsRequest = { - encode(message: QueryProposalsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryProposalsRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.proposalStatus !== 0) { - writer.uint32(8).int32(message.proposalStatus); + writer.uint32(8).int32(message.proposalStatus) } if (message.voter !== "") { - writer.uint32(18).string(message.voter); + writer.uint32(18).string(message.voter) } if (message.depositor !== "") { - writer.uint32(26).string(message.depositor); + writer.uint32(26).string(message.depositor) } if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(34).fork()).ldelim(); + PageRequest.encode(message.pagination, writer.uint32(34).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryProposalsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryProposalsRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryProposalsRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.proposalStatus = reader.int32() as any; - break; + message.proposalStatus = reader.int32() as any + break case 2: - message.voter = reader.string(); - break; + message.voter = reader.string() + break case 3: - message.depositor = reader.string(); - break; + message.depositor = reader.string() + break case 4: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; + message.pagination = PageRequest.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryProposalsRequest { return { - proposalStatus: isSet(object.proposalStatus) ? proposalStatusFromJSON(object.proposalStatus) : 0, + proposalStatus: isSet(object.proposalStatus) + ? proposalStatusFromJSON(object.proposalStatus) + : 0, voter: isSet(object.voter) ? String(object.voter) : "", depositor: isSet(object.depositor) ? String(object.depositor) : "", - pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined, - }; + pagination: isSet(object.pagination) + ? PageRequest.fromJSON(object.pagination) + : undefined, + } }, toJSON(message: QueryProposalsRequest): unknown { - const obj: any = {}; - message.proposalStatus !== undefined && (obj.proposalStatus = proposalStatusToJSON(message.proposalStatus)); - message.voter !== undefined && (obj.voter = message.voter); - message.depositor !== undefined && (obj.depositor = message.depositor); + const obj: any = {} + message.proposalStatus !== undefined && + (obj.proposalStatus = proposalStatusToJSON(message.proposalStatus)) + message.voter !== undefined && (obj.voter = message.voter) + message.depositor !== undefined && (obj.depositor = message.depositor) message.pagination !== undefined && - (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); - return obj; - }, - - fromPartial, I>>(object: I): QueryProposalsRequest { - const message = createBaseQueryProposalsRequest(); - message.proposalStatus = object.proposalStatus ?? 0; - message.voter = object.voter ?? ""; - message.depositor = object.depositor ?? ""; - message.pagination = (object.pagination !== undefined && object.pagination !== null) - ? PageRequest.fromPartial(object.pagination) - : undefined; - return message; + (obj.pagination = message.pagination + ? PageRequest.toJSON(message.pagination) + : undefined) + return obj + }, + + fromPartial, I>>( + object: I, + ): QueryProposalsRequest { + const message = createBaseQueryProposalsRequest() + message.proposalStatus = object.proposalStatus ?? 0 + message.voter = object.voter ?? "" + message.depositor = object.depositor ?? "" + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageRequest.fromPartial(object.pagination) + : undefined + return message }, -}; +} function createBaseQueryProposalsResponse(): QueryProposalsResponse { - return { proposals: [], pagination: undefined }; + return { proposals: [], pagination: undefined } } export const QueryProposalsResponse = { - encode(message: QueryProposalsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryProposalsResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { for (const v of message.proposals) { - Proposal.encode(v!, writer.uint32(10).fork()).ldelim(); + Proposal.encode(v!, writer.uint32(10).fork()).ldelim() } if (message.pagination !== undefined) { - PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryProposalsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryProposalsResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryProposalsResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.proposals.push(Proposal.decode(reader, reader.uint32())); - break; + message.proposals.push(Proposal.decode(reader, reader.uint32())) + break case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; + message.pagination = PageResponse.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryProposalsResponse { return { - proposals: Array.isArray(object?.proposals) ? object.proposals.map((e: any) => Proposal.fromJSON(e)) : [], - pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, - }; + proposals: Array.isArray(object?.proposals) + ? object.proposals.map((e: any) => Proposal.fromJSON(e)) + : [], + pagination: isSet(object.pagination) + ? PageResponse.fromJSON(object.pagination) + : undefined, + } }, toJSON(message: QueryProposalsResponse): unknown { - const obj: any = {}; + const obj: any = {} if (message.proposals) { - obj.proposals = message.proposals.map((e) => e ? Proposal.toJSON(e) : undefined); + obj.proposals = message.proposals.map((e) => (e ? Proposal.toJSON(e) : undefined)) } else { - obj.proposals = []; + obj.proposals = [] } message.pagination !== undefined && - (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); - return obj; + (obj.pagination = message.pagination + ? PageResponse.toJSON(message.pagination) + : undefined) + return obj + }, + + fromPartial, I>>( + object: I, + ): QueryProposalsResponse { + const message = createBaseQueryProposalsResponse() + message.proposals = object.proposals?.map((e) => Proposal.fromPartial(e)) || [] + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageResponse.fromPartial(object.pagination) + : undefined + return message }, - - fromPartial, I>>(object: I): QueryProposalsResponse { - const message = createBaseQueryProposalsResponse(); - message.proposals = object.proposals?.map((e) => Proposal.fromPartial(e)) || []; - message.pagination = (object.pagination !== undefined && object.pagination !== null) - ? PageResponse.fromPartial(object.pagination) - : undefined; - return message; - }, -}; +} function createBaseQueryVoteRequest(): QueryVoteRequest { - return { proposalId: Long.UZERO, voter: "" }; + return { proposalId: Long.UZERO, voter: "" } } export const QueryVoteRequest = { - encode(message: QueryVoteRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryVoteRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (!message.proposalId.isZero()) { - writer.uint32(8).uint64(message.proposalId); + writer.uint32(8).uint64(message.proposalId) } if (message.voter !== "") { - writer.uint32(18).string(message.voter); + writer.uint32(18).string(message.voter) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryVoteRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryVoteRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryVoteRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.proposalId = reader.uint64() as Long; - break; + message.proposalId = reader.uint64() as Long + break case 2: - message.voter = reader.string(); - break; + message.voter = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryVoteRequest { return { - proposalId: isSet(object.proposalId) ? Long.fromValue(object.proposalId) : Long.UZERO, + proposalId: isSet(object.proposalId) + ? Long.fromValue(object.proposalId) + : Long.UZERO, voter: isSet(object.voter) ? String(object.voter) : "", - }; + } }, toJSON(message: QueryVoteRequest): unknown { - const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); - message.voter !== undefined && (obj.voter = message.voter); - return obj; + const obj: any = {} + message.proposalId !== undefined && + (obj.proposalId = (message.proposalId || Long.UZERO).toString()) + message.voter !== undefined && (obj.voter = message.voter) + return obj + }, + + fromPartial, I>>( + object: I, + ): QueryVoteRequest { + const message = createBaseQueryVoteRequest() + message.proposalId = + object.proposalId !== undefined && object.proposalId !== null + ? Long.fromValue(object.proposalId) + : Long.UZERO + message.voter = object.voter ?? "" + return message }, - - fromPartial, I>>(object: I): QueryVoteRequest { - const message = createBaseQueryVoteRequest(); - message.proposalId = (object.proposalId !== undefined && object.proposalId !== null) - ? Long.fromValue(object.proposalId) - : Long.UZERO; - message.voter = object.voter ?? ""; - return message; - }, -}; +} function createBaseQueryVoteResponse(): QueryVoteResponse { - return { vote: undefined }; + return { vote: undefined } } export const QueryVoteResponse = { - encode(message: QueryVoteResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryVoteResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.vote !== undefined) { - Vote.encode(message.vote, writer.uint32(10).fork()).ldelim(); + Vote.encode(message.vote, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryVoteResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryVoteResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryVoteResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.vote = Vote.decode(reader, reader.uint32()); - break; + message.vote = Vote.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryVoteResponse { - return { vote: isSet(object.vote) ? Vote.fromJSON(object.vote) : undefined }; + return { + vote: isSet(object.vote) ? Vote.fromJSON(object.vote) : undefined, + } }, toJSON(message: QueryVoteResponse): unknown { - const obj: any = {}; - message.vote !== undefined && (obj.vote = message.vote ? Vote.toJSON(message.vote) : undefined); - return obj; - }, - - fromPartial, I>>(object: I): QueryVoteResponse { - const message = createBaseQueryVoteResponse(); - message.vote = (object.vote !== undefined && object.vote !== null) ? Vote.fromPartial(object.vote) : undefined; - return message; + const obj: any = {} + message.vote !== undefined && + (obj.vote = message.vote ? Vote.toJSON(message.vote) : undefined) + return obj + }, + + fromPartial, I>>( + object: I, + ): QueryVoteResponse { + const message = createBaseQueryVoteResponse() + message.vote = + object.vote !== undefined && object.vote !== null + ? Vote.fromPartial(object.vote) + : undefined + return message }, -}; +} function createBaseQueryVotesRequest(): QueryVotesRequest { - return { proposalId: Long.UZERO, pagination: undefined }; + return { proposalId: Long.UZERO, pagination: undefined } } export const QueryVotesRequest = { - encode(message: QueryVotesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryVotesRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (!message.proposalId.isZero()) { - writer.uint32(8).uint64(message.proposalId); + writer.uint32(8).uint64(message.proposalId) } if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryVotesRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryVotesRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryVotesRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.proposalId = reader.uint64() as Long; - break; + message.proposalId = reader.uint64() as Long + break case 2: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; + message.pagination = PageRequest.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryVotesRequest { return { - proposalId: isSet(object.proposalId) ? Long.fromValue(object.proposalId) : Long.UZERO, - pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined, - }; + proposalId: isSet(object.proposalId) + ? Long.fromValue(object.proposalId) + : Long.UZERO, + pagination: isSet(object.pagination) + ? PageRequest.fromJSON(object.pagination) + : undefined, + } }, toJSON(message: QueryVotesRequest): unknown { - const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + const obj: any = {} + message.proposalId !== undefined && + (obj.proposalId = (message.proposalId || Long.UZERO).toString()) message.pagination !== undefined && - (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); - return obj; - }, - - fromPartial, I>>(object: I): QueryVotesRequest { - const message = createBaseQueryVotesRequest(); - message.proposalId = (object.proposalId !== undefined && object.proposalId !== null) - ? Long.fromValue(object.proposalId) - : Long.UZERO; - message.pagination = (object.pagination !== undefined && object.pagination !== null) - ? PageRequest.fromPartial(object.pagination) - : undefined; - return message; + (obj.pagination = message.pagination + ? PageRequest.toJSON(message.pagination) + : undefined) + return obj + }, + + fromPartial, I>>( + object: I, + ): QueryVotesRequest { + const message = createBaseQueryVotesRequest() + message.proposalId = + object.proposalId !== undefined && object.proposalId !== null + ? Long.fromValue(object.proposalId) + : Long.UZERO + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageRequest.fromPartial(object.pagination) + : undefined + return message }, -}; +} function createBaseQueryVotesResponse(): QueryVotesResponse { - return { votes: [], pagination: undefined }; + return { votes: [], pagination: undefined } } export const QueryVotesResponse = { - encode(message: QueryVotesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryVotesResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { for (const v of message.votes) { - Vote.encode(v!, writer.uint32(10).fork()).ldelim(); + Vote.encode(v!, writer.uint32(10).fork()).ldelim() } if (message.pagination !== undefined) { - PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryVotesResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryVotesResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryVotesResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.votes.push(Vote.decode(reader, reader.uint32())); - break; + message.votes.push(Vote.decode(reader, reader.uint32())) + break case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; + message.pagination = PageResponse.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryVotesResponse { return { - votes: Array.isArray(object?.votes) ? object.votes.map((e: any) => Vote.fromJSON(e)) : [], - pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, - }; + votes: Array.isArray(object?.votes) + ? object.votes.map((e: any) => Vote.fromJSON(e)) + : [], + pagination: isSet(object.pagination) + ? PageResponse.fromJSON(object.pagination) + : undefined, + } }, toJSON(message: QueryVotesResponse): unknown { - const obj: any = {}; + const obj: any = {} if (message.votes) { - obj.votes = message.votes.map((e) => e ? Vote.toJSON(e) : undefined); + obj.votes = message.votes.map((e) => (e ? Vote.toJSON(e) : undefined)) } else { - obj.votes = []; + obj.votes = [] } message.pagination !== undefined && - (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); - return obj; - }, - - fromPartial, I>>(object: I): QueryVotesResponse { - const message = createBaseQueryVotesResponse(); - message.votes = object.votes?.map((e) => Vote.fromPartial(e)) || []; - message.pagination = (object.pagination !== undefined && object.pagination !== null) - ? PageResponse.fromPartial(object.pagination) - : undefined; - return message; + (obj.pagination = message.pagination + ? PageResponse.toJSON(message.pagination) + : undefined) + return obj + }, + + fromPartial, I>>( + object: I, + ): QueryVotesResponse { + const message = createBaseQueryVotesResponse() + message.votes = object.votes?.map((e) => Vote.fromPartial(e)) || [] + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageResponse.fromPartial(object.pagination) + : undefined + return message }, -}; +} function createBaseQueryParamsRequest(): QueryParamsRequest { - return { paramsType: "" }; + return { paramsType: "" } } export const QueryParamsRequest = { - encode(message: QueryParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryParamsRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.paramsType !== "") { - writer.uint32(10).string(message.paramsType); + writer.uint32(10).string(message.paramsType) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryParamsRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryParamsRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.paramsType = reader.string(); - break; + message.paramsType = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryParamsRequest { - return { paramsType: isSet(object.paramsType) ? String(object.paramsType) : "" }; + return { + paramsType: isSet(object.paramsType) ? String(object.paramsType) : "", + } }, toJSON(message: QueryParamsRequest): unknown { - const obj: any = {}; - message.paramsType !== undefined && (obj.paramsType = message.paramsType); - return obj; + const obj: any = {} + message.paramsType !== undefined && (obj.paramsType = message.paramsType) + return obj }, - fromPartial, I>>(object: I): QueryParamsRequest { - const message = createBaseQueryParamsRequest(); - message.paramsType = object.paramsType ?? ""; - return message; + fromPartial, I>>( + object: I, + ): QueryParamsRequest { + const message = createBaseQueryParamsRequest() + message.paramsType = object.paramsType ?? "" + return message }, -}; +} function createBaseQueryParamsResponse(): QueryParamsResponse { - return { votingParams: undefined, depositParams: undefined, tallyParams: undefined }; + return { votingParams: undefined, depositParams: undefined, tallyParams: undefined } } export const QueryParamsResponse = { - encode(message: QueryParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryParamsResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.votingParams !== undefined) { - VotingParams.encode(message.votingParams, writer.uint32(10).fork()).ldelim(); + VotingParams.encode(message.votingParams, writer.uint32(10).fork()).ldelim() } if (message.depositParams !== undefined) { - DepositParams.encode(message.depositParams, writer.uint32(18).fork()).ldelim(); + DepositParams.encode(message.depositParams, writer.uint32(18).fork()).ldelim() } if (message.tallyParams !== undefined) { - TallyParams.encode(message.tallyParams, writer.uint32(26).fork()).ldelim(); + TallyParams.encode(message.tallyParams, writer.uint32(26).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryParamsResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryParamsResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.votingParams = VotingParams.decode(reader, reader.uint32()); - break; + message.votingParams = VotingParams.decode(reader, reader.uint32()) + break case 2: - message.depositParams = DepositParams.decode(reader, reader.uint32()); - break; + message.depositParams = DepositParams.decode(reader, reader.uint32()) + break case 3: - message.tallyParams = TallyParams.decode(reader, reader.uint32()); - break; + message.tallyParams = TallyParams.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryParamsResponse { return { - votingParams: isSet(object.votingParams) ? VotingParams.fromJSON(object.votingParams) : undefined, - depositParams: isSet(object.depositParams) ? DepositParams.fromJSON(object.depositParams) : undefined, - tallyParams: isSet(object.tallyParams) ? TallyParams.fromJSON(object.tallyParams) : undefined, - }; + votingParams: isSet(object.votingParams) + ? VotingParams.fromJSON(object.votingParams) + : undefined, + depositParams: isSet(object.depositParams) + ? DepositParams.fromJSON(object.depositParams) + : undefined, + tallyParams: isSet(object.tallyParams) + ? TallyParams.fromJSON(object.tallyParams) + : undefined, + } }, toJSON(message: QueryParamsResponse): unknown { - const obj: any = {}; + const obj: any = {} message.votingParams !== undefined && - (obj.votingParams = message.votingParams ? VotingParams.toJSON(message.votingParams) : undefined); + (obj.votingParams = message.votingParams + ? VotingParams.toJSON(message.votingParams) + : undefined) message.depositParams !== undefined && - (obj.depositParams = message.depositParams ? DepositParams.toJSON(message.depositParams) : undefined); + (obj.depositParams = message.depositParams + ? DepositParams.toJSON(message.depositParams) + : undefined) message.tallyParams !== undefined && - (obj.tallyParams = message.tallyParams ? TallyParams.toJSON(message.tallyParams) : undefined); - return obj; - }, - - fromPartial, I>>(object: I): QueryParamsResponse { - const message = createBaseQueryParamsResponse(); - message.votingParams = (object.votingParams !== undefined && object.votingParams !== null) - ? VotingParams.fromPartial(object.votingParams) - : undefined; - message.depositParams = (object.depositParams !== undefined && object.depositParams !== null) - ? DepositParams.fromPartial(object.depositParams) - : undefined; - message.tallyParams = (object.tallyParams !== undefined && object.tallyParams !== null) - ? TallyParams.fromPartial(object.tallyParams) - : undefined; - return message; + (obj.tallyParams = message.tallyParams + ? TallyParams.toJSON(message.tallyParams) + : undefined) + return obj + }, + + fromPartial, I>>( + object: I, + ): QueryParamsResponse { + const message = createBaseQueryParamsResponse() + message.votingParams = + object.votingParams !== undefined && object.votingParams !== null + ? VotingParams.fromPartial(object.votingParams) + : undefined + message.depositParams = + object.depositParams !== undefined && object.depositParams !== null + ? DepositParams.fromPartial(object.depositParams) + : undefined + message.tallyParams = + object.tallyParams !== undefined && object.tallyParams !== null + ? TallyParams.fromPartial(object.tallyParams) + : undefined + return message }, -}; +} function createBaseQueryDepositRequest(): QueryDepositRequest { - return { proposalId: Long.UZERO, depositor: "" }; + return { proposalId: Long.UZERO, depositor: "" } } export const QueryDepositRequest = { - encode(message: QueryDepositRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryDepositRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (!message.proposalId.isZero()) { - writer.uint32(8).uint64(message.proposalId); + writer.uint32(8).uint64(message.proposalId) } if (message.depositor !== "") { - writer.uint32(18).string(message.depositor); + writer.uint32(18).string(message.depositor) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryDepositRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryDepositRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryDepositRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.proposalId = reader.uint64() as Long; - break; + message.proposalId = reader.uint64() as Long + break case 2: - message.depositor = reader.string(); - break; + message.depositor = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryDepositRequest { return { - proposalId: isSet(object.proposalId) ? Long.fromValue(object.proposalId) : Long.UZERO, + proposalId: isSet(object.proposalId) + ? Long.fromValue(object.proposalId) + : Long.UZERO, depositor: isSet(object.depositor) ? String(object.depositor) : "", - }; + } }, toJSON(message: QueryDepositRequest): unknown { - const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); - message.depositor !== undefined && (obj.depositor = message.depositor); - return obj; + const obj: any = {} + message.proposalId !== undefined && + (obj.proposalId = (message.proposalId || Long.UZERO).toString()) + message.depositor !== undefined && (obj.depositor = message.depositor) + return obj + }, + + fromPartial, I>>( + object: I, + ): QueryDepositRequest { + const message = createBaseQueryDepositRequest() + message.proposalId = + object.proposalId !== undefined && object.proposalId !== null + ? Long.fromValue(object.proposalId) + : Long.UZERO + message.depositor = object.depositor ?? "" + return message }, - - fromPartial, I>>(object: I): QueryDepositRequest { - const message = createBaseQueryDepositRequest(); - message.proposalId = (object.proposalId !== undefined && object.proposalId !== null) - ? Long.fromValue(object.proposalId) - : Long.UZERO; - message.depositor = object.depositor ?? ""; - return message; - }, -}; +} function createBaseQueryDepositResponse(): QueryDepositResponse { - return { deposit: undefined }; + return { deposit: undefined } } export const QueryDepositResponse = { - encode(message: QueryDepositResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryDepositResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.deposit !== undefined) { - Deposit.encode(message.deposit, writer.uint32(10).fork()).ldelim(); + Deposit.encode(message.deposit, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryDepositResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryDepositResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryDepositResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.deposit = Deposit.decode(reader, reader.uint32()); - break; + message.deposit = Deposit.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryDepositResponse { - return { deposit: isSet(object.deposit) ? Deposit.fromJSON(object.deposit) : undefined }; + return { + deposit: isSet(object.deposit) ? Deposit.fromJSON(object.deposit) : undefined, + } }, toJSON(message: QueryDepositResponse): unknown { - const obj: any = {}; - message.deposit !== undefined && (obj.deposit = message.deposit ? Deposit.toJSON(message.deposit) : undefined); - return obj; + const obj: any = {} + message.deposit !== undefined && + (obj.deposit = message.deposit ? Deposit.toJSON(message.deposit) : undefined) + return obj + }, + + fromPartial, I>>( + object: I, + ): QueryDepositResponse { + const message = createBaseQueryDepositResponse() + message.deposit = + object.deposit !== undefined && object.deposit !== null + ? Deposit.fromPartial(object.deposit) + : undefined + return message }, - - fromPartial, I>>(object: I): QueryDepositResponse { - const message = createBaseQueryDepositResponse(); - message.deposit = (object.deposit !== undefined && object.deposit !== null) - ? Deposit.fromPartial(object.deposit) - : undefined; - return message; - }, -}; +} function createBaseQueryDepositsRequest(): QueryDepositsRequest { - return { proposalId: Long.UZERO, pagination: undefined }; + return { proposalId: Long.UZERO, pagination: undefined } } export const QueryDepositsRequest = { - encode(message: QueryDepositsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryDepositsRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (!message.proposalId.isZero()) { - writer.uint32(8).uint64(message.proposalId); + writer.uint32(8).uint64(message.proposalId) } if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryDepositsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryDepositsRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryDepositsRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.proposalId = reader.uint64() as Long; - break; + message.proposalId = reader.uint64() as Long + break case 2: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; + message.pagination = PageRequest.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryDepositsRequest { return { - proposalId: isSet(object.proposalId) ? Long.fromValue(object.proposalId) : Long.UZERO, - pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined, - }; + proposalId: isSet(object.proposalId) + ? Long.fromValue(object.proposalId) + : Long.UZERO, + pagination: isSet(object.pagination) + ? PageRequest.fromJSON(object.pagination) + : undefined, + } }, toJSON(message: QueryDepositsRequest): unknown { - const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + const obj: any = {} + message.proposalId !== undefined && + (obj.proposalId = (message.proposalId || Long.UZERO).toString()) message.pagination !== undefined && - (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); - return obj; - }, - - fromPartial, I>>(object: I): QueryDepositsRequest { - const message = createBaseQueryDepositsRequest(); - message.proposalId = (object.proposalId !== undefined && object.proposalId !== null) - ? Long.fromValue(object.proposalId) - : Long.UZERO; - message.pagination = (object.pagination !== undefined && object.pagination !== null) - ? PageRequest.fromPartial(object.pagination) - : undefined; - return message; + (obj.pagination = message.pagination + ? PageRequest.toJSON(message.pagination) + : undefined) + return obj + }, + + fromPartial, I>>( + object: I, + ): QueryDepositsRequest { + const message = createBaseQueryDepositsRequest() + message.proposalId = + object.proposalId !== undefined && object.proposalId !== null + ? Long.fromValue(object.proposalId) + : Long.UZERO + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageRequest.fromPartial(object.pagination) + : undefined + return message }, -}; +} function createBaseQueryDepositsResponse(): QueryDepositsResponse { - return { deposits: [], pagination: undefined }; + return { deposits: [], pagination: undefined } } export const QueryDepositsResponse = { - encode(message: QueryDepositsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryDepositsResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { for (const v of message.deposits) { - Deposit.encode(v!, writer.uint32(10).fork()).ldelim(); + Deposit.encode(v!, writer.uint32(10).fork()).ldelim() } if (message.pagination !== undefined) { - PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryDepositsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryDepositsResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryDepositsResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.deposits.push(Deposit.decode(reader, reader.uint32())); - break; + message.deposits.push(Deposit.decode(reader, reader.uint32())) + break case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; + message.pagination = PageResponse.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryDepositsResponse { return { - deposits: Array.isArray(object?.deposits) ? object.deposits.map((e: any) => Deposit.fromJSON(e)) : [], - pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, - }; + deposits: Array.isArray(object?.deposits) + ? object.deposits.map((e: any) => Deposit.fromJSON(e)) + : [], + pagination: isSet(object.pagination) + ? PageResponse.fromJSON(object.pagination) + : undefined, + } }, toJSON(message: QueryDepositsResponse): unknown { - const obj: any = {}; + const obj: any = {} if (message.deposits) { - obj.deposits = message.deposits.map((e) => e ? Deposit.toJSON(e) : undefined); + obj.deposits = message.deposits.map((e) => (e ? Deposit.toJSON(e) : undefined)) } else { - obj.deposits = []; + obj.deposits = [] } message.pagination !== undefined && - (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); - return obj; + (obj.pagination = message.pagination + ? PageResponse.toJSON(message.pagination) + : undefined) + return obj + }, + + fromPartial, I>>( + object: I, + ): QueryDepositsResponse { + const message = createBaseQueryDepositsResponse() + message.deposits = object.deposits?.map((e) => Deposit.fromPartial(e)) || [] + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageResponse.fromPartial(object.pagination) + : undefined + return message }, - - fromPartial, I>>(object: I): QueryDepositsResponse { - const message = createBaseQueryDepositsResponse(); - message.deposits = object.deposits?.map((e) => Deposit.fromPartial(e)) || []; - message.pagination = (object.pagination !== undefined && object.pagination !== null) - ? PageResponse.fromPartial(object.pagination) - : undefined; - return message; - }, -}; +} function createBaseQueryTallyResultRequest(): QueryTallyResultRequest { - return { proposalId: Long.UZERO }; + return { proposalId: Long.UZERO } } export const QueryTallyResultRequest = { - encode(message: QueryTallyResultRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryTallyResultRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (!message.proposalId.isZero()) { - writer.uint32(8).uint64(message.proposalId); + writer.uint32(8).uint64(message.proposalId) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryTallyResultRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryTallyResultRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryTallyResultRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.proposalId = reader.uint64() as Long; - break; + message.proposalId = reader.uint64() as Long + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryTallyResultRequest { - return { proposalId: isSet(object.proposalId) ? Long.fromValue(object.proposalId) : Long.UZERO }; + return { + proposalId: isSet(object.proposalId) + ? Long.fromValue(object.proposalId) + : Long.UZERO, + } }, toJSON(message: QueryTallyResultRequest): unknown { - const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); - return obj; + const obj: any = {} + message.proposalId !== undefined && + (obj.proposalId = (message.proposalId || Long.UZERO).toString()) + return obj + }, + + fromPartial, I>>( + object: I, + ): QueryTallyResultRequest { + const message = createBaseQueryTallyResultRequest() + message.proposalId = + object.proposalId !== undefined && object.proposalId !== null + ? Long.fromValue(object.proposalId) + : Long.UZERO + return message }, - - fromPartial, I>>(object: I): QueryTallyResultRequest { - const message = createBaseQueryTallyResultRequest(); - message.proposalId = (object.proposalId !== undefined && object.proposalId !== null) - ? Long.fromValue(object.proposalId) - : Long.UZERO; - return message; - }, -}; +} function createBaseQueryTallyResultResponse(): QueryTallyResultResponse { - return { tally: undefined }; + return { tally: undefined } } export const QueryTallyResultResponse = { - encode(message: QueryTallyResultResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryTallyResultResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.tally !== undefined) { - TallyResult.encode(message.tally, writer.uint32(10).fork()).ldelim(); + TallyResult.encode(message.tally, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryTallyResultResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryTallyResultResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryTallyResultResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.tally = TallyResult.decode(reader, reader.uint32()); - break; + message.tally = TallyResult.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryTallyResultResponse { - return { tally: isSet(object.tally) ? TallyResult.fromJSON(object.tally) : undefined }; + return { + tally: isSet(object.tally) ? TallyResult.fromJSON(object.tally) : undefined, + } }, toJSON(message: QueryTallyResultResponse): unknown { - const obj: any = {}; - message.tally !== undefined && (obj.tally = message.tally ? TallyResult.toJSON(message.tally) : undefined); - return obj; + const obj: any = {} + message.tally !== undefined && + (obj.tally = message.tally ? TallyResult.toJSON(message.tally) : undefined) + return obj + }, + + fromPartial, I>>( + object: I, + ): QueryTallyResultResponse { + const message = createBaseQueryTallyResultResponse() + message.tally = + object.tally !== undefined && object.tally !== null + ? TallyResult.fromPartial(object.tally) + : undefined + return message }, - - fromPartial, I>>(object: I): QueryTallyResultResponse { - const message = createBaseQueryTallyResultResponse(); - message.tally = (object.tally !== undefined && object.tally !== null) - ? TallyResult.fromPartial(object.tally) - : undefined; - return message; - }, -}; +} /** Query defines the gRPC querier service for gov module */ export interface Query { /** Proposal queries proposal details based on ProposalID. */ - Proposal(request: QueryProposalRequest): Promise; + Proposal(request: QueryProposalRequest): Promise /** Proposals queries all proposals based on given status. */ - Proposals(request: QueryProposalsRequest): Promise; + Proposals(request: QueryProposalsRequest): Promise /** Vote queries voted information based on proposalID, voterAddr. */ - Vote(request: QueryVoteRequest): Promise; + Vote(request: QueryVoteRequest): Promise /** Votes queries votes of a given proposal. */ - Votes(request: QueryVotesRequest): Promise; + Votes(request: QueryVotesRequest): Promise /** Params queries all parameters of the gov module. */ - Params(request: QueryParamsRequest): Promise; + Params(request: QueryParamsRequest): Promise /** Deposit queries single deposit information based proposalID, depositAddr. */ - Deposit(request: QueryDepositRequest): Promise; + Deposit(request: QueryDepositRequest): Promise /** Deposits queries all deposits of a single proposal. */ - Deposits(request: QueryDepositsRequest): Promise; + Deposits(request: QueryDepositsRequest): Promise /** TallyResult queries the tally of a proposal vote. */ - TallyResult(request: QueryTallyResultRequest): Promise; + TallyResult(request: QueryTallyResultRequest): Promise } export class QueryClientImpl implements Query { - private readonly rpc: Rpc; + private readonly rpc: Rpc constructor(rpc: Rpc) { - this.rpc = rpc; - this.Proposal = this.Proposal.bind(this); - this.Proposals = this.Proposals.bind(this); - this.Vote = this.Vote.bind(this); - this.Votes = this.Votes.bind(this); - this.Params = this.Params.bind(this); - this.Deposit = this.Deposit.bind(this); - this.Deposits = this.Deposits.bind(this); - this.TallyResult = this.TallyResult.bind(this); + this.rpc = rpc + this.Proposal = this.Proposal.bind(this) + this.Proposals = this.Proposals.bind(this) + this.Vote = this.Vote.bind(this) + this.Votes = this.Votes.bind(this) + this.Params = this.Params.bind(this) + this.Deposit = this.Deposit.bind(this) + this.Deposits = this.Deposits.bind(this) + this.TallyResult = this.TallyResult.bind(this) } Proposal(request: QueryProposalRequest): Promise { - const data = QueryProposalRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.gov.v1beta1.Query", "Proposal", data); - return promise.then((data) => QueryProposalResponse.decode(new _m0.Reader(data))); + const data = QueryProposalRequest.encode(request).finish() + const promise = this.rpc.request("cosmos.gov.v1beta1.Query", "Proposal", data) + return promise.then((data) => QueryProposalResponse.decode(new _m0.Reader(data))) } Proposals(request: QueryProposalsRequest): Promise { - const data = QueryProposalsRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.gov.v1beta1.Query", "Proposals", data); - return promise.then((data) => QueryProposalsResponse.decode(new _m0.Reader(data))); + const data = QueryProposalsRequest.encode(request).finish() + const promise = this.rpc.request("cosmos.gov.v1beta1.Query", "Proposals", data) + return promise.then((data) => QueryProposalsResponse.decode(new _m0.Reader(data))) } Vote(request: QueryVoteRequest): Promise { - const data = QueryVoteRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.gov.v1beta1.Query", "Vote", data); - return promise.then((data) => QueryVoteResponse.decode(new _m0.Reader(data))); + const data = QueryVoteRequest.encode(request).finish() + const promise = this.rpc.request("cosmos.gov.v1beta1.Query", "Vote", data) + return promise.then((data) => QueryVoteResponse.decode(new _m0.Reader(data))) } Votes(request: QueryVotesRequest): Promise { - const data = QueryVotesRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.gov.v1beta1.Query", "Votes", data); - return promise.then((data) => QueryVotesResponse.decode(new _m0.Reader(data))); + const data = QueryVotesRequest.encode(request).finish() + const promise = this.rpc.request("cosmos.gov.v1beta1.Query", "Votes", data) + return promise.then((data) => QueryVotesResponse.decode(new _m0.Reader(data))) } Params(request: QueryParamsRequest): Promise { - const data = QueryParamsRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.gov.v1beta1.Query", "Params", data); - return promise.then((data) => QueryParamsResponse.decode(new _m0.Reader(data))); + const data = QueryParamsRequest.encode(request).finish() + const promise = this.rpc.request("cosmos.gov.v1beta1.Query", "Params", data) + return promise.then((data) => QueryParamsResponse.decode(new _m0.Reader(data))) } Deposit(request: QueryDepositRequest): Promise { - const data = QueryDepositRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.gov.v1beta1.Query", "Deposit", data); - return promise.then((data) => QueryDepositResponse.decode(new _m0.Reader(data))); + const data = QueryDepositRequest.encode(request).finish() + const promise = this.rpc.request("cosmos.gov.v1beta1.Query", "Deposit", data) + return promise.then((data) => QueryDepositResponse.decode(new _m0.Reader(data))) } Deposits(request: QueryDepositsRequest): Promise { - const data = QueryDepositsRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.gov.v1beta1.Query", "Deposits", data); - return promise.then((data) => QueryDepositsResponse.decode(new _m0.Reader(data))); + const data = QueryDepositsRequest.encode(request).finish() + const promise = this.rpc.request("cosmos.gov.v1beta1.Query", "Deposits", data) + return promise.then((data) => QueryDepositsResponse.decode(new _m0.Reader(data))) } TallyResult(request: QueryTallyResultRequest): Promise { - const data = QueryTallyResultRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.gov.v1beta1.Query", "TallyResult", data); - return promise.then((data) => QueryTallyResultResponse.decode(new _m0.Reader(data))); + const data = QueryTallyResultRequest.encode(request).finish() + const promise = this.rpc.request("cosmos.gov.v1beta1.Query", "TallyResult", data) + return promise.then((data) => QueryTallyResultResponse.decode(new _m0.Reader(data))) } } interface Rpc { - request(service: string, method: string, data: Uint8Array): Promise; + request(service: string, method: string, data: Uint8Array): Promise } -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/cosmos/gov/v1beta1/tx.ts b/packages/protojs/src/cosmos/gov/v1beta1/tx.ts index 747672ce..e947358e 100644 --- a/packages/protojs/src/cosmos/gov/v1beta1/tx.ts +++ b/packages/protojs/src/cosmos/gov/v1beta1/tx.ts @@ -1,37 +1,41 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { Any } from "../../../google/protobuf/any"; -import { Coin } from "../../base/v1beta1/coin"; -import { VoteOption, voteOptionFromJSON, voteOptionToJSON, WeightedVoteOption } from "./gov"; - -export const protobufPackage = "cosmos.gov.v1beta1"; +import { Any } from "../../../google/protobuf/any" +import { + VoteOption, + WeightedVoteOption, + voteOptionFromJSON, + voteOptionToJSON, +} from "./gov" +import Long from "long" +import { Coin } from "../../base/v1beta1/coin" +import * as _m0 from "protobufjs/minimal" + +export const protobufPackage = "cosmos.gov.v1beta1" /** * MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary * proposal Content. */ export interface MsgSubmitProposal { - content?: Any; - initialDeposit: Coin[]; - proposer: string; + content?: Any + initialDeposit: Coin[] + proposer: string } /** MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. */ export interface MsgSubmitProposalResponse { - proposalId: Long; + proposalId: Long } /** MsgVote defines a message to cast a vote. */ export interface MsgVote { - proposalId: Long; - voter: string; - option: VoteOption; + proposalId: Long + voter: string + option: VoteOption } /** MsgVoteResponse defines the Msg/Vote response type. */ -export interface MsgVoteResponse { -} +export interface MsgVoteResponse {} /** * MsgVoteWeighted defines a message to cast a vote. @@ -39,9 +43,9 @@ export interface MsgVoteResponse { * Since: cosmos-sdk 0.43 */ export interface MsgVoteWeighted { - proposalId: Long; - voter: string; - options: WeightedVoteOption[]; + proposalId: Long + voter: string + options: WeightedVoteOption[] } /** @@ -49,60 +53,61 @@ export interface MsgVoteWeighted { * * Since: cosmos-sdk 0.43 */ -export interface MsgVoteWeightedResponse { -} +export interface MsgVoteWeightedResponse {} /** MsgDeposit defines a message to submit a deposit to an existing proposal. */ export interface MsgDeposit { - proposalId: Long; - depositor: string; - amount: Coin[]; + proposalId: Long + depositor: string + amount: Coin[] } /** MsgDepositResponse defines the Msg/Deposit response type. */ -export interface MsgDepositResponse { -} +export interface MsgDepositResponse {} function createBaseMsgSubmitProposal(): MsgSubmitProposal { - return { content: undefined, initialDeposit: [], proposer: "" }; + return { content: undefined, initialDeposit: [], proposer: "" } } export const MsgSubmitProposal = { - encode(message: MsgSubmitProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: MsgSubmitProposal, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.content !== undefined) { - Any.encode(message.content, writer.uint32(10).fork()).ldelim(); + Any.encode(message.content, writer.uint32(10).fork()).ldelim() } for (const v of message.initialDeposit) { - Coin.encode(v!, writer.uint32(18).fork()).ldelim(); + Coin.encode(v!, writer.uint32(18).fork()).ldelim() } if (message.proposer !== "") { - writer.uint32(26).string(message.proposer); + writer.uint32(26).string(message.proposer) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MsgSubmitProposal { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgSubmitProposal(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgSubmitProposal() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.content = Any.decode(reader, reader.uint32()); - break; + message.content = Any.decode(reader, reader.uint32()) + break case 2: - message.initialDeposit.push(Coin.decode(reader, reader.uint32())); - break; + message.initialDeposit.push(Coin.decode(reader, reader.uint32())) + break case 3: - message.proposer = reader.string(); - break; + message.proposer = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): MsgSubmitProposal { @@ -112,484 +117,545 @@ export const MsgSubmitProposal = { ? object.initialDeposit.map((e: any) => Coin.fromJSON(e)) : [], proposer: isSet(object.proposer) ? String(object.proposer) : "", - }; + } }, toJSON(message: MsgSubmitProposal): unknown { - const obj: any = {}; - message.content !== undefined && (obj.content = message.content ? Any.toJSON(message.content) : undefined); + const obj: any = {} + message.content !== undefined && + (obj.content = message.content ? Any.toJSON(message.content) : undefined) if (message.initialDeposit) { - obj.initialDeposit = message.initialDeposit.map((e) => e ? Coin.toJSON(e) : undefined); + obj.initialDeposit = message.initialDeposit.map((e) => + e ? Coin.toJSON(e) : undefined, + ) } else { - obj.initialDeposit = []; + obj.initialDeposit = [] } - message.proposer !== undefined && (obj.proposer = message.proposer); - return obj; - }, - - fromPartial, I>>(object: I): MsgSubmitProposal { - const message = createBaseMsgSubmitProposal(); - message.content = (object.content !== undefined && object.content !== null) - ? Any.fromPartial(object.content) - : undefined; - message.initialDeposit = object.initialDeposit?.map((e) => Coin.fromPartial(e)) || []; - message.proposer = object.proposer ?? ""; - return message; + message.proposer !== undefined && (obj.proposer = message.proposer) + return obj + }, + + fromPartial, I>>( + object: I, + ): MsgSubmitProposal { + const message = createBaseMsgSubmitProposal() + message.content = + object.content !== undefined && object.content !== null + ? Any.fromPartial(object.content) + : undefined + message.initialDeposit = + object.initialDeposit?.map((e) => Coin.fromPartial(e)) || [] + message.proposer = object.proposer ?? "" + return message }, -}; +} function createBaseMsgSubmitProposalResponse(): MsgSubmitProposalResponse { - return { proposalId: Long.UZERO }; + return { proposalId: Long.UZERO } } export const MsgSubmitProposalResponse = { - encode(message: MsgSubmitProposalResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: MsgSubmitProposalResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (!message.proposalId.isZero()) { - writer.uint32(8).uint64(message.proposalId); + writer.uint32(8).uint64(message.proposalId) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MsgSubmitProposalResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgSubmitProposalResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgSubmitProposalResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.proposalId = reader.uint64() as Long; - break; + message.proposalId = reader.uint64() as Long + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): MsgSubmitProposalResponse { - return { proposalId: isSet(object.proposalId) ? Long.fromValue(object.proposalId) : Long.UZERO }; + return { + proposalId: isSet(object.proposalId) + ? Long.fromValue(object.proposalId) + : Long.UZERO, + } }, toJSON(message: MsgSubmitProposalResponse): unknown { - const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); - return obj; + const obj: any = {} + message.proposalId !== undefined && + (obj.proposalId = (message.proposalId || Long.UZERO).toString()) + return obj + }, + + fromPartial, I>>( + object: I, + ): MsgSubmitProposalResponse { + const message = createBaseMsgSubmitProposalResponse() + message.proposalId = + object.proposalId !== undefined && object.proposalId !== null + ? Long.fromValue(object.proposalId) + : Long.UZERO + return message }, - - fromPartial, I>>(object: I): MsgSubmitProposalResponse { - const message = createBaseMsgSubmitProposalResponse(); - message.proposalId = (object.proposalId !== undefined && object.proposalId !== null) - ? Long.fromValue(object.proposalId) - : Long.UZERO; - return message; - }, -}; +} function createBaseMsgVote(): MsgVote { - return { proposalId: Long.UZERO, voter: "", option: 0 }; + return { proposalId: Long.UZERO, voter: "", option: 0 } } export const MsgVote = { encode(message: MsgVote, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (!message.proposalId.isZero()) { - writer.uint32(8).uint64(message.proposalId); + writer.uint32(8).uint64(message.proposalId) } if (message.voter !== "") { - writer.uint32(18).string(message.voter); + writer.uint32(18).string(message.voter) } if (message.option !== 0) { - writer.uint32(24).int32(message.option); + writer.uint32(24).int32(message.option) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MsgVote { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgVote(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgVote() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.proposalId = reader.uint64() as Long; - break; + message.proposalId = reader.uint64() as Long + break case 2: - message.voter = reader.string(); - break; + message.voter = reader.string() + break case 3: - message.option = reader.int32() as any; - break; + message.option = reader.int32() as any + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): MsgVote { return { - proposalId: isSet(object.proposalId) ? Long.fromValue(object.proposalId) : Long.UZERO, + proposalId: isSet(object.proposalId) + ? Long.fromValue(object.proposalId) + : Long.UZERO, voter: isSet(object.voter) ? String(object.voter) : "", option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, - }; + } }, toJSON(message: MsgVote): unknown { - const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); - message.voter !== undefined && (obj.voter = message.voter); - message.option !== undefined && (obj.option = voteOptionToJSON(message.option)); - return obj; + const obj: any = {} + message.proposalId !== undefined && + (obj.proposalId = (message.proposalId || Long.UZERO).toString()) + message.voter !== undefined && (obj.voter = message.voter) + message.option !== undefined && (obj.option = voteOptionToJSON(message.option)) + return obj }, fromPartial, I>>(object: I): MsgVote { - const message = createBaseMsgVote(); - message.proposalId = (object.proposalId !== undefined && object.proposalId !== null) - ? Long.fromValue(object.proposalId) - : Long.UZERO; - message.voter = object.voter ?? ""; - message.option = object.option ?? 0; - return message; + const message = createBaseMsgVote() + message.proposalId = + object.proposalId !== undefined && object.proposalId !== null + ? Long.fromValue(object.proposalId) + : Long.UZERO + message.voter = object.voter ?? "" + message.option = object.option ?? 0 + return message }, -}; +} function createBaseMsgVoteResponse(): MsgVoteResponse { - return {}; + return {} } export const MsgVoteResponse = { encode(_: MsgVoteResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MsgVoteResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgVoteResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgVoteResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(_: any): MsgVoteResponse { - return {}; + return {} }, toJSON(_: MsgVoteResponse): unknown { - const obj: any = {}; - return obj; + const obj: any = {} + return obj }, fromPartial, I>>(_: I): MsgVoteResponse { - const message = createBaseMsgVoteResponse(); - return message; + const message = createBaseMsgVoteResponse() + return message }, -}; +} function createBaseMsgVoteWeighted(): MsgVoteWeighted { - return { proposalId: Long.UZERO, voter: "", options: [] }; + return { proposalId: Long.UZERO, voter: "", options: [] } } export const MsgVoteWeighted = { - encode(message: MsgVoteWeighted, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: MsgVoteWeighted, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (!message.proposalId.isZero()) { - writer.uint32(8).uint64(message.proposalId); + writer.uint32(8).uint64(message.proposalId) } if (message.voter !== "") { - writer.uint32(18).string(message.voter); + writer.uint32(18).string(message.voter) } for (const v of message.options) { - WeightedVoteOption.encode(v!, writer.uint32(26).fork()).ldelim(); + WeightedVoteOption.encode(v!, writer.uint32(26).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MsgVoteWeighted { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgVoteWeighted(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgVoteWeighted() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.proposalId = reader.uint64() as Long; - break; + message.proposalId = reader.uint64() as Long + break case 2: - message.voter = reader.string(); - break; + message.voter = reader.string() + break case 3: - message.options.push(WeightedVoteOption.decode(reader, reader.uint32())); - break; + message.options.push(WeightedVoteOption.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): MsgVoteWeighted { return { - proposalId: isSet(object.proposalId) ? Long.fromValue(object.proposalId) : Long.UZERO, + proposalId: isSet(object.proposalId) + ? Long.fromValue(object.proposalId) + : Long.UZERO, voter: isSet(object.voter) ? String(object.voter) : "", - options: Array.isArray(object?.options) ? object.options.map((e: any) => WeightedVoteOption.fromJSON(e)) : [], - }; + options: Array.isArray(object?.options) + ? object.options.map((e: any) => WeightedVoteOption.fromJSON(e)) + : [], + } }, toJSON(message: MsgVoteWeighted): unknown { - const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); - message.voter !== undefined && (obj.voter = message.voter); + const obj: any = {} + message.proposalId !== undefined && + (obj.proposalId = (message.proposalId || Long.UZERO).toString()) + message.voter !== undefined && (obj.voter = message.voter) if (message.options) { - obj.options = message.options.map((e) => e ? WeightedVoteOption.toJSON(e) : undefined); + obj.options = message.options.map((e) => + e ? WeightedVoteOption.toJSON(e) : undefined, + ) } else { - obj.options = []; + obj.options = [] } - return obj; + return obj + }, + + fromPartial, I>>( + object: I, + ): MsgVoteWeighted { + const message = createBaseMsgVoteWeighted() + message.proposalId = + object.proposalId !== undefined && object.proposalId !== null + ? Long.fromValue(object.proposalId) + : Long.UZERO + message.voter = object.voter ?? "" + message.options = + object.options?.map((e) => WeightedVoteOption.fromPartial(e)) || [] + return message }, - - fromPartial, I>>(object: I): MsgVoteWeighted { - const message = createBaseMsgVoteWeighted(); - message.proposalId = (object.proposalId !== undefined && object.proposalId !== null) - ? Long.fromValue(object.proposalId) - : Long.UZERO; - message.voter = object.voter ?? ""; - message.options = object.options?.map((e) => WeightedVoteOption.fromPartial(e)) || []; - return message; - }, -}; +} function createBaseMsgVoteWeightedResponse(): MsgVoteWeightedResponse { - return {}; + return {} } export const MsgVoteWeightedResponse = { - encode(_: MsgVoteWeightedResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; + encode( + _: MsgVoteWeightedResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MsgVoteWeightedResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgVoteWeightedResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgVoteWeightedResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(_: any): MsgVoteWeightedResponse { - return {}; + return {} }, toJSON(_: MsgVoteWeightedResponse): unknown { - const obj: any = {}; - return obj; + const obj: any = {} + return obj }, - fromPartial, I>>(_: I): MsgVoteWeightedResponse { - const message = createBaseMsgVoteWeightedResponse(); - return message; + fromPartial, I>>( + _: I, + ): MsgVoteWeightedResponse { + const message = createBaseMsgVoteWeightedResponse() + return message }, -}; +} function createBaseMsgDeposit(): MsgDeposit { - return { proposalId: Long.UZERO, depositor: "", amount: [] }; + return { proposalId: Long.UZERO, depositor: "", amount: [] } } export const MsgDeposit = { encode(message: MsgDeposit, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (!message.proposalId.isZero()) { - writer.uint32(8).uint64(message.proposalId); + writer.uint32(8).uint64(message.proposalId) } if (message.depositor !== "") { - writer.uint32(18).string(message.depositor); + writer.uint32(18).string(message.depositor) } for (const v of message.amount) { - Coin.encode(v!, writer.uint32(26).fork()).ldelim(); + Coin.encode(v!, writer.uint32(26).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MsgDeposit { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgDeposit(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgDeposit() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.proposalId = reader.uint64() as Long; - break; + message.proposalId = reader.uint64() as Long + break case 2: - message.depositor = reader.string(); - break; + message.depositor = reader.string() + break case 3: - message.amount.push(Coin.decode(reader, reader.uint32())); - break; + message.amount.push(Coin.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): MsgDeposit { return { - proposalId: isSet(object.proposalId) ? Long.fromValue(object.proposalId) : Long.UZERO, + proposalId: isSet(object.proposalId) + ? Long.fromValue(object.proposalId) + : Long.UZERO, depositor: isSet(object.depositor) ? String(object.depositor) : "", - amount: Array.isArray(object?.amount) ? object.amount.map((e: any) => Coin.fromJSON(e)) : [], - }; + amount: Array.isArray(object?.amount) + ? object.amount.map((e: any) => Coin.fromJSON(e)) + : [], + } }, toJSON(message: MsgDeposit): unknown { - const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); - message.depositor !== undefined && (obj.depositor = message.depositor); + const obj: any = {} + message.proposalId !== undefined && + (obj.proposalId = (message.proposalId || Long.UZERO).toString()) + message.depositor !== undefined && (obj.depositor = message.depositor) if (message.amount) { - obj.amount = message.amount.map((e) => e ? Coin.toJSON(e) : undefined); + obj.amount = message.amount.map((e) => (e ? Coin.toJSON(e) : undefined)) } else { - obj.amount = []; + obj.amount = [] } - return obj; + return obj }, fromPartial, I>>(object: I): MsgDeposit { - const message = createBaseMsgDeposit(); - message.proposalId = (object.proposalId !== undefined && object.proposalId !== null) - ? Long.fromValue(object.proposalId) - : Long.UZERO; - message.depositor = object.depositor ?? ""; - message.amount = object.amount?.map((e) => Coin.fromPartial(e)) || []; - return message; + const message = createBaseMsgDeposit() + message.proposalId = + object.proposalId !== undefined && object.proposalId !== null + ? Long.fromValue(object.proposalId) + : Long.UZERO + message.depositor = object.depositor ?? "" + message.amount = object.amount?.map((e) => Coin.fromPartial(e)) || [] + return message }, -}; +} function createBaseMsgDepositResponse(): MsgDepositResponse { - return {}; + return {} } export const MsgDepositResponse = { encode(_: MsgDepositResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MsgDepositResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgDepositResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgDepositResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(_: any): MsgDepositResponse { - return {}; + return {} }, toJSON(_: MsgDepositResponse): unknown { - const obj: any = {}; - return obj; + const obj: any = {} + return obj }, - fromPartial, I>>(_: I): MsgDepositResponse { - const message = createBaseMsgDepositResponse(); - return message; + fromPartial, I>>( + _: I, + ): MsgDepositResponse { + const message = createBaseMsgDepositResponse() + return message }, -}; +} /** Msg defines the bank Msg service. */ export interface Msg { /** SubmitProposal defines a method to create new proposal given a content. */ - SubmitProposal(request: MsgSubmitProposal): Promise; + SubmitProposal(request: MsgSubmitProposal): Promise /** Vote defines a method to add a vote on a specific proposal. */ - Vote(request: MsgVote): Promise; + Vote(request: MsgVote): Promise /** * VoteWeighted defines a method to add a weighted vote on a specific proposal. * * Since: cosmos-sdk 0.43 */ - VoteWeighted(request: MsgVoteWeighted): Promise; + VoteWeighted(request: MsgVoteWeighted): Promise /** Deposit defines a method to add deposit on a specific proposal. */ - Deposit(request: MsgDeposit): Promise; + Deposit(request: MsgDeposit): Promise } export class MsgClientImpl implements Msg { - private readonly rpc: Rpc; + private readonly rpc: Rpc constructor(rpc: Rpc) { - this.rpc = rpc; - this.SubmitProposal = this.SubmitProposal.bind(this); - this.Vote = this.Vote.bind(this); - this.VoteWeighted = this.VoteWeighted.bind(this); - this.Deposit = this.Deposit.bind(this); + this.rpc = rpc + this.SubmitProposal = this.SubmitProposal.bind(this) + this.Vote = this.Vote.bind(this) + this.VoteWeighted = this.VoteWeighted.bind(this) + this.Deposit = this.Deposit.bind(this) } SubmitProposal(request: MsgSubmitProposal): Promise { - const data = MsgSubmitProposal.encode(request).finish(); - const promise = this.rpc.request("cosmos.gov.v1beta1.Msg", "SubmitProposal", data); - return promise.then((data) => MsgSubmitProposalResponse.decode(new _m0.Reader(data))); + const data = MsgSubmitProposal.encode(request).finish() + const promise = this.rpc.request("cosmos.gov.v1beta1.Msg", "SubmitProposal", data) + return promise.then((data) => + MsgSubmitProposalResponse.decode(new _m0.Reader(data)), + ) } Vote(request: MsgVote): Promise { - const data = MsgVote.encode(request).finish(); - const promise = this.rpc.request("cosmos.gov.v1beta1.Msg", "Vote", data); - return promise.then((data) => MsgVoteResponse.decode(new _m0.Reader(data))); + const data = MsgVote.encode(request).finish() + const promise = this.rpc.request("cosmos.gov.v1beta1.Msg", "Vote", data) + return promise.then((data) => MsgVoteResponse.decode(new _m0.Reader(data))) } VoteWeighted(request: MsgVoteWeighted): Promise { - const data = MsgVoteWeighted.encode(request).finish(); - const promise = this.rpc.request("cosmos.gov.v1beta1.Msg", "VoteWeighted", data); - return promise.then((data) => MsgVoteWeightedResponse.decode(new _m0.Reader(data))); + const data = MsgVoteWeighted.encode(request).finish() + const promise = this.rpc.request("cosmos.gov.v1beta1.Msg", "VoteWeighted", data) + return promise.then((data) => MsgVoteWeightedResponse.decode(new _m0.Reader(data))) } Deposit(request: MsgDeposit): Promise { - const data = MsgDeposit.encode(request).finish(); - const promise = this.rpc.request("cosmos.gov.v1beta1.Msg", "Deposit", data); - return promise.then((data) => MsgDepositResponse.decode(new _m0.Reader(data))); + const data = MsgDeposit.encode(request).finish() + const promise = this.rpc.request("cosmos.gov.v1beta1.Msg", "Deposit", data) + return promise.then((data) => MsgDepositResponse.decode(new _m0.Reader(data))) } } interface Rpc { - request(service: string, method: string, data: Uint8Array): Promise; + request(service: string, method: string, data: Uint8Array): Promise } -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/cosmos/mint/v1beta1/genesis.ts b/packages/protojs/src/cosmos/mint/v1beta1/genesis.ts index a0bd11f1..993edfdd 100644 --- a/packages/protojs/src/cosmos/mint/v1beta1/genesis.ts +++ b/packages/protojs/src/cosmos/mint/v1beta1/genesis.ts @@ -1,97 +1,111 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { Minter, Params } from "./mint"; +import { Minter, Params } from "./mint" +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "cosmos.mint.v1beta1"; +export const protobufPackage = "cosmos.mint.v1beta1" /** GenesisState defines the mint module's genesis state. */ export interface GenesisState { /** minter is a space for holding current inflation information. */ - minter?: Minter; + minter?: Minter /** params defines all the paramaters of the module. */ - params?: Params; + params?: Params } function createBaseGenesisState(): GenesisState { - return { minter: undefined, params: undefined }; + return { minter: undefined, params: undefined } } export const GenesisState = { encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.minter !== undefined) { - Minter.encode(message.minter, writer.uint32(10).fork()).ldelim(); + Minter.encode(message.minter, writer.uint32(10).fork()).ldelim() } if (message.params !== undefined) { - Params.encode(message.params, writer.uint32(18).fork()).ldelim(); + Params.encode(message.params, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGenesisState(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseGenesisState() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.minter = Minter.decode(reader, reader.uint32()); - break; + message.minter = Minter.decode(reader, reader.uint32()) + break case 2: - message.params = Params.decode(reader, reader.uint32()); - break; + message.params = Params.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): GenesisState { return { minter: isSet(object.minter) ? Minter.fromJSON(object.minter) : undefined, params: isSet(object.params) ? Params.fromJSON(object.params) : undefined, - }; + } }, toJSON(message: GenesisState): unknown { - const obj: any = {}; - message.minter !== undefined && (obj.minter = message.minter ? Minter.toJSON(message.minter) : undefined); - message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); - return obj; + const obj: any = {} + message.minter !== undefined && + (obj.minter = message.minter ? Minter.toJSON(message.minter) : undefined) + message.params !== undefined && + (obj.params = message.params ? Params.toJSON(message.params) : undefined) + return obj }, fromPartial, I>>(object: I): GenesisState { - const message = createBaseGenesisState(); - message.minter = (object.minter !== undefined && object.minter !== null) - ? Minter.fromPartial(object.minter) - : undefined; - message.params = (object.params !== undefined && object.params !== null) - ? Params.fromPartial(object.params) - : undefined; - return message; + const message = createBaseGenesisState() + message.minter = + object.minter !== undefined && object.minter !== null + ? Minter.fromPartial(object.minter) + : undefined + message.params = + object.params !== undefined && object.params !== null + ? Params.fromPartial(object.params) + : undefined + return message }, -}; +} -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/cosmos/mint/v1beta1/mint.ts b/packages/protojs/src/cosmos/mint/v1beta1/mint.ts index f64b65f3..990b8f69 100644 --- a/packages/protojs/src/cosmos/mint/v1beta1/mint.ts +++ b/packages/protojs/src/cosmos/mint/v1beta1/mint.ts @@ -1,90 +1,93 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "cosmos.mint.v1beta1"; +export const protobufPackage = "cosmos.mint.v1beta1" /** Minter represents the minting state. */ export interface Minter { /** current annual inflation rate */ - inflation: string; + inflation: string /** current annual expected provisions */ - annualProvisions: string; + annualProvisions: string } /** Params holds parameters for the mint module. */ export interface Params { /** type of coin to mint */ - mintDenom: string; + mintDenom: string /** maximum annual change in inflation rate */ - inflationRateChange: string; + inflationRateChange: string /** maximum inflation rate */ - inflationMax: string; + inflationMax: string /** minimum inflation rate */ - inflationMin: string; + inflationMin: string /** goal of percent bonded atoms */ - goalBonded: string; + goalBonded: string /** expected blocks per year */ - blocksPerYear: Long; + blocksPerYear: Long } function createBaseMinter(): Minter { - return { inflation: "", annualProvisions: "" }; + return { inflation: "", annualProvisions: "" } } export const Minter = { encode(message: Minter, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.inflation !== "") { - writer.uint32(10).string(message.inflation); + writer.uint32(10).string(message.inflation) } if (message.annualProvisions !== "") { - writer.uint32(18).string(message.annualProvisions); + writer.uint32(18).string(message.annualProvisions) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Minter { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMinter(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMinter() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.inflation = reader.string(); - break; + message.inflation = reader.string() + break case 2: - message.annualProvisions = reader.string(); - break; + message.annualProvisions = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Minter { return { inflation: isSet(object.inflation) ? String(object.inflation) : "", - annualProvisions: isSet(object.annualProvisions) ? String(object.annualProvisions) : "", - }; + annualProvisions: isSet(object.annualProvisions) + ? String(object.annualProvisions) + : "", + } }, toJSON(message: Minter): unknown { - const obj: any = {}; - message.inflation !== undefined && (obj.inflation = message.inflation); - message.annualProvisions !== undefined && (obj.annualProvisions = message.annualProvisions); - return obj; + const obj: any = {} + message.inflation !== undefined && (obj.inflation = message.inflation) + message.annualProvisions !== undefined && + (obj.annualProvisions = message.annualProvisions) + return obj }, fromPartial, I>>(object: I): Minter { - const message = createBaseMinter(); - message.inflation = object.inflation ?? ""; - message.annualProvisions = object.annualProvisions ?? ""; - return message; + const message = createBaseMinter() + message.inflation = object.inflation ?? "" + message.annualProvisions = object.annualProvisions ?? "" + return message }, -}; +} function createBaseParams(): Params { return { @@ -94,118 +97,135 @@ function createBaseParams(): Params { inflationMin: "", goalBonded: "", blocksPerYear: Long.UZERO, - }; + } } export const Params = { encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.mintDenom !== "") { - writer.uint32(10).string(message.mintDenom); + writer.uint32(10).string(message.mintDenom) } if (message.inflationRateChange !== "") { - writer.uint32(18).string(message.inflationRateChange); + writer.uint32(18).string(message.inflationRateChange) } if (message.inflationMax !== "") { - writer.uint32(26).string(message.inflationMax); + writer.uint32(26).string(message.inflationMax) } if (message.inflationMin !== "") { - writer.uint32(34).string(message.inflationMin); + writer.uint32(34).string(message.inflationMin) } if (message.goalBonded !== "") { - writer.uint32(42).string(message.goalBonded); + writer.uint32(42).string(message.goalBonded) } if (!message.blocksPerYear.isZero()) { - writer.uint32(48).uint64(message.blocksPerYear); + writer.uint32(48).uint64(message.blocksPerYear) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Params { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseParams(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseParams() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.mintDenom = reader.string(); - break; + message.mintDenom = reader.string() + break case 2: - message.inflationRateChange = reader.string(); - break; + message.inflationRateChange = reader.string() + break case 3: - message.inflationMax = reader.string(); - break; + message.inflationMax = reader.string() + break case 4: - message.inflationMin = reader.string(); - break; + message.inflationMin = reader.string() + break case 5: - message.goalBonded = reader.string(); - break; + message.goalBonded = reader.string() + break case 6: - message.blocksPerYear = reader.uint64() as Long; - break; + message.blocksPerYear = reader.uint64() as Long + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Params { return { mintDenom: isSet(object.mintDenom) ? String(object.mintDenom) : "", - inflationRateChange: isSet(object.inflationRateChange) ? String(object.inflationRateChange) : "", + inflationRateChange: isSet(object.inflationRateChange) + ? String(object.inflationRateChange) + : "", inflationMax: isSet(object.inflationMax) ? String(object.inflationMax) : "", inflationMin: isSet(object.inflationMin) ? String(object.inflationMin) : "", goalBonded: isSet(object.goalBonded) ? String(object.goalBonded) : "", - blocksPerYear: isSet(object.blocksPerYear) ? Long.fromValue(object.blocksPerYear) : Long.UZERO, - }; + blocksPerYear: isSet(object.blocksPerYear) + ? Long.fromValue(object.blocksPerYear) + : Long.UZERO, + } }, toJSON(message: Params): unknown { - const obj: any = {}; - message.mintDenom !== undefined && (obj.mintDenom = message.mintDenom); - message.inflationRateChange !== undefined && (obj.inflationRateChange = message.inflationRateChange); - message.inflationMax !== undefined && (obj.inflationMax = message.inflationMax); - message.inflationMin !== undefined && (obj.inflationMin = message.inflationMin); - message.goalBonded !== undefined && (obj.goalBonded = message.goalBonded); - message.blocksPerYear !== undefined && (obj.blocksPerYear = (message.blocksPerYear || Long.UZERO).toString()); - return obj; + const obj: any = {} + message.mintDenom !== undefined && (obj.mintDenom = message.mintDenom) + message.inflationRateChange !== undefined && + (obj.inflationRateChange = message.inflationRateChange) + message.inflationMax !== undefined && (obj.inflationMax = message.inflationMax) + message.inflationMin !== undefined && (obj.inflationMin = message.inflationMin) + message.goalBonded !== undefined && (obj.goalBonded = message.goalBonded) + message.blocksPerYear !== undefined && + (obj.blocksPerYear = (message.blocksPerYear || Long.UZERO).toString()) + return obj }, fromPartial, I>>(object: I): Params { - const message = createBaseParams(); - message.mintDenom = object.mintDenom ?? ""; - message.inflationRateChange = object.inflationRateChange ?? ""; - message.inflationMax = object.inflationMax ?? ""; - message.inflationMin = object.inflationMin ?? ""; - message.goalBonded = object.goalBonded ?? ""; - message.blocksPerYear = (object.blocksPerYear !== undefined && object.blocksPerYear !== null) - ? Long.fromValue(object.blocksPerYear) - : Long.UZERO; - return message; + const message = createBaseParams() + message.mintDenom = object.mintDenom ?? "" + message.inflationRateChange = object.inflationRateChange ?? "" + message.inflationMax = object.inflationMax ?? "" + message.inflationMin = object.inflationMin ?? "" + message.goalBonded = object.goalBonded ?? "" + message.blocksPerYear = + object.blocksPerYear !== undefined && object.blocksPerYear !== null + ? Long.fromValue(object.blocksPerYear) + : Long.UZERO + return message }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; +} -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/cosmos/mint/v1beta1/query.ts b/packages/protojs/src/cosmos/mint/v1beta1/query.ts index 89584791..2ffd5068 100644 --- a/packages/protojs/src/cosmos/mint/v1beta1/query.ts +++ b/packages/protojs/src/cosmos/mint/v1beta1/query.ts @@ -1,23 +1,21 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { Params } from "./mint"; +import { Params } from "./mint" +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "cosmos.mint.v1beta1"; +export const protobufPackage = "cosmos.mint.v1beta1" /** QueryParamsRequest is the request type for the Query/Params RPC method. */ -export interface QueryParamsRequest { -} +export interface QueryParamsRequest {} /** QueryParamsResponse is the response type for the Query/Params RPC method. */ export interface QueryParamsResponse { /** params defines the parameters of the module. */ - params?: Params; + params?: Params } /** QueryInflationRequest is the request type for the Query/Inflation RPC method. */ -export interface QueryInflationRequest { -} +export interface QueryInflationRequest {} /** * QueryInflationResponse is the response type for the Query/Inflation RPC @@ -25,15 +23,14 @@ export interface QueryInflationRequest { */ export interface QueryInflationResponse { /** inflation is the current minting inflation value. */ - inflation: Uint8Array; + inflation: Uint8Array } /** * QueryAnnualProvisionsRequest is the request type for the * Query/AnnualProvisions RPC method. */ -export interface QueryAnnualProvisionsRequest { -} +export interface QueryAnnualProvisionsRequest {} /** * QueryAnnualProvisionsResponse is the response type for the @@ -41,379 +38,432 @@ export interface QueryAnnualProvisionsRequest { */ export interface QueryAnnualProvisionsResponse { /** annual_provisions is the current minting annual provisions value. */ - annualProvisions: Uint8Array; + annualProvisions: Uint8Array } function createBaseQueryParamsRequest(): QueryParamsRequest { - return {}; + return {} } export const QueryParamsRequest = { encode(_: QueryParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryParamsRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryParamsRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(_: any): QueryParamsRequest { - return {}; + return {} }, toJSON(_: QueryParamsRequest): unknown { - const obj: any = {}; - return obj; + const obj: any = {} + return obj }, - fromPartial, I>>(_: I): QueryParamsRequest { - const message = createBaseQueryParamsRequest(); - return message; + fromPartial, I>>( + _: I, + ): QueryParamsRequest { + const message = createBaseQueryParamsRequest() + return message }, -}; +} function createBaseQueryParamsResponse(): QueryParamsResponse { - return { params: undefined }; + return { params: undefined } } export const QueryParamsResponse = { - encode(message: QueryParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryParamsResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.params !== undefined) { - Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + Params.encode(message.params, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryParamsResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryParamsResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.params = Params.decode(reader, reader.uint32()); - break; + message.params = Params.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryParamsResponse { - return { params: isSet(object.params) ? Params.fromJSON(object.params) : undefined }; + return { + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined, + } }, toJSON(message: QueryParamsResponse): unknown { - const obj: any = {}; - message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); - return obj; + const obj: any = {} + message.params !== undefined && + (obj.params = message.params ? Params.toJSON(message.params) : undefined) + return obj }, - fromPartial, I>>(object: I): QueryParamsResponse { - const message = createBaseQueryParamsResponse(); - message.params = (object.params !== undefined && object.params !== null) - ? Params.fromPartial(object.params) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): QueryParamsResponse { + const message = createBaseQueryParamsResponse() + message.params = + object.params !== undefined && object.params !== null + ? Params.fromPartial(object.params) + : undefined + return message }, -}; +} function createBaseQueryInflationRequest(): QueryInflationRequest { - return {}; + return {} } export const QueryInflationRequest = { - encode(_: QueryInflationRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; + encode( + _: QueryInflationRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryInflationRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryInflationRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryInflationRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(_: any): QueryInflationRequest { - return {}; + return {} }, toJSON(_: QueryInflationRequest): unknown { - const obj: any = {}; - return obj; + const obj: any = {} + return obj }, - fromPartial, I>>(_: I): QueryInflationRequest { - const message = createBaseQueryInflationRequest(); - return message; + fromPartial, I>>( + _: I, + ): QueryInflationRequest { + const message = createBaseQueryInflationRequest() + return message }, -}; +} function createBaseQueryInflationResponse(): QueryInflationResponse { - return { inflation: new Uint8Array() }; + return { inflation: new Uint8Array() } } export const QueryInflationResponse = { - encode(message: QueryInflationResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryInflationResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.inflation.length !== 0) { - writer.uint32(10).bytes(message.inflation); + writer.uint32(10).bytes(message.inflation) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryInflationResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryInflationResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryInflationResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.inflation = reader.bytes(); - break; + message.inflation = reader.bytes() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryInflationResponse { - return { inflation: isSet(object.inflation) ? bytesFromBase64(object.inflation) : new Uint8Array() }; + return { + inflation: isSet(object.inflation) + ? bytesFromBase64(object.inflation) + : new Uint8Array(), + } }, toJSON(message: QueryInflationResponse): unknown { - const obj: any = {}; + const obj: any = {} message.inflation !== undefined && - (obj.inflation = base64FromBytes(message.inflation !== undefined ? message.inflation : new Uint8Array())); - return obj; + (obj.inflation = base64FromBytes( + message.inflation !== undefined ? message.inflation : new Uint8Array(), + )) + return obj }, - fromPartial, I>>(object: I): QueryInflationResponse { - const message = createBaseQueryInflationResponse(); - message.inflation = object.inflation ?? new Uint8Array(); - return message; + fromPartial, I>>( + object: I, + ): QueryInflationResponse { + const message = createBaseQueryInflationResponse() + message.inflation = object.inflation ?? new Uint8Array() + return message }, -}; +} function createBaseQueryAnnualProvisionsRequest(): QueryAnnualProvisionsRequest { - return {}; + return {} } export const QueryAnnualProvisionsRequest = { - encode(_: QueryAnnualProvisionsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; + encode( + _: QueryAnnualProvisionsRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAnnualProvisionsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryAnnualProvisionsRequest(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryAnnualProvisionsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryAnnualProvisionsRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(_: any): QueryAnnualProvisionsRequest { - return {}; + return {} }, toJSON(_: QueryAnnualProvisionsRequest): unknown { - const obj: any = {}; - return obj; + const obj: any = {} + return obj }, - fromPartial, I>>(_: I): QueryAnnualProvisionsRequest { - const message = createBaseQueryAnnualProvisionsRequest(); - return message; + fromPartial, I>>( + _: I, + ): QueryAnnualProvisionsRequest { + const message = createBaseQueryAnnualProvisionsRequest() + return message }, -}; +} function createBaseQueryAnnualProvisionsResponse(): QueryAnnualProvisionsResponse { - return { annualProvisions: new Uint8Array() }; + return { annualProvisions: new Uint8Array() } } export const QueryAnnualProvisionsResponse = { - encode(message: QueryAnnualProvisionsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryAnnualProvisionsResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.annualProvisions.length !== 0) { - writer.uint32(10).bytes(message.annualProvisions); + writer.uint32(10).bytes(message.annualProvisions) } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAnnualProvisionsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryAnnualProvisionsResponse(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryAnnualProvisionsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryAnnualProvisionsResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.annualProvisions = reader.bytes(); - break; + message.annualProvisions = reader.bytes() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryAnnualProvisionsResponse { return { - annualProvisions: isSet(object.annualProvisions) ? bytesFromBase64(object.annualProvisions) : new Uint8Array(), - }; + annualProvisions: isSet(object.annualProvisions) + ? bytesFromBase64(object.annualProvisions) + : new Uint8Array(), + } }, toJSON(message: QueryAnnualProvisionsResponse): unknown { - const obj: any = {}; + const obj: any = {} message.annualProvisions !== undefined && (obj.annualProvisions = base64FromBytes( - message.annualProvisions !== undefined ? message.annualProvisions : new Uint8Array(), - )); - return obj; + message.annualProvisions !== undefined + ? message.annualProvisions + : new Uint8Array(), + )) + return obj }, fromPartial, I>>( object: I, ): QueryAnnualProvisionsResponse { - const message = createBaseQueryAnnualProvisionsResponse(); - message.annualProvisions = object.annualProvisions ?? new Uint8Array(); - return message; + const message = createBaseQueryAnnualProvisionsResponse() + message.annualProvisions = object.annualProvisions ?? new Uint8Array() + return message }, -}; +} /** Query provides defines the gRPC querier service. */ export interface Query { /** Params returns the total set of minting parameters. */ - Params(request: QueryParamsRequest): Promise; + Params(request: QueryParamsRequest): Promise /** Inflation returns the current minting inflation value. */ - Inflation(request: QueryInflationRequest): Promise; + Inflation(request: QueryInflationRequest): Promise /** AnnualProvisions current minting annual provisions value. */ - AnnualProvisions(request: QueryAnnualProvisionsRequest): Promise; + AnnualProvisions( + request: QueryAnnualProvisionsRequest, + ): Promise } export class QueryClientImpl implements Query { - private readonly rpc: Rpc; + private readonly rpc: Rpc constructor(rpc: Rpc) { - this.rpc = rpc; - this.Params = this.Params.bind(this); - this.Inflation = this.Inflation.bind(this); - this.AnnualProvisions = this.AnnualProvisions.bind(this); + this.rpc = rpc + this.Params = this.Params.bind(this) + this.Inflation = this.Inflation.bind(this) + this.AnnualProvisions = this.AnnualProvisions.bind(this) } Params(request: QueryParamsRequest): Promise { - const data = QueryParamsRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.mint.v1beta1.Query", "Params", data); - return promise.then((data) => QueryParamsResponse.decode(new _m0.Reader(data))); + const data = QueryParamsRequest.encode(request).finish() + const promise = this.rpc.request("cosmos.mint.v1beta1.Query", "Params", data) + return promise.then((data) => QueryParamsResponse.decode(new _m0.Reader(data))) } Inflation(request: QueryInflationRequest): Promise { - const data = QueryInflationRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.mint.v1beta1.Query", "Inflation", data); - return promise.then((data) => QueryInflationResponse.decode(new _m0.Reader(data))); + const data = QueryInflationRequest.encode(request).finish() + const promise = this.rpc.request("cosmos.mint.v1beta1.Query", "Inflation", data) + return promise.then((data) => QueryInflationResponse.decode(new _m0.Reader(data))) } - AnnualProvisions(request: QueryAnnualProvisionsRequest): Promise { - const data = QueryAnnualProvisionsRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.mint.v1beta1.Query", "AnnualProvisions", data); - return promise.then((data) => QueryAnnualProvisionsResponse.decode(new _m0.Reader(data))); + AnnualProvisions( + request: QueryAnnualProvisionsRequest, + ): Promise { + const data = QueryAnnualProvisionsRequest.encode(request).finish() + const promise = this.rpc.request( + "cosmos.mint.v1beta1.Query", + "AnnualProvisions", + data, + ) + return promise.then((data) => + QueryAnnualProvisionsResponse.decode(new _m0.Reader(data)), + ) } } interface Rpc { - request(service: string, method: string, data: Uint8Array): Promise; + request(service: string, method: string, data: Uint8Array): Promise } -declare var self: any | undefined; -declare var window: any | undefined; -declare var global: any | undefined; +declare var self: any | undefined +declare var window: any | undefined +declare var global: any | undefined var globalThis: any = (() => { - if (typeof globalThis !== "undefined") { - return globalThis; - } - if (typeof self !== "undefined") { - return self; - } - if (typeof window !== "undefined") { - return window; - } - if (typeof global !== "undefined") { - return global; - } - throw "Unable to locate global object"; -})(); - + if (typeof globalThis !== "undefined") return globalThis + if (typeof self !== "undefined") return self + if (typeof window !== "undefined") return window + if (typeof global !== "undefined") return global + throw "Unable to locate global object" +})() + +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")) function bytesFromBase64(b64: string): Uint8Array { - if (globalThis.Buffer) { - return Uint8Array.from(globalThis.Buffer.from(b64, "base64")); - } else { - const bin = globalThis.atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; + 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 } +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")) function base64FromBytes(arr: Uint8Array): string { - if (globalThis.Buffer) { - return globalThis.Buffer.from(arr).toString("base64"); - } else { - const bin: string[] = []; - arr.forEach((byte) => { - bin.push(String.fromCharCode(byte)); - }); - return globalThis.btoa(bin.join("")); - } + const bin: string[] = [] + arr.forEach((byte) => { + bin.push(String.fromCharCode(byte)) + }) + return btoa(bin.join("")) } -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/cosmos/params/v1beta1/params.ts b/packages/protojs/src/cosmos/params/v1beta1/params.ts index 8d70dc38..09757c39 100644 --- a/packages/protojs/src/cosmos/params/v1beta1/params.ts +++ b/packages/protojs/src/cosmos/params/v1beta1/params.ts @@ -1,14 +1,14 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "cosmos.params.v1beta1"; +export const protobufPackage = "cosmos.params.v1beta1" /** ParameterChangeProposal defines a proposal to change one or more parameters. */ export interface ParameterChangeProposal { - title: string; - description: string; - changes: ParamChange[]; + title: string + description: string + changes: ParamChange[] } /** @@ -16,122 +16,129 @@ export interface ParameterChangeProposal { * ParameterChangeProposal. */ export interface ParamChange { - subspace: string; - key: string; - value: string; + subspace: string + key: string + value: string } function createBaseParameterChangeProposal(): ParameterChangeProposal { - return { title: "", description: "", changes: [] }; + return { title: "", description: "", changes: [] } } export const ParameterChangeProposal = { - encode(message: ParameterChangeProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: ParameterChangeProposal, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.title !== "") { - writer.uint32(10).string(message.title); + writer.uint32(10).string(message.title) } if (message.description !== "") { - writer.uint32(18).string(message.description); + writer.uint32(18).string(message.description) } for (const v of message.changes) { - ParamChange.encode(v!, writer.uint32(26).fork()).ldelim(); + ParamChange.encode(v!, writer.uint32(26).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): ParameterChangeProposal { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseParameterChangeProposal(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseParameterChangeProposal() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.title = reader.string(); - break; + message.title = reader.string() + break case 2: - message.description = reader.string(); - break; + message.description = reader.string() + break case 3: - message.changes.push(ParamChange.decode(reader, reader.uint32())); - break; + message.changes.push(ParamChange.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): ParameterChangeProposal { return { title: isSet(object.title) ? String(object.title) : "", description: isSet(object.description) ? String(object.description) : "", - changes: Array.isArray(object?.changes) ? object.changes.map((e: any) => ParamChange.fromJSON(e)) : [], - }; + changes: Array.isArray(object?.changes) + ? object.changes.map((e: any) => ParamChange.fromJSON(e)) + : [], + } }, toJSON(message: ParameterChangeProposal): unknown { - const obj: any = {}; - message.title !== undefined && (obj.title = message.title); - message.description !== undefined && (obj.description = message.description); + const obj: any = {} + message.title !== undefined && (obj.title = message.title) + message.description !== undefined && (obj.description = message.description) if (message.changes) { - obj.changes = message.changes.map((e) => e ? ParamChange.toJSON(e) : undefined); + obj.changes = message.changes.map((e) => (e ? ParamChange.toJSON(e) : undefined)) } else { - obj.changes = []; + obj.changes = [] } - return obj; + return obj }, - fromPartial, I>>(object: I): ParameterChangeProposal { - const message = createBaseParameterChangeProposal(); - message.title = object.title ?? ""; - message.description = object.description ?? ""; - message.changes = object.changes?.map((e) => ParamChange.fromPartial(e)) || []; - return message; + fromPartial, I>>( + object: I, + ): ParameterChangeProposal { + const message = createBaseParameterChangeProposal() + message.title = object.title ?? "" + message.description = object.description ?? "" + message.changes = object.changes?.map((e) => ParamChange.fromPartial(e)) || [] + return message }, -}; +} function createBaseParamChange(): ParamChange { - return { subspace: "", key: "", value: "" }; + return { subspace: "", key: "", value: "" } } export const ParamChange = { encode(message: ParamChange, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.subspace !== "") { - writer.uint32(10).string(message.subspace); + writer.uint32(10).string(message.subspace) } if (message.key !== "") { - writer.uint32(18).string(message.key); + writer.uint32(18).string(message.key) } if (message.value !== "") { - writer.uint32(26).string(message.value); + writer.uint32(26).string(message.value) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): ParamChange { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseParamChange(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseParamChange() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.subspace = reader.string(); - break; + message.subspace = reader.string() + break case 2: - message.key = reader.string(); - break; + message.key = reader.string() + break case 3: - message.value = reader.string(); - break; + message.value = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): ParamChange { @@ -139,43 +146,53 @@ export const ParamChange = { subspace: isSet(object.subspace) ? String(object.subspace) : "", key: isSet(object.key) ? String(object.key) : "", value: isSet(object.value) ? String(object.value) : "", - }; + } }, toJSON(message: ParamChange): unknown { - const obj: any = {}; - message.subspace !== undefined && (obj.subspace = message.subspace); - message.key !== undefined && (obj.key = message.key); - message.value !== undefined && (obj.value = message.value); - return obj; + const obj: any = {} + message.subspace !== undefined && (obj.subspace = message.subspace) + message.key !== undefined && (obj.key = message.key) + message.value !== undefined && (obj.value = message.value) + return obj }, fromPartial, I>>(object: I): ParamChange { - const message = createBaseParamChange(); - message.subspace = object.subspace ?? ""; - message.key = object.key ?? ""; - message.value = object.value ?? ""; - return message; + const message = createBaseParamChange() + message.subspace = object.subspace ?? "" + message.key = object.key ?? "" + message.value = object.value ?? "" + return message }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; +} -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/cosmos/params/v1beta1/query.ts b/packages/protojs/src/cosmos/params/v1beta1/query.ts index 3852b407..454bb631 100644 --- a/packages/protojs/src/cosmos/params/v1beta1/query.ts +++ b/packages/protojs/src/cosmos/params/v1beta1/query.ts @@ -1,130 +1,144 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { ParamChange } from "./params"; +import { ParamChange } from "./params" +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "cosmos.params.v1beta1"; +export const protobufPackage = "cosmos.params.v1beta1" /** QueryParamsRequest is request type for the Query/Params RPC method. */ export interface QueryParamsRequest { /** subspace defines the module to query the parameter for. */ - subspace: string; + subspace: string /** key defines the key of the parameter in the subspace. */ - key: string; + key: string } /** QueryParamsResponse is response type for the Query/Params RPC method. */ export interface QueryParamsResponse { /** param defines the queried parameter. */ - param?: ParamChange; + param?: ParamChange } function createBaseQueryParamsRequest(): QueryParamsRequest { - return { subspace: "", key: "" }; + return { subspace: "", key: "" } } export const QueryParamsRequest = { - encode(message: QueryParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryParamsRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.subspace !== "") { - writer.uint32(10).string(message.subspace); + writer.uint32(10).string(message.subspace) } if (message.key !== "") { - writer.uint32(18).string(message.key); + writer.uint32(18).string(message.key) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryParamsRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryParamsRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.subspace = reader.string(); - break; + message.subspace = reader.string() + break case 2: - message.key = reader.string(); - break; + message.key = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryParamsRequest { return { subspace: isSet(object.subspace) ? String(object.subspace) : "", key: isSet(object.key) ? String(object.key) : "", - }; + } }, toJSON(message: QueryParamsRequest): unknown { - const obj: any = {}; - message.subspace !== undefined && (obj.subspace = message.subspace); - message.key !== undefined && (obj.key = message.key); - return obj; + const obj: any = {} + message.subspace !== undefined && (obj.subspace = message.subspace) + message.key !== undefined && (obj.key = message.key) + return obj }, - fromPartial, I>>(object: I): QueryParamsRequest { - const message = createBaseQueryParamsRequest(); - message.subspace = object.subspace ?? ""; - message.key = object.key ?? ""; - return message; + fromPartial, I>>( + object: I, + ): QueryParamsRequest { + const message = createBaseQueryParamsRequest() + message.subspace = object.subspace ?? "" + message.key = object.key ?? "" + return message }, -}; +} function createBaseQueryParamsResponse(): QueryParamsResponse { - return { param: undefined }; + return { param: undefined } } export const QueryParamsResponse = { - encode(message: QueryParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryParamsResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.param !== undefined) { - ParamChange.encode(message.param, writer.uint32(10).fork()).ldelim(); + ParamChange.encode(message.param, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryParamsResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryParamsResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.param = ParamChange.decode(reader, reader.uint32()); - break; + message.param = ParamChange.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryParamsResponse { - return { param: isSet(object.param) ? ParamChange.fromJSON(object.param) : undefined }; + return { + param: isSet(object.param) ? ParamChange.fromJSON(object.param) : undefined, + } }, toJSON(message: QueryParamsResponse): unknown { - const obj: any = {}; - message.param !== undefined && (obj.param = message.param ? ParamChange.toJSON(message.param) : undefined); - return obj; + const obj: any = {} + message.param !== undefined && + (obj.param = message.param ? ParamChange.toJSON(message.param) : undefined) + return obj }, - fromPartial, I>>(object: I): QueryParamsResponse { - const message = createBaseQueryParamsResponse(); - message.param = (object.param !== undefined && object.param !== null) - ? ParamChange.fromPartial(object.param) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): QueryParamsResponse { + const message = createBaseQueryParamsResponse() + message.param = + object.param !== undefined && object.param !== null + ? ParamChange.fromPartial(object.param) + : undefined + return message }, -}; +} /** Query defines the gRPC querier service. */ export interface Query { @@ -132,43 +146,53 @@ export interface Query { * Params queries a specific parameter of a module, given its subspace and * key. */ - Params(request: QueryParamsRequest): Promise; + Params(request: QueryParamsRequest): Promise } export class QueryClientImpl implements Query { - private readonly rpc: Rpc; + private readonly rpc: Rpc constructor(rpc: Rpc) { - this.rpc = rpc; - this.Params = this.Params.bind(this); + this.rpc = rpc + this.Params = this.Params.bind(this) } Params(request: QueryParamsRequest): Promise { - const data = QueryParamsRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.params.v1beta1.Query", "Params", data); - return promise.then((data) => QueryParamsResponse.decode(new _m0.Reader(data))); + const data = QueryParamsRequest.encode(request).finish() + const promise = this.rpc.request("cosmos.params.v1beta1.Query", "Params", data) + return promise.then((data) => QueryParamsResponse.decode(new _m0.Reader(data))) } } interface Rpc { - request(service: string, method: string, data: Uint8Array): Promise; + request(service: string, method: string, data: Uint8Array): Promise } -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/cosmos/slashing/v1beta1/genesis.ts b/packages/protojs/src/cosmos/slashing/v1beta1/genesis.ts index 398aeaea..f2432b98 100644 --- a/packages/protojs/src/cosmos/slashing/v1beta1/genesis.ts +++ b/packages/protojs/src/cosmos/slashing/v1beta1/genesis.ts @@ -1,32 +1,32 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { Params, ValidatorSigningInfo } from "./slashing"; +import { Params, ValidatorSigningInfo } from "./slashing" +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "cosmos.slashing.v1beta1"; +export const protobufPackage = "cosmos.slashing.v1beta1" /** GenesisState defines the slashing module's genesis state. */ export interface GenesisState { /** params defines all the paramaters of related to deposit. */ - params?: Params; + params?: Params /** * signing_infos represents a map between validator addresses and their * signing infos. */ - signingInfos: SigningInfo[]; + signingInfos: SigningInfo[] /** * missed_blocks represents a map between validator addresses and their * missed blocks. */ - missedBlocks: ValidatorMissedBlocks[]; + missedBlocks: ValidatorMissedBlocks[] } /** SigningInfo stores validator signing info of corresponding address. */ export interface SigningInfo { /** address is the validator address. */ - address: string; + address: string /** validator_signing_info represents the signing info of this validator. */ - validatorSigningInfo?: ValidatorSigningInfo; + validatorSigningInfo?: ValidatorSigningInfo } /** @@ -35,59 +35,61 @@ export interface SigningInfo { */ export interface ValidatorMissedBlocks { /** address is the validator address. */ - address: string; + address: string /** missed_blocks is an array of missed blocks by the validator. */ - missedBlocks: MissedBlock[]; + missedBlocks: MissedBlock[] } /** MissedBlock contains height and missed status as boolean. */ export interface MissedBlock { /** index is the height at which the block was missed. */ - index: Long; + index: Long /** missed is the missed status. */ - missed: boolean; + missed: boolean } function createBaseGenesisState(): GenesisState { - return { params: undefined, signingInfos: [], missedBlocks: [] }; + return { params: undefined, signingInfos: [], missedBlocks: [] } } export const GenesisState = { encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.params !== undefined) { - Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + Params.encode(message.params, writer.uint32(10).fork()).ldelim() } for (const v of message.signingInfos) { - SigningInfo.encode(v!, writer.uint32(18).fork()).ldelim(); + SigningInfo.encode(v!, writer.uint32(18).fork()).ldelim() } for (const v of message.missedBlocks) { - ValidatorMissedBlocks.encode(v!, writer.uint32(26).fork()).ldelim(); + ValidatorMissedBlocks.encode(v!, writer.uint32(26).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGenesisState(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseGenesisState() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.params = Params.decode(reader, reader.uint32()); - break; + message.params = Params.decode(reader, reader.uint32()) + break case 2: - message.signingInfos.push(SigningInfo.decode(reader, reader.uint32())); - break; + message.signingInfos.push(SigningInfo.decode(reader, reader.uint32())) + break case 3: - message.missedBlocks.push(ValidatorMissedBlocks.decode(reader, reader.uint32())); - break; + message.missedBlocks.push( + ValidatorMissedBlocks.decode(reader, reader.uint32()), + ) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): GenesisState { @@ -99,70 +101,84 @@ export const GenesisState = { missedBlocks: Array.isArray(object?.missedBlocks) ? object.missedBlocks.map((e: any) => ValidatorMissedBlocks.fromJSON(e)) : [], - }; + } }, toJSON(message: GenesisState): unknown { - const obj: any = {}; - message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + const obj: any = {} + message.params !== undefined && + (obj.params = message.params ? Params.toJSON(message.params) : undefined) if (message.signingInfos) { - obj.signingInfos = message.signingInfos.map((e) => e ? SigningInfo.toJSON(e) : undefined); + obj.signingInfos = message.signingInfos.map((e) => + e ? SigningInfo.toJSON(e) : undefined, + ) } else { - obj.signingInfos = []; + obj.signingInfos = [] } if (message.missedBlocks) { - obj.missedBlocks = message.missedBlocks.map((e) => e ? ValidatorMissedBlocks.toJSON(e) : undefined); + obj.missedBlocks = message.missedBlocks.map((e) => + e ? ValidatorMissedBlocks.toJSON(e) : undefined, + ) } else { - obj.missedBlocks = []; + obj.missedBlocks = [] } - return obj; + return obj }, fromPartial, I>>(object: I): GenesisState { - const message = createBaseGenesisState(); - message.params = (object.params !== undefined && object.params !== null) - ? Params.fromPartial(object.params) - : undefined; - message.signingInfos = object.signingInfos?.map((e) => SigningInfo.fromPartial(e)) || []; - message.missedBlocks = object.missedBlocks?.map((e) => ValidatorMissedBlocks.fromPartial(e)) || []; - return message; + const message = createBaseGenesisState() + message.params = + object.params !== undefined && object.params !== null + ? Params.fromPartial(object.params) + : undefined + message.signingInfos = + object.signingInfos?.map((e) => SigningInfo.fromPartial(e)) || [] + message.missedBlocks = + object.missedBlocks?.map((e) => ValidatorMissedBlocks.fromPartial(e)) || [] + return message }, -}; +} function createBaseSigningInfo(): SigningInfo { - return { address: "", validatorSigningInfo: undefined }; + return { address: "", validatorSigningInfo: undefined } } export const SigningInfo = { encode(message: SigningInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.address !== "") { - writer.uint32(10).string(message.address); + writer.uint32(10).string(message.address) } if (message.validatorSigningInfo !== undefined) { - ValidatorSigningInfo.encode(message.validatorSigningInfo, writer.uint32(18).fork()).ldelim(); + ValidatorSigningInfo.encode( + message.validatorSigningInfo, + writer.uint32(18).fork(), + ).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): SigningInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSigningInfo(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseSigningInfo() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.address = reader.string(); - break; + message.address = reader.string() + break case 2: - message.validatorSigningInfo = ValidatorSigningInfo.decode(reader, reader.uint32()); - break; + message.validatorSigningInfo = ValidatorSigningInfo.decode( + reader, + reader.uint32(), + ) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): SigningInfo { @@ -171,62 +187,67 @@ export const SigningInfo = { validatorSigningInfo: isSet(object.validatorSigningInfo) ? ValidatorSigningInfo.fromJSON(object.validatorSigningInfo) : undefined, - }; + } }, toJSON(message: SigningInfo): unknown { - const obj: any = {}; - message.address !== undefined && (obj.address = message.address); - message.validatorSigningInfo !== undefined && (obj.validatorSigningInfo = message.validatorSigningInfo - ? ValidatorSigningInfo.toJSON(message.validatorSigningInfo) - : undefined); - return obj; + const obj: any = {} + message.address !== undefined && (obj.address = message.address) + message.validatorSigningInfo !== undefined && + (obj.validatorSigningInfo = message.validatorSigningInfo + ? ValidatorSigningInfo.toJSON(message.validatorSigningInfo) + : undefined) + return obj }, fromPartial, I>>(object: I): SigningInfo { - const message = createBaseSigningInfo(); - message.address = object.address ?? ""; - message.validatorSigningInfo = (object.validatorSigningInfo !== undefined && object.validatorSigningInfo !== null) - ? ValidatorSigningInfo.fromPartial(object.validatorSigningInfo) - : undefined; - return message; + const message = createBaseSigningInfo() + message.address = object.address ?? "" + message.validatorSigningInfo = + object.validatorSigningInfo !== undefined && object.validatorSigningInfo !== null + ? ValidatorSigningInfo.fromPartial(object.validatorSigningInfo) + : undefined + return message }, -}; +} function createBaseValidatorMissedBlocks(): ValidatorMissedBlocks { - return { address: "", missedBlocks: [] }; + return { address: "", missedBlocks: [] } } export const ValidatorMissedBlocks = { - encode(message: ValidatorMissedBlocks, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: ValidatorMissedBlocks, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.address !== "") { - writer.uint32(10).string(message.address); + writer.uint32(10).string(message.address) } for (const v of message.missedBlocks) { - MissedBlock.encode(v!, writer.uint32(18).fork()).ldelim(); + MissedBlock.encode(v!, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorMissedBlocks { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseValidatorMissedBlocks(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseValidatorMissedBlocks() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.address = reader.string(); - break; + message.address = reader.string() + break case 2: - message.missedBlocks.push(MissedBlock.decode(reader, reader.uint32())); - break; + message.missedBlocks.push(MissedBlock.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): ValidatorMissedBlocks { @@ -235,103 +256,121 @@ export const ValidatorMissedBlocks = { missedBlocks: Array.isArray(object?.missedBlocks) ? object.missedBlocks.map((e: any) => MissedBlock.fromJSON(e)) : [], - }; + } }, toJSON(message: ValidatorMissedBlocks): unknown { - const obj: any = {}; - message.address !== undefined && (obj.address = message.address); + const obj: any = {} + message.address !== undefined && (obj.address = message.address) if (message.missedBlocks) { - obj.missedBlocks = message.missedBlocks.map((e) => e ? MissedBlock.toJSON(e) : undefined); + obj.missedBlocks = message.missedBlocks.map((e) => + e ? MissedBlock.toJSON(e) : undefined, + ) } else { - obj.missedBlocks = []; + obj.missedBlocks = [] } - return obj; + return obj }, - fromPartial, I>>(object: I): ValidatorMissedBlocks { - const message = createBaseValidatorMissedBlocks(); - message.address = object.address ?? ""; - message.missedBlocks = object.missedBlocks?.map((e) => MissedBlock.fromPartial(e)) || []; - return message; + fromPartial, I>>( + object: I, + ): ValidatorMissedBlocks { + const message = createBaseValidatorMissedBlocks() + message.address = object.address ?? "" + message.missedBlocks = + object.missedBlocks?.map((e) => MissedBlock.fromPartial(e)) || [] + return message }, -}; +} function createBaseMissedBlock(): MissedBlock { - return { index: Long.ZERO, missed: false }; + return { index: Long.ZERO, missed: false } } export const MissedBlock = { encode(message: MissedBlock, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (!message.index.isZero()) { - writer.uint32(8).int64(message.index); + writer.uint32(8).int64(message.index) } if (message.missed === true) { - writer.uint32(16).bool(message.missed); + writer.uint32(16).bool(message.missed) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MissedBlock { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMissedBlock(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMissedBlock() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.index = reader.int64() as Long; - break; + message.index = reader.int64() as Long + break case 2: - message.missed = reader.bool(); - break; + message.missed = reader.bool() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): MissedBlock { return { index: isSet(object.index) ? Long.fromValue(object.index) : Long.ZERO, missed: isSet(object.missed) ? Boolean(object.missed) : false, - }; + } }, toJSON(message: MissedBlock): unknown { - const obj: any = {}; - message.index !== undefined && (obj.index = (message.index || Long.ZERO).toString()); - message.missed !== undefined && (obj.missed = message.missed); - return obj; + const obj: any = {} + message.index !== undefined && (obj.index = (message.index || Long.ZERO).toString()) + message.missed !== undefined && (obj.missed = message.missed) + return obj }, fromPartial, I>>(object: I): MissedBlock { - const message = createBaseMissedBlock(); - message.index = (object.index !== undefined && object.index !== null) ? Long.fromValue(object.index) : Long.ZERO; - message.missed = object.missed ?? false; - return message; + const message = createBaseMissedBlock() + message.index = + object.index !== undefined && object.index !== null + ? Long.fromValue(object.index) + : Long.ZERO + message.missed = object.missed ?? false + return message }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; +} -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/cosmos/slashing/v1beta1/query.ts b/packages/protojs/src/cosmos/slashing/v1beta1/query.ts index b184773b..dbbc3221 100644 --- a/packages/protojs/src/cosmos/slashing/v1beta1/query.ts +++ b/packages/protojs/src/cosmos/slashing/v1beta1/query.ts @@ -1,18 +1,17 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { PageRequest, PageResponse } from "../../base/query/v1beta1/pagination"; -import { Params, ValidatorSigningInfo } from "./slashing"; +import { Params, ValidatorSigningInfo } from "./slashing" +import { PageRequest, PageResponse } from "../../base/query/v1beta1/pagination" +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "cosmos.slashing.v1beta1"; +export const protobufPackage = "cosmos.slashing.v1beta1" /** QueryParamsRequest is the request type for the Query/Params RPC method */ -export interface QueryParamsRequest { -} +export interface QueryParamsRequest {} /** QueryParamsResponse is the response type for the Query/Params RPC method */ export interface QueryParamsResponse { - params?: Params; + params?: Params } /** @@ -21,7 +20,7 @@ export interface QueryParamsResponse { */ export interface QuerySigningInfoRequest { /** cons_address is the address to query signing info of */ - consAddress: string; + consAddress: string } /** @@ -30,7 +29,7 @@ export interface QuerySigningInfoRequest { */ export interface QuerySigningInfoResponse { /** val_signing_info is the signing info of requested val cons address */ - valSigningInfo?: ValidatorSigningInfo; + valSigningInfo?: ValidatorSigningInfo } /** @@ -38,7 +37,7 @@ export interface QuerySigningInfoResponse { * method */ export interface QuerySigningInfosRequest { - pagination?: PageRequest; + pagination?: PageRequest } /** @@ -47,370 +46,447 @@ export interface QuerySigningInfosRequest { */ export interface QuerySigningInfosResponse { /** info is the signing info of all validators */ - info: ValidatorSigningInfo[]; - pagination?: PageResponse; + info: ValidatorSigningInfo[] + pagination?: PageResponse } function createBaseQueryParamsRequest(): QueryParamsRequest { - return {}; + return {} } export const QueryParamsRequest = { encode(_: QueryParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryParamsRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryParamsRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(_: any): QueryParamsRequest { - return {}; + return {} }, toJSON(_: QueryParamsRequest): unknown { - const obj: any = {}; - return obj; + const obj: any = {} + return obj }, - fromPartial, I>>(_: I): QueryParamsRequest { - const message = createBaseQueryParamsRequest(); - return message; + fromPartial, I>>( + _: I, + ): QueryParamsRequest { + const message = createBaseQueryParamsRequest() + return message }, -}; +} function createBaseQueryParamsResponse(): QueryParamsResponse { - return { params: undefined }; + return { params: undefined } } export const QueryParamsResponse = { - encode(message: QueryParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryParamsResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.params !== undefined) { - Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + Params.encode(message.params, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryParamsResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryParamsResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.params = Params.decode(reader, reader.uint32()); - break; + message.params = Params.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryParamsResponse { - return { params: isSet(object.params) ? Params.fromJSON(object.params) : undefined }; + return { + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined, + } }, toJSON(message: QueryParamsResponse): unknown { - const obj: any = {}; - message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); - return obj; + const obj: any = {} + message.params !== undefined && + (obj.params = message.params ? Params.toJSON(message.params) : undefined) + return obj }, - fromPartial, I>>(object: I): QueryParamsResponse { - const message = createBaseQueryParamsResponse(); - message.params = (object.params !== undefined && object.params !== null) - ? Params.fromPartial(object.params) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): QueryParamsResponse { + const message = createBaseQueryParamsResponse() + message.params = + object.params !== undefined && object.params !== null + ? Params.fromPartial(object.params) + : undefined + return message }, -}; +} function createBaseQuerySigningInfoRequest(): QuerySigningInfoRequest { - return { consAddress: "" }; + return { consAddress: "" } } export const QuerySigningInfoRequest = { - encode(message: QuerySigningInfoRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QuerySigningInfoRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.consAddress !== "") { - writer.uint32(10).string(message.consAddress); + writer.uint32(10).string(message.consAddress) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QuerySigningInfoRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQuerySigningInfoRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQuerySigningInfoRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.consAddress = reader.string(); - break; + message.consAddress = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QuerySigningInfoRequest { - return { consAddress: isSet(object.consAddress) ? String(object.consAddress) : "" }; + return { + consAddress: isSet(object.consAddress) ? String(object.consAddress) : "", + } }, toJSON(message: QuerySigningInfoRequest): unknown { - const obj: any = {}; - message.consAddress !== undefined && (obj.consAddress = message.consAddress); - return obj; + const obj: any = {} + message.consAddress !== undefined && (obj.consAddress = message.consAddress) + return obj }, - fromPartial, I>>(object: I): QuerySigningInfoRequest { - const message = createBaseQuerySigningInfoRequest(); - message.consAddress = object.consAddress ?? ""; - return message; + fromPartial, I>>( + object: I, + ): QuerySigningInfoRequest { + const message = createBaseQuerySigningInfoRequest() + message.consAddress = object.consAddress ?? "" + return message }, -}; +} function createBaseQuerySigningInfoResponse(): QuerySigningInfoResponse { - return { valSigningInfo: undefined }; + return { valSigningInfo: undefined } } export const QuerySigningInfoResponse = { - encode(message: QuerySigningInfoResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QuerySigningInfoResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.valSigningInfo !== undefined) { - ValidatorSigningInfo.encode(message.valSigningInfo, writer.uint32(10).fork()).ldelim(); + ValidatorSigningInfo.encode( + message.valSigningInfo, + writer.uint32(10).fork(), + ).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QuerySigningInfoResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQuerySigningInfoResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQuerySigningInfoResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.valSigningInfo = ValidatorSigningInfo.decode(reader, reader.uint32()); - break; + message.valSigningInfo = ValidatorSigningInfo.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QuerySigningInfoResponse { return { - valSigningInfo: isSet(object.valSigningInfo) ? ValidatorSigningInfo.fromJSON(object.valSigningInfo) : undefined, - }; + valSigningInfo: isSet(object.valSigningInfo) + ? ValidatorSigningInfo.fromJSON(object.valSigningInfo) + : undefined, + } }, toJSON(message: QuerySigningInfoResponse): unknown { - const obj: any = {}; + const obj: any = {} message.valSigningInfo !== undefined && - (obj.valSigningInfo = message.valSigningInfo ? ValidatorSigningInfo.toJSON(message.valSigningInfo) : undefined); - return obj; + (obj.valSigningInfo = message.valSigningInfo + ? ValidatorSigningInfo.toJSON(message.valSigningInfo) + : undefined) + return obj }, - fromPartial, I>>(object: I): QuerySigningInfoResponse { - const message = createBaseQuerySigningInfoResponse(); - message.valSigningInfo = (object.valSigningInfo !== undefined && object.valSigningInfo !== null) - ? ValidatorSigningInfo.fromPartial(object.valSigningInfo) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): QuerySigningInfoResponse { + const message = createBaseQuerySigningInfoResponse() + message.valSigningInfo = + object.valSigningInfo !== undefined && object.valSigningInfo !== null + ? ValidatorSigningInfo.fromPartial(object.valSigningInfo) + : undefined + return message }, -}; +} function createBaseQuerySigningInfosRequest(): QuerySigningInfosRequest { - return { pagination: undefined }; + return { pagination: undefined } } export const QuerySigningInfosRequest = { - encode(message: QuerySigningInfosRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QuerySigningInfosRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QuerySigningInfosRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQuerySigningInfosRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQuerySigningInfosRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; + message.pagination = PageRequest.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QuerySigningInfosRequest { - return { pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined }; + return { + pagination: isSet(object.pagination) + ? PageRequest.fromJSON(object.pagination) + : undefined, + } }, toJSON(message: QuerySigningInfosRequest): unknown { - const obj: any = {}; + const obj: any = {} message.pagination !== undefined && - (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); - return obj; + (obj.pagination = message.pagination + ? PageRequest.toJSON(message.pagination) + : undefined) + return obj }, - fromPartial, I>>(object: I): QuerySigningInfosRequest { - const message = createBaseQuerySigningInfosRequest(); - message.pagination = (object.pagination !== undefined && object.pagination !== null) - ? PageRequest.fromPartial(object.pagination) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): QuerySigningInfosRequest { + const message = createBaseQuerySigningInfosRequest() + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageRequest.fromPartial(object.pagination) + : undefined + return message }, -}; +} function createBaseQuerySigningInfosResponse(): QuerySigningInfosResponse { - return { info: [], pagination: undefined }; + return { info: [], pagination: undefined } } export const QuerySigningInfosResponse = { - encode(message: QuerySigningInfosResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QuerySigningInfosResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { for (const v of message.info) { - ValidatorSigningInfo.encode(v!, writer.uint32(10).fork()).ldelim(); + ValidatorSigningInfo.encode(v!, writer.uint32(10).fork()).ldelim() } if (message.pagination !== undefined) { - PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QuerySigningInfosResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQuerySigningInfosResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQuerySigningInfosResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.info.push(ValidatorSigningInfo.decode(reader, reader.uint32())); - break; + message.info.push(ValidatorSigningInfo.decode(reader, reader.uint32())) + break case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; + message.pagination = PageResponse.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QuerySigningInfosResponse { return { - info: Array.isArray(object?.info) ? object.info.map((e: any) => ValidatorSigningInfo.fromJSON(e)) : [], - pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, - }; + info: Array.isArray(object?.info) + ? object.info.map((e: any) => ValidatorSigningInfo.fromJSON(e)) + : [], + pagination: isSet(object.pagination) + ? PageResponse.fromJSON(object.pagination) + : undefined, + } }, toJSON(message: QuerySigningInfosResponse): unknown { - const obj: any = {}; + const obj: any = {} if (message.info) { - obj.info = message.info.map((e) => e ? ValidatorSigningInfo.toJSON(e) : undefined); + obj.info = message.info.map((e) => + e ? ValidatorSigningInfo.toJSON(e) : undefined, + ) } else { - obj.info = []; + obj.info = [] } message.pagination !== undefined && - (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); - return obj; + (obj.pagination = message.pagination + ? PageResponse.toJSON(message.pagination) + : undefined) + return obj }, - fromPartial, I>>(object: I): QuerySigningInfosResponse { - const message = createBaseQuerySigningInfosResponse(); - message.info = object.info?.map((e) => ValidatorSigningInfo.fromPartial(e)) || []; - message.pagination = (object.pagination !== undefined && object.pagination !== null) - ? PageResponse.fromPartial(object.pagination) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): QuerySigningInfosResponse { + const message = createBaseQuerySigningInfosResponse() + message.info = object.info?.map((e) => ValidatorSigningInfo.fromPartial(e)) || [] + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageResponse.fromPartial(object.pagination) + : undefined + return message }, -}; +} /** Query provides defines the gRPC querier service */ export interface Query { /** Params queries the parameters of slashing module */ - Params(request: QueryParamsRequest): Promise; + Params(request: QueryParamsRequest): Promise /** SigningInfo queries the signing info of given cons address */ - SigningInfo(request: QuerySigningInfoRequest): Promise; + SigningInfo(request: QuerySigningInfoRequest): Promise /** SigningInfos queries signing info of all validators */ - SigningInfos(request: QuerySigningInfosRequest): Promise; + SigningInfos(request: QuerySigningInfosRequest): Promise } export class QueryClientImpl implements Query { - private readonly rpc: Rpc; + private readonly rpc: Rpc constructor(rpc: Rpc) { - this.rpc = rpc; - this.Params = this.Params.bind(this); - this.SigningInfo = this.SigningInfo.bind(this); - this.SigningInfos = this.SigningInfos.bind(this); + this.rpc = rpc + this.Params = this.Params.bind(this) + this.SigningInfo = this.SigningInfo.bind(this) + this.SigningInfos = this.SigningInfos.bind(this) } Params(request: QueryParamsRequest): Promise { - const data = QueryParamsRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.slashing.v1beta1.Query", "Params", data); - return promise.then((data) => QueryParamsResponse.decode(new _m0.Reader(data))); + const data = QueryParamsRequest.encode(request).finish() + const promise = this.rpc.request("cosmos.slashing.v1beta1.Query", "Params", data) + return promise.then((data) => QueryParamsResponse.decode(new _m0.Reader(data))) } SigningInfo(request: QuerySigningInfoRequest): Promise { - const data = QuerySigningInfoRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.slashing.v1beta1.Query", "SigningInfo", data); - return promise.then((data) => QuerySigningInfoResponse.decode(new _m0.Reader(data))); + const data = QuerySigningInfoRequest.encode(request).finish() + const promise = this.rpc.request( + "cosmos.slashing.v1beta1.Query", + "SigningInfo", + data, + ) + return promise.then((data) => QuerySigningInfoResponse.decode(new _m0.Reader(data))) } SigningInfos(request: QuerySigningInfosRequest): Promise { - const data = QuerySigningInfosRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.slashing.v1beta1.Query", "SigningInfos", data); - return promise.then((data) => QuerySigningInfosResponse.decode(new _m0.Reader(data))); + const data = QuerySigningInfosRequest.encode(request).finish() + const promise = this.rpc.request( + "cosmos.slashing.v1beta1.Query", + "SigningInfos", + data, + ) + return promise.then((data) => + QuerySigningInfosResponse.decode(new _m0.Reader(data)), + ) } } interface Rpc { - request(service: string, method: string, data: Uint8Array): Promise; + request(service: string, method: string, data: Uint8Array): Promise } -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/cosmos/slashing/v1beta1/slashing.ts b/packages/protojs/src/cosmos/slashing/v1beta1/slashing.ts index 5cbb5e0c..96d0aa32 100644 --- a/packages/protojs/src/cosmos/slashing/v1beta1/slashing.ts +++ b/packages/protojs/src/cosmos/slashing/v1beta1/slashing.ts @@ -1,46 +1,46 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { Duration } from "../../../google/protobuf/duration"; -import { Timestamp } from "../../../google/protobuf/timestamp"; +import { Duration } from "../../../google/protobuf/duration" +import { Timestamp } from "../../../google/protobuf/timestamp" +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "cosmos.slashing.v1beta1"; +export const protobufPackage = "cosmos.slashing.v1beta1" /** * ValidatorSigningInfo defines a validator's signing info for monitoring their * liveness activity. */ export interface ValidatorSigningInfo { - address: string; + address: string /** Height at which validator was first a candidate OR was unjailed */ - startHeight: Long; + startHeight: Long /** * Index which is incremented each time the validator was a bonded * in a block and may have signed a precommit or not. This in conjunction with the * `SignedBlocksWindow` param determines the index in the `MissedBlocksBitArray`. */ - indexOffset: Long; + indexOffset: Long /** Timestamp until which the validator is jailed due to liveness downtime. */ - jailedUntil?: Date; + jailedUntil?: Date /** * Whether or not a validator has been tombstoned (killed out of validator set). It is set * once the validator commits an equivocation or for any other configured misbehiavor. */ - tombstoned: boolean; + tombstoned: boolean /** * A counter kept to avoid unnecessary array reads. * Note that `Sum(MissedBlocksBitArray)` always equals `MissedBlocksCounter`. */ - missedBlocksCounter: Long; + missedBlocksCounter: Long } /** Params represents the parameters used for by the slashing module. */ export interface Params { - signedBlocksWindow: Long; - minSignedPerWindow: Uint8Array; - downtimeJailDuration?: Duration; - slashFractionDoubleSign: Uint8Array; - slashFractionDowntime: Uint8Array; + signedBlocksWindow: Long + minSignedPerWindow: Uint8Array + downtimeJailDuration?: Duration + slashFractionDoubleSign: Uint8Array + slashFractionDowntime: Uint8Array } function createBaseValidatorSigningInfo(): ValidatorSigningInfo { @@ -51,105 +51,127 @@ function createBaseValidatorSigningInfo(): ValidatorSigningInfo { jailedUntil: undefined, tombstoned: false, missedBlocksCounter: Long.ZERO, - }; + } } export const ValidatorSigningInfo = { - encode(message: ValidatorSigningInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: ValidatorSigningInfo, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.address !== "") { - writer.uint32(10).string(message.address); + writer.uint32(10).string(message.address) } if (!message.startHeight.isZero()) { - writer.uint32(16).int64(message.startHeight); + writer.uint32(16).int64(message.startHeight) } if (!message.indexOffset.isZero()) { - writer.uint32(24).int64(message.indexOffset); + writer.uint32(24).int64(message.indexOffset) } if (message.jailedUntil !== undefined) { - Timestamp.encode(toTimestamp(message.jailedUntil), writer.uint32(34).fork()).ldelim(); + Timestamp.encode( + toTimestamp(message.jailedUntil), + writer.uint32(34).fork(), + ).ldelim() } if (message.tombstoned === true) { - writer.uint32(40).bool(message.tombstoned); + writer.uint32(40).bool(message.tombstoned) } if (!message.missedBlocksCounter.isZero()) { - writer.uint32(48).int64(message.missedBlocksCounter); + writer.uint32(48).int64(message.missedBlocksCounter) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorSigningInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseValidatorSigningInfo(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseValidatorSigningInfo() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.address = reader.string(); - break; + message.address = reader.string() + break case 2: - message.startHeight = reader.int64() as Long; - break; + message.startHeight = reader.int64() as Long + break case 3: - message.indexOffset = reader.int64() as Long; - break; + message.indexOffset = reader.int64() as Long + break case 4: - message.jailedUntil = fromTimestamp(Timestamp.decode(reader, reader.uint32())); - break; + message.jailedUntil = fromTimestamp(Timestamp.decode(reader, reader.uint32())) + break case 5: - message.tombstoned = reader.bool(); - break; + message.tombstoned = reader.bool() + break case 6: - message.missedBlocksCounter = reader.int64() as Long; - break; + message.missedBlocksCounter = reader.int64() as Long + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): ValidatorSigningInfo { return { address: isSet(object.address) ? String(object.address) : "", - startHeight: isSet(object.startHeight) ? Long.fromValue(object.startHeight) : Long.ZERO, - indexOffset: isSet(object.indexOffset) ? Long.fromValue(object.indexOffset) : Long.ZERO, - jailedUntil: isSet(object.jailedUntil) ? fromJsonTimestamp(object.jailedUntil) : undefined, + startHeight: isSet(object.startHeight) + ? Long.fromValue(object.startHeight) + : Long.ZERO, + indexOffset: isSet(object.indexOffset) + ? Long.fromValue(object.indexOffset) + : Long.ZERO, + jailedUntil: isSet(object.jailedUntil) + ? fromJsonTimestamp(object.jailedUntil) + : undefined, tombstoned: isSet(object.tombstoned) ? Boolean(object.tombstoned) : false, - missedBlocksCounter: isSet(object.missedBlocksCounter) ? Long.fromValue(object.missedBlocksCounter) : Long.ZERO, - }; + missedBlocksCounter: isSet(object.missedBlocksCounter) + ? Long.fromValue(object.missedBlocksCounter) + : Long.ZERO, + } }, toJSON(message: ValidatorSigningInfo): unknown { - const obj: any = {}; - message.address !== undefined && (obj.address = message.address); - message.startHeight !== undefined && (obj.startHeight = (message.startHeight || Long.ZERO).toString()); - message.indexOffset !== undefined && (obj.indexOffset = (message.indexOffset || Long.ZERO).toString()); - message.jailedUntil !== undefined && (obj.jailedUntil = message.jailedUntil.toISOString()); - message.tombstoned !== undefined && (obj.tombstoned = message.tombstoned); + const obj: any = {} + message.address !== undefined && (obj.address = message.address) + message.startHeight !== undefined && + (obj.startHeight = (message.startHeight || Long.ZERO).toString()) + message.indexOffset !== undefined && + (obj.indexOffset = (message.indexOffset || Long.ZERO).toString()) + message.jailedUntil !== undefined && + (obj.jailedUntil = message.jailedUntil.toISOString()) + message.tombstoned !== undefined && (obj.tombstoned = message.tombstoned) message.missedBlocksCounter !== undefined && - (obj.missedBlocksCounter = (message.missedBlocksCounter || Long.ZERO).toString()); - return obj; + (obj.missedBlocksCounter = (message.missedBlocksCounter || Long.ZERO).toString()) + return obj }, - fromPartial, I>>(object: I): ValidatorSigningInfo { - const message = createBaseValidatorSigningInfo(); - message.address = object.address ?? ""; - message.startHeight = (object.startHeight !== undefined && object.startHeight !== null) - ? Long.fromValue(object.startHeight) - : Long.ZERO; - message.indexOffset = (object.indexOffset !== undefined && object.indexOffset !== null) - ? Long.fromValue(object.indexOffset) - : Long.ZERO; - message.jailedUntil = object.jailedUntil ?? undefined; - message.tombstoned = object.tombstoned ?? false; - message.missedBlocksCounter = (object.missedBlocksCounter !== undefined && object.missedBlocksCounter !== null) - ? Long.fromValue(object.missedBlocksCounter) - : Long.ZERO; - return message; + fromPartial, I>>( + object: I, + ): ValidatorSigningInfo { + const message = createBaseValidatorSigningInfo() + message.address = object.address ?? "" + message.startHeight = + object.startHeight !== undefined && object.startHeight !== null + ? Long.fromValue(object.startHeight) + : Long.ZERO + message.indexOffset = + object.indexOffset !== undefined && object.indexOffset !== null + ? Long.fromValue(object.indexOffset) + : Long.ZERO + message.jailedUntil = object.jailedUntil ?? undefined + message.tombstoned = object.tombstoned ?? false + message.missedBlocksCounter = + object.missedBlocksCounter !== undefined && object.missedBlocksCounter !== null + ? Long.fromValue(object.missedBlocksCounter) + : Long.ZERO + return message }, -}; +} function createBaseParams(): Params { return { @@ -158,62 +180,64 @@ function createBaseParams(): Params { downtimeJailDuration: undefined, slashFractionDoubleSign: new Uint8Array(), slashFractionDowntime: new Uint8Array(), - }; + } } export const Params = { encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (!message.signedBlocksWindow.isZero()) { - writer.uint32(8).int64(message.signedBlocksWindow); + writer.uint32(8).int64(message.signedBlocksWindow) } if (message.minSignedPerWindow.length !== 0) { - writer.uint32(18).bytes(message.minSignedPerWindow); + writer.uint32(18).bytes(message.minSignedPerWindow) } if (message.downtimeJailDuration !== undefined) { - Duration.encode(message.downtimeJailDuration, writer.uint32(26).fork()).ldelim(); + Duration.encode(message.downtimeJailDuration, writer.uint32(26).fork()).ldelim() } if (message.slashFractionDoubleSign.length !== 0) { - writer.uint32(34).bytes(message.slashFractionDoubleSign); + writer.uint32(34).bytes(message.slashFractionDoubleSign) } if (message.slashFractionDowntime.length !== 0) { - writer.uint32(42).bytes(message.slashFractionDowntime); + writer.uint32(42).bytes(message.slashFractionDowntime) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Params { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseParams(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseParams() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.signedBlocksWindow = reader.int64() as Long; - break; + message.signedBlocksWindow = reader.int64() as Long + break case 2: - message.minSignedPerWindow = reader.bytes(); - break; + message.minSignedPerWindow = reader.bytes() + break case 3: - message.downtimeJailDuration = Duration.decode(reader, reader.uint32()); - break; + message.downtimeJailDuration = Duration.decode(reader, reader.uint32()) + break case 4: - message.slashFractionDoubleSign = reader.bytes(); - break; + message.slashFractionDoubleSign = reader.bytes() + break case 5: - message.slashFractionDowntime = reader.bytes(); - break; + message.slashFractionDowntime = reader.bytes() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Params { return { - signedBlocksWindow: isSet(object.signedBlocksWindow) ? Long.fromValue(object.signedBlocksWindow) : Long.ZERO, + signedBlocksWindow: isSet(object.signedBlocksWindow) + ? Long.fromValue(object.signedBlocksWindow) + : Long.ZERO, minSignedPerWindow: isSet(object.minSignedPerWindow) ? bytesFromBase64(object.minSignedPerWindow) : new Uint8Array(), @@ -226,133 +250,140 @@ export const Params = { slashFractionDowntime: isSet(object.slashFractionDowntime) ? bytesFromBase64(object.slashFractionDowntime) : new Uint8Array(), - }; + } }, toJSON(message: Params): unknown { - const obj: any = {}; + const obj: any = {} message.signedBlocksWindow !== undefined && - (obj.signedBlocksWindow = (message.signedBlocksWindow || Long.ZERO).toString()); + (obj.signedBlocksWindow = (message.signedBlocksWindow || Long.ZERO).toString()) message.minSignedPerWindow !== undefined && (obj.minSignedPerWindow = base64FromBytes( - message.minSignedPerWindow !== undefined ? message.minSignedPerWindow : new Uint8Array(), - )); - message.downtimeJailDuration !== undefined && (obj.downtimeJailDuration = message.downtimeJailDuration - ? Duration.toJSON(message.downtimeJailDuration) - : undefined); + message.minSignedPerWindow !== undefined + ? message.minSignedPerWindow + : new Uint8Array(), + )) + message.downtimeJailDuration !== undefined && + (obj.downtimeJailDuration = message.downtimeJailDuration + ? Duration.toJSON(message.downtimeJailDuration) + : undefined) message.slashFractionDoubleSign !== undefined && (obj.slashFractionDoubleSign = base64FromBytes( - message.slashFractionDoubleSign !== undefined ? message.slashFractionDoubleSign : new Uint8Array(), - )); + message.slashFractionDoubleSign !== undefined + ? message.slashFractionDoubleSign + : new Uint8Array(), + )) message.slashFractionDowntime !== undefined && (obj.slashFractionDowntime = base64FromBytes( - message.slashFractionDowntime !== undefined ? message.slashFractionDowntime : new Uint8Array(), - )); - return obj; + message.slashFractionDowntime !== undefined + ? message.slashFractionDowntime + : new Uint8Array(), + )) + return obj }, fromPartial, I>>(object: I): Params { - const message = createBaseParams(); - message.signedBlocksWindow = (object.signedBlocksWindow !== undefined && object.signedBlocksWindow !== null) - ? Long.fromValue(object.signedBlocksWindow) - : Long.ZERO; - message.minSignedPerWindow = object.minSignedPerWindow ?? new Uint8Array(); - message.downtimeJailDuration = (object.downtimeJailDuration !== undefined && object.downtimeJailDuration !== null) - ? Duration.fromPartial(object.downtimeJailDuration) - : undefined; - message.slashFractionDoubleSign = object.slashFractionDoubleSign ?? new Uint8Array(); - message.slashFractionDowntime = object.slashFractionDowntime ?? new Uint8Array(); - return message; + const message = createBaseParams() + message.signedBlocksWindow = + object.signedBlocksWindow !== undefined && object.signedBlocksWindow !== null + ? Long.fromValue(object.signedBlocksWindow) + : Long.ZERO + message.minSignedPerWindow = object.minSignedPerWindow ?? new Uint8Array() + message.downtimeJailDuration = + object.downtimeJailDuration !== undefined && object.downtimeJailDuration !== null + ? Duration.fromPartial(object.downtimeJailDuration) + : undefined + message.slashFractionDoubleSign = object.slashFractionDoubleSign ?? new Uint8Array() + message.slashFractionDowntime = object.slashFractionDowntime ?? new Uint8Array() + return message }, -}; +} -declare var self: any | undefined; -declare var window: any | undefined; -declare var global: any | undefined; +declare var self: any | undefined +declare var window: any | undefined +declare var global: any | undefined var globalThis: any = (() => { - if (typeof globalThis !== "undefined") { - return globalThis; - } - if (typeof self !== "undefined") { - return self; - } - if (typeof window !== "undefined") { - return window; - } - if (typeof global !== "undefined") { - return global; - } - throw "Unable to locate global object"; -})(); + if (typeof globalThis !== "undefined") return globalThis + if (typeof self !== "undefined") return self + if (typeof window !== "undefined") return window + if (typeof global !== "undefined") return global + throw "Unable to locate global object" +})() +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")) function bytesFromBase64(b64: string): Uint8Array { - if (globalThis.Buffer) { - return Uint8Array.from(globalThis.Buffer.from(b64, "base64")); - } else { - const bin = globalThis.atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; + 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 } +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")) function base64FromBytes(arr: Uint8Array): string { - if (globalThis.Buffer) { - return globalThis.Buffer.from(arr).toString("base64"); - } else { - const bin: string[] = []; - arr.forEach((byte) => { - bin.push(String.fromCharCode(byte)); - }); - return globalThis.btoa(bin.join("")); - } + const bin: string[] = [] + arr.forEach((byte) => { + bin.push(String.fromCharCode(byte)) + }) + return btoa(bin.join("")) } -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > function toTimestamp(date: Date): Timestamp { - const seconds = numberToLong(date.getTime() / 1_000); - const nanos = (date.getTime() % 1_000) * 1_000_000; - return { seconds, nanos }; + const seconds = numberToLong(date.getTime() / 1_000) + const nanos = (date.getTime() % 1_000) * 1_000_000 + return { seconds, nanos } } function fromTimestamp(t: Timestamp): Date { - let millis = t.seconds.toNumber() * 1_000; - millis += t.nanos / 1_000_000; - return new Date(millis); + let millis = t.seconds.toNumber() * 1_000 + millis += t.nanos / 1_000_000 + return new Date(millis) } function fromJsonTimestamp(o: any): Date { if (o instanceof Date) { - return o; + return o } else if (typeof o === "string") { - return new Date(o); + return new Date(o) } else { - return fromTimestamp(Timestamp.fromJSON(o)); + return fromTimestamp(Timestamp.fromJSON(o)) } } function numberToLong(number: number) { - return Long.fromNumber(number); + return Long.fromNumber(number) } if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/cosmos/slashing/v1beta1/tx.ts b/packages/protojs/src/cosmos/slashing/v1beta1/tx.ts index 6bc2191e..e8e9e1d7 100644 --- a/packages/protojs/src/cosmos/slashing/v1beta1/tx.ts +++ b/packages/protojs/src/cosmos/slashing/v1beta1/tx.ts @@ -1,103 +1,106 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "cosmos.slashing.v1beta1"; +export const protobufPackage = "cosmos.slashing.v1beta1" /** MsgUnjail defines the Msg/Unjail request type */ export interface MsgUnjail { - validatorAddr: string; + validatorAddr: string } /** MsgUnjailResponse defines the Msg/Unjail response type */ -export interface MsgUnjailResponse { -} +export interface MsgUnjailResponse {} function createBaseMsgUnjail(): MsgUnjail { - return { validatorAddr: "" }; + return { validatorAddr: "" } } export const MsgUnjail = { encode(message: MsgUnjail, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.validatorAddr !== "") { - writer.uint32(10).string(message.validatorAddr); + writer.uint32(10).string(message.validatorAddr) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MsgUnjail { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgUnjail(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgUnjail() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.validatorAddr = reader.string(); - break; + message.validatorAddr = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): MsgUnjail { - return { validatorAddr: isSet(object.validatorAddr) ? String(object.validatorAddr) : "" }; + return { + validatorAddr: isSet(object.validatorAddr) ? String(object.validatorAddr) : "", + } }, toJSON(message: MsgUnjail): unknown { - const obj: any = {}; - message.validatorAddr !== undefined && (obj.validatorAddr = message.validatorAddr); - return obj; + const obj: any = {} + message.validatorAddr !== undefined && (obj.validatorAddr = message.validatorAddr) + return obj }, fromPartial, I>>(object: I): MsgUnjail { - const message = createBaseMsgUnjail(); - message.validatorAddr = object.validatorAddr ?? ""; - return message; + const message = createBaseMsgUnjail() + message.validatorAddr = object.validatorAddr ?? "" + return message }, -}; +} function createBaseMsgUnjailResponse(): MsgUnjailResponse { - return {}; + return {} } export const MsgUnjailResponse = { encode(_: MsgUnjailResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MsgUnjailResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgUnjailResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgUnjailResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(_: any): MsgUnjailResponse { - return {}; + return {} }, toJSON(_: MsgUnjailResponse): unknown { - const obj: any = {}; - return obj; + const obj: any = {} + return obj }, - fromPartial, I>>(_: I): MsgUnjailResponse { - const message = createBaseMsgUnjailResponse(); - return message; + fromPartial, I>>( + _: I, + ): MsgUnjailResponse { + const message = createBaseMsgUnjailResponse() + return message }, -}; +} /** Msg defines the slashing Msg service. */ export interface Msg { @@ -106,43 +109,53 @@ export interface Msg { * them into the bonded validator set, so they can begin receiving provisions * and rewards again. */ - Unjail(request: MsgUnjail): Promise; + Unjail(request: MsgUnjail): Promise } export class MsgClientImpl implements Msg { - private readonly rpc: Rpc; + private readonly rpc: Rpc constructor(rpc: Rpc) { - this.rpc = rpc; - this.Unjail = this.Unjail.bind(this); + this.rpc = rpc + this.Unjail = this.Unjail.bind(this) } Unjail(request: MsgUnjail): Promise { - const data = MsgUnjail.encode(request).finish(); - const promise = this.rpc.request("cosmos.slashing.v1beta1.Msg", "Unjail", data); - return promise.then((data) => MsgUnjailResponse.decode(new _m0.Reader(data))); + const data = MsgUnjail.encode(request).finish() + const promise = this.rpc.request("cosmos.slashing.v1beta1.Msg", "Unjail", data) + return promise.then((data) => MsgUnjailResponse.decode(new _m0.Reader(data))) } } interface Rpc { - request(service: string, method: string, data: Uint8Array): Promise; + request(service: string, method: string, data: Uint8Array): Promise } -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/cosmos/staking/v1beta1/authz.ts b/packages/protojs/src/cosmos/staking/v1beta1/authz.ts index 991e7d63..d6c773b1 100644 --- a/packages/protojs/src/cosmos/staking/v1beta1/authz.ts +++ b/packages/protojs/src/cosmos/staking/v1beta1/authz.ts @@ -1,9 +1,9 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { Coin } from "../../base/v1beta1/coin"; +import { Coin } from "../../base/v1beta1/coin" +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "cosmos.staking.v1beta1"; +export const protobufPackage = "cosmos.staking.v1beta1" /** * AuthorizationType defines the type of staking module authorization type @@ -26,36 +26,36 @@ export function authorizationTypeFromJSON(object: any): AuthorizationType { switch (object) { case 0: case "AUTHORIZATION_TYPE_UNSPECIFIED": - return AuthorizationType.AUTHORIZATION_TYPE_UNSPECIFIED; + return AuthorizationType.AUTHORIZATION_TYPE_UNSPECIFIED case 1: case "AUTHORIZATION_TYPE_DELEGATE": - return AuthorizationType.AUTHORIZATION_TYPE_DELEGATE; + return AuthorizationType.AUTHORIZATION_TYPE_DELEGATE case 2: case "AUTHORIZATION_TYPE_UNDELEGATE": - return AuthorizationType.AUTHORIZATION_TYPE_UNDELEGATE; + return AuthorizationType.AUTHORIZATION_TYPE_UNDELEGATE case 3: case "AUTHORIZATION_TYPE_REDELEGATE": - return AuthorizationType.AUTHORIZATION_TYPE_REDELEGATE; + return AuthorizationType.AUTHORIZATION_TYPE_REDELEGATE case -1: case "UNRECOGNIZED": default: - return AuthorizationType.UNRECOGNIZED; + return AuthorizationType.UNRECOGNIZED } } export function authorizationTypeToJSON(object: AuthorizationType): string { switch (object) { case AuthorizationType.AUTHORIZATION_TYPE_UNSPECIFIED: - return "AUTHORIZATION_TYPE_UNSPECIFIED"; + return "AUTHORIZATION_TYPE_UNSPECIFIED" case AuthorizationType.AUTHORIZATION_TYPE_DELEGATE: - return "AUTHORIZATION_TYPE_DELEGATE"; + return "AUTHORIZATION_TYPE_DELEGATE" case AuthorizationType.AUTHORIZATION_TYPE_UNDELEGATE: - return "AUTHORIZATION_TYPE_UNDELEGATE"; + return "AUTHORIZATION_TYPE_UNDELEGATE" case AuthorizationType.AUTHORIZATION_TYPE_REDELEGATE: - return "AUTHORIZATION_TYPE_REDELEGATE"; + return "AUTHORIZATION_TYPE_REDELEGATE" case AuthorizationType.UNRECOGNIZED: default: - return "UNRECOGNIZED"; + return "UNRECOGNIZED" } } @@ -69,182 +69,234 @@ export interface StakeAuthorization { * max_tokens specifies the maximum amount of tokens can be delegate to a validator. If it is * empty, there is no spend limit and any amount of coins can be delegated. */ - maxTokens?: Coin; + maxTokens?: Coin /** * allow_list specifies list of validator addresses to whom grantee can delegate tokens on behalf of granter's * account. */ - allowList?: - | StakeAuthorization_Validators - | undefined; + allowList?: StakeAuthorization_Validators | undefined /** deny_list specifies list of validator addresses to whom grantee can not delegate tokens. */ - denyList?: - | StakeAuthorization_Validators - | undefined; + denyList?: StakeAuthorization_Validators | undefined /** authorization_type defines one of AuthorizationType. */ - authorizationType: AuthorizationType; + authorizationType: AuthorizationType } /** Validators defines list of validator addresses. */ export interface StakeAuthorization_Validators { - address: string[]; + address: string[] } function createBaseStakeAuthorization(): StakeAuthorization { - return { maxTokens: undefined, allowList: undefined, denyList: undefined, authorizationType: 0 }; + return { + maxTokens: undefined, + allowList: undefined, + denyList: undefined, + authorizationType: 0, + } } export const StakeAuthorization = { - encode(message: StakeAuthorization, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: StakeAuthorization, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.maxTokens !== undefined) { - Coin.encode(message.maxTokens, writer.uint32(10).fork()).ldelim(); + Coin.encode(message.maxTokens, writer.uint32(10).fork()).ldelim() } if (message.allowList !== undefined) { - StakeAuthorization_Validators.encode(message.allowList, writer.uint32(18).fork()).ldelim(); + StakeAuthorization_Validators.encode( + message.allowList, + writer.uint32(18).fork(), + ).ldelim() } if (message.denyList !== undefined) { - StakeAuthorization_Validators.encode(message.denyList, writer.uint32(26).fork()).ldelim(); + StakeAuthorization_Validators.encode( + message.denyList, + writer.uint32(26).fork(), + ).ldelim() } if (message.authorizationType !== 0) { - writer.uint32(32).int32(message.authorizationType); + writer.uint32(32).int32(message.authorizationType) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): StakeAuthorization { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseStakeAuthorization(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseStakeAuthorization() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.maxTokens = Coin.decode(reader, reader.uint32()); - break; + message.maxTokens = Coin.decode(reader, reader.uint32()) + break case 2: - message.allowList = StakeAuthorization_Validators.decode(reader, reader.uint32()); - break; + message.allowList = StakeAuthorization_Validators.decode( + reader, + reader.uint32(), + ) + break case 3: - message.denyList = StakeAuthorization_Validators.decode(reader, reader.uint32()); - break; + message.denyList = StakeAuthorization_Validators.decode( + reader, + reader.uint32(), + ) + break case 4: - message.authorizationType = reader.int32() as any; - break; + message.authorizationType = reader.int32() as any + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): StakeAuthorization { return { maxTokens: isSet(object.maxTokens) ? Coin.fromJSON(object.maxTokens) : undefined, - allowList: isSet(object.allowList) ? StakeAuthorization_Validators.fromJSON(object.allowList) : undefined, - denyList: isSet(object.denyList) ? StakeAuthorization_Validators.fromJSON(object.denyList) : undefined, - authorizationType: isSet(object.authorizationType) ? authorizationTypeFromJSON(object.authorizationType) : 0, - }; + allowList: isSet(object.allowList) + ? StakeAuthorization_Validators.fromJSON(object.allowList) + : undefined, + denyList: isSet(object.denyList) + ? StakeAuthorization_Validators.fromJSON(object.denyList) + : undefined, + authorizationType: isSet(object.authorizationType) + ? authorizationTypeFromJSON(object.authorizationType) + : 0, + } }, toJSON(message: StakeAuthorization): unknown { - const obj: any = {}; - message.maxTokens !== undefined && (obj.maxTokens = message.maxTokens ? Coin.toJSON(message.maxTokens) : undefined); + const obj: any = {} + message.maxTokens !== undefined && + (obj.maxTokens = message.maxTokens ? Coin.toJSON(message.maxTokens) : undefined) message.allowList !== undefined && - (obj.allowList = message.allowList ? StakeAuthorization_Validators.toJSON(message.allowList) : undefined); + (obj.allowList = message.allowList + ? StakeAuthorization_Validators.toJSON(message.allowList) + : undefined) message.denyList !== undefined && - (obj.denyList = message.denyList ? StakeAuthorization_Validators.toJSON(message.denyList) : undefined); + (obj.denyList = message.denyList + ? StakeAuthorization_Validators.toJSON(message.denyList) + : undefined) message.authorizationType !== undefined && - (obj.authorizationType = authorizationTypeToJSON(message.authorizationType)); - return obj; + (obj.authorizationType = authorizationTypeToJSON(message.authorizationType)) + return obj }, - fromPartial, I>>(object: I): StakeAuthorization { - const message = createBaseStakeAuthorization(); - message.maxTokens = (object.maxTokens !== undefined && object.maxTokens !== null) - ? Coin.fromPartial(object.maxTokens) - : undefined; - message.allowList = (object.allowList !== undefined && object.allowList !== null) - ? StakeAuthorization_Validators.fromPartial(object.allowList) - : undefined; - message.denyList = (object.denyList !== undefined && object.denyList !== null) - ? StakeAuthorization_Validators.fromPartial(object.denyList) - : undefined; - message.authorizationType = object.authorizationType ?? 0; - return message; + fromPartial, I>>( + object: I, + ): StakeAuthorization { + const message = createBaseStakeAuthorization() + message.maxTokens = + object.maxTokens !== undefined && object.maxTokens !== null + ? Coin.fromPartial(object.maxTokens) + : undefined + message.allowList = + object.allowList !== undefined && object.allowList !== null + ? StakeAuthorization_Validators.fromPartial(object.allowList) + : undefined + message.denyList = + object.denyList !== undefined && object.denyList !== null + ? StakeAuthorization_Validators.fromPartial(object.denyList) + : undefined + message.authorizationType = object.authorizationType ?? 0 + return message }, -}; +} function createBaseStakeAuthorization_Validators(): StakeAuthorization_Validators { - return { address: [] }; + return { address: [] } } export const StakeAuthorization_Validators = { - encode(message: StakeAuthorization_Validators, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: StakeAuthorization_Validators, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { for (const v of message.address) { - writer.uint32(10).string(v!); + writer.uint32(10).string(v!) } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): StakeAuthorization_Validators { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseStakeAuthorization_Validators(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): StakeAuthorization_Validators { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseStakeAuthorization_Validators() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.address.push(reader.string()); - break; + message.address.push(reader.string()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): StakeAuthorization_Validators { - return { address: Array.isArray(object?.address) ? object.address.map((e: any) => String(e)) : [] }; + return { + address: Array.isArray(object?.address) + ? object.address.map((e: any) => String(e)) + : [], + } }, toJSON(message: StakeAuthorization_Validators): unknown { - const obj: any = {}; + const obj: any = {} if (message.address) { - obj.address = message.address.map((e) => e); + obj.address = message.address.map((e) => e) } else { - obj.address = []; + obj.address = [] } - return obj; + return obj }, fromPartial, I>>( object: I, ): StakeAuthorization_Validators { - const message = createBaseStakeAuthorization_Validators(); - message.address = object.address?.map((e) => e) || []; - return message; + const message = createBaseStakeAuthorization_Validators() + message.address = object.address?.map((e) => e) || [] + return message }, -}; +} -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/cosmos/staking/v1beta1/genesis.ts b/packages/protojs/src/cosmos/staking/v1beta1/genesis.ts index 8aeec714..bd185f05 100644 --- a/packages/protojs/src/cosmos/staking/v1beta1/genesis.ts +++ b/packages/protojs/src/cosmos/staking/v1beta1/genesis.ts @@ -1,41 +1,47 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { Delegation, Params, Redelegation, UnbondingDelegation, Validator } from "./staking"; +import { + Params, + Validator, + Delegation, + UnbondingDelegation, + Redelegation, +} from "./staking" +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "cosmos.staking.v1beta1"; +export const protobufPackage = "cosmos.staking.v1beta1" /** GenesisState defines the staking module's genesis state. */ export interface GenesisState { /** params defines all the paramaters of related to deposit. */ - params?: Params; + params?: Params /** * last_total_power tracks the total amounts of bonded tokens recorded during * the previous end block. */ - lastTotalPower: Uint8Array; + lastTotalPower: Uint8Array /** * last_validator_powers is a special index that provides a historical list * of the last-block's bonded validators. */ - lastValidatorPowers: LastValidatorPower[]; + lastValidatorPowers: LastValidatorPower[] /** delegations defines the validator set at genesis. */ - validators: Validator[]; + validators: Validator[] /** delegations defines the delegations active at genesis. */ - delegations: Delegation[]; + delegations: Delegation[] /** unbonding_delegations defines the unbonding delegations active at genesis. */ - unbondingDelegations: UnbondingDelegation[]; + unbondingDelegations: UnbondingDelegation[] /** redelegations defines the redelegations active at genesis. */ - redelegations: Redelegation[]; - exported: boolean; + redelegations: Redelegation[] + exported: boolean } /** LastValidatorPower required for validator set update logic. */ export interface LastValidatorPower { /** address is the address of the validator. */ - address: string; + address: string /** power defines the power of the validator. */ - power: Long; + power: Long } function createBaseGenesisState(): GenesisState { @@ -48,86 +54,96 @@ function createBaseGenesisState(): GenesisState { unbondingDelegations: [], redelegations: [], exported: false, - }; + } } export const GenesisState = { encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.params !== undefined) { - Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + Params.encode(message.params, writer.uint32(10).fork()).ldelim() } if (message.lastTotalPower.length !== 0) { - writer.uint32(18).bytes(message.lastTotalPower); + writer.uint32(18).bytes(message.lastTotalPower) } for (const v of message.lastValidatorPowers) { - LastValidatorPower.encode(v!, writer.uint32(26).fork()).ldelim(); + LastValidatorPower.encode(v!, writer.uint32(26).fork()).ldelim() } for (const v of message.validators) { - Validator.encode(v!, writer.uint32(34).fork()).ldelim(); + Validator.encode(v!, writer.uint32(34).fork()).ldelim() } for (const v of message.delegations) { - Delegation.encode(v!, writer.uint32(42).fork()).ldelim(); + Delegation.encode(v!, writer.uint32(42).fork()).ldelim() } for (const v of message.unbondingDelegations) { - UnbondingDelegation.encode(v!, writer.uint32(50).fork()).ldelim(); + UnbondingDelegation.encode(v!, writer.uint32(50).fork()).ldelim() } for (const v of message.redelegations) { - Redelegation.encode(v!, writer.uint32(58).fork()).ldelim(); + Redelegation.encode(v!, writer.uint32(58).fork()).ldelim() } if (message.exported === true) { - writer.uint32(64).bool(message.exported); + writer.uint32(64).bool(message.exported) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGenesisState(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseGenesisState() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.params = Params.decode(reader, reader.uint32()); - break; + message.params = Params.decode(reader, reader.uint32()) + break case 2: - message.lastTotalPower = reader.bytes(); - break; + message.lastTotalPower = reader.bytes() + break case 3: - message.lastValidatorPowers.push(LastValidatorPower.decode(reader, reader.uint32())); - break; + message.lastValidatorPowers.push( + LastValidatorPower.decode(reader, reader.uint32()), + ) + break case 4: - message.validators.push(Validator.decode(reader, reader.uint32())); - break; + message.validators.push(Validator.decode(reader, reader.uint32())) + break case 5: - message.delegations.push(Delegation.decode(reader, reader.uint32())); - break; + message.delegations.push(Delegation.decode(reader, reader.uint32())) + break case 6: - message.unbondingDelegations.push(UnbondingDelegation.decode(reader, reader.uint32())); - break; + message.unbondingDelegations.push( + UnbondingDelegation.decode(reader, reader.uint32()), + ) + break case 7: - message.redelegations.push(Redelegation.decode(reader, reader.uint32())); - break; + message.redelegations.push(Redelegation.decode(reader, reader.uint32())) + break case 8: - message.exported = reader.bool(); - break; + message.exported = reader.bool() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): GenesisState { return { params: isSet(object.params) ? Params.fromJSON(object.params) : undefined, - lastTotalPower: isSet(object.lastTotalPower) ? bytesFromBase64(object.lastTotalPower) : new Uint8Array(), + lastTotalPower: isSet(object.lastTotalPower) + ? bytesFromBase64(object.lastTotalPower) + : new Uint8Array(), lastValidatorPowers: Array.isArray(object?.lastValidatorPowers) ? object.lastValidatorPowers.map((e: any) => LastValidatorPower.fromJSON(e)) : [], - validators: Array.isArray(object?.validators) ? object.validators.map((e: any) => Validator.fromJSON(e)) : [], - delegations: Array.isArray(object?.delegations) ? object.delegations.map((e: any) => Delegation.fromJSON(e)) : [], + validators: Array.isArray(object?.validators) + ? object.validators.map((e: any) => Validator.fromJSON(e)) + : [], + delegations: Array.isArray(object?.delegations) + ? object.delegations.map((e: any) => Delegation.fromJSON(e)) + : [], unbondingDelegations: Array.isArray(object?.unbondingDelegations) ? object.unbondingDelegations.map((e: any) => UnbondingDelegation.fromJSON(e)) : [], @@ -135,180 +151,204 @@ export const GenesisState = { ? object.redelegations.map((e: any) => Redelegation.fromJSON(e)) : [], exported: isSet(object.exported) ? Boolean(object.exported) : false, - }; + } }, toJSON(message: GenesisState): unknown { - const obj: any = {}; - message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + const obj: any = {} + message.params !== undefined && + (obj.params = message.params ? Params.toJSON(message.params) : undefined) message.lastTotalPower !== undefined && (obj.lastTotalPower = base64FromBytes( - message.lastTotalPower !== undefined ? message.lastTotalPower : new Uint8Array(), - )); + message.lastTotalPower !== undefined + ? message.lastTotalPower + : new Uint8Array(), + )) if (message.lastValidatorPowers) { - obj.lastValidatorPowers = message.lastValidatorPowers.map((e) => e ? LastValidatorPower.toJSON(e) : undefined); + obj.lastValidatorPowers = message.lastValidatorPowers.map((e) => + e ? LastValidatorPower.toJSON(e) : undefined, + ) } else { - obj.lastValidatorPowers = []; + obj.lastValidatorPowers = [] } if (message.validators) { - obj.validators = message.validators.map((e) => e ? Validator.toJSON(e) : undefined); + obj.validators = message.validators.map((e) => + e ? Validator.toJSON(e) : undefined, + ) } else { - obj.validators = []; + obj.validators = [] } if (message.delegations) { - obj.delegations = message.delegations.map((e) => e ? Delegation.toJSON(e) : undefined); + obj.delegations = message.delegations.map((e) => + e ? Delegation.toJSON(e) : undefined, + ) } else { - obj.delegations = []; + obj.delegations = [] } if (message.unbondingDelegations) { - obj.unbondingDelegations = message.unbondingDelegations.map((e) => e ? UnbondingDelegation.toJSON(e) : undefined); + obj.unbondingDelegations = message.unbondingDelegations.map((e) => + e ? UnbondingDelegation.toJSON(e) : undefined, + ) } else { - obj.unbondingDelegations = []; + obj.unbondingDelegations = [] } if (message.redelegations) { - obj.redelegations = message.redelegations.map((e) => e ? Redelegation.toJSON(e) : undefined); + obj.redelegations = message.redelegations.map((e) => + e ? Redelegation.toJSON(e) : undefined, + ) } else { - obj.redelegations = []; + obj.redelegations = [] } - message.exported !== undefined && (obj.exported = message.exported); - return obj; + message.exported !== undefined && (obj.exported = message.exported) + return obj }, fromPartial, I>>(object: I): GenesisState { - const message = createBaseGenesisState(); - message.params = (object.params !== undefined && object.params !== null) - ? Params.fromPartial(object.params) - : undefined; - message.lastTotalPower = object.lastTotalPower ?? new Uint8Array(); - message.lastValidatorPowers = object.lastValidatorPowers?.map((e) => LastValidatorPower.fromPartial(e)) || []; - message.validators = object.validators?.map((e) => Validator.fromPartial(e)) || []; - message.delegations = object.delegations?.map((e) => Delegation.fromPartial(e)) || []; - message.unbondingDelegations = object.unbondingDelegations?.map((e) => UnbondingDelegation.fromPartial(e)) || []; - message.redelegations = object.redelegations?.map((e) => Redelegation.fromPartial(e)) || []; - message.exported = object.exported ?? false; - return message; + const message = createBaseGenesisState() + message.params = + object.params !== undefined && object.params !== null + ? Params.fromPartial(object.params) + : undefined + message.lastTotalPower = object.lastTotalPower ?? new Uint8Array() + message.lastValidatorPowers = + object.lastValidatorPowers?.map((e) => LastValidatorPower.fromPartial(e)) || [] + message.validators = object.validators?.map((e) => Validator.fromPartial(e)) || [] + message.delegations = + object.delegations?.map((e) => Delegation.fromPartial(e)) || [] + message.unbondingDelegations = + object.unbondingDelegations?.map((e) => UnbondingDelegation.fromPartial(e)) || [] + message.redelegations = + object.redelegations?.map((e) => Redelegation.fromPartial(e)) || [] + message.exported = object.exported ?? false + return message }, -}; +} function createBaseLastValidatorPower(): LastValidatorPower { - return { address: "", power: Long.ZERO }; + return { address: "", power: Long.ZERO } } export const LastValidatorPower = { - encode(message: LastValidatorPower, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: LastValidatorPower, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.address !== "") { - writer.uint32(10).string(message.address); + writer.uint32(10).string(message.address) } if (!message.power.isZero()) { - writer.uint32(16).int64(message.power); + writer.uint32(16).int64(message.power) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): LastValidatorPower { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseLastValidatorPower(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseLastValidatorPower() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.address = reader.string(); - break; + message.address = reader.string() + break case 2: - message.power = reader.int64() as Long; - break; + message.power = reader.int64() as Long + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): LastValidatorPower { return { address: isSet(object.address) ? String(object.address) : "", power: isSet(object.power) ? Long.fromValue(object.power) : Long.ZERO, - }; + } }, toJSON(message: LastValidatorPower): unknown { - const obj: any = {}; - message.address !== undefined && (obj.address = message.address); - message.power !== undefined && (obj.power = (message.power || Long.ZERO).toString()); - return obj; + const obj: any = {} + message.address !== undefined && (obj.address = message.address) + message.power !== undefined && (obj.power = (message.power || Long.ZERO).toString()) + return obj }, - fromPartial, I>>(object: I): LastValidatorPower { - const message = createBaseLastValidatorPower(); - message.address = object.address ?? ""; - message.power = (object.power !== undefined && object.power !== null) ? Long.fromValue(object.power) : Long.ZERO; - return message; + fromPartial, I>>( + object: I, + ): LastValidatorPower { + const message = createBaseLastValidatorPower() + message.address = object.address ?? "" + message.power = + object.power !== undefined && object.power !== null + ? Long.fromValue(object.power) + : Long.ZERO + return message }, -}; +} -declare var self: any | undefined; -declare var window: any | undefined; -declare var global: any | undefined; +declare var self: any | undefined +declare var window: any | undefined +declare var global: any | undefined var globalThis: any = (() => { - if (typeof globalThis !== "undefined") { - return globalThis; - } - if (typeof self !== "undefined") { - return self; - } - if (typeof window !== "undefined") { - return window; - } - if (typeof global !== "undefined") { - return global; - } - throw "Unable to locate global object"; -})(); + if (typeof globalThis !== "undefined") return globalThis + if (typeof self !== "undefined") return self + if (typeof window !== "undefined") return window + if (typeof global !== "undefined") return global + throw "Unable to locate global object" +})() +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")) function bytesFromBase64(b64: string): Uint8Array { - if (globalThis.Buffer) { - return Uint8Array.from(globalThis.Buffer.from(b64, "base64")); - } else { - const bin = globalThis.atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; + 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 } +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")) function base64FromBytes(arr: Uint8Array): string { - if (globalThis.Buffer) { - return globalThis.Buffer.from(arr).toString("base64"); - } else { - const bin: string[] = []; - arr.forEach((byte) => { - bin.push(String.fromCharCode(byte)); - }); - return globalThis.btoa(bin.join("")); - } + const bin: string[] = [] + arr.forEach((byte) => { + bin.push(String.fromCharCode(byte)) + }) + return btoa(bin.join("")) } -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/cosmos/staking/v1beta1/query.ts b/packages/protojs/src/cosmos/staking/v1beta1/query.ts index 9e5aa5bc..387947da 100644 --- a/packages/protojs/src/cosmos/staking/v1beta1/query.ts +++ b/packages/protojs/src/cosmos/staking/v1beta1/query.ts @@ -1,45 +1,45 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { PageRequest, PageResponse } from "../../base/query/v1beta1/pagination"; +import { PageRequest, PageResponse } from "../../base/query/v1beta1/pagination" import { + Validator, DelegationResponse, + UnbondingDelegation, HistoricalInfo, - Params, Pool, + Params, RedelegationResponse, - UnbondingDelegation, - Validator, -} from "./staking"; +} from "./staking" +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "cosmos.staking.v1beta1"; +export const protobufPackage = "cosmos.staking.v1beta1" /** QueryValidatorsRequest is request type for Query/Validators RPC method. */ export interface QueryValidatorsRequest { /** status enables to query for validators matching a given status. */ - status: string; + status: string /** pagination defines an optional pagination for the request. */ - pagination?: PageRequest; + pagination?: PageRequest } /** QueryValidatorsResponse is response type for the Query/Validators RPC method */ export interface QueryValidatorsResponse { /** validators contains all the queried validators. */ - validators: Validator[]; + validators: Validator[] /** pagination defines the pagination in the response. */ - pagination?: PageResponse; + pagination?: PageResponse } /** QueryValidatorRequest is response type for the Query/Validator RPC method */ export interface QueryValidatorRequest { /** validator_addr defines the validator address to query for. */ - validatorAddr: string; + validatorAddr: string } /** QueryValidatorResponse is response type for the Query/Validator RPC method */ export interface QueryValidatorResponse { /** validator defines the the validator info. */ - validator?: Validator; + validator?: Validator } /** @@ -48,9 +48,9 @@ export interface QueryValidatorResponse { */ export interface QueryValidatorDelegationsRequest { /** validator_addr defines the validator address to query for. */ - validatorAddr: string; + validatorAddr: string /** pagination defines an optional pagination for the request. */ - pagination?: PageRequest; + pagination?: PageRequest } /** @@ -58,9 +58,9 @@ export interface QueryValidatorDelegationsRequest { * Query/ValidatorDelegations RPC method */ export interface QueryValidatorDelegationsResponse { - delegationResponses: DelegationResponse[]; + delegationResponses: DelegationResponse[] /** pagination defines the pagination in the response. */ - pagination?: PageResponse; + pagination?: PageResponse } /** @@ -69,9 +69,9 @@ export interface QueryValidatorDelegationsResponse { */ export interface QueryValidatorUnbondingDelegationsRequest { /** validator_addr defines the validator address to query for. */ - validatorAddr: string; + validatorAddr: string /** pagination defines an optional pagination for the request. */ - pagination?: PageRequest; + pagination?: PageRequest } /** @@ -79,23 +79,23 @@ export interface QueryValidatorUnbondingDelegationsRequest { * Query/ValidatorUnbondingDelegations RPC method. */ export interface QueryValidatorUnbondingDelegationsResponse { - unbondingResponses: UnbondingDelegation[]; + unbondingResponses: UnbondingDelegation[] /** pagination defines the pagination in the response. */ - pagination?: PageResponse; + pagination?: PageResponse } /** QueryDelegationRequest is request type for the Query/Delegation RPC method. */ export interface QueryDelegationRequest { /** delegator_addr defines the delegator address to query for. */ - delegatorAddr: string; + delegatorAddr: string /** validator_addr defines the validator address to query for. */ - validatorAddr: string; + validatorAddr: string } /** QueryDelegationResponse is response type for the Query/Delegation RPC method. */ export interface QueryDelegationResponse { /** delegation_responses defines the delegation info of a delegation. */ - delegationResponse?: DelegationResponse; + delegationResponse?: DelegationResponse } /** @@ -104,9 +104,9 @@ export interface QueryDelegationResponse { */ export interface QueryUnbondingDelegationRequest { /** delegator_addr defines the delegator address to query for. */ - delegatorAddr: string; + delegatorAddr: string /** validator_addr defines the validator address to query for. */ - validatorAddr: string; + validatorAddr: string } /** @@ -115,7 +115,7 @@ export interface QueryUnbondingDelegationRequest { */ export interface QueryUnbondingDelegationResponse { /** unbond defines the unbonding information of a delegation. */ - unbond?: UnbondingDelegation; + unbond?: UnbondingDelegation } /** @@ -124,9 +124,9 @@ export interface QueryUnbondingDelegationResponse { */ export interface QueryDelegatorDelegationsRequest { /** delegator_addr defines the delegator address to query for. */ - delegatorAddr: string; + delegatorAddr: string /** pagination defines an optional pagination for the request. */ - pagination?: PageRequest; + pagination?: PageRequest } /** @@ -135,9 +135,9 @@ export interface QueryDelegatorDelegationsRequest { */ export interface QueryDelegatorDelegationsResponse { /** delegation_responses defines all the delegations' info of a delegator. */ - delegationResponses: DelegationResponse[]; + delegationResponses: DelegationResponse[] /** pagination defines the pagination in the response. */ - pagination?: PageResponse; + pagination?: PageResponse } /** @@ -146,9 +146,9 @@ export interface QueryDelegatorDelegationsResponse { */ export interface QueryDelegatorUnbondingDelegationsRequest { /** delegator_addr defines the delegator address to query for. */ - delegatorAddr: string; + delegatorAddr: string /** pagination defines an optional pagination for the request. */ - pagination?: PageRequest; + pagination?: PageRequest } /** @@ -156,9 +156,9 @@ export interface QueryDelegatorUnbondingDelegationsRequest { * Query/UnbondingDelegatorDelegations RPC method. */ export interface QueryDelegatorUnbondingDelegationsResponse { - unbondingResponses: UnbondingDelegation[]; + unbondingResponses: UnbondingDelegation[] /** pagination defines the pagination in the response. */ - pagination?: PageResponse; + pagination?: PageResponse } /** @@ -167,13 +167,13 @@ export interface QueryDelegatorUnbondingDelegationsResponse { */ export interface QueryRedelegationsRequest { /** delegator_addr defines the delegator address to query for. */ - delegatorAddr: string; + delegatorAddr: string /** src_validator_addr defines the validator address to redelegate from. */ - srcValidatorAddr: string; + srcValidatorAddr: string /** dst_validator_addr defines the validator address to redelegate to. */ - dstValidatorAddr: string; + dstValidatorAddr: string /** pagination defines an optional pagination for the request. */ - pagination?: PageRequest; + pagination?: PageRequest } /** @@ -181,9 +181,9 @@ export interface QueryRedelegationsRequest { * method. */ export interface QueryRedelegationsResponse { - redelegationResponses: RedelegationResponse[]; + redelegationResponses: RedelegationResponse[] /** pagination defines the pagination in the response. */ - pagination?: PageResponse; + pagination?: PageResponse } /** @@ -192,9 +192,9 @@ export interface QueryRedelegationsResponse { */ export interface QueryDelegatorValidatorsRequest { /** delegator_addr defines the delegator address to query for. */ - delegatorAddr: string; + delegatorAddr: string /** pagination defines an optional pagination for the request. */ - pagination?: PageRequest; + pagination?: PageRequest } /** @@ -203,9 +203,9 @@ export interface QueryDelegatorValidatorsRequest { */ export interface QueryDelegatorValidatorsResponse { /** validators defines the the validators' info of a delegator. */ - validators: Validator[]; + validators: Validator[] /** pagination defines the pagination in the response. */ - pagination?: PageResponse; + pagination?: PageResponse } /** @@ -214,9 +214,9 @@ export interface QueryDelegatorValidatorsResponse { */ export interface QueryDelegatorValidatorRequest { /** delegator_addr defines the delegator address to query for. */ - delegatorAddr: string; + delegatorAddr: string /** validator_addr defines the validator address to query for. */ - validatorAddr: string; + validatorAddr: string } /** @@ -225,7 +225,7 @@ export interface QueryDelegatorValidatorRequest { */ export interface QueryDelegatorValidatorResponse { /** validator defines the the validator info. */ - validator?: Validator; + validator?: Validator } /** @@ -234,7 +234,7 @@ export interface QueryDelegatorValidatorResponse { */ export interface QueryHistoricalInfoRequest { /** height defines at which height to query the historical info. */ - height: Long; + height: Long } /** @@ -243,349 +243,409 @@ export interface QueryHistoricalInfoRequest { */ export interface QueryHistoricalInfoResponse { /** hist defines the historical info at the given height. */ - hist?: HistoricalInfo; + hist?: HistoricalInfo } /** QueryPoolRequest is request type for the Query/Pool RPC method. */ -export interface QueryPoolRequest { -} +export interface QueryPoolRequest {} /** QueryPoolResponse is response type for the Query/Pool RPC method. */ export interface QueryPoolResponse { /** pool defines the pool info. */ - pool?: Pool; + pool?: Pool } /** QueryParamsRequest is request type for the Query/Params RPC method. */ -export interface QueryParamsRequest { -} +export interface QueryParamsRequest {} /** QueryParamsResponse is response type for the Query/Params RPC method. */ export interface QueryParamsResponse { /** params holds all the parameters of this module. */ - params?: Params; + params?: Params } function createBaseQueryValidatorsRequest(): QueryValidatorsRequest { - return { status: "", pagination: undefined }; + return { status: "", pagination: undefined } } export const QueryValidatorsRequest = { - encode(message: QueryValidatorsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryValidatorsRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.status !== "") { - writer.uint32(10).string(message.status); + writer.uint32(10).string(message.status) } if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryValidatorsRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryValidatorsRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.status = reader.string(); - break; + message.status = reader.string() + break case 2: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; + message.pagination = PageRequest.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryValidatorsRequest { return { status: isSet(object.status) ? String(object.status) : "", - pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined, - }; + pagination: isSet(object.pagination) + ? PageRequest.fromJSON(object.pagination) + : undefined, + } }, toJSON(message: QueryValidatorsRequest): unknown { - const obj: any = {}; - message.status !== undefined && (obj.status = message.status); + const obj: any = {} + message.status !== undefined && (obj.status = message.status) message.pagination !== undefined && - (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); - return obj; + (obj.pagination = message.pagination + ? PageRequest.toJSON(message.pagination) + : undefined) + return obj }, - fromPartial, I>>(object: I): QueryValidatorsRequest { - const message = createBaseQueryValidatorsRequest(); - message.status = object.status ?? ""; - message.pagination = (object.pagination !== undefined && object.pagination !== null) - ? PageRequest.fromPartial(object.pagination) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): QueryValidatorsRequest { + const message = createBaseQueryValidatorsRequest() + message.status = object.status ?? "" + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageRequest.fromPartial(object.pagination) + : undefined + return message }, -}; +} function createBaseQueryValidatorsResponse(): QueryValidatorsResponse { - return { validators: [], pagination: undefined }; + return { validators: [], pagination: undefined } } export const QueryValidatorsResponse = { - encode(message: QueryValidatorsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryValidatorsResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { for (const v of message.validators) { - Validator.encode(v!, writer.uint32(10).fork()).ldelim(); + Validator.encode(v!, writer.uint32(10).fork()).ldelim() } if (message.pagination !== undefined) { - PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryValidatorsResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryValidatorsResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.validators.push(Validator.decode(reader, reader.uint32())); - break; + message.validators.push(Validator.decode(reader, reader.uint32())) + break case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; + message.pagination = PageResponse.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryValidatorsResponse { return { - validators: Array.isArray(object?.validators) ? object.validators.map((e: any) => Validator.fromJSON(e)) : [], - pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, - }; + validators: Array.isArray(object?.validators) + ? object.validators.map((e: any) => Validator.fromJSON(e)) + : [], + pagination: isSet(object.pagination) + ? PageResponse.fromJSON(object.pagination) + : undefined, + } }, toJSON(message: QueryValidatorsResponse): unknown { - const obj: any = {}; + const obj: any = {} if (message.validators) { - obj.validators = message.validators.map((e) => e ? Validator.toJSON(e) : undefined); + obj.validators = message.validators.map((e) => + e ? Validator.toJSON(e) : undefined, + ) } else { - obj.validators = []; + obj.validators = [] } message.pagination !== undefined && - (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); - return obj; + (obj.pagination = message.pagination + ? PageResponse.toJSON(message.pagination) + : undefined) + return obj }, - fromPartial, I>>(object: I): QueryValidatorsResponse { - const message = createBaseQueryValidatorsResponse(); - message.validators = object.validators?.map((e) => Validator.fromPartial(e)) || []; - message.pagination = (object.pagination !== undefined && object.pagination !== null) - ? PageResponse.fromPartial(object.pagination) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): QueryValidatorsResponse { + const message = createBaseQueryValidatorsResponse() + message.validators = object.validators?.map((e) => Validator.fromPartial(e)) || [] + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageResponse.fromPartial(object.pagination) + : undefined + return message }, -}; +} function createBaseQueryValidatorRequest(): QueryValidatorRequest { - return { validatorAddr: "" }; + return { validatorAddr: "" } } export const QueryValidatorRequest = { - encode(message: QueryValidatorRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryValidatorRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.validatorAddr !== "") { - writer.uint32(10).string(message.validatorAddr); + writer.uint32(10).string(message.validatorAddr) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryValidatorRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryValidatorRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.validatorAddr = reader.string(); - break; + message.validatorAddr = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryValidatorRequest { - return { validatorAddr: isSet(object.validatorAddr) ? String(object.validatorAddr) : "" }; + return { + validatorAddr: isSet(object.validatorAddr) ? String(object.validatorAddr) : "", + } }, toJSON(message: QueryValidatorRequest): unknown { - const obj: any = {}; - message.validatorAddr !== undefined && (obj.validatorAddr = message.validatorAddr); - return obj; + const obj: any = {} + message.validatorAddr !== undefined && (obj.validatorAddr = message.validatorAddr) + return obj }, - fromPartial, I>>(object: I): QueryValidatorRequest { - const message = createBaseQueryValidatorRequest(); - message.validatorAddr = object.validatorAddr ?? ""; - return message; + fromPartial, I>>( + object: I, + ): QueryValidatorRequest { + const message = createBaseQueryValidatorRequest() + message.validatorAddr = object.validatorAddr ?? "" + return message }, -}; +} function createBaseQueryValidatorResponse(): QueryValidatorResponse { - return { validator: undefined }; + return { validator: undefined } } export const QueryValidatorResponse = { - encode(message: QueryValidatorResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryValidatorResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.validator !== undefined) { - Validator.encode(message.validator, writer.uint32(10).fork()).ldelim(); + Validator.encode(message.validator, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryValidatorResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryValidatorResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.validator = Validator.decode(reader, reader.uint32()); - break; + message.validator = Validator.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryValidatorResponse { - return { validator: isSet(object.validator) ? Validator.fromJSON(object.validator) : undefined }; + return { + validator: isSet(object.validator) + ? Validator.fromJSON(object.validator) + : undefined, + } }, toJSON(message: QueryValidatorResponse): unknown { - const obj: any = {}; + const obj: any = {} message.validator !== undefined && - (obj.validator = message.validator ? Validator.toJSON(message.validator) : undefined); - return obj; + (obj.validator = message.validator + ? Validator.toJSON(message.validator) + : undefined) + return obj }, - fromPartial, I>>(object: I): QueryValidatorResponse { - const message = createBaseQueryValidatorResponse(); - message.validator = (object.validator !== undefined && object.validator !== null) - ? Validator.fromPartial(object.validator) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): QueryValidatorResponse { + const message = createBaseQueryValidatorResponse() + message.validator = + object.validator !== undefined && object.validator !== null + ? Validator.fromPartial(object.validator) + : undefined + return message }, -}; +} function createBaseQueryValidatorDelegationsRequest(): QueryValidatorDelegationsRequest { - return { validatorAddr: "", pagination: undefined }; + return { validatorAddr: "", pagination: undefined } } export const QueryValidatorDelegationsRequest = { - encode(message: QueryValidatorDelegationsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryValidatorDelegationsRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.validatorAddr !== "") { - writer.uint32(10).string(message.validatorAddr); + writer.uint32(10).string(message.validatorAddr) } if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorDelegationsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryValidatorDelegationsRequest(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryValidatorDelegationsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryValidatorDelegationsRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.validatorAddr = reader.string(); - break; + message.validatorAddr = reader.string() + break case 2: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; + message.pagination = PageRequest.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryValidatorDelegationsRequest { return { validatorAddr: isSet(object.validatorAddr) ? String(object.validatorAddr) : "", - pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined, - }; + pagination: isSet(object.pagination) + ? PageRequest.fromJSON(object.pagination) + : undefined, + } }, toJSON(message: QueryValidatorDelegationsRequest): unknown { - const obj: any = {}; - message.validatorAddr !== undefined && (obj.validatorAddr = message.validatorAddr); + const obj: any = {} + message.validatorAddr !== undefined && (obj.validatorAddr = message.validatorAddr) message.pagination !== undefined && - (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); - return obj; + (obj.pagination = message.pagination + ? PageRequest.toJSON(message.pagination) + : undefined) + return obj }, fromPartial, I>>( object: I, ): QueryValidatorDelegationsRequest { - const message = createBaseQueryValidatorDelegationsRequest(); - message.validatorAddr = object.validatorAddr ?? ""; - message.pagination = (object.pagination !== undefined && object.pagination !== null) - ? PageRequest.fromPartial(object.pagination) - : undefined; - return message; + const message = createBaseQueryValidatorDelegationsRequest() + message.validatorAddr = object.validatorAddr ?? "" + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageRequest.fromPartial(object.pagination) + : undefined + return message }, -}; +} function createBaseQueryValidatorDelegationsResponse(): QueryValidatorDelegationsResponse { - return { delegationResponses: [], pagination: undefined }; + return { delegationResponses: [], pagination: undefined } } export const QueryValidatorDelegationsResponse = { - encode(message: QueryValidatorDelegationsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryValidatorDelegationsResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { for (const v of message.delegationResponses) { - DelegationResponse.encode(v!, writer.uint32(10).fork()).ldelim(); + DelegationResponse.encode(v!, writer.uint32(10).fork()).ldelim() } if (message.pagination !== undefined) { - PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorDelegationsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryValidatorDelegationsResponse(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryValidatorDelegationsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryValidatorDelegationsResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.delegationResponses.push(DelegationResponse.decode(reader, reader.uint32())); - break; + message.delegationResponses.push( + DelegationResponse.decode(reader, reader.uint32()), + ) + break case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; + message.pagination = PageResponse.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryValidatorDelegationsResponse { @@ -593,131 +653,158 @@ export const QueryValidatorDelegationsResponse = { delegationResponses: Array.isArray(object?.delegationResponses) ? object.delegationResponses.map((e: any) => DelegationResponse.fromJSON(e)) : [], - pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, - }; + pagination: isSet(object.pagination) + ? PageResponse.fromJSON(object.pagination) + : undefined, + } }, toJSON(message: QueryValidatorDelegationsResponse): unknown { - const obj: any = {}; + const obj: any = {} if (message.delegationResponses) { - obj.delegationResponses = message.delegationResponses.map((e) => e ? DelegationResponse.toJSON(e) : undefined); + obj.delegationResponses = message.delegationResponses.map((e) => + e ? DelegationResponse.toJSON(e) : undefined, + ) } else { - obj.delegationResponses = []; + obj.delegationResponses = [] } message.pagination !== undefined && - (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); - return obj; + (obj.pagination = message.pagination + ? PageResponse.toJSON(message.pagination) + : undefined) + return obj }, fromPartial, I>>( object: I, ): QueryValidatorDelegationsResponse { - const message = createBaseQueryValidatorDelegationsResponse(); - message.delegationResponses = object.delegationResponses?.map((e) => DelegationResponse.fromPartial(e)) || []; - message.pagination = (object.pagination !== undefined && object.pagination !== null) - ? PageResponse.fromPartial(object.pagination) - : undefined; - return message; + const message = createBaseQueryValidatorDelegationsResponse() + message.delegationResponses = + object.delegationResponses?.map((e) => DelegationResponse.fromPartial(e)) || [] + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageResponse.fromPartial(object.pagination) + : undefined + return message }, -}; +} function createBaseQueryValidatorUnbondingDelegationsRequest(): QueryValidatorUnbondingDelegationsRequest { - return { validatorAddr: "", pagination: undefined }; + return { validatorAddr: "", pagination: undefined } } export const QueryValidatorUnbondingDelegationsRequest = { - encode(message: QueryValidatorUnbondingDelegationsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryValidatorUnbondingDelegationsRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.validatorAddr !== "") { - writer.uint32(10).string(message.validatorAddr); + writer.uint32(10).string(message.validatorAddr) } if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorUnbondingDelegationsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryValidatorUnbondingDelegationsRequest(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryValidatorUnbondingDelegationsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryValidatorUnbondingDelegationsRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.validatorAddr = reader.string(); - break; + message.validatorAddr = reader.string() + break case 2: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; + message.pagination = PageRequest.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryValidatorUnbondingDelegationsRequest { return { validatorAddr: isSet(object.validatorAddr) ? String(object.validatorAddr) : "", - pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined, - }; + pagination: isSet(object.pagination) + ? PageRequest.fromJSON(object.pagination) + : undefined, + } }, toJSON(message: QueryValidatorUnbondingDelegationsRequest): unknown { - const obj: any = {}; - message.validatorAddr !== undefined && (obj.validatorAddr = message.validatorAddr); + const obj: any = {} + message.validatorAddr !== undefined && (obj.validatorAddr = message.validatorAddr) message.pagination !== undefined && - (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); - return obj; + (obj.pagination = message.pagination + ? PageRequest.toJSON(message.pagination) + : undefined) + return obj + }, + + fromPartial< + I extends Exact, I>, + >(object: I): QueryValidatorUnbondingDelegationsRequest { + const message = createBaseQueryValidatorUnbondingDelegationsRequest() + message.validatorAddr = object.validatorAddr ?? "" + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageRequest.fromPartial(object.pagination) + : undefined + return message }, - - fromPartial, I>>( - object: I, - ): QueryValidatorUnbondingDelegationsRequest { - const message = createBaseQueryValidatorUnbondingDelegationsRequest(); - message.validatorAddr = object.validatorAddr ?? ""; - message.pagination = (object.pagination !== undefined && object.pagination !== null) - ? PageRequest.fromPartial(object.pagination) - : undefined; - return message; - }, -}; +} function createBaseQueryValidatorUnbondingDelegationsResponse(): QueryValidatorUnbondingDelegationsResponse { - return { unbondingResponses: [], pagination: undefined }; + return { unbondingResponses: [], pagination: undefined } } export const QueryValidatorUnbondingDelegationsResponse = { - encode(message: QueryValidatorUnbondingDelegationsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryValidatorUnbondingDelegationsResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { for (const v of message.unbondingResponses) { - UnbondingDelegation.encode(v!, writer.uint32(10).fork()).ldelim(); + UnbondingDelegation.encode(v!, writer.uint32(10).fork()).ldelim() } if (message.pagination !== undefined) { - PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorUnbondingDelegationsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryValidatorUnbondingDelegationsResponse(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryValidatorUnbondingDelegationsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryValidatorUnbondingDelegationsResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.unbondingResponses.push(UnbondingDelegation.decode(reader, reader.uint32())); - break; + message.unbondingResponses.push( + UnbondingDelegation.decode(reader, reader.uint32()), + ) + break case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; + message.pagination = PageResponse.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryValidatorUnbondingDelegationsResponse { @@ -725,120 +812,142 @@ export const QueryValidatorUnbondingDelegationsResponse = { unbondingResponses: Array.isArray(object?.unbondingResponses) ? object.unbondingResponses.map((e: any) => UnbondingDelegation.fromJSON(e)) : [], - pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, - }; + pagination: isSet(object.pagination) + ? PageResponse.fromJSON(object.pagination) + : undefined, + } }, toJSON(message: QueryValidatorUnbondingDelegationsResponse): unknown { - const obj: any = {}; + const obj: any = {} if (message.unbondingResponses) { - obj.unbondingResponses = message.unbondingResponses.map((e) => e ? UnbondingDelegation.toJSON(e) : undefined); + obj.unbondingResponses = message.unbondingResponses.map((e) => + e ? UnbondingDelegation.toJSON(e) : undefined, + ) } else { - obj.unbondingResponses = []; + obj.unbondingResponses = [] } message.pagination !== undefined && - (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); - return obj; - }, - - fromPartial, I>>( - object: I, - ): QueryValidatorUnbondingDelegationsResponse { - const message = createBaseQueryValidatorUnbondingDelegationsResponse(); - message.unbondingResponses = object.unbondingResponses?.map((e) => UnbondingDelegation.fromPartial(e)) || []; - message.pagination = (object.pagination !== undefined && object.pagination !== null) - ? PageResponse.fromPartial(object.pagination) - : undefined; - return message; + (obj.pagination = message.pagination + ? PageResponse.toJSON(message.pagination) + : undefined) + return obj + }, + + fromPartial< + I extends Exact, I>, + >(object: I): QueryValidatorUnbondingDelegationsResponse { + const message = createBaseQueryValidatorUnbondingDelegationsResponse() + message.unbondingResponses = + object.unbondingResponses?.map((e) => UnbondingDelegation.fromPartial(e)) || [] + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageResponse.fromPartial(object.pagination) + : undefined + return message }, -}; +} function createBaseQueryDelegationRequest(): QueryDelegationRequest { - return { delegatorAddr: "", validatorAddr: "" }; + return { delegatorAddr: "", validatorAddr: "" } } export const QueryDelegationRequest = { - encode(message: QueryDelegationRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryDelegationRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.delegatorAddr !== "") { - writer.uint32(10).string(message.delegatorAddr); + writer.uint32(10).string(message.delegatorAddr) } if (message.validatorAddr !== "") { - writer.uint32(18).string(message.validatorAddr); + writer.uint32(18).string(message.validatorAddr) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegationRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryDelegationRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryDelegationRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.delegatorAddr = reader.string(); - break; + message.delegatorAddr = reader.string() + break case 2: - message.validatorAddr = reader.string(); - break; + message.validatorAddr = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryDelegationRequest { return { delegatorAddr: isSet(object.delegatorAddr) ? String(object.delegatorAddr) : "", validatorAddr: isSet(object.validatorAddr) ? String(object.validatorAddr) : "", - }; + } }, toJSON(message: QueryDelegationRequest): unknown { - const obj: any = {}; - message.delegatorAddr !== undefined && (obj.delegatorAddr = message.delegatorAddr); - message.validatorAddr !== undefined && (obj.validatorAddr = message.validatorAddr); - return obj; + const obj: any = {} + message.delegatorAddr !== undefined && (obj.delegatorAddr = message.delegatorAddr) + message.validatorAddr !== undefined && (obj.validatorAddr = message.validatorAddr) + return obj }, - fromPartial, I>>(object: I): QueryDelegationRequest { - const message = createBaseQueryDelegationRequest(); - message.delegatorAddr = object.delegatorAddr ?? ""; - message.validatorAddr = object.validatorAddr ?? ""; - return message; + fromPartial, I>>( + object: I, + ): QueryDelegationRequest { + const message = createBaseQueryDelegationRequest() + message.delegatorAddr = object.delegatorAddr ?? "" + message.validatorAddr = object.validatorAddr ?? "" + return message }, -}; +} function createBaseQueryDelegationResponse(): QueryDelegationResponse { - return { delegationResponse: undefined }; + return { delegationResponse: undefined } } export const QueryDelegationResponse = { - encode(message: QueryDelegationResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryDelegationResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.delegationResponse !== undefined) { - DelegationResponse.encode(message.delegationResponse, writer.uint32(10).fork()).ldelim(); + DelegationResponse.encode( + message.delegationResponse, + writer.uint32(10).fork(), + ).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegationResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryDelegationResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryDelegationResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.delegationResponse = DelegationResponse.decode(reader, reader.uint32()); - break; + message.delegationResponse = DelegationResponse.decode( + reader, + reader.uint32(), + ) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryDelegationResponse { @@ -846,235 +955,277 @@ export const QueryDelegationResponse = { delegationResponse: isSet(object.delegationResponse) ? DelegationResponse.fromJSON(object.delegationResponse) : undefined, - }; + } }, toJSON(message: QueryDelegationResponse): unknown { - const obj: any = {}; - message.delegationResponse !== undefined && (obj.delegationResponse = message.delegationResponse - ? DelegationResponse.toJSON(message.delegationResponse) - : undefined); - return obj; + const obj: any = {} + message.delegationResponse !== undefined && + (obj.delegationResponse = message.delegationResponse + ? DelegationResponse.toJSON(message.delegationResponse) + : undefined) + return obj }, - fromPartial, I>>(object: I): QueryDelegationResponse { - const message = createBaseQueryDelegationResponse(); - message.delegationResponse = (object.delegationResponse !== undefined && object.delegationResponse !== null) - ? DelegationResponse.fromPartial(object.delegationResponse) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): QueryDelegationResponse { + const message = createBaseQueryDelegationResponse() + message.delegationResponse = + object.delegationResponse !== undefined && object.delegationResponse !== null + ? DelegationResponse.fromPartial(object.delegationResponse) + : undefined + return message }, -}; +} function createBaseQueryUnbondingDelegationRequest(): QueryUnbondingDelegationRequest { - return { delegatorAddr: "", validatorAddr: "" }; + return { delegatorAddr: "", validatorAddr: "" } } export const QueryUnbondingDelegationRequest = { - encode(message: QueryUnbondingDelegationRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryUnbondingDelegationRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.delegatorAddr !== "") { - writer.uint32(10).string(message.delegatorAddr); + writer.uint32(10).string(message.delegatorAddr) } if (message.validatorAddr !== "") { - writer.uint32(18).string(message.validatorAddr); + writer.uint32(18).string(message.validatorAddr) } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryUnbondingDelegationRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryUnbondingDelegationRequest(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryUnbondingDelegationRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryUnbondingDelegationRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.delegatorAddr = reader.string(); - break; + message.delegatorAddr = reader.string() + break case 2: - message.validatorAddr = reader.string(); - break; + message.validatorAddr = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryUnbondingDelegationRequest { return { delegatorAddr: isSet(object.delegatorAddr) ? String(object.delegatorAddr) : "", validatorAddr: isSet(object.validatorAddr) ? String(object.validatorAddr) : "", - }; + } }, toJSON(message: QueryUnbondingDelegationRequest): unknown { - const obj: any = {}; - message.delegatorAddr !== undefined && (obj.delegatorAddr = message.delegatorAddr); - message.validatorAddr !== undefined && (obj.validatorAddr = message.validatorAddr); - return obj; + const obj: any = {} + message.delegatorAddr !== undefined && (obj.delegatorAddr = message.delegatorAddr) + message.validatorAddr !== undefined && (obj.validatorAddr = message.validatorAddr) + return obj }, fromPartial, I>>( object: I, ): QueryUnbondingDelegationRequest { - const message = createBaseQueryUnbondingDelegationRequest(); - message.delegatorAddr = object.delegatorAddr ?? ""; - message.validatorAddr = object.validatorAddr ?? ""; - return message; + const message = createBaseQueryUnbondingDelegationRequest() + message.delegatorAddr = object.delegatorAddr ?? "" + message.validatorAddr = object.validatorAddr ?? "" + return message }, -}; +} function createBaseQueryUnbondingDelegationResponse(): QueryUnbondingDelegationResponse { - return { unbond: undefined }; + return { unbond: undefined } } export const QueryUnbondingDelegationResponse = { - encode(message: QueryUnbondingDelegationResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryUnbondingDelegationResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.unbond !== undefined) { - UnbondingDelegation.encode(message.unbond, writer.uint32(10).fork()).ldelim(); + UnbondingDelegation.encode(message.unbond, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryUnbondingDelegationResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryUnbondingDelegationResponse(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryUnbondingDelegationResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryUnbondingDelegationResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.unbond = UnbondingDelegation.decode(reader, reader.uint32()); - break; + message.unbond = UnbondingDelegation.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryUnbondingDelegationResponse { - return { unbond: isSet(object.unbond) ? UnbondingDelegation.fromJSON(object.unbond) : undefined }; + return { + unbond: isSet(object.unbond) + ? UnbondingDelegation.fromJSON(object.unbond) + : undefined, + } }, toJSON(message: QueryUnbondingDelegationResponse): unknown { - const obj: any = {}; + const obj: any = {} message.unbond !== undefined && - (obj.unbond = message.unbond ? UnbondingDelegation.toJSON(message.unbond) : undefined); - return obj; + (obj.unbond = message.unbond + ? UnbondingDelegation.toJSON(message.unbond) + : undefined) + return obj }, fromPartial, I>>( object: I, ): QueryUnbondingDelegationResponse { - const message = createBaseQueryUnbondingDelegationResponse(); - message.unbond = (object.unbond !== undefined && object.unbond !== null) - ? UnbondingDelegation.fromPartial(object.unbond) - : undefined; - return message; + const message = createBaseQueryUnbondingDelegationResponse() + message.unbond = + object.unbond !== undefined && object.unbond !== null + ? UnbondingDelegation.fromPartial(object.unbond) + : undefined + return message }, -}; +} function createBaseQueryDelegatorDelegationsRequest(): QueryDelegatorDelegationsRequest { - return { delegatorAddr: "", pagination: undefined }; + return { delegatorAddr: "", pagination: undefined } } export const QueryDelegatorDelegationsRequest = { - encode(message: QueryDelegatorDelegationsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryDelegatorDelegationsRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.delegatorAddr !== "") { - writer.uint32(10).string(message.delegatorAddr); + writer.uint32(10).string(message.delegatorAddr) } if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegatorDelegationsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryDelegatorDelegationsRequest(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryDelegatorDelegationsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryDelegatorDelegationsRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.delegatorAddr = reader.string(); - break; + message.delegatorAddr = reader.string() + break case 2: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; + message.pagination = PageRequest.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryDelegatorDelegationsRequest { return { delegatorAddr: isSet(object.delegatorAddr) ? String(object.delegatorAddr) : "", - pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined, - }; + pagination: isSet(object.pagination) + ? PageRequest.fromJSON(object.pagination) + : undefined, + } }, toJSON(message: QueryDelegatorDelegationsRequest): unknown { - const obj: any = {}; - message.delegatorAddr !== undefined && (obj.delegatorAddr = message.delegatorAddr); + const obj: any = {} + message.delegatorAddr !== undefined && (obj.delegatorAddr = message.delegatorAddr) message.pagination !== undefined && - (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); - return obj; + (obj.pagination = message.pagination + ? PageRequest.toJSON(message.pagination) + : undefined) + return obj }, fromPartial, I>>( object: I, ): QueryDelegatorDelegationsRequest { - const message = createBaseQueryDelegatorDelegationsRequest(); - message.delegatorAddr = object.delegatorAddr ?? ""; - message.pagination = (object.pagination !== undefined && object.pagination !== null) - ? PageRequest.fromPartial(object.pagination) - : undefined; - return message; + const message = createBaseQueryDelegatorDelegationsRequest() + message.delegatorAddr = object.delegatorAddr ?? "" + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageRequest.fromPartial(object.pagination) + : undefined + return message }, -}; +} function createBaseQueryDelegatorDelegationsResponse(): QueryDelegatorDelegationsResponse { - return { delegationResponses: [], pagination: undefined }; + return { delegationResponses: [], pagination: undefined } } export const QueryDelegatorDelegationsResponse = { - encode(message: QueryDelegatorDelegationsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryDelegatorDelegationsResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { for (const v of message.delegationResponses) { - DelegationResponse.encode(v!, writer.uint32(10).fork()).ldelim(); + DelegationResponse.encode(v!, writer.uint32(10).fork()).ldelim() } if (message.pagination !== undefined) { - PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegatorDelegationsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryDelegatorDelegationsResponse(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryDelegatorDelegationsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryDelegatorDelegationsResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.delegationResponses.push(DelegationResponse.decode(reader, reader.uint32())); - break; + message.delegationResponses.push( + DelegationResponse.decode(reader, reader.uint32()), + ) + break case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; + message.pagination = PageResponse.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryDelegatorDelegationsResponse { @@ -1082,131 +1233,158 @@ export const QueryDelegatorDelegationsResponse = { delegationResponses: Array.isArray(object?.delegationResponses) ? object.delegationResponses.map((e: any) => DelegationResponse.fromJSON(e)) : [], - pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, - }; + pagination: isSet(object.pagination) + ? PageResponse.fromJSON(object.pagination) + : undefined, + } }, toJSON(message: QueryDelegatorDelegationsResponse): unknown { - const obj: any = {}; + const obj: any = {} if (message.delegationResponses) { - obj.delegationResponses = message.delegationResponses.map((e) => e ? DelegationResponse.toJSON(e) : undefined); + obj.delegationResponses = message.delegationResponses.map((e) => + e ? DelegationResponse.toJSON(e) : undefined, + ) } else { - obj.delegationResponses = []; + obj.delegationResponses = [] } message.pagination !== undefined && - (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); - return obj; + (obj.pagination = message.pagination + ? PageResponse.toJSON(message.pagination) + : undefined) + return obj }, fromPartial, I>>( object: I, ): QueryDelegatorDelegationsResponse { - const message = createBaseQueryDelegatorDelegationsResponse(); - message.delegationResponses = object.delegationResponses?.map((e) => DelegationResponse.fromPartial(e)) || []; - message.pagination = (object.pagination !== undefined && object.pagination !== null) - ? PageResponse.fromPartial(object.pagination) - : undefined; - return message; + const message = createBaseQueryDelegatorDelegationsResponse() + message.delegationResponses = + object.delegationResponses?.map((e) => DelegationResponse.fromPartial(e)) || [] + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageResponse.fromPartial(object.pagination) + : undefined + return message }, -}; +} function createBaseQueryDelegatorUnbondingDelegationsRequest(): QueryDelegatorUnbondingDelegationsRequest { - return { delegatorAddr: "", pagination: undefined }; + return { delegatorAddr: "", pagination: undefined } } export const QueryDelegatorUnbondingDelegationsRequest = { - encode(message: QueryDelegatorUnbondingDelegationsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryDelegatorUnbondingDelegationsRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.delegatorAddr !== "") { - writer.uint32(10).string(message.delegatorAddr); + writer.uint32(10).string(message.delegatorAddr) } if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegatorUnbondingDelegationsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryDelegatorUnbondingDelegationsRequest(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryDelegatorUnbondingDelegationsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryDelegatorUnbondingDelegationsRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.delegatorAddr = reader.string(); - break; + message.delegatorAddr = reader.string() + break case 2: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; + message.pagination = PageRequest.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryDelegatorUnbondingDelegationsRequest { return { delegatorAddr: isSet(object.delegatorAddr) ? String(object.delegatorAddr) : "", - pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined, - }; + pagination: isSet(object.pagination) + ? PageRequest.fromJSON(object.pagination) + : undefined, + } }, toJSON(message: QueryDelegatorUnbondingDelegationsRequest): unknown { - const obj: any = {}; - message.delegatorAddr !== undefined && (obj.delegatorAddr = message.delegatorAddr); + const obj: any = {} + message.delegatorAddr !== undefined && (obj.delegatorAddr = message.delegatorAddr) message.pagination !== undefined && - (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); - return obj; + (obj.pagination = message.pagination + ? PageRequest.toJSON(message.pagination) + : undefined) + return obj + }, + + fromPartial< + I extends Exact, I>, + >(object: I): QueryDelegatorUnbondingDelegationsRequest { + const message = createBaseQueryDelegatorUnbondingDelegationsRequest() + message.delegatorAddr = object.delegatorAddr ?? "" + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageRequest.fromPartial(object.pagination) + : undefined + return message }, - - fromPartial, I>>( - object: I, - ): QueryDelegatorUnbondingDelegationsRequest { - const message = createBaseQueryDelegatorUnbondingDelegationsRequest(); - message.delegatorAddr = object.delegatorAddr ?? ""; - message.pagination = (object.pagination !== undefined && object.pagination !== null) - ? PageRequest.fromPartial(object.pagination) - : undefined; - return message; - }, -}; +} function createBaseQueryDelegatorUnbondingDelegationsResponse(): QueryDelegatorUnbondingDelegationsResponse { - return { unbondingResponses: [], pagination: undefined }; + return { unbondingResponses: [], pagination: undefined } } export const QueryDelegatorUnbondingDelegationsResponse = { - encode(message: QueryDelegatorUnbondingDelegationsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryDelegatorUnbondingDelegationsResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { for (const v of message.unbondingResponses) { - UnbondingDelegation.encode(v!, writer.uint32(10).fork()).ldelim(); + UnbondingDelegation.encode(v!, writer.uint32(10).fork()).ldelim() } if (message.pagination !== undefined) { - PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegatorUnbondingDelegationsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryDelegatorUnbondingDelegationsResponse(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryDelegatorUnbondingDelegationsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryDelegatorUnbondingDelegationsResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.unbondingResponses.push(UnbondingDelegation.decode(reader, reader.uint32())); - break; + message.unbondingResponses.push( + UnbondingDelegation.decode(reader, reader.uint32()), + ) + break case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; + message.pagination = PageResponse.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryDelegatorUnbondingDelegationsResponse { @@ -1214,147 +1392,181 @@ export const QueryDelegatorUnbondingDelegationsResponse = { unbondingResponses: Array.isArray(object?.unbondingResponses) ? object.unbondingResponses.map((e: any) => UnbondingDelegation.fromJSON(e)) : [], - pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, - }; + pagination: isSet(object.pagination) + ? PageResponse.fromJSON(object.pagination) + : undefined, + } }, toJSON(message: QueryDelegatorUnbondingDelegationsResponse): unknown { - const obj: any = {}; + const obj: any = {} if (message.unbondingResponses) { - obj.unbondingResponses = message.unbondingResponses.map((e) => e ? UnbondingDelegation.toJSON(e) : undefined); + obj.unbondingResponses = message.unbondingResponses.map((e) => + e ? UnbondingDelegation.toJSON(e) : undefined, + ) } else { - obj.unbondingResponses = []; + obj.unbondingResponses = [] } message.pagination !== undefined && - (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); - return obj; - }, - - fromPartial, I>>( - object: I, - ): QueryDelegatorUnbondingDelegationsResponse { - const message = createBaseQueryDelegatorUnbondingDelegationsResponse(); - message.unbondingResponses = object.unbondingResponses?.map((e) => UnbondingDelegation.fromPartial(e)) || []; - message.pagination = (object.pagination !== undefined && object.pagination !== null) - ? PageResponse.fromPartial(object.pagination) - : undefined; - return message; + (obj.pagination = message.pagination + ? PageResponse.toJSON(message.pagination) + : undefined) + return obj + }, + + fromPartial< + I extends Exact, I>, + >(object: I): QueryDelegatorUnbondingDelegationsResponse { + const message = createBaseQueryDelegatorUnbondingDelegationsResponse() + message.unbondingResponses = + object.unbondingResponses?.map((e) => UnbondingDelegation.fromPartial(e)) || [] + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageResponse.fromPartial(object.pagination) + : undefined + return message }, -}; +} function createBaseQueryRedelegationsRequest(): QueryRedelegationsRequest { - return { delegatorAddr: "", srcValidatorAddr: "", dstValidatorAddr: "", pagination: undefined }; + return { + delegatorAddr: "", + srcValidatorAddr: "", + dstValidatorAddr: "", + pagination: undefined, + } } export const QueryRedelegationsRequest = { - encode(message: QueryRedelegationsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryRedelegationsRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.delegatorAddr !== "") { - writer.uint32(10).string(message.delegatorAddr); + writer.uint32(10).string(message.delegatorAddr) } if (message.srcValidatorAddr !== "") { - writer.uint32(18).string(message.srcValidatorAddr); + writer.uint32(18).string(message.srcValidatorAddr) } if (message.dstValidatorAddr !== "") { - writer.uint32(26).string(message.dstValidatorAddr); + writer.uint32(26).string(message.dstValidatorAddr) } if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(34).fork()).ldelim(); + PageRequest.encode(message.pagination, writer.uint32(34).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryRedelegationsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryRedelegationsRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryRedelegationsRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.delegatorAddr = reader.string(); - break; + message.delegatorAddr = reader.string() + break case 2: - message.srcValidatorAddr = reader.string(); - break; + message.srcValidatorAddr = reader.string() + break case 3: - message.dstValidatorAddr = reader.string(); - break; + message.dstValidatorAddr = reader.string() + break case 4: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; + message.pagination = PageRequest.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryRedelegationsRequest { return { delegatorAddr: isSet(object.delegatorAddr) ? String(object.delegatorAddr) : "", - srcValidatorAddr: isSet(object.srcValidatorAddr) ? String(object.srcValidatorAddr) : "", - dstValidatorAddr: isSet(object.dstValidatorAddr) ? String(object.dstValidatorAddr) : "", - pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined, - }; + srcValidatorAddr: isSet(object.srcValidatorAddr) + ? String(object.srcValidatorAddr) + : "", + dstValidatorAddr: isSet(object.dstValidatorAddr) + ? String(object.dstValidatorAddr) + : "", + pagination: isSet(object.pagination) + ? PageRequest.fromJSON(object.pagination) + : undefined, + } }, toJSON(message: QueryRedelegationsRequest): unknown { - const obj: any = {}; - message.delegatorAddr !== undefined && (obj.delegatorAddr = message.delegatorAddr); - message.srcValidatorAddr !== undefined && (obj.srcValidatorAddr = message.srcValidatorAddr); - message.dstValidatorAddr !== undefined && (obj.dstValidatorAddr = message.dstValidatorAddr); + const obj: any = {} + message.delegatorAddr !== undefined && (obj.delegatorAddr = message.delegatorAddr) + message.srcValidatorAddr !== undefined && + (obj.srcValidatorAddr = message.srcValidatorAddr) + message.dstValidatorAddr !== undefined && + (obj.dstValidatorAddr = message.dstValidatorAddr) message.pagination !== undefined && - (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); - return obj; + (obj.pagination = message.pagination + ? PageRequest.toJSON(message.pagination) + : undefined) + return obj }, - fromPartial, I>>(object: I): QueryRedelegationsRequest { - const message = createBaseQueryRedelegationsRequest(); - message.delegatorAddr = object.delegatorAddr ?? ""; - message.srcValidatorAddr = object.srcValidatorAddr ?? ""; - message.dstValidatorAddr = object.dstValidatorAddr ?? ""; - message.pagination = (object.pagination !== undefined && object.pagination !== null) - ? PageRequest.fromPartial(object.pagination) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): QueryRedelegationsRequest { + const message = createBaseQueryRedelegationsRequest() + message.delegatorAddr = object.delegatorAddr ?? "" + message.srcValidatorAddr = object.srcValidatorAddr ?? "" + message.dstValidatorAddr = object.dstValidatorAddr ?? "" + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageRequest.fromPartial(object.pagination) + : undefined + return message }, -}; +} function createBaseQueryRedelegationsResponse(): QueryRedelegationsResponse { - return { redelegationResponses: [], pagination: undefined }; + return { redelegationResponses: [], pagination: undefined } } export const QueryRedelegationsResponse = { - encode(message: QueryRedelegationsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryRedelegationsResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { for (const v of message.redelegationResponses) { - RedelegationResponse.encode(v!, writer.uint32(10).fork()).ldelim(); + RedelegationResponse.encode(v!, writer.uint32(10).fork()).ldelim() } if (message.pagination !== undefined) { - PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryRedelegationsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryRedelegationsResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryRedelegationsResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.redelegationResponses.push(RedelegationResponse.decode(reader, reader.uint32())); - break; + message.redelegationResponses.push( + RedelegationResponse.decode(reader, reader.uint32()), + ) + break case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; + message.pagination = PageResponse.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryRedelegationsResponse { @@ -1362,725 +1574,911 @@ export const QueryRedelegationsResponse = { redelegationResponses: Array.isArray(object?.redelegationResponses) ? object.redelegationResponses.map((e: any) => RedelegationResponse.fromJSON(e)) : [], - pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, - }; + pagination: isSet(object.pagination) + ? PageResponse.fromJSON(object.pagination) + : undefined, + } }, toJSON(message: QueryRedelegationsResponse): unknown { - const obj: any = {}; + const obj: any = {} if (message.redelegationResponses) { obj.redelegationResponses = message.redelegationResponses.map((e) => - e ? RedelegationResponse.toJSON(e) : undefined - ); + e ? RedelegationResponse.toJSON(e) : undefined, + ) } else { - obj.redelegationResponses = []; + obj.redelegationResponses = [] } message.pagination !== undefined && - (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); - return obj; + (obj.pagination = message.pagination + ? PageResponse.toJSON(message.pagination) + : undefined) + return obj }, - fromPartial, I>>(object: I): QueryRedelegationsResponse { - const message = createBaseQueryRedelegationsResponse(); - message.redelegationResponses = object.redelegationResponses?.map((e) => RedelegationResponse.fromPartial(e)) || []; - message.pagination = (object.pagination !== undefined && object.pagination !== null) - ? PageResponse.fromPartial(object.pagination) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): QueryRedelegationsResponse { + const message = createBaseQueryRedelegationsResponse() + message.redelegationResponses = + object.redelegationResponses?.map((e) => RedelegationResponse.fromPartial(e)) || + [] + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageResponse.fromPartial(object.pagination) + : undefined + return message }, -}; +} function createBaseQueryDelegatorValidatorsRequest(): QueryDelegatorValidatorsRequest { - return { delegatorAddr: "", pagination: undefined }; + return { delegatorAddr: "", pagination: undefined } } export const QueryDelegatorValidatorsRequest = { - encode(message: QueryDelegatorValidatorsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryDelegatorValidatorsRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.delegatorAddr !== "") { - writer.uint32(10).string(message.delegatorAddr); + writer.uint32(10).string(message.delegatorAddr) } if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegatorValidatorsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryDelegatorValidatorsRequest(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryDelegatorValidatorsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryDelegatorValidatorsRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.delegatorAddr = reader.string(); - break; + message.delegatorAddr = reader.string() + break case 2: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; + message.pagination = PageRequest.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryDelegatorValidatorsRequest { return { delegatorAddr: isSet(object.delegatorAddr) ? String(object.delegatorAddr) : "", - pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined, - }; + pagination: isSet(object.pagination) + ? PageRequest.fromJSON(object.pagination) + : undefined, + } }, toJSON(message: QueryDelegatorValidatorsRequest): unknown { - const obj: any = {}; - message.delegatorAddr !== undefined && (obj.delegatorAddr = message.delegatorAddr); + const obj: any = {} + message.delegatorAddr !== undefined && (obj.delegatorAddr = message.delegatorAddr) message.pagination !== undefined && - (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); - return obj; + (obj.pagination = message.pagination + ? PageRequest.toJSON(message.pagination) + : undefined) + return obj }, fromPartial, I>>( object: I, ): QueryDelegatorValidatorsRequest { - const message = createBaseQueryDelegatorValidatorsRequest(); - message.delegatorAddr = object.delegatorAddr ?? ""; - message.pagination = (object.pagination !== undefined && object.pagination !== null) - ? PageRequest.fromPartial(object.pagination) - : undefined; - return message; + const message = createBaseQueryDelegatorValidatorsRequest() + message.delegatorAddr = object.delegatorAddr ?? "" + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageRequest.fromPartial(object.pagination) + : undefined + return message }, -}; +} function createBaseQueryDelegatorValidatorsResponse(): QueryDelegatorValidatorsResponse { - return { validators: [], pagination: undefined }; + return { validators: [], pagination: undefined } } export const QueryDelegatorValidatorsResponse = { - encode(message: QueryDelegatorValidatorsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryDelegatorValidatorsResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { for (const v of message.validators) { - Validator.encode(v!, writer.uint32(10).fork()).ldelim(); + Validator.encode(v!, writer.uint32(10).fork()).ldelim() } if (message.pagination !== undefined) { - PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegatorValidatorsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryDelegatorValidatorsResponse(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryDelegatorValidatorsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryDelegatorValidatorsResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.validators.push(Validator.decode(reader, reader.uint32())); - break; + message.validators.push(Validator.decode(reader, reader.uint32())) + break case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; + message.pagination = PageResponse.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryDelegatorValidatorsResponse { return { - validators: Array.isArray(object?.validators) ? object.validators.map((e: any) => Validator.fromJSON(e)) : [], - pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, - }; + validators: Array.isArray(object?.validators) + ? object.validators.map((e: any) => Validator.fromJSON(e)) + : [], + pagination: isSet(object.pagination) + ? PageResponse.fromJSON(object.pagination) + : undefined, + } }, toJSON(message: QueryDelegatorValidatorsResponse): unknown { - const obj: any = {}; + const obj: any = {} if (message.validators) { - obj.validators = message.validators.map((e) => e ? Validator.toJSON(e) : undefined); + obj.validators = message.validators.map((e) => + e ? Validator.toJSON(e) : undefined, + ) } else { - obj.validators = []; + obj.validators = [] } message.pagination !== undefined && - (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); - return obj; + (obj.pagination = message.pagination + ? PageResponse.toJSON(message.pagination) + : undefined) + return obj }, fromPartial, I>>( object: I, ): QueryDelegatorValidatorsResponse { - const message = createBaseQueryDelegatorValidatorsResponse(); - message.validators = object.validators?.map((e) => Validator.fromPartial(e)) || []; - message.pagination = (object.pagination !== undefined && object.pagination !== null) - ? PageResponse.fromPartial(object.pagination) - : undefined; - return message; + const message = createBaseQueryDelegatorValidatorsResponse() + message.validators = object.validators?.map((e) => Validator.fromPartial(e)) || [] + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageResponse.fromPartial(object.pagination) + : undefined + return message }, -}; +} function createBaseQueryDelegatorValidatorRequest(): QueryDelegatorValidatorRequest { - return { delegatorAddr: "", validatorAddr: "" }; + return { delegatorAddr: "", validatorAddr: "" } } export const QueryDelegatorValidatorRequest = { - encode(message: QueryDelegatorValidatorRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryDelegatorValidatorRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.delegatorAddr !== "") { - writer.uint32(10).string(message.delegatorAddr); + writer.uint32(10).string(message.delegatorAddr) } if (message.validatorAddr !== "") { - writer.uint32(18).string(message.validatorAddr); + writer.uint32(18).string(message.validatorAddr) } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegatorValidatorRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryDelegatorValidatorRequest(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryDelegatorValidatorRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryDelegatorValidatorRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.delegatorAddr = reader.string(); - break; + message.delegatorAddr = reader.string() + break case 2: - message.validatorAddr = reader.string(); - break; + message.validatorAddr = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryDelegatorValidatorRequest { return { delegatorAddr: isSet(object.delegatorAddr) ? String(object.delegatorAddr) : "", validatorAddr: isSet(object.validatorAddr) ? String(object.validatorAddr) : "", - }; + } }, toJSON(message: QueryDelegatorValidatorRequest): unknown { - const obj: any = {}; - message.delegatorAddr !== undefined && (obj.delegatorAddr = message.delegatorAddr); - message.validatorAddr !== undefined && (obj.validatorAddr = message.validatorAddr); - return obj; + const obj: any = {} + message.delegatorAddr !== undefined && (obj.delegatorAddr = message.delegatorAddr) + message.validatorAddr !== undefined && (obj.validatorAddr = message.validatorAddr) + return obj }, fromPartial, I>>( object: I, ): QueryDelegatorValidatorRequest { - const message = createBaseQueryDelegatorValidatorRequest(); - message.delegatorAddr = object.delegatorAddr ?? ""; - message.validatorAddr = object.validatorAddr ?? ""; - return message; + const message = createBaseQueryDelegatorValidatorRequest() + message.delegatorAddr = object.delegatorAddr ?? "" + message.validatorAddr = object.validatorAddr ?? "" + return message }, -}; +} function createBaseQueryDelegatorValidatorResponse(): QueryDelegatorValidatorResponse { - return { validator: undefined }; + return { validator: undefined } } export const QueryDelegatorValidatorResponse = { - encode(message: QueryDelegatorValidatorResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryDelegatorValidatorResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.validator !== undefined) { - Validator.encode(message.validator, writer.uint32(10).fork()).ldelim(); + Validator.encode(message.validator, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegatorValidatorResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryDelegatorValidatorResponse(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryDelegatorValidatorResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryDelegatorValidatorResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.validator = Validator.decode(reader, reader.uint32()); - break; + message.validator = Validator.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryDelegatorValidatorResponse { - return { validator: isSet(object.validator) ? Validator.fromJSON(object.validator) : undefined }; + return { + validator: isSet(object.validator) + ? Validator.fromJSON(object.validator) + : undefined, + } }, toJSON(message: QueryDelegatorValidatorResponse): unknown { - const obj: any = {}; + const obj: any = {} message.validator !== undefined && - (obj.validator = message.validator ? Validator.toJSON(message.validator) : undefined); - return obj; + (obj.validator = message.validator + ? Validator.toJSON(message.validator) + : undefined) + return obj }, fromPartial, I>>( object: I, ): QueryDelegatorValidatorResponse { - const message = createBaseQueryDelegatorValidatorResponse(); - message.validator = (object.validator !== undefined && object.validator !== null) - ? Validator.fromPartial(object.validator) - : undefined; - return message; + const message = createBaseQueryDelegatorValidatorResponse() + message.validator = + object.validator !== undefined && object.validator !== null + ? Validator.fromPartial(object.validator) + : undefined + return message }, -}; +} function createBaseQueryHistoricalInfoRequest(): QueryHistoricalInfoRequest { - return { height: Long.ZERO }; + return { height: Long.ZERO } } export const QueryHistoricalInfoRequest = { - encode(message: QueryHistoricalInfoRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryHistoricalInfoRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (!message.height.isZero()) { - writer.uint32(8).int64(message.height); + writer.uint32(8).int64(message.height) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryHistoricalInfoRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryHistoricalInfoRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryHistoricalInfoRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.height = reader.int64() as Long; - break; + message.height = reader.int64() as Long + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryHistoricalInfoRequest { - return { height: isSet(object.height) ? Long.fromValue(object.height) : Long.ZERO }; + return { + height: isSet(object.height) ? Long.fromValue(object.height) : Long.ZERO, + } }, toJSON(message: QueryHistoricalInfoRequest): unknown { - const obj: any = {}; - message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); - return obj; + const obj: any = {} + message.height !== undefined && + (obj.height = (message.height || Long.ZERO).toString()) + return obj }, - fromPartial, I>>(object: I): QueryHistoricalInfoRequest { - const message = createBaseQueryHistoricalInfoRequest(); - message.height = (object.height !== undefined && object.height !== null) - ? Long.fromValue(object.height) - : Long.ZERO; - return message; + fromPartial, I>>( + object: I, + ): QueryHistoricalInfoRequest { + const message = createBaseQueryHistoricalInfoRequest() + message.height = + object.height !== undefined && object.height !== null + ? Long.fromValue(object.height) + : Long.ZERO + return message }, -}; +} function createBaseQueryHistoricalInfoResponse(): QueryHistoricalInfoResponse { - return { hist: undefined }; + return { hist: undefined } } export const QueryHistoricalInfoResponse = { - encode(message: QueryHistoricalInfoResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryHistoricalInfoResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.hist !== undefined) { - HistoricalInfo.encode(message.hist, writer.uint32(10).fork()).ldelim(); + HistoricalInfo.encode(message.hist, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryHistoricalInfoResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryHistoricalInfoResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryHistoricalInfoResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.hist = HistoricalInfo.decode(reader, reader.uint32()); - break; + message.hist = HistoricalInfo.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryHistoricalInfoResponse { - return { hist: isSet(object.hist) ? HistoricalInfo.fromJSON(object.hist) : undefined }; + return { + hist: isSet(object.hist) ? HistoricalInfo.fromJSON(object.hist) : undefined, + } }, toJSON(message: QueryHistoricalInfoResponse): unknown { - const obj: any = {}; - message.hist !== undefined && (obj.hist = message.hist ? HistoricalInfo.toJSON(message.hist) : undefined); - return obj; + const obj: any = {} + message.hist !== undefined && + (obj.hist = message.hist ? HistoricalInfo.toJSON(message.hist) : undefined) + return obj }, - fromPartial, I>>(object: I): QueryHistoricalInfoResponse { - const message = createBaseQueryHistoricalInfoResponse(); - message.hist = (object.hist !== undefined && object.hist !== null) - ? HistoricalInfo.fromPartial(object.hist) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): QueryHistoricalInfoResponse { + const message = createBaseQueryHistoricalInfoResponse() + message.hist = + object.hist !== undefined && object.hist !== null + ? HistoricalInfo.fromPartial(object.hist) + : undefined + return message }, -}; +} function createBaseQueryPoolRequest(): QueryPoolRequest { - return {}; + return {} } export const QueryPoolRequest = { encode(_: QueryPoolRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryPoolRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryPoolRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryPoolRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(_: any): QueryPoolRequest { - return {}; + return {} }, toJSON(_: QueryPoolRequest): unknown { - const obj: any = {}; - return obj; + const obj: any = {} + return obj }, - fromPartial, I>>(_: I): QueryPoolRequest { - const message = createBaseQueryPoolRequest(); - return message; + fromPartial, I>>( + _: I, + ): QueryPoolRequest { + const message = createBaseQueryPoolRequest() + return message }, -}; +} function createBaseQueryPoolResponse(): QueryPoolResponse { - return { pool: undefined }; + return { pool: undefined } } export const QueryPoolResponse = { - encode(message: QueryPoolResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryPoolResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.pool !== undefined) { - Pool.encode(message.pool, writer.uint32(10).fork()).ldelim(); + Pool.encode(message.pool, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryPoolResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryPoolResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryPoolResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.pool = Pool.decode(reader, reader.uint32()); - break; + message.pool = Pool.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryPoolResponse { - return { pool: isSet(object.pool) ? Pool.fromJSON(object.pool) : undefined }; + return { + pool: isSet(object.pool) ? Pool.fromJSON(object.pool) : undefined, + } }, toJSON(message: QueryPoolResponse): unknown { - const obj: any = {}; - message.pool !== undefined && (obj.pool = message.pool ? Pool.toJSON(message.pool) : undefined); - return obj; + const obj: any = {} + message.pool !== undefined && + (obj.pool = message.pool ? Pool.toJSON(message.pool) : undefined) + return obj }, - fromPartial, I>>(object: I): QueryPoolResponse { - const message = createBaseQueryPoolResponse(); - message.pool = (object.pool !== undefined && object.pool !== null) ? Pool.fromPartial(object.pool) : undefined; - return message; + fromPartial, I>>( + object: I, + ): QueryPoolResponse { + const message = createBaseQueryPoolResponse() + message.pool = + object.pool !== undefined && object.pool !== null + ? Pool.fromPartial(object.pool) + : undefined + return message }, -}; +} function createBaseQueryParamsRequest(): QueryParamsRequest { - return {}; + return {} } export const QueryParamsRequest = { encode(_: QueryParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryParamsRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryParamsRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(_: any): QueryParamsRequest { - return {}; + return {} }, toJSON(_: QueryParamsRequest): unknown { - const obj: any = {}; - return obj; + const obj: any = {} + return obj }, - fromPartial, I>>(_: I): QueryParamsRequest { - const message = createBaseQueryParamsRequest(); - return message; + fromPartial, I>>( + _: I, + ): QueryParamsRequest { + const message = createBaseQueryParamsRequest() + return message }, -}; +} function createBaseQueryParamsResponse(): QueryParamsResponse { - return { params: undefined }; + return { params: undefined } } export const QueryParamsResponse = { - encode(message: QueryParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryParamsResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.params !== undefined) { - Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + Params.encode(message.params, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryParamsResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryParamsResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.params = Params.decode(reader, reader.uint32()); - break; + message.params = Params.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryParamsResponse { - return { params: isSet(object.params) ? Params.fromJSON(object.params) : undefined }; + return { + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined, + } }, toJSON(message: QueryParamsResponse): unknown { - const obj: any = {}; - message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); - return obj; + const obj: any = {} + message.params !== undefined && + (obj.params = message.params ? Params.toJSON(message.params) : undefined) + return obj }, - fromPartial, I>>(object: I): QueryParamsResponse { - const message = createBaseQueryParamsResponse(); - message.params = (object.params !== undefined && object.params !== null) - ? Params.fromPartial(object.params) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): QueryParamsResponse { + const message = createBaseQueryParamsResponse() + message.params = + object.params !== undefined && object.params !== null + ? Params.fromPartial(object.params) + : undefined + return message }, -}; +} /** Query defines the gRPC querier service. */ export interface Query { /** Validators queries all validators that match the given status. */ - Validators(request: QueryValidatorsRequest): Promise; + Validators(request: QueryValidatorsRequest): Promise /** Validator queries validator info for given validator address. */ - Validator(request: QueryValidatorRequest): Promise; + Validator(request: QueryValidatorRequest): Promise /** ValidatorDelegations queries delegate info for given validator. */ - ValidatorDelegations(request: QueryValidatorDelegationsRequest): Promise; + ValidatorDelegations( + request: QueryValidatorDelegationsRequest, + ): Promise /** ValidatorUnbondingDelegations queries unbonding delegations of a validator. */ ValidatorUnbondingDelegations( request: QueryValidatorUnbondingDelegationsRequest, - ): Promise; + ): Promise /** Delegation queries delegate info for given validator delegator pair. */ - Delegation(request: QueryDelegationRequest): Promise; + Delegation(request: QueryDelegationRequest): Promise /** * UnbondingDelegation queries unbonding info for given validator delegator * pair. */ - UnbondingDelegation(request: QueryUnbondingDelegationRequest): Promise; + UnbondingDelegation( + request: QueryUnbondingDelegationRequest, + ): Promise /** DelegatorDelegations queries all delegations of a given delegator address. */ - DelegatorDelegations(request: QueryDelegatorDelegationsRequest): Promise; + DelegatorDelegations( + request: QueryDelegatorDelegationsRequest, + ): Promise /** * DelegatorUnbondingDelegations queries all unbonding delegations of a given * delegator address. */ DelegatorUnbondingDelegations( request: QueryDelegatorUnbondingDelegationsRequest, - ): Promise; + ): Promise /** Redelegations queries redelegations of given address. */ - Redelegations(request: QueryRedelegationsRequest): Promise; + Redelegations(request: QueryRedelegationsRequest): Promise /** * DelegatorValidators queries all validators info for given delegator * address. */ - DelegatorValidators(request: QueryDelegatorValidatorsRequest): Promise; + DelegatorValidators( + request: QueryDelegatorValidatorsRequest, + ): Promise /** * DelegatorValidator queries validator info for given delegator validator * pair. */ - DelegatorValidator(request: QueryDelegatorValidatorRequest): Promise; + DelegatorValidator( + request: QueryDelegatorValidatorRequest, + ): Promise /** HistoricalInfo queries the historical info for given height. */ - HistoricalInfo(request: QueryHistoricalInfoRequest): Promise; + HistoricalInfo( + request: QueryHistoricalInfoRequest, + ): Promise /** Pool queries the pool info. */ - Pool(request: QueryPoolRequest): Promise; + Pool(request: QueryPoolRequest): Promise /** Parameters queries the staking parameters. */ - Params(request: QueryParamsRequest): Promise; + Params(request: QueryParamsRequest): Promise } export class QueryClientImpl implements Query { - private readonly rpc: Rpc; + private readonly rpc: Rpc constructor(rpc: Rpc) { - this.rpc = rpc; - this.Validators = this.Validators.bind(this); - this.Validator = this.Validator.bind(this); - this.ValidatorDelegations = this.ValidatorDelegations.bind(this); - this.ValidatorUnbondingDelegations = this.ValidatorUnbondingDelegations.bind(this); - this.Delegation = this.Delegation.bind(this); - this.UnbondingDelegation = this.UnbondingDelegation.bind(this); - this.DelegatorDelegations = this.DelegatorDelegations.bind(this); - this.DelegatorUnbondingDelegations = this.DelegatorUnbondingDelegations.bind(this); - this.Redelegations = this.Redelegations.bind(this); - this.DelegatorValidators = this.DelegatorValidators.bind(this); - this.DelegatorValidator = this.DelegatorValidator.bind(this); - this.HistoricalInfo = this.HistoricalInfo.bind(this); - this.Pool = this.Pool.bind(this); - this.Params = this.Params.bind(this); + this.rpc = rpc + this.Validators = this.Validators.bind(this) + this.Validator = this.Validator.bind(this) + this.ValidatorDelegations = this.ValidatorDelegations.bind(this) + this.ValidatorUnbondingDelegations = this.ValidatorUnbondingDelegations.bind(this) + this.Delegation = this.Delegation.bind(this) + this.UnbondingDelegation = this.UnbondingDelegation.bind(this) + this.DelegatorDelegations = this.DelegatorDelegations.bind(this) + this.DelegatorUnbondingDelegations = this.DelegatorUnbondingDelegations.bind(this) + this.Redelegations = this.Redelegations.bind(this) + this.DelegatorValidators = this.DelegatorValidators.bind(this) + this.DelegatorValidator = this.DelegatorValidator.bind(this) + this.HistoricalInfo = this.HistoricalInfo.bind(this) + this.Pool = this.Pool.bind(this) + this.Params = this.Params.bind(this) } Validators(request: QueryValidatorsRequest): Promise { - const data = QueryValidatorsRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "Validators", data); - return promise.then((data) => QueryValidatorsResponse.decode(new _m0.Reader(data))); + const data = QueryValidatorsRequest.encode(request).finish() + const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "Validators", data) + return promise.then((data) => QueryValidatorsResponse.decode(new _m0.Reader(data))) } Validator(request: QueryValidatorRequest): Promise { - const data = QueryValidatorRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "Validator", data); - return promise.then((data) => QueryValidatorResponse.decode(new _m0.Reader(data))); + const data = QueryValidatorRequest.encode(request).finish() + const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "Validator", data) + return promise.then((data) => QueryValidatorResponse.decode(new _m0.Reader(data))) } - ValidatorDelegations(request: QueryValidatorDelegationsRequest): Promise { - const data = QueryValidatorDelegationsRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "ValidatorDelegations", data); - return promise.then((data) => QueryValidatorDelegationsResponse.decode(new _m0.Reader(data))); + ValidatorDelegations( + request: QueryValidatorDelegationsRequest, + ): Promise { + const data = QueryValidatorDelegationsRequest.encode(request).finish() + const promise = this.rpc.request( + "cosmos.staking.v1beta1.Query", + "ValidatorDelegations", + data, + ) + return promise.then((data) => + QueryValidatorDelegationsResponse.decode(new _m0.Reader(data)), + ) } ValidatorUnbondingDelegations( request: QueryValidatorUnbondingDelegationsRequest, ): Promise { - const data = QueryValidatorUnbondingDelegationsRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "ValidatorUnbondingDelegations", data); - return promise.then((data) => QueryValidatorUnbondingDelegationsResponse.decode(new _m0.Reader(data))); + const data = QueryValidatorUnbondingDelegationsRequest.encode(request).finish() + const promise = this.rpc.request( + "cosmos.staking.v1beta1.Query", + "ValidatorUnbondingDelegations", + data, + ) + return promise.then((data) => + QueryValidatorUnbondingDelegationsResponse.decode(new _m0.Reader(data)), + ) } Delegation(request: QueryDelegationRequest): Promise { - const data = QueryDelegationRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "Delegation", data); - return promise.then((data) => QueryDelegationResponse.decode(new _m0.Reader(data))); + const data = QueryDelegationRequest.encode(request).finish() + const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "Delegation", data) + return promise.then((data) => QueryDelegationResponse.decode(new _m0.Reader(data))) } - UnbondingDelegation(request: QueryUnbondingDelegationRequest): Promise { - const data = QueryUnbondingDelegationRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "UnbondingDelegation", data); - return promise.then((data) => QueryUnbondingDelegationResponse.decode(new _m0.Reader(data))); + UnbondingDelegation( + request: QueryUnbondingDelegationRequest, + ): Promise { + const data = QueryUnbondingDelegationRequest.encode(request).finish() + const promise = this.rpc.request( + "cosmos.staking.v1beta1.Query", + "UnbondingDelegation", + data, + ) + return promise.then((data) => + QueryUnbondingDelegationResponse.decode(new _m0.Reader(data)), + ) } - DelegatorDelegations(request: QueryDelegatorDelegationsRequest): Promise { - const data = QueryDelegatorDelegationsRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "DelegatorDelegations", data); - return promise.then((data) => QueryDelegatorDelegationsResponse.decode(new _m0.Reader(data))); + DelegatorDelegations( + request: QueryDelegatorDelegationsRequest, + ): Promise { + const data = QueryDelegatorDelegationsRequest.encode(request).finish() + const promise = this.rpc.request( + "cosmos.staking.v1beta1.Query", + "DelegatorDelegations", + data, + ) + return promise.then((data) => + QueryDelegatorDelegationsResponse.decode(new _m0.Reader(data)), + ) } DelegatorUnbondingDelegations( request: QueryDelegatorUnbondingDelegationsRequest, ): Promise { - const data = QueryDelegatorUnbondingDelegationsRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "DelegatorUnbondingDelegations", data); - return promise.then((data) => QueryDelegatorUnbondingDelegationsResponse.decode(new _m0.Reader(data))); + const data = QueryDelegatorUnbondingDelegationsRequest.encode(request).finish() + const promise = this.rpc.request( + "cosmos.staking.v1beta1.Query", + "DelegatorUnbondingDelegations", + data, + ) + return promise.then((data) => + QueryDelegatorUnbondingDelegationsResponse.decode(new _m0.Reader(data)), + ) } - Redelegations(request: QueryRedelegationsRequest): Promise { - const data = QueryRedelegationsRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "Redelegations", data); - return promise.then((data) => QueryRedelegationsResponse.decode(new _m0.Reader(data))); + Redelegations( + request: QueryRedelegationsRequest, + ): Promise { + const data = QueryRedelegationsRequest.encode(request).finish() + const promise = this.rpc.request( + "cosmos.staking.v1beta1.Query", + "Redelegations", + data, + ) + return promise.then((data) => + QueryRedelegationsResponse.decode(new _m0.Reader(data)), + ) } - DelegatorValidators(request: QueryDelegatorValidatorsRequest): Promise { - const data = QueryDelegatorValidatorsRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "DelegatorValidators", data); - return promise.then((data) => QueryDelegatorValidatorsResponse.decode(new _m0.Reader(data))); + DelegatorValidators( + request: QueryDelegatorValidatorsRequest, + ): Promise { + const data = QueryDelegatorValidatorsRequest.encode(request).finish() + const promise = this.rpc.request( + "cosmos.staking.v1beta1.Query", + "DelegatorValidators", + data, + ) + return promise.then((data) => + QueryDelegatorValidatorsResponse.decode(new _m0.Reader(data)), + ) } - DelegatorValidator(request: QueryDelegatorValidatorRequest): Promise { - const data = QueryDelegatorValidatorRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "DelegatorValidator", data); - return promise.then((data) => QueryDelegatorValidatorResponse.decode(new _m0.Reader(data))); + DelegatorValidator( + request: QueryDelegatorValidatorRequest, + ): Promise { + const data = QueryDelegatorValidatorRequest.encode(request).finish() + const promise = this.rpc.request( + "cosmos.staking.v1beta1.Query", + "DelegatorValidator", + data, + ) + return promise.then((data) => + QueryDelegatorValidatorResponse.decode(new _m0.Reader(data)), + ) } - HistoricalInfo(request: QueryHistoricalInfoRequest): Promise { - const data = QueryHistoricalInfoRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "HistoricalInfo", data); - return promise.then((data) => QueryHistoricalInfoResponse.decode(new _m0.Reader(data))); + HistoricalInfo( + request: QueryHistoricalInfoRequest, + ): Promise { + const data = QueryHistoricalInfoRequest.encode(request).finish() + const promise = this.rpc.request( + "cosmos.staking.v1beta1.Query", + "HistoricalInfo", + data, + ) + return promise.then((data) => + QueryHistoricalInfoResponse.decode(new _m0.Reader(data)), + ) } Pool(request: QueryPoolRequest): Promise { - const data = QueryPoolRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "Pool", data); - return promise.then((data) => QueryPoolResponse.decode(new _m0.Reader(data))); + const data = QueryPoolRequest.encode(request).finish() + const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "Pool", data) + return promise.then((data) => QueryPoolResponse.decode(new _m0.Reader(data))) } Params(request: QueryParamsRequest): Promise { - const data = QueryParamsRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "Params", data); - return promise.then((data) => QueryParamsResponse.decode(new _m0.Reader(data))); + const data = QueryParamsRequest.encode(request).finish() + const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "Params", data) + return promise.then((data) => QueryParamsResponse.decode(new _m0.Reader(data))) } } interface Rpc { - request(service: string, method: string, data: Uint8Array): Promise; + request(service: string, method: string, data: Uint8Array): Promise } -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/cosmos/staking/v1beta1/staking.ts b/packages/protojs/src/cosmos/staking/v1beta1/staking.ts index f1720933..a0383793 100644 --- a/packages/protojs/src/cosmos/staking/v1beta1/staking.ts +++ b/packages/protojs/src/cosmos/staking/v1beta1/staking.ts @@ -1,13 +1,13 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { Any } from "../../../google/protobuf/any"; -import { Duration } from "../../../google/protobuf/duration"; -import { Timestamp } from "../../../google/protobuf/timestamp"; -import { Header } from "../../../tendermint/types/types"; -import { Coin } from "../../base/v1beta1/coin"; +import { Header } from "../../../tendermint/types/types" +import { Any } from "../../../google/protobuf/any" +import { Duration } from "../../../google/protobuf/duration" +import { Coin } from "../../base/v1beta1/coin" +import { Timestamp } from "../../../google/protobuf/timestamp" +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "cosmos.staking.v1beta1"; +export const protobufPackage = "cosmos.staking.v1beta1" /** BondStatus is the status of a validator. */ export enum BondStatus { @@ -26,36 +26,36 @@ export function bondStatusFromJSON(object: any): BondStatus { switch (object) { case 0: case "BOND_STATUS_UNSPECIFIED": - return BondStatus.BOND_STATUS_UNSPECIFIED; + return BondStatus.BOND_STATUS_UNSPECIFIED case 1: case "BOND_STATUS_UNBONDED": - return BondStatus.BOND_STATUS_UNBONDED; + return BondStatus.BOND_STATUS_UNBONDED case 2: case "BOND_STATUS_UNBONDING": - return BondStatus.BOND_STATUS_UNBONDING; + return BondStatus.BOND_STATUS_UNBONDING case 3: case "BOND_STATUS_BONDED": - return BondStatus.BOND_STATUS_BONDED; + return BondStatus.BOND_STATUS_BONDED case -1: case "UNRECOGNIZED": default: - return BondStatus.UNRECOGNIZED; + return BondStatus.UNRECOGNIZED } } export function bondStatusToJSON(object: BondStatus): string { switch (object) { case BondStatus.BOND_STATUS_UNSPECIFIED: - return "BOND_STATUS_UNSPECIFIED"; + return "BOND_STATUS_UNSPECIFIED" case BondStatus.BOND_STATUS_UNBONDED: - return "BOND_STATUS_UNBONDED"; + return "BOND_STATUS_UNBONDED" case BondStatus.BOND_STATUS_UNBONDING: - return "BOND_STATUS_UNBONDING"; + return "BOND_STATUS_UNBONDING" case BondStatus.BOND_STATUS_BONDED: - return "BOND_STATUS_BONDED"; + return "BOND_STATUS_BONDED" case BondStatus.UNRECOGNIZED: default: - return "UNRECOGNIZED"; + return "UNRECOGNIZED" } } @@ -66,8 +66,8 @@ export function bondStatusToJSON(object: BondStatus): string { * (`n` is set by the staking module's `historical_entries` parameter). */ export interface HistoricalInfo { - header?: Header; - valset: Validator[]; + header?: Header + valset: Validator[] } /** @@ -76,33 +76,33 @@ export interface HistoricalInfo { */ export interface CommissionRates { /** rate is the commission rate charged to delegators, as a fraction. */ - rate: string; + rate: string /** max_rate defines the maximum commission rate which validator can ever charge, as a fraction. */ - maxRate: string; + maxRate: string /** max_change_rate defines the maximum daily increase of the validator commission, as a fraction. */ - maxChangeRate: string; + maxChangeRate: string } /** Commission defines commission parameters for a given validator. */ export interface Commission { /** commission_rates defines the initial commission rates to be used for creating a validator. */ - commissionRates?: CommissionRates; + commissionRates?: CommissionRates /** update_time is the last time the commission rate was changed. */ - updateTime?: Date; + updateTime?: Date } /** Description defines a validator description. */ export interface Description { /** moniker defines a human-readable name for the validator. */ - moniker: string; + moniker: string /** identity defines an optional identity signature (ex. UPort or Keybase). */ - identity: string; + identity: string /** website defines an optional website link. */ - website: string; + website: string /** security_contact defines an optional email for security contact. */ - securityContact: string; + securityContact: string /** details define other optional details. */ - details: string; + details: string } /** @@ -117,32 +117,32 @@ export interface Description { */ export interface Validator { /** operator_address defines the address of the validator's operator; bech encoded in JSON. */ - operatorAddress: string; + operatorAddress: string /** consensus_pubkey is the consensus public key of the validator, as a Protobuf Any. */ - consensusPubkey?: Any; + consensusPubkey?: Any /** jailed defined whether the validator has been jailed from bonded status or not. */ - jailed: boolean; + jailed: boolean /** status is the validator status (bonded/unbonding/unbonded). */ - status: BondStatus; + status: BondStatus /** tokens define the delegated tokens (incl. self-delegation). */ - tokens: string; + tokens: string /** delegator_shares defines total shares issued to a validator's delegators. */ - delegatorShares: string; + delegatorShares: string /** description defines the description terms for the validator. */ - description?: Description; + description?: Description /** unbonding_height defines, if unbonding, the height at which this validator has begun unbonding. */ - unbondingHeight: Long; + unbondingHeight: Long /** unbonding_time defines, if unbonding, the min time for the validator to complete unbonding. */ - unbondingTime?: Date; + unbondingTime?: Date /** commission defines the commission parameters. */ - commission?: Commission; + commission?: Commission /** min_self_delegation is the validator's self declared minimum self delegation. */ - minSelfDelegation: string; + minSelfDelegation: string } /** ValAddresses defines a repeated set of validator addresses. */ export interface ValAddresses { - addresses: string[]; + addresses: string[] } /** @@ -151,13 +151,13 @@ export interface ValAddresses { * be used to construct the key to getting an UnbondingDelegation from state. */ export interface DVPair { - delegatorAddress: string; - validatorAddress: string; + delegatorAddress: string + validatorAddress: string } /** DVPairs defines an array of DVPair objects. */ export interface DVPairs { - pairs: DVPair[]; + pairs: DVPair[] } /** @@ -167,14 +167,14 @@ export interface DVPairs { * Redelegation from state. */ export interface DVVTriplet { - delegatorAddress: string; - validatorSrcAddress: string; - validatorDstAddress: string; + delegatorAddress: string + validatorSrcAddress: string + validatorDstAddress: string } /** DVVTriplets defines an array of DVVTriplet objects. */ export interface DVVTriplets { - triplets: DVVTriplet[]; + triplets: DVVTriplet[] } /** @@ -184,11 +184,11 @@ export interface DVVTriplets { */ export interface Delegation { /** delegator_address is the bech32-encoded address of the delegator. */ - delegatorAddress: string; + delegatorAddress: string /** validator_address is the bech32-encoded address of the validator. */ - validatorAddress: string; + validatorAddress: string /** shares define the delegation shares received. */ - shares: string; + shares: string } /** @@ -197,35 +197,35 @@ export interface Delegation { */ export interface UnbondingDelegation { /** delegator_address is the bech32-encoded address of the delegator. */ - delegatorAddress: string; + delegatorAddress: string /** validator_address is the bech32-encoded address of the validator. */ - validatorAddress: string; + validatorAddress: string /** entries are the unbonding delegation entries. */ - entries: UnbondingDelegationEntry[]; + entries: UnbondingDelegationEntry[] } /** UnbondingDelegationEntry defines an unbonding object with relevant metadata. */ export interface UnbondingDelegationEntry { /** creation_height is the height which the unbonding took place. */ - creationHeight: Long; + creationHeight: Long /** completion_time is the unix time for unbonding completion. */ - completionTime?: Date; + completionTime?: Date /** initial_balance defines the tokens initially scheduled to receive at completion. */ - initialBalance: string; + initialBalance: string /** balance defines the tokens to receive at completion. */ - balance: string; + balance: string } /** RedelegationEntry defines a redelegation object with relevant metadata. */ export interface RedelegationEntry { /** creation_height defines the height which the redelegation took place. */ - creationHeight: Long; + creationHeight: Long /** completion_time defines the unix time for redelegation completion. */ - completionTime?: Date; + completionTime?: Date /** initial_balance defines the initial balance when redelegation started. */ - initialBalance: string; + initialBalance: string /** shares_dst is the amount of destination-validator shares created by redelegation. */ - sharesDst: string; + sharesDst: string } /** @@ -234,27 +234,27 @@ export interface RedelegationEntry { */ export interface Redelegation { /** delegator_address is the bech32-encoded address of the delegator. */ - delegatorAddress: string; + delegatorAddress: string /** validator_src_address is the validator redelegation source operator address. */ - validatorSrcAddress: string; + validatorSrcAddress: string /** validator_dst_address is the validator redelegation destination operator address. */ - validatorDstAddress: string; + validatorDstAddress: string /** entries are the redelegation entries. */ - entries: RedelegationEntry[]; + entries: RedelegationEntry[] } /** Params defines the parameters for the staking module. */ export interface Params { /** unbonding_time is the time duration of unbonding. */ - unbondingTime?: Duration; + unbondingTime?: Duration /** max_validators is the maximum number of validators. */ - maxValidators: number; + maxValidators: number /** max_entries is the max entries for either unbonding delegation or redelegation (per pair/trio). */ - maxEntries: number; + maxEntries: number /** historical_entries is the number of historical entries to persist. */ - historicalEntries: number; + historicalEntries: number /** bond_denom defines the bondable coin denomination. */ - bondDenom: string; + bondDenom: string } /** @@ -262,8 +262,8 @@ export interface Params { * balance in addition to shares which is more suitable for client responses. */ export interface DelegationResponse { - delegation?: Delegation; - balance?: Coin; + delegation?: Delegation + balance?: Coin } /** @@ -272,8 +272,8 @@ export interface DelegationResponse { * responses. */ export interface RedelegationEntryResponse { - redelegationEntry?: RedelegationEntry; - balance: string; + redelegationEntry?: RedelegationEntry + balance: string } /** @@ -282,8 +282,8 @@ export interface RedelegationEntryResponse { * responses. */ export interface RedelegationResponse { - redelegation?: Redelegation; - entries: RedelegationEntryResponse[]; + redelegation?: Redelegation + entries: RedelegationEntryResponse[] } /** @@ -291,114 +291,126 @@ export interface RedelegationResponse { * denomination. */ export interface Pool { - notBondedTokens: string; - bondedTokens: string; + notBondedTokens: string + bondedTokens: string } function createBaseHistoricalInfo(): HistoricalInfo { - return { header: undefined, valset: [] }; + return { header: undefined, valset: [] } } export const HistoricalInfo = { - encode(message: HistoricalInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: HistoricalInfo, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.header !== undefined) { - Header.encode(message.header, writer.uint32(10).fork()).ldelim(); + Header.encode(message.header, writer.uint32(10).fork()).ldelim() } for (const v of message.valset) { - Validator.encode(v!, writer.uint32(18).fork()).ldelim(); + Validator.encode(v!, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): HistoricalInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseHistoricalInfo(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseHistoricalInfo() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.header = Header.decode(reader, reader.uint32()); - break; + message.header = Header.decode(reader, reader.uint32()) + break case 2: - message.valset.push(Validator.decode(reader, reader.uint32())); - break; + message.valset.push(Validator.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): HistoricalInfo { return { header: isSet(object.header) ? Header.fromJSON(object.header) : undefined, - valset: Array.isArray(object?.valset) ? object.valset.map((e: any) => Validator.fromJSON(e)) : [], - }; + valset: Array.isArray(object?.valset) + ? object.valset.map((e: any) => Validator.fromJSON(e)) + : [], + } }, toJSON(message: HistoricalInfo): unknown { - const obj: any = {}; - message.header !== undefined && (obj.header = message.header ? Header.toJSON(message.header) : undefined); + const obj: any = {} + message.header !== undefined && + (obj.header = message.header ? Header.toJSON(message.header) : undefined) if (message.valset) { - obj.valset = message.valset.map((e) => e ? Validator.toJSON(e) : undefined); + obj.valset = message.valset.map((e) => (e ? Validator.toJSON(e) : undefined)) } else { - obj.valset = []; + obj.valset = [] } - return obj; + return obj }, - fromPartial, I>>(object: I): HistoricalInfo { - const message = createBaseHistoricalInfo(); - message.header = (object.header !== undefined && object.header !== null) - ? Header.fromPartial(object.header) - : undefined; - message.valset = object.valset?.map((e) => Validator.fromPartial(e)) || []; - return message; + fromPartial, I>>( + object: I, + ): HistoricalInfo { + const message = createBaseHistoricalInfo() + message.header = + object.header !== undefined && object.header !== null + ? Header.fromPartial(object.header) + : undefined + message.valset = object.valset?.map((e) => Validator.fromPartial(e)) || [] + return message }, -}; +} function createBaseCommissionRates(): CommissionRates { - return { rate: "", maxRate: "", maxChangeRate: "" }; + return { rate: "", maxRate: "", maxChangeRate: "" } } export const CommissionRates = { - encode(message: CommissionRates, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: CommissionRates, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.rate !== "") { - writer.uint32(10).string(message.rate); + writer.uint32(10).string(message.rate) } if (message.maxRate !== "") { - writer.uint32(18).string(message.maxRate); + writer.uint32(18).string(message.maxRate) } if (message.maxChangeRate !== "") { - writer.uint32(26).string(message.maxChangeRate); + writer.uint32(26).string(message.maxChangeRate) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): CommissionRates { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseCommissionRates(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseCommissionRates() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.rate = reader.string(); - break; + message.rate = reader.string() + break case 2: - message.maxRate = reader.string(); - break; + message.maxRate = reader.string() + break case 3: - message.maxChangeRate = reader.string(); - break; + message.maxChangeRate = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): CommissionRates { @@ -406,139 +418,152 @@ export const CommissionRates = { rate: isSet(object.rate) ? String(object.rate) : "", maxRate: isSet(object.maxRate) ? String(object.maxRate) : "", maxChangeRate: isSet(object.maxChangeRate) ? String(object.maxChangeRate) : "", - }; + } }, toJSON(message: CommissionRates): unknown { - const obj: any = {}; - message.rate !== undefined && (obj.rate = message.rate); - message.maxRate !== undefined && (obj.maxRate = message.maxRate); - message.maxChangeRate !== undefined && (obj.maxChangeRate = message.maxChangeRate); - return obj; - }, - - fromPartial, I>>(object: I): CommissionRates { - const message = createBaseCommissionRates(); - message.rate = object.rate ?? ""; - message.maxRate = object.maxRate ?? ""; - message.maxChangeRate = object.maxChangeRate ?? ""; - return message; + const obj: any = {} + message.rate !== undefined && (obj.rate = message.rate) + message.maxRate !== undefined && (obj.maxRate = message.maxRate) + message.maxChangeRate !== undefined && (obj.maxChangeRate = message.maxChangeRate) + return obj + }, + + fromPartial, I>>( + object: I, + ): CommissionRates { + const message = createBaseCommissionRates() + message.rate = object.rate ?? "" + message.maxRate = object.maxRate ?? "" + message.maxChangeRate = object.maxChangeRate ?? "" + return message }, -}; +} function createBaseCommission(): Commission { - return { commissionRates: undefined, updateTime: undefined }; + return { commissionRates: undefined, updateTime: undefined } } export const Commission = { encode(message: Commission, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.commissionRates !== undefined) { - CommissionRates.encode(message.commissionRates, writer.uint32(10).fork()).ldelim(); + CommissionRates.encode(message.commissionRates, writer.uint32(10).fork()).ldelim() } if (message.updateTime !== undefined) { - Timestamp.encode(toTimestamp(message.updateTime), writer.uint32(18).fork()).ldelim(); + Timestamp.encode( + toTimestamp(message.updateTime), + writer.uint32(18).fork(), + ).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Commission { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseCommission(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseCommission() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.commissionRates = CommissionRates.decode(reader, reader.uint32()); - break; + message.commissionRates = CommissionRates.decode(reader, reader.uint32()) + break case 2: - message.updateTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); - break; + message.updateTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Commission { return { - commissionRates: isSet(object.commissionRates) ? CommissionRates.fromJSON(object.commissionRates) : undefined, - updateTime: isSet(object.updateTime) ? fromJsonTimestamp(object.updateTime) : undefined, - }; + commissionRates: isSet(object.commissionRates) + ? CommissionRates.fromJSON(object.commissionRates) + : undefined, + updateTime: isSet(object.updateTime) + ? fromJsonTimestamp(object.updateTime) + : undefined, + } }, toJSON(message: Commission): unknown { - const obj: any = {}; + const obj: any = {} message.commissionRates !== undefined && - (obj.commissionRates = message.commissionRates ? CommissionRates.toJSON(message.commissionRates) : undefined); - message.updateTime !== undefined && (obj.updateTime = message.updateTime.toISOString()); - return obj; + (obj.commissionRates = message.commissionRates + ? CommissionRates.toJSON(message.commissionRates) + : undefined) + message.updateTime !== undefined && + (obj.updateTime = message.updateTime.toISOString()) + return obj }, fromPartial, I>>(object: I): Commission { - const message = createBaseCommission(); - message.commissionRates = (object.commissionRates !== undefined && object.commissionRates !== null) - ? CommissionRates.fromPartial(object.commissionRates) - : undefined; - message.updateTime = object.updateTime ?? undefined; - return message; + const message = createBaseCommission() + message.commissionRates = + object.commissionRates !== undefined && object.commissionRates !== null + ? CommissionRates.fromPartial(object.commissionRates) + : undefined + message.updateTime = object.updateTime ?? undefined + return message }, -}; +} function createBaseDescription(): Description { - return { moniker: "", identity: "", website: "", securityContact: "", details: "" }; + return { moniker: "", identity: "", website: "", securityContact: "", details: "" } } export const Description = { encode(message: Description, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.moniker !== "") { - writer.uint32(10).string(message.moniker); + writer.uint32(10).string(message.moniker) } if (message.identity !== "") { - writer.uint32(18).string(message.identity); + writer.uint32(18).string(message.identity) } if (message.website !== "") { - writer.uint32(26).string(message.website); + writer.uint32(26).string(message.website) } if (message.securityContact !== "") { - writer.uint32(34).string(message.securityContact); + writer.uint32(34).string(message.securityContact) } if (message.details !== "") { - writer.uint32(42).string(message.details); + writer.uint32(42).string(message.details) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Description { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDescription(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseDescription() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.moniker = reader.string(); - break; + message.moniker = reader.string() + break case 2: - message.identity = reader.string(); - break; + message.identity = reader.string() + break case 3: - message.website = reader.string(); - break; + message.website = reader.string() + break case 4: - message.securityContact = reader.string(); - break; + message.securityContact = reader.string() + break case 5: - message.details = reader.string(); - break; + message.details = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Description { @@ -546,31 +571,34 @@ export const Description = { moniker: isSet(object.moniker) ? String(object.moniker) : "", identity: isSet(object.identity) ? String(object.identity) : "", website: isSet(object.website) ? String(object.website) : "", - securityContact: isSet(object.securityContact) ? String(object.securityContact) : "", + securityContact: isSet(object.securityContact) + ? String(object.securityContact) + : "", details: isSet(object.details) ? String(object.details) : "", - }; + } }, toJSON(message: Description): unknown { - const obj: any = {}; - message.moniker !== undefined && (obj.moniker = message.moniker); - message.identity !== undefined && (obj.identity = message.identity); - message.website !== undefined && (obj.website = message.website); - message.securityContact !== undefined && (obj.securityContact = message.securityContact); - message.details !== undefined && (obj.details = message.details); - return obj; + const obj: any = {} + message.moniker !== undefined && (obj.moniker = message.moniker) + message.identity !== undefined && (obj.identity = message.identity) + message.website !== undefined && (obj.website = message.website) + message.securityContact !== undefined && + (obj.securityContact = message.securityContact) + message.details !== undefined && (obj.details = message.details) + return obj }, fromPartial, I>>(object: I): Description { - const message = createBaseDescription(); - message.moniker = object.moniker ?? ""; - message.identity = object.identity ?? ""; - message.website = object.website ?? ""; - message.securityContact = object.securityContact ?? ""; - message.details = object.details ?? ""; - return message; + const message = createBaseDescription() + message.moniker = object.moniker ?? "" + message.identity = object.identity ?? "" + message.website = object.website ?? "" + message.securityContact = object.securityContact ?? "" + message.details = object.details ?? "" + return message }, -}; +} function createBaseValidator(): Validator { return { @@ -585,994 +613,1175 @@ function createBaseValidator(): Validator { unbondingTime: undefined, commission: undefined, minSelfDelegation: "", - }; + } } export const Validator = { encode(message: Validator, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.operatorAddress !== "") { - writer.uint32(10).string(message.operatorAddress); + writer.uint32(10).string(message.operatorAddress) } if (message.consensusPubkey !== undefined) { - Any.encode(message.consensusPubkey, writer.uint32(18).fork()).ldelim(); + Any.encode(message.consensusPubkey, writer.uint32(18).fork()).ldelim() } if (message.jailed === true) { - writer.uint32(24).bool(message.jailed); + writer.uint32(24).bool(message.jailed) } if (message.status !== 0) { - writer.uint32(32).int32(message.status); + writer.uint32(32).int32(message.status) } if (message.tokens !== "") { - writer.uint32(42).string(message.tokens); + writer.uint32(42).string(message.tokens) } if (message.delegatorShares !== "") { - writer.uint32(50).string(message.delegatorShares); + writer.uint32(50).string(message.delegatorShares) } if (message.description !== undefined) { - Description.encode(message.description, writer.uint32(58).fork()).ldelim(); + Description.encode(message.description, writer.uint32(58).fork()).ldelim() } if (!message.unbondingHeight.isZero()) { - writer.uint32(64).int64(message.unbondingHeight); + writer.uint32(64).int64(message.unbondingHeight) } if (message.unbondingTime !== undefined) { - Timestamp.encode(toTimestamp(message.unbondingTime), writer.uint32(74).fork()).ldelim(); + Timestamp.encode( + toTimestamp(message.unbondingTime), + writer.uint32(74).fork(), + ).ldelim() } if (message.commission !== undefined) { - Commission.encode(message.commission, writer.uint32(82).fork()).ldelim(); + Commission.encode(message.commission, writer.uint32(82).fork()).ldelim() } if (message.minSelfDelegation !== "") { - writer.uint32(90).string(message.minSelfDelegation); + writer.uint32(90).string(message.minSelfDelegation) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Validator { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseValidator(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseValidator() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.operatorAddress = reader.string(); - break; + message.operatorAddress = reader.string() + break case 2: - message.consensusPubkey = Any.decode(reader, reader.uint32()); - break; + message.consensusPubkey = Any.decode(reader, reader.uint32()) + break case 3: - message.jailed = reader.bool(); - break; + message.jailed = reader.bool() + break case 4: - message.status = reader.int32() as any; - break; + message.status = reader.int32() as any + break case 5: - message.tokens = reader.string(); - break; + message.tokens = reader.string() + break case 6: - message.delegatorShares = reader.string(); - break; + message.delegatorShares = reader.string() + break case 7: - message.description = Description.decode(reader, reader.uint32()); - break; + message.description = Description.decode(reader, reader.uint32()) + break case 8: - message.unbondingHeight = reader.int64() as Long; - break; + message.unbondingHeight = reader.int64() as Long + break case 9: - message.unbondingTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); - break; + message.unbondingTime = fromTimestamp( + Timestamp.decode(reader, reader.uint32()), + ) + break case 10: - message.commission = Commission.decode(reader, reader.uint32()); - break; + message.commission = Commission.decode(reader, reader.uint32()) + break case 11: - message.minSelfDelegation = reader.string(); - break; + message.minSelfDelegation = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Validator { return { - operatorAddress: isSet(object.operatorAddress) ? String(object.operatorAddress) : "", - consensusPubkey: isSet(object.consensusPubkey) ? Any.fromJSON(object.consensusPubkey) : undefined, + operatorAddress: isSet(object.operatorAddress) + ? String(object.operatorAddress) + : "", + consensusPubkey: isSet(object.consensusPubkey) + ? Any.fromJSON(object.consensusPubkey) + : undefined, jailed: isSet(object.jailed) ? Boolean(object.jailed) : false, status: isSet(object.status) ? bondStatusFromJSON(object.status) : 0, tokens: isSet(object.tokens) ? String(object.tokens) : "", - delegatorShares: isSet(object.delegatorShares) ? String(object.delegatorShares) : "", - description: isSet(object.description) ? Description.fromJSON(object.description) : undefined, - unbondingHeight: isSet(object.unbondingHeight) ? Long.fromValue(object.unbondingHeight) : Long.ZERO, - unbondingTime: isSet(object.unbondingTime) ? fromJsonTimestamp(object.unbondingTime) : undefined, - commission: isSet(object.commission) ? Commission.fromJSON(object.commission) : undefined, - minSelfDelegation: isSet(object.minSelfDelegation) ? String(object.minSelfDelegation) : "", - }; + delegatorShares: isSet(object.delegatorShares) + ? String(object.delegatorShares) + : "", + description: isSet(object.description) + ? Description.fromJSON(object.description) + : undefined, + unbondingHeight: isSet(object.unbondingHeight) + ? Long.fromValue(object.unbondingHeight) + : Long.ZERO, + unbondingTime: isSet(object.unbondingTime) + ? fromJsonTimestamp(object.unbondingTime) + : undefined, + commission: isSet(object.commission) + ? Commission.fromJSON(object.commission) + : undefined, + minSelfDelegation: isSet(object.minSelfDelegation) + ? String(object.minSelfDelegation) + : "", + } }, toJSON(message: Validator): unknown { - const obj: any = {}; - message.operatorAddress !== undefined && (obj.operatorAddress = message.operatorAddress); + const obj: any = {} + message.operatorAddress !== undefined && + (obj.operatorAddress = message.operatorAddress) message.consensusPubkey !== undefined && - (obj.consensusPubkey = message.consensusPubkey ? Any.toJSON(message.consensusPubkey) : undefined); - message.jailed !== undefined && (obj.jailed = message.jailed); - message.status !== undefined && (obj.status = bondStatusToJSON(message.status)); - message.tokens !== undefined && (obj.tokens = message.tokens); - message.delegatorShares !== undefined && (obj.delegatorShares = message.delegatorShares); + (obj.consensusPubkey = message.consensusPubkey + ? Any.toJSON(message.consensusPubkey) + : undefined) + message.jailed !== undefined && (obj.jailed = message.jailed) + message.status !== undefined && (obj.status = bondStatusToJSON(message.status)) + message.tokens !== undefined && (obj.tokens = message.tokens) + message.delegatorShares !== undefined && + (obj.delegatorShares = message.delegatorShares) message.description !== undefined && - (obj.description = message.description ? Description.toJSON(message.description) : undefined); - message.unbondingHeight !== undefined && (obj.unbondingHeight = (message.unbondingHeight || Long.ZERO).toString()); - message.unbondingTime !== undefined && (obj.unbondingTime = message.unbondingTime.toISOString()); + (obj.description = message.description + ? Description.toJSON(message.description) + : undefined) + message.unbondingHeight !== undefined && + (obj.unbondingHeight = (message.unbondingHeight || Long.ZERO).toString()) + message.unbondingTime !== undefined && + (obj.unbondingTime = message.unbondingTime.toISOString()) message.commission !== undefined && - (obj.commission = message.commission ? Commission.toJSON(message.commission) : undefined); - message.minSelfDelegation !== undefined && (obj.minSelfDelegation = message.minSelfDelegation); - return obj; + (obj.commission = message.commission + ? Commission.toJSON(message.commission) + : undefined) + message.minSelfDelegation !== undefined && + (obj.minSelfDelegation = message.minSelfDelegation) + return obj }, fromPartial, I>>(object: I): Validator { - const message = createBaseValidator(); - message.operatorAddress = object.operatorAddress ?? ""; - message.consensusPubkey = (object.consensusPubkey !== undefined && object.consensusPubkey !== null) - ? Any.fromPartial(object.consensusPubkey) - : undefined; - message.jailed = object.jailed ?? false; - message.status = object.status ?? 0; - message.tokens = object.tokens ?? ""; - message.delegatorShares = object.delegatorShares ?? ""; - message.description = (object.description !== undefined && object.description !== null) - ? Description.fromPartial(object.description) - : undefined; - message.unbondingHeight = (object.unbondingHeight !== undefined && object.unbondingHeight !== null) - ? Long.fromValue(object.unbondingHeight) - : Long.ZERO; - message.unbondingTime = object.unbondingTime ?? undefined; - message.commission = (object.commission !== undefined && object.commission !== null) - ? Commission.fromPartial(object.commission) - : undefined; - message.minSelfDelegation = object.minSelfDelegation ?? ""; - return message; - }, -}; + const message = createBaseValidator() + message.operatorAddress = object.operatorAddress ?? "" + message.consensusPubkey = + object.consensusPubkey !== undefined && object.consensusPubkey !== null + ? Any.fromPartial(object.consensusPubkey) + : undefined + message.jailed = object.jailed ?? false + message.status = object.status ?? 0 + message.tokens = object.tokens ?? "" + message.delegatorShares = object.delegatorShares ?? "" + message.description = + object.description !== undefined && object.description !== null + ? Description.fromPartial(object.description) + : undefined + message.unbondingHeight = + object.unbondingHeight !== undefined && object.unbondingHeight !== null + ? Long.fromValue(object.unbondingHeight) + : Long.ZERO + message.unbondingTime = object.unbondingTime ?? undefined + message.commission = + object.commission !== undefined && object.commission !== null + ? Commission.fromPartial(object.commission) + : undefined + message.minSelfDelegation = object.minSelfDelegation ?? "" + return message + }, +} function createBaseValAddresses(): ValAddresses { - return { addresses: [] }; + return { addresses: [] } } export const ValAddresses = { encode(message: ValAddresses, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.addresses) { - writer.uint32(10).string(v!); + writer.uint32(10).string(v!) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): ValAddresses { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseValAddresses(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseValAddresses() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.addresses.push(reader.string()); - break; + message.addresses.push(reader.string()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): ValAddresses { - return { addresses: Array.isArray(object?.addresses) ? object.addresses.map((e: any) => String(e)) : [] }; + return { + addresses: Array.isArray(object?.addresses) + ? object.addresses.map((e: any) => String(e)) + : [], + } }, toJSON(message: ValAddresses): unknown { - const obj: any = {}; + const obj: any = {} if (message.addresses) { - obj.addresses = message.addresses.map((e) => e); + obj.addresses = message.addresses.map((e) => e) } else { - obj.addresses = []; + obj.addresses = [] } - return obj; + return obj }, fromPartial, I>>(object: I): ValAddresses { - const message = createBaseValAddresses(); - message.addresses = object.addresses?.map((e) => e) || []; - return message; + const message = createBaseValAddresses() + message.addresses = object.addresses?.map((e) => e) || [] + return message }, -}; +} function createBaseDVPair(): DVPair { - return { delegatorAddress: "", validatorAddress: "" }; + return { delegatorAddress: "", validatorAddress: "" } } export const DVPair = { encode(message: DVPair, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.delegatorAddress !== "") { - writer.uint32(10).string(message.delegatorAddress); + writer.uint32(10).string(message.delegatorAddress) } if (message.validatorAddress !== "") { - writer.uint32(18).string(message.validatorAddress); + writer.uint32(18).string(message.validatorAddress) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): DVPair { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDVPair(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseDVPair() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.delegatorAddress = reader.string(); - break; + message.delegatorAddress = reader.string() + break case 2: - message.validatorAddress = reader.string(); - break; + message.validatorAddress = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): DVPair { return { - delegatorAddress: isSet(object.delegatorAddress) ? String(object.delegatorAddress) : "", - validatorAddress: isSet(object.validatorAddress) ? String(object.validatorAddress) : "", - }; + delegatorAddress: isSet(object.delegatorAddress) + ? String(object.delegatorAddress) + : "", + validatorAddress: isSet(object.validatorAddress) + ? String(object.validatorAddress) + : "", + } }, toJSON(message: DVPair): unknown { - const obj: any = {}; - message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); - message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); - return obj; + const obj: any = {} + message.delegatorAddress !== undefined && + (obj.delegatorAddress = message.delegatorAddress) + message.validatorAddress !== undefined && + (obj.validatorAddress = message.validatorAddress) + return obj }, fromPartial, I>>(object: I): DVPair { - const message = createBaseDVPair(); - message.delegatorAddress = object.delegatorAddress ?? ""; - message.validatorAddress = object.validatorAddress ?? ""; - return message; + const message = createBaseDVPair() + message.delegatorAddress = object.delegatorAddress ?? "" + message.validatorAddress = object.validatorAddress ?? "" + return message }, -}; +} function createBaseDVPairs(): DVPairs { - return { pairs: [] }; + return { pairs: [] } } export const DVPairs = { encode(message: DVPairs, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.pairs) { - DVPair.encode(v!, writer.uint32(10).fork()).ldelim(); + DVPair.encode(v!, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): DVPairs { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDVPairs(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseDVPairs() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.pairs.push(DVPair.decode(reader, reader.uint32())); - break; + message.pairs.push(DVPair.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): DVPairs { - return { pairs: Array.isArray(object?.pairs) ? object.pairs.map((e: any) => DVPair.fromJSON(e)) : [] }; + return { + pairs: Array.isArray(object?.pairs) + ? object.pairs.map((e: any) => DVPair.fromJSON(e)) + : [], + } }, toJSON(message: DVPairs): unknown { - const obj: any = {}; + const obj: any = {} if (message.pairs) { - obj.pairs = message.pairs.map((e) => e ? DVPair.toJSON(e) : undefined); + obj.pairs = message.pairs.map((e) => (e ? DVPair.toJSON(e) : undefined)) } else { - obj.pairs = []; + obj.pairs = [] } - return obj; + return obj }, fromPartial, I>>(object: I): DVPairs { - const message = createBaseDVPairs(); - message.pairs = object.pairs?.map((e) => DVPair.fromPartial(e)) || []; - return message; + const message = createBaseDVPairs() + message.pairs = object.pairs?.map((e) => DVPair.fromPartial(e)) || [] + return message }, -}; +} function createBaseDVVTriplet(): DVVTriplet { - return { delegatorAddress: "", validatorSrcAddress: "", validatorDstAddress: "" }; + return { delegatorAddress: "", validatorSrcAddress: "", validatorDstAddress: "" } } export const DVVTriplet = { encode(message: DVVTriplet, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.delegatorAddress !== "") { - writer.uint32(10).string(message.delegatorAddress); + writer.uint32(10).string(message.delegatorAddress) } if (message.validatorSrcAddress !== "") { - writer.uint32(18).string(message.validatorSrcAddress); + writer.uint32(18).string(message.validatorSrcAddress) } if (message.validatorDstAddress !== "") { - writer.uint32(26).string(message.validatorDstAddress); + writer.uint32(26).string(message.validatorDstAddress) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): DVVTriplet { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDVVTriplet(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseDVVTriplet() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.delegatorAddress = reader.string(); - break; + message.delegatorAddress = reader.string() + break case 2: - message.validatorSrcAddress = reader.string(); - break; + message.validatorSrcAddress = reader.string() + break case 3: - message.validatorDstAddress = reader.string(); - break; + message.validatorDstAddress = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): DVVTriplet { return { - delegatorAddress: isSet(object.delegatorAddress) ? String(object.delegatorAddress) : "", - validatorSrcAddress: isSet(object.validatorSrcAddress) ? String(object.validatorSrcAddress) : "", - validatorDstAddress: isSet(object.validatorDstAddress) ? String(object.validatorDstAddress) : "", - }; + delegatorAddress: isSet(object.delegatorAddress) + ? String(object.delegatorAddress) + : "", + validatorSrcAddress: isSet(object.validatorSrcAddress) + ? String(object.validatorSrcAddress) + : "", + validatorDstAddress: isSet(object.validatorDstAddress) + ? String(object.validatorDstAddress) + : "", + } }, toJSON(message: DVVTriplet): unknown { - const obj: any = {}; - message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); - message.validatorSrcAddress !== undefined && (obj.validatorSrcAddress = message.validatorSrcAddress); - message.validatorDstAddress !== undefined && (obj.validatorDstAddress = message.validatorDstAddress); - return obj; + const obj: any = {} + message.delegatorAddress !== undefined && + (obj.delegatorAddress = message.delegatorAddress) + message.validatorSrcAddress !== undefined && + (obj.validatorSrcAddress = message.validatorSrcAddress) + message.validatorDstAddress !== undefined && + (obj.validatorDstAddress = message.validatorDstAddress) + return obj }, fromPartial, I>>(object: I): DVVTriplet { - const message = createBaseDVVTriplet(); - message.delegatorAddress = object.delegatorAddress ?? ""; - message.validatorSrcAddress = object.validatorSrcAddress ?? ""; - message.validatorDstAddress = object.validatorDstAddress ?? ""; - return message; + const message = createBaseDVVTriplet() + message.delegatorAddress = object.delegatorAddress ?? "" + message.validatorSrcAddress = object.validatorSrcAddress ?? "" + message.validatorDstAddress = object.validatorDstAddress ?? "" + return message }, -}; +} function createBaseDVVTriplets(): DVVTriplets { - return { triplets: [] }; + return { triplets: [] } } export const DVVTriplets = { encode(message: DVVTriplets, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.triplets) { - DVVTriplet.encode(v!, writer.uint32(10).fork()).ldelim(); + DVVTriplet.encode(v!, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): DVVTriplets { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDVVTriplets(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseDVVTriplets() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.triplets.push(DVVTriplet.decode(reader, reader.uint32())); - break; + message.triplets.push(DVVTriplet.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): DVVTriplets { - return { triplets: Array.isArray(object?.triplets) ? object.triplets.map((e: any) => DVVTriplet.fromJSON(e)) : [] }; + return { + triplets: Array.isArray(object?.triplets) + ? object.triplets.map((e: any) => DVVTriplet.fromJSON(e)) + : [], + } }, toJSON(message: DVVTriplets): unknown { - const obj: any = {}; + const obj: any = {} if (message.triplets) { - obj.triplets = message.triplets.map((e) => e ? DVVTriplet.toJSON(e) : undefined); + obj.triplets = message.triplets.map((e) => (e ? DVVTriplet.toJSON(e) : undefined)) } else { - obj.triplets = []; + obj.triplets = [] } - return obj; + return obj }, fromPartial, I>>(object: I): DVVTriplets { - const message = createBaseDVVTriplets(); - message.triplets = object.triplets?.map((e) => DVVTriplet.fromPartial(e)) || []; - return message; + const message = createBaseDVVTriplets() + message.triplets = object.triplets?.map((e) => DVVTriplet.fromPartial(e)) || [] + return message }, -}; +} function createBaseDelegation(): Delegation { - return { delegatorAddress: "", validatorAddress: "", shares: "" }; + return { delegatorAddress: "", validatorAddress: "", shares: "" } } export const Delegation = { encode(message: Delegation, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.delegatorAddress !== "") { - writer.uint32(10).string(message.delegatorAddress); + writer.uint32(10).string(message.delegatorAddress) } if (message.validatorAddress !== "") { - writer.uint32(18).string(message.validatorAddress); + writer.uint32(18).string(message.validatorAddress) } if (message.shares !== "") { - writer.uint32(26).string(message.shares); + writer.uint32(26).string(message.shares) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Delegation { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDelegation(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseDelegation() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.delegatorAddress = reader.string(); - break; + message.delegatorAddress = reader.string() + break case 2: - message.validatorAddress = reader.string(); - break; + message.validatorAddress = reader.string() + break case 3: - message.shares = reader.string(); - break; + message.shares = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Delegation { return { - delegatorAddress: isSet(object.delegatorAddress) ? String(object.delegatorAddress) : "", - validatorAddress: isSet(object.validatorAddress) ? String(object.validatorAddress) : "", + delegatorAddress: isSet(object.delegatorAddress) + ? String(object.delegatorAddress) + : "", + validatorAddress: isSet(object.validatorAddress) + ? String(object.validatorAddress) + : "", shares: isSet(object.shares) ? String(object.shares) : "", - }; + } }, toJSON(message: Delegation): unknown { - const obj: any = {}; - message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); - message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); - message.shares !== undefined && (obj.shares = message.shares); - return obj; + const obj: any = {} + message.delegatorAddress !== undefined && + (obj.delegatorAddress = message.delegatorAddress) + message.validatorAddress !== undefined && + (obj.validatorAddress = message.validatorAddress) + message.shares !== undefined && (obj.shares = message.shares) + return obj }, fromPartial, I>>(object: I): Delegation { - const message = createBaseDelegation(); - message.delegatorAddress = object.delegatorAddress ?? ""; - message.validatorAddress = object.validatorAddress ?? ""; - message.shares = object.shares ?? ""; - return message; + const message = createBaseDelegation() + message.delegatorAddress = object.delegatorAddress ?? "" + message.validatorAddress = object.validatorAddress ?? "" + message.shares = object.shares ?? "" + return message }, -}; +} function createBaseUnbondingDelegation(): UnbondingDelegation { - return { delegatorAddress: "", validatorAddress: "", entries: [] }; + return { delegatorAddress: "", validatorAddress: "", entries: [] } } export const UnbondingDelegation = { - encode(message: UnbondingDelegation, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: UnbondingDelegation, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.delegatorAddress !== "") { - writer.uint32(10).string(message.delegatorAddress); + writer.uint32(10).string(message.delegatorAddress) } if (message.validatorAddress !== "") { - writer.uint32(18).string(message.validatorAddress); + writer.uint32(18).string(message.validatorAddress) } for (const v of message.entries) { - UnbondingDelegationEntry.encode(v!, writer.uint32(26).fork()).ldelim(); + UnbondingDelegationEntry.encode(v!, writer.uint32(26).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): UnbondingDelegation { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseUnbondingDelegation(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseUnbondingDelegation() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.delegatorAddress = reader.string(); - break; + message.delegatorAddress = reader.string() + break case 2: - message.validatorAddress = reader.string(); - break; + message.validatorAddress = reader.string() + break case 3: - message.entries.push(UnbondingDelegationEntry.decode(reader, reader.uint32())); - break; + message.entries.push(UnbondingDelegationEntry.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): UnbondingDelegation { return { - delegatorAddress: isSet(object.delegatorAddress) ? String(object.delegatorAddress) : "", - validatorAddress: isSet(object.validatorAddress) ? String(object.validatorAddress) : "", + delegatorAddress: isSet(object.delegatorAddress) + ? String(object.delegatorAddress) + : "", + validatorAddress: isSet(object.validatorAddress) + ? String(object.validatorAddress) + : "", entries: Array.isArray(object?.entries) ? object.entries.map((e: any) => UnbondingDelegationEntry.fromJSON(e)) : [], - }; + } }, toJSON(message: UnbondingDelegation): unknown { - const obj: any = {}; - message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); - message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); + const obj: any = {} + message.delegatorAddress !== undefined && + (obj.delegatorAddress = message.delegatorAddress) + message.validatorAddress !== undefined && + (obj.validatorAddress = message.validatorAddress) if (message.entries) { - obj.entries = message.entries.map((e) => e ? UnbondingDelegationEntry.toJSON(e) : undefined); + obj.entries = message.entries.map((e) => + e ? UnbondingDelegationEntry.toJSON(e) : undefined, + ) } else { - obj.entries = []; + obj.entries = [] } - return obj; + return obj }, - fromPartial, I>>(object: I): UnbondingDelegation { - const message = createBaseUnbondingDelegation(); - message.delegatorAddress = object.delegatorAddress ?? ""; - message.validatorAddress = object.validatorAddress ?? ""; - message.entries = object.entries?.map((e) => UnbondingDelegationEntry.fromPartial(e)) || []; - return message; + fromPartial, I>>( + object: I, + ): UnbondingDelegation { + const message = createBaseUnbondingDelegation() + message.delegatorAddress = object.delegatorAddress ?? "" + message.validatorAddress = object.validatorAddress ?? "" + message.entries = + object.entries?.map((e) => UnbondingDelegationEntry.fromPartial(e)) || [] + return message }, -}; +} function createBaseUnbondingDelegationEntry(): UnbondingDelegationEntry { - return { creationHeight: Long.ZERO, completionTime: undefined, initialBalance: "", balance: "" }; + return { + creationHeight: Long.ZERO, + completionTime: undefined, + initialBalance: "", + balance: "", + } } export const UnbondingDelegationEntry = { - encode(message: UnbondingDelegationEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: UnbondingDelegationEntry, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (!message.creationHeight.isZero()) { - writer.uint32(8).int64(message.creationHeight); + writer.uint32(8).int64(message.creationHeight) } if (message.completionTime !== undefined) { - Timestamp.encode(toTimestamp(message.completionTime), writer.uint32(18).fork()).ldelim(); + Timestamp.encode( + toTimestamp(message.completionTime), + writer.uint32(18).fork(), + ).ldelim() } if (message.initialBalance !== "") { - writer.uint32(26).string(message.initialBalance); + writer.uint32(26).string(message.initialBalance) } if (message.balance !== "") { - writer.uint32(34).string(message.balance); + writer.uint32(34).string(message.balance) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): UnbondingDelegationEntry { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseUnbondingDelegationEntry(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseUnbondingDelegationEntry() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.creationHeight = reader.int64() as Long; - break; + message.creationHeight = reader.int64() as Long + break case 2: - message.completionTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); - break; + message.completionTime = fromTimestamp( + Timestamp.decode(reader, reader.uint32()), + ) + break case 3: - message.initialBalance = reader.string(); - break; + message.initialBalance = reader.string() + break case 4: - message.balance = reader.string(); - break; + message.balance = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): UnbondingDelegationEntry { return { - creationHeight: isSet(object.creationHeight) ? Long.fromValue(object.creationHeight) : Long.ZERO, - completionTime: isSet(object.completionTime) ? fromJsonTimestamp(object.completionTime) : undefined, + creationHeight: isSet(object.creationHeight) + ? Long.fromValue(object.creationHeight) + : Long.ZERO, + completionTime: isSet(object.completionTime) + ? fromJsonTimestamp(object.completionTime) + : undefined, initialBalance: isSet(object.initialBalance) ? String(object.initialBalance) : "", balance: isSet(object.balance) ? String(object.balance) : "", - }; + } }, toJSON(message: UnbondingDelegationEntry): unknown { - const obj: any = {}; - message.creationHeight !== undefined && (obj.creationHeight = (message.creationHeight || Long.ZERO).toString()); - message.completionTime !== undefined && (obj.completionTime = message.completionTime.toISOString()); - message.initialBalance !== undefined && (obj.initialBalance = message.initialBalance); - message.balance !== undefined && (obj.balance = message.balance); - return obj; - }, - - fromPartial, I>>(object: I): UnbondingDelegationEntry { - const message = createBaseUnbondingDelegationEntry(); - message.creationHeight = (object.creationHeight !== undefined && object.creationHeight !== null) - ? Long.fromValue(object.creationHeight) - : Long.ZERO; - message.completionTime = object.completionTime ?? undefined; - message.initialBalance = object.initialBalance ?? ""; - message.balance = object.balance ?? ""; - return message; - }, -}; + const obj: any = {} + message.creationHeight !== undefined && + (obj.creationHeight = (message.creationHeight || Long.ZERO).toString()) + message.completionTime !== undefined && + (obj.completionTime = message.completionTime.toISOString()) + message.initialBalance !== undefined && + (obj.initialBalance = message.initialBalance) + message.balance !== undefined && (obj.balance = message.balance) + return obj + }, + + fromPartial, I>>( + object: I, + ): UnbondingDelegationEntry { + const message = createBaseUnbondingDelegationEntry() + message.creationHeight = + object.creationHeight !== undefined && object.creationHeight !== null + ? Long.fromValue(object.creationHeight) + : Long.ZERO + message.completionTime = object.completionTime ?? undefined + message.initialBalance = object.initialBalance ?? "" + message.balance = object.balance ?? "" + return message + }, +} function createBaseRedelegationEntry(): RedelegationEntry { - return { creationHeight: Long.ZERO, completionTime: undefined, initialBalance: "", sharesDst: "" }; + return { + creationHeight: Long.ZERO, + completionTime: undefined, + initialBalance: "", + sharesDst: "", + } } export const RedelegationEntry = { - encode(message: RedelegationEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: RedelegationEntry, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (!message.creationHeight.isZero()) { - writer.uint32(8).int64(message.creationHeight); + writer.uint32(8).int64(message.creationHeight) } if (message.completionTime !== undefined) { - Timestamp.encode(toTimestamp(message.completionTime), writer.uint32(18).fork()).ldelim(); + Timestamp.encode( + toTimestamp(message.completionTime), + writer.uint32(18).fork(), + ).ldelim() } if (message.initialBalance !== "") { - writer.uint32(26).string(message.initialBalance); + writer.uint32(26).string(message.initialBalance) } if (message.sharesDst !== "") { - writer.uint32(34).string(message.sharesDst); + writer.uint32(34).string(message.sharesDst) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): RedelegationEntry { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseRedelegationEntry(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseRedelegationEntry() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.creationHeight = reader.int64() as Long; - break; + message.creationHeight = reader.int64() as Long + break case 2: - message.completionTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); - break; + message.completionTime = fromTimestamp( + Timestamp.decode(reader, reader.uint32()), + ) + break case 3: - message.initialBalance = reader.string(); - break; + message.initialBalance = reader.string() + break case 4: - message.sharesDst = reader.string(); - break; + message.sharesDst = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): RedelegationEntry { return { - creationHeight: isSet(object.creationHeight) ? Long.fromValue(object.creationHeight) : Long.ZERO, - completionTime: isSet(object.completionTime) ? fromJsonTimestamp(object.completionTime) : undefined, + creationHeight: isSet(object.creationHeight) + ? Long.fromValue(object.creationHeight) + : Long.ZERO, + completionTime: isSet(object.completionTime) + ? fromJsonTimestamp(object.completionTime) + : undefined, initialBalance: isSet(object.initialBalance) ? String(object.initialBalance) : "", sharesDst: isSet(object.sharesDst) ? String(object.sharesDst) : "", - }; + } }, toJSON(message: RedelegationEntry): unknown { - const obj: any = {}; - message.creationHeight !== undefined && (obj.creationHeight = (message.creationHeight || Long.ZERO).toString()); - message.completionTime !== undefined && (obj.completionTime = message.completionTime.toISOString()); - message.initialBalance !== undefined && (obj.initialBalance = message.initialBalance); - message.sharesDst !== undefined && (obj.sharesDst = message.sharesDst); - return obj; - }, - - fromPartial, I>>(object: I): RedelegationEntry { - const message = createBaseRedelegationEntry(); - message.creationHeight = (object.creationHeight !== undefined && object.creationHeight !== null) - ? Long.fromValue(object.creationHeight) - : Long.ZERO; - message.completionTime = object.completionTime ?? undefined; - message.initialBalance = object.initialBalance ?? ""; - message.sharesDst = object.sharesDst ?? ""; - return message; - }, -}; + const obj: any = {} + message.creationHeight !== undefined && + (obj.creationHeight = (message.creationHeight || Long.ZERO).toString()) + message.completionTime !== undefined && + (obj.completionTime = message.completionTime.toISOString()) + message.initialBalance !== undefined && + (obj.initialBalance = message.initialBalance) + message.sharesDst !== undefined && (obj.sharesDst = message.sharesDst) + return obj + }, + + fromPartial, I>>( + object: I, + ): RedelegationEntry { + const message = createBaseRedelegationEntry() + message.creationHeight = + object.creationHeight !== undefined && object.creationHeight !== null + ? Long.fromValue(object.creationHeight) + : Long.ZERO + message.completionTime = object.completionTime ?? undefined + message.initialBalance = object.initialBalance ?? "" + message.sharesDst = object.sharesDst ?? "" + return message + }, +} function createBaseRedelegation(): Redelegation { - return { delegatorAddress: "", validatorSrcAddress: "", validatorDstAddress: "", entries: [] }; + return { + delegatorAddress: "", + validatorSrcAddress: "", + validatorDstAddress: "", + entries: [], + } } export const Redelegation = { encode(message: Redelegation, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.delegatorAddress !== "") { - writer.uint32(10).string(message.delegatorAddress); + writer.uint32(10).string(message.delegatorAddress) } if (message.validatorSrcAddress !== "") { - writer.uint32(18).string(message.validatorSrcAddress); + writer.uint32(18).string(message.validatorSrcAddress) } if (message.validatorDstAddress !== "") { - writer.uint32(26).string(message.validatorDstAddress); + writer.uint32(26).string(message.validatorDstAddress) } for (const v of message.entries) { - RedelegationEntry.encode(v!, writer.uint32(34).fork()).ldelim(); + RedelegationEntry.encode(v!, writer.uint32(34).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Redelegation { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseRedelegation(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseRedelegation() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.delegatorAddress = reader.string(); - break; + message.delegatorAddress = reader.string() + break case 2: - message.validatorSrcAddress = reader.string(); - break; + message.validatorSrcAddress = reader.string() + break case 3: - message.validatorDstAddress = reader.string(); - break; + message.validatorDstAddress = reader.string() + break case 4: - message.entries.push(RedelegationEntry.decode(reader, reader.uint32())); - break; + message.entries.push(RedelegationEntry.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Redelegation { return { - delegatorAddress: isSet(object.delegatorAddress) ? String(object.delegatorAddress) : "", - validatorSrcAddress: isSet(object.validatorSrcAddress) ? String(object.validatorSrcAddress) : "", - validatorDstAddress: isSet(object.validatorDstAddress) ? String(object.validatorDstAddress) : "", - entries: Array.isArray(object?.entries) ? object.entries.map((e: any) => RedelegationEntry.fromJSON(e)) : [], - }; + delegatorAddress: isSet(object.delegatorAddress) + ? String(object.delegatorAddress) + : "", + validatorSrcAddress: isSet(object.validatorSrcAddress) + ? String(object.validatorSrcAddress) + : "", + validatorDstAddress: isSet(object.validatorDstAddress) + ? String(object.validatorDstAddress) + : "", + entries: Array.isArray(object?.entries) + ? object.entries.map((e: any) => RedelegationEntry.fromJSON(e)) + : [], + } }, toJSON(message: Redelegation): unknown { - const obj: any = {}; - message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); - message.validatorSrcAddress !== undefined && (obj.validatorSrcAddress = message.validatorSrcAddress); - message.validatorDstAddress !== undefined && (obj.validatorDstAddress = message.validatorDstAddress); + const obj: any = {} + message.delegatorAddress !== undefined && + (obj.delegatorAddress = message.delegatorAddress) + message.validatorSrcAddress !== undefined && + (obj.validatorSrcAddress = message.validatorSrcAddress) + message.validatorDstAddress !== undefined && + (obj.validatorDstAddress = message.validatorDstAddress) if (message.entries) { - obj.entries = message.entries.map((e) => e ? RedelegationEntry.toJSON(e) : undefined); + obj.entries = message.entries.map((e) => + e ? RedelegationEntry.toJSON(e) : undefined, + ) } else { - obj.entries = []; + obj.entries = [] } - return obj; + return obj }, fromPartial, I>>(object: I): Redelegation { - const message = createBaseRedelegation(); - message.delegatorAddress = object.delegatorAddress ?? ""; - message.validatorSrcAddress = object.validatorSrcAddress ?? ""; - message.validatorDstAddress = object.validatorDstAddress ?? ""; - message.entries = object.entries?.map((e) => RedelegationEntry.fromPartial(e)) || []; - return message; + const message = createBaseRedelegation() + message.delegatorAddress = object.delegatorAddress ?? "" + message.validatorSrcAddress = object.validatorSrcAddress ?? "" + message.validatorDstAddress = object.validatorDstAddress ?? "" + message.entries = object.entries?.map((e) => RedelegationEntry.fromPartial(e)) || [] + return message }, -}; +} function createBaseParams(): Params { - return { unbondingTime: undefined, maxValidators: 0, maxEntries: 0, historicalEntries: 0, bondDenom: "" }; + return { + unbondingTime: undefined, + maxValidators: 0, + maxEntries: 0, + historicalEntries: 0, + bondDenom: "", + } } export const Params = { encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.unbondingTime !== undefined) { - Duration.encode(message.unbondingTime, writer.uint32(10).fork()).ldelim(); + Duration.encode(message.unbondingTime, writer.uint32(10).fork()).ldelim() } if (message.maxValidators !== 0) { - writer.uint32(16).uint32(message.maxValidators); + writer.uint32(16).uint32(message.maxValidators) } if (message.maxEntries !== 0) { - writer.uint32(24).uint32(message.maxEntries); + writer.uint32(24).uint32(message.maxEntries) } if (message.historicalEntries !== 0) { - writer.uint32(32).uint32(message.historicalEntries); + writer.uint32(32).uint32(message.historicalEntries) } if (message.bondDenom !== "") { - writer.uint32(42).string(message.bondDenom); + writer.uint32(42).string(message.bondDenom) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Params { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseParams(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseParams() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.unbondingTime = Duration.decode(reader, reader.uint32()); - break; + message.unbondingTime = Duration.decode(reader, reader.uint32()) + break case 2: - message.maxValidators = reader.uint32(); - break; + message.maxValidators = reader.uint32() + break case 3: - message.maxEntries = reader.uint32(); - break; + message.maxEntries = reader.uint32() + break case 4: - message.historicalEntries = reader.uint32(); - break; + message.historicalEntries = reader.uint32() + break case 5: - message.bondDenom = reader.string(); - break; + message.bondDenom = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Params { return { - unbondingTime: isSet(object.unbondingTime) ? Duration.fromJSON(object.unbondingTime) : undefined, + unbondingTime: isSet(object.unbondingTime) + ? Duration.fromJSON(object.unbondingTime) + : undefined, maxValidators: isSet(object.maxValidators) ? Number(object.maxValidators) : 0, maxEntries: isSet(object.maxEntries) ? Number(object.maxEntries) : 0, - historicalEntries: isSet(object.historicalEntries) ? Number(object.historicalEntries) : 0, + historicalEntries: isSet(object.historicalEntries) + ? Number(object.historicalEntries) + : 0, bondDenom: isSet(object.bondDenom) ? String(object.bondDenom) : "", - }; + } }, toJSON(message: Params): unknown { - const obj: any = {}; + const obj: any = {} message.unbondingTime !== undefined && - (obj.unbondingTime = message.unbondingTime ? Duration.toJSON(message.unbondingTime) : undefined); - message.maxValidators !== undefined && (obj.maxValidators = Math.round(message.maxValidators)); - message.maxEntries !== undefined && (obj.maxEntries = Math.round(message.maxEntries)); - message.historicalEntries !== undefined && (obj.historicalEntries = Math.round(message.historicalEntries)); - message.bondDenom !== undefined && (obj.bondDenom = message.bondDenom); - return obj; + (obj.unbondingTime = message.unbondingTime + ? Duration.toJSON(message.unbondingTime) + : undefined) + message.maxValidators !== undefined && + (obj.maxValidators = Math.round(message.maxValidators)) + message.maxEntries !== undefined && + (obj.maxEntries = Math.round(message.maxEntries)) + message.historicalEntries !== undefined && + (obj.historicalEntries = Math.round(message.historicalEntries)) + message.bondDenom !== undefined && (obj.bondDenom = message.bondDenom) + return obj }, fromPartial, I>>(object: I): Params { - const message = createBaseParams(); - message.unbondingTime = (object.unbondingTime !== undefined && object.unbondingTime !== null) - ? Duration.fromPartial(object.unbondingTime) - : undefined; - message.maxValidators = object.maxValidators ?? 0; - message.maxEntries = object.maxEntries ?? 0; - message.historicalEntries = object.historicalEntries ?? 0; - message.bondDenom = object.bondDenom ?? ""; - return message; - }, -}; + const message = createBaseParams() + message.unbondingTime = + object.unbondingTime !== undefined && object.unbondingTime !== null + ? Duration.fromPartial(object.unbondingTime) + : undefined + message.maxValidators = object.maxValidators ?? 0 + message.maxEntries = object.maxEntries ?? 0 + message.historicalEntries = object.historicalEntries ?? 0 + message.bondDenom = object.bondDenom ?? "" + return message + }, +} function createBaseDelegationResponse(): DelegationResponse { - return { delegation: undefined, balance: undefined }; + return { delegation: undefined, balance: undefined } } export const DelegationResponse = { - encode(message: DelegationResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: DelegationResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.delegation !== undefined) { - Delegation.encode(message.delegation, writer.uint32(10).fork()).ldelim(); + Delegation.encode(message.delegation, writer.uint32(10).fork()).ldelim() } if (message.balance !== undefined) { - Coin.encode(message.balance, writer.uint32(18).fork()).ldelim(); + Coin.encode(message.balance, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): DelegationResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDelegationResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseDelegationResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.delegation = Delegation.decode(reader, reader.uint32()); - break; + message.delegation = Delegation.decode(reader, reader.uint32()) + break case 2: - message.balance = Coin.decode(reader, reader.uint32()); - break; + message.balance = Coin.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): DelegationResponse { return { - delegation: isSet(object.delegation) ? Delegation.fromJSON(object.delegation) : undefined, + delegation: isSet(object.delegation) + ? Delegation.fromJSON(object.delegation) + : undefined, balance: isSet(object.balance) ? Coin.fromJSON(object.balance) : undefined, - }; + } }, toJSON(message: DelegationResponse): unknown { - const obj: any = {}; + const obj: any = {} message.delegation !== undefined && - (obj.delegation = message.delegation ? Delegation.toJSON(message.delegation) : undefined); - message.balance !== undefined && (obj.balance = message.balance ? Coin.toJSON(message.balance) : undefined); - return obj; - }, - - fromPartial, I>>(object: I): DelegationResponse { - const message = createBaseDelegationResponse(); - message.delegation = (object.delegation !== undefined && object.delegation !== null) - ? Delegation.fromPartial(object.delegation) - : undefined; - message.balance = (object.balance !== undefined && object.balance !== null) - ? Coin.fromPartial(object.balance) - : undefined; - return message; + (obj.delegation = message.delegation + ? Delegation.toJSON(message.delegation) + : undefined) + message.balance !== undefined && + (obj.balance = message.balance ? Coin.toJSON(message.balance) : undefined) + return obj + }, + + fromPartial, I>>( + object: I, + ): DelegationResponse { + const message = createBaseDelegationResponse() + message.delegation = + object.delegation !== undefined && object.delegation !== null + ? Delegation.fromPartial(object.delegation) + : undefined + message.balance = + object.balance !== undefined && object.balance !== null + ? Coin.fromPartial(object.balance) + : undefined + return message }, -}; +} function createBaseRedelegationEntryResponse(): RedelegationEntryResponse { - return { redelegationEntry: undefined, balance: "" }; + return { redelegationEntry: undefined, balance: "" } } export const RedelegationEntryResponse = { - encode(message: RedelegationEntryResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: RedelegationEntryResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.redelegationEntry !== undefined) { - RedelegationEntry.encode(message.redelegationEntry, writer.uint32(10).fork()).ldelim(); + RedelegationEntry.encode( + message.redelegationEntry, + writer.uint32(10).fork(), + ).ldelim() } if (message.balance !== "") { - writer.uint32(34).string(message.balance); + writer.uint32(34).string(message.balance) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): RedelegationEntryResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseRedelegationEntryResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseRedelegationEntryResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.redelegationEntry = RedelegationEntry.decode(reader, reader.uint32()); - break; + message.redelegationEntry = RedelegationEntry.decode(reader, reader.uint32()) + break case 4: - message.balance = reader.string(); - break; + message.balance = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): RedelegationEntryResponse { @@ -1581,196 +1790,228 @@ export const RedelegationEntryResponse = { ? RedelegationEntry.fromJSON(object.redelegationEntry) : undefined, balance: isSet(object.balance) ? String(object.balance) : "", - }; + } }, toJSON(message: RedelegationEntryResponse): unknown { - const obj: any = {}; - message.redelegationEntry !== undefined && (obj.redelegationEntry = message.redelegationEntry - ? RedelegationEntry.toJSON(message.redelegationEntry) - : undefined); - message.balance !== undefined && (obj.balance = message.balance); - return obj; + const obj: any = {} + message.redelegationEntry !== undefined && + (obj.redelegationEntry = message.redelegationEntry + ? RedelegationEntry.toJSON(message.redelegationEntry) + : undefined) + message.balance !== undefined && (obj.balance = message.balance) + return obj + }, + + fromPartial, I>>( + object: I, + ): RedelegationEntryResponse { + const message = createBaseRedelegationEntryResponse() + message.redelegationEntry = + object.redelegationEntry !== undefined && object.redelegationEntry !== null + ? RedelegationEntry.fromPartial(object.redelegationEntry) + : undefined + message.balance = object.balance ?? "" + return message }, - - fromPartial, I>>(object: I): RedelegationEntryResponse { - const message = createBaseRedelegationEntryResponse(); - message.redelegationEntry = (object.redelegationEntry !== undefined && object.redelegationEntry !== null) - ? RedelegationEntry.fromPartial(object.redelegationEntry) - : undefined; - message.balance = object.balance ?? ""; - return message; - }, -}; +} function createBaseRedelegationResponse(): RedelegationResponse { - return { redelegation: undefined, entries: [] }; + return { redelegation: undefined, entries: [] } } export const RedelegationResponse = { - encode(message: RedelegationResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: RedelegationResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.redelegation !== undefined) { - Redelegation.encode(message.redelegation, writer.uint32(10).fork()).ldelim(); + Redelegation.encode(message.redelegation, writer.uint32(10).fork()).ldelim() } for (const v of message.entries) { - RedelegationEntryResponse.encode(v!, writer.uint32(18).fork()).ldelim(); + RedelegationEntryResponse.encode(v!, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): RedelegationResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseRedelegationResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseRedelegationResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.redelegation = Redelegation.decode(reader, reader.uint32()); - break; + message.redelegation = Redelegation.decode(reader, reader.uint32()) + break case 2: - message.entries.push(RedelegationEntryResponse.decode(reader, reader.uint32())); - break; + message.entries.push( + RedelegationEntryResponse.decode(reader, reader.uint32()), + ) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): RedelegationResponse { return { - redelegation: isSet(object.redelegation) ? Redelegation.fromJSON(object.redelegation) : undefined, + redelegation: isSet(object.redelegation) + ? Redelegation.fromJSON(object.redelegation) + : undefined, entries: Array.isArray(object?.entries) ? object.entries.map((e: any) => RedelegationEntryResponse.fromJSON(e)) : [], - }; + } }, toJSON(message: RedelegationResponse): unknown { - const obj: any = {}; + const obj: any = {} message.redelegation !== undefined && - (obj.redelegation = message.redelegation ? Redelegation.toJSON(message.redelegation) : undefined); + (obj.redelegation = message.redelegation + ? Redelegation.toJSON(message.redelegation) + : undefined) if (message.entries) { - obj.entries = message.entries.map((e) => e ? RedelegationEntryResponse.toJSON(e) : undefined); + obj.entries = message.entries.map((e) => + e ? RedelegationEntryResponse.toJSON(e) : undefined, + ) } else { - obj.entries = []; + obj.entries = [] } - return obj; + return obj }, - fromPartial, I>>(object: I): RedelegationResponse { - const message = createBaseRedelegationResponse(); - message.redelegation = (object.redelegation !== undefined && object.redelegation !== null) - ? Redelegation.fromPartial(object.redelegation) - : undefined; - message.entries = object.entries?.map((e) => RedelegationEntryResponse.fromPartial(e)) || []; - return message; + fromPartial, I>>( + object: I, + ): RedelegationResponse { + const message = createBaseRedelegationResponse() + message.redelegation = + object.redelegation !== undefined && object.redelegation !== null + ? Redelegation.fromPartial(object.redelegation) + : undefined + message.entries = + object.entries?.map((e) => RedelegationEntryResponse.fromPartial(e)) || [] + return message }, -}; +} function createBasePool(): Pool { - return { notBondedTokens: "", bondedTokens: "" }; + return { notBondedTokens: "", bondedTokens: "" } } export const Pool = { encode(message: Pool, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.notBondedTokens !== "") { - writer.uint32(10).string(message.notBondedTokens); + writer.uint32(10).string(message.notBondedTokens) } if (message.bondedTokens !== "") { - writer.uint32(18).string(message.bondedTokens); + writer.uint32(18).string(message.bondedTokens) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Pool { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBasePool(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBasePool() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.notBondedTokens = reader.string(); - break; + message.notBondedTokens = reader.string() + break case 2: - message.bondedTokens = reader.string(); - break; + message.bondedTokens = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Pool { return { - notBondedTokens: isSet(object.notBondedTokens) ? String(object.notBondedTokens) : "", + notBondedTokens: isSet(object.notBondedTokens) + ? String(object.notBondedTokens) + : "", bondedTokens: isSet(object.bondedTokens) ? String(object.bondedTokens) : "", - }; + } }, toJSON(message: Pool): unknown { - const obj: any = {}; - message.notBondedTokens !== undefined && (obj.notBondedTokens = message.notBondedTokens); - message.bondedTokens !== undefined && (obj.bondedTokens = message.bondedTokens); - return obj; + const obj: any = {} + message.notBondedTokens !== undefined && + (obj.notBondedTokens = message.notBondedTokens) + message.bondedTokens !== undefined && (obj.bondedTokens = message.bondedTokens) + return obj }, fromPartial, I>>(object: I): Pool { - const message = createBasePool(); - message.notBondedTokens = object.notBondedTokens ?? ""; - message.bondedTokens = object.bondedTokens ?? ""; - return message; + const message = createBasePool() + message.notBondedTokens = object.notBondedTokens ?? "" + message.bondedTokens = object.bondedTokens ?? "" + return message }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; +} -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > function toTimestamp(date: Date): Timestamp { - const seconds = numberToLong(date.getTime() / 1_000); - const nanos = (date.getTime() % 1_000) * 1_000_000; - return { seconds, nanos }; + const seconds = numberToLong(date.getTime() / 1_000) + const nanos = (date.getTime() % 1_000) * 1_000_000 + return { seconds, nanos } } function fromTimestamp(t: Timestamp): Date { - let millis = t.seconds.toNumber() * 1_000; - millis += t.nanos / 1_000_000; - return new Date(millis); + let millis = t.seconds.toNumber() * 1_000 + millis += t.nanos / 1_000_000 + return new Date(millis) } function fromJsonTimestamp(o: any): Date { if (o instanceof Date) { - return o; + return o } else if (typeof o === "string") { - return new Date(o); + return new Date(o) } else { - return fromTimestamp(Timestamp.fromJSON(o)); + return fromTimestamp(Timestamp.fromJSON(o)) } } function numberToLong(number: number) { - return Long.fromNumber(number); + return Long.fromNumber(number) } if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/cosmos/staking/v1beta1/tx.ts b/packages/protojs/src/cosmos/staking/v1beta1/tx.ts index c5fc2a36..bffa184a 100644 --- a/packages/protojs/src/cosmos/staking/v1beta1/tx.ts +++ b/packages/protojs/src/cosmos/staking/v1beta1/tx.ts @@ -1,74 +1,71 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { Any } from "../../../google/protobuf/any"; -import { Timestamp } from "../../../google/protobuf/timestamp"; -import { Coin } from "../../base/v1beta1/coin"; -import { CommissionRates, Description } from "./staking"; +import { Description, CommissionRates } from "./staking" +import { Any } from "../../../google/protobuf/any" +import { Coin } from "../../base/v1beta1/coin" +import { Timestamp } from "../../../google/protobuf/timestamp" +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "cosmos.staking.v1beta1"; +export const protobufPackage = "cosmos.staking.v1beta1" /** MsgCreateValidator defines a SDK message for creating a new validator. */ export interface MsgCreateValidator { - description?: Description; - commission?: CommissionRates; - minSelfDelegation: string; - delegatorAddress: string; - validatorAddress: string; - pubkey?: Any; - value?: Coin; + description?: Description + commission?: CommissionRates + minSelfDelegation: string + delegatorAddress: string + validatorAddress: string + pubkey?: Any + value?: Coin } /** MsgCreateValidatorResponse defines the Msg/CreateValidator response type. */ -export interface MsgCreateValidatorResponse { -} +export interface MsgCreateValidatorResponse {} /** MsgEditValidator defines a SDK message for editing an existing validator. */ export interface MsgEditValidator { - description?: Description; - validatorAddress: string; + description?: Description + validatorAddress: string /** * We pass a reference to the new commission rate and min self delegation as * it's not mandatory to update. If not updated, the deserialized rate will be * zero with no way to distinguish if an update was intended. * REF: #2373 */ - commissionRate: string; - minSelfDelegation: string; + commissionRate: string + minSelfDelegation: string } /** MsgEditValidatorResponse defines the Msg/EditValidator response type. */ -export interface MsgEditValidatorResponse { -} +export interface MsgEditValidatorResponse {} /** * MsgDelegate defines a SDK message for performing a delegation of coins * from a delegator to a validator. */ export interface MsgDelegate { - delegatorAddress: string; - validatorAddress: string; - amount?: Coin; + delegatorAddress: string + validatorAddress: string + amount?: Coin } /** MsgDelegateResponse defines the Msg/Delegate response type. */ -export interface MsgDelegateResponse { -} +export interface MsgDelegateResponse {} /** * MsgBeginRedelegate defines a SDK message for performing a redelegation * of coins from a delegator and source validator to a destination validator. */ export interface MsgBeginRedelegate { - delegatorAddress: string; - validatorSrcAddress: string; - validatorDstAddress: string; - amount?: Coin; + delegatorAddress: string + validatorSrcAddress: string + validatorDstAddress: string + amount?: Coin } /** MsgBeginRedelegateResponse defines the Msg/BeginRedelegate response type. */ export interface MsgBeginRedelegateResponse { - completionTime?: Date; + completionTime?: Date } /** @@ -76,14 +73,14 @@ export interface MsgBeginRedelegateResponse { * delegate and a validator. */ export interface MsgUndelegate { - delegatorAddress: string; - validatorAddress: string; - amount?: Coin; + delegatorAddress: string + validatorAddress: string + amount?: Coin } /** MsgUndelegateResponse defines the Msg/Undelegate response type. */ export interface MsgUndelegateResponse { - completionTime?: Date; + completionTime?: Date } function createBaseMsgCreateValidator(): MsgCreateValidator { @@ -95,733 +92,892 @@ function createBaseMsgCreateValidator(): MsgCreateValidator { validatorAddress: "", pubkey: undefined, value: undefined, - }; + } } export const MsgCreateValidator = { - encode(message: MsgCreateValidator, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: MsgCreateValidator, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.description !== undefined) { - Description.encode(message.description, writer.uint32(10).fork()).ldelim(); + Description.encode(message.description, writer.uint32(10).fork()).ldelim() } if (message.commission !== undefined) { - CommissionRates.encode(message.commission, writer.uint32(18).fork()).ldelim(); + CommissionRates.encode(message.commission, writer.uint32(18).fork()).ldelim() } if (message.minSelfDelegation !== "") { - writer.uint32(26).string(message.minSelfDelegation); + writer.uint32(26).string(message.minSelfDelegation) } if (message.delegatorAddress !== "") { - writer.uint32(34).string(message.delegatorAddress); + writer.uint32(34).string(message.delegatorAddress) } if (message.validatorAddress !== "") { - writer.uint32(42).string(message.validatorAddress); + writer.uint32(42).string(message.validatorAddress) } if (message.pubkey !== undefined) { - Any.encode(message.pubkey, writer.uint32(50).fork()).ldelim(); + Any.encode(message.pubkey, writer.uint32(50).fork()).ldelim() } if (message.value !== undefined) { - Coin.encode(message.value, writer.uint32(58).fork()).ldelim(); + Coin.encode(message.value, writer.uint32(58).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateValidator { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgCreateValidator(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgCreateValidator() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.description = Description.decode(reader, reader.uint32()); - break; + message.description = Description.decode(reader, reader.uint32()) + break case 2: - message.commission = CommissionRates.decode(reader, reader.uint32()); - break; + message.commission = CommissionRates.decode(reader, reader.uint32()) + break case 3: - message.minSelfDelegation = reader.string(); - break; + message.minSelfDelegation = reader.string() + break case 4: - message.delegatorAddress = reader.string(); - break; + message.delegatorAddress = reader.string() + break case 5: - message.validatorAddress = reader.string(); - break; + message.validatorAddress = reader.string() + break case 6: - message.pubkey = Any.decode(reader, reader.uint32()); - break; + message.pubkey = Any.decode(reader, reader.uint32()) + break case 7: - message.value = Coin.decode(reader, reader.uint32()); - break; + message.value = Coin.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): MsgCreateValidator { return { - description: isSet(object.description) ? Description.fromJSON(object.description) : undefined, - commission: isSet(object.commission) ? CommissionRates.fromJSON(object.commission) : undefined, - minSelfDelegation: isSet(object.minSelfDelegation) ? String(object.minSelfDelegation) : "", - delegatorAddress: isSet(object.delegatorAddress) ? String(object.delegatorAddress) : "", - validatorAddress: isSet(object.validatorAddress) ? String(object.validatorAddress) : "", + description: isSet(object.description) + ? Description.fromJSON(object.description) + : undefined, + commission: isSet(object.commission) + ? CommissionRates.fromJSON(object.commission) + : undefined, + minSelfDelegation: isSet(object.minSelfDelegation) + ? String(object.minSelfDelegation) + : "", + delegatorAddress: isSet(object.delegatorAddress) + ? String(object.delegatorAddress) + : "", + validatorAddress: isSet(object.validatorAddress) + ? String(object.validatorAddress) + : "", pubkey: isSet(object.pubkey) ? Any.fromJSON(object.pubkey) : undefined, value: isSet(object.value) ? Coin.fromJSON(object.value) : undefined, - }; + } }, toJSON(message: MsgCreateValidator): unknown { - const obj: any = {}; + const obj: any = {} message.description !== undefined && - (obj.description = message.description ? Description.toJSON(message.description) : undefined); + (obj.description = message.description + ? Description.toJSON(message.description) + : undefined) message.commission !== undefined && - (obj.commission = message.commission ? CommissionRates.toJSON(message.commission) : undefined); - message.minSelfDelegation !== undefined && (obj.minSelfDelegation = message.minSelfDelegation); - message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); - message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); - message.pubkey !== undefined && (obj.pubkey = message.pubkey ? Any.toJSON(message.pubkey) : undefined); - message.value !== undefined && (obj.value = message.value ? Coin.toJSON(message.value) : undefined); - return obj; - }, - - fromPartial, I>>(object: I): MsgCreateValidator { - const message = createBaseMsgCreateValidator(); - message.description = (object.description !== undefined && object.description !== null) - ? Description.fromPartial(object.description) - : undefined; - message.commission = (object.commission !== undefined && object.commission !== null) - ? CommissionRates.fromPartial(object.commission) - : undefined; - message.minSelfDelegation = object.minSelfDelegation ?? ""; - message.delegatorAddress = object.delegatorAddress ?? ""; - message.validatorAddress = object.validatorAddress ?? ""; - message.pubkey = (object.pubkey !== undefined && object.pubkey !== null) - ? Any.fromPartial(object.pubkey) - : undefined; - message.value = (object.value !== undefined && object.value !== null) ? Coin.fromPartial(object.value) : undefined; - return message; - }, -}; + (obj.commission = message.commission + ? CommissionRates.toJSON(message.commission) + : undefined) + message.minSelfDelegation !== undefined && + (obj.minSelfDelegation = message.minSelfDelegation) + message.delegatorAddress !== undefined && + (obj.delegatorAddress = message.delegatorAddress) + message.validatorAddress !== undefined && + (obj.validatorAddress = message.validatorAddress) + message.pubkey !== undefined && + (obj.pubkey = message.pubkey ? Any.toJSON(message.pubkey) : undefined) + message.value !== undefined && + (obj.value = message.value ? Coin.toJSON(message.value) : undefined) + return obj + }, + + fromPartial, I>>( + object: I, + ): MsgCreateValidator { + const message = createBaseMsgCreateValidator() + message.description = + object.description !== undefined && object.description !== null + ? Description.fromPartial(object.description) + : undefined + message.commission = + object.commission !== undefined && object.commission !== null + ? CommissionRates.fromPartial(object.commission) + : undefined + message.minSelfDelegation = object.minSelfDelegation ?? "" + message.delegatorAddress = object.delegatorAddress ?? "" + message.validatorAddress = object.validatorAddress ?? "" + message.pubkey = + object.pubkey !== undefined && object.pubkey !== null + ? Any.fromPartial(object.pubkey) + : undefined + message.value = + object.value !== undefined && object.value !== null + ? Coin.fromPartial(object.value) + : undefined + return message + }, +} function createBaseMsgCreateValidatorResponse(): MsgCreateValidatorResponse { - return {}; + return {} } export const MsgCreateValidatorResponse = { - encode(_: MsgCreateValidatorResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; + encode( + _: MsgCreateValidatorResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateValidatorResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgCreateValidatorResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgCreateValidatorResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(_: any): MsgCreateValidatorResponse { - return {}; + return {} }, toJSON(_: MsgCreateValidatorResponse): unknown { - const obj: any = {}; - return obj; + const obj: any = {} + return obj }, - fromPartial, I>>(_: I): MsgCreateValidatorResponse { - const message = createBaseMsgCreateValidatorResponse(); - return message; + fromPartial, I>>( + _: I, + ): MsgCreateValidatorResponse { + const message = createBaseMsgCreateValidatorResponse() + return message }, -}; +} function createBaseMsgEditValidator(): MsgEditValidator { - return { description: undefined, validatorAddress: "", commissionRate: "", minSelfDelegation: "" }; + return { + description: undefined, + validatorAddress: "", + commissionRate: "", + minSelfDelegation: "", + } } export const MsgEditValidator = { - encode(message: MsgEditValidator, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: MsgEditValidator, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.description !== undefined) { - Description.encode(message.description, writer.uint32(10).fork()).ldelim(); + Description.encode(message.description, writer.uint32(10).fork()).ldelim() } if (message.validatorAddress !== "") { - writer.uint32(18).string(message.validatorAddress); + writer.uint32(18).string(message.validatorAddress) } if (message.commissionRate !== "") { - writer.uint32(26).string(message.commissionRate); + writer.uint32(26).string(message.commissionRate) } if (message.minSelfDelegation !== "") { - writer.uint32(34).string(message.minSelfDelegation); + writer.uint32(34).string(message.minSelfDelegation) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MsgEditValidator { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgEditValidator(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgEditValidator() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.description = Description.decode(reader, reader.uint32()); - break; + message.description = Description.decode(reader, reader.uint32()) + break case 2: - message.validatorAddress = reader.string(); - break; + message.validatorAddress = reader.string() + break case 3: - message.commissionRate = reader.string(); - break; + message.commissionRate = reader.string() + break case 4: - message.minSelfDelegation = reader.string(); - break; + message.minSelfDelegation = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): MsgEditValidator { return { - description: isSet(object.description) ? Description.fromJSON(object.description) : undefined, - validatorAddress: isSet(object.validatorAddress) ? String(object.validatorAddress) : "", + description: isSet(object.description) + ? Description.fromJSON(object.description) + : undefined, + validatorAddress: isSet(object.validatorAddress) + ? String(object.validatorAddress) + : "", commissionRate: isSet(object.commissionRate) ? String(object.commissionRate) : "", - minSelfDelegation: isSet(object.minSelfDelegation) ? String(object.minSelfDelegation) : "", - }; + minSelfDelegation: isSet(object.minSelfDelegation) + ? String(object.minSelfDelegation) + : "", + } }, toJSON(message: MsgEditValidator): unknown { - const obj: any = {}; + const obj: any = {} message.description !== undefined && - (obj.description = message.description ? Description.toJSON(message.description) : undefined); - message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); - message.commissionRate !== undefined && (obj.commissionRate = message.commissionRate); - message.minSelfDelegation !== undefined && (obj.minSelfDelegation = message.minSelfDelegation); - return obj; - }, - - fromPartial, I>>(object: I): MsgEditValidator { - const message = createBaseMsgEditValidator(); - message.description = (object.description !== undefined && object.description !== null) - ? Description.fromPartial(object.description) - : undefined; - message.validatorAddress = object.validatorAddress ?? ""; - message.commissionRate = object.commissionRate ?? ""; - message.minSelfDelegation = object.minSelfDelegation ?? ""; - return message; + (obj.description = message.description + ? Description.toJSON(message.description) + : undefined) + message.validatorAddress !== undefined && + (obj.validatorAddress = message.validatorAddress) + message.commissionRate !== undefined && + (obj.commissionRate = message.commissionRate) + message.minSelfDelegation !== undefined && + (obj.minSelfDelegation = message.minSelfDelegation) + return obj + }, + + fromPartial, I>>( + object: I, + ): MsgEditValidator { + const message = createBaseMsgEditValidator() + message.description = + object.description !== undefined && object.description !== null + ? Description.fromPartial(object.description) + : undefined + message.validatorAddress = object.validatorAddress ?? "" + message.commissionRate = object.commissionRate ?? "" + message.minSelfDelegation = object.minSelfDelegation ?? "" + return message }, -}; +} function createBaseMsgEditValidatorResponse(): MsgEditValidatorResponse { - return {}; + return {} } export const MsgEditValidatorResponse = { - encode(_: MsgEditValidatorResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; + encode( + _: MsgEditValidatorResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MsgEditValidatorResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgEditValidatorResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgEditValidatorResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(_: any): MsgEditValidatorResponse { - return {}; + return {} }, toJSON(_: MsgEditValidatorResponse): unknown { - const obj: any = {}; - return obj; + const obj: any = {} + return obj }, - fromPartial, I>>(_: I): MsgEditValidatorResponse { - const message = createBaseMsgEditValidatorResponse(); - return message; + fromPartial, I>>( + _: I, + ): MsgEditValidatorResponse { + const message = createBaseMsgEditValidatorResponse() + return message }, -}; +} function createBaseMsgDelegate(): MsgDelegate { - return { delegatorAddress: "", validatorAddress: "", amount: undefined }; + return { delegatorAddress: "", validatorAddress: "", amount: undefined } } export const MsgDelegate = { encode(message: MsgDelegate, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.delegatorAddress !== "") { - writer.uint32(10).string(message.delegatorAddress); + writer.uint32(10).string(message.delegatorAddress) } if (message.validatorAddress !== "") { - writer.uint32(18).string(message.validatorAddress); + writer.uint32(18).string(message.validatorAddress) } if (message.amount !== undefined) { - Coin.encode(message.amount, writer.uint32(26).fork()).ldelim(); + Coin.encode(message.amount, writer.uint32(26).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MsgDelegate { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgDelegate(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgDelegate() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.delegatorAddress = reader.string(); - break; + message.delegatorAddress = reader.string() + break case 2: - message.validatorAddress = reader.string(); - break; + message.validatorAddress = reader.string() + break case 3: - message.amount = Coin.decode(reader, reader.uint32()); - break; + message.amount = Coin.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): MsgDelegate { return { - delegatorAddress: isSet(object.delegatorAddress) ? String(object.delegatorAddress) : "", - validatorAddress: isSet(object.validatorAddress) ? String(object.validatorAddress) : "", + delegatorAddress: isSet(object.delegatorAddress) + ? String(object.delegatorAddress) + : "", + validatorAddress: isSet(object.validatorAddress) + ? String(object.validatorAddress) + : "", amount: isSet(object.amount) ? Coin.fromJSON(object.amount) : undefined, - }; + } }, toJSON(message: MsgDelegate): unknown { - const obj: any = {}; - message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); - message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); - message.amount !== undefined && (obj.amount = message.amount ? Coin.toJSON(message.amount) : undefined); - return obj; + const obj: any = {} + message.delegatorAddress !== undefined && + (obj.delegatorAddress = message.delegatorAddress) + message.validatorAddress !== undefined && + (obj.validatorAddress = message.validatorAddress) + message.amount !== undefined && + (obj.amount = message.amount ? Coin.toJSON(message.amount) : undefined) + return obj }, fromPartial, I>>(object: I): MsgDelegate { - const message = createBaseMsgDelegate(); - message.delegatorAddress = object.delegatorAddress ?? ""; - message.validatorAddress = object.validatorAddress ?? ""; - message.amount = (object.amount !== undefined && object.amount !== null) - ? Coin.fromPartial(object.amount) - : undefined; - return message; + const message = createBaseMsgDelegate() + message.delegatorAddress = object.delegatorAddress ?? "" + message.validatorAddress = object.validatorAddress ?? "" + message.amount = + object.amount !== undefined && object.amount !== null + ? Coin.fromPartial(object.amount) + : undefined + return message }, -}; +} function createBaseMsgDelegateResponse(): MsgDelegateResponse { - return {}; + return {} } export const MsgDelegateResponse = { encode(_: MsgDelegateResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MsgDelegateResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgDelegateResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgDelegateResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(_: any): MsgDelegateResponse { - return {}; + return {} }, toJSON(_: MsgDelegateResponse): unknown { - const obj: any = {}; - return obj; + const obj: any = {} + return obj }, - fromPartial, I>>(_: I): MsgDelegateResponse { - const message = createBaseMsgDelegateResponse(); - return message; + fromPartial, I>>( + _: I, + ): MsgDelegateResponse { + const message = createBaseMsgDelegateResponse() + return message }, -}; +} function createBaseMsgBeginRedelegate(): MsgBeginRedelegate { - return { delegatorAddress: "", validatorSrcAddress: "", validatorDstAddress: "", amount: undefined }; + return { + delegatorAddress: "", + validatorSrcAddress: "", + validatorDstAddress: "", + amount: undefined, + } } export const MsgBeginRedelegate = { - encode(message: MsgBeginRedelegate, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: MsgBeginRedelegate, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.delegatorAddress !== "") { - writer.uint32(10).string(message.delegatorAddress); + writer.uint32(10).string(message.delegatorAddress) } if (message.validatorSrcAddress !== "") { - writer.uint32(18).string(message.validatorSrcAddress); + writer.uint32(18).string(message.validatorSrcAddress) } if (message.validatorDstAddress !== "") { - writer.uint32(26).string(message.validatorDstAddress); + writer.uint32(26).string(message.validatorDstAddress) } if (message.amount !== undefined) { - Coin.encode(message.amount, writer.uint32(34).fork()).ldelim(); + Coin.encode(message.amount, writer.uint32(34).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MsgBeginRedelegate { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgBeginRedelegate(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgBeginRedelegate() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.delegatorAddress = reader.string(); - break; + message.delegatorAddress = reader.string() + break case 2: - message.validatorSrcAddress = reader.string(); - break; + message.validatorSrcAddress = reader.string() + break case 3: - message.validatorDstAddress = reader.string(); - break; + message.validatorDstAddress = reader.string() + break case 4: - message.amount = Coin.decode(reader, reader.uint32()); - break; + message.amount = Coin.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): MsgBeginRedelegate { return { - delegatorAddress: isSet(object.delegatorAddress) ? String(object.delegatorAddress) : "", - validatorSrcAddress: isSet(object.validatorSrcAddress) ? String(object.validatorSrcAddress) : "", - validatorDstAddress: isSet(object.validatorDstAddress) ? String(object.validatorDstAddress) : "", + delegatorAddress: isSet(object.delegatorAddress) + ? String(object.delegatorAddress) + : "", + validatorSrcAddress: isSet(object.validatorSrcAddress) + ? String(object.validatorSrcAddress) + : "", + validatorDstAddress: isSet(object.validatorDstAddress) + ? String(object.validatorDstAddress) + : "", amount: isSet(object.amount) ? Coin.fromJSON(object.amount) : undefined, - }; + } }, toJSON(message: MsgBeginRedelegate): unknown { - const obj: any = {}; - message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); - message.validatorSrcAddress !== undefined && (obj.validatorSrcAddress = message.validatorSrcAddress); - message.validatorDstAddress !== undefined && (obj.validatorDstAddress = message.validatorDstAddress); - message.amount !== undefined && (obj.amount = message.amount ? Coin.toJSON(message.amount) : undefined); - return obj; - }, - - fromPartial, I>>(object: I): MsgBeginRedelegate { - const message = createBaseMsgBeginRedelegate(); - message.delegatorAddress = object.delegatorAddress ?? ""; - message.validatorSrcAddress = object.validatorSrcAddress ?? ""; - message.validatorDstAddress = object.validatorDstAddress ?? ""; - message.amount = (object.amount !== undefined && object.amount !== null) - ? Coin.fromPartial(object.amount) - : undefined; - return message; - }, -}; + const obj: any = {} + message.delegatorAddress !== undefined && + (obj.delegatorAddress = message.delegatorAddress) + message.validatorSrcAddress !== undefined && + (obj.validatorSrcAddress = message.validatorSrcAddress) + message.validatorDstAddress !== undefined && + (obj.validatorDstAddress = message.validatorDstAddress) + message.amount !== undefined && + (obj.amount = message.amount ? Coin.toJSON(message.amount) : undefined) + return obj + }, + + fromPartial, I>>( + object: I, + ): MsgBeginRedelegate { + const message = createBaseMsgBeginRedelegate() + message.delegatorAddress = object.delegatorAddress ?? "" + message.validatorSrcAddress = object.validatorSrcAddress ?? "" + message.validatorDstAddress = object.validatorDstAddress ?? "" + message.amount = + object.amount !== undefined && object.amount !== null + ? Coin.fromPartial(object.amount) + : undefined + return message + }, +} function createBaseMsgBeginRedelegateResponse(): MsgBeginRedelegateResponse { - return { completionTime: undefined }; + return { completionTime: undefined } } export const MsgBeginRedelegateResponse = { - encode(message: MsgBeginRedelegateResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: MsgBeginRedelegateResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.completionTime !== undefined) { - Timestamp.encode(toTimestamp(message.completionTime), writer.uint32(10).fork()).ldelim(); + Timestamp.encode( + toTimestamp(message.completionTime), + writer.uint32(10).fork(), + ).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MsgBeginRedelegateResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgBeginRedelegateResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgBeginRedelegateResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.completionTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); - break; + message.completionTime = fromTimestamp( + Timestamp.decode(reader, reader.uint32()), + ) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): MsgBeginRedelegateResponse { - return { completionTime: isSet(object.completionTime) ? fromJsonTimestamp(object.completionTime) : undefined }; + return { + completionTime: isSet(object.completionTime) + ? fromJsonTimestamp(object.completionTime) + : undefined, + } }, toJSON(message: MsgBeginRedelegateResponse): unknown { - const obj: any = {}; - message.completionTime !== undefined && (obj.completionTime = message.completionTime.toISOString()); - return obj; + const obj: any = {} + message.completionTime !== undefined && + (obj.completionTime = message.completionTime.toISOString()) + return obj }, - fromPartial, I>>(object: I): MsgBeginRedelegateResponse { - const message = createBaseMsgBeginRedelegateResponse(); - message.completionTime = object.completionTime ?? undefined; - return message; + fromPartial, I>>( + object: I, + ): MsgBeginRedelegateResponse { + const message = createBaseMsgBeginRedelegateResponse() + message.completionTime = object.completionTime ?? undefined + return message }, -}; +} function createBaseMsgUndelegate(): MsgUndelegate { - return { delegatorAddress: "", validatorAddress: "", amount: undefined }; + return { delegatorAddress: "", validatorAddress: "", amount: undefined } } export const MsgUndelegate = { encode(message: MsgUndelegate, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.delegatorAddress !== "") { - writer.uint32(10).string(message.delegatorAddress); + writer.uint32(10).string(message.delegatorAddress) } if (message.validatorAddress !== "") { - writer.uint32(18).string(message.validatorAddress); + writer.uint32(18).string(message.validatorAddress) } if (message.amount !== undefined) { - Coin.encode(message.amount, writer.uint32(26).fork()).ldelim(); + Coin.encode(message.amount, writer.uint32(26).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MsgUndelegate { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgUndelegate(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgUndelegate() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.delegatorAddress = reader.string(); - break; + message.delegatorAddress = reader.string() + break case 2: - message.validatorAddress = reader.string(); - break; + message.validatorAddress = reader.string() + break case 3: - message.amount = Coin.decode(reader, reader.uint32()); - break; + message.amount = Coin.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): MsgUndelegate { return { - delegatorAddress: isSet(object.delegatorAddress) ? String(object.delegatorAddress) : "", - validatorAddress: isSet(object.validatorAddress) ? String(object.validatorAddress) : "", + delegatorAddress: isSet(object.delegatorAddress) + ? String(object.delegatorAddress) + : "", + validatorAddress: isSet(object.validatorAddress) + ? String(object.validatorAddress) + : "", amount: isSet(object.amount) ? Coin.fromJSON(object.amount) : undefined, - }; + } }, toJSON(message: MsgUndelegate): unknown { - const obj: any = {}; - message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); - message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); - message.amount !== undefined && (obj.amount = message.amount ? Coin.toJSON(message.amount) : undefined); - return obj; - }, - - fromPartial, I>>(object: I): MsgUndelegate { - const message = createBaseMsgUndelegate(); - message.delegatorAddress = object.delegatorAddress ?? ""; - message.validatorAddress = object.validatorAddress ?? ""; - message.amount = (object.amount !== undefined && object.amount !== null) - ? Coin.fromPartial(object.amount) - : undefined; - return message; + const obj: any = {} + message.delegatorAddress !== undefined && + (obj.delegatorAddress = message.delegatorAddress) + message.validatorAddress !== undefined && + (obj.validatorAddress = message.validatorAddress) + message.amount !== undefined && + (obj.amount = message.amount ? Coin.toJSON(message.amount) : undefined) + return obj + }, + + fromPartial, I>>( + object: I, + ): MsgUndelegate { + const message = createBaseMsgUndelegate() + message.delegatorAddress = object.delegatorAddress ?? "" + message.validatorAddress = object.validatorAddress ?? "" + message.amount = + object.amount !== undefined && object.amount !== null + ? Coin.fromPartial(object.amount) + : undefined + return message }, -}; +} function createBaseMsgUndelegateResponse(): MsgUndelegateResponse { - return { completionTime: undefined }; + return { completionTime: undefined } } export const MsgUndelegateResponse = { - encode(message: MsgUndelegateResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: MsgUndelegateResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.completionTime !== undefined) { - Timestamp.encode(toTimestamp(message.completionTime), writer.uint32(10).fork()).ldelim(); + Timestamp.encode( + toTimestamp(message.completionTime), + writer.uint32(10).fork(), + ).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MsgUndelegateResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgUndelegateResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgUndelegateResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.completionTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); - break; + message.completionTime = fromTimestamp( + Timestamp.decode(reader, reader.uint32()), + ) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): MsgUndelegateResponse { - return { completionTime: isSet(object.completionTime) ? fromJsonTimestamp(object.completionTime) : undefined }; + return { + completionTime: isSet(object.completionTime) + ? fromJsonTimestamp(object.completionTime) + : undefined, + } }, toJSON(message: MsgUndelegateResponse): unknown { - const obj: any = {}; - message.completionTime !== undefined && (obj.completionTime = message.completionTime.toISOString()); - return obj; + const obj: any = {} + message.completionTime !== undefined && + (obj.completionTime = message.completionTime.toISOString()) + return obj }, - fromPartial, I>>(object: I): MsgUndelegateResponse { - const message = createBaseMsgUndelegateResponse(); - message.completionTime = object.completionTime ?? undefined; - return message; + fromPartial, I>>( + object: I, + ): MsgUndelegateResponse { + const message = createBaseMsgUndelegateResponse() + message.completionTime = object.completionTime ?? undefined + return message }, -}; +} /** Msg defines the staking Msg service. */ export interface Msg { /** CreateValidator defines a method for creating a new validator. */ - CreateValidator(request: MsgCreateValidator): Promise; + CreateValidator(request: MsgCreateValidator): Promise /** EditValidator defines a method for editing an existing validator. */ - EditValidator(request: MsgEditValidator): Promise; + EditValidator(request: MsgEditValidator): Promise /** * Delegate defines a method for performing a delegation of coins * from a delegator to a validator. */ - Delegate(request: MsgDelegate): Promise; + Delegate(request: MsgDelegate): Promise /** * BeginRedelegate defines a method for performing a redelegation * of coins from a delegator and source validator to a destination validator. */ - BeginRedelegate(request: MsgBeginRedelegate): Promise; + BeginRedelegate(request: MsgBeginRedelegate): Promise /** * Undelegate defines a method for performing an undelegation from a * delegate and a validator. */ - Undelegate(request: MsgUndelegate): Promise; + Undelegate(request: MsgUndelegate): Promise } export class MsgClientImpl implements Msg { - private readonly rpc: Rpc; + private readonly rpc: Rpc constructor(rpc: Rpc) { - this.rpc = rpc; - this.CreateValidator = this.CreateValidator.bind(this); - this.EditValidator = this.EditValidator.bind(this); - this.Delegate = this.Delegate.bind(this); - this.BeginRedelegate = this.BeginRedelegate.bind(this); - this.Undelegate = this.Undelegate.bind(this); + this.rpc = rpc + this.CreateValidator = this.CreateValidator.bind(this) + this.EditValidator = this.EditValidator.bind(this) + this.Delegate = this.Delegate.bind(this) + this.BeginRedelegate = this.BeginRedelegate.bind(this) + this.Undelegate = this.Undelegate.bind(this) } CreateValidator(request: MsgCreateValidator): Promise { - const data = MsgCreateValidator.encode(request).finish(); - const promise = this.rpc.request("cosmos.staking.v1beta1.Msg", "CreateValidator", data); - return promise.then((data) => MsgCreateValidatorResponse.decode(new _m0.Reader(data))); + const data = MsgCreateValidator.encode(request).finish() + const promise = this.rpc.request( + "cosmos.staking.v1beta1.Msg", + "CreateValidator", + data, + ) + return promise.then((data) => + MsgCreateValidatorResponse.decode(new _m0.Reader(data)), + ) } EditValidator(request: MsgEditValidator): Promise { - const data = MsgEditValidator.encode(request).finish(); - const promise = this.rpc.request("cosmos.staking.v1beta1.Msg", "EditValidator", data); - return promise.then((data) => MsgEditValidatorResponse.decode(new _m0.Reader(data))); + const data = MsgEditValidator.encode(request).finish() + const promise = this.rpc.request( + "cosmos.staking.v1beta1.Msg", + "EditValidator", + data, + ) + return promise.then((data) => MsgEditValidatorResponse.decode(new _m0.Reader(data))) } Delegate(request: MsgDelegate): Promise { - const data = MsgDelegate.encode(request).finish(); - const promise = this.rpc.request("cosmos.staking.v1beta1.Msg", "Delegate", data); - return promise.then((data) => MsgDelegateResponse.decode(new _m0.Reader(data))); + const data = MsgDelegate.encode(request).finish() + const promise = this.rpc.request("cosmos.staking.v1beta1.Msg", "Delegate", data) + return promise.then((data) => MsgDelegateResponse.decode(new _m0.Reader(data))) } BeginRedelegate(request: MsgBeginRedelegate): Promise { - const data = MsgBeginRedelegate.encode(request).finish(); - const promise = this.rpc.request("cosmos.staking.v1beta1.Msg", "BeginRedelegate", data); - return promise.then((data) => MsgBeginRedelegateResponse.decode(new _m0.Reader(data))); + const data = MsgBeginRedelegate.encode(request).finish() + const promise = this.rpc.request( + "cosmos.staking.v1beta1.Msg", + "BeginRedelegate", + data, + ) + return promise.then((data) => + MsgBeginRedelegateResponse.decode(new _m0.Reader(data)), + ) } Undelegate(request: MsgUndelegate): Promise { - const data = MsgUndelegate.encode(request).finish(); - const promise = this.rpc.request("cosmos.staking.v1beta1.Msg", "Undelegate", data); - return promise.then((data) => MsgUndelegateResponse.decode(new _m0.Reader(data))); + const data = MsgUndelegate.encode(request).finish() + const promise = this.rpc.request("cosmos.staking.v1beta1.Msg", "Undelegate", data) + return promise.then((data) => MsgUndelegateResponse.decode(new _m0.Reader(data))) } } interface Rpc { - request(service: string, method: string, data: Uint8Array): Promise; + request(service: string, method: string, data: Uint8Array): Promise } -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > function toTimestamp(date: Date): Timestamp { - const seconds = numberToLong(date.getTime() / 1_000); - const nanos = (date.getTime() % 1_000) * 1_000_000; - return { seconds, nanos }; + const seconds = numberToLong(date.getTime() / 1_000) + const nanos = (date.getTime() % 1_000) * 1_000_000 + return { seconds, nanos } } function fromTimestamp(t: Timestamp): Date { - let millis = t.seconds.toNumber() * 1_000; - millis += t.nanos / 1_000_000; - return new Date(millis); + let millis = t.seconds.toNumber() * 1_000 + millis += t.nanos / 1_000_000 + return new Date(millis) } function fromJsonTimestamp(o: any): Date { if (o instanceof Date) { - return o; + return o } else if (typeof o === "string") { - return new Date(o); + return new Date(o) } else { - return fromTimestamp(Timestamp.fromJSON(o)); + return fromTimestamp(Timestamp.fromJSON(o)) } } function numberToLong(number: number) { - return Long.fromNumber(number); + return Long.fromNumber(number) } if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/cosmos/tx/signing/v1beta1/signing.ts b/packages/protojs/src/cosmos/tx/signing/v1beta1/signing.ts index 7d74d65c..dc9ebc3e 100644 --- a/packages/protojs/src/cosmos/tx/signing/v1beta1/signing.ts +++ b/packages/protojs/src/cosmos/tx/signing/v1beta1/signing.ts @@ -1,10 +1,10 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { Any } from "../../../../google/protobuf/any"; -import { CompactBitArray } from "../../../crypto/multisig/v1beta1/multisig"; +import { Any } from "../../../../google/protobuf/any" +import { CompactBitArray } from "../../../crypto/multisig/v1beta1/multisig" +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "cosmos.tx.signing.v1beta1"; +export const protobufPackage = "cosmos.tx.signing.v1beta1" /** SignMode represents a signing mode with its own security guarantees. */ export enum SignMode { @@ -49,48 +49,48 @@ export function signModeFromJSON(object: any): SignMode { switch (object) { case 0: case "SIGN_MODE_UNSPECIFIED": - return SignMode.SIGN_MODE_UNSPECIFIED; + return SignMode.SIGN_MODE_UNSPECIFIED case 1: case "SIGN_MODE_DIRECT": - return SignMode.SIGN_MODE_DIRECT; + return SignMode.SIGN_MODE_DIRECT case 2: case "SIGN_MODE_TEXTUAL": - return SignMode.SIGN_MODE_TEXTUAL; + return SignMode.SIGN_MODE_TEXTUAL case 127: case "SIGN_MODE_LEGACY_AMINO_JSON": - return SignMode.SIGN_MODE_LEGACY_AMINO_JSON; + return SignMode.SIGN_MODE_LEGACY_AMINO_JSON case 191: case "SIGN_MODE_EIP_191": - return SignMode.SIGN_MODE_EIP_191; + return SignMode.SIGN_MODE_EIP_191 case -1: case "UNRECOGNIZED": default: - return SignMode.UNRECOGNIZED; + return SignMode.UNRECOGNIZED } } export function signModeToJSON(object: SignMode): string { switch (object) { case SignMode.SIGN_MODE_UNSPECIFIED: - return "SIGN_MODE_UNSPECIFIED"; + return "SIGN_MODE_UNSPECIFIED" case SignMode.SIGN_MODE_DIRECT: - return "SIGN_MODE_DIRECT"; + return "SIGN_MODE_DIRECT" case SignMode.SIGN_MODE_TEXTUAL: - return "SIGN_MODE_TEXTUAL"; + return "SIGN_MODE_TEXTUAL" case SignMode.SIGN_MODE_LEGACY_AMINO_JSON: - return "SIGN_MODE_LEGACY_AMINO_JSON"; + return "SIGN_MODE_LEGACY_AMINO_JSON" case SignMode.SIGN_MODE_EIP_191: - return "SIGN_MODE_EIP_191"; + return "SIGN_MODE_EIP_191" case SignMode.UNRECOGNIZED: default: - return "UNRECOGNIZED"; + return "UNRECOGNIZED" } } /** SignatureDescriptors wraps multiple SignatureDescriptor's. */ export interface SignatureDescriptors { /** signatures are the signature descriptors */ - signatures: SignatureDescriptor[]; + signatures: SignatureDescriptor[] } /** @@ -101,70 +101,71 @@ export interface SignatureDescriptors { */ export interface SignatureDescriptor { /** public_key is the public key of the signer */ - publicKey?: Any; - data?: SignatureDescriptor_Data; + 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; + sequence: Long } /** Data represents signature data */ export interface SignatureDescriptor_Data { /** single represents a single signer */ - single?: - | SignatureDescriptor_Data_Single - | undefined; + single?: SignatureDescriptor_Data_Single | undefined /** multi represents a multisig signer */ - multi?: SignatureDescriptor_Data_Multi | undefined; + 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; + mode: SignMode /** signature is the raw signature bytes */ - signature: Uint8Array; + 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; + bitarray?: CompactBitArray /** signatures is the signatures of the multi-signature */ - signatures: SignatureDescriptor_Data[]; + signatures: SignatureDescriptor_Data[] } function createBaseSignatureDescriptors(): SignatureDescriptors { - return { signatures: [] }; + return { signatures: [] } } export const SignatureDescriptors = { - encode(message: SignatureDescriptors, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: SignatureDescriptors, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { for (const v of message.signatures) { - SignatureDescriptor.encode(v!, writer.uint32(10).fork()).ldelim(); + SignatureDescriptor.encode(v!, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): SignatureDescriptors { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSignatureDescriptors(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseSignatureDescriptors() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.signatures.push(SignatureDescriptor.decode(reader, reader.uint32())); - break; + message.signatures.push(SignatureDescriptor.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): SignatureDescriptors { @@ -172,354 +173,422 @@ export const SignatureDescriptors = { signatures: Array.isArray(object?.signatures) ? object.signatures.map((e: any) => SignatureDescriptor.fromJSON(e)) : [], - }; + } }, toJSON(message: SignatureDescriptors): unknown { - const obj: any = {}; + const obj: any = {} if (message.signatures) { - obj.signatures = message.signatures.map((e) => e ? SignatureDescriptor.toJSON(e) : undefined); + obj.signatures = message.signatures.map((e) => + e ? SignatureDescriptor.toJSON(e) : undefined, + ) } else { - obj.signatures = []; + obj.signatures = [] } - return obj; + return obj }, - fromPartial, I>>(object: I): SignatureDescriptors { - const message = createBaseSignatureDescriptors(); - message.signatures = object.signatures?.map((e) => SignatureDescriptor.fromPartial(e)) || []; - return message; + fromPartial, I>>( + object: I, + ): SignatureDescriptors { + const message = createBaseSignatureDescriptors() + message.signatures = + object.signatures?.map((e) => SignatureDescriptor.fromPartial(e)) || [] + return message }, -}; +} function createBaseSignatureDescriptor(): SignatureDescriptor { - return { publicKey: undefined, data: undefined, sequence: Long.UZERO }; + return { publicKey: undefined, data: undefined, sequence: Long.UZERO } } export const SignatureDescriptor = { - encode(message: SignatureDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: SignatureDescriptor, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.publicKey !== undefined) { - Any.encode(message.publicKey, writer.uint32(10).fork()).ldelim(); + Any.encode(message.publicKey, writer.uint32(10).fork()).ldelim() } if (message.data !== undefined) { - SignatureDescriptor_Data.encode(message.data, writer.uint32(18).fork()).ldelim(); + SignatureDescriptor_Data.encode(message.data, writer.uint32(18).fork()).ldelim() } if (!message.sequence.isZero()) { - writer.uint32(24).uint64(message.sequence); + writer.uint32(24).uint64(message.sequence) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): SignatureDescriptor { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSignatureDescriptor(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseSignatureDescriptor() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.publicKey = Any.decode(reader, reader.uint32()); - break; + message.publicKey = Any.decode(reader, reader.uint32()) + break case 2: - message.data = SignatureDescriptor_Data.decode(reader, reader.uint32()); - break; + message.data = SignatureDescriptor_Data.decode(reader, reader.uint32()) + break case 3: - message.sequence = reader.uint64() as Long; - break; + message.sequence = reader.uint64() as Long + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): SignatureDescriptor { return { publicKey: isSet(object.publicKey) ? Any.fromJSON(object.publicKey) : undefined, - data: isSet(object.data) ? SignatureDescriptor_Data.fromJSON(object.data) : undefined, + data: isSet(object.data) + ? SignatureDescriptor_Data.fromJSON(object.data) + : undefined, sequence: isSet(object.sequence) ? Long.fromValue(object.sequence) : Long.UZERO, - }; + } }, 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; + 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 }, - fromPartial, I>>(object: I): SignatureDescriptor { - const message = createBaseSignatureDescriptor(); - message.publicKey = (object.publicKey !== undefined && object.publicKey !== null) - ? Any.fromPartial(object.publicKey) - : undefined; - message.data = (object.data !== undefined && object.data !== null) - ? SignatureDescriptor_Data.fromPartial(object.data) - : undefined; - message.sequence = (object.sequence !== undefined && object.sequence !== null) - ? Long.fromValue(object.sequence) - : Long.UZERO; - return message; + fromPartial, I>>( + object: I, + ): SignatureDescriptor { + const message = createBaseSignatureDescriptor() + message.publicKey = + object.publicKey !== undefined && object.publicKey !== null + ? Any.fromPartial(object.publicKey) + : undefined + message.data = + object.data !== undefined && object.data !== null + ? SignatureDescriptor_Data.fromPartial(object.data) + : undefined + message.sequence = + object.sequence !== undefined && object.sequence !== null + ? Long.fromValue(object.sequence) + : Long.UZERO + return message }, -}; +} function createBaseSignatureDescriptor_Data(): SignatureDescriptor_Data { - return { single: undefined, multi: undefined }; + return { single: undefined, multi: undefined } } export const SignatureDescriptor_Data = { - encode(message: SignatureDescriptor_Data, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: SignatureDescriptor_Data, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.single !== undefined) { - SignatureDescriptor_Data_Single.encode(message.single, writer.uint32(10).fork()).ldelim(); + 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(); + SignatureDescriptor_Data_Multi.encode( + message.multi, + writer.uint32(18).fork(), + ).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): SignatureDescriptor_Data { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSignatureDescriptor_Data(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseSignatureDescriptor_Data() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.single = SignatureDescriptor_Data_Single.decode(reader, reader.uint32()); - break; + message.single = SignatureDescriptor_Data_Single.decode( + reader, + reader.uint32(), + ) + break case 2: - message.multi = SignatureDescriptor_Data_Multi.decode(reader, reader.uint32()); - break; + message.multi = SignatureDescriptor_Data_Multi.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): SignatureDescriptor_Data { return { - single: isSet(object.single) ? SignatureDescriptor_Data_Single.fromJSON(object.single) : undefined, - multi: isSet(object.multi) ? SignatureDescriptor_Data_Multi.fromJSON(object.multi) : undefined, - }; + single: isSet(object.single) + ? SignatureDescriptor_Data_Single.fromJSON(object.single) + : undefined, + multi: isSet(object.multi) + ? SignatureDescriptor_Data_Multi.fromJSON(object.multi) + : undefined, + } }, toJSON(message: SignatureDescriptor_Data): unknown { - const obj: any = {}; + const obj: any = {} message.single !== undefined && - (obj.single = message.single ? SignatureDescriptor_Data_Single.toJSON(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; + (obj.multi = message.multi + ? SignatureDescriptor_Data_Multi.toJSON(message.multi) + : undefined) + return obj }, - fromPartial, I>>(object: I): SignatureDescriptor_Data { - const message = createBaseSignatureDescriptor_Data(); - message.single = (object.single !== undefined && object.single !== null) - ? SignatureDescriptor_Data_Single.fromPartial(object.single) - : undefined; - message.multi = (object.multi !== undefined && object.multi !== null) - ? SignatureDescriptor_Data_Multi.fromPartial(object.multi) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): SignatureDescriptor_Data { + const message = createBaseSignatureDescriptor_Data() + message.single = + object.single !== undefined && object.single !== null + ? SignatureDescriptor_Data_Single.fromPartial(object.single) + : undefined + message.multi = + object.multi !== undefined && object.multi !== null + ? SignatureDescriptor_Data_Multi.fromPartial(object.multi) + : undefined + return message }, -}; +} function createBaseSignatureDescriptor_Data_Single(): SignatureDescriptor_Data_Single { - return { mode: 0, signature: new Uint8Array() }; + return { mode: 0, signature: new Uint8Array() } } export const SignatureDescriptor_Data_Single = { - encode(message: SignatureDescriptor_Data_Single, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: SignatureDescriptor_Data_Single, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.mode !== 0) { - writer.uint32(8).int32(message.mode); + writer.uint32(8).int32(message.mode) } if (message.signature.length !== 0) { - writer.uint32(18).bytes(message.signature); + writer.uint32(18).bytes(message.signature) } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): SignatureDescriptor_Data_Single { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSignatureDescriptor_Data_Single(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): SignatureDescriptor_Data_Single { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseSignatureDescriptor_Data_Single() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.mode = reader.int32() as any; - break; + message.mode = reader.int32() as any + break case 2: - message.signature = reader.bytes(); - break; + message.signature = reader.bytes() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): SignatureDescriptor_Data_Single { return { mode: isSet(object.mode) ? signModeFromJSON(object.mode) : 0, - signature: isSet(object.signature) ? bytesFromBase64(object.signature) : new Uint8Array(), - }; + signature: isSet(object.signature) + ? bytesFromBase64(object.signature) + : new Uint8Array(), + } }, toJSON(message: SignatureDescriptor_Data_Single): unknown { - const obj: any = {}; - message.mode !== undefined && (obj.mode = signModeToJSON(message.mode)); + 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; + (obj.signature = base64FromBytes( + message.signature !== undefined ? message.signature : new Uint8Array(), + )) + return obj }, fromPartial, I>>( object: I, ): SignatureDescriptor_Data_Single { - const message = createBaseSignatureDescriptor_Data_Single(); - message.mode = object.mode ?? 0; - message.signature = object.signature ?? new Uint8Array(); - return message; + const message = createBaseSignatureDescriptor_Data_Single() + message.mode = object.mode ?? 0 + message.signature = object.signature ?? new Uint8Array() + return message }, -}; +} function createBaseSignatureDescriptor_Data_Multi(): SignatureDescriptor_Data_Multi { - return { bitarray: undefined, signatures: [] }; + return { bitarray: undefined, signatures: [] } } export const SignatureDescriptor_Data_Multi = { - encode(message: SignatureDescriptor_Data_Multi, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: SignatureDescriptor_Data_Multi, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.bitarray !== undefined) { - CompactBitArray.encode(message.bitarray, writer.uint32(10).fork()).ldelim(); + CompactBitArray.encode(message.bitarray, writer.uint32(10).fork()).ldelim() } for (const v of message.signatures) { - SignatureDescriptor_Data.encode(v!, writer.uint32(18).fork()).ldelim(); + SignatureDescriptor_Data.encode(v!, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): SignatureDescriptor_Data_Multi { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSignatureDescriptor_Data_Multi(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): SignatureDescriptor_Data_Multi { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseSignatureDescriptor_Data_Multi() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.bitarray = CompactBitArray.decode(reader, reader.uint32()); - break; + message.bitarray = CompactBitArray.decode(reader, reader.uint32()) + break case 2: - message.signatures.push(SignatureDescriptor_Data.decode(reader, reader.uint32())); - break; + message.signatures.push( + SignatureDescriptor_Data.decode(reader, reader.uint32()), + ) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): SignatureDescriptor_Data_Multi { return { - bitarray: isSet(object.bitarray) ? CompactBitArray.fromJSON(object.bitarray) : undefined, + bitarray: isSet(object.bitarray) + ? CompactBitArray.fromJSON(object.bitarray) + : undefined, signatures: Array.isArray(object?.signatures) ? object.signatures.map((e: any) => SignatureDescriptor_Data.fromJSON(e)) : [], - }; + } }, toJSON(message: SignatureDescriptor_Data_Multi): unknown { - const obj: any = {}; + const obj: any = {} message.bitarray !== undefined && - (obj.bitarray = message.bitarray ? CompactBitArray.toJSON(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); + obj.signatures = message.signatures.map((e) => + e ? SignatureDescriptor_Data.toJSON(e) : undefined, + ) } else { - obj.signatures = []; + obj.signatures = [] } - return obj; + return obj }, fromPartial, I>>( object: I, ): SignatureDescriptor_Data_Multi { - const message = createBaseSignatureDescriptor_Data_Multi(); - message.bitarray = (object.bitarray !== undefined && object.bitarray !== null) - ? CompactBitArray.fromPartial(object.bitarray) - : undefined; - message.signatures = object.signatures?.map((e) => SignatureDescriptor_Data.fromPartial(e)) || []; - return message; + const message = createBaseSignatureDescriptor_Data_Multi() + message.bitarray = + object.bitarray !== undefined && object.bitarray !== null + ? CompactBitArray.fromPartial(object.bitarray) + : undefined + message.signatures = + object.signatures?.map((e) => SignatureDescriptor_Data.fromPartial(e)) || [] + return message }, -}; +} -declare var self: any | undefined; -declare var window: any | undefined; -declare var global: any | undefined; +declare var self: any | undefined +declare var window: any | undefined +declare var global: any | undefined var globalThis: any = (() => { - if (typeof globalThis !== "undefined") { - return globalThis; - } - if (typeof self !== "undefined") { - return self; - } - if (typeof window !== "undefined") { - return window; - } - if (typeof global !== "undefined") { - return global; - } - throw "Unable to locate global object"; -})(); - + if (typeof globalThis !== "undefined") return globalThis + if (typeof self !== "undefined") return self + if (typeof window !== "undefined") return window + if (typeof global !== "undefined") return global + throw "Unable to locate global object" +})() + +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")) function bytesFromBase64(b64: string): Uint8Array { - if (globalThis.Buffer) { - return Uint8Array.from(globalThis.Buffer.from(b64, "base64")); - } else { - const bin = globalThis.atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; + 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 } +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")) function base64FromBytes(arr: Uint8Array): string { - if (globalThis.Buffer) { - return globalThis.Buffer.from(arr).toString("base64"); - } else { - const bin: string[] = []; - arr.forEach((byte) => { - bin.push(String.fromCharCode(byte)); - }); - return globalThis.btoa(bin.join("")); - } + const bin: string[] = [] + arr.forEach((byte) => { + bin.push(String.fromCharCode(byte)) + }) + return btoa(bin.join("")) } -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/cosmos/tx/v1beta1/service.ts b/packages/protojs/src/cosmos/tx/v1beta1/service.ts index 101d7097..9125d321 100644 --- a/packages/protojs/src/cosmos/tx/v1beta1/service.ts +++ b/packages/protojs/src/cosmos/tx/v1beta1/service.ts @@ -1,13 +1,13 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { Block } from "../../../tendermint/types/block"; -import { BlockID } from "../../../tendermint/types/types"; -import { GasInfo, Result, TxResponse } from "../../base/abci/v1beta1/abci"; -import { PageRequest, PageResponse } from "../../base/query/v1beta1/pagination"; -import { Tx } from "./tx"; +import { PageRequest, PageResponse } from "../../base/query/v1beta1/pagination" +import { TxResponse, GasInfo, Result } from "../../base/abci/v1beta1/abci" +import { Tx } from "./tx" +import { BlockID } from "../../../tendermint/types/types" +import { Block } from "../../../tendermint/types/block" +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "cosmos.tx.v1beta1"; +export const protobufPackage = "cosmos.tx.v1beta1" /** OrderBy defines the sorting order */ export enum OrderBy { @@ -24,31 +24,31 @@ export function orderByFromJSON(object: any): OrderBy { switch (object) { case 0: case "ORDER_BY_UNSPECIFIED": - return OrderBy.ORDER_BY_UNSPECIFIED; + return OrderBy.ORDER_BY_UNSPECIFIED case 1: case "ORDER_BY_ASC": - return OrderBy.ORDER_BY_ASC; + return OrderBy.ORDER_BY_ASC case 2: case "ORDER_BY_DESC": - return OrderBy.ORDER_BY_DESC; + return OrderBy.ORDER_BY_DESC case -1: case "UNRECOGNIZED": default: - return OrderBy.UNRECOGNIZED; + return OrderBy.UNRECOGNIZED } } export function orderByToJSON(object: OrderBy): string { switch (object) { case OrderBy.ORDER_BY_UNSPECIFIED: - return "ORDER_BY_UNSPECIFIED"; + return "ORDER_BY_UNSPECIFIED" case OrderBy.ORDER_BY_ASC: - return "ORDER_BY_ASC"; + return "ORDER_BY_ASC" case OrderBy.ORDER_BY_DESC: - return "ORDER_BY_DESC"; + return "ORDER_BY_DESC" case OrderBy.UNRECOGNIZED: default: - return "UNRECOGNIZED"; + return "UNRECOGNIZED" } } @@ -78,36 +78,36 @@ export function broadcastModeFromJSON(object: any): BroadcastMode { switch (object) { case 0: case "BROADCAST_MODE_UNSPECIFIED": - return BroadcastMode.BROADCAST_MODE_UNSPECIFIED; + return BroadcastMode.BROADCAST_MODE_UNSPECIFIED case 1: case "BROADCAST_MODE_BLOCK": - return BroadcastMode.BROADCAST_MODE_BLOCK; + return BroadcastMode.BROADCAST_MODE_BLOCK case 2: case "BROADCAST_MODE_SYNC": - return BroadcastMode.BROADCAST_MODE_SYNC; + return BroadcastMode.BROADCAST_MODE_SYNC case 3: case "BROADCAST_MODE_ASYNC": - return BroadcastMode.BROADCAST_MODE_ASYNC; + return BroadcastMode.BROADCAST_MODE_ASYNC case -1: case "UNRECOGNIZED": default: - return BroadcastMode.UNRECOGNIZED; + return BroadcastMode.UNRECOGNIZED } } export function broadcastModeToJSON(object: BroadcastMode): string { switch (object) { case BroadcastMode.BROADCAST_MODE_UNSPECIFIED: - return "BROADCAST_MODE_UNSPECIFIED"; + return "BROADCAST_MODE_UNSPECIFIED" case BroadcastMode.BROADCAST_MODE_BLOCK: - return "BROADCAST_MODE_BLOCK"; + return "BROADCAST_MODE_BLOCK" case BroadcastMode.BROADCAST_MODE_SYNC: - return "BROADCAST_MODE_SYNC"; + return "BROADCAST_MODE_SYNC" case BroadcastMode.BROADCAST_MODE_ASYNC: - return "BROADCAST_MODE_ASYNC"; + return "BROADCAST_MODE_ASYNC" case BroadcastMode.UNRECOGNIZED: default: - return "UNRECOGNIZED"; + return "UNRECOGNIZED" } } @@ -117,10 +117,10 @@ export function broadcastModeToJSON(object: BroadcastMode): string { */ export interface GetTxsEventRequest { /** events is the list of transaction event type. */ - events: string[]; + events: string[] /** pagination defines a pagination for the request. */ - pagination?: PageRequest; - orderBy: OrderBy; + pagination?: PageRequest + orderBy: OrderBy } /** @@ -129,11 +129,11 @@ export interface GetTxsEventRequest { */ export interface GetTxsEventResponse { /** txs is the list of queried transactions. */ - txs: Tx[]; + txs: Tx[] /** tx_responses is the list of queried TxResponses. */ - txResponses: TxResponse[]; + txResponses: TxResponse[] /** pagination defines a pagination for the response. */ - pagination?: PageResponse; + pagination?: PageResponse } /** @@ -142,8 +142,8 @@ export interface GetTxsEventResponse { */ export interface BroadcastTxRequest { /** tx_bytes is the raw transaction. */ - txBytes: Uint8Array; - mode: BroadcastMode; + txBytes: Uint8Array + mode: BroadcastMode } /** @@ -152,7 +152,7 @@ export interface BroadcastTxRequest { */ export interface BroadcastTxResponse { /** tx_response is the queried TxResponses. */ - txResponse?: TxResponse; + txResponse?: TxResponse } /** @@ -166,13 +166,13 @@ export interface SimulateRequest { * * @deprecated */ - tx?: Tx; + tx?: Tx /** * tx_bytes is the raw transaction. * * Since: cosmos-sdk 0.43 */ - txBytes: Uint8Array; + txBytes: Uint8Array } /** @@ -181,9 +181,9 @@ export interface SimulateRequest { */ export interface SimulateResponse { /** gas_info is the information about gas used in the simulation. */ - gasInfo?: GasInfo; + gasInfo?: GasInfo /** result is the result of the simulation. */ - result?: Result; + result?: Result } /** @@ -192,15 +192,15 @@ export interface SimulateResponse { */ export interface GetTxRequest { /** hash is the tx hash to query, encoded as a hex string. */ - hash: string; + hash: string } /** GetTxResponse is the response type for the Service.GetTx method. */ export interface GetTxResponse { /** tx is the queried transaction. */ - tx?: Tx; + tx?: Tx /** tx_response is the queried TxResponses. */ - txResponse?: TxResponse; + txResponse?: TxResponse } /** @@ -211,9 +211,9 @@ export interface GetTxResponse { */ export interface GetBlockWithTxsRequest { /** height is the height of the block to query. */ - height: Long; + height: Long /** pagination defines a pagination for the request. */ - pagination?: PageRequest; + pagination?: PageRequest } /** @@ -223,612 +223,710 @@ export interface GetBlockWithTxsRequest { */ export interface GetBlockWithTxsResponse { /** txs are the transactions in the block. */ - txs: Tx[]; - blockId?: BlockID; - block?: Block; + txs: Tx[] + blockId?: BlockID + block?: Block /** pagination defines a pagination for the response. */ - pagination?: PageResponse; + pagination?: PageResponse } function createBaseGetTxsEventRequest(): GetTxsEventRequest { - return { events: [], pagination: undefined, orderBy: 0 }; + return { events: [], pagination: undefined, orderBy: 0 } } export const GetTxsEventRequest = { - encode(message: GetTxsEventRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: GetTxsEventRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { for (const v of message.events) { - writer.uint32(10).string(v!); + writer.uint32(10).string(v!) } if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim() } if (message.orderBy !== 0) { - writer.uint32(24).int32(message.orderBy); + writer.uint32(24).int32(message.orderBy) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): GetTxsEventRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetTxsEventRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseGetTxsEventRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.events.push(reader.string()); - break; + message.events.push(reader.string()) + break case 2: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; + message.pagination = PageRequest.decode(reader, reader.uint32()) + break case 3: - message.orderBy = reader.int32() as any; - break; + message.orderBy = reader.int32() as any + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): GetTxsEventRequest { return { - events: Array.isArray(object?.events) ? object.events.map((e: any) => String(e)) : [], - pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined, + events: Array.isArray(object?.events) + ? object.events.map((e: any) => String(e)) + : [], + pagination: isSet(object.pagination) + ? PageRequest.fromJSON(object.pagination) + : undefined, orderBy: isSet(object.orderBy) ? orderByFromJSON(object.orderBy) : 0, - }; + } }, toJSON(message: GetTxsEventRequest): unknown { - const obj: any = {}; + const obj: any = {} if (message.events) { - obj.events = message.events.map((e) => e); + obj.events = message.events.map((e) => e) } else { - obj.events = []; + obj.events = [] } message.pagination !== undefined && - (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); - message.orderBy !== undefined && (obj.orderBy = orderByToJSON(message.orderBy)); - return obj; + (obj.pagination = message.pagination + ? PageRequest.toJSON(message.pagination) + : undefined) + message.orderBy !== undefined && (obj.orderBy = orderByToJSON(message.orderBy)) + return obj }, - fromPartial, I>>(object: I): GetTxsEventRequest { - const message = createBaseGetTxsEventRequest(); - message.events = object.events?.map((e) => e) || []; - message.pagination = (object.pagination !== undefined && object.pagination !== null) - ? PageRequest.fromPartial(object.pagination) - : undefined; - message.orderBy = object.orderBy ?? 0; - return message; + fromPartial, I>>( + object: I, + ): GetTxsEventRequest { + const message = createBaseGetTxsEventRequest() + message.events = object.events?.map((e) => e) || [] + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageRequest.fromPartial(object.pagination) + : undefined + message.orderBy = object.orderBy ?? 0 + return message }, -}; +} function createBaseGetTxsEventResponse(): GetTxsEventResponse { - return { txs: [], txResponses: [], pagination: undefined }; + return { txs: [], txResponses: [], pagination: undefined } } export const GetTxsEventResponse = { - encode(message: GetTxsEventResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: GetTxsEventResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { for (const v of message.txs) { - Tx.encode(v!, writer.uint32(10).fork()).ldelim(); + Tx.encode(v!, writer.uint32(10).fork()).ldelim() } for (const v of message.txResponses) { - TxResponse.encode(v!, writer.uint32(18).fork()).ldelim(); + TxResponse.encode(v!, writer.uint32(18).fork()).ldelim() } if (message.pagination !== undefined) { - PageResponse.encode(message.pagination, writer.uint32(26).fork()).ldelim(); + PageResponse.encode(message.pagination, writer.uint32(26).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): GetTxsEventResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetTxsEventResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseGetTxsEventResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.txs.push(Tx.decode(reader, reader.uint32())); - break; + message.txs.push(Tx.decode(reader, reader.uint32())) + break case 2: - message.txResponses.push(TxResponse.decode(reader, reader.uint32())); - break; + message.txResponses.push(TxResponse.decode(reader, reader.uint32())) + break case 3: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; + message.pagination = PageResponse.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): GetTxsEventResponse { return { txs: Array.isArray(object?.txs) ? object.txs.map((e: any) => Tx.fromJSON(e)) : [], - txResponses: Array.isArray(object?.txResponses) ? object.txResponses.map((e: any) => TxResponse.fromJSON(e)) : [], - pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, - }; + txResponses: Array.isArray(object?.txResponses) + ? object.txResponses.map((e: any) => TxResponse.fromJSON(e)) + : [], + pagination: isSet(object.pagination) + ? PageResponse.fromJSON(object.pagination) + : undefined, + } }, toJSON(message: GetTxsEventResponse): unknown { - const obj: any = {}; + const obj: any = {} if (message.txs) { - obj.txs = message.txs.map((e) => e ? Tx.toJSON(e) : undefined); + obj.txs = message.txs.map((e) => (e ? Tx.toJSON(e) : undefined)) } else { - obj.txs = []; + obj.txs = [] } if (message.txResponses) { - obj.txResponses = message.txResponses.map((e) => e ? TxResponse.toJSON(e) : undefined); + obj.txResponses = message.txResponses.map((e) => + e ? TxResponse.toJSON(e) : undefined, + ) } else { - obj.txResponses = []; + obj.txResponses = [] } message.pagination !== undefined && - (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); - return obj; + (obj.pagination = message.pagination + ? PageResponse.toJSON(message.pagination) + : undefined) + return obj }, - fromPartial, I>>(object: I): GetTxsEventResponse { - const message = createBaseGetTxsEventResponse(); - message.txs = object.txs?.map((e) => Tx.fromPartial(e)) || []; - message.txResponses = object.txResponses?.map((e) => TxResponse.fromPartial(e)) || []; - message.pagination = (object.pagination !== undefined && object.pagination !== null) - ? PageResponse.fromPartial(object.pagination) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): GetTxsEventResponse { + const message = createBaseGetTxsEventResponse() + message.txs = object.txs?.map((e) => Tx.fromPartial(e)) || [] + message.txResponses = + object.txResponses?.map((e) => TxResponse.fromPartial(e)) || [] + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageResponse.fromPartial(object.pagination) + : undefined + return message }, -}; +} function createBaseBroadcastTxRequest(): BroadcastTxRequest { - return { txBytes: new Uint8Array(), mode: 0 }; + return { txBytes: new Uint8Array(), mode: 0 } } export const BroadcastTxRequest = { - encode(message: BroadcastTxRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: BroadcastTxRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.txBytes.length !== 0) { - writer.uint32(10).bytes(message.txBytes); + writer.uint32(10).bytes(message.txBytes) } if (message.mode !== 0) { - writer.uint32(16).int32(message.mode); + writer.uint32(16).int32(message.mode) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): BroadcastTxRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseBroadcastTxRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseBroadcastTxRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.txBytes = reader.bytes(); - break; + message.txBytes = reader.bytes() + break case 2: - message.mode = reader.int32() as any; - break; + message.mode = reader.int32() as any + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): BroadcastTxRequest { return { - txBytes: isSet(object.txBytes) ? bytesFromBase64(object.txBytes) : new Uint8Array(), + txBytes: isSet(object.txBytes) + ? bytesFromBase64(object.txBytes) + : new Uint8Array(), mode: isSet(object.mode) ? broadcastModeFromJSON(object.mode) : 0, - }; + } }, toJSON(message: BroadcastTxRequest): unknown { - const obj: any = {}; + const obj: any = {} message.txBytes !== undefined && - (obj.txBytes = base64FromBytes(message.txBytes !== undefined ? message.txBytes : new Uint8Array())); - message.mode !== undefined && (obj.mode = broadcastModeToJSON(message.mode)); - return obj; + (obj.txBytes = base64FromBytes( + message.txBytes !== undefined ? message.txBytes : new Uint8Array(), + )) + message.mode !== undefined && (obj.mode = broadcastModeToJSON(message.mode)) + return obj }, - fromPartial, I>>(object: I): BroadcastTxRequest { - const message = createBaseBroadcastTxRequest(); - message.txBytes = object.txBytes ?? new Uint8Array(); - message.mode = object.mode ?? 0; - return message; + fromPartial, I>>( + object: I, + ): BroadcastTxRequest { + const message = createBaseBroadcastTxRequest() + message.txBytes = object.txBytes ?? new Uint8Array() + message.mode = object.mode ?? 0 + return message }, -}; +} function createBaseBroadcastTxResponse(): BroadcastTxResponse { - return { txResponse: undefined }; + return { txResponse: undefined } } export const BroadcastTxResponse = { - encode(message: BroadcastTxResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: BroadcastTxResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.txResponse !== undefined) { - TxResponse.encode(message.txResponse, writer.uint32(10).fork()).ldelim(); + TxResponse.encode(message.txResponse, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): BroadcastTxResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseBroadcastTxResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseBroadcastTxResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.txResponse = TxResponse.decode(reader, reader.uint32()); - break; + message.txResponse = TxResponse.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): BroadcastTxResponse { - return { txResponse: isSet(object.txResponse) ? TxResponse.fromJSON(object.txResponse) : undefined }; + return { + txResponse: isSet(object.txResponse) + ? TxResponse.fromJSON(object.txResponse) + : undefined, + } }, toJSON(message: BroadcastTxResponse): unknown { - const obj: any = {}; + const obj: any = {} message.txResponse !== undefined && - (obj.txResponse = message.txResponse ? TxResponse.toJSON(message.txResponse) : undefined); - return obj; + (obj.txResponse = message.txResponse + ? TxResponse.toJSON(message.txResponse) + : undefined) + return obj }, - fromPartial, I>>(object: I): BroadcastTxResponse { - const message = createBaseBroadcastTxResponse(); - message.txResponse = (object.txResponse !== undefined && object.txResponse !== null) - ? TxResponse.fromPartial(object.txResponse) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): BroadcastTxResponse { + const message = createBaseBroadcastTxResponse() + message.txResponse = + object.txResponse !== undefined && object.txResponse !== null + ? TxResponse.fromPartial(object.txResponse) + : undefined + return message }, -}; +} function createBaseSimulateRequest(): SimulateRequest { - return { tx: undefined, txBytes: new Uint8Array() }; + return { tx: undefined, txBytes: new Uint8Array() } } export const SimulateRequest = { - encode(message: SimulateRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: SimulateRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.tx !== undefined) { - Tx.encode(message.tx, writer.uint32(10).fork()).ldelim(); + Tx.encode(message.tx, writer.uint32(10).fork()).ldelim() } if (message.txBytes.length !== 0) { - writer.uint32(18).bytes(message.txBytes); + writer.uint32(18).bytes(message.txBytes) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): SimulateRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSimulateRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseSimulateRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.tx = Tx.decode(reader, reader.uint32()); - break; + message.tx = Tx.decode(reader, reader.uint32()) + break case 2: - message.txBytes = reader.bytes(); - break; + message.txBytes = reader.bytes() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): SimulateRequest { return { tx: isSet(object.tx) ? Tx.fromJSON(object.tx) : undefined, - txBytes: isSet(object.txBytes) ? bytesFromBase64(object.txBytes) : new Uint8Array(), - }; + txBytes: isSet(object.txBytes) + ? bytesFromBase64(object.txBytes) + : new Uint8Array(), + } }, toJSON(message: SimulateRequest): unknown { - const obj: any = {}; - message.tx !== undefined && (obj.tx = message.tx ? Tx.toJSON(message.tx) : undefined); + const obj: any = {} + message.tx !== undefined && + (obj.tx = message.tx ? Tx.toJSON(message.tx) : undefined) message.txBytes !== undefined && - (obj.txBytes = base64FromBytes(message.txBytes !== undefined ? message.txBytes : new Uint8Array())); - return obj; + (obj.txBytes = base64FromBytes( + message.txBytes !== undefined ? message.txBytes : new Uint8Array(), + )) + return obj }, - fromPartial, I>>(object: I): SimulateRequest { - const message = createBaseSimulateRequest(); - message.tx = (object.tx !== undefined && object.tx !== null) ? Tx.fromPartial(object.tx) : undefined; - message.txBytes = object.txBytes ?? new Uint8Array(); - return message; + fromPartial, I>>( + object: I, + ): SimulateRequest { + const message = createBaseSimulateRequest() + message.tx = + object.tx !== undefined && object.tx !== null + ? Tx.fromPartial(object.tx) + : undefined + message.txBytes = object.txBytes ?? new Uint8Array() + return message }, -}; +} function createBaseSimulateResponse(): SimulateResponse { - return { gasInfo: undefined, result: undefined }; + return { gasInfo: undefined, result: undefined } } export const SimulateResponse = { - encode(message: SimulateResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: SimulateResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.gasInfo !== undefined) { - GasInfo.encode(message.gasInfo, writer.uint32(10).fork()).ldelim(); + GasInfo.encode(message.gasInfo, writer.uint32(10).fork()).ldelim() } if (message.result !== undefined) { - Result.encode(message.result, writer.uint32(18).fork()).ldelim(); + Result.encode(message.result, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): SimulateResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSimulateResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseSimulateResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.gasInfo = GasInfo.decode(reader, reader.uint32()); - break; + message.gasInfo = GasInfo.decode(reader, reader.uint32()) + break case 2: - message.result = Result.decode(reader, reader.uint32()); - break; + message.result = Result.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): SimulateResponse { return { gasInfo: isSet(object.gasInfo) ? GasInfo.fromJSON(object.gasInfo) : undefined, result: isSet(object.result) ? Result.fromJSON(object.result) : undefined, - }; + } }, toJSON(message: SimulateResponse): unknown { - const obj: any = {}; - message.gasInfo !== undefined && (obj.gasInfo = message.gasInfo ? GasInfo.toJSON(message.gasInfo) : undefined); - message.result !== undefined && (obj.result = message.result ? Result.toJSON(message.result) : undefined); - return obj; + const obj: any = {} + message.gasInfo !== undefined && + (obj.gasInfo = message.gasInfo ? GasInfo.toJSON(message.gasInfo) : undefined) + message.result !== undefined && + (obj.result = message.result ? Result.toJSON(message.result) : undefined) + return obj }, - fromPartial, I>>(object: I): SimulateResponse { - const message = createBaseSimulateResponse(); - message.gasInfo = (object.gasInfo !== undefined && object.gasInfo !== null) - ? GasInfo.fromPartial(object.gasInfo) - : undefined; - message.result = (object.result !== undefined && object.result !== null) - ? Result.fromPartial(object.result) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): SimulateResponse { + const message = createBaseSimulateResponse() + message.gasInfo = + object.gasInfo !== undefined && object.gasInfo !== null + ? GasInfo.fromPartial(object.gasInfo) + : undefined + message.result = + object.result !== undefined && object.result !== null + ? Result.fromPartial(object.result) + : undefined + return message }, -}; +} function createBaseGetTxRequest(): GetTxRequest { - return { hash: "" }; + return { hash: "" } } export const GetTxRequest = { encode(message: GetTxRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.hash !== "") { - writer.uint32(10).string(message.hash); + writer.uint32(10).string(message.hash) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): GetTxRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetTxRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseGetTxRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.hash = reader.string(); - break; + message.hash = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): GetTxRequest { - return { hash: isSet(object.hash) ? String(object.hash) : "" }; + return { + hash: isSet(object.hash) ? String(object.hash) : "", + } }, toJSON(message: GetTxRequest): unknown { - const obj: any = {}; - message.hash !== undefined && (obj.hash = message.hash); - return obj; + const obj: any = {} + message.hash !== undefined && (obj.hash = message.hash) + return obj }, fromPartial, I>>(object: I): GetTxRequest { - const message = createBaseGetTxRequest(); - message.hash = object.hash ?? ""; - return message; + const message = createBaseGetTxRequest() + message.hash = object.hash ?? "" + return message }, -}; +} function createBaseGetTxResponse(): GetTxResponse { - return { tx: undefined, txResponse: undefined }; + return { tx: undefined, txResponse: undefined } } export const GetTxResponse = { encode(message: GetTxResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.tx !== undefined) { - Tx.encode(message.tx, writer.uint32(10).fork()).ldelim(); + Tx.encode(message.tx, writer.uint32(10).fork()).ldelim() } if (message.txResponse !== undefined) { - TxResponse.encode(message.txResponse, writer.uint32(18).fork()).ldelim(); + TxResponse.encode(message.txResponse, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): GetTxResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetTxResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseGetTxResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.tx = Tx.decode(reader, reader.uint32()); - break; + message.tx = Tx.decode(reader, reader.uint32()) + break case 2: - message.txResponse = TxResponse.decode(reader, reader.uint32()); - break; + message.txResponse = TxResponse.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): GetTxResponse { return { tx: isSet(object.tx) ? Tx.fromJSON(object.tx) : undefined, - txResponse: isSet(object.txResponse) ? TxResponse.fromJSON(object.txResponse) : undefined, - }; + txResponse: isSet(object.txResponse) + ? TxResponse.fromJSON(object.txResponse) + : undefined, + } }, toJSON(message: GetTxResponse): unknown { - const obj: any = {}; - message.tx !== undefined && (obj.tx = message.tx ? Tx.toJSON(message.tx) : undefined); + const obj: any = {} + message.tx !== undefined && + (obj.tx = message.tx ? Tx.toJSON(message.tx) : undefined) message.txResponse !== undefined && - (obj.txResponse = message.txResponse ? TxResponse.toJSON(message.txResponse) : undefined); - return obj; + (obj.txResponse = message.txResponse + ? TxResponse.toJSON(message.txResponse) + : undefined) + return obj }, - fromPartial, I>>(object: I): GetTxResponse { - const message = createBaseGetTxResponse(); - message.tx = (object.tx !== undefined && object.tx !== null) ? Tx.fromPartial(object.tx) : undefined; - message.txResponse = (object.txResponse !== undefined && object.txResponse !== null) - ? TxResponse.fromPartial(object.txResponse) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): GetTxResponse { + const message = createBaseGetTxResponse() + message.tx = + object.tx !== undefined && object.tx !== null + ? Tx.fromPartial(object.tx) + : undefined + message.txResponse = + object.txResponse !== undefined && object.txResponse !== null + ? TxResponse.fromPartial(object.txResponse) + : undefined + return message }, -}; +} function createBaseGetBlockWithTxsRequest(): GetBlockWithTxsRequest { - return { height: Long.ZERO, pagination: undefined }; + return { height: Long.ZERO, pagination: undefined } } export const GetBlockWithTxsRequest = { - encode(message: GetBlockWithTxsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: GetBlockWithTxsRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (!message.height.isZero()) { - writer.uint32(8).int64(message.height); + writer.uint32(8).int64(message.height) } if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): GetBlockWithTxsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetBlockWithTxsRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseGetBlockWithTxsRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.height = reader.int64() as Long; - break; + message.height = reader.int64() as Long + break case 2: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; + message.pagination = PageRequest.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): GetBlockWithTxsRequest { return { height: isSet(object.height) ? Long.fromValue(object.height) : Long.ZERO, - pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined, - }; + pagination: isSet(object.pagination) + ? PageRequest.fromJSON(object.pagination) + : undefined, + } }, toJSON(message: GetBlockWithTxsRequest): unknown { - const obj: any = {}; - message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); + const obj: any = {} + message.height !== undefined && + (obj.height = (message.height || Long.ZERO).toString()) message.pagination !== undefined && - (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); - return obj; + (obj.pagination = message.pagination + ? PageRequest.toJSON(message.pagination) + : undefined) + return obj }, - fromPartial, I>>(object: I): GetBlockWithTxsRequest { - const message = createBaseGetBlockWithTxsRequest(); - message.height = (object.height !== undefined && object.height !== null) - ? Long.fromValue(object.height) - : Long.ZERO; - message.pagination = (object.pagination !== undefined && object.pagination !== null) - ? PageRequest.fromPartial(object.pagination) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): GetBlockWithTxsRequest { + const message = createBaseGetBlockWithTxsRequest() + message.height = + object.height !== undefined && object.height !== null + ? Long.fromValue(object.height) + : Long.ZERO + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageRequest.fromPartial(object.pagination) + : undefined + return message }, -}; +} function createBaseGetBlockWithTxsResponse(): GetBlockWithTxsResponse { - return { txs: [], blockId: undefined, block: undefined, pagination: undefined }; + return { txs: [], blockId: undefined, block: undefined, pagination: undefined } } export const GetBlockWithTxsResponse = { - encode(message: GetBlockWithTxsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: GetBlockWithTxsResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { for (const v of message.txs) { - Tx.encode(v!, writer.uint32(10).fork()).ldelim(); + Tx.encode(v!, writer.uint32(10).fork()).ldelim() } if (message.blockId !== undefined) { - BlockID.encode(message.blockId, writer.uint32(18).fork()).ldelim(); + BlockID.encode(message.blockId, writer.uint32(18).fork()).ldelim() } if (message.block !== undefined) { - Block.encode(message.block, writer.uint32(26).fork()).ldelim(); + Block.encode(message.block, writer.uint32(26).fork()).ldelim() } if (message.pagination !== undefined) { - PageResponse.encode(message.pagination, writer.uint32(34).fork()).ldelim(); + PageResponse.encode(message.pagination, writer.uint32(34).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): GetBlockWithTxsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetBlockWithTxsResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseGetBlockWithTxsResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.txs.push(Tx.decode(reader, reader.uint32())); - break; + message.txs.push(Tx.decode(reader, reader.uint32())) + break case 2: - message.blockId = BlockID.decode(reader, reader.uint32()); - break; + message.blockId = BlockID.decode(reader, reader.uint32()) + break case 3: - message.block = Block.decode(reader, reader.uint32()); - break; + message.block = Block.decode(reader, reader.uint32()) + break case 4: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; + message.pagination = PageResponse.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): GetBlockWithTxsResponse { @@ -836,162 +934,177 @@ export const GetBlockWithTxsResponse = { txs: Array.isArray(object?.txs) ? object.txs.map((e: any) => Tx.fromJSON(e)) : [], blockId: isSet(object.blockId) ? BlockID.fromJSON(object.blockId) : undefined, block: isSet(object.block) ? Block.fromJSON(object.block) : undefined, - pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, - }; + pagination: isSet(object.pagination) + ? PageResponse.fromJSON(object.pagination) + : undefined, + } }, toJSON(message: GetBlockWithTxsResponse): unknown { - const obj: any = {}; + const obj: any = {} if (message.txs) { - obj.txs = message.txs.map((e) => e ? Tx.toJSON(e) : undefined); + obj.txs = message.txs.map((e) => (e ? Tx.toJSON(e) : undefined)) } else { - obj.txs = []; + obj.txs = [] } - message.blockId !== undefined && (obj.blockId = message.blockId ? BlockID.toJSON(message.blockId) : undefined); - message.block !== undefined && (obj.block = message.block ? Block.toJSON(message.block) : undefined); + message.blockId !== undefined && + (obj.blockId = message.blockId ? BlockID.toJSON(message.blockId) : undefined) + message.block !== undefined && + (obj.block = message.block ? Block.toJSON(message.block) : undefined) message.pagination !== undefined && - (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); - return obj; + (obj.pagination = message.pagination + ? PageResponse.toJSON(message.pagination) + : undefined) + return obj }, - fromPartial, I>>(object: I): GetBlockWithTxsResponse { - const message = createBaseGetBlockWithTxsResponse(); - message.txs = object.txs?.map((e) => Tx.fromPartial(e)) || []; - message.blockId = (object.blockId !== undefined && object.blockId !== null) - ? BlockID.fromPartial(object.blockId) - : undefined; - message.block = (object.block !== undefined && object.block !== null) ? Block.fromPartial(object.block) : undefined; - message.pagination = (object.pagination !== undefined && object.pagination !== null) - ? PageResponse.fromPartial(object.pagination) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): GetBlockWithTxsResponse { + const message = createBaseGetBlockWithTxsResponse() + message.txs = object.txs?.map((e) => Tx.fromPartial(e)) || [] + message.blockId = + object.blockId !== undefined && object.blockId !== null + ? BlockID.fromPartial(object.blockId) + : undefined + message.block = + object.block !== undefined && object.block !== null + ? Block.fromPartial(object.block) + : undefined + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageResponse.fromPartial(object.pagination) + : undefined + return message }, -}; +} /** Service defines a gRPC service for interacting with transactions. */ export interface Service { /** Simulate simulates executing a transaction for estimating gas usage. */ - Simulate(request: SimulateRequest): Promise; + Simulate(request: SimulateRequest): Promise /** GetTx fetches a tx by hash. */ - GetTx(request: GetTxRequest): Promise; + GetTx(request: GetTxRequest): Promise /** BroadcastTx broadcast transaction. */ - BroadcastTx(request: BroadcastTxRequest): Promise; + BroadcastTx(request: BroadcastTxRequest): Promise /** GetTxsEvent fetches txs by event. */ - GetTxsEvent(request: GetTxsEventRequest): Promise; + GetTxsEvent(request: GetTxsEventRequest): Promise /** * GetBlockWithTxs fetches a block with decoded txs. * * Since: cosmos-sdk 0.45.2 */ - GetBlockWithTxs(request: GetBlockWithTxsRequest): Promise; + GetBlockWithTxs(request: GetBlockWithTxsRequest): Promise } export class ServiceClientImpl implements Service { - private readonly rpc: Rpc; + private readonly rpc: Rpc constructor(rpc: Rpc) { - this.rpc = rpc; - this.Simulate = this.Simulate.bind(this); - this.GetTx = this.GetTx.bind(this); - this.BroadcastTx = this.BroadcastTx.bind(this); - this.GetTxsEvent = this.GetTxsEvent.bind(this); - this.GetBlockWithTxs = this.GetBlockWithTxs.bind(this); + this.rpc = rpc + this.Simulate = this.Simulate.bind(this) + this.GetTx = this.GetTx.bind(this) + this.BroadcastTx = this.BroadcastTx.bind(this) + this.GetTxsEvent = this.GetTxsEvent.bind(this) + this.GetBlockWithTxs = this.GetBlockWithTxs.bind(this) } Simulate(request: SimulateRequest): Promise { - const data = SimulateRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.tx.v1beta1.Service", "Simulate", data); - return promise.then((data) => SimulateResponse.decode(new _m0.Reader(data))); + const data = SimulateRequest.encode(request).finish() + const promise = this.rpc.request("cosmos.tx.v1beta1.Service", "Simulate", data) + return promise.then((data) => SimulateResponse.decode(new _m0.Reader(data))) } GetTx(request: GetTxRequest): Promise { - const data = GetTxRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.tx.v1beta1.Service", "GetTx", data); - return promise.then((data) => GetTxResponse.decode(new _m0.Reader(data))); + const data = GetTxRequest.encode(request).finish() + const promise = this.rpc.request("cosmos.tx.v1beta1.Service", "GetTx", data) + return promise.then((data) => GetTxResponse.decode(new _m0.Reader(data))) } BroadcastTx(request: BroadcastTxRequest): Promise { - const data = BroadcastTxRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.tx.v1beta1.Service", "BroadcastTx", data); - return promise.then((data) => BroadcastTxResponse.decode(new _m0.Reader(data))); + const data = BroadcastTxRequest.encode(request).finish() + const promise = this.rpc.request("cosmos.tx.v1beta1.Service", "BroadcastTx", data) + return promise.then((data) => BroadcastTxResponse.decode(new _m0.Reader(data))) } GetTxsEvent(request: GetTxsEventRequest): Promise { - const data = GetTxsEventRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.tx.v1beta1.Service", "GetTxsEvent", data); - return promise.then((data) => GetTxsEventResponse.decode(new _m0.Reader(data))); + const data = GetTxsEventRequest.encode(request).finish() + const promise = this.rpc.request("cosmos.tx.v1beta1.Service", "GetTxsEvent", data) + return promise.then((data) => GetTxsEventResponse.decode(new _m0.Reader(data))) } GetBlockWithTxs(request: GetBlockWithTxsRequest): Promise { - const data = GetBlockWithTxsRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.tx.v1beta1.Service", "GetBlockWithTxs", data); - return promise.then((data) => GetBlockWithTxsResponse.decode(new _m0.Reader(data))); + const data = GetBlockWithTxsRequest.encode(request).finish() + const promise = this.rpc.request( + "cosmos.tx.v1beta1.Service", + "GetBlockWithTxs", + data, + ) + return promise.then((data) => GetBlockWithTxsResponse.decode(new _m0.Reader(data))) } } interface Rpc { - request(service: string, method: string, data: Uint8Array): Promise; + request(service: string, method: string, data: Uint8Array): Promise } -declare var self: any | undefined; -declare var window: any | undefined; -declare var global: any | undefined; +declare var self: any | undefined +declare var window: any | undefined +declare var global: any | undefined var globalThis: any = (() => { - if (typeof globalThis !== "undefined") { - return globalThis; - } - if (typeof self !== "undefined") { - return self; - } - if (typeof window !== "undefined") { - return window; - } - if (typeof global !== "undefined") { - return global; - } - throw "Unable to locate global object"; -})(); - + if (typeof globalThis !== "undefined") return globalThis + if (typeof self !== "undefined") return self + if (typeof window !== "undefined") return window + if (typeof global !== "undefined") return global + throw "Unable to locate global object" +})() + +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")) function bytesFromBase64(b64: string): Uint8Array { - if (globalThis.Buffer) { - return Uint8Array.from(globalThis.Buffer.from(b64, "base64")); - } else { - const bin = globalThis.atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; + 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 } +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")) function base64FromBytes(arr: Uint8Array): string { - if (globalThis.Buffer) { - return globalThis.Buffer.from(arr).toString("base64"); - } else { - const bin: string[] = []; - arr.forEach((byte) => { - bin.push(String.fromCharCode(byte)); - }); - return globalThis.btoa(bin.join("")); - } + const bin: string[] = [] + arr.forEach((byte) => { + bin.push(String.fromCharCode(byte)) + }) + return btoa(bin.join("")) } -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/cosmos/tx/v1beta1/tx.ts b/packages/protojs/src/cosmos/tx/v1beta1/tx.ts index 50e40c24..95af02c3 100644 --- a/packages/protojs/src/cosmos/tx/v1beta1/tx.ts +++ b/packages/protojs/src/cosmos/tx/v1beta1/tx.ts @@ -1,28 +1,28 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { Any } from "../../../google/protobuf/any"; -import { Coin } from "../../base/v1beta1/coin"; -import { CompactBitArray } from "../../crypto/multisig/v1beta1/multisig"; -import { SignMode, signModeFromJSON, signModeToJSON } from "../signing/v1beta1/signing"; +import { Any } from "../../../google/protobuf/any" +import { SignMode, signModeFromJSON, signModeToJSON } from "../signing/v1beta1/signing" +import { CompactBitArray } from "../../crypto/multisig/v1beta1/multisig" +import Long from "long" +import { Coin } from "../../base/v1beta1/coin" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "cosmos.tx.v1beta1"; +export const protobufPackage = "cosmos.tx.v1beta1" /** Tx is the standard type used for broadcasting transactions. */ export interface Tx { /** body is the processable content of the transaction */ - body?: TxBody; + body?: TxBody /** * auth_info is the authorization related content of the transaction, * specifically signers, signer modes and fee */ - authInfo?: AuthInfo; + 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[]; + signatures: Uint8Array[] } /** @@ -37,18 +37,18 @@ export interface TxRaw { * body_bytes is a protobuf serialization of a TxBody that matches the * representation in SignDoc. */ - bodyBytes: Uint8Array; + bodyBytes: Uint8Array /** * auth_info_bytes is a protobuf serialization of an AuthInfo that matches the * representation in SignDoc. */ - authInfoBytes: Uint8Array; + 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[]; + signatures: Uint8Array[] } /** SignDoc is the type used for generating sign bytes for SIGN_MODE_DIRECT. */ @@ -57,20 +57,20 @@ export interface SignDoc { * body_bytes is protobuf serialization of a TxBody that matches the * representation in TxRaw. */ - bodyBytes: Uint8Array; + bodyBytes: Uint8Array /** * auth_info_bytes is a protobuf serialization of an AuthInfo that matches the * representation in TxRaw. */ - authInfoBytes: Uint8Array; + 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; + chainId: string /** account_number is the account number of the account in state */ - accountNumber: Long; + accountNumber: Long } /** TxBody is the body of a transaction that all signers sign over. */ @@ -84,30 +84,30 @@ export interface TxBody { * is referred to as the primary signer and pays the fee for the whole * transaction. */ - messages: Any[]; + messages: Any[] /** * memo is any arbitrary note/comment to be added to the transaction. * WARNING: in clients, any publicly exposed text should not be called memo, * but should be called `note` instead (see https://github.com/cosmos/cosmos-sdk/issues/9122). */ - memo: string; + memo: string /** * timeout is the block height after which this transaction will not * be processed by the chain */ - timeoutHeight: Long; + 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[]; + 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[]; + nonCriticalExtensionOptions: Any[] } /** @@ -121,14 +121,14 @@ export interface AuthInfo { * messages. The first element is the primary signer and the one which pays * the fee. */ - signerInfos: SignerInfo[]; + 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; + fee?: Fee } /** @@ -141,28 +141,26 @@ export interface SignerInfo { * 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; + publicKey?: Any /** * mode_info describes the signing mode of the signer and is a nested * structure to support nested multisig pubkey's */ - modeInfo?: ModeInfo; + 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; + 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; + single?: ModeInfo_Single | undefined /** multi represents a nested multisig signer */ - multi?: ModeInfo_Multi | undefined; + multi?: ModeInfo_Multi | undefined } /** @@ -172,18 +170,18 @@ export interface ModeInfo { */ export interface ModeInfo_Single { /** mode is the signing mode of the single signer */ - mode: SignMode; + 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; + bitarray?: CompactBitArray /** * mode_infos is the corresponding modes of the signers of the multisig * which could include nested multisig public keys */ - modeInfos: ModeInfo[]; + modeInfos: ModeInfo[] } /** @@ -193,461 +191,527 @@ export interface ModeInfo_Multi { */ export interface Fee { /** amount is the amount of coins to be paid as a fee */ - amount: Coin[]; + amount: Coin[] /** * gas_limit is the maximum gas that can be used in transaction processing * before an out of gas error occurs */ - gasLimit: Long; + 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; + 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; + granter: string } function createBaseTx(): Tx { - return { body: undefined, authInfo: undefined, signatures: [] }; + return { body: undefined, authInfo: undefined, signatures: [] } } export const Tx = { encode(message: Tx, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.body !== undefined) { - TxBody.encode(message.body, writer.uint32(10).fork()).ldelim(); + TxBody.encode(message.body, writer.uint32(10).fork()).ldelim() } if (message.authInfo !== undefined) { - AuthInfo.encode(message.authInfo, writer.uint32(18).fork()).ldelim(); + AuthInfo.encode(message.authInfo, writer.uint32(18).fork()).ldelim() } for (const v of message.signatures) { - writer.uint32(26).bytes(v!); + writer.uint32(26).bytes(v!) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Tx { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseTx(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseTx() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.body = TxBody.decode(reader, reader.uint32()); - break; + message.body = TxBody.decode(reader, reader.uint32()) + break case 2: - message.authInfo = AuthInfo.decode(reader, reader.uint32()); - break; + message.authInfo = AuthInfo.decode(reader, reader.uint32()) + break case 3: - message.signatures.push(reader.bytes()); - break; + message.signatures.push(reader.bytes()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Tx { return { body: isSet(object.body) ? TxBody.fromJSON(object.body) : undefined, authInfo: isSet(object.authInfo) ? AuthInfo.fromJSON(object.authInfo) : undefined, - signatures: Array.isArray(object?.signatures) ? object.signatures.map((e: any) => bytesFromBase64(e)) : [], - }; + signatures: Array.isArray(object?.signatures) + ? object.signatures.map((e: any) => bytesFromBase64(e)) + : [], + } }, 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); + 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())); + obj.signatures = message.signatures.map((e) => + base64FromBytes(e !== undefined ? e : new Uint8Array()), + ) } else { - obj.signatures = []; + obj.signatures = [] } - return obj; + return obj }, fromPartial, I>>(object: I): Tx { - const message = createBaseTx(); - message.body = (object.body !== undefined && object.body !== null) ? TxBody.fromPartial(object.body) : undefined; - message.authInfo = (object.authInfo !== undefined && object.authInfo !== null) - ? AuthInfo.fromPartial(object.authInfo) - : undefined; - message.signatures = object.signatures?.map((e) => e) || []; - return message; + const message = createBaseTx() + message.body = + object.body !== undefined && object.body !== null + ? TxBody.fromPartial(object.body) + : undefined + message.authInfo = + object.authInfo !== undefined && object.authInfo !== null + ? AuthInfo.fromPartial(object.authInfo) + : undefined + message.signatures = object.signatures?.map((e) => e) || [] + return message }, -}; +} function createBaseTxRaw(): TxRaw { - return { bodyBytes: new Uint8Array(), authInfoBytes: new Uint8Array(), signatures: [] }; + return { + bodyBytes: new Uint8Array(), + authInfoBytes: new Uint8Array(), + signatures: [], + } } export const TxRaw = { encode(message: TxRaw, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.bodyBytes.length !== 0) { - writer.uint32(10).bytes(message.bodyBytes); + writer.uint32(10).bytes(message.bodyBytes) } if (message.authInfoBytes.length !== 0) { - writer.uint32(18).bytes(message.authInfoBytes); + writer.uint32(18).bytes(message.authInfoBytes) } for (const v of message.signatures) { - writer.uint32(26).bytes(v!); + writer.uint32(26).bytes(v!) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): TxRaw { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseTxRaw(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseTxRaw() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.bodyBytes = reader.bytes(); - break; + message.bodyBytes = reader.bytes() + break case 2: - message.authInfoBytes = reader.bytes(); - break; + message.authInfoBytes = reader.bytes() + break case 3: - message.signatures.push(reader.bytes()); - break; + message.signatures.push(reader.bytes()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): TxRaw { return { - bodyBytes: isSet(object.bodyBytes) ? bytesFromBase64(object.bodyBytes) : new Uint8Array(), - authInfoBytes: isSet(object.authInfoBytes) ? bytesFromBase64(object.authInfoBytes) : new Uint8Array(), - signatures: Array.isArray(object?.signatures) ? object.signatures.map((e: any) => bytesFromBase64(e)) : [], - }; + bodyBytes: isSet(object.bodyBytes) + ? bytesFromBase64(object.bodyBytes) + : new Uint8Array(), + authInfoBytes: isSet(object.authInfoBytes) + ? bytesFromBase64(object.authInfoBytes) + : new Uint8Array(), + signatures: Array.isArray(object?.signatures) + ? object.signatures.map((e: any) => bytesFromBase64(e)) + : [], + } }, toJSON(message: TxRaw): unknown { - const obj: any = {}; + const obj: any = {} message.bodyBytes !== undefined && - (obj.bodyBytes = base64FromBytes(message.bodyBytes !== undefined ? message.bodyBytes : new Uint8Array())); + (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())); + obj.signatures = message.signatures.map((e) => + base64FromBytes(e !== undefined ? e : new Uint8Array()), + ) } else { - obj.signatures = []; + obj.signatures = [] } - return obj; + return obj }, fromPartial, I>>(object: I): TxRaw { - const message = createBaseTxRaw(); - message.bodyBytes = object.bodyBytes ?? new Uint8Array(); - message.authInfoBytes = object.authInfoBytes ?? new Uint8Array(); - message.signatures = object.signatures?.map((e) => e) || []; - return message; + const message = createBaseTxRaw() + message.bodyBytes = object.bodyBytes ?? new Uint8Array() + message.authInfoBytes = object.authInfoBytes ?? new Uint8Array() + message.signatures = object.signatures?.map((e) => e) || [] + return message }, -}; +} function createBaseSignDoc(): SignDoc { - return { bodyBytes: new Uint8Array(), authInfoBytes: new Uint8Array(), chainId: "", accountNumber: Long.UZERO }; + return { + bodyBytes: new Uint8Array(), + authInfoBytes: new Uint8Array(), + chainId: "", + accountNumber: Long.UZERO, + } } export const SignDoc = { encode(message: SignDoc, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.bodyBytes.length !== 0) { - writer.uint32(10).bytes(message.bodyBytes); + writer.uint32(10).bytes(message.bodyBytes) } if (message.authInfoBytes.length !== 0) { - writer.uint32(18).bytes(message.authInfoBytes); + writer.uint32(18).bytes(message.authInfoBytes) } if (message.chainId !== "") { - writer.uint32(26).string(message.chainId); + writer.uint32(26).string(message.chainId) } if (!message.accountNumber.isZero()) { - writer.uint32(32).uint64(message.accountNumber); + writer.uint32(32).uint64(message.accountNumber) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): SignDoc { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSignDoc(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseSignDoc() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.bodyBytes = reader.bytes(); - break; + message.bodyBytes = reader.bytes() + break case 2: - message.authInfoBytes = reader.bytes(); - break; + message.authInfoBytes = reader.bytes() + break case 3: - message.chainId = reader.string(); - break; + message.chainId = reader.string() + break case 4: - message.accountNumber = reader.uint64() as Long; - break; + message.accountNumber = reader.uint64() as Long + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): SignDoc { return { - bodyBytes: isSet(object.bodyBytes) ? bytesFromBase64(object.bodyBytes) : new Uint8Array(), - authInfoBytes: isSet(object.authInfoBytes) ? bytesFromBase64(object.authInfoBytes) : new Uint8Array(), + bodyBytes: isSet(object.bodyBytes) + ? bytesFromBase64(object.bodyBytes) + : new Uint8Array(), + authInfoBytes: isSet(object.authInfoBytes) + ? bytesFromBase64(object.authInfoBytes) + : new Uint8Array(), chainId: isSet(object.chainId) ? String(object.chainId) : "", - accountNumber: isSet(object.accountNumber) ? Long.fromValue(object.accountNumber) : Long.UZERO, - }; + accountNumber: isSet(object.accountNumber) + ? Long.fromValue(object.accountNumber) + : Long.UZERO, + } }, toJSON(message: SignDoc): unknown { - const obj: any = {}; + const obj: any = {} message.bodyBytes !== undefined && - (obj.bodyBytes = base64FromBytes(message.bodyBytes !== undefined ? message.bodyBytes : new Uint8Array())); + (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; + )) + message.chainId !== undefined && (obj.chainId = message.chainId) + message.accountNumber !== undefined && + (obj.accountNumber = (message.accountNumber || Long.UZERO).toString()) + return obj }, fromPartial, I>>(object: I): SignDoc { - const message = createBaseSignDoc(); - message.bodyBytes = object.bodyBytes ?? new Uint8Array(); - message.authInfoBytes = object.authInfoBytes ?? new Uint8Array(); - message.chainId = object.chainId ?? ""; - message.accountNumber = (object.accountNumber !== undefined && object.accountNumber !== null) - ? Long.fromValue(object.accountNumber) - : Long.UZERO; - return message; + const message = createBaseSignDoc() + message.bodyBytes = object.bodyBytes ?? new Uint8Array() + message.authInfoBytes = object.authInfoBytes ?? new Uint8Array() + message.chainId = object.chainId ?? "" + message.accountNumber = + object.accountNumber !== undefined && object.accountNumber !== null + ? Long.fromValue(object.accountNumber) + : Long.UZERO + return message }, -}; +} function createBaseTxBody(): TxBody { - return { messages: [], memo: "", timeoutHeight: Long.UZERO, extensionOptions: [], nonCriticalExtensionOptions: [] }; + return { + messages: [], + memo: "", + timeoutHeight: Long.UZERO, + extensionOptions: [], + nonCriticalExtensionOptions: [], + } } export const TxBody = { encode(message: TxBody, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.messages) { - Any.encode(v!, writer.uint32(10).fork()).ldelim(); + Any.encode(v!, writer.uint32(10).fork()).ldelim() } if (message.memo !== "") { - writer.uint32(18).string(message.memo); + writer.uint32(18).string(message.memo) } if (!message.timeoutHeight.isZero()) { - writer.uint32(24).uint64(message.timeoutHeight); + writer.uint32(24).uint64(message.timeoutHeight) } for (const v of message.extensionOptions) { - Any.encode(v!, writer.uint32(8186).fork()).ldelim(); + Any.encode(v!, writer.uint32(8186).fork()).ldelim() } for (const v of message.nonCriticalExtensionOptions) { - Any.encode(v!, writer.uint32(16378).fork()).ldelim(); + Any.encode(v!, writer.uint32(16378).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): TxBody { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseTxBody(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseTxBody() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.messages.push(Any.decode(reader, reader.uint32())); - break; + message.messages.push(Any.decode(reader, reader.uint32())) + break case 2: - message.memo = reader.string(); - break; + message.memo = reader.string() + break case 3: - message.timeoutHeight = reader.uint64() as Long; - break; + message.timeoutHeight = reader.uint64() as Long + break case 1023: - message.extensionOptions.push(Any.decode(reader, reader.uint32())); - break; + message.extensionOptions.push(Any.decode(reader, reader.uint32())) + break case 2047: - message.nonCriticalExtensionOptions.push(Any.decode(reader, reader.uint32())); - break; + message.nonCriticalExtensionOptions.push(Any.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): TxBody { return { - messages: Array.isArray(object?.messages) ? object.messages.map((e: any) => Any.fromJSON(e)) : [], + messages: Array.isArray(object?.messages) + ? object.messages.map((e: any) => Any.fromJSON(e)) + : [], memo: isSet(object.memo) ? String(object.memo) : "", - timeoutHeight: isSet(object.timeoutHeight) ? Long.fromValue(object.timeoutHeight) : Long.UZERO, + timeoutHeight: isSet(object.timeoutHeight) + ? Long.fromValue(object.timeoutHeight) + : Long.UZERO, extensionOptions: Array.isArray(object?.extensionOptions) ? object.extensionOptions.map((e: any) => Any.fromJSON(e)) : [], nonCriticalExtensionOptions: Array.isArray(object?.nonCriticalExtensionOptions) ? object.nonCriticalExtensionOptions.map((e: any) => Any.fromJSON(e)) : [], - }; + } }, toJSON(message: TxBody): unknown { - const obj: any = {}; + const obj: any = {} if (message.messages) { - obj.messages = message.messages.map((e) => e ? Any.toJSON(e) : undefined); + obj.messages = message.messages.map((e) => (e ? Any.toJSON(e) : undefined)) } else { - obj.messages = []; + obj.messages = [] } - message.memo !== undefined && (obj.memo = message.memo); - message.timeoutHeight !== undefined && (obj.timeoutHeight = (message.timeoutHeight || Long.UZERO).toString()); + 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); + obj.extensionOptions = message.extensionOptions.map((e) => + e ? Any.toJSON(e) : undefined, + ) } else { - obj.extensionOptions = []; + obj.extensionOptions = [] } if (message.nonCriticalExtensionOptions) { - obj.nonCriticalExtensionOptions = message.nonCriticalExtensionOptions.map((e) => e ? Any.toJSON(e) : undefined); + obj.nonCriticalExtensionOptions = message.nonCriticalExtensionOptions.map((e) => + e ? Any.toJSON(e) : undefined, + ) } else { - obj.nonCriticalExtensionOptions = []; + obj.nonCriticalExtensionOptions = [] } - return obj; + return obj }, fromPartial, I>>(object: I): TxBody { - const message = createBaseTxBody(); - message.messages = object.messages?.map((e) => Any.fromPartial(e)) || []; - message.memo = object.memo ?? ""; - message.timeoutHeight = (object.timeoutHeight !== undefined && object.timeoutHeight !== null) - ? Long.fromValue(object.timeoutHeight) - : Long.UZERO; - message.extensionOptions = object.extensionOptions?.map((e) => Any.fromPartial(e)) || []; - message.nonCriticalExtensionOptions = object.nonCriticalExtensionOptions?.map((e) => Any.fromPartial(e)) || []; - return message; - }, -}; + const message = createBaseTxBody() + message.messages = object.messages?.map((e) => Any.fromPartial(e)) || [] + message.memo = object.memo ?? "" + message.timeoutHeight = + object.timeoutHeight !== undefined && object.timeoutHeight !== null + ? Long.fromValue(object.timeoutHeight) + : Long.UZERO + message.extensionOptions = + object.extensionOptions?.map((e) => Any.fromPartial(e)) || [] + message.nonCriticalExtensionOptions = + object.nonCriticalExtensionOptions?.map((e) => Any.fromPartial(e)) || [] + return message + }, +} function createBaseAuthInfo(): AuthInfo { - return { signerInfos: [], fee: undefined }; + return { signerInfos: [], fee: undefined } } export const AuthInfo = { encode(message: AuthInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.signerInfos) { - SignerInfo.encode(v!, writer.uint32(10).fork()).ldelim(); + SignerInfo.encode(v!, writer.uint32(10).fork()).ldelim() } if (message.fee !== undefined) { - Fee.encode(message.fee, writer.uint32(18).fork()).ldelim(); + Fee.encode(message.fee, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): AuthInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseAuthInfo(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseAuthInfo() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.signerInfos.push(SignerInfo.decode(reader, reader.uint32())); - break; + message.signerInfos.push(SignerInfo.decode(reader, reader.uint32())) + break case 2: - message.fee = Fee.decode(reader, reader.uint32()); - break; + message.fee = Fee.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): AuthInfo { return { - signerInfos: Array.isArray(object?.signerInfos) ? object.signerInfos.map((e: any) => SignerInfo.fromJSON(e)) : [], + signerInfos: Array.isArray(object?.signerInfos) + ? object.signerInfos.map((e: any) => SignerInfo.fromJSON(e)) + : [], fee: isSet(object.fee) ? Fee.fromJSON(object.fee) : undefined, - }; + } }, toJSON(message: AuthInfo): unknown { - const obj: any = {}; + const obj: any = {} if (message.signerInfos) { - obj.signerInfos = message.signerInfos.map((e) => e ? SignerInfo.toJSON(e) : undefined); + obj.signerInfos = message.signerInfos.map((e) => + e ? SignerInfo.toJSON(e) : undefined, + ) } else { - obj.signerInfos = []; + obj.signerInfos = [] } - message.fee !== undefined && (obj.fee = message.fee ? Fee.toJSON(message.fee) : undefined); - return obj; + message.fee !== undefined && + (obj.fee = message.fee ? Fee.toJSON(message.fee) : undefined) + return obj }, fromPartial, I>>(object: I): AuthInfo { - const message = createBaseAuthInfo(); - message.signerInfos = object.signerInfos?.map((e) => SignerInfo.fromPartial(e)) || []; - message.fee = (object.fee !== undefined && object.fee !== null) ? Fee.fromPartial(object.fee) : undefined; - return message; + const message = createBaseAuthInfo() + message.signerInfos = + object.signerInfos?.map((e) => SignerInfo.fromPartial(e)) || [] + message.fee = + object.fee !== undefined && object.fee !== null + ? Fee.fromPartial(object.fee) + : undefined + return message }, -}; +} function createBaseSignerInfo(): SignerInfo { - return { publicKey: undefined, modeInfo: undefined, sequence: Long.UZERO }; + return { publicKey: undefined, modeInfo: undefined, sequence: Long.UZERO } } export const SignerInfo = { encode(message: SignerInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.publicKey !== undefined) { - Any.encode(message.publicKey, writer.uint32(10).fork()).ldelim(); + Any.encode(message.publicKey, writer.uint32(10).fork()).ldelim() } if (message.modeInfo !== undefined) { - ModeInfo.encode(message.modeInfo, writer.uint32(18).fork()).ldelim(); + ModeInfo.encode(message.modeInfo, writer.uint32(18).fork()).ldelim() } if (!message.sequence.isZero()) { - writer.uint32(24).uint64(message.sequence); + writer.uint32(24).uint64(message.sequence) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): SignerInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSignerInfo(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseSignerInfo() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.publicKey = Any.decode(reader, reader.uint32()); - break; + message.publicKey = Any.decode(reader, reader.uint32()) + break case 2: - message.modeInfo = ModeInfo.decode(reader, reader.uint32()); - break; + message.modeInfo = ModeInfo.decode(reader, reader.uint32()) + break case 3: - message.sequence = reader.uint64() as Long; - break; + message.sequence = reader.uint64() as Long + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): SignerInfo { @@ -655,349 +719,382 @@ export const SignerInfo = { publicKey: isSet(object.publicKey) ? Any.fromJSON(object.publicKey) : undefined, modeInfo: isSet(object.modeInfo) ? ModeInfo.fromJSON(object.modeInfo) : undefined, sequence: isSet(object.sequence) ? Long.fromValue(object.sequence) : Long.UZERO, - }; + } }, 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; + 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 }, fromPartial, I>>(object: I): SignerInfo { - const message = createBaseSignerInfo(); - message.publicKey = (object.publicKey !== undefined && object.publicKey !== null) - ? Any.fromPartial(object.publicKey) - : undefined; - message.modeInfo = (object.modeInfo !== undefined && object.modeInfo !== null) - ? ModeInfo.fromPartial(object.modeInfo) - : undefined; - message.sequence = (object.sequence !== undefined && object.sequence !== null) - ? Long.fromValue(object.sequence) - : Long.UZERO; - return message; - }, -}; + const message = createBaseSignerInfo() + message.publicKey = + object.publicKey !== undefined && object.publicKey !== null + ? Any.fromPartial(object.publicKey) + : undefined + message.modeInfo = + object.modeInfo !== undefined && object.modeInfo !== null + ? ModeInfo.fromPartial(object.modeInfo) + : undefined + message.sequence = + object.sequence !== undefined && object.sequence !== null + ? Long.fromValue(object.sequence) + : Long.UZERO + return message + }, +} function createBaseModeInfo(): ModeInfo { - return { single: undefined, multi: undefined }; + return { single: undefined, multi: undefined } } export const ModeInfo = { encode(message: ModeInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.single !== undefined) { - ModeInfo_Single.encode(message.single, writer.uint32(10).fork()).ldelim(); + ModeInfo_Single.encode(message.single, writer.uint32(10).fork()).ldelim() } if (message.multi !== undefined) { - ModeInfo_Multi.encode(message.multi, writer.uint32(18).fork()).ldelim(); + ModeInfo_Multi.encode(message.multi, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): ModeInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseModeInfo(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseModeInfo() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.single = ModeInfo_Single.decode(reader, reader.uint32()); - break; + message.single = ModeInfo_Single.decode(reader, reader.uint32()) + break case 2: - message.multi = ModeInfo_Multi.decode(reader, reader.uint32()); - break; + message.multi = ModeInfo_Multi.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): ModeInfo { return { - single: isSet(object.single) ? ModeInfo_Single.fromJSON(object.single) : undefined, + single: isSet(object.single) + ? ModeInfo_Single.fromJSON(object.single) + : undefined, multi: isSet(object.multi) ? ModeInfo_Multi.fromJSON(object.multi) : undefined, - }; + } }, 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; + 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 }, fromPartial, I>>(object: I): ModeInfo { - const message = createBaseModeInfo(); - message.single = (object.single !== undefined && object.single !== null) - ? ModeInfo_Single.fromPartial(object.single) - : undefined; - message.multi = (object.multi !== undefined && object.multi !== null) - ? ModeInfo_Multi.fromPartial(object.multi) - : undefined; - return message; + const message = createBaseModeInfo() + message.single = + object.single !== undefined && object.single !== null + ? ModeInfo_Single.fromPartial(object.single) + : undefined + message.multi = + object.multi !== undefined && object.multi !== null + ? ModeInfo_Multi.fromPartial(object.multi) + : undefined + return message }, -}; +} function createBaseModeInfo_Single(): ModeInfo_Single { - return { mode: 0 }; + return { mode: 0 } } export const ModeInfo_Single = { - encode(message: ModeInfo_Single, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: ModeInfo_Single, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.mode !== 0) { - writer.uint32(8).int32(message.mode); + writer.uint32(8).int32(message.mode) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): ModeInfo_Single { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseModeInfo_Single(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseModeInfo_Single() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.mode = reader.int32() as any; - break; + message.mode = reader.int32() as any + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): ModeInfo_Single { - return { mode: isSet(object.mode) ? signModeFromJSON(object.mode) : 0 }; + return { + mode: isSet(object.mode) ? signModeFromJSON(object.mode) : 0, + } }, toJSON(message: ModeInfo_Single): unknown { - const obj: any = {}; - message.mode !== undefined && (obj.mode = signModeToJSON(message.mode)); - return obj; + const obj: any = {} + message.mode !== undefined && (obj.mode = signModeToJSON(message.mode)) + return obj }, - fromPartial, I>>(object: I): ModeInfo_Single { - const message = createBaseModeInfo_Single(); - message.mode = object.mode ?? 0; - return message; + fromPartial, I>>( + object: I, + ): ModeInfo_Single { + const message = createBaseModeInfo_Single() + message.mode = object.mode ?? 0 + return message }, -}; +} function createBaseModeInfo_Multi(): ModeInfo_Multi { - return { bitarray: undefined, modeInfos: [] }; + return { bitarray: undefined, modeInfos: [] } } export const ModeInfo_Multi = { - encode(message: ModeInfo_Multi, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: ModeInfo_Multi, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.bitarray !== undefined) { - CompactBitArray.encode(message.bitarray, writer.uint32(10).fork()).ldelim(); + CompactBitArray.encode(message.bitarray, writer.uint32(10).fork()).ldelim() } for (const v of message.modeInfos) { - ModeInfo.encode(v!, writer.uint32(18).fork()).ldelim(); + ModeInfo.encode(v!, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): ModeInfo_Multi { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseModeInfo_Multi(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseModeInfo_Multi() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.bitarray = CompactBitArray.decode(reader, reader.uint32()); - break; + message.bitarray = CompactBitArray.decode(reader, reader.uint32()) + break case 2: - message.modeInfos.push(ModeInfo.decode(reader, reader.uint32())); - break; + message.modeInfos.push(ModeInfo.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): ModeInfo_Multi { return { - bitarray: isSet(object.bitarray) ? CompactBitArray.fromJSON(object.bitarray) : undefined, - modeInfos: Array.isArray(object?.modeInfos) ? object.modeInfos.map((e: any) => ModeInfo.fromJSON(e)) : [], - }; + bitarray: isSet(object.bitarray) + ? CompactBitArray.fromJSON(object.bitarray) + : undefined, + modeInfos: Array.isArray(object?.modeInfos) + ? object.modeInfos.map((e: any) => ModeInfo.fromJSON(e)) + : [], + } }, toJSON(message: ModeInfo_Multi): unknown { - const obj: any = {}; + const obj: any = {} message.bitarray !== undefined && - (obj.bitarray = message.bitarray ? CompactBitArray.toJSON(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); + obj.modeInfos = message.modeInfos.map((e) => (e ? ModeInfo.toJSON(e) : undefined)) } else { - obj.modeInfos = []; + obj.modeInfos = [] } - return obj; + return obj }, - fromPartial, I>>(object: I): ModeInfo_Multi { - const message = createBaseModeInfo_Multi(); - message.bitarray = (object.bitarray !== undefined && object.bitarray !== null) - ? CompactBitArray.fromPartial(object.bitarray) - : undefined; - message.modeInfos = object.modeInfos?.map((e) => ModeInfo.fromPartial(e)) || []; - return message; + fromPartial, I>>( + object: I, + ): ModeInfo_Multi { + const message = createBaseModeInfo_Multi() + message.bitarray = + object.bitarray !== undefined && object.bitarray !== null + ? CompactBitArray.fromPartial(object.bitarray) + : undefined + message.modeInfos = object.modeInfos?.map((e) => ModeInfo.fromPartial(e)) || [] + return message }, -}; +} function createBaseFee(): Fee { - return { amount: [], gasLimit: Long.UZERO, payer: "", granter: "" }; + return { amount: [], gasLimit: Long.UZERO, payer: "", granter: "" } } export const Fee = { encode(message: Fee, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.amount) { - Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + Coin.encode(v!, writer.uint32(10).fork()).ldelim() } if (!message.gasLimit.isZero()) { - writer.uint32(16).uint64(message.gasLimit); + writer.uint32(16).uint64(message.gasLimit) } if (message.payer !== "") { - writer.uint32(26).string(message.payer); + writer.uint32(26).string(message.payer) } if (message.granter !== "") { - writer.uint32(34).string(message.granter); + writer.uint32(34).string(message.granter) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Fee { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseFee(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseFee() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.amount.push(Coin.decode(reader, reader.uint32())); - break; + message.amount.push(Coin.decode(reader, reader.uint32())) + break case 2: - message.gasLimit = reader.uint64() as Long; - break; + message.gasLimit = reader.uint64() as Long + break case 3: - message.payer = reader.string(); - break; + message.payer = reader.string() + break case 4: - message.granter = reader.string(); - break; + message.granter = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Fee { return { - amount: Array.isArray(object?.amount) ? object.amount.map((e: any) => Coin.fromJSON(e)) : [], + amount: Array.isArray(object?.amount) + ? object.amount.map((e: any) => Coin.fromJSON(e)) + : [], gasLimit: isSet(object.gasLimit) ? Long.fromValue(object.gasLimit) : Long.UZERO, payer: isSet(object.payer) ? String(object.payer) : "", granter: isSet(object.granter) ? String(object.granter) : "", - }; + } }, toJSON(message: Fee): unknown { - const obj: any = {}; + const obj: any = {} if (message.amount) { - obj.amount = message.amount.map((e) => e ? Coin.toJSON(e) : undefined); + obj.amount = message.amount.map((e) => (e ? Coin.toJSON(e) : undefined)) } else { - obj.amount = []; + 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; + 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 }, fromPartial, I>>(object: I): Fee { - const message = createBaseFee(); - message.amount = object.amount?.map((e) => Coin.fromPartial(e)) || []; - message.gasLimit = (object.gasLimit !== undefined && object.gasLimit !== null) - ? Long.fromValue(object.gasLimit) - : Long.UZERO; - message.payer = object.payer ?? ""; - message.granter = object.granter ?? ""; - return message; - }, -}; - -declare var self: any | undefined; -declare var window: any | undefined; -declare var global: any | undefined; -var globalThis: any = (() => { - if (typeof globalThis !== "undefined") { - return globalThis; - } - if (typeof self !== "undefined") { - return self; - } - if (typeof window !== "undefined") { - return window; - } - if (typeof global !== "undefined") { - return global; - } - throw "Unable to locate global object"; -})(); + const message = createBaseFee() + message.amount = object.amount?.map((e) => Coin.fromPartial(e)) || [] + message.gasLimit = + object.gasLimit !== undefined && object.gasLimit !== null + ? Long.fromValue(object.gasLimit) + : Long.UZERO + message.payer = object.payer ?? "" + message.granter = object.granter ?? "" + return message + }, +} +declare var self: any | undefined +declare var window: any | undefined +declare var global: any | undefined +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis + if (typeof self !== "undefined") return self + if (typeof window !== "undefined") return window + if (typeof global !== "undefined") return global + throw "Unable to locate global object" +})() + +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")) function bytesFromBase64(b64: string): Uint8Array { - if (globalThis.Buffer) { - return Uint8Array.from(globalThis.Buffer.from(b64, "base64")); - } else { - const bin = globalThis.atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; + 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 } +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")) function base64FromBytes(arr: Uint8Array): string { - if (globalThis.Buffer) { - return globalThis.Buffer.from(arr).toString("base64"); - } else { - const bin: string[] = []; - arr.forEach((byte) => { - bin.push(String.fromCharCode(byte)); - }); - return globalThis.btoa(bin.join("")); - } + const bin: string[] = [] + arr.forEach((byte) => { + bin.push(String.fromCharCode(byte)) + }) + return btoa(bin.join("")) } -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/cosmos/upgrade/v1beta1/query.ts b/packages/protojs/src/cosmos/upgrade/v1beta1/query.ts index 80be7d95..f3bfc3c9 100644 --- a/packages/protojs/src/cosmos/upgrade/v1beta1/query.ts +++ b/packages/protojs/src/cosmos/upgrade/v1beta1/query.ts @@ -1,16 +1,15 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { ModuleVersion, Plan } from "./upgrade"; +import { Plan, ModuleVersion } from "./upgrade" +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "cosmos.upgrade.v1beta1"; +export const protobufPackage = "cosmos.upgrade.v1beta1" /** * QueryCurrentPlanRequest is the request type for the Query/CurrentPlan RPC * method. */ -export interface QueryCurrentPlanRequest { -} +export interface QueryCurrentPlanRequest {} /** * QueryCurrentPlanResponse is the response type for the Query/CurrentPlan RPC @@ -18,7 +17,7 @@ export interface QueryCurrentPlanRequest { */ export interface QueryCurrentPlanResponse { /** plan is the current upgrade plan. */ - plan?: Plan; + plan?: Plan } /** @@ -27,7 +26,7 @@ export interface QueryCurrentPlanResponse { */ export interface QueryAppliedPlanRequest { /** name is the name of the applied plan to query for. */ - name: string; + name: string } /** @@ -36,7 +35,7 @@ export interface QueryAppliedPlanRequest { */ export interface QueryAppliedPlanResponse { /** height is the block height at which the plan was applied. */ - height: Long; + height: Long } /** @@ -50,7 +49,7 @@ export interface QueryUpgradedConsensusStateRequest { * last height of the current chain must be sent in request * as this is the height under which next consensus state is stored */ - lastHeight: Long; + lastHeight: Long } /** @@ -61,7 +60,7 @@ export interface QueryUpgradedConsensusStateRequest { */ export interface QueryUpgradedConsensusStateResponse { /** Since: cosmos-sdk 0.43 */ - upgradedConsensusState: Uint8Array; + upgradedConsensusState: Uint8Array } /** @@ -76,7 +75,7 @@ export interface QueryModuleVersionsRequest { * consensus version from state. Leaving this empty will * fetch the full list of module versions from state */ - moduleName: string; + moduleName: string } /** @@ -87,270 +86,320 @@ export interface QueryModuleVersionsRequest { */ export interface QueryModuleVersionsResponse { /** module_versions is a list of module names with their consensus versions. */ - moduleVersions: ModuleVersion[]; + moduleVersions: ModuleVersion[] } function createBaseQueryCurrentPlanRequest(): QueryCurrentPlanRequest { - return {}; + return {} } export const QueryCurrentPlanRequest = { - encode(_: QueryCurrentPlanRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; + encode( + _: QueryCurrentPlanRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryCurrentPlanRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryCurrentPlanRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryCurrentPlanRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(_: any): QueryCurrentPlanRequest { - return {}; + return {} }, toJSON(_: QueryCurrentPlanRequest): unknown { - const obj: any = {}; - return obj; + const obj: any = {} + return obj }, - fromPartial, I>>(_: I): QueryCurrentPlanRequest { - const message = createBaseQueryCurrentPlanRequest(); - return message; + fromPartial, I>>( + _: I, + ): QueryCurrentPlanRequest { + const message = createBaseQueryCurrentPlanRequest() + return message }, -}; +} function createBaseQueryCurrentPlanResponse(): QueryCurrentPlanResponse { - return { plan: undefined }; + return { plan: undefined } } export const QueryCurrentPlanResponse = { - encode(message: QueryCurrentPlanResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryCurrentPlanResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.plan !== undefined) { - Plan.encode(message.plan, writer.uint32(10).fork()).ldelim(); + Plan.encode(message.plan, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryCurrentPlanResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryCurrentPlanResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryCurrentPlanResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.plan = Plan.decode(reader, reader.uint32()); - break; + message.plan = Plan.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryCurrentPlanResponse { - return { plan: isSet(object.plan) ? Plan.fromJSON(object.plan) : undefined }; + return { + plan: isSet(object.plan) ? Plan.fromJSON(object.plan) : undefined, + } }, toJSON(message: QueryCurrentPlanResponse): unknown { - const obj: any = {}; - message.plan !== undefined && (obj.plan = message.plan ? Plan.toJSON(message.plan) : undefined); - return obj; + const obj: any = {} + message.plan !== undefined && + (obj.plan = message.plan ? Plan.toJSON(message.plan) : undefined) + return obj }, - fromPartial, I>>(object: I): QueryCurrentPlanResponse { - const message = createBaseQueryCurrentPlanResponse(); - message.plan = (object.plan !== undefined && object.plan !== null) ? Plan.fromPartial(object.plan) : undefined; - return message; + fromPartial, I>>( + object: I, + ): QueryCurrentPlanResponse { + const message = createBaseQueryCurrentPlanResponse() + message.plan = + object.plan !== undefined && object.plan !== null + ? Plan.fromPartial(object.plan) + : undefined + return message }, -}; +} function createBaseQueryAppliedPlanRequest(): QueryAppliedPlanRequest { - return { name: "" }; + return { name: "" } } export const QueryAppliedPlanRequest = { - encode(message: QueryAppliedPlanRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryAppliedPlanRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.name !== "") { - writer.uint32(10).string(message.name); + writer.uint32(10).string(message.name) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryAppliedPlanRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryAppliedPlanRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryAppliedPlanRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.name = reader.string(); - break; + message.name = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryAppliedPlanRequest { - return { name: isSet(object.name) ? String(object.name) : "" }; + return { + name: isSet(object.name) ? String(object.name) : "", + } }, toJSON(message: QueryAppliedPlanRequest): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - return obj; + const obj: any = {} + message.name !== undefined && (obj.name = message.name) + return obj }, - fromPartial, I>>(object: I): QueryAppliedPlanRequest { - const message = createBaseQueryAppliedPlanRequest(); - message.name = object.name ?? ""; - return message; + fromPartial, I>>( + object: I, + ): QueryAppliedPlanRequest { + const message = createBaseQueryAppliedPlanRequest() + message.name = object.name ?? "" + return message }, -}; +} function createBaseQueryAppliedPlanResponse(): QueryAppliedPlanResponse { - return { height: Long.ZERO }; + return { height: Long.ZERO } } export const QueryAppliedPlanResponse = { - encode(message: QueryAppliedPlanResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryAppliedPlanResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (!message.height.isZero()) { - writer.uint32(8).int64(message.height); + writer.uint32(8).int64(message.height) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryAppliedPlanResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryAppliedPlanResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryAppliedPlanResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.height = reader.int64() as Long; - break; + message.height = reader.int64() as Long + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryAppliedPlanResponse { - return { height: isSet(object.height) ? Long.fromValue(object.height) : Long.ZERO }; + return { + height: isSet(object.height) ? Long.fromValue(object.height) : Long.ZERO, + } }, toJSON(message: QueryAppliedPlanResponse): unknown { - const obj: any = {}; - message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); - return obj; + const obj: any = {} + message.height !== undefined && + (obj.height = (message.height || Long.ZERO).toString()) + return obj }, - fromPartial, I>>(object: I): QueryAppliedPlanResponse { - const message = createBaseQueryAppliedPlanResponse(); - message.height = (object.height !== undefined && object.height !== null) - ? Long.fromValue(object.height) - : Long.ZERO; - return message; + fromPartial, I>>( + object: I, + ): QueryAppliedPlanResponse { + const message = createBaseQueryAppliedPlanResponse() + message.height = + object.height !== undefined && object.height !== null + ? Long.fromValue(object.height) + : Long.ZERO + return message }, -}; +} function createBaseQueryUpgradedConsensusStateRequest(): QueryUpgradedConsensusStateRequest { - return { lastHeight: Long.ZERO }; + return { lastHeight: Long.ZERO } } export const QueryUpgradedConsensusStateRequest = { - encode(message: QueryUpgradedConsensusStateRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryUpgradedConsensusStateRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (!message.lastHeight.isZero()) { - writer.uint32(8).int64(message.lastHeight); + writer.uint32(8).int64(message.lastHeight) } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryUpgradedConsensusStateRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryUpgradedConsensusStateRequest(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryUpgradedConsensusStateRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryUpgradedConsensusStateRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.lastHeight = reader.int64() as Long; - break; + message.lastHeight = reader.int64() as Long + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryUpgradedConsensusStateRequest { - return { lastHeight: isSet(object.lastHeight) ? Long.fromValue(object.lastHeight) : Long.ZERO }; + return { + lastHeight: isSet(object.lastHeight) + ? Long.fromValue(object.lastHeight) + : Long.ZERO, + } }, toJSON(message: QueryUpgradedConsensusStateRequest): unknown { - const obj: any = {}; - message.lastHeight !== undefined && (obj.lastHeight = (message.lastHeight || Long.ZERO).toString()); - return obj; + const obj: any = {} + message.lastHeight !== undefined && + (obj.lastHeight = (message.lastHeight || Long.ZERO).toString()) + return obj }, fromPartial, I>>( object: I, ): QueryUpgradedConsensusStateRequest { - const message = createBaseQueryUpgradedConsensusStateRequest(); - message.lastHeight = (object.lastHeight !== undefined && object.lastHeight !== null) - ? Long.fromValue(object.lastHeight) - : Long.ZERO; - return message; + const message = createBaseQueryUpgradedConsensusStateRequest() + message.lastHeight = + object.lastHeight !== undefined && object.lastHeight !== null + ? Long.fromValue(object.lastHeight) + : Long.ZERO + return message }, -}; +} function createBaseQueryUpgradedConsensusStateResponse(): QueryUpgradedConsensusStateResponse { - return { upgradedConsensusState: new Uint8Array() }; + return { upgradedConsensusState: new Uint8Array() } } export const QueryUpgradedConsensusStateResponse = { - encode(message: QueryUpgradedConsensusStateResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryUpgradedConsensusStateResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.upgradedConsensusState.length !== 0) { - writer.uint32(18).bytes(message.upgradedConsensusState); + writer.uint32(18).bytes(message.upgradedConsensusState) } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryUpgradedConsensusStateResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryUpgradedConsensusStateResponse(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryUpgradedConsensusStateResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryUpgradedConsensusStateResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 2: - message.upgradedConsensusState = reader.bytes(); - break; + message.upgradedConsensusState = reader.bytes() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryUpgradedConsensusStateResponse { @@ -358,102 +407,114 @@ export const QueryUpgradedConsensusStateResponse = { upgradedConsensusState: isSet(object.upgradedConsensusState) ? bytesFromBase64(object.upgradedConsensusState) : new Uint8Array(), - }; + } }, toJSON(message: QueryUpgradedConsensusStateResponse): unknown { - const obj: any = {}; + const obj: any = {} message.upgradedConsensusState !== undefined && (obj.upgradedConsensusState = base64FromBytes( - message.upgradedConsensusState !== undefined ? message.upgradedConsensusState : new Uint8Array(), - )); - return obj; + message.upgradedConsensusState !== undefined + ? message.upgradedConsensusState + : new Uint8Array(), + )) + return obj }, fromPartial, I>>( object: I, ): QueryUpgradedConsensusStateResponse { - const message = createBaseQueryUpgradedConsensusStateResponse(); - message.upgradedConsensusState = object.upgradedConsensusState ?? new Uint8Array(); - return message; + const message = createBaseQueryUpgradedConsensusStateResponse() + message.upgradedConsensusState = object.upgradedConsensusState ?? new Uint8Array() + return message }, -}; +} function createBaseQueryModuleVersionsRequest(): QueryModuleVersionsRequest { - return { moduleName: "" }; + return { moduleName: "" } } export const QueryModuleVersionsRequest = { - encode(message: QueryModuleVersionsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryModuleVersionsRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.moduleName !== "") { - writer.uint32(10).string(message.moduleName); + writer.uint32(10).string(message.moduleName) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryModuleVersionsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryModuleVersionsRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryModuleVersionsRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.moduleName = reader.string(); - break; + message.moduleName = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryModuleVersionsRequest { - return { moduleName: isSet(object.moduleName) ? String(object.moduleName) : "" }; + return { + moduleName: isSet(object.moduleName) ? String(object.moduleName) : "", + } }, toJSON(message: QueryModuleVersionsRequest): unknown { - const obj: any = {}; - message.moduleName !== undefined && (obj.moduleName = message.moduleName); - return obj; + const obj: any = {} + message.moduleName !== undefined && (obj.moduleName = message.moduleName) + return obj }, - fromPartial, I>>(object: I): QueryModuleVersionsRequest { - const message = createBaseQueryModuleVersionsRequest(); - message.moduleName = object.moduleName ?? ""; - return message; + fromPartial, I>>( + object: I, + ): QueryModuleVersionsRequest { + const message = createBaseQueryModuleVersionsRequest() + message.moduleName = object.moduleName ?? "" + return message }, -}; +} function createBaseQueryModuleVersionsResponse(): QueryModuleVersionsResponse { - return { moduleVersions: [] }; + return { moduleVersions: [] } } export const QueryModuleVersionsResponse = { - encode(message: QueryModuleVersionsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryModuleVersionsResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { for (const v of message.moduleVersions) { - ModuleVersion.encode(v!, writer.uint32(10).fork()).ldelim(); + ModuleVersion.encode(v!, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryModuleVersionsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryModuleVersionsResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryModuleVersionsResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.moduleVersions.push(ModuleVersion.decode(reader, reader.uint32())); - break; + message.moduleVersions.push(ModuleVersion.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryModuleVersionsResponse { @@ -461,32 +522,37 @@ export const QueryModuleVersionsResponse = { moduleVersions: Array.isArray(object?.moduleVersions) ? object.moduleVersions.map((e: any) => ModuleVersion.fromJSON(e)) : [], - }; + } }, toJSON(message: QueryModuleVersionsResponse): unknown { - const obj: any = {}; + const obj: any = {} if (message.moduleVersions) { - obj.moduleVersions = message.moduleVersions.map((e) => e ? ModuleVersion.toJSON(e) : undefined); + obj.moduleVersions = message.moduleVersions.map((e) => + e ? ModuleVersion.toJSON(e) : undefined, + ) } else { - obj.moduleVersions = []; + obj.moduleVersions = [] } - return obj; + return obj }, - fromPartial, I>>(object: I): QueryModuleVersionsResponse { - const message = createBaseQueryModuleVersionsResponse(); - message.moduleVersions = object.moduleVersions?.map((e) => ModuleVersion.fromPartial(e)) || []; - return message; + fromPartial, I>>( + object: I, + ): QueryModuleVersionsResponse { + const message = createBaseQueryModuleVersionsResponse() + message.moduleVersions = + object.moduleVersions?.map((e) => ModuleVersion.fromPartial(e)) || [] + return message }, -}; +} /** Query defines the gRPC upgrade querier service. */ export interface Query { /** CurrentPlan queries the current upgrade plan. */ - CurrentPlan(request: QueryCurrentPlanRequest): Promise; + CurrentPlan(request: QueryCurrentPlanRequest): Promise /** AppliedPlan queries a previously applied upgrade plan by its name. */ - AppliedPlan(request: QueryAppliedPlanRequest): Promise; + AppliedPlan(request: QueryAppliedPlanRequest): Promise /** * UpgradedConsensusState queries the consensus state that will serve * as a trusted kernel for the next version of this chain. It will only be @@ -497,114 +563,140 @@ export interface Query { * * @deprecated */ - UpgradedConsensusState(request: QueryUpgradedConsensusStateRequest): Promise; + UpgradedConsensusState( + request: QueryUpgradedConsensusStateRequest, + ): Promise /** * ModuleVersions queries the list of module versions from state. * * Since: cosmos-sdk 0.43 */ - ModuleVersions(request: QueryModuleVersionsRequest): Promise; + ModuleVersions( + request: QueryModuleVersionsRequest, + ): Promise } export class QueryClientImpl implements Query { - private readonly rpc: Rpc; + private readonly rpc: Rpc constructor(rpc: Rpc) { - this.rpc = rpc; - this.CurrentPlan = this.CurrentPlan.bind(this); - this.AppliedPlan = this.AppliedPlan.bind(this); - this.UpgradedConsensusState = this.UpgradedConsensusState.bind(this); - this.ModuleVersions = this.ModuleVersions.bind(this); + this.rpc = rpc + this.CurrentPlan = this.CurrentPlan.bind(this) + this.AppliedPlan = this.AppliedPlan.bind(this) + this.UpgradedConsensusState = this.UpgradedConsensusState.bind(this) + this.ModuleVersions = this.ModuleVersions.bind(this) } CurrentPlan(request: QueryCurrentPlanRequest): Promise { - const data = QueryCurrentPlanRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.upgrade.v1beta1.Query", "CurrentPlan", data); - return promise.then((data) => QueryCurrentPlanResponse.decode(new _m0.Reader(data))); + const data = QueryCurrentPlanRequest.encode(request).finish() + const promise = this.rpc.request( + "cosmos.upgrade.v1beta1.Query", + "CurrentPlan", + data, + ) + return promise.then((data) => QueryCurrentPlanResponse.decode(new _m0.Reader(data))) } AppliedPlan(request: QueryAppliedPlanRequest): Promise { - const data = QueryAppliedPlanRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.upgrade.v1beta1.Query", "AppliedPlan", data); - return promise.then((data) => QueryAppliedPlanResponse.decode(new _m0.Reader(data))); + const data = QueryAppliedPlanRequest.encode(request).finish() + const promise = this.rpc.request( + "cosmos.upgrade.v1beta1.Query", + "AppliedPlan", + data, + ) + return promise.then((data) => QueryAppliedPlanResponse.decode(new _m0.Reader(data))) } - UpgradedConsensusState(request: QueryUpgradedConsensusStateRequest): Promise { - const data = QueryUpgradedConsensusStateRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.upgrade.v1beta1.Query", "UpgradedConsensusState", data); - return promise.then((data) => QueryUpgradedConsensusStateResponse.decode(new _m0.Reader(data))); + UpgradedConsensusState( + request: QueryUpgradedConsensusStateRequest, + ): Promise { + const data = QueryUpgradedConsensusStateRequest.encode(request).finish() + const promise = this.rpc.request( + "cosmos.upgrade.v1beta1.Query", + "UpgradedConsensusState", + data, + ) + return promise.then((data) => + QueryUpgradedConsensusStateResponse.decode(new _m0.Reader(data)), + ) } - ModuleVersions(request: QueryModuleVersionsRequest): Promise { - const data = QueryModuleVersionsRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.upgrade.v1beta1.Query", "ModuleVersions", data); - return promise.then((data) => QueryModuleVersionsResponse.decode(new _m0.Reader(data))); + ModuleVersions( + request: QueryModuleVersionsRequest, + ): Promise { + const data = QueryModuleVersionsRequest.encode(request).finish() + const promise = this.rpc.request( + "cosmos.upgrade.v1beta1.Query", + "ModuleVersions", + data, + ) + return promise.then((data) => + QueryModuleVersionsResponse.decode(new _m0.Reader(data)), + ) } } interface Rpc { - request(service: string, method: string, data: Uint8Array): Promise; + request(service: string, method: string, data: Uint8Array): Promise } -declare var self: any | undefined; -declare var window: any | undefined; -declare var global: any | undefined; +declare var self: any | undefined +declare var window: any | undefined +declare var global: any | undefined var globalThis: any = (() => { - if (typeof globalThis !== "undefined") { - return globalThis; - } - if (typeof self !== "undefined") { - return self; - } - if (typeof window !== "undefined") { - return window; - } - if (typeof global !== "undefined") { - return global; - } - throw "Unable to locate global object"; -})(); - + if (typeof globalThis !== "undefined") return globalThis + if (typeof self !== "undefined") return self + if (typeof window !== "undefined") return window + if (typeof global !== "undefined") return global + throw "Unable to locate global object" +})() + +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")) function bytesFromBase64(b64: string): Uint8Array { - if (globalThis.Buffer) { - return Uint8Array.from(globalThis.Buffer.from(b64, "base64")); - } else { - const bin = globalThis.atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; + 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 } +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")) function base64FromBytes(arr: Uint8Array): string { - if (globalThis.Buffer) { - return globalThis.Buffer.from(arr).toString("base64"); - } else { - const bin: string[] = []; - arr.forEach((byte) => { - bin.push(String.fromCharCode(byte)); - }); - return globalThis.btoa(bin.join("")); - } + const bin: string[] = [] + arr.forEach((byte) => { + bin.push(String.fromCharCode(byte)) + }) + return btoa(bin.join("")) } -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/cosmos/upgrade/v1beta1/upgrade.ts b/packages/protojs/src/cosmos/upgrade/v1beta1/upgrade.ts index 90567c4b..81bc8c73 100644 --- a/packages/protojs/src/cosmos/upgrade/v1beta1/upgrade.ts +++ b/packages/protojs/src/cosmos/upgrade/v1beta1/upgrade.ts @@ -1,10 +1,10 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { Any } from "../../../google/protobuf/any"; -import { Timestamp } from "../../../google/protobuf/timestamp"; +import { Any } from "../../../google/protobuf/any" +import { Timestamp } from "../../../google/protobuf/timestamp" +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "cosmos.upgrade.v1beta1"; +export const protobufPackage = "cosmos.upgrade.v1beta1" /** Plan specifies information about a planned upgrade and when it should occur. */ export interface Plan { @@ -17,7 +17,7 @@ export interface Plan { * assumed that the software is out-of-date when the upgrade Time or Height is * reached and the software will exit. */ - name: string; + name: string /** * Deprecated: Time based upgrades have been deprecated. Time based upgrade logic * has been removed from the SDK. @@ -25,17 +25,17 @@ export interface Plan { * * @deprecated */ - time?: Date; + time?: Date /** * The height at which the upgrade must be performed. * Only used if Time is not set. */ - height: Long; + height: Long /** * Any application specific upgrade info to be included on-chain * such as a git commit that validators could automatically upgrade to */ - info: string; + info: string /** * Deprecated: UpgradedClientState field has been deprecated. IBC upgrade logic has been * moved to the IBC module in the sub module 02-client. @@ -43,7 +43,7 @@ export interface Plan { * * @deprecated */ - upgradedClientState?: Any; + upgradedClientState?: Any } /** @@ -51,9 +51,9 @@ export interface Plan { * upgrade. */ export interface SoftwareUpgradeProposal { - title: string; - description: string; - plan?: Plan; + title: string + description: string + plan?: Plan } /** @@ -61,8 +61,8 @@ export interface SoftwareUpgradeProposal { * upgrade. */ export interface CancelSoftwareUpgradeProposal { - title: string; - description: string; + title: string + description: string } /** @@ -72,63 +72,69 @@ export interface CancelSoftwareUpgradeProposal { */ export interface ModuleVersion { /** name of the app module */ - name: string; + name: string /** consensus version of the app module */ - version: Long; + version: Long } function createBasePlan(): Plan { - return { name: "", time: undefined, height: Long.ZERO, info: "", upgradedClientState: undefined }; + return { + name: "", + time: undefined, + height: Long.ZERO, + info: "", + upgradedClientState: undefined, + } } export const Plan = { encode(message: Plan, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { - writer.uint32(10).string(message.name); + writer.uint32(10).string(message.name) } if (message.time !== undefined) { - Timestamp.encode(toTimestamp(message.time), writer.uint32(18).fork()).ldelim(); + Timestamp.encode(toTimestamp(message.time), writer.uint32(18).fork()).ldelim() } if (!message.height.isZero()) { - writer.uint32(24).int64(message.height); + writer.uint32(24).int64(message.height) } if (message.info !== "") { - writer.uint32(34).string(message.info); + writer.uint32(34).string(message.info) } if (message.upgradedClientState !== undefined) { - Any.encode(message.upgradedClientState, writer.uint32(42).fork()).ldelim(); + Any.encode(message.upgradedClientState, writer.uint32(42).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Plan { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBasePlan(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBasePlan() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.name = reader.string(); - break; + message.name = reader.string() + break case 2: - message.time = fromTimestamp(Timestamp.decode(reader, reader.uint32())); - break; + message.time = fromTimestamp(Timestamp.decode(reader, reader.uint32())) + break case 3: - message.height = reader.int64() as Long; - break; + message.height = reader.int64() as Long + break case 4: - message.info = reader.string(); - break; + message.info = reader.string() + break case 5: - message.upgradedClientState = Any.decode(reader, reader.uint32()); - break; + message.upgradedClientState = Any.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Plan { @@ -137,76 +143,86 @@ export const Plan = { time: isSet(object.time) ? fromJsonTimestamp(object.time) : undefined, height: isSet(object.height) ? Long.fromValue(object.height) : Long.ZERO, info: isSet(object.info) ? String(object.info) : "", - upgradedClientState: isSet(object.upgradedClientState) ? Any.fromJSON(object.upgradedClientState) : undefined, - }; + upgradedClientState: isSet(object.upgradedClientState) + ? Any.fromJSON(object.upgradedClientState) + : undefined, + } }, toJSON(message: Plan): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.time !== undefined && (obj.time = message.time.toISOString()); - message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); - message.info !== undefined && (obj.info = message.info); + const obj: any = {} + message.name !== undefined && (obj.name = message.name) + message.time !== undefined && (obj.time = message.time.toISOString()) + message.height !== undefined && + (obj.height = (message.height || Long.ZERO).toString()) + message.info !== undefined && (obj.info = message.info) message.upgradedClientState !== undefined && - (obj.upgradedClientState = message.upgradedClientState ? Any.toJSON(message.upgradedClientState) : undefined); - return obj; + (obj.upgradedClientState = message.upgradedClientState + ? Any.toJSON(message.upgradedClientState) + : undefined) + return obj }, fromPartial, I>>(object: I): Plan { - const message = createBasePlan(); - message.name = object.name ?? ""; - message.time = object.time ?? undefined; - message.height = (object.height !== undefined && object.height !== null) - ? Long.fromValue(object.height) - : Long.ZERO; - message.info = object.info ?? ""; - message.upgradedClientState = (object.upgradedClientState !== undefined && object.upgradedClientState !== null) - ? Any.fromPartial(object.upgradedClientState) - : undefined; - return message; + const message = createBasePlan() + message.name = object.name ?? "" + message.time = object.time ?? undefined + message.height = + object.height !== undefined && object.height !== null + ? Long.fromValue(object.height) + : Long.ZERO + message.info = object.info ?? "" + message.upgradedClientState = + object.upgradedClientState !== undefined && object.upgradedClientState !== null + ? Any.fromPartial(object.upgradedClientState) + : undefined + return message }, -}; +} function createBaseSoftwareUpgradeProposal(): SoftwareUpgradeProposal { - return { title: "", description: "", plan: undefined }; + return { title: "", description: "", plan: undefined } } export const SoftwareUpgradeProposal = { - encode(message: SoftwareUpgradeProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: SoftwareUpgradeProposal, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.title !== "") { - writer.uint32(10).string(message.title); + writer.uint32(10).string(message.title) } if (message.description !== "") { - writer.uint32(18).string(message.description); + writer.uint32(18).string(message.description) } if (message.plan !== undefined) { - Plan.encode(message.plan, writer.uint32(26).fork()).ldelim(); + Plan.encode(message.plan, writer.uint32(26).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): SoftwareUpgradeProposal { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSoftwareUpgradeProposal(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseSoftwareUpgradeProposal() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.title = reader.string(); - break; + message.title = reader.string() + break case 2: - message.description = reader.string(); - break; + message.description = reader.string() + break case 3: - message.plan = Plan.decode(reader, reader.uint32()); - break; + message.plan = Plan.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): SoftwareUpgradeProposal { @@ -214,189 +230,215 @@ export const SoftwareUpgradeProposal = { title: isSet(object.title) ? String(object.title) : "", description: isSet(object.description) ? String(object.description) : "", plan: isSet(object.plan) ? Plan.fromJSON(object.plan) : undefined, - }; + } }, toJSON(message: SoftwareUpgradeProposal): unknown { - const obj: any = {}; - message.title !== undefined && (obj.title = message.title); - message.description !== undefined && (obj.description = message.description); - message.plan !== undefined && (obj.plan = message.plan ? Plan.toJSON(message.plan) : undefined); - return obj; + const obj: any = {} + message.title !== undefined && (obj.title = message.title) + message.description !== undefined && (obj.description = message.description) + message.plan !== undefined && + (obj.plan = message.plan ? Plan.toJSON(message.plan) : undefined) + return obj }, - fromPartial, I>>(object: I): SoftwareUpgradeProposal { - const message = createBaseSoftwareUpgradeProposal(); - message.title = object.title ?? ""; - message.description = object.description ?? ""; - message.plan = (object.plan !== undefined && object.plan !== null) ? Plan.fromPartial(object.plan) : undefined; - return message; + fromPartial, I>>( + object: I, + ): SoftwareUpgradeProposal { + const message = createBaseSoftwareUpgradeProposal() + message.title = object.title ?? "" + message.description = object.description ?? "" + message.plan = + object.plan !== undefined && object.plan !== null + ? Plan.fromPartial(object.plan) + : undefined + return message }, -}; +} function createBaseCancelSoftwareUpgradeProposal(): CancelSoftwareUpgradeProposal { - return { title: "", description: "" }; + return { title: "", description: "" } } export const CancelSoftwareUpgradeProposal = { - encode(message: CancelSoftwareUpgradeProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: CancelSoftwareUpgradeProposal, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.title !== "") { - writer.uint32(10).string(message.title); + writer.uint32(10).string(message.title) } if (message.description !== "") { - writer.uint32(18).string(message.description); + writer.uint32(18).string(message.description) } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): CancelSoftwareUpgradeProposal { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseCancelSoftwareUpgradeProposal(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): CancelSoftwareUpgradeProposal { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseCancelSoftwareUpgradeProposal() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.title = reader.string(); - break; + message.title = reader.string() + break case 2: - message.description = reader.string(); - break; + message.description = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): CancelSoftwareUpgradeProposal { return { title: isSet(object.title) ? String(object.title) : "", description: isSet(object.description) ? String(object.description) : "", - }; + } }, toJSON(message: CancelSoftwareUpgradeProposal): unknown { - const obj: any = {}; - message.title !== undefined && (obj.title = message.title); - message.description !== undefined && (obj.description = message.description); - return obj; + const obj: any = {} + message.title !== undefined && (obj.title = message.title) + message.description !== undefined && (obj.description = message.description) + return obj }, fromPartial, I>>( object: I, ): CancelSoftwareUpgradeProposal { - const message = createBaseCancelSoftwareUpgradeProposal(); - message.title = object.title ?? ""; - message.description = object.description ?? ""; - return message; + const message = createBaseCancelSoftwareUpgradeProposal() + message.title = object.title ?? "" + message.description = object.description ?? "" + return message }, -}; +} function createBaseModuleVersion(): ModuleVersion { - return { name: "", version: Long.UZERO }; + return { name: "", version: Long.UZERO } } export const ModuleVersion = { encode(message: ModuleVersion, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { - writer.uint32(10).string(message.name); + writer.uint32(10).string(message.name) } if (!message.version.isZero()) { - writer.uint32(16).uint64(message.version); + writer.uint32(16).uint64(message.version) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): ModuleVersion { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseModuleVersion(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseModuleVersion() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.name = reader.string(); - break; + message.name = reader.string() + break case 2: - message.version = reader.uint64() as Long; - break; + message.version = reader.uint64() as Long + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): ModuleVersion { return { name: isSet(object.name) ? String(object.name) : "", version: isSet(object.version) ? Long.fromValue(object.version) : Long.UZERO, - }; + } }, toJSON(message: ModuleVersion): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.version !== undefined && (obj.version = (message.version || Long.UZERO).toString()); - return obj; + const obj: any = {} + message.name !== undefined && (obj.name = message.name) + message.version !== undefined && + (obj.version = (message.version || Long.UZERO).toString()) + return obj }, - fromPartial, I>>(object: I): ModuleVersion { - const message = createBaseModuleVersion(); - message.name = object.name ?? ""; - message.version = (object.version !== undefined && object.version !== null) - ? Long.fromValue(object.version) - : Long.UZERO; - return message; + fromPartial, I>>( + object: I, + ): ModuleVersion { + const message = createBaseModuleVersion() + message.name = object.name ?? "" + message.version = + object.version !== undefined && object.version !== null + ? Long.fromValue(object.version) + : Long.UZERO + return message }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; +} -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > function toTimestamp(date: Date): Timestamp { - const seconds = numberToLong(date.getTime() / 1_000); - const nanos = (date.getTime() % 1_000) * 1_000_000; - return { seconds, nanos }; + const seconds = numberToLong(date.getTime() / 1_000) + const nanos = (date.getTime() % 1_000) * 1_000_000 + return { seconds, nanos } } function fromTimestamp(t: Timestamp): Date { - let millis = t.seconds.toNumber() * 1_000; - millis += t.nanos / 1_000_000; - return new Date(millis); + let millis = t.seconds.toNumber() * 1_000 + millis += t.nanos / 1_000_000 + return new Date(millis) } function fromJsonTimestamp(o: any): Date { if (o instanceof Date) { - return o; + return o } else if (typeof o === "string") { - return new Date(o); + return new Date(o) } else { - return fromTimestamp(Timestamp.fromJSON(o)); + return fromTimestamp(Timestamp.fromJSON(o)) } } function numberToLong(number: number) { - return Long.fromNumber(number); + return Long.fromNumber(number) } if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/cosmos/vesting/v1beta1/tx.ts b/packages/protojs/src/cosmos/vesting/v1beta1/tx.ts index 1fdef3b7..11c8ac69 100644 --- a/packages/protojs/src/cosmos/vesting/v1beta1/tx.ts +++ b/packages/protojs/src/cosmos/vesting/v1beta1/tx.ts @@ -1,155 +1,177 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { Coin } from "../../base/v1beta1/coin"; +import Long from "long" +import { Coin } from "../../base/v1beta1/coin" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "cosmos.vesting.v1beta1"; +export const protobufPackage = "cosmos.vesting.v1beta1" /** * MsgCreateVestingAccount defines a message that enables creating a vesting * account. */ export interface MsgCreateVestingAccount { - fromAddress: string; - toAddress: string; - amount: Coin[]; - endTime: Long; - delayed: boolean; + fromAddress: string + toAddress: string + amount: Coin[] + endTime: Long + delayed: boolean } /** MsgCreateVestingAccountResponse defines the Msg/CreateVestingAccount response type. */ -export interface MsgCreateVestingAccountResponse { -} +export interface MsgCreateVestingAccountResponse {} function createBaseMsgCreateVestingAccount(): MsgCreateVestingAccount { - return { fromAddress: "", toAddress: "", amount: [], endTime: Long.ZERO, delayed: false }; + return { + fromAddress: "", + toAddress: "", + amount: [], + endTime: Long.ZERO, + delayed: false, + } } export const MsgCreateVestingAccount = { - encode(message: MsgCreateVestingAccount, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: MsgCreateVestingAccount, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.fromAddress !== "") { - writer.uint32(10).string(message.fromAddress); + writer.uint32(10).string(message.fromAddress) } if (message.toAddress !== "") { - writer.uint32(18).string(message.toAddress); + writer.uint32(18).string(message.toAddress) } for (const v of message.amount) { - Coin.encode(v!, writer.uint32(26).fork()).ldelim(); + Coin.encode(v!, writer.uint32(26).fork()).ldelim() } if (!message.endTime.isZero()) { - writer.uint32(32).int64(message.endTime); + writer.uint32(32).int64(message.endTime) } if (message.delayed === true) { - writer.uint32(40).bool(message.delayed); + writer.uint32(40).bool(message.delayed) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateVestingAccount { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgCreateVestingAccount(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgCreateVestingAccount() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.fromAddress = reader.string(); - break; + message.fromAddress = reader.string() + break case 2: - message.toAddress = reader.string(); - break; + message.toAddress = reader.string() + break case 3: - message.amount.push(Coin.decode(reader, reader.uint32())); - break; + message.amount.push(Coin.decode(reader, reader.uint32())) + break case 4: - message.endTime = reader.int64() as Long; - break; + message.endTime = reader.int64() as Long + break case 5: - message.delayed = reader.bool(); - break; + message.delayed = reader.bool() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): MsgCreateVestingAccount { return { fromAddress: isSet(object.fromAddress) ? String(object.fromAddress) : "", toAddress: isSet(object.toAddress) ? String(object.toAddress) : "", - amount: Array.isArray(object?.amount) ? object.amount.map((e: any) => Coin.fromJSON(e)) : [], + amount: Array.isArray(object?.amount) + ? object.amount.map((e: any) => Coin.fromJSON(e)) + : [], endTime: isSet(object.endTime) ? Long.fromValue(object.endTime) : Long.ZERO, delayed: isSet(object.delayed) ? Boolean(object.delayed) : false, - }; + } }, toJSON(message: MsgCreateVestingAccount): unknown { - const obj: any = {}; - message.fromAddress !== undefined && (obj.fromAddress = message.fromAddress); - message.toAddress !== undefined && (obj.toAddress = message.toAddress); + 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); + obj.amount = message.amount.map((e) => (e ? Coin.toJSON(e) : undefined)) } else { - obj.amount = []; + obj.amount = [] } - message.endTime !== undefined && (obj.endTime = (message.endTime || Long.ZERO).toString()); - message.delayed !== undefined && (obj.delayed = message.delayed); - return obj; + message.endTime !== undefined && + (obj.endTime = (message.endTime || Long.ZERO).toString()) + message.delayed !== undefined && (obj.delayed = message.delayed) + return obj }, - fromPartial, I>>(object: I): MsgCreateVestingAccount { - const message = createBaseMsgCreateVestingAccount(); - message.fromAddress = object.fromAddress ?? ""; - message.toAddress = object.toAddress ?? ""; - message.amount = object.amount?.map((e) => Coin.fromPartial(e)) || []; - message.endTime = (object.endTime !== undefined && object.endTime !== null) - ? Long.fromValue(object.endTime) - : Long.ZERO; - message.delayed = object.delayed ?? false; - return message; + fromPartial, I>>( + object: I, + ): MsgCreateVestingAccount { + const message = createBaseMsgCreateVestingAccount() + message.fromAddress = object.fromAddress ?? "" + message.toAddress = object.toAddress ?? "" + message.amount = object.amount?.map((e) => Coin.fromPartial(e)) || [] + message.endTime = + object.endTime !== undefined && object.endTime !== null + ? Long.fromValue(object.endTime) + : Long.ZERO + message.delayed = object.delayed ?? false + return message }, -}; +} function createBaseMsgCreateVestingAccountResponse(): MsgCreateVestingAccountResponse { - return {}; + return {} } export const MsgCreateVestingAccountResponse = { - encode(_: MsgCreateVestingAccountResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; + encode( + _: MsgCreateVestingAccountResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateVestingAccountResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgCreateVestingAccountResponse(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgCreateVestingAccountResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgCreateVestingAccountResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(_: any): MsgCreateVestingAccountResponse { - return {}; + return {} }, toJSON(_: MsgCreateVestingAccountResponse): unknown { - const obj: any = {}; - return obj; + const obj: any = {} + return obj }, - fromPartial, I>>(_: I): MsgCreateVestingAccountResponse { - const message = createBaseMsgCreateVestingAccountResponse(); - return message; + fromPartial, I>>( + _: I, + ): MsgCreateVestingAccountResponse { + const message = createBaseMsgCreateVestingAccountResponse() + return message }, -}; +} /** Msg defines the bank Msg service. */ export interface Msg { @@ -157,43 +179,63 @@ export interface Msg { * CreateVestingAccount defines a method that enables creating a vesting * account. */ - CreateVestingAccount(request: MsgCreateVestingAccount): Promise; + CreateVestingAccount( + request: MsgCreateVestingAccount, + ): Promise } export class MsgClientImpl implements Msg { - private readonly rpc: Rpc; + private readonly rpc: Rpc constructor(rpc: Rpc) { - this.rpc = rpc; - this.CreateVestingAccount = this.CreateVestingAccount.bind(this); + this.rpc = rpc + this.CreateVestingAccount = this.CreateVestingAccount.bind(this) } - CreateVestingAccount(request: MsgCreateVestingAccount): Promise { - const data = MsgCreateVestingAccount.encode(request).finish(); - const promise = this.rpc.request("cosmos.vesting.v1beta1.Msg", "CreateVestingAccount", data); - return promise.then((data) => MsgCreateVestingAccountResponse.decode(new _m0.Reader(data))); + CreateVestingAccount( + request: MsgCreateVestingAccount, + ): Promise { + const data = MsgCreateVestingAccount.encode(request).finish() + const promise = this.rpc.request( + "cosmos.vesting.v1beta1.Msg", + "CreateVestingAccount", + data, + ) + return promise.then((data) => + MsgCreateVestingAccountResponse.decode(new _m0.Reader(data)), + ) } } interface Rpc { - request(service: string, method: string, data: Uint8Array): Promise; + request(service: string, method: string, data: Uint8Array): Promise } -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/cosmos/vesting/v1beta1/vesting.ts b/packages/protojs/src/cosmos/vesting/v1beta1/vesting.ts index b8fd3e8d..ff770d3f 100644 --- a/packages/protojs/src/cosmos/vesting/v1beta1/vesting.ts +++ b/packages/protojs/src/cosmos/vesting/v1beta1/vesting.ts @@ -1,21 +1,21 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { BaseAccount } from "../../auth/v1beta1/auth"; -import { Coin } from "../../base/v1beta1/coin"; +import { BaseAccount } from "../../auth/v1beta1/auth" +import Long from "long" +import { Coin } from "../../base/v1beta1/coin" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "cosmos.vesting.v1beta1"; +export const protobufPackage = "cosmos.vesting.v1beta1" /** * BaseVestingAccount implements the VestingAccount interface. It contains all * the necessary fields needed for any vesting account implementation. */ export interface BaseVestingAccount { - baseAccount?: BaseAccount; - originalVesting: Coin[]; - delegatedFree: Coin[]; - delegatedVesting: Coin[]; - endTime: Long; + baseAccount?: BaseAccount + originalVesting: Coin[] + delegatedFree: Coin[] + delegatedVesting: Coin[] + endTime: Long } /** @@ -23,8 +23,8 @@ export interface BaseVestingAccount { * continuously vests by unlocking coins linearly with respect to time. */ export interface ContinuousVestingAccount { - baseVestingAccount?: BaseVestingAccount; - startTime: Long; + baseVestingAccount?: BaseVestingAccount + startTime: Long } /** @@ -33,13 +33,13 @@ export interface ContinuousVestingAccount { * locked until a specified time. */ export interface DelayedVestingAccount { - baseVestingAccount?: BaseVestingAccount; + baseVestingAccount?: BaseVestingAccount } /** Period defines a length of time and amount of coins that will vest. */ export interface Period { - length: Long; - amount: Coin[]; + length: Long + amount: Coin[] } /** @@ -47,9 +47,9 @@ export interface Period { * periodically vests by unlocking coins during each specified period. */ export interface PeriodicVestingAccount { - baseVestingAccount?: BaseVestingAccount; - startTime: Long; - vestingPeriods: Period[]; + baseVestingAccount?: BaseVestingAccount + startTime: Long + vestingPeriods: Period[] } /** @@ -60,149 +60,186 @@ export interface PeriodicVestingAccount { * Since: cosmos-sdk 0.43 */ export interface PermanentLockedAccount { - baseVestingAccount?: BaseVestingAccount; + baseVestingAccount?: BaseVestingAccount } function createBaseBaseVestingAccount(): BaseVestingAccount { - return { baseAccount: undefined, originalVesting: [], delegatedFree: [], delegatedVesting: [], endTime: Long.ZERO }; + return { + baseAccount: undefined, + originalVesting: [], + delegatedFree: [], + delegatedVesting: [], + endTime: Long.ZERO, + } } export const BaseVestingAccount = { - encode(message: BaseVestingAccount, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: BaseVestingAccount, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.baseAccount !== undefined) { - BaseAccount.encode(message.baseAccount, writer.uint32(10).fork()).ldelim(); + BaseAccount.encode(message.baseAccount, writer.uint32(10).fork()).ldelim() } for (const v of message.originalVesting) { - Coin.encode(v!, writer.uint32(18).fork()).ldelim(); + Coin.encode(v!, writer.uint32(18).fork()).ldelim() } for (const v of message.delegatedFree) { - Coin.encode(v!, writer.uint32(26).fork()).ldelim(); + Coin.encode(v!, writer.uint32(26).fork()).ldelim() } for (const v of message.delegatedVesting) { - Coin.encode(v!, writer.uint32(34).fork()).ldelim(); + Coin.encode(v!, writer.uint32(34).fork()).ldelim() } if (!message.endTime.isZero()) { - writer.uint32(40).int64(message.endTime); + writer.uint32(40).int64(message.endTime) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): BaseVestingAccount { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseBaseVestingAccount(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseBaseVestingAccount() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.baseAccount = BaseAccount.decode(reader, reader.uint32()); - break; + message.baseAccount = BaseAccount.decode(reader, reader.uint32()) + break case 2: - message.originalVesting.push(Coin.decode(reader, reader.uint32())); - break; + message.originalVesting.push(Coin.decode(reader, reader.uint32())) + break case 3: - message.delegatedFree.push(Coin.decode(reader, reader.uint32())); - break; + message.delegatedFree.push(Coin.decode(reader, reader.uint32())) + break case 4: - message.delegatedVesting.push(Coin.decode(reader, reader.uint32())); - break; + message.delegatedVesting.push(Coin.decode(reader, reader.uint32())) + break case 5: - message.endTime = reader.int64() as Long; - break; + message.endTime = reader.int64() as Long + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): BaseVestingAccount { return { - baseAccount: isSet(object.baseAccount) ? BaseAccount.fromJSON(object.baseAccount) : undefined, + baseAccount: isSet(object.baseAccount) + ? BaseAccount.fromJSON(object.baseAccount) + : undefined, originalVesting: Array.isArray(object?.originalVesting) ? object.originalVesting.map((e: any) => Coin.fromJSON(e)) : [], - delegatedFree: Array.isArray(object?.delegatedFree) ? object.delegatedFree.map((e: any) => Coin.fromJSON(e)) : [], + delegatedFree: Array.isArray(object?.delegatedFree) + ? object.delegatedFree.map((e: any) => Coin.fromJSON(e)) + : [], delegatedVesting: Array.isArray(object?.delegatedVesting) ? object.delegatedVesting.map((e: any) => Coin.fromJSON(e)) : [], endTime: isSet(object.endTime) ? Long.fromValue(object.endTime) : Long.ZERO, - }; + } }, toJSON(message: BaseVestingAccount): unknown { - const obj: any = {}; + const obj: any = {} message.baseAccount !== undefined && - (obj.baseAccount = message.baseAccount ? BaseAccount.toJSON(message.baseAccount) : undefined); + (obj.baseAccount = message.baseAccount + ? BaseAccount.toJSON(message.baseAccount) + : undefined) if (message.originalVesting) { - obj.originalVesting = message.originalVesting.map((e) => e ? Coin.toJSON(e) : undefined); + obj.originalVesting = message.originalVesting.map((e) => + e ? Coin.toJSON(e) : undefined, + ) } else { - obj.originalVesting = []; + obj.originalVesting = [] } if (message.delegatedFree) { - obj.delegatedFree = message.delegatedFree.map((e) => e ? Coin.toJSON(e) : undefined); + obj.delegatedFree = message.delegatedFree.map((e) => + e ? Coin.toJSON(e) : undefined, + ) } else { - obj.delegatedFree = []; + obj.delegatedFree = [] } if (message.delegatedVesting) { - obj.delegatedVesting = message.delegatedVesting.map((e) => e ? Coin.toJSON(e) : undefined); + obj.delegatedVesting = message.delegatedVesting.map((e) => + e ? Coin.toJSON(e) : undefined, + ) } else { - obj.delegatedVesting = []; + obj.delegatedVesting = [] } - message.endTime !== undefined && (obj.endTime = (message.endTime || Long.ZERO).toString()); - return obj; + message.endTime !== undefined && + (obj.endTime = (message.endTime || Long.ZERO).toString()) + return obj }, - fromPartial, I>>(object: I): BaseVestingAccount { - const message = createBaseBaseVestingAccount(); - message.baseAccount = (object.baseAccount !== undefined && object.baseAccount !== null) - ? BaseAccount.fromPartial(object.baseAccount) - : undefined; - message.originalVesting = object.originalVesting?.map((e) => Coin.fromPartial(e)) || []; - message.delegatedFree = object.delegatedFree?.map((e) => Coin.fromPartial(e)) || []; - message.delegatedVesting = object.delegatedVesting?.map((e) => Coin.fromPartial(e)) || []; - message.endTime = (object.endTime !== undefined && object.endTime !== null) - ? Long.fromValue(object.endTime) - : Long.ZERO; - return message; + fromPartial, I>>( + object: I, + ): BaseVestingAccount { + const message = createBaseBaseVestingAccount() + message.baseAccount = + object.baseAccount !== undefined && object.baseAccount !== null + ? BaseAccount.fromPartial(object.baseAccount) + : undefined + message.originalVesting = + object.originalVesting?.map((e) => Coin.fromPartial(e)) || [] + message.delegatedFree = object.delegatedFree?.map((e) => Coin.fromPartial(e)) || [] + message.delegatedVesting = + object.delegatedVesting?.map((e) => Coin.fromPartial(e)) || [] + message.endTime = + object.endTime !== undefined && object.endTime !== null + ? Long.fromValue(object.endTime) + : Long.ZERO + return message }, -}; +} function createBaseContinuousVestingAccount(): ContinuousVestingAccount { - return { baseVestingAccount: undefined, startTime: Long.ZERO }; + return { baseVestingAccount: undefined, startTime: Long.ZERO } } export const ContinuousVestingAccount = { - encode(message: ContinuousVestingAccount, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: ContinuousVestingAccount, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.baseVestingAccount !== undefined) { - BaseVestingAccount.encode(message.baseVestingAccount, writer.uint32(10).fork()).ldelim(); + BaseVestingAccount.encode( + message.baseVestingAccount, + writer.uint32(10).fork(), + ).ldelim() } if (!message.startTime.isZero()) { - writer.uint32(16).int64(message.startTime); + writer.uint32(16).int64(message.startTime) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): ContinuousVestingAccount { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseContinuousVestingAccount(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseContinuousVestingAccount() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.baseVestingAccount = BaseVestingAccount.decode(reader, reader.uint32()); - break; + message.baseVestingAccount = BaseVestingAccount.decode( + reader, + reader.uint32(), + ) + break case 2: - message.startTime = reader.int64() as Long; - break; + message.startTime = reader.int64() as Long + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): ContinuousVestingAccount { @@ -211,58 +248,73 @@ export const ContinuousVestingAccount = { ? BaseVestingAccount.fromJSON(object.baseVestingAccount) : undefined, startTime: isSet(object.startTime) ? Long.fromValue(object.startTime) : Long.ZERO, - }; + } }, toJSON(message: ContinuousVestingAccount): unknown { - const obj: any = {}; - message.baseVestingAccount !== undefined && (obj.baseVestingAccount = message.baseVestingAccount - ? BaseVestingAccount.toJSON(message.baseVestingAccount) - : undefined); - message.startTime !== undefined && (obj.startTime = (message.startTime || Long.ZERO).toString()); - return obj; + const obj: any = {} + message.baseVestingAccount !== undefined && + (obj.baseVestingAccount = message.baseVestingAccount + ? BaseVestingAccount.toJSON(message.baseVestingAccount) + : undefined) + message.startTime !== undefined && + (obj.startTime = (message.startTime || Long.ZERO).toString()) + return obj }, - fromPartial, I>>(object: I): ContinuousVestingAccount { - const message = createBaseContinuousVestingAccount(); - message.baseVestingAccount = (object.baseVestingAccount !== undefined && object.baseVestingAccount !== null) - ? BaseVestingAccount.fromPartial(object.baseVestingAccount) - : undefined; - message.startTime = (object.startTime !== undefined && object.startTime !== null) - ? Long.fromValue(object.startTime) - : Long.ZERO; - return message; + fromPartial, I>>( + object: I, + ): ContinuousVestingAccount { + const message = createBaseContinuousVestingAccount() + message.baseVestingAccount = + object.baseVestingAccount !== undefined && object.baseVestingAccount !== null + ? BaseVestingAccount.fromPartial(object.baseVestingAccount) + : undefined + message.startTime = + object.startTime !== undefined && object.startTime !== null + ? Long.fromValue(object.startTime) + : Long.ZERO + return message }, -}; +} function createBaseDelayedVestingAccount(): DelayedVestingAccount { - return { baseVestingAccount: undefined }; + return { baseVestingAccount: undefined } } export const DelayedVestingAccount = { - encode(message: DelayedVestingAccount, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: DelayedVestingAccount, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.baseVestingAccount !== undefined) { - BaseVestingAccount.encode(message.baseVestingAccount, writer.uint32(10).fork()).ldelim(); + BaseVestingAccount.encode( + message.baseVestingAccount, + writer.uint32(10).fork(), + ).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): DelayedVestingAccount { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDelayedVestingAccount(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseDelayedVestingAccount() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.baseVestingAccount = BaseVestingAccount.decode(reader, reader.uint32()); - break; + message.baseVestingAccount = BaseVestingAccount.decode( + reader, + reader.uint32(), + ) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): DelayedVestingAccount { @@ -270,130 +322,147 @@ export const DelayedVestingAccount = { baseVestingAccount: isSet(object.baseVestingAccount) ? BaseVestingAccount.fromJSON(object.baseVestingAccount) : undefined, - }; + } }, toJSON(message: DelayedVestingAccount): unknown { - const obj: any = {}; - message.baseVestingAccount !== undefined && (obj.baseVestingAccount = message.baseVestingAccount - ? BaseVestingAccount.toJSON(message.baseVestingAccount) - : undefined); - return obj; + const obj: any = {} + message.baseVestingAccount !== undefined && + (obj.baseVestingAccount = message.baseVestingAccount + ? BaseVestingAccount.toJSON(message.baseVestingAccount) + : undefined) + return obj }, - fromPartial, I>>(object: I): DelayedVestingAccount { - const message = createBaseDelayedVestingAccount(); - message.baseVestingAccount = (object.baseVestingAccount !== undefined && object.baseVestingAccount !== null) - ? BaseVestingAccount.fromPartial(object.baseVestingAccount) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): DelayedVestingAccount { + const message = createBaseDelayedVestingAccount() + message.baseVestingAccount = + object.baseVestingAccount !== undefined && object.baseVestingAccount !== null + ? BaseVestingAccount.fromPartial(object.baseVestingAccount) + : undefined + return message }, -}; +} function createBasePeriod(): Period { - return { length: Long.ZERO, amount: [] }; + return { length: Long.ZERO, amount: [] } } export const Period = { encode(message: Period, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (!message.length.isZero()) { - writer.uint32(8).int64(message.length); + writer.uint32(8).int64(message.length) } for (const v of message.amount) { - Coin.encode(v!, writer.uint32(18).fork()).ldelim(); + Coin.encode(v!, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Period { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBasePeriod(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBasePeriod() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.length = reader.int64() as Long; - break; + message.length = reader.int64() as Long + break case 2: - message.amount.push(Coin.decode(reader, reader.uint32())); - break; + message.amount.push(Coin.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Period { return { length: isSet(object.length) ? Long.fromValue(object.length) : Long.ZERO, - amount: Array.isArray(object?.amount) ? object.amount.map((e: any) => Coin.fromJSON(e)) : [], - }; + amount: Array.isArray(object?.amount) + ? object.amount.map((e: any) => Coin.fromJSON(e)) + : [], + } }, toJSON(message: Period): unknown { - const obj: any = {}; - message.length !== undefined && (obj.length = (message.length || Long.ZERO).toString()); + const obj: any = {} + message.length !== undefined && + (obj.length = (message.length || Long.ZERO).toString()) if (message.amount) { - obj.amount = message.amount.map((e) => e ? Coin.toJSON(e) : undefined); + obj.amount = message.amount.map((e) => (e ? Coin.toJSON(e) : undefined)) } else { - obj.amount = []; + obj.amount = [] } - return obj; + return obj }, fromPartial, I>>(object: I): Period { - const message = createBasePeriod(); - message.length = (object.length !== undefined && object.length !== null) - ? Long.fromValue(object.length) - : Long.ZERO; - message.amount = object.amount?.map((e) => Coin.fromPartial(e)) || []; - return message; + const message = createBasePeriod() + message.length = + object.length !== undefined && object.length !== null + ? Long.fromValue(object.length) + : Long.ZERO + message.amount = object.amount?.map((e) => Coin.fromPartial(e)) || [] + return message }, -}; +} function createBasePeriodicVestingAccount(): PeriodicVestingAccount { - return { baseVestingAccount: undefined, startTime: Long.ZERO, vestingPeriods: [] }; + return { baseVestingAccount: undefined, startTime: Long.ZERO, vestingPeriods: [] } } export const PeriodicVestingAccount = { - encode(message: PeriodicVestingAccount, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: PeriodicVestingAccount, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.baseVestingAccount !== undefined) { - BaseVestingAccount.encode(message.baseVestingAccount, writer.uint32(10).fork()).ldelim(); + BaseVestingAccount.encode( + message.baseVestingAccount, + writer.uint32(10).fork(), + ).ldelim() } if (!message.startTime.isZero()) { - writer.uint32(16).int64(message.startTime); + writer.uint32(16).int64(message.startTime) } for (const v of message.vestingPeriods) { - Period.encode(v!, writer.uint32(26).fork()).ldelim(); + Period.encode(v!, writer.uint32(26).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): PeriodicVestingAccount { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBasePeriodicVestingAccount(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBasePeriodicVestingAccount() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.baseVestingAccount = BaseVestingAccount.decode(reader, reader.uint32()); - break; + message.baseVestingAccount = BaseVestingAccount.decode( + reader, + reader.uint32(), + ) + break case 2: - message.startTime = reader.int64() as Long; - break; + message.startTime = reader.int64() as Long + break case 3: - message.vestingPeriods.push(Period.decode(reader, reader.uint32())); - break; + message.vestingPeriods.push(Period.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): PeriodicVestingAccount { @@ -405,64 +474,82 @@ export const PeriodicVestingAccount = { vestingPeriods: Array.isArray(object?.vestingPeriods) ? object.vestingPeriods.map((e: any) => Period.fromJSON(e)) : [], - }; + } }, toJSON(message: PeriodicVestingAccount): unknown { - const obj: any = {}; - message.baseVestingAccount !== undefined && (obj.baseVestingAccount = message.baseVestingAccount - ? BaseVestingAccount.toJSON(message.baseVestingAccount) - : undefined); - message.startTime !== undefined && (obj.startTime = (message.startTime || Long.ZERO).toString()); + const obj: any = {} + message.baseVestingAccount !== undefined && + (obj.baseVestingAccount = message.baseVestingAccount + ? BaseVestingAccount.toJSON(message.baseVestingAccount) + : undefined) + message.startTime !== undefined && + (obj.startTime = (message.startTime || Long.ZERO).toString()) if (message.vestingPeriods) { - obj.vestingPeriods = message.vestingPeriods.map((e) => e ? Period.toJSON(e) : undefined); + obj.vestingPeriods = message.vestingPeriods.map((e) => + e ? Period.toJSON(e) : undefined, + ) } else { - obj.vestingPeriods = []; + obj.vestingPeriods = [] } - return obj; + return obj }, - fromPartial, I>>(object: I): PeriodicVestingAccount { - const message = createBasePeriodicVestingAccount(); - message.baseVestingAccount = (object.baseVestingAccount !== undefined && object.baseVestingAccount !== null) - ? BaseVestingAccount.fromPartial(object.baseVestingAccount) - : undefined; - message.startTime = (object.startTime !== undefined && object.startTime !== null) - ? Long.fromValue(object.startTime) - : Long.ZERO; - message.vestingPeriods = object.vestingPeriods?.map((e) => Period.fromPartial(e)) || []; - return message; + fromPartial, I>>( + object: I, + ): PeriodicVestingAccount { + const message = createBasePeriodicVestingAccount() + message.baseVestingAccount = + object.baseVestingAccount !== undefined && object.baseVestingAccount !== null + ? BaseVestingAccount.fromPartial(object.baseVestingAccount) + : undefined + message.startTime = + object.startTime !== undefined && object.startTime !== null + ? Long.fromValue(object.startTime) + : Long.ZERO + message.vestingPeriods = + object.vestingPeriods?.map((e) => Period.fromPartial(e)) || [] + return message }, -}; +} function createBasePermanentLockedAccount(): PermanentLockedAccount { - return { baseVestingAccount: undefined }; + return { baseVestingAccount: undefined } } export const PermanentLockedAccount = { - encode(message: PermanentLockedAccount, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: PermanentLockedAccount, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.baseVestingAccount !== undefined) { - BaseVestingAccount.encode(message.baseVestingAccount, writer.uint32(10).fork()).ldelim(); + BaseVestingAccount.encode( + message.baseVestingAccount, + writer.uint32(10).fork(), + ).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): PermanentLockedAccount { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBasePermanentLockedAccount(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBasePermanentLockedAccount() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.baseVestingAccount = BaseVestingAccount.decode(reader, reader.uint32()); - break; + message.baseVestingAccount = BaseVestingAccount.decode( + reader, + reader.uint32(), + ) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): PermanentLockedAccount { @@ -470,43 +557,57 @@ export const PermanentLockedAccount = { baseVestingAccount: isSet(object.baseVestingAccount) ? BaseVestingAccount.fromJSON(object.baseVestingAccount) : undefined, - }; + } }, toJSON(message: PermanentLockedAccount): unknown { - const obj: any = {}; - message.baseVestingAccount !== undefined && (obj.baseVestingAccount = message.baseVestingAccount - ? BaseVestingAccount.toJSON(message.baseVestingAccount) - : undefined); - return obj; + const obj: any = {} + message.baseVestingAccount !== undefined && + (obj.baseVestingAccount = message.baseVestingAccount + ? BaseVestingAccount.toJSON(message.baseVestingAccount) + : undefined) + return obj }, - fromPartial, I>>(object: I): PermanentLockedAccount { - const message = createBasePermanentLockedAccount(); - message.baseVestingAccount = (object.baseVestingAccount !== undefined && object.baseVestingAccount !== null) - ? BaseVestingAccount.fromPartial(object.baseVestingAccount) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): PermanentLockedAccount { + const message = createBasePermanentLockedAccount() + message.baseVestingAccount = + object.baseVestingAccount !== undefined && object.baseVestingAccount !== null + ? BaseVestingAccount.fromPartial(object.baseVestingAccount) + : undefined + return message }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; +} -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/cosmos_proto/cosmos.ts b/packages/protojs/src/cosmos_proto/cosmos.ts index 1ef6995b..042ebce4 100644 --- a/packages/protojs/src/cosmos_proto/cosmos.ts +++ b/packages/protojs/src/cosmos_proto/cosmos.ts @@ -1,3 +1,2 @@ /* eslint-disable */ - -export const protobufPackage = "cosmos_proto"; +export const protobufPackage = "cosmos_proto" diff --git a/packages/protojs/src/epochs/event.ts b/packages/protojs/src/epochs/event.ts index f993b6ee..fdace0a0 100644 --- a/packages/protojs/src/epochs/event.ts +++ b/packages/protojs/src/epochs/event.ts @@ -1,174 +1,209 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { Timestamp } from "../google/protobuf/timestamp"; +import { Timestamp } from "../google/protobuf/timestamp" +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "nibiru.epochs.v1"; +export const protobufPackage = "nibiru.epochs.v1" export interface EventEpochStart { /** Epoch number, starting from 1. */ - epochNumber: Long; + epochNumber: Long /** The start timestamp of the epoch. */ - epochStartTime?: Date; + epochStartTime?: Date } export interface EventEpochEnd { /** Epoch number, starting from 1. */ - epochNumber: Long; + epochNumber: Long } function createBaseEventEpochStart(): EventEpochStart { - return { epochNumber: Long.UZERO, epochStartTime: undefined }; + return { epochNumber: Long.UZERO, epochStartTime: undefined } } export const EventEpochStart = { - encode(message: EventEpochStart, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: EventEpochStart, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (!message.epochNumber.isZero()) { - writer.uint32(8).uint64(message.epochNumber); + writer.uint32(8).uint64(message.epochNumber) } if (message.epochStartTime !== undefined) { - Timestamp.encode(toTimestamp(message.epochStartTime), writer.uint32(18).fork()).ldelim(); + Timestamp.encode( + toTimestamp(message.epochStartTime), + writer.uint32(18).fork(), + ).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): EventEpochStart { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseEventEpochStart(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseEventEpochStart() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.epochNumber = reader.uint64() as Long; - break; + message.epochNumber = reader.uint64() as Long + break case 2: - message.epochStartTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); - break; + message.epochStartTime = fromTimestamp( + Timestamp.decode(reader, reader.uint32()), + ) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): EventEpochStart { return { - epochNumber: isSet(object.epochNumber) ? Long.fromValue(object.epochNumber) : Long.UZERO, - epochStartTime: isSet(object.epochStartTime) ? fromJsonTimestamp(object.epochStartTime) : undefined, - }; + epochNumber: isSet(object.epochNumber) + ? Long.fromValue(object.epochNumber) + : Long.UZERO, + epochStartTime: isSet(object.epochStartTime) + ? fromJsonTimestamp(object.epochStartTime) + : undefined, + } }, toJSON(message: EventEpochStart): unknown { - const obj: any = {}; - message.epochNumber !== undefined && (obj.epochNumber = (message.epochNumber || Long.UZERO).toString()); - message.epochStartTime !== undefined && (obj.epochStartTime = message.epochStartTime.toISOString()); - return obj; + const obj: any = {} + message.epochNumber !== undefined && + (obj.epochNumber = (message.epochNumber || Long.UZERO).toString()) + message.epochStartTime !== undefined && + (obj.epochStartTime = message.epochStartTime.toISOString()) + return obj }, - fromPartial, I>>(object: I): EventEpochStart { - const message = createBaseEventEpochStart(); - message.epochNumber = (object.epochNumber !== undefined && object.epochNumber !== null) - ? Long.fromValue(object.epochNumber) - : Long.UZERO; - message.epochStartTime = object.epochStartTime ?? undefined; - return message; + fromPartial, I>>( + object: I, + ): EventEpochStart { + const message = createBaseEventEpochStart() + message.epochNumber = + object.epochNumber !== undefined && object.epochNumber !== null + ? Long.fromValue(object.epochNumber) + : Long.UZERO + message.epochStartTime = object.epochStartTime ?? undefined + return message }, -}; +} function createBaseEventEpochEnd(): EventEpochEnd { - return { epochNumber: Long.UZERO }; + return { epochNumber: Long.UZERO } } export const EventEpochEnd = { encode(message: EventEpochEnd, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (!message.epochNumber.isZero()) { - writer.uint32(8).uint64(message.epochNumber); + writer.uint32(8).uint64(message.epochNumber) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): EventEpochEnd { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseEventEpochEnd(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseEventEpochEnd() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.epochNumber = reader.uint64() as Long; - break; + message.epochNumber = reader.uint64() as Long + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): EventEpochEnd { - return { epochNumber: isSet(object.epochNumber) ? Long.fromValue(object.epochNumber) : Long.UZERO }; + return { + epochNumber: isSet(object.epochNumber) + ? Long.fromValue(object.epochNumber) + : Long.UZERO, + } }, toJSON(message: EventEpochEnd): unknown { - const obj: any = {}; - message.epochNumber !== undefined && (obj.epochNumber = (message.epochNumber || Long.UZERO).toString()); - return obj; + const obj: any = {} + message.epochNumber !== undefined && + (obj.epochNumber = (message.epochNumber || Long.UZERO).toString()) + return obj }, - fromPartial, I>>(object: I): EventEpochEnd { - const message = createBaseEventEpochEnd(); - message.epochNumber = (object.epochNumber !== undefined && object.epochNumber !== null) - ? Long.fromValue(object.epochNumber) - : Long.UZERO; - return message; + fromPartial, I>>( + object: I, + ): EventEpochEnd { + const message = createBaseEventEpochEnd() + message.epochNumber = + object.epochNumber !== undefined && object.epochNumber !== null + ? Long.fromValue(object.epochNumber) + : Long.UZERO + return message }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; +} -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > function toTimestamp(date: Date): Timestamp { - const seconds = numberToLong(date.getTime() / 1_000); - const nanos = (date.getTime() % 1_000) * 1_000_000; - return { seconds, nanos }; + const seconds = numberToLong(date.getTime() / 1_000) + const nanos = (date.getTime() % 1_000) * 1_000_000 + return { seconds, nanos } } function fromTimestamp(t: Timestamp): Date { - let millis = t.seconds.toNumber() * 1_000; - millis += t.nanos / 1_000_000; - return new Date(millis); + let millis = t.seconds.toNumber() * 1_000 + millis += t.nanos / 1_000_000 + return new Date(millis) } function fromJsonTimestamp(o: any): Date { if (o instanceof Date) { - return o; + return o } else if (typeof o === "string") { - return new Date(o); + return new Date(o) } else { - return fromTimestamp(Timestamp.fromJSON(o)); + return fromTimestamp(Timestamp.fromJSON(o)) } } function numberToLong(number: number) { - return Long.fromNumber(number); + return Long.fromNumber(number) } if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/epochs/genesis.ts b/packages/protojs/src/epochs/genesis.ts index 159efabf..49848073 100644 --- a/packages/protojs/src/epochs/genesis.ts +++ b/packages/protojs/src/epochs/genesis.ts @@ -1,79 +1,93 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { EpochInfo } from "./state"; +import Long from "long" +import { EpochInfo } from "./state" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "nibiru.epochs.v1beta1"; +export const protobufPackage = "nibiru.epochs.v1beta1" /** GenesisState defines the epochs module's genesis state. */ export interface GenesisState { - epochs: EpochInfo[]; + epochs: EpochInfo[] } function createBaseGenesisState(): GenesisState { - return { epochs: [] }; + return { epochs: [] } } export const GenesisState = { encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.epochs) { - EpochInfo.encode(v!, writer.uint32(10).fork()).ldelim(); + EpochInfo.encode(v!, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGenesisState(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseGenesisState() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.epochs.push(EpochInfo.decode(reader, reader.uint32())); - break; + message.epochs.push(EpochInfo.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): GenesisState { - return { epochs: Array.isArray(object?.epochs) ? object.epochs.map((e: any) => EpochInfo.fromJSON(e)) : [] }; + return { + epochs: Array.isArray(object?.epochs) + ? object.epochs.map((e: any) => EpochInfo.fromJSON(e)) + : [], + } }, toJSON(message: GenesisState): unknown { - const obj: any = {}; + const obj: any = {} if (message.epochs) { - obj.epochs = message.epochs.map((e) => e ? EpochInfo.toJSON(e) : undefined); + obj.epochs = message.epochs.map((e) => (e ? EpochInfo.toJSON(e) : undefined)) } else { - obj.epochs = []; + obj.epochs = [] } - return obj; + return obj }, fromPartial, I>>(object: I): GenesisState { - const message = createBaseGenesisState(); - message.epochs = object.epochs?.map((e) => EpochInfo.fromPartial(e)) || []; - return message; + const message = createBaseGenesisState() + message.epochs = object.epochs?.map((e) => EpochInfo.fromPartial(e)) || [] + return message }, -}; +} -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } diff --git a/packages/protojs/src/epochs/query.ts b/packages/protojs/src/epochs/query.ts index e026481c..e5af4bb8 100644 --- a/packages/protojs/src/epochs/query.ts +++ b/packages/protojs/src/epochs/query.ts @@ -1,260 +1,307 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { EpochInfo } from "./state"; +import Long from "long" +import { EpochInfo } from "./state" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "nibiru.epochs.v1beta1"; +export const protobufPackage = "nibiru.epochs.v1beta1" -export interface QueryEpochsInfoRequest { -} +export interface QueryEpochsInfoRequest {} export interface QueryEpochsInfoResponse { - epochs: EpochInfo[]; + epochs: EpochInfo[] } export interface QueryCurrentEpochRequest { - identifier: string; + identifier: string } export interface QueryCurrentEpochResponse { - currentEpoch: Long; + currentEpoch: Long } function createBaseQueryEpochsInfoRequest(): QueryEpochsInfoRequest { - return {}; + return {} } export const QueryEpochsInfoRequest = { - encode(_: QueryEpochsInfoRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; + encode( + _: QueryEpochsInfoRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryEpochsInfoRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryEpochsInfoRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryEpochsInfoRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(_: any): QueryEpochsInfoRequest { - return {}; + return {} }, toJSON(_: QueryEpochsInfoRequest): unknown { - const obj: any = {}; - return obj; + const obj: any = {} + return obj }, - fromPartial, I>>(_: I): QueryEpochsInfoRequest { - const message = createBaseQueryEpochsInfoRequest(); - return message; + fromPartial, I>>( + _: I, + ): QueryEpochsInfoRequest { + const message = createBaseQueryEpochsInfoRequest() + return message }, -}; +} function createBaseQueryEpochsInfoResponse(): QueryEpochsInfoResponse { - return { epochs: [] }; + return { epochs: [] } } export const QueryEpochsInfoResponse = { - encode(message: QueryEpochsInfoResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryEpochsInfoResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { for (const v of message.epochs) { - EpochInfo.encode(v!, writer.uint32(10).fork()).ldelim(); + EpochInfo.encode(v!, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryEpochsInfoResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryEpochsInfoResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryEpochsInfoResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.epochs.push(EpochInfo.decode(reader, reader.uint32())); - break; + message.epochs.push(EpochInfo.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryEpochsInfoResponse { - return { epochs: Array.isArray(object?.epochs) ? object.epochs.map((e: any) => EpochInfo.fromJSON(e)) : [] }; + return { + epochs: Array.isArray(object?.epochs) + ? object.epochs.map((e: any) => EpochInfo.fromJSON(e)) + : [], + } }, toJSON(message: QueryEpochsInfoResponse): unknown { - const obj: any = {}; + const obj: any = {} if (message.epochs) { - obj.epochs = message.epochs.map((e) => e ? EpochInfo.toJSON(e) : undefined); + obj.epochs = message.epochs.map((e) => (e ? EpochInfo.toJSON(e) : undefined)) } else { - obj.epochs = []; + obj.epochs = [] } - return obj; + return obj }, - fromPartial, I>>(object: I): QueryEpochsInfoResponse { - const message = createBaseQueryEpochsInfoResponse(); - message.epochs = object.epochs?.map((e) => EpochInfo.fromPartial(e)) || []; - return message; + fromPartial, I>>( + object: I, + ): QueryEpochsInfoResponse { + const message = createBaseQueryEpochsInfoResponse() + message.epochs = object.epochs?.map((e) => EpochInfo.fromPartial(e)) || [] + return message }, -}; +} function createBaseQueryCurrentEpochRequest(): QueryCurrentEpochRequest { - return { identifier: "" }; + return { identifier: "" } } export const QueryCurrentEpochRequest = { - encode(message: QueryCurrentEpochRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryCurrentEpochRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.identifier !== "") { - writer.uint32(10).string(message.identifier); + writer.uint32(10).string(message.identifier) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryCurrentEpochRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryCurrentEpochRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryCurrentEpochRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.identifier = reader.string(); - break; + message.identifier = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryCurrentEpochRequest { - return { identifier: isSet(object.identifier) ? String(object.identifier) : "" }; + return { + identifier: isSet(object.identifier) ? String(object.identifier) : "", + } }, toJSON(message: QueryCurrentEpochRequest): unknown { - const obj: any = {}; - message.identifier !== undefined && (obj.identifier = message.identifier); - return obj; + const obj: any = {} + message.identifier !== undefined && (obj.identifier = message.identifier) + return obj }, - fromPartial, I>>(object: I): QueryCurrentEpochRequest { - const message = createBaseQueryCurrentEpochRequest(); - message.identifier = object.identifier ?? ""; - return message; + fromPartial, I>>( + object: I, + ): QueryCurrentEpochRequest { + const message = createBaseQueryCurrentEpochRequest() + message.identifier = object.identifier ?? "" + return message }, -}; +} function createBaseQueryCurrentEpochResponse(): QueryCurrentEpochResponse { - return { currentEpoch: Long.UZERO }; + return { currentEpoch: Long.UZERO } } export const QueryCurrentEpochResponse = { - encode(message: QueryCurrentEpochResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryCurrentEpochResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (!message.currentEpoch.isZero()) { - writer.uint32(8).uint64(message.currentEpoch); + writer.uint32(8).uint64(message.currentEpoch) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryCurrentEpochResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryCurrentEpochResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryCurrentEpochResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.currentEpoch = reader.uint64() as Long; - break; + message.currentEpoch = reader.uint64() as Long + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryCurrentEpochResponse { - return { currentEpoch: isSet(object.currentEpoch) ? Long.fromValue(object.currentEpoch) : Long.UZERO }; + return { + currentEpoch: isSet(object.currentEpoch) + ? Long.fromValue(object.currentEpoch) + : Long.UZERO, + } }, toJSON(message: QueryCurrentEpochResponse): unknown { - const obj: any = {}; - message.currentEpoch !== undefined && (obj.currentEpoch = (message.currentEpoch || Long.UZERO).toString()); - return obj; + const obj: any = {} + message.currentEpoch !== undefined && + (obj.currentEpoch = (message.currentEpoch || Long.UZERO).toString()) + return obj }, - fromPartial, I>>(object: I): QueryCurrentEpochResponse { - const message = createBaseQueryCurrentEpochResponse(); - message.currentEpoch = (object.currentEpoch !== undefined && object.currentEpoch !== null) - ? Long.fromValue(object.currentEpoch) - : Long.UZERO; - return message; + fromPartial, I>>( + object: I, + ): QueryCurrentEpochResponse { + const message = createBaseQueryCurrentEpochResponse() + message.currentEpoch = + object.currentEpoch !== undefined && object.currentEpoch !== null + ? Long.fromValue(object.currentEpoch) + : Long.UZERO + return message }, -}; +} /** Query defines the gRPC querier service. */ export interface Query { /** EpochInfos provide running epochInfos */ - EpochInfos(request: QueryEpochsInfoRequest): Promise; + EpochInfos(request: QueryEpochsInfoRequest): Promise /** CurrentEpoch provide current epoch of specified identifier */ - CurrentEpoch(request: QueryCurrentEpochRequest): Promise; + CurrentEpoch(request: QueryCurrentEpochRequest): Promise } export class QueryClientImpl implements Query { - private readonly rpc: Rpc; + private readonly rpc: Rpc constructor(rpc: Rpc) { - this.rpc = rpc; - this.EpochInfos = this.EpochInfos.bind(this); - this.CurrentEpoch = this.CurrentEpoch.bind(this); + this.rpc = rpc + this.EpochInfos = this.EpochInfos.bind(this) + this.CurrentEpoch = this.CurrentEpoch.bind(this) } EpochInfos(request: QueryEpochsInfoRequest): Promise { - const data = QueryEpochsInfoRequest.encode(request).finish(); - const promise = this.rpc.request("nibiru.epochs.v1beta1.Query", "EpochInfos", data); - return promise.then((data) => QueryEpochsInfoResponse.decode(new _m0.Reader(data))); + const data = QueryEpochsInfoRequest.encode(request).finish() + const promise = this.rpc.request("nibiru.epochs.v1beta1.Query", "EpochInfos", data) + return promise.then((data) => QueryEpochsInfoResponse.decode(new _m0.Reader(data))) } CurrentEpoch(request: QueryCurrentEpochRequest): Promise { - const data = QueryCurrentEpochRequest.encode(request).finish(); - const promise = this.rpc.request("nibiru.epochs.v1beta1.Query", "CurrentEpoch", data); - return promise.then((data) => QueryCurrentEpochResponse.decode(new _m0.Reader(data))); + const data = QueryCurrentEpochRequest.encode(request).finish() + const promise = this.rpc.request( + "nibiru.epochs.v1beta1.Query", + "CurrentEpoch", + data, + ) + return promise.then((data) => + QueryCurrentEpochResponse.decode(new _m0.Reader(data)), + ) } } interface Rpc { - request(service: string, method: string, data: Uint8Array): Promise; + request(service: string, method: string, data: Uint8Array): Promise } -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/epochs/state.ts b/packages/protojs/src/epochs/state.ts index b5251e07..74f4dbba 100644 --- a/packages/protojs/src/epochs/state.ts +++ b/packages/protojs/src/epochs/state.ts @@ -1,26 +1,26 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { Duration } from "../google/protobuf/duration"; -import { Timestamp } from "../google/protobuf/timestamp"; +import { Duration } from "../google/protobuf/duration" +import { Timestamp } from "../google/protobuf/timestamp" +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "nibiru.epochs.v1beta1"; +export const protobufPackage = "nibiru.epochs.v1beta1" export interface EpochInfo { /** A string identifier for the epoch. e.g. "15min" or "1hour" */ - identifier: string; + identifier: string /** When the epoch repetitino should start. */ - startTime?: Date; + startTime?: Date /** How long each epoch lasts for. */ - duration?: Duration; + duration?: Duration /** The current epoch number, starting from 1. */ - currentEpoch: Long; + currentEpoch: Long /** The start timestamp of the current epoch. */ - currentEpochStartTime?: Date; + currentEpochStartTime?: Date /** Whether or not this epoch has started. Set to true if current blocktime >= start_time. */ - epochCountingStarted: boolean; + epochCountingStarted: boolean /** The block height at which the current epoch started at. */ - currentEpochStartHeight: Long; + currentEpochStartHeight: Long } function createBaseEpochInfo(): EpochInfo { @@ -32,164 +32,196 @@ function createBaseEpochInfo(): EpochInfo { currentEpochStartTime: undefined, epochCountingStarted: false, currentEpochStartHeight: Long.ZERO, - }; + } } export const EpochInfo = { encode(message: EpochInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.identifier !== "") { - writer.uint32(10).string(message.identifier); + writer.uint32(10).string(message.identifier) } if (message.startTime !== undefined) { - Timestamp.encode(toTimestamp(message.startTime), writer.uint32(18).fork()).ldelim(); + Timestamp.encode( + toTimestamp(message.startTime), + writer.uint32(18).fork(), + ).ldelim() } if (message.duration !== undefined) { - Duration.encode(message.duration, writer.uint32(26).fork()).ldelim(); + Duration.encode(message.duration, writer.uint32(26).fork()).ldelim() } if (!message.currentEpoch.isZero()) { - writer.uint32(32).uint64(message.currentEpoch); + writer.uint32(32).uint64(message.currentEpoch) } if (message.currentEpochStartTime !== undefined) { - Timestamp.encode(toTimestamp(message.currentEpochStartTime), writer.uint32(42).fork()).ldelim(); + Timestamp.encode( + toTimestamp(message.currentEpochStartTime), + writer.uint32(42).fork(), + ).ldelim() } if (message.epochCountingStarted === true) { - writer.uint32(48).bool(message.epochCountingStarted); + writer.uint32(48).bool(message.epochCountingStarted) } if (!message.currentEpochStartHeight.isZero()) { - writer.uint32(56).int64(message.currentEpochStartHeight); + writer.uint32(56).int64(message.currentEpochStartHeight) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): EpochInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseEpochInfo(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseEpochInfo() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.identifier = reader.string(); - break; + message.identifier = reader.string() + break case 2: - message.startTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); - break; + message.startTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())) + break case 3: - message.duration = Duration.decode(reader, reader.uint32()); - break; + message.duration = Duration.decode(reader, reader.uint32()) + break case 4: - message.currentEpoch = reader.uint64() as Long; - break; + message.currentEpoch = reader.uint64() as Long + break case 5: - message.currentEpochStartTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); - break; + message.currentEpochStartTime = fromTimestamp( + Timestamp.decode(reader, reader.uint32()), + ) + break case 6: - message.epochCountingStarted = reader.bool(); - break; + message.epochCountingStarted = reader.bool() + break case 7: - message.currentEpochStartHeight = reader.int64() as Long; - break; + message.currentEpochStartHeight = reader.int64() as Long + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): EpochInfo { return { identifier: isSet(object.identifier) ? String(object.identifier) : "", - startTime: isSet(object.startTime) ? fromJsonTimestamp(object.startTime) : undefined, + startTime: isSet(object.startTime) + ? fromJsonTimestamp(object.startTime) + : undefined, duration: isSet(object.duration) ? Duration.fromJSON(object.duration) : undefined, - currentEpoch: isSet(object.currentEpoch) ? Long.fromValue(object.currentEpoch) : Long.UZERO, + currentEpoch: isSet(object.currentEpoch) + ? Long.fromValue(object.currentEpoch) + : Long.UZERO, currentEpochStartTime: isSet(object.currentEpochStartTime) ? fromJsonTimestamp(object.currentEpochStartTime) : undefined, - epochCountingStarted: isSet(object.epochCountingStarted) ? Boolean(object.epochCountingStarted) : false, + epochCountingStarted: isSet(object.epochCountingStarted) + ? Boolean(object.epochCountingStarted) + : false, currentEpochStartHeight: isSet(object.currentEpochStartHeight) ? Long.fromValue(object.currentEpochStartHeight) : Long.ZERO, - }; + } }, toJSON(message: EpochInfo): unknown { - const obj: any = {}; - message.identifier !== undefined && (obj.identifier = message.identifier); - message.startTime !== undefined && (obj.startTime = message.startTime.toISOString()); - message.duration !== undefined && (obj.duration = message.duration ? Duration.toJSON(message.duration) : undefined); - message.currentEpoch !== undefined && (obj.currentEpoch = (message.currentEpoch || Long.UZERO).toString()); + const obj: any = {} + message.identifier !== undefined && (obj.identifier = message.identifier) + message.startTime !== undefined && (obj.startTime = message.startTime.toISOString()) + message.duration !== undefined && + (obj.duration = message.duration ? Duration.toJSON(message.duration) : undefined) + message.currentEpoch !== undefined && + (obj.currentEpoch = (message.currentEpoch || Long.UZERO).toString()) message.currentEpochStartTime !== undefined && - (obj.currentEpochStartTime = message.currentEpochStartTime.toISOString()); - message.epochCountingStarted !== undefined && (obj.epochCountingStarted = message.epochCountingStarted); + (obj.currentEpochStartTime = message.currentEpochStartTime.toISOString()) + message.epochCountingStarted !== undefined && + (obj.epochCountingStarted = message.epochCountingStarted) message.currentEpochStartHeight !== undefined && - (obj.currentEpochStartHeight = (message.currentEpochStartHeight || Long.ZERO).toString()); - return obj; + (obj.currentEpochStartHeight = ( + message.currentEpochStartHeight || Long.ZERO + ).toString()) + return obj }, fromPartial, I>>(object: I): EpochInfo { - const message = createBaseEpochInfo(); - message.identifier = object.identifier ?? ""; - message.startTime = object.startTime ?? undefined; - message.duration = (object.duration !== undefined && object.duration !== null) - ? Duration.fromPartial(object.duration) - : undefined; - message.currentEpoch = (object.currentEpoch !== undefined && object.currentEpoch !== null) - ? Long.fromValue(object.currentEpoch) - : Long.UZERO; - message.currentEpochStartTime = object.currentEpochStartTime ?? undefined; - message.epochCountingStarted = object.epochCountingStarted ?? false; + const message = createBaseEpochInfo() + message.identifier = object.identifier ?? "" + message.startTime = object.startTime ?? undefined + message.duration = + object.duration !== undefined && object.duration !== null + ? Duration.fromPartial(object.duration) + : undefined + message.currentEpoch = + object.currentEpoch !== undefined && object.currentEpoch !== null + ? Long.fromValue(object.currentEpoch) + : Long.UZERO + message.currentEpochStartTime = object.currentEpochStartTime ?? undefined + message.epochCountingStarted = object.epochCountingStarted ?? false message.currentEpochStartHeight = - (object.currentEpochStartHeight !== undefined && object.currentEpochStartHeight !== null) + object.currentEpochStartHeight !== undefined && + object.currentEpochStartHeight !== null ? Long.fromValue(object.currentEpochStartHeight) - : Long.ZERO; - return message; + : Long.ZERO + return message }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; +} -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > function toTimestamp(date: Date): Timestamp { - const seconds = numberToLong(date.getTime() / 1_000); - const nanos = (date.getTime() % 1_000) * 1_000_000; - return { seconds, nanos }; + const seconds = numberToLong(date.getTime() / 1_000) + const nanos = (date.getTime() % 1_000) * 1_000_000 + return { seconds, nanos } } function fromTimestamp(t: Timestamp): Date { - let millis = t.seconds.toNumber() * 1_000; - millis += t.nanos / 1_000_000; - return new Date(millis); + let millis = t.seconds.toNumber() * 1_000 + millis += t.nanos / 1_000_000 + return new Date(millis) } function fromJsonTimestamp(o: any): Date { if (o instanceof Date) { - return o; + return o } else if (typeof o === "string") { - return new Date(o); + return new Date(o) } else { - return fromTimestamp(Timestamp.fromJSON(o)); + return fromTimestamp(Timestamp.fromJSON(o)) } } function numberToLong(number: number) { - return Long.fromNumber(number); + return Long.fromNumber(number) } if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/gogoproto/gogo.ts b/packages/protojs/src/gogoproto/gogo.ts index ecf800e0..d297b2a6 100644 --- a/packages/protojs/src/gogoproto/gogo.ts +++ b/packages/protojs/src/gogoproto/gogo.ts @@ -1,3 +1,2 @@ /* eslint-disable */ - -export const protobufPackage = "gogoproto"; +export const protobufPackage = "gogoproto" diff --git a/packages/protojs/src/google/api/annotations.ts b/packages/protojs/src/google/api/annotations.ts index c2161053..2b96a2d5 100644 --- a/packages/protojs/src/google/api/annotations.ts +++ b/packages/protojs/src/google/api/annotations.ts @@ -1,3 +1,2 @@ /* eslint-disable */ - -export const protobufPackage = "google.api"; +export const protobufPackage = "google.api" diff --git a/packages/protojs/src/google/api/http.ts b/packages/protojs/src/google/api/http.ts index b070b6d9..6cf713d4 100644 --- a/packages/protojs/src/google/api/http.ts +++ b/packages/protojs/src/google/api/http.ts @@ -1,8 +1,8 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "google.api"; +export const protobufPackage = "google.api" /** * Defines the HTTP configuration for an API service. It contains a list of @@ -15,7 +15,7 @@ export interface Http { * * **NOTE:** All service configuration rules follow "last one wins" order. */ - rules: HttpRule[]; + rules: HttpRule[] /** * When set to true, URL path parmeters will be fully URI-decoded except in * cases of single segment matches in reserved expansion, where "%2F" will be @@ -24,7 +24,7 @@ export interface Http { * The default behavior is to not decode RFC 6570 reserved characters in multi * segment matches. */ - fullyDecodeReservedExpansion: boolean; + fullyDecodeReservedExpansion: boolean } /** @@ -40,6 +40,7 @@ export interface Http { * message, as in the example below which describes a REST GET * operation on a resource collection of messages: * + * * service Messaging { * rpc GetMessage(GetMessageRequest) returns (Message) { * option (google.api.http).get = "/v1/messages/{message_id}/{sub.subfield}"; @@ -79,6 +80,7 @@ export interface Http { * pattern automatically become (optional) HTTP query * parameters. Assume the following definition of the request message: * + * * service Messaging { * rpc GetMessage(GetMessageRequest) returns (Message) { * option (google.api.http).get = "/v1/messages/{message_id}"; @@ -93,6 +95,7 @@ export interface Http { * SubMessage sub = 3; // `sub.subfield` becomes a parameter * } * + * * This enables a HTTP JSON to RPC mapping as below: * * HTTP | RPC @@ -108,6 +111,7 @@ export interface Http { * specifies the mapping. Consider a REST update method on the * message resource collection: * + * * service Messaging { * rpc UpdateMessage(UpdateMessageRequest) returns (Message) { * option (google.api.http) = { @@ -121,6 +125,7 @@ export interface Http { * Message message = 2; // mapped to the body * } * + * * The following HTTP JSON to RPC mapping is enabled, where the * representation of the JSON in the request body is determined by * protos JSON encoding: @@ -147,6 +152,7 @@ export interface Http { * string text = 2; * } * + * * The following HTTP JSON to RPC mapping is enabled: * * HTTP | RPC @@ -177,6 +183,7 @@ export interface Http { * string user_id = 2; * } * + * * This enables the following two alternative HTTP JSON to RPC * mappings: * @@ -245,129 +252,119 @@ export interface HttpRule { * * Refer to [selector][google.api.DocumentationRule.selector] for syntax details. */ - selector: string; + selector: string /** Used for listing and getting information about resources. */ - get: - | string - | undefined; + get: string | undefined /** Used for updating a resource. */ - put: - | string - | undefined; + put: string | undefined /** Used for creating a resource. */ - post: - | string - | undefined; + post: string | undefined /** Used for deleting a resource. */ - delete: - | string - | undefined; + delete: string | undefined /** Used for updating a resource. */ - patch: - | string - | undefined; + patch: string | undefined /** * The custom pattern is used for specifying an HTTP method that is not * included in the `pattern` field, such as HEAD, or "*" to leave the * HTTP method unspecified for this rule. The wild-card rule is useful * for services that provide content to Web (HTML) clients. */ - custom?: - | CustomHttpPattern - | undefined; + custom?: CustomHttpPattern | undefined /** * The name of the request field whose value is mapped to the HTTP body, or * `*` for mapping all fields not captured by the path pattern to the HTTP * body. NOTE: the referred field must not be a repeated field and must be * present at the top-level of request message type. */ - body: string; + body: string /** * Optional. The name of the response field whose value is mapped to the HTTP * body of response. Other response fields are ignored. When * not set, the response message will be used as HTTP body of response. */ - responseBody: string; + responseBody: string /** * Additional HTTP bindings for the selector. Nested bindings must * not contain an `additional_bindings` field themselves (that is, * the nesting may only be one level deep). */ - additionalBindings: HttpRule[]; + additionalBindings: HttpRule[] } /** A custom pattern is used for defining custom HTTP verb. */ export interface CustomHttpPattern { /** The name of this custom HTTP verb. */ - kind: string; + kind: string /** The path matched by this custom verb. */ - path: string; + path: string } function createBaseHttp(): Http { - return { rules: [], fullyDecodeReservedExpansion: false }; + return { rules: [], fullyDecodeReservedExpansion: false } } export const Http = { encode(message: Http, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.rules) { - HttpRule.encode(v!, writer.uint32(10).fork()).ldelim(); + HttpRule.encode(v!, writer.uint32(10).fork()).ldelim() } if (message.fullyDecodeReservedExpansion === true) { - writer.uint32(16).bool(message.fullyDecodeReservedExpansion); + writer.uint32(16).bool(message.fullyDecodeReservedExpansion) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Http { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseHttp(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseHttp() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.rules.push(HttpRule.decode(reader, reader.uint32())); - break; + message.rules.push(HttpRule.decode(reader, reader.uint32())) + break case 2: - message.fullyDecodeReservedExpansion = reader.bool(); - break; + message.fullyDecodeReservedExpansion = reader.bool() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Http { return { - rules: Array.isArray(object?.rules) ? object.rules.map((e: any) => HttpRule.fromJSON(e)) : [], + rules: Array.isArray(object?.rules) + ? object.rules.map((e: any) => HttpRule.fromJSON(e)) + : [], fullyDecodeReservedExpansion: isSet(object.fullyDecodeReservedExpansion) ? Boolean(object.fullyDecodeReservedExpansion) : false, - }; + } }, toJSON(message: Http): unknown { - const obj: any = {}; + const obj: any = {} if (message.rules) { - obj.rules = message.rules.map((e) => e ? HttpRule.toJSON(e) : undefined); + obj.rules = message.rules.map((e) => (e ? HttpRule.toJSON(e) : undefined)) } else { - obj.rules = []; + obj.rules = [] } message.fullyDecodeReservedExpansion !== undefined && - (obj.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion); - return obj; + (obj.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion) + return obj }, fromPartial, I>>(object: I): Http { - const message = createBaseHttp(); - message.rules = object.rules?.map((e) => HttpRule.fromPartial(e)) || []; - message.fullyDecodeReservedExpansion = object.fullyDecodeReservedExpansion ?? false; - return message; + const message = createBaseHttp() + message.rules = object.rules?.map((e) => HttpRule.fromPartial(e)) || [] + message.fullyDecodeReservedExpansion = object.fullyDecodeReservedExpansion ?? false + return message }, -}; +} function createBaseHttpRule(): HttpRule { return { @@ -381,87 +378,87 @@ function createBaseHttpRule(): HttpRule { body: "", responseBody: "", additionalBindings: [], - }; + } } export const HttpRule = { encode(message: HttpRule, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.selector !== "") { - writer.uint32(10).string(message.selector); + writer.uint32(10).string(message.selector) } if (message.get !== undefined) { - writer.uint32(18).string(message.get); + writer.uint32(18).string(message.get) } if (message.put !== undefined) { - writer.uint32(26).string(message.put); + writer.uint32(26).string(message.put) } if (message.post !== undefined) { - writer.uint32(34).string(message.post); + writer.uint32(34).string(message.post) } if (message.delete !== undefined) { - writer.uint32(42).string(message.delete); + writer.uint32(42).string(message.delete) } if (message.patch !== undefined) { - writer.uint32(50).string(message.patch); + writer.uint32(50).string(message.patch) } if (message.custom !== undefined) { - CustomHttpPattern.encode(message.custom, writer.uint32(66).fork()).ldelim(); + CustomHttpPattern.encode(message.custom, writer.uint32(66).fork()).ldelim() } if (message.body !== "") { - writer.uint32(58).string(message.body); + writer.uint32(58).string(message.body) } if (message.responseBody !== "") { - writer.uint32(98).string(message.responseBody); + writer.uint32(98).string(message.responseBody) } for (const v of message.additionalBindings) { - HttpRule.encode(v!, writer.uint32(90).fork()).ldelim(); + HttpRule.encode(v!, writer.uint32(90).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): HttpRule { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseHttpRule(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseHttpRule() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.selector = reader.string(); - break; + message.selector = reader.string() + break case 2: - message.get = reader.string(); - break; + message.get = reader.string() + break case 3: - message.put = reader.string(); - break; + message.put = reader.string() + break case 4: - message.post = reader.string(); - break; + message.post = reader.string() + break case 5: - message.delete = reader.string(); - break; + message.delete = reader.string() + break case 6: - message.patch = reader.string(); - break; + message.patch = reader.string() + break case 8: - message.custom = CustomHttpPattern.decode(reader, reader.uint32()); - break; + message.custom = CustomHttpPattern.decode(reader, reader.uint32()) + break case 7: - message.body = reader.string(); - break; + message.body = reader.string() + break case 12: - message.responseBody = reader.string(); - break; + message.responseBody = reader.string() + break case 11: - message.additionalBindings.push(HttpRule.decode(reader, reader.uint32())); - break; + message.additionalBindings.push(HttpRule.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): HttpRule { @@ -472,125 +469,151 @@ export const HttpRule = { post: isSet(object.post) ? String(object.post) : undefined, delete: isSet(object.delete) ? String(object.delete) : undefined, patch: isSet(object.patch) ? String(object.patch) : undefined, - custom: isSet(object.custom) ? CustomHttpPattern.fromJSON(object.custom) : undefined, + custom: isSet(object.custom) + ? CustomHttpPattern.fromJSON(object.custom) + : undefined, body: isSet(object.body) ? String(object.body) : "", responseBody: isSet(object.responseBody) ? String(object.responseBody) : "", additionalBindings: Array.isArray(object?.additionalBindings) ? object.additionalBindings.map((e: any) => HttpRule.fromJSON(e)) : [], - }; + } }, toJSON(message: HttpRule): unknown { - const obj: any = {}; - message.selector !== undefined && (obj.selector = message.selector); - message.get !== undefined && (obj.get = message.get); - message.put !== undefined && (obj.put = message.put); - message.post !== undefined && (obj.post = message.post); - message.delete !== undefined && (obj.delete = message.delete); - message.patch !== undefined && (obj.patch = message.patch); + const obj: any = {} + message.selector !== undefined && (obj.selector = message.selector) + message.get !== undefined && (obj.get = message.get) + message.put !== undefined && (obj.put = message.put) + message.post !== undefined && (obj.post = message.post) + message.delete !== undefined && (obj.delete = message.delete) + message.patch !== undefined && (obj.patch = message.patch) message.custom !== undefined && - (obj.custom = message.custom ? CustomHttpPattern.toJSON(message.custom) : undefined); - message.body !== undefined && (obj.body = message.body); - message.responseBody !== undefined && (obj.responseBody = message.responseBody); + (obj.custom = message.custom + ? CustomHttpPattern.toJSON(message.custom) + : undefined) + message.body !== undefined && (obj.body = message.body) + message.responseBody !== undefined && (obj.responseBody = message.responseBody) if (message.additionalBindings) { - obj.additionalBindings = message.additionalBindings.map((e) => e ? HttpRule.toJSON(e) : undefined); + obj.additionalBindings = message.additionalBindings.map((e) => + e ? HttpRule.toJSON(e) : undefined, + ) } else { - obj.additionalBindings = []; + obj.additionalBindings = [] } - return obj; + return obj }, fromPartial, I>>(object: I): HttpRule { - const message = createBaseHttpRule(); - message.selector = object.selector ?? ""; - message.get = object.get ?? undefined; - message.put = object.put ?? undefined; - message.post = object.post ?? undefined; - message.delete = object.delete ?? undefined; - message.patch = object.patch ?? undefined; - message.custom = (object.custom !== undefined && object.custom !== null) - ? CustomHttpPattern.fromPartial(object.custom) - : undefined; - message.body = object.body ?? ""; - message.responseBody = object.responseBody ?? ""; - message.additionalBindings = object.additionalBindings?.map((e) => HttpRule.fromPartial(e)) || []; - return message; + const message = createBaseHttpRule() + message.selector = object.selector ?? "" + message.get = object.get ?? undefined + message.put = object.put ?? undefined + message.post = object.post ?? undefined + message.delete = object.delete ?? undefined + message.patch = object.patch ?? undefined + message.custom = + object.custom !== undefined && object.custom !== null + ? CustomHttpPattern.fromPartial(object.custom) + : undefined + message.body = object.body ?? "" + message.responseBody = object.responseBody ?? "" + message.additionalBindings = + object.additionalBindings?.map((e) => HttpRule.fromPartial(e)) || [] + return message }, -}; +} function createBaseCustomHttpPattern(): CustomHttpPattern { - return { kind: "", path: "" }; + return { kind: "", path: "" } } export const CustomHttpPattern = { - encode(message: CustomHttpPattern, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: CustomHttpPattern, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.kind !== "") { - writer.uint32(10).string(message.kind); + writer.uint32(10).string(message.kind) } if (message.path !== "") { - writer.uint32(18).string(message.path); + writer.uint32(18).string(message.path) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): CustomHttpPattern { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseCustomHttpPattern(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseCustomHttpPattern() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.kind = reader.string(); - break; + message.kind = reader.string() + break case 2: - message.path = reader.string(); - break; + message.path = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): CustomHttpPattern { - return { kind: isSet(object.kind) ? String(object.kind) : "", path: isSet(object.path) ? String(object.path) : "" }; + return { + kind: isSet(object.kind) ? String(object.kind) : "", + path: isSet(object.path) ? String(object.path) : "", + } }, toJSON(message: CustomHttpPattern): unknown { - const obj: any = {}; - message.kind !== undefined && (obj.kind = message.kind); - message.path !== undefined && (obj.path = message.path); - return obj; + const obj: any = {} + message.kind !== undefined && (obj.kind = message.kind) + message.path !== undefined && (obj.path = message.path) + return obj }, - fromPartial, I>>(object: I): CustomHttpPattern { - const message = createBaseCustomHttpPattern(); - message.kind = object.kind ?? ""; - message.path = object.path ?? ""; - return message; + fromPartial, I>>( + object: I, + ): CustomHttpPattern { + const message = createBaseCustomHttpPattern() + message.kind = object.kind ?? "" + message.path = object.path ?? "" + return message }, -}; +} -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/google/api/httpbody.ts b/packages/protojs/src/google/api/httpbody.ts index 09be9f24..dacb0a31 100644 --- a/packages/protojs/src/google/api/httpbody.ts +++ b/packages/protojs/src/google/api/httpbody.ts @@ -1,15 +1,16 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { Any } from "../protobuf/any"; +import Long from "long" +import { Any } from "../protobuf/any" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "google.api"; +export const protobufPackage = "google.api" /** * Message that represents an arbitrary HTTP body. It should only be used for * payload formats that can't be represented as JSON, such as raw binary or * an HTML page. * + * * This message can be used both in streaming and non-streaming API methods in * the request as well as the response. * @@ -47,149 +48,151 @@ export const protobufPackage = "google.api"; */ export interface HttpBody { /** The HTTP Content-Type header value specifying the content type of the body. */ - contentType: string; + contentType: string /** The HTTP request/response body as raw binary. */ - data: Uint8Array; + data: Uint8Array /** * Application specific response metadata. Must be set in the first response * for streaming APIs. */ - extensions: Any[]; + extensions: Any[] } function createBaseHttpBody(): HttpBody { - return { contentType: "", data: new Uint8Array(), extensions: [] }; + return { contentType: "", data: new Uint8Array(), extensions: [] } } export const HttpBody = { encode(message: HttpBody, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.contentType !== "") { - writer.uint32(10).string(message.contentType); + writer.uint32(10).string(message.contentType) } if (message.data.length !== 0) { - writer.uint32(18).bytes(message.data); + writer.uint32(18).bytes(message.data) } for (const v of message.extensions) { - Any.encode(v!, writer.uint32(26).fork()).ldelim(); + Any.encode(v!, writer.uint32(26).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): HttpBody { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseHttpBody(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseHttpBody() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.contentType = reader.string(); - break; + message.contentType = reader.string() + break case 2: - message.data = reader.bytes(); - break; + message.data = reader.bytes() + break case 3: - message.extensions.push(Any.decode(reader, reader.uint32())); - break; + message.extensions.push(Any.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): HttpBody { return { contentType: isSet(object.contentType) ? String(object.contentType) : "", data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(), - extensions: Array.isArray(object?.extensions) ? object.extensions.map((e: any) => Any.fromJSON(e)) : [], - }; + extensions: Array.isArray(object?.extensions) + ? object.extensions.map((e: any) => Any.fromJSON(e)) + : [], + } }, toJSON(message: HttpBody): unknown { - const obj: any = {}; - message.contentType !== undefined && (obj.contentType = message.contentType); + const obj: any = {} + message.contentType !== undefined && (obj.contentType = message.contentType) message.data !== undefined && - (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); + (obj.data = base64FromBytes( + message.data !== undefined ? message.data : new Uint8Array(), + )) if (message.extensions) { - obj.extensions = message.extensions.map((e) => e ? Any.toJSON(e) : undefined); + obj.extensions = message.extensions.map((e) => (e ? Any.toJSON(e) : undefined)) } else { - obj.extensions = []; + obj.extensions = [] } - return obj; + return obj }, fromPartial, I>>(object: I): HttpBody { - const message = createBaseHttpBody(); - message.contentType = object.contentType ?? ""; - message.data = object.data ?? new Uint8Array(); - message.extensions = object.extensions?.map((e) => Any.fromPartial(e)) || []; - return message; + const message = createBaseHttpBody() + message.contentType = object.contentType ?? "" + message.data = object.data ?? new Uint8Array() + message.extensions = object.extensions?.map((e) => Any.fromPartial(e)) || [] + return message }, -}; +} -declare var self: any | undefined; -declare var window: any | undefined; -declare var global: any | undefined; +declare var self: any | undefined +declare var window: any | undefined +declare var global: any | undefined var globalThis: any = (() => { - if (typeof globalThis !== "undefined") { - return globalThis; - } - if (typeof self !== "undefined") { - return self; - } - if (typeof window !== "undefined") { - return window; - } - if (typeof global !== "undefined") { - return global; - } - throw "Unable to locate global object"; -})(); - + if (typeof globalThis !== "undefined") return globalThis + if (typeof self !== "undefined") return self + if (typeof window !== "undefined") return window + if (typeof global !== "undefined") return global + throw "Unable to locate global object" +})() + +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")) function bytesFromBase64(b64: string): Uint8Array { - if (globalThis.Buffer) { - return Uint8Array.from(globalThis.Buffer.from(b64, "base64")); - } else { - const bin = globalThis.atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; + 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 } +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")) function base64FromBytes(arr: Uint8Array): string { - if (globalThis.Buffer) { - return globalThis.Buffer.from(arr).toString("base64"); - } else { - const bin: string[] = []; - arr.forEach((byte) => { - bin.push(String.fromCharCode(byte)); - }); - return globalThis.btoa(bin.join("")); - } + const bin: string[] = [] + arr.forEach((byte) => { + bin.push(String.fromCharCode(byte)) + }) + return btoa(bin.join("")) } -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/google/protobuf/any.ts b/packages/protojs/src/google/protobuf/any.ts index 4a8713a2..f982d82c 100644 --- a/packages/protojs/src/google/protobuf/any.ts +++ b/packages/protojs/src/google/protobuf/any.ts @@ -1,8 +1,8 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "google.protobuf"; +export const protobufPackage = "google.protobuf" /** * `Any` contains an arbitrary serialized protocol buffer message along with a @@ -56,6 +56,7 @@ export const protobufPackage = "google.protobuf"; * 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 @@ -114,131 +115,131 @@ export interface Any { * Schemes other than `http`, `https` (or the empty scheme) might be * used with implementation specific semantics. */ - typeUrl: string; + typeUrl: string /** Must be a valid serialized protocol buffer of the above specified type. */ - value: Uint8Array; + value: Uint8Array } function createBaseAny(): Any { - return { typeUrl: "", value: new Uint8Array() }; + return { typeUrl: "", value: new Uint8Array() } } export const Any = { encode(message: Any, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.typeUrl !== "") { - writer.uint32(10).string(message.typeUrl); + writer.uint32(10).string(message.typeUrl) } if (message.value.length !== 0) { - writer.uint32(18).bytes(message.value); + writer.uint32(18).bytes(message.value) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Any { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseAny(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseAny() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.typeUrl = reader.string(); - break; + message.typeUrl = reader.string() + break case 2: - message.value = reader.bytes(); - break; + message.value = reader.bytes() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Any { return { typeUrl: isSet(object.typeUrl) ? String(object.typeUrl) : "", value: isSet(object.value) ? bytesFromBase64(object.value) : new Uint8Array(), - }; + } }, toJSON(message: Any): unknown { - const obj: any = {}; - message.typeUrl !== undefined && (obj.typeUrl = message.typeUrl); + 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; + (obj.value = base64FromBytes( + message.value !== undefined ? message.value : new Uint8Array(), + )) + return obj }, fromPartial, I>>(object: I): Any { - const message = createBaseAny(); - message.typeUrl = object.typeUrl ?? ""; - message.value = object.value ?? new Uint8Array(); - return message; + const message = createBaseAny() + message.typeUrl = object.typeUrl ?? "" + message.value = object.value ?? new Uint8Array() + return message }, -}; +} -declare var self: any | undefined; -declare var window: any | undefined; -declare var global: any | undefined; +declare var self: any | undefined +declare var window: any | undefined +declare var global: any | undefined var globalThis: any = (() => { - if (typeof globalThis !== "undefined") { - return globalThis; - } - if (typeof self !== "undefined") { - return self; - } - if (typeof window !== "undefined") { - return window; - } - if (typeof global !== "undefined") { - return global; - } - throw "Unable to locate global object"; -})(); - + if (typeof globalThis !== "undefined") return globalThis + if (typeof self !== "undefined") return self + if (typeof window !== "undefined") return window + if (typeof global !== "undefined") return global + throw "Unable to locate global object" +})() + +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")) function bytesFromBase64(b64: string): Uint8Array { - if (globalThis.Buffer) { - return Uint8Array.from(globalThis.Buffer.from(b64, "base64")); - } else { - const bin = globalThis.atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; + 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 } +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")) function base64FromBytes(arr: Uint8Array): string { - if (globalThis.Buffer) { - return globalThis.Buffer.from(arr).toString("base64"); - } else { - const bin: string[] = []; - arr.forEach((byte) => { - bin.push(String.fromCharCode(byte)); - }); - return globalThis.btoa(bin.join("")); - } + const bin: string[] = [] + arr.forEach((byte) => { + bin.push(String.fromCharCode(byte)) + }) + return btoa(bin.join("")) } -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/google/protobuf/descriptor.ts b/packages/protojs/src/google/protobuf/descriptor.ts index c3a49214..08f3a2ff 100644 --- a/packages/protojs/src/google/protobuf/descriptor.ts +++ b/packages/protojs/src/google/protobuf/descriptor.ts @@ -1,74 +1,76 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "google.protobuf"; +export const protobufPackage = "google.protobuf" /** * The protocol compiler can output a FileDescriptorSet containing the .proto * files it parses. */ export interface FileDescriptorSet { - file: FileDescriptorProto[]; + file: FileDescriptorProto[] } /** Describes a complete .proto file. */ export interface FileDescriptorProto { /** file name, relative to root of source tree */ - name: string; + name: string /** e.g. "foo", "foo.bar", etc. */ - package: string; + package: string /** Names of files imported by this file. */ - dependency: string[]; + dependency: string[] /** Indexes of the public imported files in the dependency list above. */ - publicDependency: number[]; + publicDependency: number[] /** * Indexes of the weak imported files in the dependency list. * For Google-internal migration only. Do not use. */ - weakDependency: number[]; + weakDependency: number[] /** All top-level definitions in this file. */ - messageType: DescriptorProto[]; - enumType: EnumDescriptorProto[]; - service: ServiceDescriptorProto[]; - extension: FieldDescriptorProto[]; - options?: FileOptions; + 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; + sourceCodeInfo?: SourceCodeInfo /** * The syntax of the proto file. * The supported values are "proto2" and "proto3". */ - syntax: string; + 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[]; + 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[]; + reservedName: string[] } export interface DescriptorProto_ExtensionRange { - start: number; - end: number; - options?: ExtensionRangeOptions; + /** Inclusive. */ + start: number + /** Exclusive. */ + end: number + options?: ExtensionRangeOptions } /** @@ -78,26 +80,26 @@ export interface DescriptorProto_ExtensionRange { */ export interface DescriptorProto_ReservedRange { /** Inclusive. */ - start: number; + start: number /** Exclusive. */ - end: number; + end: number } export interface ExtensionRangeOptions { /** The parser stores options it doesn't recognize here. See above. */ - uninterpretedOption: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[] } /** Describes a field within a message. */ export interface FieldDescriptorProto { - name: string; - number: number; - label: FieldDescriptorProto_Label; + 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; + 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 @@ -105,33 +107,56 @@ export interface FieldDescriptorProto { * message are searched, then within the parent, on up to the root * namespace). */ - typeName: string; + 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; + 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; + 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; + 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; + 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 } export enum FieldDescriptorProto_Type { @@ -178,110 +203,114 @@ export enum FieldDescriptorProto_Type { UNRECOGNIZED = -1, } -export function fieldDescriptorProto_TypeFromJSON(object: any): FieldDescriptorProto_Type { +export function fieldDescriptorProto_TypeFromJSON( + object: any, +): FieldDescriptorProto_Type { switch (object) { case 1: case "TYPE_DOUBLE": - return FieldDescriptorProto_Type.TYPE_DOUBLE; + return FieldDescriptorProto_Type.TYPE_DOUBLE case 2: case "TYPE_FLOAT": - return FieldDescriptorProto_Type.TYPE_FLOAT; + return FieldDescriptorProto_Type.TYPE_FLOAT case 3: case "TYPE_INT64": - return FieldDescriptorProto_Type.TYPE_INT64; + return FieldDescriptorProto_Type.TYPE_INT64 case 4: case "TYPE_UINT64": - return FieldDescriptorProto_Type.TYPE_UINT64; + return FieldDescriptorProto_Type.TYPE_UINT64 case 5: case "TYPE_INT32": - return FieldDescriptorProto_Type.TYPE_INT32; + return FieldDescriptorProto_Type.TYPE_INT32 case 6: case "TYPE_FIXED64": - return FieldDescriptorProto_Type.TYPE_FIXED64; + return FieldDescriptorProto_Type.TYPE_FIXED64 case 7: case "TYPE_FIXED32": - return FieldDescriptorProto_Type.TYPE_FIXED32; + return FieldDescriptorProto_Type.TYPE_FIXED32 case 8: case "TYPE_BOOL": - return FieldDescriptorProto_Type.TYPE_BOOL; + return FieldDescriptorProto_Type.TYPE_BOOL case 9: case "TYPE_STRING": - return FieldDescriptorProto_Type.TYPE_STRING; + return FieldDescriptorProto_Type.TYPE_STRING case 10: case "TYPE_GROUP": - return FieldDescriptorProto_Type.TYPE_GROUP; + return FieldDescriptorProto_Type.TYPE_GROUP case 11: case "TYPE_MESSAGE": - return FieldDescriptorProto_Type.TYPE_MESSAGE; + return FieldDescriptorProto_Type.TYPE_MESSAGE case 12: case "TYPE_BYTES": - return FieldDescriptorProto_Type.TYPE_BYTES; + return FieldDescriptorProto_Type.TYPE_BYTES case 13: case "TYPE_UINT32": - return FieldDescriptorProto_Type.TYPE_UINT32; + return FieldDescriptorProto_Type.TYPE_UINT32 case 14: case "TYPE_ENUM": - return FieldDescriptorProto_Type.TYPE_ENUM; + return FieldDescriptorProto_Type.TYPE_ENUM case 15: case "TYPE_SFIXED32": - return FieldDescriptorProto_Type.TYPE_SFIXED32; + return FieldDescriptorProto_Type.TYPE_SFIXED32 case 16: case "TYPE_SFIXED64": - return FieldDescriptorProto_Type.TYPE_SFIXED64; + return FieldDescriptorProto_Type.TYPE_SFIXED64 case 17: case "TYPE_SINT32": - return FieldDescriptorProto_Type.TYPE_SINT32; + return FieldDescriptorProto_Type.TYPE_SINT32 case 18: case "TYPE_SINT64": - return FieldDescriptorProto_Type.TYPE_SINT64; + return FieldDescriptorProto_Type.TYPE_SINT64 case -1: case "UNRECOGNIZED": default: - return FieldDescriptorProto_Type.UNRECOGNIZED; + return FieldDescriptorProto_Type.UNRECOGNIZED } } -export function fieldDescriptorProto_TypeToJSON(object: FieldDescriptorProto_Type): string { +export function fieldDescriptorProto_TypeToJSON( + object: FieldDescriptorProto_Type, +): string { switch (object) { case FieldDescriptorProto_Type.TYPE_DOUBLE: - return "TYPE_DOUBLE"; + return "TYPE_DOUBLE" case FieldDescriptorProto_Type.TYPE_FLOAT: - return "TYPE_FLOAT"; + return "TYPE_FLOAT" case FieldDescriptorProto_Type.TYPE_INT64: - return "TYPE_INT64"; + return "TYPE_INT64" case FieldDescriptorProto_Type.TYPE_UINT64: - return "TYPE_UINT64"; + return "TYPE_UINT64" case FieldDescriptorProto_Type.TYPE_INT32: - return "TYPE_INT32"; + return "TYPE_INT32" case FieldDescriptorProto_Type.TYPE_FIXED64: - return "TYPE_FIXED64"; + return "TYPE_FIXED64" case FieldDescriptorProto_Type.TYPE_FIXED32: - return "TYPE_FIXED32"; + return "TYPE_FIXED32" case FieldDescriptorProto_Type.TYPE_BOOL: - return "TYPE_BOOL"; + return "TYPE_BOOL" case FieldDescriptorProto_Type.TYPE_STRING: - return "TYPE_STRING"; + return "TYPE_STRING" case FieldDescriptorProto_Type.TYPE_GROUP: - return "TYPE_GROUP"; + return "TYPE_GROUP" case FieldDescriptorProto_Type.TYPE_MESSAGE: - return "TYPE_MESSAGE"; + return "TYPE_MESSAGE" case FieldDescriptorProto_Type.TYPE_BYTES: - return "TYPE_BYTES"; + return "TYPE_BYTES" case FieldDescriptorProto_Type.TYPE_UINT32: - return "TYPE_UINT32"; + return "TYPE_UINT32" case FieldDescriptorProto_Type.TYPE_ENUM: - return "TYPE_ENUM"; + return "TYPE_ENUM" case FieldDescriptorProto_Type.TYPE_SFIXED32: - return "TYPE_SFIXED32"; + return "TYPE_SFIXED32" case FieldDescriptorProto_Type.TYPE_SFIXED64: - return "TYPE_SFIXED64"; + return "TYPE_SFIXED64" case FieldDescriptorProto_Type.TYPE_SINT32: - return "TYPE_SINT32"; + return "TYPE_SINT32" case FieldDescriptorProto_Type.TYPE_SINT64: - return "TYPE_SINT64"; + return "TYPE_SINT64" case FieldDescriptorProto_Type.UNRECOGNIZED: default: - return "UNRECOGNIZED"; + return "UNRECOGNIZED" } } @@ -293,60 +322,64 @@ export enum FieldDescriptorProto_Label { UNRECOGNIZED = -1, } -export function fieldDescriptorProto_LabelFromJSON(object: any): FieldDescriptorProto_Label { +export function fieldDescriptorProto_LabelFromJSON( + object: any, +): FieldDescriptorProto_Label { switch (object) { case 1: case "LABEL_OPTIONAL": - return FieldDescriptorProto_Label.LABEL_OPTIONAL; + return FieldDescriptorProto_Label.LABEL_OPTIONAL case 2: case "LABEL_REQUIRED": - return FieldDescriptorProto_Label.LABEL_REQUIRED; + return FieldDescriptorProto_Label.LABEL_REQUIRED case 3: case "LABEL_REPEATED": - return FieldDescriptorProto_Label.LABEL_REPEATED; + return FieldDescriptorProto_Label.LABEL_REPEATED case -1: case "UNRECOGNIZED": default: - return FieldDescriptorProto_Label.UNRECOGNIZED; + return FieldDescriptorProto_Label.UNRECOGNIZED } } -export function fieldDescriptorProto_LabelToJSON(object: FieldDescriptorProto_Label): string { +export function fieldDescriptorProto_LabelToJSON( + object: FieldDescriptorProto_Label, +): string { switch (object) { case FieldDescriptorProto_Label.LABEL_OPTIONAL: - return "LABEL_OPTIONAL"; + return "LABEL_OPTIONAL" case FieldDescriptorProto_Label.LABEL_REQUIRED: - return "LABEL_REQUIRED"; + return "LABEL_REQUIRED" case FieldDescriptorProto_Label.LABEL_REPEATED: - return "LABEL_REPEATED"; + return "LABEL_REPEATED" case FieldDescriptorProto_Label.UNRECOGNIZED: default: - return "UNRECOGNIZED"; + return "UNRECOGNIZED" } } /** Describes a oneof. */ export interface OneofDescriptorProto { - name: string; - options?: OneofOptions; + name: string + options?: OneofOptions } /** Describes an enum type. */ export interface EnumDescriptorProto { - name: string; - value: EnumValueDescriptorProto[]; - options?: EnumOptions; + 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[]; + reservedRange: EnumDescriptorProto_EnumReservedRange[] /** * Reserved enum value names, which may not be reused. A given name may only * be reserved once. */ - reservedName: string[]; + reservedName: string[] } /** @@ -359,39 +392,39 @@ export interface EnumDescriptorProto { */ export interface EnumDescriptorProto_EnumReservedRange { /** Inclusive. */ - start: number; + start: number /** Inclusive. */ - end: number; + end: number } /** Describes a value within an enum. */ export interface EnumValueDescriptorProto { - name: string; - number: number; - options?: EnumValueOptions; + name: string + number: number + options?: EnumValueOptions } /** Describes a service. */ export interface ServiceDescriptorProto { - name: string; - method: MethodDescriptorProto[]; - options?: ServiceOptions; + name: string + method: MethodDescriptorProto[] + options?: ServiceOptions } /** Describes a method of a service. */ export interface MethodDescriptorProto { - name: string; + 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; + inputType: string + outputType: string + options?: MethodOptions /** Identifies if client streams multiple client messages */ - clientStreaming: boolean; + clientStreaming: boolean /** Identifies if server streams multiple server messages */ - serverStreaming: boolean; + serverStreaming: boolean } export interface FileOptions { @@ -401,30 +434,30 @@ export interface FileOptions { * inappropriate because proto packages do not normally start with backwards * domain names. */ - javaPackage: string; + 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). + * Controls the name of the wrapper Java class generated for the .proto file. + * That class will always contain the .proto file's getDescriptor() method as + * well as any top-level extensions defined in the .proto file. + * If java_multiple_files is disabled, then all the other classes from the + * .proto file will be nested inside the single wrapper outer class. */ - javaOuterClassname: string; + javaOuterClassname: string /** - * If set true, then the Java code generator will generate a separate .java + * If enabled, 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 + * file. Thus, these types will *not* be nested inside the wrapper class + * named by java_outer_classname. However, the wrapper 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; + javaMultipleFiles: boolean /** * This option does nothing. * * @deprecated */ - javaGenerateEqualsAndHash: boolean; + 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 @@ -433,8 +466,8 @@ export interface FileOptions { * 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; + 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: @@ -442,7 +475,7 @@ export interface FileOptions { * - Otherwise, the package statement in the .proto file, if present. * - Otherwise, the basename of the .proto file, without extension. */ - goPackage: string; + 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 @@ -455,64 +488,64 @@ export interface FileOptions { * 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; + 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; + deprecated: boolean /** * Enables the use of arenas for the proto messages in this file. This applies * only to generated classes for C++. */ - ccEnableArenas: boolean; + 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; + objcClassPrefix: string /** Namespace for generated classes; defaults to the package. */ - csharpNamespace: string; + 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; + swiftPrefix: string /** * Sets the php class prefix which is prepended to all php generated classes * from this .proto. Default is empty. */ - phpClassPrefix: string; + 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; + 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. + * Default is empty. When this option is empty, the proto file name will be + * used for determining the namespace. */ - phpMetadataNamespace: string; + 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; + rubyPackage: string /** * The parser stores options it doesn't recognize here. * See the documentation for the "Options" section above. */ - uninterpretedOption: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[] } /** Generated classes can be optimized for speed or code size. */ @@ -526,35 +559,39 @@ export enum FileOptions_OptimizeMode { UNRECOGNIZED = -1, } -export function fileOptions_OptimizeModeFromJSON(object: any): FileOptions_OptimizeMode { +export function fileOptions_OptimizeModeFromJSON( + object: any, +): FileOptions_OptimizeMode { switch (object) { case 1: case "SPEED": - return FileOptions_OptimizeMode.SPEED; + return FileOptions_OptimizeMode.SPEED case 2: case "CODE_SIZE": - return FileOptions_OptimizeMode.CODE_SIZE; + return FileOptions_OptimizeMode.CODE_SIZE case 3: case "LITE_RUNTIME": - return FileOptions_OptimizeMode.LITE_RUNTIME; + return FileOptions_OptimizeMode.LITE_RUNTIME case -1: case "UNRECOGNIZED": default: - return FileOptions_OptimizeMode.UNRECOGNIZED; + return FileOptions_OptimizeMode.UNRECOGNIZED } } -export function fileOptions_OptimizeModeToJSON(object: FileOptions_OptimizeMode): string { +export function fileOptions_OptimizeModeToJSON( + object: FileOptions_OptimizeMode, +): string { switch (object) { case FileOptions_OptimizeMode.SPEED: - return "SPEED"; + return "SPEED" case FileOptions_OptimizeMode.CODE_SIZE: - return "CODE_SIZE"; + return "CODE_SIZE" case FileOptions_OptimizeMode.LITE_RUNTIME: - return "LITE_RUNTIME"; + return "LITE_RUNTIME" case FileOptions_OptimizeMode.UNRECOGNIZED: default: - return "UNRECOGNIZED"; + return "UNRECOGNIZED" } } @@ -579,20 +616,20 @@ export interface MessageOptions { * Because this is an option, the above two restrictions are not enforced by * the protocol compiler. */ - messageSetWireFormat: boolean; + 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; + 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; + deprecated: boolean /** * Whether the message is an automatically generated map entry type for the * maps field. @@ -609,16 +646,16 @@ export interface MessageOptions { * * 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 implementions still need to work as + * 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; + mapEntry: boolean /** The parser stores options it doesn't recognize here. See above. */ - uninterpretedOption: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[] } export interface FieldOptions { @@ -628,7 +665,7 @@ export interface FieldOptions { * 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; + 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 @@ -636,7 +673,7 @@ export interface FieldOptions { * a single length-delimited blob. In proto3, only explicit setting it to * false will avoid using packed encoding. */ - packed: boolean; + 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 @@ -650,7 +687,7 @@ export interface FieldOptions { * This option is an enum to permit additional types to be added, e.g. * goog.math.Integer. */ - jstype: FieldOptions_JSType; + 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 @@ -669,6 +706,7 @@ export interface FieldOptions { * 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. @@ -679,19 +717,31 @@ export interface FieldOptions { * implementation must either *always* check its required fields, or *never* * check its required fields, regardless of whether or not the message has * been parsed. + * + * As of 2021, lazy does no correctness checks on the byte stream during + * parsing. This may lead to crashes if and when an invalid byte stream is + * finally parsed upon access. + * + * TODO(b/211906113): Enable validation on lazy fields. + */ + lazy: boolean + /** + * unverified_lazy does no correctness checks on the byte stream. This should + * only be used where lazy with verification is prohibitive for performance + * reasons. */ - lazy: boolean; + unverifiedLazy: 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; + deprecated: boolean /** For Google-internal migration only. Do not use. */ - weak: boolean; + weak: boolean /** The parser stores options it doesn't recognize here. See above. */ - uninterpretedOption: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[] } export enum FieldOptions_CType { @@ -706,31 +756,31 @@ export function fieldOptions_CTypeFromJSON(object: any): FieldOptions_CType { switch (object) { case 0: case "STRING": - return FieldOptions_CType.STRING; + return FieldOptions_CType.STRING case 1: case "CORD": - return FieldOptions_CType.CORD; + return FieldOptions_CType.CORD case 2: case "STRING_PIECE": - return FieldOptions_CType.STRING_PIECE; + return FieldOptions_CType.STRING_PIECE case -1: case "UNRECOGNIZED": default: - return FieldOptions_CType.UNRECOGNIZED; + return FieldOptions_CType.UNRECOGNIZED } } export function fieldOptions_CTypeToJSON(object: FieldOptions_CType): string { switch (object) { case FieldOptions_CType.STRING: - return "STRING"; + return "STRING" case FieldOptions_CType.CORD: - return "CORD"; + return "CORD" case FieldOptions_CType.STRING_PIECE: - return "STRING_PIECE"; + return "STRING_PIECE" case FieldOptions_CType.UNRECOGNIZED: default: - return "UNRECOGNIZED"; + return "UNRECOGNIZED" } } @@ -748,37 +798,37 @@ export function fieldOptions_JSTypeFromJSON(object: any): FieldOptions_JSType { switch (object) { case 0: case "JS_NORMAL": - return FieldOptions_JSType.JS_NORMAL; + return FieldOptions_JSType.JS_NORMAL case 1: case "JS_STRING": - return FieldOptions_JSType.JS_STRING; + return FieldOptions_JSType.JS_STRING case 2: case "JS_NUMBER": - return FieldOptions_JSType.JS_NUMBER; + return FieldOptions_JSType.JS_NUMBER case -1: case "UNRECOGNIZED": default: - return FieldOptions_JSType.UNRECOGNIZED; + return FieldOptions_JSType.UNRECOGNIZED } } export function fieldOptions_JSTypeToJSON(object: FieldOptions_JSType): string { switch (object) { case FieldOptions_JSType.JS_NORMAL: - return "JS_NORMAL"; + return "JS_NORMAL" case FieldOptions_JSType.JS_STRING: - return "JS_STRING"; + return "JS_STRING" case FieldOptions_JSType.JS_NUMBER: - return "JS_NUMBER"; + return "JS_NUMBER" case FieldOptions_JSType.UNRECOGNIZED: default: - return "UNRECOGNIZED"; + return "UNRECOGNIZED" } } export interface OneofOptions { /** The parser stores options it doesn't recognize here. See above. */ - uninterpretedOption: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[] } export interface EnumOptions { @@ -786,16 +836,16 @@ export interface EnumOptions { * Set this option to true to allow mapping different tag names to the same * value. */ - allowAlias: boolean; + 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; + deprecated: boolean /** The parser stores options it doesn't recognize here. See above. */ - uninterpretedOption: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[] } export interface EnumValueOptions { @@ -805,9 +855,9 @@ export interface EnumValueOptions { * for the enum value, or it will be completely ignored; in the very least, * this is a formalization for deprecating enum values. */ - deprecated: boolean; + deprecated: boolean /** The parser stores options it doesn't recognize here. See above. */ - uninterpretedOption: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[] } export interface ServiceOptions { @@ -817,9 +867,9 @@ export interface ServiceOptions { * for the service, or it will be completely ignored; in the very least, * this is a formalization for deprecating services. */ - deprecated: boolean; + deprecated: boolean /** The parser stores options it doesn't recognize here. See above. */ - uninterpretedOption: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[] } export interface MethodOptions { @@ -829,10 +879,10 @@ export interface MethodOptions { * 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; + deprecated: boolean + idempotencyLevel: MethodOptions_IdempotencyLevel /** The parser stores options it doesn't recognize here. See above. */ - uninterpretedOption: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[] } /** @@ -849,35 +899,39 @@ export enum MethodOptions_IdempotencyLevel { UNRECOGNIZED = -1, } -export function methodOptions_IdempotencyLevelFromJSON(object: any): MethodOptions_IdempotencyLevel { +export function methodOptions_IdempotencyLevelFromJSON( + object: any, +): MethodOptions_IdempotencyLevel { switch (object) { case 0: case "IDEMPOTENCY_UNKNOWN": - return MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN; + return MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN case 1: case "NO_SIDE_EFFECTS": - return MethodOptions_IdempotencyLevel.NO_SIDE_EFFECTS; + return MethodOptions_IdempotencyLevel.NO_SIDE_EFFECTS case 2: case "IDEMPOTENT": - return MethodOptions_IdempotencyLevel.IDEMPOTENT; + return MethodOptions_IdempotencyLevel.IDEMPOTENT case -1: case "UNRECOGNIZED": default: - return MethodOptions_IdempotencyLevel.UNRECOGNIZED; + return MethodOptions_IdempotencyLevel.UNRECOGNIZED } } -export function methodOptions_IdempotencyLevelToJSON(object: MethodOptions_IdempotencyLevel): string { +export function methodOptions_IdempotencyLevelToJSON( + object: MethodOptions_IdempotencyLevel, +): string { switch (object) { case MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN: - return "IDEMPOTENCY_UNKNOWN"; + return "IDEMPOTENCY_UNKNOWN" case MethodOptions_IdempotencyLevel.NO_SIDE_EFFECTS: - return "NO_SIDE_EFFECTS"; + return "NO_SIDE_EFFECTS" case MethodOptions_IdempotencyLevel.IDEMPOTENT: - return "IDEMPOTENT"; + return "IDEMPOTENT" case MethodOptions_IdempotencyLevel.UNRECOGNIZED: default: - return "UNRECOGNIZED"; + return "UNRECOGNIZED" } } @@ -890,29 +944,29 @@ export function methodOptions_IdempotencyLevelToJSON(object: MethodOptions_Idemp * in them. */ export interface UninterpretedOption { - name: UninterpretedOption_NamePart[]; + 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; + 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". + * E.g.,{ ["foo", false], ["bar.baz", true], ["moo", false] } represents + * "foo.(bar.baz).moo". */ export interface UninterpretedOption_NamePart { - namePart: string; - isExtension: boolean; + namePart: string + isExtension: boolean } /** @@ -958,14 +1012,14 @@ export interface SourceCodeInfo { * 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 descendent. For example, a "group" defines + * 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[]; + location: SourceCodeInfo_Location[] } export interface SourceCodeInfo_Location { @@ -974,8 +1028,8 @@ export interface SourceCodeInfo_Location { * 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: + * the root FileDescriptorProto to the place where the definition occurs. + * For example, this path: * [ 4, 3, 2, 7, 1 ] * refers to: * file.message_type(3) // 4, 3 @@ -994,7 +1048,7 @@ export interface SourceCodeInfo_Location { * this path refers to the whole field declaration (from the beginning * of the label to the terminating semicolon). */ - path: number[]; + path: number[] /** * Always has exactly three or four elements: start line, start column, * end line (optional, otherwise assumed same as start line), end column. @@ -1002,7 +1056,7 @@ export interface SourceCodeInfo_Location { * and column numbers are zero-based -- typically you will want to add * 1 to each before displaying to a user. */ - span: number[]; + span: number[] /** * If this SourceCodeInfo represents a complete declaration, these are any * comments appearing before and after the declaration which appear to be @@ -1031,13 +1085,13 @@ export interface SourceCodeInfo_Location { * // Comment attached to baz. * // Another line attached to baz. * - * // Comment attached to qux. + * // Comment attached to moo. * // - * // Another line attached to qux. - * optional double qux = 4; + * // Another line attached to moo. + * optional double moo = 4; * * // Detached comment for corge. This is not leading or trailing comments - * // to qux or corge because there are blank lines separating it from + * // to moo or corge because there are blank lines separating it from * // both. * * // Detached comment for corge paragraph 2. @@ -1052,9 +1106,9 @@ export interface SourceCodeInfo_Location { * * // ignored detached comments. */ - leadingComments: string; - trailingComments: string; - leadingDetachedComments: string[]; + leadingComments: string + trailingComments: string + leadingDetachedComments: string[] } /** @@ -1067,7 +1121,7 @@ export interface GeneratedCodeInfo { * An Annotation connects some span of text in generated code to an element * of its generating .proto file. */ - annotation: GeneratedCodeInfo_Annotation[]; + annotation: GeneratedCodeInfo_Annotation[] } export interface GeneratedCodeInfo_Annotation { @@ -1075,72 +1129,83 @@ 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[]; + path: number[] /** Identifies the filesystem path to the original source .proto. */ - sourceFile: string; + sourceFile: string /** * Identifies the starting offset in bytes in the generated code * that relates to the identified object. */ - begin: number; + 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; + end: number } function createBaseFileDescriptorSet(): FileDescriptorSet { - return { file: [] }; + return { file: [] } } export const FileDescriptorSet = { - encode(message: FileDescriptorSet, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: FileDescriptorSet, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { for (const v of message.file) { - FileDescriptorProto.encode(v!, writer.uint32(10).fork()).ldelim(); + FileDescriptorProto.encode(v!, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): FileDescriptorSet { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseFileDescriptorSet(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseFileDescriptorSet() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.file.push(FileDescriptorProto.decode(reader, reader.uint32())); - break; + message.file.push(FileDescriptorProto.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): FileDescriptorSet { - return { file: Array.isArray(object?.file) ? object.file.map((e: any) => FileDescriptorProto.fromJSON(e)) : [] }; + return { + file: Array.isArray(object?.file) + ? object.file.map((e: any) => FileDescriptorProto.fromJSON(e)) + : [], + } }, toJSON(message: FileDescriptorSet): unknown { - const obj: any = {}; + const obj: any = {} if (message.file) { - obj.file = message.file.map((e) => e ? FileDescriptorProto.toJSON(e) : undefined); + obj.file = message.file.map((e) => + e ? FileDescriptorProto.toJSON(e) : undefined, + ) } else { - obj.file = []; + obj.file = [] } - return obj; + return obj }, - fromPartial, I>>(object: I): FileDescriptorSet { - const message = createBaseFileDescriptorSet(); - message.file = object.file?.map((e) => FileDescriptorProto.fromPartial(e)) || []; - return message; + fromPartial, I>>( + object: I, + ): FileDescriptorSet { + const message = createBaseFileDescriptorSet() + message.file = object.file?.map((e) => FileDescriptorProto.fromPartial(e)) || [] + return message }, -}; +} function createBaseFileDescriptorProto(): FileDescriptorProto { return { @@ -1156,209 +1221,241 @@ function createBaseFileDescriptorProto(): FileDescriptorProto { options: undefined, sourceCodeInfo: undefined, syntax: "", - }; + } } export const FileDescriptorProto = { - encode(message: FileDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: FileDescriptorProto, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.name !== "") { - writer.uint32(10).string(message.name); + writer.uint32(10).string(message.name) } if (message.package !== "") { - writer.uint32(18).string(message.package); + writer.uint32(18).string(message.package) } for (const v of message.dependency) { - writer.uint32(26).string(v!); + writer.uint32(26).string(v!) } - writer.uint32(82).fork(); + writer.uint32(82).fork() for (const v of message.publicDependency) { - writer.int32(v); + writer.int32(v) } - writer.ldelim(); - writer.uint32(90).fork(); + writer.ldelim() + writer.uint32(90).fork() for (const v of message.weakDependency) { - writer.int32(v); + writer.int32(v) } - writer.ldelim(); + writer.ldelim() for (const v of message.messageType) { - DescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); + DescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim() } for (const v of message.enumType) { - EnumDescriptorProto.encode(v!, writer.uint32(42).fork()).ldelim(); + EnumDescriptorProto.encode(v!, writer.uint32(42).fork()).ldelim() } for (const v of message.service) { - ServiceDescriptorProto.encode(v!, writer.uint32(50).fork()).ldelim(); + ServiceDescriptorProto.encode(v!, writer.uint32(50).fork()).ldelim() } for (const v of message.extension) { - FieldDescriptorProto.encode(v!, writer.uint32(58).fork()).ldelim(); + FieldDescriptorProto.encode(v!, writer.uint32(58).fork()).ldelim() } if (message.options !== undefined) { - FileOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); + FileOptions.encode(message.options, writer.uint32(66).fork()).ldelim() } if (message.sourceCodeInfo !== undefined) { - SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(74).fork()).ldelim(); + SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(74).fork()).ldelim() } if (message.syntax !== "") { - writer.uint32(98).string(message.syntax); + writer.uint32(98).string(message.syntax) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): FileDescriptorProto { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseFileDescriptorProto(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseFileDescriptorProto() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.name = reader.string(); - break; + message.name = reader.string() + break case 2: - message.package = reader.string(); - break; + message.package = reader.string() + break case 3: - message.dependency.push(reader.string()); - break; + message.dependency.push(reader.string()) + break case 10: if ((tag & 7) === 2) { - const end2 = reader.uint32() + reader.pos; + const end2 = reader.uint32() + reader.pos while (reader.pos < end2) { - message.publicDependency.push(reader.int32()); + message.publicDependency.push(reader.int32()) } } else { - message.publicDependency.push(reader.int32()); + message.publicDependency.push(reader.int32()) } - break; + break case 11: if ((tag & 7) === 2) { - const end2 = reader.uint32() + reader.pos; + const end2 = reader.uint32() + reader.pos while (reader.pos < end2) { - message.weakDependency.push(reader.int32()); + message.weakDependency.push(reader.int32()) } } else { - message.weakDependency.push(reader.int32()); + message.weakDependency.push(reader.int32()) } - break; + break case 4: - message.messageType.push(DescriptorProto.decode(reader, reader.uint32())); - break; + message.messageType.push(DescriptorProto.decode(reader, reader.uint32())) + break case 5: - message.enumType.push(EnumDescriptorProto.decode(reader, reader.uint32())); - break; + message.enumType.push(EnumDescriptorProto.decode(reader, reader.uint32())) + break case 6: - message.service.push(ServiceDescriptorProto.decode(reader, reader.uint32())); - break; + message.service.push(ServiceDescriptorProto.decode(reader, reader.uint32())) + break case 7: - message.extension.push(FieldDescriptorProto.decode(reader, reader.uint32())); - break; + message.extension.push(FieldDescriptorProto.decode(reader, reader.uint32())) + break case 8: - message.options = FileOptions.decode(reader, reader.uint32()); - break; + message.options = FileOptions.decode(reader, reader.uint32()) + break case 9: - message.sourceCodeInfo = SourceCodeInfo.decode(reader, reader.uint32()); - break; + message.sourceCodeInfo = SourceCodeInfo.decode(reader, reader.uint32()) + break case 12: - message.syntax = reader.string(); - break; + message.syntax = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): FileDescriptorProto { return { name: isSet(object.name) ? String(object.name) : "", package: isSet(object.package) ? String(object.package) : "", - dependency: Array.isArray(object?.dependency) ? object.dependency.map((e: any) => String(e)) : [], + dependency: Array.isArray(object?.dependency) + ? object.dependency.map((e: any) => String(e)) + : [], publicDependency: Array.isArray(object?.publicDependency) ? object.publicDependency.map((e: any) => Number(e)) : [], - weakDependency: Array.isArray(object?.weakDependency) ? object.weakDependency.map((e: any) => Number(e)) : [], + weakDependency: Array.isArray(object?.weakDependency) + ? object.weakDependency.map((e: any) => Number(e)) + : [], messageType: Array.isArray(object?.messageType) ? object.messageType.map((e: any) => DescriptorProto.fromJSON(e)) : [], - enumType: Array.isArray(object?.enumType) ? object.enumType.map((e: any) => EnumDescriptorProto.fromJSON(e)) : [], - service: Array.isArray(object?.service) ? object.service.map((e: any) => ServiceDescriptorProto.fromJSON(e)) : [], + enumType: Array.isArray(object?.enumType) + ? object.enumType.map((e: any) => EnumDescriptorProto.fromJSON(e)) + : [], + service: Array.isArray(object?.service) + ? object.service.map((e: any) => ServiceDescriptorProto.fromJSON(e)) + : [], extension: Array.isArray(object?.extension) ? object.extension.map((e: any) => FieldDescriptorProto.fromJSON(e)) : [], options: isSet(object.options) ? FileOptions.fromJSON(object.options) : undefined, - sourceCodeInfo: isSet(object.sourceCodeInfo) ? SourceCodeInfo.fromJSON(object.sourceCodeInfo) : undefined, + sourceCodeInfo: isSet(object.sourceCodeInfo) + ? SourceCodeInfo.fromJSON(object.sourceCodeInfo) + : undefined, syntax: isSet(object.syntax) ? String(object.syntax) : "", - }; + } }, toJSON(message: FileDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.package !== undefined && (obj.package = message.package); + 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); + obj.dependency = message.dependency.map((e) => e) } else { - obj.dependency = []; + obj.dependency = [] } if (message.publicDependency) { - obj.publicDependency = message.publicDependency.map((e) => Math.round(e)); + obj.publicDependency = message.publicDependency.map((e) => Math.round(e)) } else { - obj.publicDependency = []; + obj.publicDependency = [] } if (message.weakDependency) { - obj.weakDependency = message.weakDependency.map((e) => Math.round(e)); + obj.weakDependency = message.weakDependency.map((e) => Math.round(e)) } else { - obj.weakDependency = []; + obj.weakDependency = [] } if (message.messageType) { - obj.messageType = message.messageType.map((e) => e ? DescriptorProto.toJSON(e) : undefined); + obj.messageType = message.messageType.map((e) => + e ? DescriptorProto.toJSON(e) : undefined, + ) } else { - obj.messageType = []; + obj.messageType = [] } if (message.enumType) { - obj.enumType = message.enumType.map((e) => e ? EnumDescriptorProto.toJSON(e) : undefined); + obj.enumType = message.enumType.map((e) => + e ? EnumDescriptorProto.toJSON(e) : undefined, + ) } else { - obj.enumType = []; + obj.enumType = [] } if (message.service) { - obj.service = message.service.map((e) => e ? ServiceDescriptorProto.toJSON(e) : undefined); + obj.service = message.service.map((e) => + e ? ServiceDescriptorProto.toJSON(e) : undefined, + ) } else { - obj.service = []; + obj.service = [] } if (message.extension) { - obj.extension = message.extension.map((e) => e ? FieldDescriptorProto.toJSON(e) : undefined); + obj.extension = message.extension.map((e) => + e ? FieldDescriptorProto.toJSON(e) : undefined, + ) } else { - obj.extension = []; + obj.extension = [] } - message.options !== undefined && (obj.options = message.options ? FileOptions.toJSON(message.options) : undefined); + 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; - }, - - fromPartial, I>>(object: I): FileDescriptorProto { - const message = createBaseFileDescriptorProto(); - message.name = object.name ?? ""; - message.package = object.package ?? ""; - message.dependency = object.dependency?.map((e) => e) || []; - message.publicDependency = object.publicDependency?.map((e) => e) || []; - message.weakDependency = object.weakDependency?.map((e) => e) || []; - message.messageType = object.messageType?.map((e) => DescriptorProto.fromPartial(e)) || []; - message.enumType = object.enumType?.map((e) => EnumDescriptorProto.fromPartial(e)) || []; - message.service = object.service?.map((e) => ServiceDescriptorProto.fromPartial(e)) || []; - message.extension = object.extension?.map((e) => FieldDescriptorProto.fromPartial(e)) || []; - message.options = (object.options !== undefined && object.options !== null) - ? FileOptions.fromPartial(object.options) - : undefined; - message.sourceCodeInfo = (object.sourceCodeInfo !== undefined && object.sourceCodeInfo !== null) - ? SourceCodeInfo.fromPartial(object.sourceCodeInfo) - : undefined; - message.syntax = object.syntax ?? ""; - return message; - }, -}; + (obj.sourceCodeInfo = message.sourceCodeInfo + ? SourceCodeInfo.toJSON(message.sourceCodeInfo) + : undefined) + message.syntax !== undefined && (obj.syntax = message.syntax) + return obj + }, + + fromPartial, I>>( + object: I, + ): FileDescriptorProto { + const message = createBaseFileDescriptorProto() + message.name = object.name ?? "" + message.package = object.package ?? "" + message.dependency = object.dependency?.map((e) => e) || [] + message.publicDependency = object.publicDependency?.map((e) => e) || [] + message.weakDependency = object.weakDependency?.map((e) => e) || [] + message.messageType = + object.messageType?.map((e) => DescriptorProto.fromPartial(e)) || [] + message.enumType = + object.enumType?.map((e) => EnumDescriptorProto.fromPartial(e)) || [] + message.service = + object.service?.map((e) => ServiceDescriptorProto.fromPartial(e)) || [] + message.extension = + object.extension?.map((e) => FieldDescriptorProto.fromPartial(e)) || [] + message.options = + object.options !== undefined && object.options !== null + ? FileOptions.fromPartial(object.options) + : undefined + message.sourceCodeInfo = + object.sourceCodeInfo !== undefined && object.sourceCodeInfo !== null + ? SourceCodeInfo.fromPartial(object.sourceCodeInfo) + : undefined + message.syntax = object.syntax ?? "" + return message + }, +} function createBaseDescriptorProto(): DescriptorProto { return { @@ -1372,337 +1469,409 @@ function createBaseDescriptorProto(): DescriptorProto { options: undefined, reservedRange: [], reservedName: [], - }; + } } export const DescriptorProto = { - encode(message: DescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: DescriptorProto, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.name !== "") { - writer.uint32(10).string(message.name); + writer.uint32(10).string(message.name) } for (const v of message.field) { - FieldDescriptorProto.encode(v!, writer.uint32(18).fork()).ldelim(); + FieldDescriptorProto.encode(v!, writer.uint32(18).fork()).ldelim() } for (const v of message.extension) { - FieldDescriptorProto.encode(v!, writer.uint32(50).fork()).ldelim(); + FieldDescriptorProto.encode(v!, writer.uint32(50).fork()).ldelim() } for (const v of message.nestedType) { - DescriptorProto.encode(v!, writer.uint32(26).fork()).ldelim(); + DescriptorProto.encode(v!, writer.uint32(26).fork()).ldelim() } for (const v of message.enumType) { - EnumDescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); + EnumDescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim() } for (const v of message.extensionRange) { - DescriptorProto_ExtensionRange.encode(v!, writer.uint32(42).fork()).ldelim(); + DescriptorProto_ExtensionRange.encode(v!, writer.uint32(42).fork()).ldelim() } for (const v of message.oneofDecl) { - OneofDescriptorProto.encode(v!, writer.uint32(66).fork()).ldelim(); + OneofDescriptorProto.encode(v!, writer.uint32(66).fork()).ldelim() } if (message.options !== undefined) { - MessageOptions.encode(message.options, writer.uint32(58).fork()).ldelim(); + MessageOptions.encode(message.options, writer.uint32(58).fork()).ldelim() } for (const v of message.reservedRange) { - DescriptorProto_ReservedRange.encode(v!, writer.uint32(74).fork()).ldelim(); + DescriptorProto_ReservedRange.encode(v!, writer.uint32(74).fork()).ldelim() } for (const v of message.reservedName) { - writer.uint32(82).string(v!); + writer.uint32(82).string(v!) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): DescriptorProto { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDescriptorProto(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseDescriptorProto() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.name = reader.string(); - break; + message.name = reader.string() + break case 2: - message.field.push(FieldDescriptorProto.decode(reader, reader.uint32())); - break; + message.field.push(FieldDescriptorProto.decode(reader, reader.uint32())) + break case 6: - message.extension.push(FieldDescriptorProto.decode(reader, reader.uint32())); - break; + message.extension.push(FieldDescriptorProto.decode(reader, reader.uint32())) + break case 3: - message.nestedType.push(DescriptorProto.decode(reader, reader.uint32())); - break; + message.nestedType.push(DescriptorProto.decode(reader, reader.uint32())) + break case 4: - message.enumType.push(EnumDescriptorProto.decode(reader, reader.uint32())); - break; + message.enumType.push(EnumDescriptorProto.decode(reader, reader.uint32())) + break case 5: - message.extensionRange.push(DescriptorProto_ExtensionRange.decode(reader, reader.uint32())); - break; + message.extensionRange.push( + DescriptorProto_ExtensionRange.decode(reader, reader.uint32()), + ) + break case 8: - message.oneofDecl.push(OneofDescriptorProto.decode(reader, reader.uint32())); - break; + message.oneofDecl.push(OneofDescriptorProto.decode(reader, reader.uint32())) + break case 7: - message.options = MessageOptions.decode(reader, reader.uint32()); - break; + message.options = MessageOptions.decode(reader, reader.uint32()) + break case 9: - message.reservedRange.push(DescriptorProto_ReservedRange.decode(reader, reader.uint32())); - break; + message.reservedRange.push( + DescriptorProto_ReservedRange.decode(reader, reader.uint32()), + ) + break case 10: - message.reservedName.push(reader.string()); - break; + message.reservedName.push(reader.string()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): DescriptorProto { return { name: isSet(object.name) ? String(object.name) : "", - field: Array.isArray(object?.field) ? object.field.map((e: any) => FieldDescriptorProto.fromJSON(e)) : [], + field: Array.isArray(object?.field) + ? object.field.map((e: any) => FieldDescriptorProto.fromJSON(e)) + : [], extension: Array.isArray(object?.extension) ? object.extension.map((e: any) => FieldDescriptorProto.fromJSON(e)) : [], nestedType: Array.isArray(object?.nestedType) ? object.nestedType.map((e: any) => DescriptorProto.fromJSON(e)) : [], - enumType: Array.isArray(object?.enumType) ? object.enumType.map((e: any) => EnumDescriptorProto.fromJSON(e)) : [], + enumType: Array.isArray(object?.enumType) + ? object.enumType.map((e: any) => EnumDescriptorProto.fromJSON(e)) + : [], extensionRange: Array.isArray(object?.extensionRange) - ? object.extensionRange.map((e: any) => DescriptorProto_ExtensionRange.fromJSON(e)) + ? object.extensionRange.map((e: any) => + DescriptorProto_ExtensionRange.fromJSON(e), + ) : [], oneofDecl: Array.isArray(object?.oneofDecl) ? object.oneofDecl.map((e: any) => OneofDescriptorProto.fromJSON(e)) : [], - options: isSet(object.options) ? MessageOptions.fromJSON(object.options) : undefined, + options: isSet(object.options) + ? MessageOptions.fromJSON(object.options) + : undefined, reservedRange: Array.isArray(object?.reservedRange) - ? object.reservedRange.map((e: any) => DescriptorProto_ReservedRange.fromJSON(e)) + ? object.reservedRange.map((e: any) => + DescriptorProto_ReservedRange.fromJSON(e), + ) + : [], + reservedName: Array.isArray(object?.reservedName) + ? object.reservedName.map((e: any) => String(e)) : [], - reservedName: Array.isArray(object?.reservedName) ? object.reservedName.map((e: any) => String(e)) : [], - }; + } }, toJSON(message: DescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); + const obj: any = {} + message.name !== undefined && (obj.name = message.name) if (message.field) { - obj.field = message.field.map((e) => e ? FieldDescriptorProto.toJSON(e) : undefined); + obj.field = message.field.map((e) => + e ? FieldDescriptorProto.toJSON(e) : undefined, + ) } else { - obj.field = []; + obj.field = [] } if (message.extension) { - obj.extension = message.extension.map((e) => e ? FieldDescriptorProto.toJSON(e) : undefined); + obj.extension = message.extension.map((e) => + e ? FieldDescriptorProto.toJSON(e) : undefined, + ) } else { - obj.extension = []; + obj.extension = [] } if (message.nestedType) { - obj.nestedType = message.nestedType.map((e) => e ? DescriptorProto.toJSON(e) : undefined); + obj.nestedType = message.nestedType.map((e) => + e ? DescriptorProto.toJSON(e) : undefined, + ) } else { - obj.nestedType = []; + obj.nestedType = [] } if (message.enumType) { - obj.enumType = message.enumType.map((e) => e ? EnumDescriptorProto.toJSON(e) : undefined); + obj.enumType = message.enumType.map((e) => + e ? EnumDescriptorProto.toJSON(e) : undefined, + ) } else { - obj.enumType = []; + obj.enumType = [] } if (message.extensionRange) { - obj.extensionRange = message.extensionRange.map((e) => e ? DescriptorProto_ExtensionRange.toJSON(e) : undefined); + obj.extensionRange = message.extensionRange.map((e) => + e ? DescriptorProto_ExtensionRange.toJSON(e) : undefined, + ) } else { - obj.extensionRange = []; + obj.extensionRange = [] } if (message.oneofDecl) { - obj.oneofDecl = message.oneofDecl.map((e) => e ? OneofDescriptorProto.toJSON(e) : undefined); + obj.oneofDecl = message.oneofDecl.map((e) => + e ? OneofDescriptorProto.toJSON(e) : undefined, + ) } else { - obj.oneofDecl = []; + obj.oneofDecl = [] } message.options !== undefined && - (obj.options = message.options ? MessageOptions.toJSON(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); + obj.reservedRange = message.reservedRange.map((e) => + e ? DescriptorProto_ReservedRange.toJSON(e) : undefined, + ) } else { - obj.reservedRange = []; + obj.reservedRange = [] } if (message.reservedName) { - obj.reservedName = message.reservedName.map((e) => e); + obj.reservedName = message.reservedName.map((e) => e) } else { - obj.reservedName = []; + obj.reservedName = [] } - return obj; + return obj }, - fromPartial, I>>(object: I): DescriptorProto { - const message = createBaseDescriptorProto(); - message.name = object.name ?? ""; - message.field = object.field?.map((e) => FieldDescriptorProto.fromPartial(e)) || []; - message.extension = object.extension?.map((e) => FieldDescriptorProto.fromPartial(e)) || []; - message.nestedType = object.nestedType?.map((e) => DescriptorProto.fromPartial(e)) || []; - message.enumType = object.enumType?.map((e) => EnumDescriptorProto.fromPartial(e)) || []; - message.extensionRange = object.extensionRange?.map((e) => DescriptorProto_ExtensionRange.fromPartial(e)) || []; - message.oneofDecl = object.oneofDecl?.map((e) => OneofDescriptorProto.fromPartial(e)) || []; - message.options = (object.options !== undefined && object.options !== null) - ? MessageOptions.fromPartial(object.options) - : undefined; - message.reservedRange = object.reservedRange?.map((e) => DescriptorProto_ReservedRange.fromPartial(e)) || []; - message.reservedName = object.reservedName?.map((e) => e) || []; - return message; + fromPartial, I>>( + object: I, + ): DescriptorProto { + const message = createBaseDescriptorProto() + message.name = object.name ?? "" + message.field = object.field?.map((e) => FieldDescriptorProto.fromPartial(e)) || [] + message.extension = + object.extension?.map((e) => FieldDescriptorProto.fromPartial(e)) || [] + message.nestedType = + object.nestedType?.map((e) => DescriptorProto.fromPartial(e)) || [] + message.enumType = + object.enumType?.map((e) => EnumDescriptorProto.fromPartial(e)) || [] + message.extensionRange = + object.extensionRange?.map((e) => + DescriptorProto_ExtensionRange.fromPartial(e), + ) || [] + message.oneofDecl = + object.oneofDecl?.map((e) => OneofDescriptorProto.fromPartial(e)) || [] + message.options = + object.options !== undefined && object.options !== null + ? MessageOptions.fromPartial(object.options) + : undefined + message.reservedRange = + object.reservedRange?.map((e) => DescriptorProto_ReservedRange.fromPartial(e)) || + [] + message.reservedName = object.reservedName?.map((e) => e) || [] + return message }, -}; +} function createBaseDescriptorProto_ExtensionRange(): DescriptorProto_ExtensionRange { - return { start: 0, end: 0, options: undefined }; + return { start: 0, end: 0, options: undefined } } export const DescriptorProto_ExtensionRange = { - encode(message: DescriptorProto_ExtensionRange, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: DescriptorProto_ExtensionRange, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.start !== 0) { - writer.uint32(8).int32(message.start); + writer.uint32(8).int32(message.start) } if (message.end !== 0) { - writer.uint32(16).int32(message.end); + writer.uint32(16).int32(message.end) } if (message.options !== undefined) { - ExtensionRangeOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); + ExtensionRangeOptions.encode(message.options, writer.uint32(26).fork()).ldelim() } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): DescriptorProto_ExtensionRange { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDescriptorProto_ExtensionRange(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): DescriptorProto_ExtensionRange { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseDescriptorProto_ExtensionRange() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.start = reader.int32(); - break; + message.start = reader.int32() + break case 2: - message.end = reader.int32(); - break; + message.end = reader.int32() + break case 3: - message.options = ExtensionRangeOptions.decode(reader, reader.uint32()); - break; + message.options = ExtensionRangeOptions.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): DescriptorProto_ExtensionRange { return { start: isSet(object.start) ? Number(object.start) : 0, end: isSet(object.end) ? Number(object.end) : 0, - options: isSet(object.options) ? ExtensionRangeOptions.fromJSON(object.options) : undefined, - }; + options: isSet(object.options) + ? ExtensionRangeOptions.fromJSON(object.options) + : undefined, + } }, toJSON(message: DescriptorProto_ExtensionRange): unknown { - const obj: any = {}; - message.start !== undefined && (obj.start = Math.round(message.start)); - message.end !== undefined && (obj.end = Math.round(message.end)); + const obj: any = {} + message.start !== undefined && (obj.start = Math.round(message.start)) + message.end !== undefined && (obj.end = Math.round(message.end)) message.options !== undefined && - (obj.options = message.options ? ExtensionRangeOptions.toJSON(message.options) : undefined); - return obj; + (obj.options = message.options + ? ExtensionRangeOptions.toJSON(message.options) + : undefined) + return obj }, fromPartial, I>>( object: I, ): DescriptorProto_ExtensionRange { - const message = createBaseDescriptorProto_ExtensionRange(); - message.start = object.start ?? 0; - message.end = object.end ?? 0; - message.options = (object.options !== undefined && object.options !== null) - ? ExtensionRangeOptions.fromPartial(object.options) - : undefined; - return message; + const message = createBaseDescriptorProto_ExtensionRange() + message.start = object.start ?? 0 + message.end = object.end ?? 0 + message.options = + object.options !== undefined && object.options !== null + ? ExtensionRangeOptions.fromPartial(object.options) + : undefined + return message }, -}; +} function createBaseDescriptorProto_ReservedRange(): DescriptorProto_ReservedRange { - return { start: 0, end: 0 }; + return { start: 0, end: 0 } } export const DescriptorProto_ReservedRange = { - encode(message: DescriptorProto_ReservedRange, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: DescriptorProto_ReservedRange, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.start !== 0) { - writer.uint32(8).int32(message.start); + writer.uint32(8).int32(message.start) } if (message.end !== 0) { - writer.uint32(16).int32(message.end); + writer.uint32(16).int32(message.end) } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): DescriptorProto_ReservedRange { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDescriptorProto_ReservedRange(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): DescriptorProto_ReservedRange { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseDescriptorProto_ReservedRange() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.start = reader.int32(); - break; + message.start = reader.int32() + break case 2: - message.end = reader.int32(); - break; + message.end = reader.int32() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): DescriptorProto_ReservedRange { - return { start: isSet(object.start) ? Number(object.start) : 0, end: isSet(object.end) ? Number(object.end) : 0 }; + return { + start: isSet(object.start) ? Number(object.start) : 0, + end: isSet(object.end) ? Number(object.end) : 0, + } }, toJSON(message: DescriptorProto_ReservedRange): unknown { - const obj: any = {}; - message.start !== undefined && (obj.start = Math.round(message.start)); - message.end !== undefined && (obj.end = Math.round(message.end)); - return obj; + const obj: any = {} + message.start !== undefined && (obj.start = Math.round(message.start)) + message.end !== undefined && (obj.end = Math.round(message.end)) + return obj }, fromPartial, I>>( object: I, ): DescriptorProto_ReservedRange { - const message = createBaseDescriptorProto_ReservedRange(); - message.start = object.start ?? 0; - message.end = object.end ?? 0; - return message; + const message = createBaseDescriptorProto_ReservedRange() + message.start = object.start ?? 0 + message.end = object.end ?? 0 + return message }, -}; +} function createBaseExtensionRangeOptions(): ExtensionRangeOptions { - return { uninterpretedOption: [] }; + return { uninterpretedOption: [] } } export const ExtensionRangeOptions = { - encode(message: ExtensionRangeOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: ExtensionRangeOptions, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { for (const v of message.uninterpretedOption) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): ExtensionRangeOptions { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseExtensionRangeOptions(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseExtensionRangeOptions() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 999: - message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); - break; + message.uninterpretedOption.push( + UninterpretedOption.decode(reader, reader.uint32()), + ) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): ExtensionRangeOptions { @@ -1710,25 +1879,30 @@ export const ExtensionRangeOptions = { uninterpretedOption: Array.isArray(object?.uninterpretedOption) ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) : [], - }; + } }, toJSON(message: ExtensionRangeOptions): unknown { - const obj: any = {}; + const obj: any = {} if (message.uninterpretedOption) { - obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); + obj.uninterpretedOption = message.uninterpretedOption.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined, + ) } else { - obj.uninterpretedOption = []; + obj.uninterpretedOption = [] } - return obj; + return obj }, - fromPartial, I>>(object: I): ExtensionRangeOptions { - const message = createBaseExtensionRangeOptions(); - message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; - return message; + fromPartial, I>>( + object: I, + ): ExtensionRangeOptions { + const message = createBaseExtensionRangeOptions() + message.uninterpretedOption = + object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || [] + return message }, -}; +} function createBaseFieldDescriptorProto(): FieldDescriptorProto { return { @@ -1742,87 +1916,97 @@ function createBaseFieldDescriptorProto(): FieldDescriptorProto { oneofIndex: 0, jsonName: "", options: undefined, - }; + proto3Optional: false, + } } export const FieldDescriptorProto = { - encode(message: FieldDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: FieldDescriptorProto, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.name !== "") { - writer.uint32(10).string(message.name); + writer.uint32(10).string(message.name) } if (message.number !== 0) { - writer.uint32(24).int32(message.number); + writer.uint32(24).int32(message.number) } if (message.label !== 1) { - writer.uint32(32).int32(message.label); + writer.uint32(32).int32(message.label) } if (message.type !== 1) { - writer.uint32(40).int32(message.type); + writer.uint32(40).int32(message.type) } if (message.typeName !== "") { - writer.uint32(50).string(message.typeName); + writer.uint32(50).string(message.typeName) } if (message.extendee !== "") { - writer.uint32(18).string(message.extendee); + writer.uint32(18).string(message.extendee) } if (message.defaultValue !== "") { - writer.uint32(58).string(message.defaultValue); + writer.uint32(58).string(message.defaultValue) } if (message.oneofIndex !== 0) { - writer.uint32(72).int32(message.oneofIndex); + writer.uint32(72).int32(message.oneofIndex) } if (message.jsonName !== "") { - writer.uint32(82).string(message.jsonName); + writer.uint32(82).string(message.jsonName) } if (message.options !== undefined) { - FieldOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); + FieldOptions.encode(message.options, writer.uint32(66).fork()).ldelim() + } + if (message.proto3Optional === true) { + writer.uint32(136).bool(message.proto3Optional) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): FieldDescriptorProto { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseFieldDescriptorProto(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseFieldDescriptorProto() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.name = reader.string(); - break; + message.name = reader.string() + break case 3: - message.number = reader.int32(); - break; + message.number = reader.int32() + break case 4: - message.label = reader.int32() as any; - break; + message.label = reader.int32() as any + break case 5: - message.type = reader.int32() as any; - break; + message.type = reader.int32() as any + break case 6: - message.typeName = reader.string(); - break; + message.typeName = reader.string() + break case 2: - message.extendee = reader.string(); - break; + message.extendee = reader.string() + break case 7: - message.defaultValue = reader.string(); - break; + message.defaultValue = reader.string() + break case 9: - message.oneofIndex = reader.int32(); - break; + message.oneofIndex = reader.int32() + break case 10: - message.jsonName = reader.string(); - break; + message.jsonName = reader.string() + break case 8: - message.options = FieldOptions.decode(reader, reader.uint32()); - break; + message.options = FieldOptions.decode(reader, reader.uint32()) + break + case 17: + message.proto3Optional = reader.bool() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): FieldDescriptorProto { @@ -1836,407 +2020,494 @@ export const FieldDescriptorProto = { defaultValue: isSet(object.defaultValue) ? String(object.defaultValue) : "", oneofIndex: isSet(object.oneofIndex) ? Number(object.oneofIndex) : 0, jsonName: isSet(object.jsonName) ? String(object.jsonName) : "", - options: isSet(object.options) ? FieldOptions.fromJSON(object.options) : undefined, - }; + options: isSet(object.options) + ? FieldOptions.fromJSON(object.options) + : undefined, + proto3Optional: isSet(object.proto3Optional) + ? Boolean(object.proto3Optional) + : false, + } }, toJSON(message: FieldDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.number !== undefined && (obj.number = Math.round(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 = Math.round(message.oneofIndex)); - message.jsonName !== undefined && (obj.jsonName = message.jsonName); - message.options !== undefined && (obj.options = message.options ? FieldOptions.toJSON(message.options) : undefined); - return obj; - }, - - fromPartial, I>>(object: I): FieldDescriptorProto { - const message = createBaseFieldDescriptorProto(); - message.name = object.name ?? ""; - message.number = object.number ?? 0; - message.label = object.label ?? 1; - message.type = object.type ?? 1; - message.typeName = object.typeName ?? ""; - message.extendee = object.extendee ?? ""; - message.defaultValue = object.defaultValue ?? ""; - message.oneofIndex = object.oneofIndex ?? 0; - message.jsonName = object.jsonName ?? ""; - message.options = (object.options !== undefined && object.options !== null) - ? FieldOptions.fromPartial(object.options) - : undefined; - return message; - }, -}; + const obj: any = {} + message.name !== undefined && (obj.name = message.name) + message.number !== undefined && (obj.number = Math.round(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 = Math.round(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 + }, + + fromPartial, I>>( + object: I, + ): FieldDescriptorProto { + const message = createBaseFieldDescriptorProto() + message.name = object.name ?? "" + message.number = object.number ?? 0 + message.label = object.label ?? 1 + message.type = object.type ?? 1 + message.typeName = object.typeName ?? "" + message.extendee = object.extendee ?? "" + message.defaultValue = object.defaultValue ?? "" + message.oneofIndex = object.oneofIndex ?? 0 + message.jsonName = object.jsonName ?? "" + message.options = + object.options !== undefined && object.options !== null + ? FieldOptions.fromPartial(object.options) + : undefined + message.proto3Optional = object.proto3Optional ?? false + return message + }, +} function createBaseOneofDescriptorProto(): OneofDescriptorProto { - return { name: "", options: undefined }; + return { name: "", options: undefined } } export const OneofDescriptorProto = { - encode(message: OneofDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: OneofDescriptorProto, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.name !== "") { - writer.uint32(10).string(message.name); + writer.uint32(10).string(message.name) } if (message.options !== undefined) { - OneofOptions.encode(message.options, writer.uint32(18).fork()).ldelim(); + OneofOptions.encode(message.options, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): OneofDescriptorProto { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseOneofDescriptorProto(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseOneofDescriptorProto() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.name = reader.string(); - break; + message.name = reader.string() + break case 2: - message.options = OneofOptions.decode(reader, reader.uint32()); - break; + message.options = OneofOptions.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): OneofDescriptorProto { return { name: isSet(object.name) ? String(object.name) : "", - options: isSet(object.options) ? OneofOptions.fromJSON(object.options) : undefined, - }; + options: isSet(object.options) + ? OneofOptions.fromJSON(object.options) + : undefined, + } }, 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; + const obj: any = {} + message.name !== undefined && (obj.name = message.name) + message.options !== undefined && + (obj.options = message.options ? OneofOptions.toJSON(message.options) : undefined) + return obj }, - fromPartial, I>>(object: I): OneofDescriptorProto { - const message = createBaseOneofDescriptorProto(); - message.name = object.name ?? ""; - message.options = (object.options !== undefined && object.options !== null) - ? OneofOptions.fromPartial(object.options) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): OneofDescriptorProto { + const message = createBaseOneofDescriptorProto() + message.name = object.name ?? "" + message.options = + object.options !== undefined && object.options !== null + ? OneofOptions.fromPartial(object.options) + : undefined + return message }, -}; +} function createBaseEnumDescriptorProto(): EnumDescriptorProto { - return { name: "", value: [], options: undefined, reservedRange: [], reservedName: [] }; + return { + name: "", + value: [], + options: undefined, + reservedRange: [], + reservedName: [], + } } export const EnumDescriptorProto = { - encode(message: EnumDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: EnumDescriptorProto, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.name !== "") { - writer.uint32(10).string(message.name); + writer.uint32(10).string(message.name) } for (const v of message.value) { - EnumValueDescriptorProto.encode(v!, writer.uint32(18).fork()).ldelim(); + EnumValueDescriptorProto.encode(v!, writer.uint32(18).fork()).ldelim() } if (message.options !== undefined) { - EnumOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); + EnumOptions.encode(message.options, writer.uint32(26).fork()).ldelim() } for (const v of message.reservedRange) { - EnumDescriptorProto_EnumReservedRange.encode(v!, writer.uint32(34).fork()).ldelim(); + EnumDescriptorProto_EnumReservedRange.encode( + v!, + writer.uint32(34).fork(), + ).ldelim() } for (const v of message.reservedName) { - writer.uint32(42).string(v!); + writer.uint32(42).string(v!) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): EnumDescriptorProto { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseEnumDescriptorProto(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseEnumDescriptorProto() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.name = reader.string(); - break; + message.name = reader.string() + break case 2: - message.value.push(EnumValueDescriptorProto.decode(reader, reader.uint32())); - break; + message.value.push(EnumValueDescriptorProto.decode(reader, reader.uint32())) + break case 3: - message.options = EnumOptions.decode(reader, reader.uint32()); - break; + message.options = EnumOptions.decode(reader, reader.uint32()) + break case 4: - message.reservedRange.push(EnumDescriptorProto_EnumReservedRange.decode(reader, reader.uint32())); - break; + message.reservedRange.push( + EnumDescriptorProto_EnumReservedRange.decode(reader, reader.uint32()), + ) + break case 5: - message.reservedName.push(reader.string()); - break; + message.reservedName.push(reader.string()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): EnumDescriptorProto { return { name: isSet(object.name) ? String(object.name) : "", - value: Array.isArray(object?.value) ? object.value.map((e: any) => EnumValueDescriptorProto.fromJSON(e)) : [], + value: Array.isArray(object?.value) + ? object.value.map((e: any) => EnumValueDescriptorProto.fromJSON(e)) + : [], options: isSet(object.options) ? EnumOptions.fromJSON(object.options) : undefined, reservedRange: Array.isArray(object?.reservedRange) - ? object.reservedRange.map((e: any) => EnumDescriptorProto_EnumReservedRange.fromJSON(e)) + ? object.reservedRange.map((e: any) => + EnumDescriptorProto_EnumReservedRange.fromJSON(e), + ) + : [], + reservedName: Array.isArray(object?.reservedName) + ? object.reservedName.map((e: any) => String(e)) : [], - reservedName: Array.isArray(object?.reservedName) ? object.reservedName.map((e: any) => String(e)) : [], - }; + } }, toJSON(message: EnumDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); + const obj: any = {} + message.name !== undefined && (obj.name = message.name) if (message.value) { - obj.value = message.value.map((e) => e ? EnumValueDescriptorProto.toJSON(e) : undefined); + obj.value = message.value.map((e) => + e ? EnumValueDescriptorProto.toJSON(e) : undefined, + ) } else { - obj.value = []; + obj.value = [] } - message.options !== undefined && (obj.options = message.options ? EnumOptions.toJSON(message.options) : undefined); + 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 - ); + e ? EnumDescriptorProto_EnumReservedRange.toJSON(e) : undefined, + ) } else { - obj.reservedRange = []; + obj.reservedRange = [] } if (message.reservedName) { - obj.reservedName = message.reservedName.map((e) => e); + obj.reservedName = message.reservedName.map((e) => e) } else { - obj.reservedName = []; + obj.reservedName = [] } - return obj; + return obj }, - fromPartial, I>>(object: I): EnumDescriptorProto { - const message = createBaseEnumDescriptorProto(); - message.name = object.name ?? ""; - message.value = object.value?.map((e) => EnumValueDescriptorProto.fromPartial(e)) || []; - message.options = (object.options !== undefined && object.options !== null) - ? EnumOptions.fromPartial(object.options) - : undefined; - message.reservedRange = object.reservedRange?.map((e) => EnumDescriptorProto_EnumReservedRange.fromPartial(e)) || - []; - message.reservedName = object.reservedName?.map((e) => e) || []; - return message; + fromPartial, I>>( + object: I, + ): EnumDescriptorProto { + const message = createBaseEnumDescriptorProto() + message.name = object.name ?? "" + message.value = + object.value?.map((e) => EnumValueDescriptorProto.fromPartial(e)) || [] + message.options = + object.options !== undefined && object.options !== null + ? EnumOptions.fromPartial(object.options) + : undefined + message.reservedRange = + object.reservedRange?.map((e) => + EnumDescriptorProto_EnumReservedRange.fromPartial(e), + ) || [] + message.reservedName = object.reservedName?.map((e) => e) || [] + return message }, -}; +} function createBaseEnumDescriptorProto_EnumReservedRange(): EnumDescriptorProto_EnumReservedRange { - return { start: 0, end: 0 }; + return { start: 0, end: 0 } } export const EnumDescriptorProto_EnumReservedRange = { - encode(message: EnumDescriptorProto_EnumReservedRange, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: EnumDescriptorProto_EnumReservedRange, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.start !== 0) { - writer.uint32(8).int32(message.start); + writer.uint32(8).int32(message.start) } if (message.end !== 0) { - writer.uint32(16).int32(message.end); + writer.uint32(16).int32(message.end) } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): EnumDescriptorProto_EnumReservedRange { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseEnumDescriptorProto_EnumReservedRange(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): EnumDescriptorProto_EnumReservedRange { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseEnumDescriptorProto_EnumReservedRange() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.start = reader.int32(); - break; + message.start = reader.int32() + break case 2: - message.end = reader.int32(); - break; + message.end = reader.int32() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): EnumDescriptorProto_EnumReservedRange { - return { start: isSet(object.start) ? Number(object.start) : 0, end: isSet(object.end) ? Number(object.end) : 0 }; + return { + start: isSet(object.start) ? Number(object.start) : 0, + end: isSet(object.end) ? Number(object.end) : 0, + } }, toJSON(message: EnumDescriptorProto_EnumReservedRange): unknown { - const obj: any = {}; - message.start !== undefined && (obj.start = Math.round(message.start)); - message.end !== undefined && (obj.end = Math.round(message.end)); - return obj; + const obj: any = {} + message.start !== undefined && (obj.start = Math.round(message.start)) + message.end !== undefined && (obj.end = Math.round(message.end)) + return obj }, fromPartial, I>>( object: I, ): EnumDescriptorProto_EnumReservedRange { - const message = createBaseEnumDescriptorProto_EnumReservedRange(); - message.start = object.start ?? 0; - message.end = object.end ?? 0; - return message; + const message = createBaseEnumDescriptorProto_EnumReservedRange() + message.start = object.start ?? 0 + message.end = object.end ?? 0 + return message }, -}; +} function createBaseEnumValueDescriptorProto(): EnumValueDescriptorProto { - return { name: "", number: 0, options: undefined }; + return { name: "", number: 0, options: undefined } } export const EnumValueDescriptorProto = { - encode(message: EnumValueDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: EnumValueDescriptorProto, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.name !== "") { - writer.uint32(10).string(message.name); + writer.uint32(10).string(message.name) } if (message.number !== 0) { - writer.uint32(16).int32(message.number); + writer.uint32(16).int32(message.number) } if (message.options !== undefined) { - EnumValueOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); + EnumValueOptions.encode(message.options, writer.uint32(26).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): EnumValueDescriptorProto { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseEnumValueDescriptorProto(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseEnumValueDescriptorProto() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.name = reader.string(); - break; + message.name = reader.string() + break case 2: - message.number = reader.int32(); - break; + message.number = reader.int32() + break case 3: - message.options = EnumValueOptions.decode(reader, reader.uint32()); - break; + message.options = EnumValueOptions.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): EnumValueDescriptorProto { return { name: isSet(object.name) ? String(object.name) : "", number: isSet(object.number) ? Number(object.number) : 0, - options: isSet(object.options) ? EnumValueOptions.fromJSON(object.options) : undefined, - }; + options: isSet(object.options) + ? EnumValueOptions.fromJSON(object.options) + : undefined, + } }, toJSON(message: EnumValueDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.number !== undefined && (obj.number = Math.round(message.number)); + const obj: any = {} + message.name !== undefined && (obj.name = message.name) + message.number !== undefined && (obj.number = Math.round(message.number)) message.options !== undefined && - (obj.options = message.options ? EnumValueOptions.toJSON(message.options) : undefined); - return obj; + (obj.options = message.options + ? EnumValueOptions.toJSON(message.options) + : undefined) + return obj }, - fromPartial, I>>(object: I): EnumValueDescriptorProto { - const message = createBaseEnumValueDescriptorProto(); - message.name = object.name ?? ""; - message.number = object.number ?? 0; - message.options = (object.options !== undefined && object.options !== null) - ? EnumValueOptions.fromPartial(object.options) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): EnumValueDescriptorProto { + const message = createBaseEnumValueDescriptorProto() + message.name = object.name ?? "" + message.number = object.number ?? 0 + message.options = + object.options !== undefined && object.options !== null + ? EnumValueOptions.fromPartial(object.options) + : undefined + return message }, -}; +} function createBaseServiceDescriptorProto(): ServiceDescriptorProto { - return { name: "", method: [], options: undefined }; + return { name: "", method: [], options: undefined } } export const ServiceDescriptorProto = { - encode(message: ServiceDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: ServiceDescriptorProto, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.name !== "") { - writer.uint32(10).string(message.name); + writer.uint32(10).string(message.name) } for (const v of message.method) { - MethodDescriptorProto.encode(v!, writer.uint32(18).fork()).ldelim(); + MethodDescriptorProto.encode(v!, writer.uint32(18).fork()).ldelim() } if (message.options !== undefined) { - ServiceOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); + ServiceOptions.encode(message.options, writer.uint32(26).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): ServiceDescriptorProto { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseServiceDescriptorProto(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseServiceDescriptorProto() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.name = reader.string(); - break; + message.name = reader.string() + break case 2: - message.method.push(MethodDescriptorProto.decode(reader, reader.uint32())); - break; + message.method.push(MethodDescriptorProto.decode(reader, reader.uint32())) + break case 3: - message.options = ServiceOptions.decode(reader, reader.uint32()); - break; + message.options = ServiceOptions.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): ServiceDescriptorProto { return { name: isSet(object.name) ? String(object.name) : "", - method: Array.isArray(object?.method) ? object.method.map((e: any) => MethodDescriptorProto.fromJSON(e)) : [], - options: isSet(object.options) ? ServiceOptions.fromJSON(object.options) : undefined, - }; + method: Array.isArray(object?.method) + ? object.method.map((e: any) => MethodDescriptorProto.fromJSON(e)) + : [], + options: isSet(object.options) + ? ServiceOptions.fromJSON(object.options) + : undefined, + } }, toJSON(message: ServiceDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); + const obj: any = {} + message.name !== undefined && (obj.name = message.name) if (message.method) { - obj.method = message.method.map((e) => e ? MethodDescriptorProto.toJSON(e) : undefined); + obj.method = message.method.map((e) => + e ? MethodDescriptorProto.toJSON(e) : undefined, + ) } else { - obj.method = []; + obj.method = [] } message.options !== undefined && - (obj.options = message.options ? ServiceOptions.toJSON(message.options) : undefined); - return obj; + (obj.options = message.options + ? ServiceOptions.toJSON(message.options) + : undefined) + return obj }, - fromPartial, I>>(object: I): ServiceDescriptorProto { - const message = createBaseServiceDescriptorProto(); - message.name = object.name ?? ""; - message.method = object.method?.map((e) => MethodDescriptorProto.fromPartial(e)) || []; - message.options = (object.options !== undefined && object.options !== null) - ? ServiceOptions.fromPartial(object.options) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): ServiceDescriptorProto { + const message = createBaseServiceDescriptorProto() + message.name = object.name ?? "" + message.method = + object.method?.map((e) => MethodDescriptorProto.fromPartial(e)) || [] + message.options = + object.options !== undefined && object.options !== null + ? ServiceOptions.fromPartial(object.options) + : undefined + return message }, -}; +} function createBaseMethodDescriptorProto(): MethodDescriptorProto { return { @@ -2246,63 +2517,66 @@ function createBaseMethodDescriptorProto(): MethodDescriptorProto { options: undefined, clientStreaming: false, serverStreaming: false, - }; + } } export const MethodDescriptorProto = { - encode(message: MethodDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: MethodDescriptorProto, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.name !== "") { - writer.uint32(10).string(message.name); + writer.uint32(10).string(message.name) } if (message.inputType !== "") { - writer.uint32(18).string(message.inputType); + writer.uint32(18).string(message.inputType) } if (message.outputType !== "") { - writer.uint32(26).string(message.outputType); + writer.uint32(26).string(message.outputType) } if (message.options !== undefined) { - MethodOptions.encode(message.options, writer.uint32(34).fork()).ldelim(); + MethodOptions.encode(message.options, writer.uint32(34).fork()).ldelim() } if (message.clientStreaming === true) { - writer.uint32(40).bool(message.clientStreaming); + writer.uint32(40).bool(message.clientStreaming) } if (message.serverStreaming === true) { - writer.uint32(48).bool(message.serverStreaming); + writer.uint32(48).bool(message.serverStreaming) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MethodDescriptorProto { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMethodDescriptorProto(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMethodDescriptorProto() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.name = reader.string(); - break; + message.name = reader.string() + break case 2: - message.inputType = reader.string(); - break; + message.inputType = reader.string() + break case 3: - message.outputType = reader.string(); - break; + message.outputType = reader.string() + break case 4: - message.options = MethodOptions.decode(reader, reader.uint32()); - break; + message.options = MethodOptions.decode(reader, reader.uint32()) + break case 5: - message.clientStreaming = reader.bool(); - break; + message.clientStreaming = reader.bool() + break case 6: - message.serverStreaming = reader.bool(); - break; + message.serverStreaming = reader.bool() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): MethodDescriptorProto { @@ -2310,37 +2584,50 @@ export const MethodDescriptorProto = { name: isSet(object.name) ? String(object.name) : "", inputType: isSet(object.inputType) ? String(object.inputType) : "", outputType: isSet(object.outputType) ? String(object.outputType) : "", - options: isSet(object.options) ? MethodOptions.fromJSON(object.options) : undefined, - clientStreaming: isSet(object.clientStreaming) ? Boolean(object.clientStreaming) : false, - serverStreaming: isSet(object.serverStreaming) ? Boolean(object.serverStreaming) : false, - }; + options: isSet(object.options) + ? MethodOptions.fromJSON(object.options) + : undefined, + clientStreaming: isSet(object.clientStreaming) + ? Boolean(object.clientStreaming) + : false, + serverStreaming: isSet(object.serverStreaming) + ? Boolean(object.serverStreaming) + : false, + } }, 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); + 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; - }, - - fromPartial, I>>(object: I): MethodDescriptorProto { - const message = createBaseMethodDescriptorProto(); - message.name = object.name ?? ""; - message.inputType = object.inputType ?? ""; - message.outputType = object.outputType ?? ""; - message.options = (object.options !== undefined && object.options !== null) - ? MethodOptions.fromPartial(object.options) - : undefined; - message.clientStreaming = object.clientStreaming ?? false; - message.serverStreaming = object.serverStreaming ?? false; - return message; - }, -}; + (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 + }, + + fromPartial, I>>( + object: I, + ): MethodDescriptorProto { + const message = createBaseMethodDescriptorProto() + message.name = object.name ?? "" + message.inputType = object.inputType ?? "" + message.outputType = object.outputType ?? "" + message.options = + object.options !== undefined && object.options !== null + ? MethodOptions.fromPartial(object.options) + : undefined + message.clientStreaming = object.clientStreaming ?? false + message.serverStreaming = object.serverStreaming ?? false + return message + }, +} function createBaseFileOptions(): FileOptions { return { @@ -2365,242 +2652,284 @@ function createBaseFileOptions(): FileOptions { phpMetadataNamespace: "", rubyPackage: "", uninterpretedOption: [], - }; + } } export const FileOptions = { encode(message: FileOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.javaPackage !== "") { - writer.uint32(10).string(message.javaPackage); + writer.uint32(10).string(message.javaPackage) } if (message.javaOuterClassname !== "") { - writer.uint32(66).string(message.javaOuterClassname); + writer.uint32(66).string(message.javaOuterClassname) } if (message.javaMultipleFiles === true) { - writer.uint32(80).bool(message.javaMultipleFiles); + writer.uint32(80).bool(message.javaMultipleFiles) } if (message.javaGenerateEqualsAndHash === true) { - writer.uint32(160).bool(message.javaGenerateEqualsAndHash); + writer.uint32(160).bool(message.javaGenerateEqualsAndHash) } if (message.javaStringCheckUtf8 === true) { - writer.uint32(216).bool(message.javaStringCheckUtf8); + writer.uint32(216).bool(message.javaStringCheckUtf8) } if (message.optimizeFor !== 1) { - writer.uint32(72).int32(message.optimizeFor); + writer.uint32(72).int32(message.optimizeFor) } if (message.goPackage !== "") { - writer.uint32(90).string(message.goPackage); + writer.uint32(90).string(message.goPackage) } if (message.ccGenericServices === true) { - writer.uint32(128).bool(message.ccGenericServices); + writer.uint32(128).bool(message.ccGenericServices) } if (message.javaGenericServices === true) { - writer.uint32(136).bool(message.javaGenericServices); + writer.uint32(136).bool(message.javaGenericServices) } if (message.pyGenericServices === true) { - writer.uint32(144).bool(message.pyGenericServices); + writer.uint32(144).bool(message.pyGenericServices) } if (message.phpGenericServices === true) { - writer.uint32(336).bool(message.phpGenericServices); + writer.uint32(336).bool(message.phpGenericServices) } if (message.deprecated === true) { - writer.uint32(184).bool(message.deprecated); + writer.uint32(184).bool(message.deprecated) } if (message.ccEnableArenas === true) { - writer.uint32(248).bool(message.ccEnableArenas); + writer.uint32(248).bool(message.ccEnableArenas) } if (message.objcClassPrefix !== "") { - writer.uint32(290).string(message.objcClassPrefix); + writer.uint32(290).string(message.objcClassPrefix) } if (message.csharpNamespace !== "") { - writer.uint32(298).string(message.csharpNamespace); + writer.uint32(298).string(message.csharpNamespace) } if (message.swiftPrefix !== "") { - writer.uint32(314).string(message.swiftPrefix); + writer.uint32(314).string(message.swiftPrefix) } if (message.phpClassPrefix !== "") { - writer.uint32(322).string(message.phpClassPrefix); + writer.uint32(322).string(message.phpClassPrefix) } if (message.phpNamespace !== "") { - writer.uint32(330).string(message.phpNamespace); + writer.uint32(330).string(message.phpNamespace) } if (message.phpMetadataNamespace !== "") { - writer.uint32(354).string(message.phpMetadataNamespace); + writer.uint32(354).string(message.phpMetadataNamespace) } if (message.rubyPackage !== "") { - writer.uint32(362).string(message.rubyPackage); + writer.uint32(362).string(message.rubyPackage) } for (const v of message.uninterpretedOption) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): FileOptions { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseFileOptions(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseFileOptions() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.javaPackage = reader.string(); - break; + message.javaPackage = reader.string() + break case 8: - message.javaOuterClassname = reader.string(); - break; + message.javaOuterClassname = reader.string() + break case 10: - message.javaMultipleFiles = reader.bool(); - break; + message.javaMultipleFiles = reader.bool() + break case 20: - message.javaGenerateEqualsAndHash = reader.bool(); - break; + message.javaGenerateEqualsAndHash = reader.bool() + break case 27: - message.javaStringCheckUtf8 = reader.bool(); - break; + message.javaStringCheckUtf8 = reader.bool() + break case 9: - message.optimizeFor = reader.int32() as any; - break; + message.optimizeFor = reader.int32() as any + break case 11: - message.goPackage = reader.string(); - break; + message.goPackage = reader.string() + break case 16: - message.ccGenericServices = reader.bool(); - break; + message.ccGenericServices = reader.bool() + break case 17: - message.javaGenericServices = reader.bool(); - break; + message.javaGenericServices = reader.bool() + break case 18: - message.pyGenericServices = reader.bool(); - break; + message.pyGenericServices = reader.bool() + break case 42: - message.phpGenericServices = reader.bool(); - break; + message.phpGenericServices = reader.bool() + break case 23: - message.deprecated = reader.bool(); - break; + message.deprecated = reader.bool() + break case 31: - message.ccEnableArenas = reader.bool(); - break; + message.ccEnableArenas = reader.bool() + break case 36: - message.objcClassPrefix = reader.string(); - break; + message.objcClassPrefix = reader.string() + break case 37: - message.csharpNamespace = reader.string(); - break; + message.csharpNamespace = reader.string() + break case 39: - message.swiftPrefix = reader.string(); - break; + message.swiftPrefix = reader.string() + break case 40: - message.phpClassPrefix = reader.string(); - break; + message.phpClassPrefix = reader.string() + break case 41: - message.phpNamespace = reader.string(); - break; + message.phpNamespace = reader.string() + break case 44: - message.phpMetadataNamespace = reader.string(); - break; + message.phpMetadataNamespace = reader.string() + break case 45: - message.rubyPackage = reader.string(); - break; + message.rubyPackage = reader.string() + break case 999: - message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); - break; + message.uninterpretedOption.push( + UninterpretedOption.decode(reader, reader.uint32()), + ) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): FileOptions { return { javaPackage: isSet(object.javaPackage) ? String(object.javaPackage) : "", - javaOuterClassname: isSet(object.javaOuterClassname) ? String(object.javaOuterClassname) : "", - javaMultipleFiles: isSet(object.javaMultipleFiles) ? Boolean(object.javaMultipleFiles) : false, + javaOuterClassname: isSet(object.javaOuterClassname) + ? String(object.javaOuterClassname) + : "", + javaMultipleFiles: isSet(object.javaMultipleFiles) + ? Boolean(object.javaMultipleFiles) + : false, javaGenerateEqualsAndHash: isSet(object.javaGenerateEqualsAndHash) ? Boolean(object.javaGenerateEqualsAndHash) : false, - javaStringCheckUtf8: isSet(object.javaStringCheckUtf8) ? Boolean(object.javaStringCheckUtf8) : false, - optimizeFor: isSet(object.optimizeFor) ? fileOptions_OptimizeModeFromJSON(object.optimizeFor) : 1, + javaStringCheckUtf8: isSet(object.javaStringCheckUtf8) + ? Boolean(object.javaStringCheckUtf8) + : false, + optimizeFor: isSet(object.optimizeFor) + ? fileOptions_OptimizeModeFromJSON(object.optimizeFor) + : 1, goPackage: isSet(object.goPackage) ? String(object.goPackage) : "", - ccGenericServices: isSet(object.ccGenericServices) ? Boolean(object.ccGenericServices) : false, - javaGenericServices: isSet(object.javaGenericServices) ? Boolean(object.javaGenericServices) : false, - pyGenericServices: isSet(object.pyGenericServices) ? Boolean(object.pyGenericServices) : false, - phpGenericServices: isSet(object.phpGenericServices) ? Boolean(object.phpGenericServices) : false, + ccGenericServices: isSet(object.ccGenericServices) + ? Boolean(object.ccGenericServices) + : false, + javaGenericServices: isSet(object.javaGenericServices) + ? Boolean(object.javaGenericServices) + : false, + pyGenericServices: isSet(object.pyGenericServices) + ? Boolean(object.pyGenericServices) + : false, + phpGenericServices: isSet(object.phpGenericServices) + ? Boolean(object.phpGenericServices) + : false, deprecated: isSet(object.deprecated) ? Boolean(object.deprecated) : false, - ccEnableArenas: isSet(object.ccEnableArenas) ? Boolean(object.ccEnableArenas) : false, - objcClassPrefix: isSet(object.objcClassPrefix) ? String(object.objcClassPrefix) : "", - csharpNamespace: isSet(object.csharpNamespace) ? String(object.csharpNamespace) : "", + ccEnableArenas: isSet(object.ccEnableArenas) + ? Boolean(object.ccEnableArenas) + : false, + objcClassPrefix: isSet(object.objcClassPrefix) + ? String(object.objcClassPrefix) + : "", + csharpNamespace: isSet(object.csharpNamespace) + ? String(object.csharpNamespace) + : "", swiftPrefix: isSet(object.swiftPrefix) ? String(object.swiftPrefix) : "", phpClassPrefix: isSet(object.phpClassPrefix) ? String(object.phpClassPrefix) : "", phpNamespace: isSet(object.phpNamespace) ? String(object.phpNamespace) : "", - phpMetadataNamespace: isSet(object.phpMetadataNamespace) ? String(object.phpMetadataNamespace) : "", + phpMetadataNamespace: isSet(object.phpMetadataNamespace) + ? String(object.phpMetadataNamespace) + : "", rubyPackage: isSet(object.rubyPackage) ? String(object.rubyPackage) : "", uninterpretedOption: Array.isArray(object?.uninterpretedOption) ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) : [], - }; + } }, 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); + 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); + (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); + obj.uninterpretedOption = message.uninterpretedOption.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined, + ) } else { - obj.uninterpretedOption = []; + obj.uninterpretedOption = [] } - return obj; + return obj }, fromPartial, I>>(object: I): FileOptions { - const message = createBaseFileOptions(); - message.javaPackage = object.javaPackage ?? ""; - message.javaOuterClassname = object.javaOuterClassname ?? ""; - message.javaMultipleFiles = object.javaMultipleFiles ?? false; - message.javaGenerateEqualsAndHash = object.javaGenerateEqualsAndHash ?? false; - message.javaStringCheckUtf8 = object.javaStringCheckUtf8 ?? false; - message.optimizeFor = object.optimizeFor ?? 1; - message.goPackage = object.goPackage ?? ""; - message.ccGenericServices = object.ccGenericServices ?? false; - message.javaGenericServices = object.javaGenericServices ?? false; - message.pyGenericServices = object.pyGenericServices ?? false; - message.phpGenericServices = object.phpGenericServices ?? false; - message.deprecated = object.deprecated ?? false; - message.ccEnableArenas = object.ccEnableArenas ?? false; - message.objcClassPrefix = object.objcClassPrefix ?? ""; - message.csharpNamespace = object.csharpNamespace ?? ""; - message.swiftPrefix = object.swiftPrefix ?? ""; - message.phpClassPrefix = object.phpClassPrefix ?? ""; - message.phpNamespace = object.phpNamespace ?? ""; - message.phpMetadataNamespace = object.phpMetadataNamespace ?? ""; - message.rubyPackage = object.rubyPackage ?? ""; - message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; - return message; - }, -}; + const message = createBaseFileOptions() + message.javaPackage = object.javaPackage ?? "" + message.javaOuterClassname = object.javaOuterClassname ?? "" + message.javaMultipleFiles = object.javaMultipleFiles ?? false + message.javaGenerateEqualsAndHash = object.javaGenerateEqualsAndHash ?? false + message.javaStringCheckUtf8 = object.javaStringCheckUtf8 ?? false + message.optimizeFor = object.optimizeFor ?? 1 + message.goPackage = object.goPackage ?? "" + message.ccGenericServices = object.ccGenericServices ?? false + message.javaGenericServices = object.javaGenericServices ?? false + message.pyGenericServices = object.pyGenericServices ?? false + message.phpGenericServices = object.phpGenericServices ?? false + message.deprecated = object.deprecated ?? false + message.ccEnableArenas = object.ccEnableArenas ?? false + message.objcClassPrefix = object.objcClassPrefix ?? "" + message.csharpNamespace = object.csharpNamespace ?? "" + message.swiftPrefix = object.swiftPrefix ?? "" + message.phpClassPrefix = object.phpClassPrefix ?? "" + message.phpNamespace = object.phpNamespace ?? "" + message.phpMetadataNamespace = object.phpMetadataNamespace ?? "" + message.rubyPackage = object.rubyPackage ?? "" + message.uninterpretedOption = + object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || [] + return message + }, +} function createBaseMessageOptions(): MessageOptions { return { @@ -2609,62 +2938,69 @@ function createBaseMessageOptions(): MessageOptions { deprecated: false, mapEntry: false, uninterpretedOption: [], - }; + } } export const MessageOptions = { - encode(message: MessageOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: MessageOptions, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.messageSetWireFormat === true) { - writer.uint32(8).bool(message.messageSetWireFormat); + writer.uint32(8).bool(message.messageSetWireFormat) } if (message.noStandardDescriptorAccessor === true) { - writer.uint32(16).bool(message.noStandardDescriptorAccessor); + writer.uint32(16).bool(message.noStandardDescriptorAccessor) } if (message.deprecated === true) { - writer.uint32(24).bool(message.deprecated); + writer.uint32(24).bool(message.deprecated) } if (message.mapEntry === true) { - writer.uint32(56).bool(message.mapEntry); + writer.uint32(56).bool(message.mapEntry) } for (const v of message.uninterpretedOption) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MessageOptions { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMessageOptions(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMessageOptions() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.messageSetWireFormat = reader.bool(); - break; + message.messageSetWireFormat = reader.bool() + break case 2: - message.noStandardDescriptorAccessor = reader.bool(); - break; + message.noStandardDescriptorAccessor = reader.bool() + break case 3: - message.deprecated = reader.bool(); - break; + message.deprecated = reader.bool() + break case 7: - message.mapEntry = reader.bool(); - break; + message.mapEntry = reader.bool() + break case 999: - message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); - break; + message.uninterpretedOption.push( + UninterpretedOption.decode(reader, reader.uint32()), + ) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): MessageOptions { return { - messageSetWireFormat: isSet(object.messageSetWireFormat) ? Boolean(object.messageSetWireFormat) : false, + messageSetWireFormat: isSet(object.messageSetWireFormat) + ? Boolean(object.messageSetWireFormat) + : false, noStandardDescriptorAccessor: isSet(object.noStandardDescriptorAccessor) ? Boolean(object.noStandardDescriptorAccessor) : false, @@ -2673,99 +3009,122 @@ export const MessageOptions = { uninterpretedOption: Array.isArray(object?.uninterpretedOption) ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) : [], - }; + } }, toJSON(message: MessageOptions): unknown { - const obj: any = {}; - message.messageSetWireFormat !== undefined && (obj.messageSetWireFormat = message.messageSetWireFormat); + 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); + (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); + obj.uninterpretedOption = message.uninterpretedOption.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined, + ) } else { - obj.uninterpretedOption = []; + obj.uninterpretedOption = [] } - return obj; + return obj }, - fromPartial, I>>(object: I): MessageOptions { - const message = createBaseMessageOptions(); - message.messageSetWireFormat = object.messageSetWireFormat ?? false; - message.noStandardDescriptorAccessor = object.noStandardDescriptorAccessor ?? false; - message.deprecated = object.deprecated ?? false; - message.mapEntry = object.mapEntry ?? false; - message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; - return message; + fromPartial, I>>( + object: I, + ): MessageOptions { + const message = createBaseMessageOptions() + message.messageSetWireFormat = object.messageSetWireFormat ?? false + message.noStandardDescriptorAccessor = object.noStandardDescriptorAccessor ?? false + message.deprecated = object.deprecated ?? false + message.mapEntry = object.mapEntry ?? false + message.uninterpretedOption = + object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || [] + return message }, -}; +} function createBaseFieldOptions(): FieldOptions { - return { ctype: 0, packed: false, jstype: 0, lazy: false, deprecated: false, weak: false, uninterpretedOption: [] }; + return { + ctype: 0, + packed: false, + jstype: 0, + lazy: false, + unverifiedLazy: false, + deprecated: false, + weak: false, + uninterpretedOption: [], + } } export const FieldOptions = { encode(message: FieldOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.ctype !== 0) { - writer.uint32(8).int32(message.ctype); + writer.uint32(8).int32(message.ctype) } if (message.packed === true) { - writer.uint32(16).bool(message.packed); + writer.uint32(16).bool(message.packed) } if (message.jstype !== 0) { - writer.uint32(48).int32(message.jstype); + writer.uint32(48).int32(message.jstype) } if (message.lazy === true) { - writer.uint32(40).bool(message.lazy); + writer.uint32(40).bool(message.lazy) + } + if (message.unverifiedLazy === true) { + writer.uint32(120).bool(message.unverifiedLazy) } if (message.deprecated === true) { - writer.uint32(24).bool(message.deprecated); + writer.uint32(24).bool(message.deprecated) } if (message.weak === true) { - writer.uint32(80).bool(message.weak); + writer.uint32(80).bool(message.weak) } for (const v of message.uninterpretedOption) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): FieldOptions { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseFieldOptions(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseFieldOptions() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.ctype = reader.int32() as any; - break; + message.ctype = reader.int32() as any + break case 2: - message.packed = reader.bool(); - break; + message.packed = reader.bool() + break case 6: - message.jstype = reader.int32() as any; - break; + message.jstype = reader.int32() as any + break case 5: - message.lazy = reader.bool(); - break; + message.lazy = reader.bool() + break + case 15: + message.unverifiedLazy = reader.bool() + break case 3: - message.deprecated = reader.bool(); - break; + message.deprecated = reader.bool() + break case 10: - message.weak = reader.bool(); - break; + message.weak = reader.bool() + break case 999: - message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); - break; + message.uninterpretedOption.push( + UninterpretedOption.decode(reader, reader.uint32()), + ) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): FieldOptions { @@ -2774,71 +3133,83 @@ export const FieldOptions = { packed: isSet(object.packed) ? Boolean(object.packed) : false, jstype: isSet(object.jstype) ? fieldOptions_JSTypeFromJSON(object.jstype) : 0, lazy: isSet(object.lazy) ? Boolean(object.lazy) : false, + unverifiedLazy: isSet(object.unverifiedLazy) + ? Boolean(object.unverifiedLazy) + : false, deprecated: isSet(object.deprecated) ? Boolean(object.deprecated) : false, weak: isSet(object.weak) ? Boolean(object.weak) : false, uninterpretedOption: Array.isArray(object?.uninterpretedOption) ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) : [], - }; + } }, 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); + 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.unverifiedLazy !== undefined && + (obj.unverifiedLazy = message.unverifiedLazy) + 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); + obj.uninterpretedOption = message.uninterpretedOption.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined, + ) } else { - obj.uninterpretedOption = []; + obj.uninterpretedOption = [] } - return obj; + return obj }, fromPartial, I>>(object: I): FieldOptions { - const message = createBaseFieldOptions(); - message.ctype = object.ctype ?? 0; - message.packed = object.packed ?? false; - message.jstype = object.jstype ?? 0; - message.lazy = object.lazy ?? false; - message.deprecated = object.deprecated ?? false; - message.weak = object.weak ?? false; - message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; - return message; - }, -}; + const message = createBaseFieldOptions() + message.ctype = object.ctype ?? 0 + message.packed = object.packed ?? false + message.jstype = object.jstype ?? 0 + message.lazy = object.lazy ?? false + message.unverifiedLazy = object.unverifiedLazy ?? false + message.deprecated = object.deprecated ?? false + message.weak = object.weak ?? false + message.uninterpretedOption = + object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || [] + return message + }, +} function createBaseOneofOptions(): OneofOptions { - return { uninterpretedOption: [] }; + return { uninterpretedOption: [] } } export const OneofOptions = { encode(message: OneofOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.uninterpretedOption) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): OneofOptions { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseOneofOptions(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseOneofOptions() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 999: - message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); - break; + message.uninterpretedOption.push( + UninterpretedOption.decode(reader, reader.uint32()), + ) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): OneofOptions { @@ -2846,66 +3217,71 @@ export const OneofOptions = { uninterpretedOption: Array.isArray(object?.uninterpretedOption) ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) : [], - }; + } }, toJSON(message: OneofOptions): unknown { - const obj: any = {}; + const obj: any = {} if (message.uninterpretedOption) { - obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); + obj.uninterpretedOption = message.uninterpretedOption.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined, + ) } else { - obj.uninterpretedOption = []; + obj.uninterpretedOption = [] } - return obj; + return obj }, fromPartial, I>>(object: I): OneofOptions { - const message = createBaseOneofOptions(); - message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; - return message; + const message = createBaseOneofOptions() + message.uninterpretedOption = + object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || [] + return message }, -}; +} function createBaseEnumOptions(): EnumOptions { - return { allowAlias: false, deprecated: false, uninterpretedOption: [] }; + return { allowAlias: false, deprecated: false, uninterpretedOption: [] } } export const EnumOptions = { encode(message: EnumOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.allowAlias === true) { - writer.uint32(16).bool(message.allowAlias); + writer.uint32(16).bool(message.allowAlias) } if (message.deprecated === true) { - writer.uint32(24).bool(message.deprecated); + writer.uint32(24).bool(message.deprecated) } for (const v of message.uninterpretedOption) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): EnumOptions { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseEnumOptions(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseEnumOptions() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 2: - message.allowAlias = reader.bool(); - break; + message.allowAlias = reader.bool() + break case 3: - message.deprecated = reader.bool(); - break; + message.deprecated = reader.bool() + break case 999: - message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); - break; + message.uninterpretedOption.push( + UninterpretedOption.decode(reader, reader.uint32()), + ) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): EnumOptions { @@ -2915,64 +3291,72 @@ export const EnumOptions = { uninterpretedOption: Array.isArray(object?.uninterpretedOption) ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) : [], - }; + } }, toJSON(message: EnumOptions): unknown { - const obj: any = {}; - message.allowAlias !== undefined && (obj.allowAlias = message.allowAlias); - message.deprecated !== undefined && (obj.deprecated = message.deprecated); + 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); + obj.uninterpretedOption = message.uninterpretedOption.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined, + ) } else { - obj.uninterpretedOption = []; + obj.uninterpretedOption = [] } - return obj; + return obj }, fromPartial, I>>(object: I): EnumOptions { - const message = createBaseEnumOptions(); - message.allowAlias = object.allowAlias ?? false; - message.deprecated = object.deprecated ?? false; - message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; - return message; + const message = createBaseEnumOptions() + message.allowAlias = object.allowAlias ?? false + message.deprecated = object.deprecated ?? false + message.uninterpretedOption = + object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || [] + return message }, -}; +} function createBaseEnumValueOptions(): EnumValueOptions { - return { deprecated: false, uninterpretedOption: [] }; + return { deprecated: false, uninterpretedOption: [] } } export const EnumValueOptions = { - encode(message: EnumValueOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: EnumValueOptions, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.deprecated === true) { - writer.uint32(8).bool(message.deprecated); + writer.uint32(8).bool(message.deprecated) } for (const v of message.uninterpretedOption) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): EnumValueOptions { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseEnumValueOptions(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseEnumValueOptions() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.deprecated = reader.bool(); - break; + message.deprecated = reader.bool() + break case 999: - message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); - break; + message.uninterpretedOption.push( + UninterpretedOption.decode(reader, reader.uint32()), + ) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): EnumValueOptions { @@ -2981,62 +3365,72 @@ export const EnumValueOptions = { uninterpretedOption: Array.isArray(object?.uninterpretedOption) ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) : [], - }; + } }, toJSON(message: EnumValueOptions): unknown { - const obj: any = {}; - message.deprecated !== undefined && (obj.deprecated = message.deprecated); + const obj: any = {} + message.deprecated !== undefined && (obj.deprecated = message.deprecated) if (message.uninterpretedOption) { - obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); + obj.uninterpretedOption = message.uninterpretedOption.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined, + ) } else { - obj.uninterpretedOption = []; + obj.uninterpretedOption = [] } - return obj; + return obj }, - fromPartial, I>>(object: I): EnumValueOptions { - const message = createBaseEnumValueOptions(); - message.deprecated = object.deprecated ?? false; - message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; - return message; + fromPartial, I>>( + object: I, + ): EnumValueOptions { + const message = createBaseEnumValueOptions() + message.deprecated = object.deprecated ?? false + message.uninterpretedOption = + object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || [] + return message }, -}; +} function createBaseServiceOptions(): ServiceOptions { - return { deprecated: false, uninterpretedOption: [] }; + return { deprecated: false, uninterpretedOption: [] } } export const ServiceOptions = { - encode(message: ServiceOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: ServiceOptions, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.deprecated === true) { - writer.uint32(264).bool(message.deprecated); + writer.uint32(264).bool(message.deprecated) } for (const v of message.uninterpretedOption) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): ServiceOptions { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseServiceOptions(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseServiceOptions() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 33: - message.deprecated = reader.bool(); - break; + message.deprecated = reader.bool() + break case 999: - message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); - break; + message.uninterpretedOption.push( + UninterpretedOption.decode(reader, reader.uint32()), + ) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): ServiceOptions { @@ -3045,68 +3439,75 @@ export const ServiceOptions = { uninterpretedOption: Array.isArray(object?.uninterpretedOption) ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) : [], - }; + } }, toJSON(message: ServiceOptions): unknown { - const obj: any = {}; - message.deprecated !== undefined && (obj.deprecated = message.deprecated); + const obj: any = {} + message.deprecated !== undefined && (obj.deprecated = message.deprecated) if (message.uninterpretedOption) { - obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); + obj.uninterpretedOption = message.uninterpretedOption.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined, + ) } else { - obj.uninterpretedOption = []; + obj.uninterpretedOption = [] } - return obj; + return obj }, - fromPartial, I>>(object: I): ServiceOptions { - const message = createBaseServiceOptions(); - message.deprecated = object.deprecated ?? false; - message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; - return message; + fromPartial, I>>( + object: I, + ): ServiceOptions { + const message = createBaseServiceOptions() + message.deprecated = object.deprecated ?? false + message.uninterpretedOption = + object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || [] + return message }, -}; +} function createBaseMethodOptions(): MethodOptions { - return { deprecated: false, idempotencyLevel: 0, uninterpretedOption: [] }; + return { deprecated: false, idempotencyLevel: 0, uninterpretedOption: [] } } export const MethodOptions = { encode(message: MethodOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.deprecated === true) { - writer.uint32(264).bool(message.deprecated); + writer.uint32(264).bool(message.deprecated) } if (message.idempotencyLevel !== 0) { - writer.uint32(272).int32(message.idempotencyLevel); + writer.uint32(272).int32(message.idempotencyLevel) } for (const v of message.uninterpretedOption) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MethodOptions { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMethodOptions(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMethodOptions() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 33: - message.deprecated = reader.bool(); - break; + message.deprecated = reader.bool() + break case 34: - message.idempotencyLevel = reader.int32() as any; - break; + message.idempotencyLevel = reader.int32() as any + break case 999: - message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); - break; + message.uninterpretedOption.push( + UninterpretedOption.decode(reader, reader.uint32()), + ) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): MethodOptions { @@ -3118,30 +3519,37 @@ export const MethodOptions = { uninterpretedOption: Array.isArray(object?.uninterpretedOption) ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) : [], - }; + } }, toJSON(message: MethodOptions): unknown { - const obj: any = {}; - message.deprecated !== undefined && (obj.deprecated = message.deprecated); + const obj: any = {} + message.deprecated !== undefined && (obj.deprecated = message.deprecated) message.idempotencyLevel !== undefined && - (obj.idempotencyLevel = methodOptions_IdempotencyLevelToJSON(message.idempotencyLevel)); + (obj.idempotencyLevel = methodOptions_IdempotencyLevelToJSON( + message.idempotencyLevel, + )) if (message.uninterpretedOption) { - obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); + obj.uninterpretedOption = message.uninterpretedOption.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined, + ) } else { - obj.uninterpretedOption = []; + obj.uninterpretedOption = [] } - return obj; + return obj }, - fromPartial, I>>(object: I): MethodOptions { - const message = createBaseMethodOptions(); - message.deprecated = object.deprecated ?? false; - message.idempotencyLevel = object.idempotencyLevel ?? 0; - message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; - return message; + fromPartial, I>>( + object: I, + ): MethodOptions { + const message = createBaseMethodOptions() + message.deprecated = object.deprecated ?? false + message.idempotencyLevel = object.idempotencyLevel ?? 0 + message.uninterpretedOption = + object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || [] + return message }, -}; +} function createBaseUninterpretedOption(): UninterpretedOption { return { @@ -3152,205 +3560,242 @@ function createBaseUninterpretedOption(): UninterpretedOption { doubleValue: 0, stringValue: new Uint8Array(), aggregateValue: "", - }; + } } export const UninterpretedOption = { - encode(message: UninterpretedOption, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: UninterpretedOption, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { for (const v of message.name) { - UninterpretedOption_NamePart.encode(v!, writer.uint32(18).fork()).ldelim(); + UninterpretedOption_NamePart.encode(v!, writer.uint32(18).fork()).ldelim() } if (message.identifierValue !== "") { - writer.uint32(26).string(message.identifierValue); + writer.uint32(26).string(message.identifierValue) } if (!message.positiveIntValue.isZero()) { - writer.uint32(32).uint64(message.positiveIntValue); + writer.uint32(32).uint64(message.positiveIntValue) } if (!message.negativeIntValue.isZero()) { - writer.uint32(40).int64(message.negativeIntValue); + writer.uint32(40).int64(message.negativeIntValue) } if (message.doubleValue !== 0) { - writer.uint32(49).double(message.doubleValue); + writer.uint32(49).double(message.doubleValue) } if (message.stringValue.length !== 0) { - writer.uint32(58).bytes(message.stringValue); + writer.uint32(58).bytes(message.stringValue) } if (message.aggregateValue !== "") { - writer.uint32(66).string(message.aggregateValue); + writer.uint32(66).string(message.aggregateValue) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): UninterpretedOption { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseUninterpretedOption(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseUninterpretedOption() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 2: - message.name.push(UninterpretedOption_NamePart.decode(reader, reader.uint32())); - break; + message.name.push( + UninterpretedOption_NamePart.decode(reader, reader.uint32()), + ) + break case 3: - message.identifierValue = reader.string(); - break; + message.identifierValue = reader.string() + break case 4: - message.positiveIntValue = reader.uint64() as Long; - break; + message.positiveIntValue = reader.uint64() as Long + break case 5: - message.negativeIntValue = reader.int64() as Long; - break; + message.negativeIntValue = reader.int64() as Long + break case 6: - message.doubleValue = reader.double(); - break; + message.doubleValue = reader.double() + break case 7: - message.stringValue = reader.bytes(); - break; + message.stringValue = reader.bytes() + break case 8: - message.aggregateValue = reader.string(); - break; + message.aggregateValue = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): UninterpretedOption { return { - name: Array.isArray(object?.name) ? object.name.map((e: any) => UninterpretedOption_NamePart.fromJSON(e)) : [], - identifierValue: isSet(object.identifierValue) ? String(object.identifierValue) : "", - positiveIntValue: isSet(object.positiveIntValue) ? Long.fromValue(object.positiveIntValue) : Long.UZERO, - negativeIntValue: isSet(object.negativeIntValue) ? Long.fromValue(object.negativeIntValue) : Long.ZERO, + name: Array.isArray(object?.name) + ? object.name.map((e: any) => UninterpretedOption_NamePart.fromJSON(e)) + : [], + identifierValue: isSet(object.identifierValue) + ? String(object.identifierValue) + : "", + positiveIntValue: isSet(object.positiveIntValue) + ? Long.fromValue(object.positiveIntValue) + : Long.UZERO, + negativeIntValue: isSet(object.negativeIntValue) + ? Long.fromValue(object.negativeIntValue) + : Long.ZERO, doubleValue: isSet(object.doubleValue) ? Number(object.doubleValue) : 0, - stringValue: isSet(object.stringValue) ? bytesFromBase64(object.stringValue) : new Uint8Array(), + stringValue: isSet(object.stringValue) + ? bytesFromBase64(object.stringValue) + : new Uint8Array(), aggregateValue: isSet(object.aggregateValue) ? String(object.aggregateValue) : "", - }; + } }, toJSON(message: UninterpretedOption): unknown { - const obj: any = {}; + const obj: any = {} if (message.name) { - obj.name = message.name.map((e) => e ? UninterpretedOption_NamePart.toJSON(e) : undefined); + obj.name = message.name.map((e) => + e ? UninterpretedOption_NamePart.toJSON(e) : undefined, + ) } else { - obj.name = []; + obj.name = [] } - message.identifierValue !== undefined && (obj.identifierValue = message.identifierValue); + message.identifierValue !== undefined && + (obj.identifierValue = message.identifierValue) message.positiveIntValue !== undefined && - (obj.positiveIntValue = (message.positiveIntValue || Long.UZERO).toString()); + (obj.positiveIntValue = (message.positiveIntValue || Long.UZERO).toString()) message.negativeIntValue !== undefined && - (obj.negativeIntValue = (message.negativeIntValue || Long.ZERO).toString()); - message.doubleValue !== undefined && (obj.doubleValue = message.doubleValue); + (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; - }, - - fromPartial, I>>(object: I): UninterpretedOption { - const message = createBaseUninterpretedOption(); - message.name = object.name?.map((e) => UninterpretedOption_NamePart.fromPartial(e)) || []; - message.identifierValue = object.identifierValue ?? ""; - message.positiveIntValue = (object.positiveIntValue !== undefined && object.positiveIntValue !== null) - ? Long.fromValue(object.positiveIntValue) - : Long.UZERO; - message.negativeIntValue = (object.negativeIntValue !== undefined && object.negativeIntValue !== null) - ? Long.fromValue(object.negativeIntValue) - : Long.ZERO; - message.doubleValue = object.doubleValue ?? 0; - message.stringValue = object.stringValue ?? new Uint8Array(); - message.aggregateValue = object.aggregateValue ?? ""; - return message; - }, -}; + (obj.stringValue = base64FromBytes( + message.stringValue !== undefined ? message.stringValue : new Uint8Array(), + )) + message.aggregateValue !== undefined && + (obj.aggregateValue = message.aggregateValue) + return obj + }, + + fromPartial, I>>( + object: I, + ): UninterpretedOption { + const message = createBaseUninterpretedOption() + message.name = + object.name?.map((e) => UninterpretedOption_NamePart.fromPartial(e)) || [] + message.identifierValue = object.identifierValue ?? "" + message.positiveIntValue = + object.positiveIntValue !== undefined && object.positiveIntValue !== null + ? Long.fromValue(object.positiveIntValue) + : Long.UZERO + message.negativeIntValue = + object.negativeIntValue !== undefined && object.negativeIntValue !== null + ? Long.fromValue(object.negativeIntValue) + : Long.ZERO + message.doubleValue = object.doubleValue ?? 0 + message.stringValue = object.stringValue ?? new Uint8Array() + message.aggregateValue = object.aggregateValue ?? "" + return message + }, +} function createBaseUninterpretedOption_NamePart(): UninterpretedOption_NamePart { - return { namePart: "", isExtension: false }; + return { namePart: "", isExtension: false } } export const UninterpretedOption_NamePart = { - encode(message: UninterpretedOption_NamePart, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: UninterpretedOption_NamePart, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.namePart !== "") { - writer.uint32(10).string(message.namePart); + writer.uint32(10).string(message.namePart) } if (message.isExtension === true) { - writer.uint32(16).bool(message.isExtension); + writer.uint32(16).bool(message.isExtension) } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): UninterpretedOption_NamePart { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseUninterpretedOption_NamePart(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): UninterpretedOption_NamePart { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseUninterpretedOption_NamePart() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.namePart = reader.string(); - break; + message.namePart = reader.string() + break case 2: - message.isExtension = reader.bool(); - break; + message.isExtension = reader.bool() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): UninterpretedOption_NamePart { return { namePart: isSet(object.namePart) ? String(object.namePart) : "", isExtension: isSet(object.isExtension) ? Boolean(object.isExtension) : false, - }; + } }, toJSON(message: UninterpretedOption_NamePart): unknown { - const obj: any = {}; - message.namePart !== undefined && (obj.namePart = message.namePart); - message.isExtension !== undefined && (obj.isExtension = message.isExtension); - return obj; + const obj: any = {} + message.namePart !== undefined && (obj.namePart = message.namePart) + message.isExtension !== undefined && (obj.isExtension = message.isExtension) + return obj }, - fromPartial, I>>(object: I): UninterpretedOption_NamePart { - const message = createBaseUninterpretedOption_NamePart(); - message.namePart = object.namePart ?? ""; - message.isExtension = object.isExtension ?? false; - return message; + fromPartial, I>>( + object: I, + ): UninterpretedOption_NamePart { + const message = createBaseUninterpretedOption_NamePart() + message.namePart = object.namePart ?? "" + message.isExtension = object.isExtension ?? false + return message }, -}; +} function createBaseSourceCodeInfo(): SourceCodeInfo { - return { location: [] }; + return { location: [] } } export const SourceCodeInfo = { - encode(message: SourceCodeInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: SourceCodeInfo, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { for (const v of message.location) { - SourceCodeInfo_Location.encode(v!, writer.uint32(10).fork()).ldelim(); + SourceCodeInfo_Location.encode(v!, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): SourceCodeInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSourceCodeInfo(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseSourceCodeInfo() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.location.push(SourceCodeInfo_Location.decode(reader, reader.uint32())); - break; + message.location.push(SourceCodeInfo_Location.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): SourceCodeInfo { @@ -3358,171 +3803,199 @@ export const SourceCodeInfo = { location: Array.isArray(object?.location) ? object.location.map((e: any) => SourceCodeInfo_Location.fromJSON(e)) : [], - }; + } }, toJSON(message: SourceCodeInfo): unknown { - const obj: any = {}; + const obj: any = {} if (message.location) { - obj.location = message.location.map((e) => e ? SourceCodeInfo_Location.toJSON(e) : undefined); + obj.location = message.location.map((e) => + e ? SourceCodeInfo_Location.toJSON(e) : undefined, + ) } else { - obj.location = []; + obj.location = [] } - return obj; + return obj }, - fromPartial, I>>(object: I): SourceCodeInfo { - const message = createBaseSourceCodeInfo(); - message.location = object.location?.map((e) => SourceCodeInfo_Location.fromPartial(e)) || []; - return message; + fromPartial, I>>( + object: I, + ): SourceCodeInfo { + const message = createBaseSourceCodeInfo() + message.location = + object.location?.map((e) => SourceCodeInfo_Location.fromPartial(e)) || [] + return message }, -}; +} function createBaseSourceCodeInfo_Location(): SourceCodeInfo_Location { - return { path: [], span: [], leadingComments: "", trailingComments: "", leadingDetachedComments: [] }; + return { + path: [], + span: [], + leadingComments: "", + trailingComments: "", + leadingDetachedComments: [], + } } export const SourceCodeInfo_Location = { - encode(message: SourceCodeInfo_Location, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - writer.uint32(10).fork(); + encode( + message: SourceCodeInfo_Location, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + writer.uint32(10).fork() for (const v of message.path) { - writer.int32(v); + writer.int32(v) } - writer.ldelim(); - writer.uint32(18).fork(); + writer.ldelim() + writer.uint32(18).fork() for (const v of message.span) { - writer.int32(v); + writer.int32(v) } - writer.ldelim(); + writer.ldelim() if (message.leadingComments !== "") { - writer.uint32(26).string(message.leadingComments); + writer.uint32(26).string(message.leadingComments) } if (message.trailingComments !== "") { - writer.uint32(34).string(message.trailingComments); + writer.uint32(34).string(message.trailingComments) } for (const v of message.leadingDetachedComments) { - writer.uint32(50).string(v!); + writer.uint32(50).string(v!) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): SourceCodeInfo_Location { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSourceCodeInfo_Location(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseSourceCodeInfo_Location() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: if ((tag & 7) === 2) { - const end2 = reader.uint32() + reader.pos; + const end2 = reader.uint32() + reader.pos while (reader.pos < end2) { - message.path.push(reader.int32()); + message.path.push(reader.int32()) } } else { - message.path.push(reader.int32()); + message.path.push(reader.int32()) } - break; + break case 2: if ((tag & 7) === 2) { - const end2 = reader.uint32() + reader.pos; + const end2 = reader.uint32() + reader.pos while (reader.pos < end2) { - message.span.push(reader.int32()); + message.span.push(reader.int32()) } } else { - message.span.push(reader.int32()); + message.span.push(reader.int32()) } - break; + break case 3: - message.leadingComments = reader.string(); - break; + message.leadingComments = reader.string() + break case 4: - message.trailingComments = reader.string(); - break; + message.trailingComments = reader.string() + break case 6: - message.leadingDetachedComments.push(reader.string()); - break; + message.leadingDetachedComments.push(reader.string()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): SourceCodeInfo_Location { return { path: Array.isArray(object?.path) ? object.path.map((e: any) => Number(e)) : [], span: Array.isArray(object?.span) ? object.span.map((e: any) => Number(e)) : [], - leadingComments: isSet(object.leadingComments) ? String(object.leadingComments) : "", - trailingComments: isSet(object.trailingComments) ? String(object.trailingComments) : "", + leadingComments: isSet(object.leadingComments) + ? String(object.leadingComments) + : "", + trailingComments: isSet(object.trailingComments) + ? String(object.trailingComments) + : "", leadingDetachedComments: Array.isArray(object?.leadingDetachedComments) ? object.leadingDetachedComments.map((e: any) => String(e)) : [], - }; + } }, toJSON(message: SourceCodeInfo_Location): unknown { - const obj: any = {}; + const obj: any = {} if (message.path) { - obj.path = message.path.map((e) => Math.round(e)); + obj.path = message.path.map((e) => Math.round(e)) } else { - obj.path = []; + obj.path = [] } if (message.span) { - obj.span = message.span.map((e) => Math.round(e)); + obj.span = message.span.map((e) => Math.round(e)) } else { - obj.span = []; + obj.span = [] } - message.leadingComments !== undefined && (obj.leadingComments = message.leadingComments); - message.trailingComments !== undefined && (obj.trailingComments = message.trailingComments); + message.leadingComments !== undefined && + (obj.leadingComments = message.leadingComments) + message.trailingComments !== undefined && + (obj.trailingComments = message.trailingComments) if (message.leadingDetachedComments) { - obj.leadingDetachedComments = message.leadingDetachedComments.map((e) => e); + obj.leadingDetachedComments = message.leadingDetachedComments.map((e) => e) } else { - obj.leadingDetachedComments = []; + obj.leadingDetachedComments = [] } - return obj; + return obj }, - fromPartial, I>>(object: I): SourceCodeInfo_Location { - const message = createBaseSourceCodeInfo_Location(); - message.path = object.path?.map((e) => e) || []; - message.span = object.span?.map((e) => e) || []; - message.leadingComments = object.leadingComments ?? ""; - message.trailingComments = object.trailingComments ?? ""; - message.leadingDetachedComments = object.leadingDetachedComments?.map((e) => e) || []; - return message; + fromPartial, I>>( + object: I, + ): SourceCodeInfo_Location { + const message = createBaseSourceCodeInfo_Location() + message.path = object.path?.map((e) => e) || [] + message.span = object.span?.map((e) => e) || [] + message.leadingComments = object.leadingComments ?? "" + message.trailingComments = object.trailingComments ?? "" + message.leadingDetachedComments = + object.leadingDetachedComments?.map((e) => e) || [] + return message }, -}; +} function createBaseGeneratedCodeInfo(): GeneratedCodeInfo { - return { annotation: [] }; + return { annotation: [] } } export const GeneratedCodeInfo = { - encode(message: GeneratedCodeInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: GeneratedCodeInfo, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { for (const v of message.annotation) { - GeneratedCodeInfo_Annotation.encode(v!, writer.uint32(10).fork()).ldelim(); + GeneratedCodeInfo_Annotation.encode(v!, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): GeneratedCodeInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGeneratedCodeInfo(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseGeneratedCodeInfo() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.annotation.push(GeneratedCodeInfo_Annotation.decode(reader, reader.uint32())); - break; + message.annotation.push( + GeneratedCodeInfo_Annotation.decode(reader, reader.uint32()), + ) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): GeneratedCodeInfo { @@ -3530,81 +4003,92 @@ export const GeneratedCodeInfo = { annotation: Array.isArray(object?.annotation) ? object.annotation.map((e: any) => GeneratedCodeInfo_Annotation.fromJSON(e)) : [], - }; + } }, toJSON(message: GeneratedCodeInfo): unknown { - const obj: any = {}; + const obj: any = {} if (message.annotation) { - obj.annotation = message.annotation.map((e) => e ? GeneratedCodeInfo_Annotation.toJSON(e) : undefined); + obj.annotation = message.annotation.map((e) => + e ? GeneratedCodeInfo_Annotation.toJSON(e) : undefined, + ) } else { - obj.annotation = []; + obj.annotation = [] } - return obj; + return obj }, - fromPartial, I>>(object: I): GeneratedCodeInfo { - const message = createBaseGeneratedCodeInfo(); - message.annotation = object.annotation?.map((e) => GeneratedCodeInfo_Annotation.fromPartial(e)) || []; - return message; + fromPartial, I>>( + object: I, + ): GeneratedCodeInfo { + const message = createBaseGeneratedCodeInfo() + message.annotation = + object.annotation?.map((e) => GeneratedCodeInfo_Annotation.fromPartial(e)) || [] + return message }, -}; +} function createBaseGeneratedCodeInfo_Annotation(): GeneratedCodeInfo_Annotation { - return { path: [], sourceFile: "", begin: 0, end: 0 }; + return { path: [], sourceFile: "", begin: 0, end: 0 } } export const GeneratedCodeInfo_Annotation = { - encode(message: GeneratedCodeInfo_Annotation, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - writer.uint32(10).fork(); + encode( + message: GeneratedCodeInfo_Annotation, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + writer.uint32(10).fork() for (const v of message.path) { - writer.int32(v); + writer.int32(v) } - writer.ldelim(); + writer.ldelim() if (message.sourceFile !== "") { - writer.uint32(18).string(message.sourceFile); + writer.uint32(18).string(message.sourceFile) } if (message.begin !== 0) { - writer.uint32(24).int32(message.begin); + writer.uint32(24).int32(message.begin) } if (message.end !== 0) { - writer.uint32(32).int32(message.end); + writer.uint32(32).int32(message.end) } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): GeneratedCodeInfo_Annotation { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGeneratedCodeInfo_Annotation(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): GeneratedCodeInfo_Annotation { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseGeneratedCodeInfo_Annotation() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: if ((tag & 7) === 2) { - const end2 = reader.uint32() + reader.pos; + const end2 = reader.uint32() + reader.pos while (reader.pos < end2) { - message.path.push(reader.int32()); + message.path.push(reader.int32()) } } else { - message.path.push(reader.int32()); + message.path.push(reader.int32()) } - break; + break case 2: - message.sourceFile = reader.string(); - break; + message.sourceFile = reader.string() + break case 3: - message.begin = reader.int32(); - break; + message.begin = reader.int32() + break case 4: - message.end = reader.int32(); - break; + message.end = reader.int32() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): GeneratedCodeInfo_Annotation { @@ -3613,93 +4097,93 @@ export const GeneratedCodeInfo_Annotation = { sourceFile: isSet(object.sourceFile) ? String(object.sourceFile) : "", begin: isSet(object.begin) ? Number(object.begin) : 0, end: isSet(object.end) ? Number(object.end) : 0, - }; + } }, toJSON(message: GeneratedCodeInfo_Annotation): unknown { - const obj: any = {}; + const obj: any = {} if (message.path) { - obj.path = message.path.map((e) => Math.round(e)); + obj.path = message.path.map((e) => Math.round(e)) } else { - obj.path = []; + obj.path = [] } - message.sourceFile !== undefined && (obj.sourceFile = message.sourceFile); - message.begin !== undefined && (obj.begin = Math.round(message.begin)); - message.end !== undefined && (obj.end = Math.round(message.end)); - return obj; + message.sourceFile !== undefined && (obj.sourceFile = message.sourceFile) + message.begin !== undefined && (obj.begin = Math.round(message.begin)) + message.end !== undefined && (obj.end = Math.round(message.end)) + return obj }, - fromPartial, I>>(object: I): GeneratedCodeInfo_Annotation { - const message = createBaseGeneratedCodeInfo_Annotation(); - message.path = object.path?.map((e) => e) || []; - message.sourceFile = object.sourceFile ?? ""; - message.begin = object.begin ?? 0; - message.end = object.end ?? 0; - return message; + fromPartial, I>>( + object: I, + ): GeneratedCodeInfo_Annotation { + const message = createBaseGeneratedCodeInfo_Annotation() + message.path = object.path?.map((e) => e) || [] + message.sourceFile = object.sourceFile ?? "" + message.begin = object.begin ?? 0 + message.end = object.end ?? 0 + return message }, -}; +} -declare var self: any | undefined; -declare var window: any | undefined; -declare var global: any | undefined; +declare var self: any | undefined +declare var window: any | undefined +declare var global: any | undefined var globalThis: any = (() => { - if (typeof globalThis !== "undefined") { - return globalThis; - } - if (typeof self !== "undefined") { - return self; - } - if (typeof window !== "undefined") { - return window; - } - if (typeof global !== "undefined") { - return global; - } - throw "Unable to locate global object"; -})(); - + if (typeof globalThis !== "undefined") return globalThis + if (typeof self !== "undefined") return self + if (typeof window !== "undefined") return window + if (typeof global !== "undefined") return global + throw "Unable to locate global object" +})() + +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")) function bytesFromBase64(b64: string): Uint8Array { - if (globalThis.Buffer) { - return Uint8Array.from(globalThis.Buffer.from(b64, "base64")); - } else { - const bin = globalThis.atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; + 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 } +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")) function base64FromBytes(arr: Uint8Array): string { - if (globalThis.Buffer) { - return globalThis.Buffer.from(arr).toString("base64"); - } else { - const bin: string[] = []; - arr.forEach((byte) => { - bin.push(String.fromCharCode(byte)); - }); - return globalThis.btoa(bin.join("")); - } + const bin: string[] = [] + arr.forEach((byte) => { + bin.push(String.fromCharCode(byte)) + }) + return btoa(bin.join("")) } -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/google/protobuf/duration.ts b/packages/protojs/src/google/protobuf/duration.ts index 105772c1..5bd84412 100644 --- a/packages/protojs/src/google/protobuf/duration.ts +++ b/packages/protojs/src/google/protobuf/duration.ts @@ -1,8 +1,8 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "google.protobuf"; +export const protobufPackage = "google.protobuf" /** * A Duration represents a signed, fixed-length span of time represented @@ -26,7 +26,7 @@ export const protobufPackage = "google.protobuf"; * if (duration.seconds < 0 && duration.nanos > 0) { * duration.seconds += 1; * duration.nanos -= 1000000000; - * } else if (durations.seconds > 0 && duration.nanos < 0) { + * } else if (duration.seconds > 0 && duration.nanos < 0) { * duration.seconds -= 1; * duration.nanos += 1000000000; * } @@ -70,7 +70,7 @@ export interface Duration { * to +315,576,000,000 inclusive. Note: these bounds are computed from: * 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years */ - seconds: Long; + seconds: Long /** * Signed fractions of a second at nanosecond resolution of the span * of time. Durations less than one second are represented with a 0 @@ -79,86 +79,98 @@ export interface Duration { * of the same sign as the `seconds` field. Must be from -999,999,999 * to +999,999,999 inclusive. */ - nanos: number; + nanos: number } function createBaseDuration(): Duration { - return { seconds: Long.ZERO, nanos: 0 }; + return { seconds: Long.ZERO, nanos: 0 } } export const Duration = { encode(message: Duration, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (!message.seconds.isZero()) { - writer.uint32(8).int64(message.seconds); + writer.uint32(8).int64(message.seconds) } if (message.nanos !== 0) { - writer.uint32(16).int32(message.nanos); + writer.uint32(16).int32(message.nanos) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Duration { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDuration(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseDuration() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.seconds = reader.int64() as Long; - break; + message.seconds = reader.int64() as Long + break case 2: - message.nanos = reader.int32(); - break; + message.nanos = reader.int32() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Duration { return { seconds: isSet(object.seconds) ? Long.fromValue(object.seconds) : Long.ZERO, nanos: isSet(object.nanos) ? Number(object.nanos) : 0, - }; + } }, toJSON(message: Duration): unknown { - const obj: any = {}; - message.seconds !== undefined && (obj.seconds = (message.seconds || Long.ZERO).toString()); - message.nanos !== undefined && (obj.nanos = Math.round(message.nanos)); - return obj; + const obj: any = {} + message.seconds !== undefined && + (obj.seconds = (message.seconds || Long.ZERO).toString()) + message.nanos !== undefined && (obj.nanos = Math.round(message.nanos)) + return obj }, fromPartial, I>>(object: I): Duration { - const message = createBaseDuration(); - message.seconds = (object.seconds !== undefined && object.seconds !== null) - ? Long.fromValue(object.seconds) - : Long.ZERO; - message.nanos = object.nanos ?? 0; - return message; + const message = createBaseDuration() + message.seconds = + object.seconds !== undefined && object.seconds !== null + ? Long.fromValue(object.seconds) + : Long.ZERO + message.nanos = object.nanos ?? 0 + return message }, -}; +} -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/google/protobuf/timestamp.ts b/packages/protojs/src/google/protobuf/timestamp.ts index 4a0842aa..98906fb5 100644 --- a/packages/protojs/src/google/protobuf/timestamp.ts +++ b/packages/protojs/src/google/protobuf/timestamp.ts @@ -1,21 +1,23 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "google.protobuf"; +export const protobufPackage = "google.protobuf" /** - * A Timestamp represents a point in time independent of any time zone - * or calendar, represented as seconds and fractions of seconds at - * nanosecond resolution in UTC Epoch time. It is encoded using the - * Proleptic Gregorian Calendar which extends the Gregorian calendar - * backwards to year one. It is encoded assuming all minutes are 60 - * seconds long, i.e. leap seconds are "smeared" so that no leap second - * table is needed for interpretation. Range is from - * 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. - * By restricting to that range, we ensure that we can convert to - * and from RFC 3339 date strings. - * See [https://www.ietf.org/rfc/rfc3339.txt](https://www.ietf.org/rfc/rfc3339.txt). + * A Timestamp represents a point in time independent of any time zone or local + * calendar, encoded as a count of seconds and fractions of seconds at + * nanosecond resolution. The count is relative to an epoch at UTC midnight on + * January 1, 1970, in the proleptic Gregorian calendar which extends the + * Gregorian calendar backwards to year one. + * + * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + * second table is needed for interpretation, using a [24-hour linear + * smear](https://developers.google.com/time/smear). + * + * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + * restricting to that range, we ensure that we can convert to and from [RFC + * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. * * # Examples * @@ -53,7 +55,17 @@ export const protobufPackage = "google.protobuf"; * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) * .setNanos((int) ((millis % 1000) * 1000000)).build(); * - * Example 5: Compute Timestamp from current time in Python. + * + * Example 5: Compute Timestamp from Java `Instant.now()`. + * + * Instant now = Instant.now(); + * + * Timestamp timestamp = + * Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + * .setNanos(now.getNano()).build(); + * + * + * Example 6: Compute Timestamp from current time in Python. * * timestamp = Timestamp() * timestamp.GetCurrentTime() @@ -75,12 +87,14 @@ export const protobufPackage = "google.protobuf"; * 01:30 UTC on January 15, 2017. * * In JavaScript, one can convert a Date object to this format using the - * standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString] + * standard + * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) * method. In Python, a standard `datetime.datetime` object can be converted - * to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) - * with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one - * can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( - * http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime-- + * to this format using + * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with + * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use + * the Joda Time's [`ISODateTimeFormat.dateTime()`]( + * http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D * ) to obtain a formatter capable of generating timestamps in this format. */ export interface Timestamp { @@ -89,93 +103,105 @@ export interface Timestamp { * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to * 9999-12-31T23:59:59Z inclusive. */ - seconds: Long; + seconds: Long /** * Non-negative fractions of a second at nanosecond resolution. Negative * second values with fractions must still have non-negative nanos values * that count forward in time. Must be from 0 to 999,999,999 * inclusive. */ - nanos: number; + nanos: number } function createBaseTimestamp(): Timestamp { - return { seconds: Long.ZERO, nanos: 0 }; + return { seconds: Long.ZERO, nanos: 0 } } export const Timestamp = { encode(message: Timestamp, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (!message.seconds.isZero()) { - writer.uint32(8).int64(message.seconds); + writer.uint32(8).int64(message.seconds) } if (message.nanos !== 0) { - writer.uint32(16).int32(message.nanos); + writer.uint32(16).int32(message.nanos) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Timestamp { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseTimestamp(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseTimestamp() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.seconds = reader.int64() as Long; - break; + message.seconds = reader.int64() as Long + break case 2: - message.nanos = reader.int32(); - break; + message.nanos = reader.int32() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Timestamp { return { seconds: isSet(object.seconds) ? Long.fromValue(object.seconds) : Long.ZERO, nanos: isSet(object.nanos) ? Number(object.nanos) : 0, - }; + } }, toJSON(message: Timestamp): unknown { - const obj: any = {}; - message.seconds !== undefined && (obj.seconds = (message.seconds || Long.ZERO).toString()); - message.nanos !== undefined && (obj.nanos = Math.round(message.nanos)); - return obj; + const obj: any = {} + message.seconds !== undefined && + (obj.seconds = (message.seconds || Long.ZERO).toString()) + message.nanos !== undefined && (obj.nanos = Math.round(message.nanos)) + return obj }, fromPartial, I>>(object: I): Timestamp { - const message = createBaseTimestamp(); - message.seconds = (object.seconds !== undefined && object.seconds !== null) - ? Long.fromValue(object.seconds) - : Long.ZERO; - message.nanos = object.nanos ?? 0; - return message; + const message = createBaseTimestamp() + message.seconds = + object.seconds !== undefined && object.seconds !== null + ? Long.fromValue(object.seconds) + : Long.ZERO + message.nanos = object.nanos ?? 0 + return message }, -}; +} -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/oracle/v1beta1/genesis.ts b/packages/protojs/src/oracle/v1beta1/genesis.ts index 0367ea9d..f0e18943 100644 --- a/packages/protojs/src/oracle/v1beta1/genesis.ts +++ b/packages/protojs/src/oracle/v1beta1/genesis.ts @@ -1,26 +1,26 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; import { + Params, + ExchangeRateTuple, AggregateExchangeRatePrevote, AggregateExchangeRateVote, - ExchangeRateTuple, PairReward, - Params, -} from "./oracle"; +} from "./oracle" +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "nibiru.oracle.v1beta1"; +export const protobufPackage = "nibiru.oracle.v1beta1" /** GenesisState defines the oracle module's genesis state. */ export interface GenesisState { - params?: Params; - feederDelegations: FeederDelegation[]; - exchangeRates: ExchangeRateTuple[]; - missCounters: MissCounter[]; - aggregateExchangeRatePrevotes: AggregateExchangeRatePrevote[]; - aggregateExchangeRateVotes: AggregateExchangeRateVote[]; - pairs: string[]; - pairRewards: PairReward[]; + params?: Params + feederDelegations: FeederDelegation[] + exchangeRates: ExchangeRateTuple[] + missCounters: MissCounter[] + aggregateExchangeRatePrevotes: AggregateExchangeRatePrevote[] + aggregateExchangeRateVotes: AggregateExchangeRateVote[] + pairs: string[] + pairRewards: PairReward[] } /** @@ -29,8 +29,8 @@ export interface GenesisState { * default feeder addresses. */ export interface FeederDelegation { - feederAddress: string; - validatorAddress: string; + feederAddress: string + validatorAddress: string } /** @@ -38,8 +38,8 @@ export interface FeederDelegation { * oracle module's genesis state */ export interface MissCounter { - validatorAddress: string; - missCounter: Long; + validatorAddress: string + missCounter: Long } function createBaseGenesisState(): GenesisState { @@ -52,75 +52,81 @@ function createBaseGenesisState(): GenesisState { aggregateExchangeRateVotes: [], pairs: [], pairRewards: [], - }; + } } export const GenesisState = { encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.params !== undefined) { - Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + Params.encode(message.params, writer.uint32(10).fork()).ldelim() } for (const v of message.feederDelegations) { - FeederDelegation.encode(v!, writer.uint32(18).fork()).ldelim(); + FeederDelegation.encode(v!, writer.uint32(18).fork()).ldelim() } for (const v of message.exchangeRates) { - ExchangeRateTuple.encode(v!, writer.uint32(26).fork()).ldelim(); + ExchangeRateTuple.encode(v!, writer.uint32(26).fork()).ldelim() } for (const v of message.missCounters) { - MissCounter.encode(v!, writer.uint32(34).fork()).ldelim(); + MissCounter.encode(v!, writer.uint32(34).fork()).ldelim() } for (const v of message.aggregateExchangeRatePrevotes) { - AggregateExchangeRatePrevote.encode(v!, writer.uint32(42).fork()).ldelim(); + AggregateExchangeRatePrevote.encode(v!, writer.uint32(42).fork()).ldelim() } for (const v of message.aggregateExchangeRateVotes) { - AggregateExchangeRateVote.encode(v!, writer.uint32(50).fork()).ldelim(); + AggregateExchangeRateVote.encode(v!, writer.uint32(50).fork()).ldelim() } for (const v of message.pairs) { - writer.uint32(58).string(v!); + writer.uint32(58).string(v!) } for (const v of message.pairRewards) { - PairReward.encode(v!, writer.uint32(66).fork()).ldelim(); + PairReward.encode(v!, writer.uint32(66).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGenesisState(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseGenesisState() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.params = Params.decode(reader, reader.uint32()); - break; + message.params = Params.decode(reader, reader.uint32()) + break case 2: - message.feederDelegations.push(FeederDelegation.decode(reader, reader.uint32())); - break; + message.feederDelegations.push( + FeederDelegation.decode(reader, reader.uint32()), + ) + break case 3: - message.exchangeRates.push(ExchangeRateTuple.decode(reader, reader.uint32())); - break; + message.exchangeRates.push(ExchangeRateTuple.decode(reader, reader.uint32())) + break case 4: - message.missCounters.push(MissCounter.decode(reader, reader.uint32())); - break; + message.missCounters.push(MissCounter.decode(reader, reader.uint32())) + break case 5: - message.aggregateExchangeRatePrevotes.push(AggregateExchangeRatePrevote.decode(reader, reader.uint32())); - break; + message.aggregateExchangeRatePrevotes.push( + AggregateExchangeRatePrevote.decode(reader, reader.uint32()), + ) + break case 6: - message.aggregateExchangeRateVotes.push(AggregateExchangeRateVote.decode(reader, reader.uint32())); - break; + message.aggregateExchangeRateVotes.push( + AggregateExchangeRateVote.decode(reader, reader.uint32()), + ) + break case 7: - message.pairs.push(reader.string()); - break; + message.pairs.push(reader.string()) + break case 8: - message.pairRewards.push(PairReward.decode(reader, reader.uint32())); - break; + message.pairRewards.push(PairReward.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): GenesisState { @@ -135,217 +141,268 @@ export const GenesisState = { missCounters: Array.isArray(object?.missCounters) ? object.missCounters.map((e: any) => MissCounter.fromJSON(e)) : [], - aggregateExchangeRatePrevotes: Array.isArray(object?.aggregateExchangeRatePrevotes) - ? object.aggregateExchangeRatePrevotes.map((e: any) => AggregateExchangeRatePrevote.fromJSON(e)) + aggregateExchangeRatePrevotes: Array.isArray( + object?.aggregateExchangeRatePrevotes, + ) + ? object.aggregateExchangeRatePrevotes.map((e: any) => + AggregateExchangeRatePrevote.fromJSON(e), + ) : [], aggregateExchangeRateVotes: Array.isArray(object?.aggregateExchangeRateVotes) - ? object.aggregateExchangeRateVotes.map((e: any) => AggregateExchangeRateVote.fromJSON(e)) + ? object.aggregateExchangeRateVotes.map((e: any) => + AggregateExchangeRateVote.fromJSON(e), + ) : [], pairs: Array.isArray(object?.pairs) ? object.pairs.map((e: any) => String(e)) : [], - pairRewards: Array.isArray(object?.pairRewards) ? object.pairRewards.map((e: any) => PairReward.fromJSON(e)) : [], - }; + pairRewards: Array.isArray(object?.pairRewards) + ? object.pairRewards.map((e: any) => PairReward.fromJSON(e)) + : [], + } }, toJSON(message: GenesisState): unknown { - const obj: any = {}; - message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + const obj: any = {} + message.params !== undefined && + (obj.params = message.params ? Params.toJSON(message.params) : undefined) if (message.feederDelegations) { - obj.feederDelegations = message.feederDelegations.map((e) => e ? FeederDelegation.toJSON(e) : undefined); + obj.feederDelegations = message.feederDelegations.map((e) => + e ? FeederDelegation.toJSON(e) : undefined, + ) } else { - obj.feederDelegations = []; + obj.feederDelegations = [] } if (message.exchangeRates) { - obj.exchangeRates = message.exchangeRates.map((e) => e ? ExchangeRateTuple.toJSON(e) : undefined); + obj.exchangeRates = message.exchangeRates.map((e) => + e ? ExchangeRateTuple.toJSON(e) : undefined, + ) } else { - obj.exchangeRates = []; + obj.exchangeRates = [] } if (message.missCounters) { - obj.missCounters = message.missCounters.map((e) => e ? MissCounter.toJSON(e) : undefined); + obj.missCounters = message.missCounters.map((e) => + e ? MissCounter.toJSON(e) : undefined, + ) } else { - obj.missCounters = []; + obj.missCounters = [] } if (message.aggregateExchangeRatePrevotes) { - obj.aggregateExchangeRatePrevotes = message.aggregateExchangeRatePrevotes.map((e) => - e ? AggregateExchangeRatePrevote.toJSON(e) : undefined - ); + obj.aggregateExchangeRatePrevotes = message.aggregateExchangeRatePrevotes.map( + (e) => (e ? AggregateExchangeRatePrevote.toJSON(e) : undefined), + ) } else { - obj.aggregateExchangeRatePrevotes = []; + obj.aggregateExchangeRatePrevotes = [] } if (message.aggregateExchangeRateVotes) { obj.aggregateExchangeRateVotes = message.aggregateExchangeRateVotes.map((e) => - e ? AggregateExchangeRateVote.toJSON(e) : undefined - ); + e ? AggregateExchangeRateVote.toJSON(e) : undefined, + ) } else { - obj.aggregateExchangeRateVotes = []; + obj.aggregateExchangeRateVotes = [] } if (message.pairs) { - obj.pairs = message.pairs.map((e) => e); + obj.pairs = message.pairs.map((e) => e) } else { - obj.pairs = []; + obj.pairs = [] } if (message.pairRewards) { - obj.pairRewards = message.pairRewards.map((e) => e ? PairReward.toJSON(e) : undefined); + obj.pairRewards = message.pairRewards.map((e) => + e ? PairReward.toJSON(e) : undefined, + ) } else { - obj.pairRewards = []; + obj.pairRewards = [] } - return obj; + return obj }, fromPartial, I>>(object: I): GenesisState { - const message = createBaseGenesisState(); - message.params = (object.params !== undefined && object.params !== null) - ? Params.fromPartial(object.params) - : undefined; - message.feederDelegations = object.feederDelegations?.map((e) => FeederDelegation.fromPartial(e)) || []; - message.exchangeRates = object.exchangeRates?.map((e) => ExchangeRateTuple.fromPartial(e)) || []; - message.missCounters = object.missCounters?.map((e) => MissCounter.fromPartial(e)) || []; + const message = createBaseGenesisState() + message.params = + object.params !== undefined && object.params !== null + ? Params.fromPartial(object.params) + : undefined + message.feederDelegations = + object.feederDelegations?.map((e) => FeederDelegation.fromPartial(e)) || [] + message.exchangeRates = + object.exchangeRates?.map((e) => ExchangeRateTuple.fromPartial(e)) || [] + message.missCounters = + object.missCounters?.map((e) => MissCounter.fromPartial(e)) || [] message.aggregateExchangeRatePrevotes = - object.aggregateExchangeRatePrevotes?.map((e) => AggregateExchangeRatePrevote.fromPartial(e)) || []; + object.aggregateExchangeRatePrevotes?.map((e) => + AggregateExchangeRatePrevote.fromPartial(e), + ) || [] message.aggregateExchangeRateVotes = - object.aggregateExchangeRateVotes?.map((e) => AggregateExchangeRateVote.fromPartial(e)) || []; - message.pairs = object.pairs?.map((e) => e) || []; - message.pairRewards = object.pairRewards?.map((e) => PairReward.fromPartial(e)) || []; - return message; + object.aggregateExchangeRateVotes?.map((e) => + AggregateExchangeRateVote.fromPartial(e), + ) || [] + message.pairs = object.pairs?.map((e) => e) || [] + message.pairRewards = + object.pairRewards?.map((e) => PairReward.fromPartial(e)) || [] + return message }, -}; +} function createBaseFeederDelegation(): FeederDelegation { - return { feederAddress: "", validatorAddress: "" }; + return { feederAddress: "", validatorAddress: "" } } export const FeederDelegation = { - encode(message: FeederDelegation, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: FeederDelegation, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.feederAddress !== "") { - writer.uint32(10).string(message.feederAddress); + writer.uint32(10).string(message.feederAddress) } if (message.validatorAddress !== "") { - writer.uint32(18).string(message.validatorAddress); + writer.uint32(18).string(message.validatorAddress) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): FeederDelegation { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseFeederDelegation(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseFeederDelegation() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.feederAddress = reader.string(); - break; + message.feederAddress = reader.string() + break case 2: - message.validatorAddress = reader.string(); - break; + message.validatorAddress = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): FeederDelegation { return { feederAddress: isSet(object.feederAddress) ? String(object.feederAddress) : "", - validatorAddress: isSet(object.validatorAddress) ? String(object.validatorAddress) : "", - }; + validatorAddress: isSet(object.validatorAddress) + ? String(object.validatorAddress) + : "", + } }, toJSON(message: FeederDelegation): unknown { - const obj: any = {}; - message.feederAddress !== undefined && (obj.feederAddress = message.feederAddress); - message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); - return obj; + const obj: any = {} + message.feederAddress !== undefined && (obj.feederAddress = message.feederAddress) + message.validatorAddress !== undefined && + (obj.validatorAddress = message.validatorAddress) + return obj }, - fromPartial, I>>(object: I): FeederDelegation { - const message = createBaseFeederDelegation(); - message.feederAddress = object.feederAddress ?? ""; - message.validatorAddress = object.validatorAddress ?? ""; - return message; + fromPartial, I>>( + object: I, + ): FeederDelegation { + const message = createBaseFeederDelegation() + message.feederAddress = object.feederAddress ?? "" + message.validatorAddress = object.validatorAddress ?? "" + return message }, -}; +} function createBaseMissCounter(): MissCounter { - return { validatorAddress: "", missCounter: Long.UZERO }; + return { validatorAddress: "", missCounter: Long.UZERO } } export const MissCounter = { encode(message: MissCounter, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.validatorAddress !== "") { - writer.uint32(10).string(message.validatorAddress); + writer.uint32(10).string(message.validatorAddress) } if (!message.missCounter.isZero()) { - writer.uint32(16).uint64(message.missCounter); + writer.uint32(16).uint64(message.missCounter) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MissCounter { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMissCounter(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMissCounter() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.validatorAddress = reader.string(); - break; + message.validatorAddress = reader.string() + break case 2: - message.missCounter = reader.uint64() as Long; - break; + message.missCounter = reader.uint64() as Long + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): MissCounter { return { - validatorAddress: isSet(object.validatorAddress) ? String(object.validatorAddress) : "", - missCounter: isSet(object.missCounter) ? Long.fromValue(object.missCounter) : Long.UZERO, - }; + validatorAddress: isSet(object.validatorAddress) + ? String(object.validatorAddress) + : "", + missCounter: isSet(object.missCounter) + ? Long.fromValue(object.missCounter) + : Long.UZERO, + } }, toJSON(message: MissCounter): unknown { - const obj: any = {}; - message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); - message.missCounter !== undefined && (obj.missCounter = (message.missCounter || Long.UZERO).toString()); - return obj; + const obj: any = {} + message.validatorAddress !== undefined && + (obj.validatorAddress = message.validatorAddress) + message.missCounter !== undefined && + (obj.missCounter = (message.missCounter || Long.UZERO).toString()) + return obj }, fromPartial, I>>(object: I): MissCounter { - const message = createBaseMissCounter(); - message.validatorAddress = object.validatorAddress ?? ""; - message.missCounter = (object.missCounter !== undefined && object.missCounter !== null) - ? Long.fromValue(object.missCounter) - : Long.UZERO; - return message; + const message = createBaseMissCounter() + message.validatorAddress = object.validatorAddress ?? "" + message.missCounter = + object.missCounter !== undefined && object.missCounter !== null + ? Long.fromValue(object.missCounter) + : Long.UZERO + return message }, -}; +} -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/oracle/v1beta1/oracle.ts b/packages/protojs/src/oracle/v1beta1/oracle.ts index 9822d298..7635a58c 100644 --- a/packages/protojs/src/oracle/v1beta1/oracle.ts +++ b/packages/protojs/src/oracle/v1beta1/oracle.ts @@ -1,20 +1,20 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { Coin } from "../../cosmos/base/v1beta1/coin"; -import { Duration } from "../../google/protobuf/duration"; +import { Duration } from "../../google/protobuf/duration" +import Long from "long" +import { Coin } from "../../cosmos/base/v1beta1/coin" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "nibiru.oracle.v1beta1"; +export const protobufPackage = "nibiru.oracle.v1beta1" /** Params defines the module parameters for the x/oracle module. */ export interface Params { /** VotePeriod defines the number of blocks during which voting takes place. */ - votePeriod: Long; + votePeriod: Long /** * VoteThreshold specifies the minimum proportion of votes that must be * received for a ballot to pass. */ - voteThreshold: string; + voteThreshold: string /** * RewardBand defines a maxium divergence that a price vote can have from the * weighted median in the ballot. If a vote lies within the valid range @@ -25,33 +25,33 @@ export interface Params { * Note that if the reward band is smaller than 1 standard * deviation, the band is taken to be 1 standard deviation.a price */ - rewardBand: string; + rewardBand: string /** * The set of whitelisted markets, or asset pairs, for the module. * Ex. '["unibi:uusd","ubtc:uusd"]' */ - whitelist: string[]; + whitelist: string[] /** * SlashFraction returns the proportion of an oracle's stake that gets * slashed in the event of slashing. `SlashFraction` specifies the exact * penalty for failing a voting period. */ - slashFraction: string; + slashFraction: string /** * SlashWindow returns the number of voting periods that specify a * "slash window". After each slash window, all oracles that have missed more * than the penalty threshold are slashed. Missing the penalty threshold is * synonymous with submitting fewer valid votes than `MinValidPerWindow`. */ - slashWindow: Long; - minValidPerWindow: string; + slashWindow: Long + minValidPerWindow: string /** Amount of time to look back for TWAP calculations */ - twapLookbackWindow?: Duration; + twapLookbackWindow?: Duration /** * The minimum number of voters (i.e. oracle validators) per pair for it to be considered a passing ballot. * Recommended at least 4. */ - minVoters: Long; + minVoters: Long } /** @@ -60,9 +60,9 @@ export interface Params { * which is formatted as hex string in SHA256("{salt}:({pair},{exchange_rate})|...|({pair},{exchange_rate}):{voter}") */ export interface AggregateExchangeRatePrevote { - hash: string; - voter: string; - submitBlock: Long; + hash: string + voter: string + submitBlock: Long } /** @@ -70,14 +70,14 @@ export interface AggregateExchangeRatePrevote { * the exchange rates different assets. */ export interface AggregateExchangeRateVote { - exchangeRateTuples: ExchangeRateTuple[]; - voter: string; + exchangeRateTuples: ExchangeRateTuple[] + voter: string } /** ExchangeRateTuple - struct to store interpreted exchange rates data to store */ export interface ExchangeRateTuple { - pair: string; - exchangeRate: string; + pair: string + exchangeRate: string } /** @@ -86,13 +86,13 @@ export interface ExchangeRateTuple { */ export interface PairReward { /** pair defines the pair for which we incentivize validator to provide prices for. */ - pair: string; + pair: string /** id uniquely identifies the rewards instance of the pair */ - id: Long; + id: Long /** vote_periods defines the vote periods left in which rewards will be distributed. */ - votePeriods: Long; + votePeriods: Long /** Coins defines the amount of coins to distribute in a single vote period. */ - coins: Coin[]; + coins: Coin[] } function createBaseParams(): Params { @@ -106,242 +106,281 @@ function createBaseParams(): Params { minValidPerWindow: "", twapLookbackWindow: undefined, minVoters: Long.UZERO, - }; + } } export const Params = { encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (!message.votePeriod.isZero()) { - writer.uint32(8).uint64(message.votePeriod); + writer.uint32(8).uint64(message.votePeriod) } if (message.voteThreshold !== "") { - writer.uint32(18).string(message.voteThreshold); + writer.uint32(18).string(message.voteThreshold) } if (message.rewardBand !== "") { - writer.uint32(26).string(message.rewardBand); + writer.uint32(26).string(message.rewardBand) } for (const v of message.whitelist) { - writer.uint32(34).string(v!); + writer.uint32(34).string(v!) } if (message.slashFraction !== "") { - writer.uint32(42).string(message.slashFraction); + writer.uint32(42).string(message.slashFraction) } if (!message.slashWindow.isZero()) { - writer.uint32(48).uint64(message.slashWindow); + writer.uint32(48).uint64(message.slashWindow) } if (message.minValidPerWindow !== "") { - writer.uint32(58).string(message.minValidPerWindow); + writer.uint32(58).string(message.minValidPerWindow) } if (message.twapLookbackWindow !== undefined) { - Duration.encode(message.twapLookbackWindow, writer.uint32(66).fork()).ldelim(); + Duration.encode(message.twapLookbackWindow, writer.uint32(66).fork()).ldelim() } if (!message.minVoters.isZero()) { - writer.uint32(72).uint64(message.minVoters); + writer.uint32(72).uint64(message.minVoters) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Params { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseParams(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseParams() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.votePeriod = reader.uint64() as Long; - break; + message.votePeriod = reader.uint64() as Long + break case 2: - message.voteThreshold = reader.string(); - break; + message.voteThreshold = reader.string() + break case 3: - message.rewardBand = reader.string(); - break; + message.rewardBand = reader.string() + break case 4: - message.whitelist.push(reader.string()); - break; + message.whitelist.push(reader.string()) + break case 5: - message.slashFraction = reader.string(); - break; + message.slashFraction = reader.string() + break case 6: - message.slashWindow = reader.uint64() as Long; - break; + message.slashWindow = reader.uint64() as Long + break case 7: - message.minValidPerWindow = reader.string(); - break; + message.minValidPerWindow = reader.string() + break case 8: - message.twapLookbackWindow = Duration.decode(reader, reader.uint32()); - break; + message.twapLookbackWindow = Duration.decode(reader, reader.uint32()) + break case 9: - message.minVoters = reader.uint64() as Long; - break; + message.minVoters = reader.uint64() as Long + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Params { return { - votePeriod: isSet(object.votePeriod) ? Long.fromValue(object.votePeriod) : Long.UZERO, + votePeriod: isSet(object.votePeriod) + ? Long.fromValue(object.votePeriod) + : Long.UZERO, voteThreshold: isSet(object.voteThreshold) ? String(object.voteThreshold) : "", rewardBand: isSet(object.rewardBand) ? String(object.rewardBand) : "", - whitelist: Array.isArray(object?.whitelist) ? object.whitelist.map((e: any) => String(e)) : [], + whitelist: Array.isArray(object?.whitelist) + ? object.whitelist.map((e: any) => String(e)) + : [], slashFraction: isSet(object.slashFraction) ? String(object.slashFraction) : "", - slashWindow: isSet(object.slashWindow) ? Long.fromValue(object.slashWindow) : Long.UZERO, - minValidPerWindow: isSet(object.minValidPerWindow) ? String(object.minValidPerWindow) : "", - twapLookbackWindow: isSet(object.twapLookbackWindow) ? Duration.fromJSON(object.twapLookbackWindow) : undefined, - minVoters: isSet(object.minVoters) ? Long.fromValue(object.minVoters) : Long.UZERO, - }; + slashWindow: isSet(object.slashWindow) + ? Long.fromValue(object.slashWindow) + : Long.UZERO, + minValidPerWindow: isSet(object.minValidPerWindow) + ? String(object.minValidPerWindow) + : "", + twapLookbackWindow: isSet(object.twapLookbackWindow) + ? Duration.fromJSON(object.twapLookbackWindow) + : undefined, + minVoters: isSet(object.minVoters) + ? Long.fromValue(object.minVoters) + : Long.UZERO, + } }, toJSON(message: Params): unknown { - const obj: any = {}; - message.votePeriod !== undefined && (obj.votePeriod = (message.votePeriod || Long.UZERO).toString()); - message.voteThreshold !== undefined && (obj.voteThreshold = message.voteThreshold); - message.rewardBand !== undefined && (obj.rewardBand = message.rewardBand); + const obj: any = {} + message.votePeriod !== undefined && + (obj.votePeriod = (message.votePeriod || Long.UZERO).toString()) + message.voteThreshold !== undefined && (obj.voteThreshold = message.voteThreshold) + message.rewardBand !== undefined && (obj.rewardBand = message.rewardBand) if (message.whitelist) { - obj.whitelist = message.whitelist.map((e) => e); + obj.whitelist = message.whitelist.map((e) => e) } else { - obj.whitelist = []; + obj.whitelist = [] } - message.slashFraction !== undefined && (obj.slashFraction = message.slashFraction); - message.slashWindow !== undefined && (obj.slashWindow = (message.slashWindow || Long.UZERO).toString()); - message.minValidPerWindow !== undefined && (obj.minValidPerWindow = message.minValidPerWindow); + message.slashFraction !== undefined && (obj.slashFraction = message.slashFraction) + message.slashWindow !== undefined && + (obj.slashWindow = (message.slashWindow || Long.UZERO).toString()) + message.minValidPerWindow !== undefined && + (obj.minValidPerWindow = message.minValidPerWindow) message.twapLookbackWindow !== undefined && - (obj.twapLookbackWindow = message.twapLookbackWindow ? Duration.toJSON(message.twapLookbackWindow) : undefined); - message.minVoters !== undefined && (obj.minVoters = (message.minVoters || Long.UZERO).toString()); - return obj; + (obj.twapLookbackWindow = message.twapLookbackWindow + ? Duration.toJSON(message.twapLookbackWindow) + : undefined) + message.minVoters !== undefined && + (obj.minVoters = (message.minVoters || Long.UZERO).toString()) + return obj }, fromPartial, I>>(object: I): Params { - const message = createBaseParams(); - message.votePeriod = (object.votePeriod !== undefined && object.votePeriod !== null) - ? Long.fromValue(object.votePeriod) - : Long.UZERO; - message.voteThreshold = object.voteThreshold ?? ""; - message.rewardBand = object.rewardBand ?? ""; - message.whitelist = object.whitelist?.map((e) => e) || []; - message.slashFraction = object.slashFraction ?? ""; - message.slashWindow = (object.slashWindow !== undefined && object.slashWindow !== null) - ? Long.fromValue(object.slashWindow) - : Long.UZERO; - message.minValidPerWindow = object.minValidPerWindow ?? ""; - message.twapLookbackWindow = (object.twapLookbackWindow !== undefined && object.twapLookbackWindow !== null) - ? Duration.fromPartial(object.twapLookbackWindow) - : undefined; - message.minVoters = (object.minVoters !== undefined && object.minVoters !== null) - ? Long.fromValue(object.minVoters) - : Long.UZERO; - return message; + const message = createBaseParams() + message.votePeriod = + object.votePeriod !== undefined && object.votePeriod !== null + ? Long.fromValue(object.votePeriod) + : Long.UZERO + message.voteThreshold = object.voteThreshold ?? "" + message.rewardBand = object.rewardBand ?? "" + message.whitelist = object.whitelist?.map((e) => e) || [] + message.slashFraction = object.slashFraction ?? "" + message.slashWindow = + object.slashWindow !== undefined && object.slashWindow !== null + ? Long.fromValue(object.slashWindow) + : Long.UZERO + message.minValidPerWindow = object.minValidPerWindow ?? "" + message.twapLookbackWindow = + object.twapLookbackWindow !== undefined && object.twapLookbackWindow !== null + ? Duration.fromPartial(object.twapLookbackWindow) + : undefined + message.minVoters = + object.minVoters !== undefined && object.minVoters !== null + ? Long.fromValue(object.minVoters) + : Long.UZERO + return message }, -}; +} function createBaseAggregateExchangeRatePrevote(): AggregateExchangeRatePrevote { - return { hash: "", voter: "", submitBlock: Long.UZERO }; + return { hash: "", voter: "", submitBlock: Long.UZERO } } export const AggregateExchangeRatePrevote = { - encode(message: AggregateExchangeRatePrevote, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: AggregateExchangeRatePrevote, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.hash !== "") { - writer.uint32(10).string(message.hash); + writer.uint32(10).string(message.hash) } if (message.voter !== "") { - writer.uint32(18).string(message.voter); + writer.uint32(18).string(message.voter) } if (!message.submitBlock.isZero()) { - writer.uint32(24).uint64(message.submitBlock); + writer.uint32(24).uint64(message.submitBlock) } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): AggregateExchangeRatePrevote { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseAggregateExchangeRatePrevote(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): AggregateExchangeRatePrevote { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseAggregateExchangeRatePrevote() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.hash = reader.string(); - break; + message.hash = reader.string() + break case 2: - message.voter = reader.string(); - break; + message.voter = reader.string() + break case 3: - message.submitBlock = reader.uint64() as Long; - break; + message.submitBlock = reader.uint64() as Long + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): AggregateExchangeRatePrevote { return { hash: isSet(object.hash) ? String(object.hash) : "", voter: isSet(object.voter) ? String(object.voter) : "", - submitBlock: isSet(object.submitBlock) ? Long.fromValue(object.submitBlock) : Long.UZERO, - }; + submitBlock: isSet(object.submitBlock) + ? Long.fromValue(object.submitBlock) + : Long.UZERO, + } }, toJSON(message: AggregateExchangeRatePrevote): unknown { - const obj: any = {}; - message.hash !== undefined && (obj.hash = message.hash); - message.voter !== undefined && (obj.voter = message.voter); - message.submitBlock !== undefined && (obj.submitBlock = (message.submitBlock || Long.UZERO).toString()); - return obj; + const obj: any = {} + message.hash !== undefined && (obj.hash = message.hash) + message.voter !== undefined && (obj.voter = message.voter) + message.submitBlock !== undefined && + (obj.submitBlock = (message.submitBlock || Long.UZERO).toString()) + return obj }, - fromPartial, I>>(object: I): AggregateExchangeRatePrevote { - const message = createBaseAggregateExchangeRatePrevote(); - message.hash = object.hash ?? ""; - message.voter = object.voter ?? ""; - message.submitBlock = (object.submitBlock !== undefined && object.submitBlock !== null) - ? Long.fromValue(object.submitBlock) - : Long.UZERO; - return message; + fromPartial, I>>( + object: I, + ): AggregateExchangeRatePrevote { + const message = createBaseAggregateExchangeRatePrevote() + message.hash = object.hash ?? "" + message.voter = object.voter ?? "" + message.submitBlock = + object.submitBlock !== undefined && object.submitBlock !== null + ? Long.fromValue(object.submitBlock) + : Long.UZERO + return message }, -}; +} function createBaseAggregateExchangeRateVote(): AggregateExchangeRateVote { - return { exchangeRateTuples: [], voter: "" }; + return { exchangeRateTuples: [], voter: "" } } export const AggregateExchangeRateVote = { - encode(message: AggregateExchangeRateVote, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: AggregateExchangeRateVote, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { for (const v of message.exchangeRateTuples) { - ExchangeRateTuple.encode(v!, writer.uint32(10).fork()).ldelim(); + ExchangeRateTuple.encode(v!, writer.uint32(10).fork()).ldelim() } if (message.voter !== "") { - writer.uint32(18).string(message.voter); + writer.uint32(18).string(message.voter) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): AggregateExchangeRateVote { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseAggregateExchangeRateVote(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseAggregateExchangeRateVote() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.exchangeRateTuples.push(ExchangeRateTuple.decode(reader, reader.uint32())); - break; + message.exchangeRateTuples.push( + ExchangeRateTuple.decode(reader, reader.uint32()), + ) + break case 2: - message.voter = reader.string(); - break; + message.voter = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): AggregateExchangeRateVote { @@ -350,185 +389,214 @@ export const AggregateExchangeRateVote = { ? object.exchangeRateTuples.map((e: any) => ExchangeRateTuple.fromJSON(e)) : [], voter: isSet(object.voter) ? String(object.voter) : "", - }; + } }, toJSON(message: AggregateExchangeRateVote): unknown { - const obj: any = {}; + const obj: any = {} if (message.exchangeRateTuples) { - obj.exchangeRateTuples = message.exchangeRateTuples.map((e) => e ? ExchangeRateTuple.toJSON(e) : undefined); + obj.exchangeRateTuples = message.exchangeRateTuples.map((e) => + e ? ExchangeRateTuple.toJSON(e) : undefined, + ) } else { - obj.exchangeRateTuples = []; + obj.exchangeRateTuples = [] } - message.voter !== undefined && (obj.voter = message.voter); - return obj; + message.voter !== undefined && (obj.voter = message.voter) + return obj }, - fromPartial, I>>(object: I): AggregateExchangeRateVote { - const message = createBaseAggregateExchangeRateVote(); - message.exchangeRateTuples = object.exchangeRateTuples?.map((e) => ExchangeRateTuple.fromPartial(e)) || []; - message.voter = object.voter ?? ""; - return message; + fromPartial, I>>( + object: I, + ): AggregateExchangeRateVote { + const message = createBaseAggregateExchangeRateVote() + message.exchangeRateTuples = + object.exchangeRateTuples?.map((e) => ExchangeRateTuple.fromPartial(e)) || [] + message.voter = object.voter ?? "" + return message }, -}; +} function createBaseExchangeRateTuple(): ExchangeRateTuple { - return { pair: "", exchangeRate: "" }; + return { pair: "", exchangeRate: "" } } export const ExchangeRateTuple = { - encode(message: ExchangeRateTuple, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: ExchangeRateTuple, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.pair !== "") { - writer.uint32(10).string(message.pair); + writer.uint32(10).string(message.pair) } if (message.exchangeRate !== "") { - writer.uint32(18).string(message.exchangeRate); + writer.uint32(18).string(message.exchangeRate) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): ExchangeRateTuple { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseExchangeRateTuple(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseExchangeRateTuple() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.pair = reader.string(); - break; + message.pair = reader.string() + break case 2: - message.exchangeRate = reader.string(); - break; + message.exchangeRate = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): ExchangeRateTuple { return { pair: isSet(object.pair) ? String(object.pair) : "", exchangeRate: isSet(object.exchangeRate) ? String(object.exchangeRate) : "", - }; + } }, toJSON(message: ExchangeRateTuple): unknown { - const obj: any = {}; - message.pair !== undefined && (obj.pair = message.pair); - message.exchangeRate !== undefined && (obj.exchangeRate = message.exchangeRate); - return obj; + const obj: any = {} + message.pair !== undefined && (obj.pair = message.pair) + message.exchangeRate !== undefined && (obj.exchangeRate = message.exchangeRate) + return obj }, - fromPartial, I>>(object: I): ExchangeRateTuple { - const message = createBaseExchangeRateTuple(); - message.pair = object.pair ?? ""; - message.exchangeRate = object.exchangeRate ?? ""; - return message; + fromPartial, I>>( + object: I, + ): ExchangeRateTuple { + const message = createBaseExchangeRateTuple() + message.pair = object.pair ?? "" + message.exchangeRate = object.exchangeRate ?? "" + return message }, -}; +} function createBasePairReward(): PairReward { - return { pair: "", id: Long.UZERO, votePeriods: Long.UZERO, coins: [] }; + return { pair: "", id: Long.UZERO, votePeriods: Long.UZERO, coins: [] } } export const PairReward = { encode(message: PairReward, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.pair !== "") { - writer.uint32(10).string(message.pair); + writer.uint32(10).string(message.pair) } if (!message.id.isZero()) { - writer.uint32(16).uint64(message.id); + writer.uint32(16).uint64(message.id) } if (!message.votePeriods.isZero()) { - writer.uint32(24).uint64(message.votePeriods); + writer.uint32(24).uint64(message.votePeriods) } for (const v of message.coins) { - Coin.encode(v!, writer.uint32(34).fork()).ldelim(); + Coin.encode(v!, writer.uint32(34).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): PairReward { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBasePairReward(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBasePairReward() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.pair = reader.string(); - break; + message.pair = reader.string() + break case 2: - message.id = reader.uint64() as Long; - break; + message.id = reader.uint64() as Long + break case 3: - message.votePeriods = reader.uint64() as Long; - break; + message.votePeriods = reader.uint64() as Long + break case 4: - message.coins.push(Coin.decode(reader, reader.uint32())); - break; + message.coins.push(Coin.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): PairReward { return { pair: isSet(object.pair) ? String(object.pair) : "", id: isSet(object.id) ? Long.fromValue(object.id) : Long.UZERO, - votePeriods: isSet(object.votePeriods) ? Long.fromValue(object.votePeriods) : Long.UZERO, - coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromJSON(e)) : [], - }; + votePeriods: isSet(object.votePeriods) + ? Long.fromValue(object.votePeriods) + : Long.UZERO, + coins: Array.isArray(object?.coins) + ? object.coins.map((e: any) => Coin.fromJSON(e)) + : [], + } }, toJSON(message: PairReward): unknown { - const obj: any = {}; - message.pair !== undefined && (obj.pair = message.pair); - message.id !== undefined && (obj.id = (message.id || Long.UZERO).toString()); - message.votePeriods !== undefined && (obj.votePeriods = (message.votePeriods || Long.UZERO).toString()); + const obj: any = {} + message.pair !== undefined && (obj.pair = message.pair) + message.id !== undefined && (obj.id = (message.id || Long.UZERO).toString()) + message.votePeriods !== undefined && + (obj.votePeriods = (message.votePeriods || Long.UZERO).toString()) if (message.coins) { - obj.coins = message.coins.map((e) => e ? Coin.toJSON(e) : undefined); + obj.coins = message.coins.map((e) => (e ? Coin.toJSON(e) : undefined)) } else { - obj.coins = []; + obj.coins = [] } - return obj; + return obj }, fromPartial, I>>(object: I): PairReward { - const message = createBasePairReward(); - message.pair = object.pair ?? ""; - message.id = (object.id !== undefined && object.id !== null) ? Long.fromValue(object.id) : Long.UZERO; - message.votePeriods = (object.votePeriods !== undefined && object.votePeriods !== null) - ? Long.fromValue(object.votePeriods) - : Long.UZERO; - message.coins = object.coins?.map((e) => Coin.fromPartial(e)) || []; - return message; + const message = createBasePairReward() + message.pair = object.pair ?? "" + message.id = + object.id !== undefined && object.id !== null + ? Long.fromValue(object.id) + : Long.UZERO + message.votePeriods = + object.votePeriods !== undefined && object.votePeriods !== null + ? Long.fromValue(object.votePeriods) + : Long.UZERO + message.coins = object.coins?.map((e) => Coin.fromPartial(e)) || [] + return message }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; +} -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/oracle/v1beta1/query.ts b/packages/protojs/src/oracle/v1beta1/query.ts index 90c234ce..58fe685f 100644 --- a/packages/protojs/src/oracle/v1beta1/query.ts +++ b/packages/protojs/src/oracle/v1beta1/query.ts @@ -1,14 +1,19 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { AggregateExchangeRatePrevote, AggregateExchangeRateVote, ExchangeRateTuple, Params } from "./oracle"; +import { + AggregateExchangeRatePrevote, + AggregateExchangeRateVote, + Params, + ExchangeRateTuple, +} from "./oracle" +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "nibiru.oracle.v1beta1"; +export const protobufPackage = "nibiru.oracle.v1beta1" /** QueryExchangeRateRequest is the request type for the Query/ExchangeRate RPC method. */ export interface QueryExchangeRateRequest { /** pair defines the pair to query for. */ - pair: string; + pair: string } /** @@ -17,12 +22,11 @@ export interface QueryExchangeRateRequest { */ export interface QueryExchangeRateResponse { /** exchange_rate defines the exchange rate of assets voted by validators */ - exchangeRate: string; + exchangeRate: string } /** QueryExchangeRatesRequest is the request type for the Query/ExchangeRates RPC method. */ -export interface QueryExchangeRatesRequest { -} +export interface QueryExchangeRatesRequest {} /** * QueryExchangeRatesResponse is response type for the @@ -30,12 +34,11 @@ export interface QueryExchangeRatesRequest { */ export interface QueryExchangeRatesResponse { /** exchange_rates defines a list of the exchange rate for all whitelisted pairs. */ - exchangeRates: ExchangeRateTuple[]; + exchangeRates: ExchangeRateTuple[] } /** QueryActivesRequest is the request type for the Query/Actives RPC method. */ -export interface QueryActivesRequest { -} +export interface QueryActivesRequest {} /** * QueryActivesResponse is response type for the @@ -43,12 +46,11 @@ export interface QueryActivesRequest { */ export interface QueryActivesResponse { /** actives defines a list of the pair which oracle prices agreed upon. */ - actives: string[]; + actives: string[] } /** QueryVoteTargetsRequest is the request type for the Query/VoteTargets RPC method. */ -export interface QueryVoteTargetsRequest { -} +export interface QueryVoteTargetsRequest {} /** * QueryVoteTargetsResponse is response type for the @@ -59,13 +61,13 @@ export interface QueryVoteTargetsResponse { * vote_targets defines a list of the pairs in which everyone * should vote in the current vote period. */ - voteTargets: string[]; + voteTargets: string[] } /** QueryFeederDelegationRequest is the request type for the Query/FeederDelegation RPC method. */ export interface QueryFeederDelegationRequest { /** validator defines the validator address to query for. */ - validatorAddr: string; + validatorAddr: string } /** @@ -74,13 +76,13 @@ export interface QueryFeederDelegationRequest { */ export interface QueryFeederDelegationResponse { /** feeder_addr defines the feeder delegation of a validator */ - feederAddr: string; + feederAddr: string } /** QueryMissCounterRequest is the request type for the Query/MissCounter RPC method. */ export interface QueryMissCounterRequest { /** validator defines the validator address to query for. */ - validatorAddr: string; + validatorAddr: string } /** @@ -89,13 +91,13 @@ export interface QueryMissCounterRequest { */ export interface QueryMissCounterResponse { /** miss_counter defines the oracle miss counter of a validator */ - missCounter: Long; + missCounter: Long } /** QueryAggregatePrevoteRequest is the request type for the Query/AggregatePrevote RPC method. */ export interface QueryAggregatePrevoteRequest { /** validator defines the validator address to query for. */ - validatorAddr: string; + validatorAddr: string } /** @@ -104,12 +106,11 @@ export interface QueryAggregatePrevoteRequest { */ export interface QueryAggregatePrevoteResponse { /** aggregate_prevote defines oracle aggregate prevote submitted by a validator in the current vote period */ - aggregatePrevote?: AggregateExchangeRatePrevote; + aggregatePrevote?: AggregateExchangeRatePrevote } /** QueryAggregatePrevotesRequest is the request type for the Query/AggregatePrevotes RPC method. */ -export interface QueryAggregatePrevotesRequest { -} +export interface QueryAggregatePrevotesRequest {} /** * QueryAggregatePrevotesResponse is response type for the @@ -117,13 +118,13 @@ export interface QueryAggregatePrevotesRequest { */ export interface QueryAggregatePrevotesResponse { /** aggregate_prevotes defines all oracle aggregate prevotes submitted in the current vote period */ - aggregatePrevotes: AggregateExchangeRatePrevote[]; + aggregatePrevotes: AggregateExchangeRatePrevote[] } /** QueryAggregateVoteRequest is the request type for the Query/AggregateVote RPC method. */ export interface QueryAggregateVoteRequest { /** validator defines the validator address to query for. */ - validatorAddr: string; + validatorAddr: string } /** @@ -132,12 +133,11 @@ export interface QueryAggregateVoteRequest { */ export interface QueryAggregateVoteResponse { /** aggregate_vote defines oracle aggregate vote submitted by a validator in the current vote period */ - aggregateVote?: AggregateExchangeRateVote; + aggregateVote?: AggregateExchangeRateVote } /** QueryAggregateVotesRequest is the request type for the Query/AggregateVotes RPC method. */ -export interface QueryAggregateVotesRequest { -} +export interface QueryAggregateVotesRequest {} /** * QueryAggregateVotesResponse is response type for the @@ -145,180 +145,201 @@ export interface QueryAggregateVotesRequest { */ export interface QueryAggregateVotesResponse { /** aggregate_votes defines all oracle aggregate votes submitted in the current vote period */ - aggregateVotes: AggregateExchangeRateVote[]; + aggregateVotes: AggregateExchangeRateVote[] } /** QueryParamsRequest is the request type for the Query/Params RPC method. */ -export interface QueryParamsRequest { -} +export interface QueryParamsRequest {} /** QueryParamsResponse is the response type for the Query/Params RPC method. */ export interface QueryParamsResponse { /** params defines the parameters of the module. */ - params?: Params; + params?: Params } function createBaseQueryExchangeRateRequest(): QueryExchangeRateRequest { - return { pair: "" }; + return { pair: "" } } export const QueryExchangeRateRequest = { - encode(message: QueryExchangeRateRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryExchangeRateRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.pair !== "") { - writer.uint32(10).string(message.pair); + writer.uint32(10).string(message.pair) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryExchangeRateRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryExchangeRateRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryExchangeRateRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.pair = reader.string(); - break; + message.pair = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryExchangeRateRequest { - return { pair: isSet(object.pair) ? String(object.pair) : "" }; + return { + pair: isSet(object.pair) ? String(object.pair) : "", + } }, toJSON(message: QueryExchangeRateRequest): unknown { - const obj: any = {}; - message.pair !== undefined && (obj.pair = message.pair); - return obj; + const obj: any = {} + message.pair !== undefined && (obj.pair = message.pair) + return obj }, - fromPartial, I>>(object: I): QueryExchangeRateRequest { - const message = createBaseQueryExchangeRateRequest(); - message.pair = object.pair ?? ""; - return message; + fromPartial, I>>( + object: I, + ): QueryExchangeRateRequest { + const message = createBaseQueryExchangeRateRequest() + message.pair = object.pair ?? "" + return message }, -}; +} function createBaseQueryExchangeRateResponse(): QueryExchangeRateResponse { - return { exchangeRate: "" }; + return { exchangeRate: "" } } export const QueryExchangeRateResponse = { - encode(message: QueryExchangeRateResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryExchangeRateResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.exchangeRate !== "") { - writer.uint32(10).string(message.exchangeRate); + writer.uint32(10).string(message.exchangeRate) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryExchangeRateResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryExchangeRateResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryExchangeRateResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.exchangeRate = reader.string(); - break; + message.exchangeRate = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryExchangeRateResponse { - return { exchangeRate: isSet(object.exchangeRate) ? String(object.exchangeRate) : "" }; + return { + exchangeRate: isSet(object.exchangeRate) ? String(object.exchangeRate) : "", + } }, toJSON(message: QueryExchangeRateResponse): unknown { - const obj: any = {}; - message.exchangeRate !== undefined && (obj.exchangeRate = message.exchangeRate); - return obj; + const obj: any = {} + message.exchangeRate !== undefined && (obj.exchangeRate = message.exchangeRate) + return obj }, - fromPartial, I>>(object: I): QueryExchangeRateResponse { - const message = createBaseQueryExchangeRateResponse(); - message.exchangeRate = object.exchangeRate ?? ""; - return message; + fromPartial, I>>( + object: I, + ): QueryExchangeRateResponse { + const message = createBaseQueryExchangeRateResponse() + message.exchangeRate = object.exchangeRate ?? "" + return message }, -}; +} function createBaseQueryExchangeRatesRequest(): QueryExchangeRatesRequest { - return {}; + return {} } export const QueryExchangeRatesRequest = { - encode(_: QueryExchangeRatesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; + encode( + _: QueryExchangeRatesRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryExchangeRatesRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryExchangeRatesRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryExchangeRatesRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(_: any): QueryExchangeRatesRequest { - return {}; + return {} }, toJSON(_: QueryExchangeRatesRequest): unknown { - const obj: any = {}; - return obj; + const obj: any = {} + return obj }, - fromPartial, I>>(_: I): QueryExchangeRatesRequest { - const message = createBaseQueryExchangeRatesRequest(); - return message; + fromPartial, I>>( + _: I, + ): QueryExchangeRatesRequest { + const message = createBaseQueryExchangeRatesRequest() + return message }, -}; +} function createBaseQueryExchangeRatesResponse(): QueryExchangeRatesResponse { - return { exchangeRates: [] }; + return { exchangeRates: [] } } export const QueryExchangeRatesResponse = { - encode(message: QueryExchangeRatesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryExchangeRatesResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { for (const v of message.exchangeRates) { - ExchangeRateTuple.encode(v!, writer.uint32(10).fork()).ldelim(); + ExchangeRateTuple.encode(v!, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryExchangeRatesResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryExchangeRatesResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryExchangeRatesResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.exchangeRates.push(ExchangeRateTuple.decode(reader, reader.uint32())); - break; + message.exchangeRates.push(ExchangeRateTuple.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryExchangeRatesResponse { @@ -326,473 +347,561 @@ export const QueryExchangeRatesResponse = { exchangeRates: Array.isArray(object?.exchangeRates) ? object.exchangeRates.map((e: any) => ExchangeRateTuple.fromJSON(e)) : [], - }; + } }, toJSON(message: QueryExchangeRatesResponse): unknown { - const obj: any = {}; + const obj: any = {} if (message.exchangeRates) { - obj.exchangeRates = message.exchangeRates.map((e) => e ? ExchangeRateTuple.toJSON(e) : undefined); + obj.exchangeRates = message.exchangeRates.map((e) => + e ? ExchangeRateTuple.toJSON(e) : undefined, + ) } else { - obj.exchangeRates = []; + obj.exchangeRates = [] } - return obj; + return obj }, - fromPartial, I>>(object: I): QueryExchangeRatesResponse { - const message = createBaseQueryExchangeRatesResponse(); - message.exchangeRates = object.exchangeRates?.map((e) => ExchangeRateTuple.fromPartial(e)) || []; - return message; + fromPartial, I>>( + object: I, + ): QueryExchangeRatesResponse { + const message = createBaseQueryExchangeRatesResponse() + message.exchangeRates = + object.exchangeRates?.map((e) => ExchangeRateTuple.fromPartial(e)) || [] + return message }, -}; +} function createBaseQueryActivesRequest(): QueryActivesRequest { - return {}; + return {} } export const QueryActivesRequest = { encode(_: QueryActivesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryActivesRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryActivesRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryActivesRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(_: any): QueryActivesRequest { - return {}; + return {} }, toJSON(_: QueryActivesRequest): unknown { - const obj: any = {}; - return obj; + const obj: any = {} + return obj }, - fromPartial, I>>(_: I): QueryActivesRequest { - const message = createBaseQueryActivesRequest(); - return message; + fromPartial, I>>( + _: I, + ): QueryActivesRequest { + const message = createBaseQueryActivesRequest() + return message }, -}; +} function createBaseQueryActivesResponse(): QueryActivesResponse { - return { actives: [] }; + return { actives: [] } } export const QueryActivesResponse = { - encode(message: QueryActivesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryActivesResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { for (const v of message.actives) { - writer.uint32(10).string(v!); + writer.uint32(10).string(v!) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryActivesResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryActivesResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryActivesResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.actives.push(reader.string()); - break; + message.actives.push(reader.string()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryActivesResponse { - return { actives: Array.isArray(object?.actives) ? object.actives.map((e: any) => String(e)) : [] }; + return { + actives: Array.isArray(object?.actives) + ? object.actives.map((e: any) => String(e)) + : [], + } }, toJSON(message: QueryActivesResponse): unknown { - const obj: any = {}; + const obj: any = {} if (message.actives) { - obj.actives = message.actives.map((e) => e); + obj.actives = message.actives.map((e) => e) } else { - obj.actives = []; + obj.actives = [] } - return obj; + return obj }, - fromPartial, I>>(object: I): QueryActivesResponse { - const message = createBaseQueryActivesResponse(); - message.actives = object.actives?.map((e) => e) || []; - return message; + fromPartial, I>>( + object: I, + ): QueryActivesResponse { + const message = createBaseQueryActivesResponse() + message.actives = object.actives?.map((e) => e) || [] + return message }, -}; +} function createBaseQueryVoteTargetsRequest(): QueryVoteTargetsRequest { - return {}; + return {} } export const QueryVoteTargetsRequest = { - encode(_: QueryVoteTargetsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; + encode( + _: QueryVoteTargetsRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryVoteTargetsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryVoteTargetsRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryVoteTargetsRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(_: any): QueryVoteTargetsRequest { - return {}; + return {} }, toJSON(_: QueryVoteTargetsRequest): unknown { - const obj: any = {}; - return obj; + const obj: any = {} + return obj }, - fromPartial, I>>(_: I): QueryVoteTargetsRequest { - const message = createBaseQueryVoteTargetsRequest(); - return message; + fromPartial, I>>( + _: I, + ): QueryVoteTargetsRequest { + const message = createBaseQueryVoteTargetsRequest() + return message }, -}; +} function createBaseQueryVoteTargetsResponse(): QueryVoteTargetsResponse { - return { voteTargets: [] }; + return { voteTargets: [] } } export const QueryVoteTargetsResponse = { - encode(message: QueryVoteTargetsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryVoteTargetsResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { for (const v of message.voteTargets) { - writer.uint32(10).string(v!); + writer.uint32(10).string(v!) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryVoteTargetsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryVoteTargetsResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryVoteTargetsResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.voteTargets.push(reader.string()); - break; + message.voteTargets.push(reader.string()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryVoteTargetsResponse { - return { voteTargets: Array.isArray(object?.voteTargets) ? object.voteTargets.map((e: any) => String(e)) : [] }; + return { + voteTargets: Array.isArray(object?.voteTargets) + ? object.voteTargets.map((e: any) => String(e)) + : [], + } }, toJSON(message: QueryVoteTargetsResponse): unknown { - const obj: any = {}; + const obj: any = {} if (message.voteTargets) { - obj.voteTargets = message.voteTargets.map((e) => e); + obj.voteTargets = message.voteTargets.map((e) => e) } else { - obj.voteTargets = []; + obj.voteTargets = [] } - return obj; + return obj }, - fromPartial, I>>(object: I): QueryVoteTargetsResponse { - const message = createBaseQueryVoteTargetsResponse(); - message.voteTargets = object.voteTargets?.map((e) => e) || []; - return message; + fromPartial, I>>( + object: I, + ): QueryVoteTargetsResponse { + const message = createBaseQueryVoteTargetsResponse() + message.voteTargets = object.voteTargets?.map((e) => e) || [] + return message }, -}; +} function createBaseQueryFeederDelegationRequest(): QueryFeederDelegationRequest { - return { validatorAddr: "" }; + return { validatorAddr: "" } } export const QueryFeederDelegationRequest = { - encode(message: QueryFeederDelegationRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryFeederDelegationRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.validatorAddr !== "") { - writer.uint32(10).string(message.validatorAddr); + writer.uint32(10).string(message.validatorAddr) } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryFeederDelegationRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryFeederDelegationRequest(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryFeederDelegationRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryFeederDelegationRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.validatorAddr = reader.string(); - break; + message.validatorAddr = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryFeederDelegationRequest { - return { validatorAddr: isSet(object.validatorAddr) ? String(object.validatorAddr) : "" }; + return { + validatorAddr: isSet(object.validatorAddr) ? String(object.validatorAddr) : "", + } }, toJSON(message: QueryFeederDelegationRequest): unknown { - const obj: any = {}; - message.validatorAddr !== undefined && (obj.validatorAddr = message.validatorAddr); - return obj; + const obj: any = {} + message.validatorAddr !== undefined && (obj.validatorAddr = message.validatorAddr) + return obj }, - fromPartial, I>>(object: I): QueryFeederDelegationRequest { - const message = createBaseQueryFeederDelegationRequest(); - message.validatorAddr = object.validatorAddr ?? ""; - return message; + fromPartial, I>>( + object: I, + ): QueryFeederDelegationRequest { + const message = createBaseQueryFeederDelegationRequest() + message.validatorAddr = object.validatorAddr ?? "" + return message }, -}; +} function createBaseQueryFeederDelegationResponse(): QueryFeederDelegationResponse { - return { feederAddr: "" }; + return { feederAddr: "" } } export const QueryFeederDelegationResponse = { - encode(message: QueryFeederDelegationResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryFeederDelegationResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.feederAddr !== "") { - writer.uint32(10).string(message.feederAddr); + writer.uint32(10).string(message.feederAddr) } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryFeederDelegationResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryFeederDelegationResponse(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryFeederDelegationResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryFeederDelegationResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.feederAddr = reader.string(); - break; + message.feederAddr = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryFeederDelegationResponse { - return { feederAddr: isSet(object.feederAddr) ? String(object.feederAddr) : "" }; + return { + feederAddr: isSet(object.feederAddr) ? String(object.feederAddr) : "", + } }, toJSON(message: QueryFeederDelegationResponse): unknown { - const obj: any = {}; - message.feederAddr !== undefined && (obj.feederAddr = message.feederAddr); - return obj; + const obj: any = {} + message.feederAddr !== undefined && (obj.feederAddr = message.feederAddr) + return obj }, fromPartial, I>>( object: I, ): QueryFeederDelegationResponse { - const message = createBaseQueryFeederDelegationResponse(); - message.feederAddr = object.feederAddr ?? ""; - return message; + const message = createBaseQueryFeederDelegationResponse() + message.feederAddr = object.feederAddr ?? "" + return message }, -}; +} function createBaseQueryMissCounterRequest(): QueryMissCounterRequest { - return { validatorAddr: "" }; + return { validatorAddr: "" } } export const QueryMissCounterRequest = { - encode(message: QueryMissCounterRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryMissCounterRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.validatorAddr !== "") { - writer.uint32(10).string(message.validatorAddr); + writer.uint32(10).string(message.validatorAddr) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryMissCounterRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryMissCounterRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryMissCounterRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.validatorAddr = reader.string(); - break; + message.validatorAddr = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryMissCounterRequest { - return { validatorAddr: isSet(object.validatorAddr) ? String(object.validatorAddr) : "" }; + return { + validatorAddr: isSet(object.validatorAddr) ? String(object.validatorAddr) : "", + } }, toJSON(message: QueryMissCounterRequest): unknown { - const obj: any = {}; - message.validatorAddr !== undefined && (obj.validatorAddr = message.validatorAddr); - return obj; + const obj: any = {} + message.validatorAddr !== undefined && (obj.validatorAddr = message.validatorAddr) + return obj }, - fromPartial, I>>(object: I): QueryMissCounterRequest { - const message = createBaseQueryMissCounterRequest(); - message.validatorAddr = object.validatorAddr ?? ""; - return message; + fromPartial, I>>( + object: I, + ): QueryMissCounterRequest { + const message = createBaseQueryMissCounterRequest() + message.validatorAddr = object.validatorAddr ?? "" + return message }, -}; +} function createBaseQueryMissCounterResponse(): QueryMissCounterResponse { - return { missCounter: Long.UZERO }; + return { missCounter: Long.UZERO } } export const QueryMissCounterResponse = { - encode(message: QueryMissCounterResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryMissCounterResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (!message.missCounter.isZero()) { - writer.uint32(8).uint64(message.missCounter); + writer.uint32(8).uint64(message.missCounter) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryMissCounterResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryMissCounterResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryMissCounterResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.missCounter = reader.uint64() as Long; - break; + message.missCounter = reader.uint64() as Long + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryMissCounterResponse { - return { missCounter: isSet(object.missCounter) ? Long.fromValue(object.missCounter) : Long.UZERO }; + return { + missCounter: isSet(object.missCounter) + ? Long.fromValue(object.missCounter) + : Long.UZERO, + } }, toJSON(message: QueryMissCounterResponse): unknown { - const obj: any = {}; - message.missCounter !== undefined && (obj.missCounter = (message.missCounter || Long.UZERO).toString()); - return obj; + const obj: any = {} + message.missCounter !== undefined && + (obj.missCounter = (message.missCounter || Long.UZERO).toString()) + return obj }, - fromPartial, I>>(object: I): QueryMissCounterResponse { - const message = createBaseQueryMissCounterResponse(); - message.missCounter = (object.missCounter !== undefined && object.missCounter !== null) - ? Long.fromValue(object.missCounter) - : Long.UZERO; - return message; + fromPartial, I>>( + object: I, + ): QueryMissCounterResponse { + const message = createBaseQueryMissCounterResponse() + message.missCounter = + object.missCounter !== undefined && object.missCounter !== null + ? Long.fromValue(object.missCounter) + : Long.UZERO + return message }, -}; +} function createBaseQueryAggregatePrevoteRequest(): QueryAggregatePrevoteRequest { - return { validatorAddr: "" }; + return { validatorAddr: "" } } export const QueryAggregatePrevoteRequest = { - encode(message: QueryAggregatePrevoteRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryAggregatePrevoteRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.validatorAddr !== "") { - writer.uint32(10).string(message.validatorAddr); + writer.uint32(10).string(message.validatorAddr) } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAggregatePrevoteRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryAggregatePrevoteRequest(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryAggregatePrevoteRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryAggregatePrevoteRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.validatorAddr = reader.string(); - break; + message.validatorAddr = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryAggregatePrevoteRequest { - return { validatorAddr: isSet(object.validatorAddr) ? String(object.validatorAddr) : "" }; + return { + validatorAddr: isSet(object.validatorAddr) ? String(object.validatorAddr) : "", + } }, toJSON(message: QueryAggregatePrevoteRequest): unknown { - const obj: any = {}; - message.validatorAddr !== undefined && (obj.validatorAddr = message.validatorAddr); - return obj; + const obj: any = {} + message.validatorAddr !== undefined && (obj.validatorAddr = message.validatorAddr) + return obj }, - fromPartial, I>>(object: I): QueryAggregatePrevoteRequest { - const message = createBaseQueryAggregatePrevoteRequest(); - message.validatorAddr = object.validatorAddr ?? ""; - return message; + fromPartial, I>>( + object: I, + ): QueryAggregatePrevoteRequest { + const message = createBaseQueryAggregatePrevoteRequest() + message.validatorAddr = object.validatorAddr ?? "" + return message }, -}; +} function createBaseQueryAggregatePrevoteResponse(): QueryAggregatePrevoteResponse { - return { aggregatePrevote: undefined }; + return { aggregatePrevote: undefined } } export const QueryAggregatePrevoteResponse = { - encode(message: QueryAggregatePrevoteResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryAggregatePrevoteResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.aggregatePrevote !== undefined) { - AggregateExchangeRatePrevote.encode(message.aggregatePrevote, writer.uint32(10).fork()).ldelim(); + AggregateExchangeRatePrevote.encode( + message.aggregatePrevote, + writer.uint32(10).fork(), + ).ldelim() } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAggregatePrevoteResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryAggregatePrevoteResponse(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryAggregatePrevoteResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryAggregatePrevoteResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.aggregatePrevote = AggregateExchangeRatePrevote.decode(reader, reader.uint32()); - break; + message.aggregatePrevote = AggregateExchangeRatePrevote.decode( + reader, + reader.uint32(), + ) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryAggregatePrevoteResponse { @@ -800,292 +909,348 @@ export const QueryAggregatePrevoteResponse = { aggregatePrevote: isSet(object.aggregatePrevote) ? AggregateExchangeRatePrevote.fromJSON(object.aggregatePrevote) : undefined, - }; + } }, toJSON(message: QueryAggregatePrevoteResponse): unknown { - const obj: any = {}; - message.aggregatePrevote !== undefined && (obj.aggregatePrevote = message.aggregatePrevote - ? AggregateExchangeRatePrevote.toJSON(message.aggregatePrevote) - : undefined); - return obj; + const obj: any = {} + message.aggregatePrevote !== undefined && + (obj.aggregatePrevote = message.aggregatePrevote + ? AggregateExchangeRatePrevote.toJSON(message.aggregatePrevote) + : undefined) + return obj }, fromPartial, I>>( object: I, ): QueryAggregatePrevoteResponse { - const message = createBaseQueryAggregatePrevoteResponse(); - message.aggregatePrevote = (object.aggregatePrevote !== undefined && object.aggregatePrevote !== null) - ? AggregateExchangeRatePrevote.fromPartial(object.aggregatePrevote) - : undefined; - return message; + const message = createBaseQueryAggregatePrevoteResponse() + message.aggregatePrevote = + object.aggregatePrevote !== undefined && object.aggregatePrevote !== null + ? AggregateExchangeRatePrevote.fromPartial(object.aggregatePrevote) + : undefined + return message }, -}; +} function createBaseQueryAggregatePrevotesRequest(): QueryAggregatePrevotesRequest { - return {}; + return {} } export const QueryAggregatePrevotesRequest = { - encode(_: QueryAggregatePrevotesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAggregatePrevotesRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryAggregatePrevotesRequest(); + encode( + _: QueryAggregatePrevotesRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryAggregatePrevotesRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryAggregatePrevotesRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(_: any): QueryAggregatePrevotesRequest { - return {}; + return {} }, toJSON(_: QueryAggregatePrevotesRequest): unknown { - const obj: any = {}; - return obj; + const obj: any = {} + return obj }, - fromPartial, I>>(_: I): QueryAggregatePrevotesRequest { - const message = createBaseQueryAggregatePrevotesRequest(); - return message; + fromPartial, I>>( + _: I, + ): QueryAggregatePrevotesRequest { + const message = createBaseQueryAggregatePrevotesRequest() + return message }, -}; +} function createBaseQueryAggregatePrevotesResponse(): QueryAggregatePrevotesResponse { - return { aggregatePrevotes: [] }; + return { aggregatePrevotes: [] } } export const QueryAggregatePrevotesResponse = { - encode(message: QueryAggregatePrevotesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryAggregatePrevotesResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { for (const v of message.aggregatePrevotes) { - AggregateExchangeRatePrevote.encode(v!, writer.uint32(10).fork()).ldelim(); + AggregateExchangeRatePrevote.encode(v!, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAggregatePrevotesResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryAggregatePrevotesResponse(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryAggregatePrevotesResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryAggregatePrevotesResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.aggregatePrevotes.push(AggregateExchangeRatePrevote.decode(reader, reader.uint32())); - break; + message.aggregatePrevotes.push( + AggregateExchangeRatePrevote.decode(reader, reader.uint32()), + ) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryAggregatePrevotesResponse { return { aggregatePrevotes: Array.isArray(object?.aggregatePrevotes) - ? object.aggregatePrevotes.map((e: any) => AggregateExchangeRatePrevote.fromJSON(e)) + ? object.aggregatePrevotes.map((e: any) => + AggregateExchangeRatePrevote.fromJSON(e), + ) : [], - }; + } }, toJSON(message: QueryAggregatePrevotesResponse): unknown { - const obj: any = {}; + const obj: any = {} if (message.aggregatePrevotes) { obj.aggregatePrevotes = message.aggregatePrevotes.map((e) => - e ? AggregateExchangeRatePrevote.toJSON(e) : undefined - ); + e ? AggregateExchangeRatePrevote.toJSON(e) : undefined, + ) } else { - obj.aggregatePrevotes = []; + obj.aggregatePrevotes = [] } - return obj; + return obj }, fromPartial, I>>( object: I, ): QueryAggregatePrevotesResponse { - const message = createBaseQueryAggregatePrevotesResponse(); - message.aggregatePrevotes = object.aggregatePrevotes?.map((e) => AggregateExchangeRatePrevote.fromPartial(e)) || []; - return message; + const message = createBaseQueryAggregatePrevotesResponse() + message.aggregatePrevotes = + object.aggregatePrevotes?.map((e) => + AggregateExchangeRatePrevote.fromPartial(e), + ) || [] + return message }, -}; +} function createBaseQueryAggregateVoteRequest(): QueryAggregateVoteRequest { - return { validatorAddr: "" }; + return { validatorAddr: "" } } export const QueryAggregateVoteRequest = { - encode(message: QueryAggregateVoteRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryAggregateVoteRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.validatorAddr !== "") { - writer.uint32(10).string(message.validatorAddr); + writer.uint32(10).string(message.validatorAddr) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryAggregateVoteRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryAggregateVoteRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryAggregateVoteRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.validatorAddr = reader.string(); - break; + message.validatorAddr = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryAggregateVoteRequest { - return { validatorAddr: isSet(object.validatorAddr) ? String(object.validatorAddr) : "" }; + return { + validatorAddr: isSet(object.validatorAddr) ? String(object.validatorAddr) : "", + } }, toJSON(message: QueryAggregateVoteRequest): unknown { - const obj: any = {}; - message.validatorAddr !== undefined && (obj.validatorAddr = message.validatorAddr); - return obj; + const obj: any = {} + message.validatorAddr !== undefined && (obj.validatorAddr = message.validatorAddr) + return obj }, - fromPartial, I>>(object: I): QueryAggregateVoteRequest { - const message = createBaseQueryAggregateVoteRequest(); - message.validatorAddr = object.validatorAddr ?? ""; - return message; + fromPartial, I>>( + object: I, + ): QueryAggregateVoteRequest { + const message = createBaseQueryAggregateVoteRequest() + message.validatorAddr = object.validatorAddr ?? "" + return message }, -}; +} function createBaseQueryAggregateVoteResponse(): QueryAggregateVoteResponse { - return { aggregateVote: undefined }; + return { aggregateVote: undefined } } export const QueryAggregateVoteResponse = { - encode(message: QueryAggregateVoteResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryAggregateVoteResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.aggregateVote !== undefined) { - AggregateExchangeRateVote.encode(message.aggregateVote, writer.uint32(10).fork()).ldelim(); + AggregateExchangeRateVote.encode( + message.aggregateVote, + writer.uint32(10).fork(), + ).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryAggregateVoteResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryAggregateVoteResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryAggregateVoteResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.aggregateVote = AggregateExchangeRateVote.decode(reader, reader.uint32()); - break; + message.aggregateVote = AggregateExchangeRateVote.decode( + reader, + reader.uint32(), + ) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryAggregateVoteResponse { return { - aggregateVote: isSet(object.aggregateVote) ? AggregateExchangeRateVote.fromJSON(object.aggregateVote) : undefined, - }; + aggregateVote: isSet(object.aggregateVote) + ? AggregateExchangeRateVote.fromJSON(object.aggregateVote) + : undefined, + } }, toJSON(message: QueryAggregateVoteResponse): unknown { - const obj: any = {}; + const obj: any = {} message.aggregateVote !== undefined && - (obj.aggregateVote = message.aggregateVote ? AggregateExchangeRateVote.toJSON(message.aggregateVote) : undefined); - return obj; + (obj.aggregateVote = message.aggregateVote + ? AggregateExchangeRateVote.toJSON(message.aggregateVote) + : undefined) + return obj }, - fromPartial, I>>(object: I): QueryAggregateVoteResponse { - const message = createBaseQueryAggregateVoteResponse(); - message.aggregateVote = (object.aggregateVote !== undefined && object.aggregateVote !== null) - ? AggregateExchangeRateVote.fromPartial(object.aggregateVote) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): QueryAggregateVoteResponse { + const message = createBaseQueryAggregateVoteResponse() + message.aggregateVote = + object.aggregateVote !== undefined && object.aggregateVote !== null + ? AggregateExchangeRateVote.fromPartial(object.aggregateVote) + : undefined + return message }, -}; +} function createBaseQueryAggregateVotesRequest(): QueryAggregateVotesRequest { - return {}; + return {} } export const QueryAggregateVotesRequest = { - encode(_: QueryAggregateVotesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; + encode( + _: QueryAggregateVotesRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryAggregateVotesRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryAggregateVotesRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryAggregateVotesRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(_: any): QueryAggregateVotesRequest { - return {}; + return {} }, toJSON(_: QueryAggregateVotesRequest): unknown { - const obj: any = {}; - return obj; + const obj: any = {} + return obj }, - fromPartial, I>>(_: I): QueryAggregateVotesRequest { - const message = createBaseQueryAggregateVotesRequest(); - return message; + fromPartial, I>>( + _: I, + ): QueryAggregateVotesRequest { + const message = createBaseQueryAggregateVotesRequest() + return message }, -}; +} function createBaseQueryAggregateVotesResponse(): QueryAggregateVotesResponse { - return { aggregateVotes: [] }; + return { aggregateVotes: [] } } export const QueryAggregateVotesResponse = { - encode(message: QueryAggregateVotesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryAggregateVotesResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { for (const v of message.aggregateVotes) { - AggregateExchangeRateVote.encode(v!, writer.uint32(10).fork()).ldelim(); + AggregateExchangeRateVote.encode(v!, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryAggregateVotesResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryAggregateVotesResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryAggregateVotesResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.aggregateVotes.push(AggregateExchangeRateVote.decode(reader, reader.uint32())); - break; + message.aggregateVotes.push( + AggregateExchangeRateVote.decode(reader, reader.uint32()), + ) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryAggregateVotesResponse { @@ -1093,253 +1258,351 @@ export const QueryAggregateVotesResponse = { aggregateVotes: Array.isArray(object?.aggregateVotes) ? object.aggregateVotes.map((e: any) => AggregateExchangeRateVote.fromJSON(e)) : [], - }; + } }, toJSON(message: QueryAggregateVotesResponse): unknown { - const obj: any = {}; + const obj: any = {} if (message.aggregateVotes) { - obj.aggregateVotes = message.aggregateVotes.map((e) => e ? AggregateExchangeRateVote.toJSON(e) : undefined); + obj.aggregateVotes = message.aggregateVotes.map((e) => + e ? AggregateExchangeRateVote.toJSON(e) : undefined, + ) } else { - obj.aggregateVotes = []; + obj.aggregateVotes = [] } - return obj; + return obj }, - fromPartial, I>>(object: I): QueryAggregateVotesResponse { - const message = createBaseQueryAggregateVotesResponse(); - message.aggregateVotes = object.aggregateVotes?.map((e) => AggregateExchangeRateVote.fromPartial(e)) || []; - return message; + fromPartial, I>>( + object: I, + ): QueryAggregateVotesResponse { + const message = createBaseQueryAggregateVotesResponse() + message.aggregateVotes = + object.aggregateVotes?.map((e) => AggregateExchangeRateVote.fromPartial(e)) || [] + return message }, -}; +} function createBaseQueryParamsRequest(): QueryParamsRequest { - return {}; + return {} } export const QueryParamsRequest = { encode(_: QueryParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryParamsRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryParamsRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(_: any): QueryParamsRequest { - return {}; + return {} }, toJSON(_: QueryParamsRequest): unknown { - const obj: any = {}; - return obj; + const obj: any = {} + return obj }, - fromPartial, I>>(_: I): QueryParamsRequest { - const message = createBaseQueryParamsRequest(); - return message; + fromPartial, I>>( + _: I, + ): QueryParamsRequest { + const message = createBaseQueryParamsRequest() + return message }, -}; +} function createBaseQueryParamsResponse(): QueryParamsResponse { - return { params: undefined }; + return { params: undefined } } export const QueryParamsResponse = { - encode(message: QueryParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryParamsResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.params !== undefined) { - Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + Params.encode(message.params, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryParamsResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryParamsResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.params = Params.decode(reader, reader.uint32()); - break; + message.params = Params.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryParamsResponse { - return { params: isSet(object.params) ? Params.fromJSON(object.params) : undefined }; + return { + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined, + } }, toJSON(message: QueryParamsResponse): unknown { - const obj: any = {}; - message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); - return obj; + const obj: any = {} + message.params !== undefined && + (obj.params = message.params ? Params.toJSON(message.params) : undefined) + return obj }, - fromPartial, I>>(object: I): QueryParamsResponse { - const message = createBaseQueryParamsResponse(); - message.params = (object.params !== undefined && object.params !== null) - ? Params.fromPartial(object.params) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): QueryParamsResponse { + const message = createBaseQueryParamsResponse() + message.params = + object.params !== undefined && object.params !== null + ? Params.fromPartial(object.params) + : undefined + return message }, -}; +} /** Query defines the gRPC querier service. */ export interface Query { /** ExchangeRate returns exchange rate of a pair */ - ExchangeRate(request: QueryExchangeRateRequest): Promise; + ExchangeRate(request: QueryExchangeRateRequest): Promise /** ExchangeRateTwap returns twap exchange rate of a pair */ - ExchangeRateTwap(request: QueryExchangeRateRequest): Promise; + ExchangeRateTwap( + request: QueryExchangeRateRequest, + ): Promise /** ExchangeRates returns exchange rates of all pairs */ - ExchangeRates(request: QueryExchangeRatesRequest): Promise; + ExchangeRates(request: QueryExchangeRatesRequest): Promise /** Actives returns all active pairs */ - Actives(request: QueryActivesRequest): Promise; + Actives(request: QueryActivesRequest): Promise /** VoteTargets returns all vote target for pairs */ - VoteTargets(request: QueryVoteTargetsRequest): Promise; + VoteTargets(request: QueryVoteTargetsRequest): Promise /** FeederDelegation returns feeder delegation of a validator */ - FeederDelegation(request: QueryFeederDelegationRequest): Promise; + FeederDelegation( + request: QueryFeederDelegationRequest, + ): Promise /** MissCounter returns oracle miss counter of a validator */ - MissCounter(request: QueryMissCounterRequest): Promise; + MissCounter(request: QueryMissCounterRequest): Promise /** AggregatePrevote returns an aggregate prevote of a validator */ - AggregatePrevote(request: QueryAggregatePrevoteRequest): Promise; + AggregatePrevote( + request: QueryAggregatePrevoteRequest, + ): Promise /** AggregatePrevotes returns aggregate prevotes of all validators */ - AggregatePrevotes(request: QueryAggregatePrevotesRequest): Promise; + AggregatePrevotes( + request: QueryAggregatePrevotesRequest, + ): Promise /** AggregateVote returns an aggregate vote of a validator */ - AggregateVote(request: QueryAggregateVoteRequest): Promise; + AggregateVote(request: QueryAggregateVoteRequest): Promise /** AggregateVotes returns aggregate votes of all validators */ - AggregateVotes(request: QueryAggregateVotesRequest): Promise; + AggregateVotes( + request: QueryAggregateVotesRequest, + ): Promise /** Params queries all parameters. */ - Params(request: QueryParamsRequest): Promise; + Params(request: QueryParamsRequest): Promise } export class QueryClientImpl implements Query { - private readonly rpc: Rpc; + private readonly rpc: Rpc constructor(rpc: Rpc) { - this.rpc = rpc; - this.ExchangeRate = this.ExchangeRate.bind(this); - this.ExchangeRateTwap = this.ExchangeRateTwap.bind(this); - this.ExchangeRates = this.ExchangeRates.bind(this); - this.Actives = this.Actives.bind(this); - this.VoteTargets = this.VoteTargets.bind(this); - this.FeederDelegation = this.FeederDelegation.bind(this); - this.MissCounter = this.MissCounter.bind(this); - this.AggregatePrevote = this.AggregatePrevote.bind(this); - this.AggregatePrevotes = this.AggregatePrevotes.bind(this); - this.AggregateVote = this.AggregateVote.bind(this); - this.AggregateVotes = this.AggregateVotes.bind(this); - this.Params = this.Params.bind(this); + this.rpc = rpc + this.ExchangeRate = this.ExchangeRate.bind(this) + this.ExchangeRateTwap = this.ExchangeRateTwap.bind(this) + this.ExchangeRates = this.ExchangeRates.bind(this) + this.Actives = this.Actives.bind(this) + this.VoteTargets = this.VoteTargets.bind(this) + this.FeederDelegation = this.FeederDelegation.bind(this) + this.MissCounter = this.MissCounter.bind(this) + this.AggregatePrevote = this.AggregatePrevote.bind(this) + this.AggregatePrevotes = this.AggregatePrevotes.bind(this) + this.AggregateVote = this.AggregateVote.bind(this) + this.AggregateVotes = this.AggregateVotes.bind(this) + this.Params = this.Params.bind(this) } ExchangeRate(request: QueryExchangeRateRequest): Promise { - const data = QueryExchangeRateRequest.encode(request).finish(); - const promise = this.rpc.request("nibiru.oracle.v1beta1.Query", "ExchangeRate", data); - return promise.then((data) => QueryExchangeRateResponse.decode(new _m0.Reader(data))); + const data = QueryExchangeRateRequest.encode(request).finish() + const promise = this.rpc.request( + "nibiru.oracle.v1beta1.Query", + "ExchangeRate", + data, + ) + return promise.then((data) => + QueryExchangeRateResponse.decode(new _m0.Reader(data)), + ) } - ExchangeRateTwap(request: QueryExchangeRateRequest): Promise { - const data = QueryExchangeRateRequest.encode(request).finish(); - const promise = this.rpc.request("nibiru.oracle.v1beta1.Query", "ExchangeRateTwap", data); - return promise.then((data) => QueryExchangeRateResponse.decode(new _m0.Reader(data))); + ExchangeRateTwap( + request: QueryExchangeRateRequest, + ): Promise { + const data = QueryExchangeRateRequest.encode(request).finish() + const promise = this.rpc.request( + "nibiru.oracle.v1beta1.Query", + "ExchangeRateTwap", + data, + ) + return promise.then((data) => + QueryExchangeRateResponse.decode(new _m0.Reader(data)), + ) } - ExchangeRates(request: QueryExchangeRatesRequest): Promise { - const data = QueryExchangeRatesRequest.encode(request).finish(); - const promise = this.rpc.request("nibiru.oracle.v1beta1.Query", "ExchangeRates", data); - return promise.then((data) => QueryExchangeRatesResponse.decode(new _m0.Reader(data))); + ExchangeRates( + request: QueryExchangeRatesRequest, + ): Promise { + const data = QueryExchangeRatesRequest.encode(request).finish() + const promise = this.rpc.request( + "nibiru.oracle.v1beta1.Query", + "ExchangeRates", + data, + ) + return promise.then((data) => + QueryExchangeRatesResponse.decode(new _m0.Reader(data)), + ) } Actives(request: QueryActivesRequest): Promise { - const data = QueryActivesRequest.encode(request).finish(); - const promise = this.rpc.request("nibiru.oracle.v1beta1.Query", "Actives", data); - return promise.then((data) => QueryActivesResponse.decode(new _m0.Reader(data))); + const data = QueryActivesRequest.encode(request).finish() + const promise = this.rpc.request("nibiru.oracle.v1beta1.Query", "Actives", data) + return promise.then((data) => QueryActivesResponse.decode(new _m0.Reader(data))) } VoteTargets(request: QueryVoteTargetsRequest): Promise { - const data = QueryVoteTargetsRequest.encode(request).finish(); - const promise = this.rpc.request("nibiru.oracle.v1beta1.Query", "VoteTargets", data); - return promise.then((data) => QueryVoteTargetsResponse.decode(new _m0.Reader(data))); + const data = QueryVoteTargetsRequest.encode(request).finish() + const promise = this.rpc.request("nibiru.oracle.v1beta1.Query", "VoteTargets", data) + return promise.then((data) => QueryVoteTargetsResponse.decode(new _m0.Reader(data))) } - FeederDelegation(request: QueryFeederDelegationRequest): Promise { - const data = QueryFeederDelegationRequest.encode(request).finish(); - const promise = this.rpc.request("nibiru.oracle.v1beta1.Query", "FeederDelegation", data); - return promise.then((data) => QueryFeederDelegationResponse.decode(new _m0.Reader(data))); + FeederDelegation( + request: QueryFeederDelegationRequest, + ): Promise { + const data = QueryFeederDelegationRequest.encode(request).finish() + const promise = this.rpc.request( + "nibiru.oracle.v1beta1.Query", + "FeederDelegation", + data, + ) + return promise.then((data) => + QueryFeederDelegationResponse.decode(new _m0.Reader(data)), + ) } MissCounter(request: QueryMissCounterRequest): Promise { - const data = QueryMissCounterRequest.encode(request).finish(); - const promise = this.rpc.request("nibiru.oracle.v1beta1.Query", "MissCounter", data); - return promise.then((data) => QueryMissCounterResponse.decode(new _m0.Reader(data))); + const data = QueryMissCounterRequest.encode(request).finish() + const promise = this.rpc.request("nibiru.oracle.v1beta1.Query", "MissCounter", data) + return promise.then((data) => QueryMissCounterResponse.decode(new _m0.Reader(data))) } - AggregatePrevote(request: QueryAggregatePrevoteRequest): Promise { - const data = QueryAggregatePrevoteRequest.encode(request).finish(); - const promise = this.rpc.request("nibiru.oracle.v1beta1.Query", "AggregatePrevote", data); - return promise.then((data) => QueryAggregatePrevoteResponse.decode(new _m0.Reader(data))); + AggregatePrevote( + request: QueryAggregatePrevoteRequest, + ): Promise { + const data = QueryAggregatePrevoteRequest.encode(request).finish() + const promise = this.rpc.request( + "nibiru.oracle.v1beta1.Query", + "AggregatePrevote", + data, + ) + return promise.then((data) => + QueryAggregatePrevoteResponse.decode(new _m0.Reader(data)), + ) } - AggregatePrevotes(request: QueryAggregatePrevotesRequest): Promise { - const data = QueryAggregatePrevotesRequest.encode(request).finish(); - const promise = this.rpc.request("nibiru.oracle.v1beta1.Query", "AggregatePrevotes", data); - return promise.then((data) => QueryAggregatePrevotesResponse.decode(new _m0.Reader(data))); + AggregatePrevotes( + request: QueryAggregatePrevotesRequest, + ): Promise { + const data = QueryAggregatePrevotesRequest.encode(request).finish() + const promise = this.rpc.request( + "nibiru.oracle.v1beta1.Query", + "AggregatePrevotes", + data, + ) + return promise.then((data) => + QueryAggregatePrevotesResponse.decode(new _m0.Reader(data)), + ) } - AggregateVote(request: QueryAggregateVoteRequest): Promise { - const data = QueryAggregateVoteRequest.encode(request).finish(); - const promise = this.rpc.request("nibiru.oracle.v1beta1.Query", "AggregateVote", data); - return promise.then((data) => QueryAggregateVoteResponse.decode(new _m0.Reader(data))); + AggregateVote( + request: QueryAggregateVoteRequest, + ): Promise { + const data = QueryAggregateVoteRequest.encode(request).finish() + const promise = this.rpc.request( + "nibiru.oracle.v1beta1.Query", + "AggregateVote", + data, + ) + return promise.then((data) => + QueryAggregateVoteResponse.decode(new _m0.Reader(data)), + ) } - AggregateVotes(request: QueryAggregateVotesRequest): Promise { - const data = QueryAggregateVotesRequest.encode(request).finish(); - const promise = this.rpc.request("nibiru.oracle.v1beta1.Query", "AggregateVotes", data); - return promise.then((data) => QueryAggregateVotesResponse.decode(new _m0.Reader(data))); + AggregateVotes( + request: QueryAggregateVotesRequest, + ): Promise { + const data = QueryAggregateVotesRequest.encode(request).finish() + const promise = this.rpc.request( + "nibiru.oracle.v1beta1.Query", + "AggregateVotes", + data, + ) + return promise.then((data) => + QueryAggregateVotesResponse.decode(new _m0.Reader(data)), + ) } Params(request: QueryParamsRequest): Promise { - const data = QueryParamsRequest.encode(request).finish(); - const promise = this.rpc.request("nibiru.oracle.v1beta1.Query", "Params", data); - return promise.then((data) => QueryParamsResponse.decode(new _m0.Reader(data))); + const data = QueryParamsRequest.encode(request).finish() + const promise = this.rpc.request("nibiru.oracle.v1beta1.Query", "Params", data) + return promise.then((data) => QueryParamsResponse.decode(new _m0.Reader(data))) } } interface Rpc { - request(service: string, method: string, data: Uint8Array): Promise; + request(service: string, method: string, data: Uint8Array): Promise } -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/oracle/v1beta1/state.ts b/packages/protojs/src/oracle/v1beta1/state.ts index b9d616e7..cf33abba 100644 --- a/packages/protojs/src/oracle/v1beta1/state.ts +++ b/packages/protojs/src/oracle/v1beta1/state.ts @@ -1,103 +1,119 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "nibiru.oracle.v1beta1"; +export const protobufPackage = "nibiru.oracle.v1beta1" /** a snapshot of the prices at a given point in time */ export interface PriceSnapshot { - pair: string; - price: string; + pair: string + price: string /** milliseconds since unix epoch */ - timestampMs: Long; + timestampMs: Long } function createBasePriceSnapshot(): PriceSnapshot { - return { pair: "", price: "", timestampMs: Long.ZERO }; + return { pair: "", price: "", timestampMs: Long.ZERO } } export const PriceSnapshot = { encode(message: PriceSnapshot, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.pair !== "") { - writer.uint32(10).string(message.pair); + writer.uint32(10).string(message.pair) } if (message.price !== "") { - writer.uint32(18).string(message.price); + writer.uint32(18).string(message.price) } if (!message.timestampMs.isZero()) { - writer.uint32(24).int64(message.timestampMs); + writer.uint32(24).int64(message.timestampMs) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): PriceSnapshot { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBasePriceSnapshot(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBasePriceSnapshot() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.pair = reader.string(); - break; + message.pair = reader.string() + break case 2: - message.price = reader.string(); - break; + message.price = reader.string() + break case 3: - message.timestampMs = reader.int64() as Long; - break; + message.timestampMs = reader.int64() as Long + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): PriceSnapshot { return { pair: isSet(object.pair) ? String(object.pair) : "", price: isSet(object.price) ? String(object.price) : "", - timestampMs: isSet(object.timestampMs) ? Long.fromValue(object.timestampMs) : Long.ZERO, - }; + timestampMs: isSet(object.timestampMs) + ? Long.fromValue(object.timestampMs) + : Long.ZERO, + } }, toJSON(message: PriceSnapshot): unknown { - const obj: any = {}; - message.pair !== undefined && (obj.pair = message.pair); - message.price !== undefined && (obj.price = message.price); - message.timestampMs !== undefined && (obj.timestampMs = (message.timestampMs || Long.ZERO).toString()); - return obj; + const obj: any = {} + message.pair !== undefined && (obj.pair = message.pair) + message.price !== undefined && (obj.price = message.price) + message.timestampMs !== undefined && + (obj.timestampMs = (message.timestampMs || Long.ZERO).toString()) + return obj }, - fromPartial, I>>(object: I): PriceSnapshot { - const message = createBasePriceSnapshot(); - message.pair = object.pair ?? ""; - message.price = object.price ?? ""; - message.timestampMs = (object.timestampMs !== undefined && object.timestampMs !== null) - ? Long.fromValue(object.timestampMs) - : Long.ZERO; - return message; + fromPartial, I>>( + object: I, + ): PriceSnapshot { + const message = createBasePriceSnapshot() + message.pair = object.pair ?? "" + message.price = object.price ?? "" + message.timestampMs = + object.timestampMs !== undefined && object.timestampMs !== null + ? Long.fromValue(object.timestampMs) + : Long.ZERO + return message }, -}; +} -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/oracle/v1beta1/tx.ts b/packages/protojs/src/oracle/v1beta1/tx.ts index d4f0add8..7044c3f8 100644 --- a/packages/protojs/src/oracle/v1beta1/tx.ts +++ b/packages/protojs/src/oracle/v1beta1/tx.ts @@ -1,103 +1,106 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "nibiru.oracle.v1beta1"; +export const protobufPackage = "nibiru.oracle.v1beta1" /** * MsgAggregateExchangeRatePrevote represents a message to submit * aggregate exchange rate prevote. */ export interface MsgAggregateExchangeRatePrevote { - hash: string; + hash: string /** * Feeder is the Bech32 address of the price feeder. A validator may * specify multiple price feeders by delegating them consent. The validator * address is also a valid feeder by default. */ - feeder: string; + feeder: string /** Validator is the Bech32 address to which the prevote will be credited. */ - validator: string; + validator: string } /** MsgAggregateExchangeRatePrevoteResponse defines the Msg/AggregateExchangeRatePrevote response type. */ -export interface MsgAggregateExchangeRatePrevoteResponse { -} +export interface MsgAggregateExchangeRatePrevoteResponse {} /** * MsgAggregateExchangeRateVote represents a message to submit * aggregate exchange rate vote. */ export interface MsgAggregateExchangeRateVote { - salt: string; - exchangeRates: string; + salt: string + exchangeRates: string /** * Feeder is the Bech32 address of the price feeder. A validator may * specify multiple price feeders by delegating them consent. The validator * address is also a valid feeder by default. */ - feeder: string; + feeder: string /** Validator is the Bech32 address to which the vote will be credited. */ - validator: string; + validator: string } /** MsgAggregateExchangeRateVoteResponse defines the Msg/AggregateExchangeRateVote response type. */ -export interface MsgAggregateExchangeRateVoteResponse { -} +export interface MsgAggregateExchangeRateVoteResponse {} /** * MsgDelegateFeedConsent represents a message to delegate oracle voting rights * to another address. */ export interface MsgDelegateFeedConsent { - operator: string; - delegate: string; + operator: string + delegate: string } /** MsgDelegateFeedConsentResponse defines the Msg/DelegateFeedConsent response type. */ -export interface MsgDelegateFeedConsentResponse { -} +export interface MsgDelegateFeedConsentResponse {} function createBaseMsgAggregateExchangeRatePrevote(): MsgAggregateExchangeRatePrevote { - return { hash: "", feeder: "", validator: "" }; + return { hash: "", feeder: "", validator: "" } } export const MsgAggregateExchangeRatePrevote = { - encode(message: MsgAggregateExchangeRatePrevote, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: MsgAggregateExchangeRatePrevote, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.hash !== "") { - writer.uint32(10).string(message.hash); + writer.uint32(10).string(message.hash) } if (message.feeder !== "") { - writer.uint32(18).string(message.feeder); + writer.uint32(18).string(message.feeder) } if (message.validator !== "") { - writer.uint32(26).string(message.validator); + writer.uint32(26).string(message.validator) } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgAggregateExchangeRatePrevote { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgAggregateExchangeRatePrevote(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgAggregateExchangeRatePrevote { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgAggregateExchangeRatePrevote() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.hash = reader.string(); - break; + message.hash = reader.string() + break case 2: - message.feeder = reader.string(); - break; + message.feeder = reader.string() + break case 3: - message.validator = reader.string(); - break; + message.validator = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): MsgAggregateExchangeRatePrevote { @@ -105,115 +108,127 @@ export const MsgAggregateExchangeRatePrevote = { hash: isSet(object.hash) ? String(object.hash) : "", feeder: isSet(object.feeder) ? String(object.feeder) : "", validator: isSet(object.validator) ? String(object.validator) : "", - }; + } }, toJSON(message: MsgAggregateExchangeRatePrevote): unknown { - const obj: any = {}; - message.hash !== undefined && (obj.hash = message.hash); - message.feeder !== undefined && (obj.feeder = message.feeder); - message.validator !== undefined && (obj.validator = message.validator); - return obj; + const obj: any = {} + message.hash !== undefined && (obj.hash = message.hash) + message.feeder !== undefined && (obj.feeder = message.feeder) + message.validator !== undefined && (obj.validator = message.validator) + return obj }, fromPartial, I>>( object: I, ): MsgAggregateExchangeRatePrevote { - const message = createBaseMsgAggregateExchangeRatePrevote(); - message.hash = object.hash ?? ""; - message.feeder = object.feeder ?? ""; - message.validator = object.validator ?? ""; - return message; + const message = createBaseMsgAggregateExchangeRatePrevote() + message.hash = object.hash ?? "" + message.feeder = object.feeder ?? "" + message.validator = object.validator ?? "" + return message }, -}; +} function createBaseMsgAggregateExchangeRatePrevoteResponse(): MsgAggregateExchangeRatePrevoteResponse { - return {}; + return {} } export const MsgAggregateExchangeRatePrevoteResponse = { - encode(_: MsgAggregateExchangeRatePrevoteResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; + encode( + _: MsgAggregateExchangeRatePrevoteResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgAggregateExchangeRatePrevoteResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgAggregateExchangeRatePrevoteResponse(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgAggregateExchangeRatePrevoteResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgAggregateExchangeRatePrevoteResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(_: any): MsgAggregateExchangeRatePrevoteResponse { - return {}; + return {} }, toJSON(_: MsgAggregateExchangeRatePrevoteResponse): unknown { - const obj: any = {}; - return obj; + const obj: any = {} + return obj }, fromPartial, I>>( _: I, ): MsgAggregateExchangeRatePrevoteResponse { - const message = createBaseMsgAggregateExchangeRatePrevoteResponse(); - return message; + const message = createBaseMsgAggregateExchangeRatePrevoteResponse() + return message }, -}; +} function createBaseMsgAggregateExchangeRateVote(): MsgAggregateExchangeRateVote { - return { salt: "", exchangeRates: "", feeder: "", validator: "" }; + return { salt: "", exchangeRates: "", feeder: "", validator: "" } } export const MsgAggregateExchangeRateVote = { - encode(message: MsgAggregateExchangeRateVote, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: MsgAggregateExchangeRateVote, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.salt !== "") { - writer.uint32(10).string(message.salt); + writer.uint32(10).string(message.salt) } if (message.exchangeRates !== "") { - writer.uint32(18).string(message.exchangeRates); + writer.uint32(18).string(message.exchangeRates) } if (message.feeder !== "") { - writer.uint32(26).string(message.feeder); + writer.uint32(26).string(message.feeder) } if (message.validator !== "") { - writer.uint32(34).string(message.validator); + writer.uint32(34).string(message.validator) } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgAggregateExchangeRateVote { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgAggregateExchangeRateVote(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgAggregateExchangeRateVote { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgAggregateExchangeRateVote() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.salt = reader.string(); - break; + message.salt = reader.string() + break case 2: - message.exchangeRates = reader.string(); - break; + message.exchangeRates = reader.string() + break case 3: - message.feeder = reader.string(); - break; + message.feeder = reader.string() + break case 4: - message.validator = reader.string(); - break; + message.validator = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): MsgAggregateExchangeRateVote { @@ -222,165 +237,186 @@ export const MsgAggregateExchangeRateVote = { exchangeRates: isSet(object.exchangeRates) ? String(object.exchangeRates) : "", feeder: isSet(object.feeder) ? String(object.feeder) : "", validator: isSet(object.validator) ? String(object.validator) : "", - }; + } }, toJSON(message: MsgAggregateExchangeRateVote): unknown { - const obj: any = {}; - message.salt !== undefined && (obj.salt = message.salt); - message.exchangeRates !== undefined && (obj.exchangeRates = message.exchangeRates); - message.feeder !== undefined && (obj.feeder = message.feeder); - message.validator !== undefined && (obj.validator = message.validator); - return obj; + const obj: any = {} + message.salt !== undefined && (obj.salt = message.salt) + message.exchangeRates !== undefined && (obj.exchangeRates = message.exchangeRates) + message.feeder !== undefined && (obj.feeder = message.feeder) + message.validator !== undefined && (obj.validator = message.validator) + return obj }, - fromPartial, I>>(object: I): MsgAggregateExchangeRateVote { - const message = createBaseMsgAggregateExchangeRateVote(); - message.salt = object.salt ?? ""; - message.exchangeRates = object.exchangeRates ?? ""; - message.feeder = object.feeder ?? ""; - message.validator = object.validator ?? ""; - return message; + fromPartial, I>>( + object: I, + ): MsgAggregateExchangeRateVote { + const message = createBaseMsgAggregateExchangeRateVote() + message.salt = object.salt ?? "" + message.exchangeRates = object.exchangeRates ?? "" + message.feeder = object.feeder ?? "" + message.validator = object.validator ?? "" + return message }, -}; +} function createBaseMsgAggregateExchangeRateVoteResponse(): MsgAggregateExchangeRateVoteResponse { - return {}; + return {} } export const MsgAggregateExchangeRateVoteResponse = { - encode(_: MsgAggregateExchangeRateVoteResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; + encode( + _: MsgAggregateExchangeRateVoteResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgAggregateExchangeRateVoteResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgAggregateExchangeRateVoteResponse(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgAggregateExchangeRateVoteResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgAggregateExchangeRateVoteResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(_: any): MsgAggregateExchangeRateVoteResponse { - return {}; + return {} }, toJSON(_: MsgAggregateExchangeRateVoteResponse): unknown { - const obj: any = {}; - return obj; + const obj: any = {} + return obj }, fromPartial, I>>( _: I, ): MsgAggregateExchangeRateVoteResponse { - const message = createBaseMsgAggregateExchangeRateVoteResponse(); - return message; + const message = createBaseMsgAggregateExchangeRateVoteResponse() + return message }, -}; +} function createBaseMsgDelegateFeedConsent(): MsgDelegateFeedConsent { - return { operator: "", delegate: "" }; + return { operator: "", delegate: "" } } export const MsgDelegateFeedConsent = { - encode(message: MsgDelegateFeedConsent, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: MsgDelegateFeedConsent, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.operator !== "") { - writer.uint32(10).string(message.operator); + writer.uint32(10).string(message.operator) } if (message.delegate !== "") { - writer.uint32(18).string(message.delegate); + writer.uint32(18).string(message.delegate) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MsgDelegateFeedConsent { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgDelegateFeedConsent(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgDelegateFeedConsent() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.operator = reader.string(); - break; + message.operator = reader.string() + break case 2: - message.delegate = reader.string(); - break; + message.delegate = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): MsgDelegateFeedConsent { return { operator: isSet(object.operator) ? String(object.operator) : "", delegate: isSet(object.delegate) ? String(object.delegate) : "", - }; + } }, toJSON(message: MsgDelegateFeedConsent): unknown { - const obj: any = {}; - message.operator !== undefined && (obj.operator = message.operator); - message.delegate !== undefined && (obj.delegate = message.delegate); - return obj; + const obj: any = {} + message.operator !== undefined && (obj.operator = message.operator) + message.delegate !== undefined && (obj.delegate = message.delegate) + return obj }, - fromPartial, I>>(object: I): MsgDelegateFeedConsent { - const message = createBaseMsgDelegateFeedConsent(); - message.operator = object.operator ?? ""; - message.delegate = object.delegate ?? ""; - return message; + fromPartial, I>>( + object: I, + ): MsgDelegateFeedConsent { + const message = createBaseMsgDelegateFeedConsent() + message.operator = object.operator ?? "" + message.delegate = object.delegate ?? "" + return message }, -}; +} function createBaseMsgDelegateFeedConsentResponse(): MsgDelegateFeedConsentResponse { - return {}; + return {} } export const MsgDelegateFeedConsentResponse = { - encode(_: MsgDelegateFeedConsentResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; + encode( + _: MsgDelegateFeedConsentResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgDelegateFeedConsentResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgDelegateFeedConsentResponse(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgDelegateFeedConsentResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgDelegateFeedConsentResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(_: any): MsgDelegateFeedConsentResponse { - return {}; + return {} }, toJSON(_: MsgDelegateFeedConsentResponse): unknown { - const obj: any = {}; - return obj; + const obj: any = {} + return obj }, - fromPartial, I>>(_: I): MsgDelegateFeedConsentResponse { - const message = createBaseMsgDelegateFeedConsentResponse(); - return message; + fromPartial, I>>( + _: I, + ): MsgDelegateFeedConsentResponse { + const message = createBaseMsgDelegateFeedConsentResponse() + return message }, -}; +} /** Msg defines the oracle Msg service. */ export interface Msg { @@ -390,70 +426,106 @@ export interface Msg { */ AggregateExchangeRatePrevote( request: MsgAggregateExchangeRatePrevote, - ): Promise; + ): Promise /** * AggregateExchangeRateVote defines a method for submitting * aggregate exchange rate vote */ - AggregateExchangeRateVote(request: MsgAggregateExchangeRateVote): Promise; + AggregateExchangeRateVote( + request: MsgAggregateExchangeRateVote, + ): Promise /** * DelegateFeedConsent defines a method for delegating oracle voting rights * to another address known as a price feeder. * See https://github.com/NibiruChain/pricefeeder. */ - DelegateFeedConsent(request: MsgDelegateFeedConsent): Promise; + DelegateFeedConsent( + request: MsgDelegateFeedConsent, + ): Promise } export class MsgClientImpl implements Msg { - private readonly rpc: Rpc; + private readonly rpc: Rpc constructor(rpc: Rpc) { - this.rpc = rpc; - this.AggregateExchangeRatePrevote = this.AggregateExchangeRatePrevote.bind(this); - this.AggregateExchangeRateVote = this.AggregateExchangeRateVote.bind(this); - this.DelegateFeedConsent = this.DelegateFeedConsent.bind(this); + this.rpc = rpc + this.AggregateExchangeRatePrevote = this.AggregateExchangeRatePrevote.bind(this) + this.AggregateExchangeRateVote = this.AggregateExchangeRateVote.bind(this) + this.DelegateFeedConsent = this.DelegateFeedConsent.bind(this) } AggregateExchangeRatePrevote( request: MsgAggregateExchangeRatePrevote, ): Promise { - const data = MsgAggregateExchangeRatePrevote.encode(request).finish(); - const promise = this.rpc.request("nibiru.oracle.v1beta1.Msg", "AggregateExchangeRatePrevote", data); - return promise.then((data) => MsgAggregateExchangeRatePrevoteResponse.decode(new _m0.Reader(data))); + const data = MsgAggregateExchangeRatePrevote.encode(request).finish() + const promise = this.rpc.request( + "nibiru.oracle.v1beta1.Msg", + "AggregateExchangeRatePrevote", + data, + ) + return promise.then((data) => + MsgAggregateExchangeRatePrevoteResponse.decode(new _m0.Reader(data)), + ) } - AggregateExchangeRateVote(request: MsgAggregateExchangeRateVote): Promise { - const data = MsgAggregateExchangeRateVote.encode(request).finish(); - const promise = this.rpc.request("nibiru.oracle.v1beta1.Msg", "AggregateExchangeRateVote", data); - return promise.then((data) => MsgAggregateExchangeRateVoteResponse.decode(new _m0.Reader(data))); + AggregateExchangeRateVote( + request: MsgAggregateExchangeRateVote, + ): Promise { + const data = MsgAggregateExchangeRateVote.encode(request).finish() + const promise = this.rpc.request( + "nibiru.oracle.v1beta1.Msg", + "AggregateExchangeRateVote", + data, + ) + return promise.then((data) => + MsgAggregateExchangeRateVoteResponse.decode(new _m0.Reader(data)), + ) } - DelegateFeedConsent(request: MsgDelegateFeedConsent): Promise { - const data = MsgDelegateFeedConsent.encode(request).finish(); - const promise = this.rpc.request("nibiru.oracle.v1beta1.Msg", "DelegateFeedConsent", data); - return promise.then((data) => MsgDelegateFeedConsentResponse.decode(new _m0.Reader(data))); + DelegateFeedConsent( + request: MsgDelegateFeedConsent, + ): Promise { + const data = MsgDelegateFeedConsent.encode(request).finish() + const promise = this.rpc.request( + "nibiru.oracle.v1beta1.Msg", + "DelegateFeedConsent", + data, + ) + return promise.then((data) => + MsgDelegateFeedConsentResponse.decode(new _m0.Reader(data)), + ) } } interface Rpc { - request(service: string, method: string, data: Uint8Array): Promise; + request(service: string, method: string, data: Uint8Array): Promise } -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/perp/v1/event.ts b/packages/protojs/src/perp/v1/event.ts index f26cbb31..004ab498 100644 --- a/packages/protojs/src/perp/v1/event.ts +++ b/packages/protojs/src/perp/v1/event.ts @@ -1,9 +1,9 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { Coin } from "../../cosmos/base/v1beta1/coin"; +import { Coin } from "../../cosmos/base/v1beta1/coin" +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "nibiru.perp.v1"; +export const protobufPackage = "nibiru.perp.v1" /** * Emitted when a position changes. @@ -11,47 +11,47 @@ export const protobufPackage = "nibiru.perp.v1"; */ export interface PositionChangedEvent { /** identifier of the corresponding virtual pool for the position */ - pair: string; + pair: string /** owner of the position. */ - traderAddress: string; + traderAddress: string /** Amount of collateral (quote units) backing the position after the change. */ - margin?: Coin; + margin?: Coin /** * Position notional (quote units) after the change. In general, * 'notional = baseAmount * priceQuotePerBase', where size is the baseAmount. */ - positionNotional: string; + positionNotional: string /** * Exchanged size is the magnitude of the change to position size (base units). * The size is a signed quantity expressing how much exposure a position has in * base units of the pair. */ - exchangedSize: string; + exchangedSize: string /** * Exchanged notional is the value of the exchanged size in quote units. * exchangedNotional = posBefore.OpenNotional + (direction * realizedPnl), * where 'posBefore' is the position before the change, and * direction is 1 if posBefore.Size > 0 or -1 if posBefore.Size < 0, */ - exchangedNotional: string; + exchangedNotional: string /** Transaction fee paid. A "taker" fee. */ - transactionFee?: Coin; + transactionFee?: Coin /** Position size after the change. */ - positionSize: string; + positionSize: string /** realize profits and losses after the change */ - realizedPnl: string; + realizedPnl: string /** unrealized profits and losses after the change */ - unrealizedPnlAfter: string; + unrealizedPnlAfter: string /** * Amount of bad debt cleared by the PerpEF during the change. * Bad debt is negative net margin past the liquidation point of a position. */ - badDebt?: Coin; + badDebt?: Coin /** * Mark price, synonymous with mark price in this context, is the quotient of * the quote reserves and base reserves */ - markPrice: string; + markPrice: string /** * A funding payment made or received by the trader on the current position. * 'fundingPayment' is positive if 'owner' is the sender and negative if 'owner' @@ -59,91 +59,91 @@ export interface PositionChangedEvent { * Funding payments act to converge the mark price (vPrice) and index price * (average price on major exchanges). */ - fundingPayment: string; + fundingPayment: string /** The block number at which this position was changed. */ - blockHeight: Long; + blockHeight: Long /** The block time in unix milliseconds at which this position was changed. */ - blockTimeMs: Long; + blockTimeMs: Long } /** Emitted when a position is liquidated. */ export interface PositionLiquidatedEvent { /** identifier of the corresponding virtual pool for the position */ - pair: string; + pair: string /** owner of the position. */ - traderAddress: string; + traderAddress: string /** margin * leverage * vPrice. 'notional' is the virtual size times the virtual price on 'vpool'. */ - exchangedQuoteAmount: string; + exchangedQuoteAmount: string /** virtual amount of base assets for the position, which would be margin * leverage * priceBasePerQuote. */ - exchangedPositionSize: string; + exchangedPositionSize: string /** Address of the account that executed the tx. */ - liquidatorAddress: string; + liquidatorAddress: string /** Commission (in margin units) received by 'liquidator'. */ - feeToLiquidator?: Coin; + feeToLiquidator?: Coin /** Commission (in margin units) given to the ecosystem fund. */ - feeToEcosystemFund?: Coin; + feeToEcosystemFund?: Coin /** Bad debt (margin units) cleared by the PerpEF during the tx. Bad debt is negative net margin past the liquidation point of a position. */ - badDebt?: Coin; + badDebt?: Coin /** Remaining margin in the position after liquidation */ - margin?: Coin; + margin?: Coin /** Remaining position notional in the position after liquidation */ - positionNotional: string; + positionNotional: string /** Remaining position size in the position after liquidation */ - positionSize: string; + positionSize: string /** Unrealized PnL in the position after liquidation */ - unrealizedPnl: string; + unrealizedPnl: string /** Spot price of the vAMM after liquidation */ - markPrice: string; + markPrice: string /** The block number at which this liquidation occured. */ - blockHeight: Long; + blockHeight: Long /** The unix timestamp in milliseconds at which this liquidation occured. */ - blockTimeMs: Long; + blockTimeMs: Long } /** Emitted when a position is settled. */ export interface PositionSettledEvent { /** Identifier for the virtual pool of the position. */ - pair: string; + pair: string /** Owner of the position. */ - traderAddress: string; + traderAddress: string /** Settled coin as dictated by the settlement price of the vpool. */ - settledCoins: Coin[]; + settledCoins: Coin[] } /** Emitted when a new funding rate is calculated. */ export interface FundingRateChangedEvent { /** The pair for which the funding rate was calculated. */ - pair: string; + pair: string /** The mark price of the pair. */ - markPrice: string; + markPrice: string /** The oracle index price of the pair. */ - indexPrice: string; + indexPrice: string /** The latest funding rate. */ - latestFundingRate: string; + latestFundingRate: string /** The latest premium fraction just calculated. */ - latestPremiumFraction: string; + latestPremiumFraction: string /** * The latest cumulative premium fraction. * The funding payment a position will pay is the difference between this value * and the latest cumulative premium fraction on the position, multiplied by the position size. */ - cumulativePremiumFraction: string; + cumulativePremiumFraction: string /** The block number at which the funding rate was calculated. */ - blockHeight: Long; + blockHeight: Long /** The block time in unix milliseconds at which the funding rate was calculated. */ - blockTimeMs: Long; + blockTimeMs: Long } /** Emitted when liquidation fails. */ export interface LiquidationFailedEvent { /** The pair for which we are trying to liquidate. */ - pair: string; + pair: string /** owner of the position. */ - trader: string; + trader: string /** Address of the account that executed the tx. */ - liquidator: string; + liquidator: string /** Reason for the liquidation failure. */ - reason: LiquidationFailedEvent_LiquidationFailedReason; + reason: LiquidationFailedEvent_LiquidationFailedReason } export enum LiquidationFailedEvent_LiquidationFailedReason { @@ -163,20 +163,20 @@ export function liquidationFailedEvent_LiquidationFailedReasonFromJSON( switch (object) { case 0: case "UNSPECIFIED": - return LiquidationFailedEvent_LiquidationFailedReason.UNSPECIFIED; + return LiquidationFailedEvent_LiquidationFailedReason.UNSPECIFIED case 1: case "POSITION_HEALTHY": - return LiquidationFailedEvent_LiquidationFailedReason.POSITION_HEALTHY; + return LiquidationFailedEvent_LiquidationFailedReason.POSITION_HEALTHY case 2: case "NONEXISTENT_PAIR": - return LiquidationFailedEvent_LiquidationFailedReason.NONEXISTENT_PAIR; + return LiquidationFailedEvent_LiquidationFailedReason.NONEXISTENT_PAIR case 3: case "NONEXISTENT_POSITION": - return LiquidationFailedEvent_LiquidationFailedReason.NONEXISTENT_POSITION; + return LiquidationFailedEvent_LiquidationFailedReason.NONEXISTENT_POSITION case -1: case "UNRECOGNIZED": default: - return LiquidationFailedEvent_LiquidationFailedReason.UNRECOGNIZED; + return LiquidationFailedEvent_LiquidationFailedReason.UNRECOGNIZED } } @@ -185,31 +185,31 @@ export function liquidationFailedEvent_LiquidationFailedReasonToJSON( ): string { switch (object) { case LiquidationFailedEvent_LiquidationFailedReason.UNSPECIFIED: - return "UNSPECIFIED"; + return "UNSPECIFIED" case LiquidationFailedEvent_LiquidationFailedReason.POSITION_HEALTHY: - return "POSITION_HEALTHY"; + return "POSITION_HEALTHY" case LiquidationFailedEvent_LiquidationFailedReason.NONEXISTENT_PAIR: - return "NONEXISTENT_PAIR"; + return "NONEXISTENT_PAIR" case LiquidationFailedEvent_LiquidationFailedReason.NONEXISTENT_POSITION: - return "NONEXISTENT_POSITION"; + return "NONEXISTENT_POSITION" case LiquidationFailedEvent_LiquidationFailedReason.UNRECOGNIZED: default: - return "UNRECOGNIZED"; + return "UNRECOGNIZED" } } export interface MetricsEvent { - pair: string; + pair: string /** Sum of all active position sizes for the pair. */ - netSize: string; + netSize: string /** Total notional volume for the pair. */ - volumeQuote: string; + volumeQuote: string /** Total size volume for the pair. */ - volumeBase: string; + volumeBase: string /** The block number at which metrics were generated. */ - blockHeight: Long; + blockHeight: Long /** The block time in unix milliseconds at which metrics were generated. */ - blockTimeMs: Long; + blockTimeMs: Long } function createBasePositionChangedEvent(): PositionChangedEvent { @@ -229,117 +229,120 @@ function createBasePositionChangedEvent(): PositionChangedEvent { fundingPayment: "", blockHeight: Long.ZERO, blockTimeMs: Long.ZERO, - }; + } } export const PositionChangedEvent = { - encode(message: PositionChangedEvent, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: PositionChangedEvent, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.pair !== "") { - writer.uint32(10).string(message.pair); + writer.uint32(10).string(message.pair) } if (message.traderAddress !== "") { - writer.uint32(18).string(message.traderAddress); + writer.uint32(18).string(message.traderAddress) } if (message.margin !== undefined) { - Coin.encode(message.margin, writer.uint32(26).fork()).ldelim(); + Coin.encode(message.margin, writer.uint32(26).fork()).ldelim() } if (message.positionNotional !== "") { - writer.uint32(34).string(message.positionNotional); + writer.uint32(34).string(message.positionNotional) } if (message.exchangedSize !== "") { - writer.uint32(42).string(message.exchangedSize); + writer.uint32(42).string(message.exchangedSize) } if (message.exchangedNotional !== "") { - writer.uint32(50).string(message.exchangedNotional); + writer.uint32(50).string(message.exchangedNotional) } if (message.transactionFee !== undefined) { - Coin.encode(message.transactionFee, writer.uint32(58).fork()).ldelim(); + Coin.encode(message.transactionFee, writer.uint32(58).fork()).ldelim() } if (message.positionSize !== "") { - writer.uint32(66).string(message.positionSize); + writer.uint32(66).string(message.positionSize) } if (message.realizedPnl !== "") { - writer.uint32(74).string(message.realizedPnl); + writer.uint32(74).string(message.realizedPnl) } if (message.unrealizedPnlAfter !== "") { - writer.uint32(82).string(message.unrealizedPnlAfter); + writer.uint32(82).string(message.unrealizedPnlAfter) } if (message.badDebt !== undefined) { - Coin.encode(message.badDebt, writer.uint32(90).fork()).ldelim(); + Coin.encode(message.badDebt, writer.uint32(90).fork()).ldelim() } if (message.markPrice !== "") { - writer.uint32(98).string(message.markPrice); + writer.uint32(98).string(message.markPrice) } if (message.fundingPayment !== "") { - writer.uint32(106).string(message.fundingPayment); + writer.uint32(106).string(message.fundingPayment) } if (!message.blockHeight.isZero()) { - writer.uint32(112).int64(message.blockHeight); + writer.uint32(112).int64(message.blockHeight) } if (!message.blockTimeMs.isZero()) { - writer.uint32(120).int64(message.blockTimeMs); + writer.uint32(120).int64(message.blockTimeMs) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): PositionChangedEvent { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBasePositionChangedEvent(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBasePositionChangedEvent() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.pair = reader.string(); - break; + message.pair = reader.string() + break case 2: - message.traderAddress = reader.string(); - break; + message.traderAddress = reader.string() + break case 3: - message.margin = Coin.decode(reader, reader.uint32()); - break; + message.margin = Coin.decode(reader, reader.uint32()) + break case 4: - message.positionNotional = reader.string(); - break; + message.positionNotional = reader.string() + break case 5: - message.exchangedSize = reader.string(); - break; + message.exchangedSize = reader.string() + break case 6: - message.exchangedNotional = reader.string(); - break; + message.exchangedNotional = reader.string() + break case 7: - message.transactionFee = Coin.decode(reader, reader.uint32()); - break; + message.transactionFee = Coin.decode(reader, reader.uint32()) + break case 8: - message.positionSize = reader.string(); - break; + message.positionSize = reader.string() + break case 9: - message.realizedPnl = reader.string(); - break; + message.realizedPnl = reader.string() + break case 10: - message.unrealizedPnlAfter = reader.string(); - break; + message.unrealizedPnlAfter = reader.string() + break case 11: - message.badDebt = Coin.decode(reader, reader.uint32()); - break; + message.badDebt = Coin.decode(reader, reader.uint32()) + break case 12: - message.markPrice = reader.string(); - break; + message.markPrice = reader.string() + break case 13: - message.fundingPayment = reader.string(); - break; + message.fundingPayment = reader.string() + break case 14: - message.blockHeight = reader.int64() as Long; - break; + message.blockHeight = reader.int64() as Long + break case 15: - message.blockTimeMs = reader.int64() as Long; - break; + message.blockTimeMs = reader.int64() as Long + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): PositionChangedEvent { @@ -347,72 +350,101 @@ export const PositionChangedEvent = { pair: isSet(object.pair) ? String(object.pair) : "", traderAddress: isSet(object.traderAddress) ? String(object.traderAddress) : "", margin: isSet(object.margin) ? Coin.fromJSON(object.margin) : undefined, - positionNotional: isSet(object.positionNotional) ? String(object.positionNotional) : "", + positionNotional: isSet(object.positionNotional) + ? String(object.positionNotional) + : "", exchangedSize: isSet(object.exchangedSize) ? String(object.exchangedSize) : "", - exchangedNotional: isSet(object.exchangedNotional) ? String(object.exchangedNotional) : "", - transactionFee: isSet(object.transactionFee) ? Coin.fromJSON(object.transactionFee) : undefined, + exchangedNotional: isSet(object.exchangedNotional) + ? String(object.exchangedNotional) + : "", + transactionFee: isSet(object.transactionFee) + ? Coin.fromJSON(object.transactionFee) + : undefined, positionSize: isSet(object.positionSize) ? String(object.positionSize) : "", realizedPnl: isSet(object.realizedPnl) ? String(object.realizedPnl) : "", - unrealizedPnlAfter: isSet(object.unrealizedPnlAfter) ? String(object.unrealizedPnlAfter) : "", + unrealizedPnlAfter: isSet(object.unrealizedPnlAfter) + ? String(object.unrealizedPnlAfter) + : "", badDebt: isSet(object.badDebt) ? Coin.fromJSON(object.badDebt) : undefined, markPrice: isSet(object.markPrice) ? String(object.markPrice) : "", fundingPayment: isSet(object.fundingPayment) ? String(object.fundingPayment) : "", - blockHeight: isSet(object.blockHeight) ? Long.fromValue(object.blockHeight) : Long.ZERO, - blockTimeMs: isSet(object.blockTimeMs) ? Long.fromValue(object.blockTimeMs) : Long.ZERO, - }; + blockHeight: isSet(object.blockHeight) + ? Long.fromValue(object.blockHeight) + : Long.ZERO, + blockTimeMs: isSet(object.blockTimeMs) + ? Long.fromValue(object.blockTimeMs) + : Long.ZERO, + } }, toJSON(message: PositionChangedEvent): unknown { - const obj: any = {}; - message.pair !== undefined && (obj.pair = message.pair); - message.traderAddress !== undefined && (obj.traderAddress = message.traderAddress); - message.margin !== undefined && (obj.margin = message.margin ? Coin.toJSON(message.margin) : undefined); - message.positionNotional !== undefined && (obj.positionNotional = message.positionNotional); - message.exchangedSize !== undefined && (obj.exchangedSize = message.exchangedSize); - message.exchangedNotional !== undefined && (obj.exchangedNotional = message.exchangedNotional); + const obj: any = {} + message.pair !== undefined && (obj.pair = message.pair) + message.traderAddress !== undefined && (obj.traderAddress = message.traderAddress) + message.margin !== undefined && + (obj.margin = message.margin ? Coin.toJSON(message.margin) : undefined) + message.positionNotional !== undefined && + (obj.positionNotional = message.positionNotional) + message.exchangedSize !== undefined && (obj.exchangedSize = message.exchangedSize) + message.exchangedNotional !== undefined && + (obj.exchangedNotional = message.exchangedNotional) message.transactionFee !== undefined && - (obj.transactionFee = message.transactionFee ? Coin.toJSON(message.transactionFee) : undefined); - message.positionSize !== undefined && (obj.positionSize = message.positionSize); - message.realizedPnl !== undefined && (obj.realizedPnl = message.realizedPnl); - message.unrealizedPnlAfter !== undefined && (obj.unrealizedPnlAfter = message.unrealizedPnlAfter); - message.badDebt !== undefined && (obj.badDebt = message.badDebt ? Coin.toJSON(message.badDebt) : undefined); - message.markPrice !== undefined && (obj.markPrice = message.markPrice); - message.fundingPayment !== undefined && (obj.fundingPayment = message.fundingPayment); - message.blockHeight !== undefined && (obj.blockHeight = (message.blockHeight || Long.ZERO).toString()); - message.blockTimeMs !== undefined && (obj.blockTimeMs = (message.blockTimeMs || Long.ZERO).toString()); - return obj; + (obj.transactionFee = message.transactionFee + ? Coin.toJSON(message.transactionFee) + : undefined) + message.positionSize !== undefined && (obj.positionSize = message.positionSize) + message.realizedPnl !== undefined && (obj.realizedPnl = message.realizedPnl) + message.unrealizedPnlAfter !== undefined && + (obj.unrealizedPnlAfter = message.unrealizedPnlAfter) + message.badDebt !== undefined && + (obj.badDebt = message.badDebt ? Coin.toJSON(message.badDebt) : undefined) + message.markPrice !== undefined && (obj.markPrice = message.markPrice) + message.fundingPayment !== undefined && + (obj.fundingPayment = message.fundingPayment) + message.blockHeight !== undefined && + (obj.blockHeight = (message.blockHeight || Long.ZERO).toString()) + message.blockTimeMs !== undefined && + (obj.blockTimeMs = (message.blockTimeMs || Long.ZERO).toString()) + return obj }, - fromPartial, I>>(object: I): PositionChangedEvent { - const message = createBasePositionChangedEvent(); - message.pair = object.pair ?? ""; - message.traderAddress = object.traderAddress ?? ""; - message.margin = (object.margin !== undefined && object.margin !== null) - ? Coin.fromPartial(object.margin) - : undefined; - message.positionNotional = object.positionNotional ?? ""; - message.exchangedSize = object.exchangedSize ?? ""; - message.exchangedNotional = object.exchangedNotional ?? ""; - message.transactionFee = (object.transactionFee !== undefined && object.transactionFee !== null) - ? Coin.fromPartial(object.transactionFee) - : undefined; - message.positionSize = object.positionSize ?? ""; - message.realizedPnl = object.realizedPnl ?? ""; - message.unrealizedPnlAfter = object.unrealizedPnlAfter ?? ""; - message.badDebt = (object.badDebt !== undefined && object.badDebt !== null) - ? Coin.fromPartial(object.badDebt) - : undefined; - message.markPrice = object.markPrice ?? ""; - message.fundingPayment = object.fundingPayment ?? ""; - message.blockHeight = (object.blockHeight !== undefined && object.blockHeight !== null) - ? Long.fromValue(object.blockHeight) - : Long.ZERO; - message.blockTimeMs = (object.blockTimeMs !== undefined && object.blockTimeMs !== null) - ? Long.fromValue(object.blockTimeMs) - : Long.ZERO; - return message; + fromPartial, I>>( + object: I, + ): PositionChangedEvent { + const message = createBasePositionChangedEvent() + message.pair = object.pair ?? "" + message.traderAddress = object.traderAddress ?? "" + message.margin = + object.margin !== undefined && object.margin !== null + ? Coin.fromPartial(object.margin) + : undefined + message.positionNotional = object.positionNotional ?? "" + message.exchangedSize = object.exchangedSize ?? "" + message.exchangedNotional = object.exchangedNotional ?? "" + message.transactionFee = + object.transactionFee !== undefined && object.transactionFee !== null + ? Coin.fromPartial(object.transactionFee) + : undefined + message.positionSize = object.positionSize ?? "" + message.realizedPnl = object.realizedPnl ?? "" + message.unrealizedPnlAfter = object.unrealizedPnlAfter ?? "" + message.badDebt = + object.badDebt !== undefined && object.badDebt !== null + ? Coin.fromPartial(object.badDebt) + : undefined + message.markPrice = object.markPrice ?? "" + message.fundingPayment = object.fundingPayment ?? "" + message.blockHeight = + object.blockHeight !== undefined && object.blockHeight !== null + ? Long.fromValue(object.blockHeight) + : Long.ZERO + message.blockTimeMs = + object.blockTimeMs !== undefined && object.blockTimeMs !== null + ? Long.fromValue(object.blockTimeMs) + : Long.ZERO + return message }, -}; +} function createBasePositionLiquidatedEvent(): PositionLiquidatedEvent { return { @@ -431,264 +463,312 @@ function createBasePositionLiquidatedEvent(): PositionLiquidatedEvent { markPrice: "", blockHeight: Long.ZERO, blockTimeMs: Long.ZERO, - }; + } } export const PositionLiquidatedEvent = { - encode(message: PositionLiquidatedEvent, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: PositionLiquidatedEvent, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.pair !== "") { - writer.uint32(10).string(message.pair); + writer.uint32(10).string(message.pair) } if (message.traderAddress !== "") { - writer.uint32(18).string(message.traderAddress); + writer.uint32(18).string(message.traderAddress) } if (message.exchangedQuoteAmount !== "") { - writer.uint32(26).string(message.exchangedQuoteAmount); + writer.uint32(26).string(message.exchangedQuoteAmount) } if (message.exchangedPositionSize !== "") { - writer.uint32(34).string(message.exchangedPositionSize); + writer.uint32(34).string(message.exchangedPositionSize) } if (message.liquidatorAddress !== "") { - writer.uint32(42).string(message.liquidatorAddress); + writer.uint32(42).string(message.liquidatorAddress) } if (message.feeToLiquidator !== undefined) { - Coin.encode(message.feeToLiquidator, writer.uint32(50).fork()).ldelim(); + Coin.encode(message.feeToLiquidator, writer.uint32(50).fork()).ldelim() } if (message.feeToEcosystemFund !== undefined) { - Coin.encode(message.feeToEcosystemFund, writer.uint32(58).fork()).ldelim(); + Coin.encode(message.feeToEcosystemFund, writer.uint32(58).fork()).ldelim() } if (message.badDebt !== undefined) { - Coin.encode(message.badDebt, writer.uint32(66).fork()).ldelim(); + Coin.encode(message.badDebt, writer.uint32(66).fork()).ldelim() } if (message.margin !== undefined) { - Coin.encode(message.margin, writer.uint32(74).fork()).ldelim(); + Coin.encode(message.margin, writer.uint32(74).fork()).ldelim() } if (message.positionNotional !== "") { - writer.uint32(82).string(message.positionNotional); + writer.uint32(82).string(message.positionNotional) } if (message.positionSize !== "") { - writer.uint32(90).string(message.positionSize); + writer.uint32(90).string(message.positionSize) } if (message.unrealizedPnl !== "") { - writer.uint32(98).string(message.unrealizedPnl); + writer.uint32(98).string(message.unrealizedPnl) } if (message.markPrice !== "") { - writer.uint32(106).string(message.markPrice); + writer.uint32(106).string(message.markPrice) } if (!message.blockHeight.isZero()) { - writer.uint32(112).int64(message.blockHeight); + writer.uint32(112).int64(message.blockHeight) } if (!message.blockTimeMs.isZero()) { - writer.uint32(120).int64(message.blockTimeMs); + writer.uint32(120).int64(message.blockTimeMs) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): PositionLiquidatedEvent { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBasePositionLiquidatedEvent(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBasePositionLiquidatedEvent() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.pair = reader.string(); - break; + message.pair = reader.string() + break case 2: - message.traderAddress = reader.string(); - break; + message.traderAddress = reader.string() + break case 3: - message.exchangedQuoteAmount = reader.string(); - break; + message.exchangedQuoteAmount = reader.string() + break case 4: - message.exchangedPositionSize = reader.string(); - break; + message.exchangedPositionSize = reader.string() + break case 5: - message.liquidatorAddress = reader.string(); - break; + message.liquidatorAddress = reader.string() + break case 6: - message.feeToLiquidator = Coin.decode(reader, reader.uint32()); - break; + message.feeToLiquidator = Coin.decode(reader, reader.uint32()) + break case 7: - message.feeToEcosystemFund = Coin.decode(reader, reader.uint32()); - break; + message.feeToEcosystemFund = Coin.decode(reader, reader.uint32()) + break case 8: - message.badDebt = Coin.decode(reader, reader.uint32()); - break; + message.badDebt = Coin.decode(reader, reader.uint32()) + break case 9: - message.margin = Coin.decode(reader, reader.uint32()); - break; + message.margin = Coin.decode(reader, reader.uint32()) + break case 10: - message.positionNotional = reader.string(); - break; + message.positionNotional = reader.string() + break case 11: - message.positionSize = reader.string(); - break; + message.positionSize = reader.string() + break case 12: - message.unrealizedPnl = reader.string(); - break; + message.unrealizedPnl = reader.string() + break case 13: - message.markPrice = reader.string(); - break; + message.markPrice = reader.string() + break case 14: - message.blockHeight = reader.int64() as Long; - break; + message.blockHeight = reader.int64() as Long + break case 15: - message.blockTimeMs = reader.int64() as Long; - break; + message.blockTimeMs = reader.int64() as Long + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): PositionLiquidatedEvent { return { pair: isSet(object.pair) ? String(object.pair) : "", traderAddress: isSet(object.traderAddress) ? String(object.traderAddress) : "", - exchangedQuoteAmount: isSet(object.exchangedQuoteAmount) ? String(object.exchangedQuoteAmount) : "", - exchangedPositionSize: isSet(object.exchangedPositionSize) ? String(object.exchangedPositionSize) : "", - liquidatorAddress: isSet(object.liquidatorAddress) ? String(object.liquidatorAddress) : "", - feeToLiquidator: isSet(object.feeToLiquidator) ? Coin.fromJSON(object.feeToLiquidator) : undefined, - feeToEcosystemFund: isSet(object.feeToEcosystemFund) ? Coin.fromJSON(object.feeToEcosystemFund) : undefined, + exchangedQuoteAmount: isSet(object.exchangedQuoteAmount) + ? String(object.exchangedQuoteAmount) + : "", + exchangedPositionSize: isSet(object.exchangedPositionSize) + ? String(object.exchangedPositionSize) + : "", + liquidatorAddress: isSet(object.liquidatorAddress) + ? String(object.liquidatorAddress) + : "", + feeToLiquidator: isSet(object.feeToLiquidator) + ? Coin.fromJSON(object.feeToLiquidator) + : undefined, + feeToEcosystemFund: isSet(object.feeToEcosystemFund) + ? Coin.fromJSON(object.feeToEcosystemFund) + : undefined, badDebt: isSet(object.badDebt) ? Coin.fromJSON(object.badDebt) : undefined, margin: isSet(object.margin) ? Coin.fromJSON(object.margin) : undefined, - positionNotional: isSet(object.positionNotional) ? String(object.positionNotional) : "", + positionNotional: isSet(object.positionNotional) + ? String(object.positionNotional) + : "", positionSize: isSet(object.positionSize) ? String(object.positionSize) : "", unrealizedPnl: isSet(object.unrealizedPnl) ? String(object.unrealizedPnl) : "", markPrice: isSet(object.markPrice) ? String(object.markPrice) : "", - blockHeight: isSet(object.blockHeight) ? Long.fromValue(object.blockHeight) : Long.ZERO, - blockTimeMs: isSet(object.blockTimeMs) ? Long.fromValue(object.blockTimeMs) : Long.ZERO, - }; + blockHeight: isSet(object.blockHeight) + ? Long.fromValue(object.blockHeight) + : Long.ZERO, + blockTimeMs: isSet(object.blockTimeMs) + ? Long.fromValue(object.blockTimeMs) + : Long.ZERO, + } }, toJSON(message: PositionLiquidatedEvent): unknown { - const obj: any = {}; - message.pair !== undefined && (obj.pair = message.pair); - message.traderAddress !== undefined && (obj.traderAddress = message.traderAddress); - message.exchangedQuoteAmount !== undefined && (obj.exchangedQuoteAmount = message.exchangedQuoteAmount); - message.exchangedPositionSize !== undefined && (obj.exchangedPositionSize = message.exchangedPositionSize); - message.liquidatorAddress !== undefined && (obj.liquidatorAddress = message.liquidatorAddress); + const obj: any = {} + message.pair !== undefined && (obj.pair = message.pair) + message.traderAddress !== undefined && (obj.traderAddress = message.traderAddress) + message.exchangedQuoteAmount !== undefined && + (obj.exchangedQuoteAmount = message.exchangedQuoteAmount) + message.exchangedPositionSize !== undefined && + (obj.exchangedPositionSize = message.exchangedPositionSize) + message.liquidatorAddress !== undefined && + (obj.liquidatorAddress = message.liquidatorAddress) message.feeToLiquidator !== undefined && - (obj.feeToLiquidator = message.feeToLiquidator ? Coin.toJSON(message.feeToLiquidator) : undefined); + (obj.feeToLiquidator = message.feeToLiquidator + ? Coin.toJSON(message.feeToLiquidator) + : undefined) message.feeToEcosystemFund !== undefined && - (obj.feeToEcosystemFund = message.feeToEcosystemFund ? Coin.toJSON(message.feeToEcosystemFund) : undefined); - message.badDebt !== undefined && (obj.badDebt = message.badDebt ? Coin.toJSON(message.badDebt) : undefined); - message.margin !== undefined && (obj.margin = message.margin ? Coin.toJSON(message.margin) : undefined); - message.positionNotional !== undefined && (obj.positionNotional = message.positionNotional); - message.positionSize !== undefined && (obj.positionSize = message.positionSize); - message.unrealizedPnl !== undefined && (obj.unrealizedPnl = message.unrealizedPnl); - message.markPrice !== undefined && (obj.markPrice = message.markPrice); - message.blockHeight !== undefined && (obj.blockHeight = (message.blockHeight || Long.ZERO).toString()); - message.blockTimeMs !== undefined && (obj.blockTimeMs = (message.blockTimeMs || Long.ZERO).toString()); - return obj; + (obj.feeToEcosystemFund = message.feeToEcosystemFund + ? Coin.toJSON(message.feeToEcosystemFund) + : undefined) + message.badDebt !== undefined && + (obj.badDebt = message.badDebt ? Coin.toJSON(message.badDebt) : undefined) + message.margin !== undefined && + (obj.margin = message.margin ? Coin.toJSON(message.margin) : undefined) + message.positionNotional !== undefined && + (obj.positionNotional = message.positionNotional) + message.positionSize !== undefined && (obj.positionSize = message.positionSize) + message.unrealizedPnl !== undefined && (obj.unrealizedPnl = message.unrealizedPnl) + message.markPrice !== undefined && (obj.markPrice = message.markPrice) + message.blockHeight !== undefined && + (obj.blockHeight = (message.blockHeight || Long.ZERO).toString()) + message.blockTimeMs !== undefined && + (obj.blockTimeMs = (message.blockTimeMs || Long.ZERO).toString()) + return obj }, - fromPartial, I>>(object: I): PositionLiquidatedEvent { - const message = createBasePositionLiquidatedEvent(); - message.pair = object.pair ?? ""; - message.traderAddress = object.traderAddress ?? ""; - message.exchangedQuoteAmount = object.exchangedQuoteAmount ?? ""; - message.exchangedPositionSize = object.exchangedPositionSize ?? ""; - message.liquidatorAddress = object.liquidatorAddress ?? ""; - message.feeToLiquidator = (object.feeToLiquidator !== undefined && object.feeToLiquidator !== null) - ? Coin.fromPartial(object.feeToLiquidator) - : undefined; - message.feeToEcosystemFund = (object.feeToEcosystemFund !== undefined && object.feeToEcosystemFund !== null) - ? Coin.fromPartial(object.feeToEcosystemFund) - : undefined; - message.badDebt = (object.badDebt !== undefined && object.badDebt !== null) - ? Coin.fromPartial(object.badDebt) - : undefined; - message.margin = (object.margin !== undefined && object.margin !== null) - ? Coin.fromPartial(object.margin) - : undefined; - message.positionNotional = object.positionNotional ?? ""; - message.positionSize = object.positionSize ?? ""; - message.unrealizedPnl = object.unrealizedPnl ?? ""; - message.markPrice = object.markPrice ?? ""; - message.blockHeight = (object.blockHeight !== undefined && object.blockHeight !== null) - ? Long.fromValue(object.blockHeight) - : Long.ZERO; - message.blockTimeMs = (object.blockTimeMs !== undefined && object.blockTimeMs !== null) - ? Long.fromValue(object.blockTimeMs) - : Long.ZERO; - return message; + fromPartial, I>>( + object: I, + ): PositionLiquidatedEvent { + const message = createBasePositionLiquidatedEvent() + message.pair = object.pair ?? "" + message.traderAddress = object.traderAddress ?? "" + message.exchangedQuoteAmount = object.exchangedQuoteAmount ?? "" + message.exchangedPositionSize = object.exchangedPositionSize ?? "" + message.liquidatorAddress = object.liquidatorAddress ?? "" + message.feeToLiquidator = + object.feeToLiquidator !== undefined && object.feeToLiquidator !== null + ? Coin.fromPartial(object.feeToLiquidator) + : undefined + message.feeToEcosystemFund = + object.feeToEcosystemFund !== undefined && object.feeToEcosystemFund !== null + ? Coin.fromPartial(object.feeToEcosystemFund) + : undefined + message.badDebt = + object.badDebt !== undefined && object.badDebt !== null + ? Coin.fromPartial(object.badDebt) + : undefined + message.margin = + object.margin !== undefined && object.margin !== null + ? Coin.fromPartial(object.margin) + : undefined + message.positionNotional = object.positionNotional ?? "" + message.positionSize = object.positionSize ?? "" + message.unrealizedPnl = object.unrealizedPnl ?? "" + message.markPrice = object.markPrice ?? "" + message.blockHeight = + object.blockHeight !== undefined && object.blockHeight !== null + ? Long.fromValue(object.blockHeight) + : Long.ZERO + message.blockTimeMs = + object.blockTimeMs !== undefined && object.blockTimeMs !== null + ? Long.fromValue(object.blockTimeMs) + : Long.ZERO + return message }, -}; +} function createBasePositionSettledEvent(): PositionSettledEvent { - return { pair: "", traderAddress: "", settledCoins: [] }; + return { pair: "", traderAddress: "", settledCoins: [] } } export const PositionSettledEvent = { - encode(message: PositionSettledEvent, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: PositionSettledEvent, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.pair !== "") { - writer.uint32(10).string(message.pair); + writer.uint32(10).string(message.pair) } if (message.traderAddress !== "") { - writer.uint32(18).string(message.traderAddress); + writer.uint32(18).string(message.traderAddress) } for (const v of message.settledCoins) { - Coin.encode(v!, writer.uint32(26).fork()).ldelim(); + Coin.encode(v!, writer.uint32(26).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): PositionSettledEvent { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBasePositionSettledEvent(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBasePositionSettledEvent() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.pair = reader.string(); - break; + message.pair = reader.string() + break case 2: - message.traderAddress = reader.string(); - break; + message.traderAddress = reader.string() + break case 3: - message.settledCoins.push(Coin.decode(reader, reader.uint32())); - break; + message.settledCoins.push(Coin.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): PositionSettledEvent { return { pair: isSet(object.pair) ? String(object.pair) : "", traderAddress: isSet(object.traderAddress) ? String(object.traderAddress) : "", - settledCoins: Array.isArray(object?.settledCoins) ? object.settledCoins.map((e: any) => Coin.fromJSON(e)) : [], - }; + settledCoins: Array.isArray(object?.settledCoins) + ? object.settledCoins.map((e: any) => Coin.fromJSON(e)) + : [], + } }, toJSON(message: PositionSettledEvent): unknown { - const obj: any = {}; - message.pair !== undefined && (obj.pair = message.pair); - message.traderAddress !== undefined && (obj.traderAddress = message.traderAddress); + const obj: any = {} + message.pair !== undefined && (obj.pair = message.pair) + message.traderAddress !== undefined && (obj.traderAddress = message.traderAddress) if (message.settledCoins) { - obj.settledCoins = message.settledCoins.map((e) => e ? Coin.toJSON(e) : undefined); + obj.settledCoins = message.settledCoins.map((e) => + e ? Coin.toJSON(e) : undefined, + ) } else { - obj.settledCoins = []; + obj.settledCoins = [] } - return obj; + return obj }, - fromPartial, I>>(object: I): PositionSettledEvent { - const message = createBasePositionSettledEvent(); - message.pair = object.pair ?? ""; - message.traderAddress = object.traderAddress ?? ""; - message.settledCoins = object.settledCoins?.map((e) => Coin.fromPartial(e)) || []; - return message; + fromPartial, I>>( + object: I, + ): PositionSettledEvent { + const message = createBasePositionSettledEvent() + message.pair = object.pair ?? "" + message.traderAddress = object.traderAddress ?? "" + message.settledCoins = object.settledCoins?.map((e) => Coin.fromPartial(e)) || [] + return message }, -}; +} function createBaseFundingRateChangedEvent(): FundingRateChangedEvent { return { @@ -700,75 +780,78 @@ function createBaseFundingRateChangedEvent(): FundingRateChangedEvent { cumulativePremiumFraction: "", blockHeight: Long.ZERO, blockTimeMs: Long.ZERO, - }; + } } export const FundingRateChangedEvent = { - encode(message: FundingRateChangedEvent, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: FundingRateChangedEvent, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.pair !== "") { - writer.uint32(10).string(message.pair); + writer.uint32(10).string(message.pair) } if (message.markPrice !== "") { - writer.uint32(18).string(message.markPrice); + writer.uint32(18).string(message.markPrice) } if (message.indexPrice !== "") { - writer.uint32(26).string(message.indexPrice); + writer.uint32(26).string(message.indexPrice) } if (message.latestFundingRate !== "") { - writer.uint32(34).string(message.latestFundingRate); + writer.uint32(34).string(message.latestFundingRate) } if (message.latestPremiumFraction !== "") { - writer.uint32(42).string(message.latestPremiumFraction); + writer.uint32(42).string(message.latestPremiumFraction) } if (message.cumulativePremiumFraction !== "") { - writer.uint32(50).string(message.cumulativePremiumFraction); + writer.uint32(50).string(message.cumulativePremiumFraction) } if (!message.blockHeight.isZero()) { - writer.uint32(56).int64(message.blockHeight); + writer.uint32(56).int64(message.blockHeight) } if (!message.blockTimeMs.isZero()) { - writer.uint32(64).int64(message.blockTimeMs); + writer.uint32(64).int64(message.blockTimeMs) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): FundingRateChangedEvent { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseFundingRateChangedEvent(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseFundingRateChangedEvent() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.pair = reader.string(); - break; + message.pair = reader.string() + break case 2: - message.markPrice = reader.string(); - break; + message.markPrice = reader.string() + break case 3: - message.indexPrice = reader.string(); - break; + message.indexPrice = reader.string() + break case 4: - message.latestFundingRate = reader.string(); - break; + message.latestFundingRate = reader.string() + break case 5: - message.latestPremiumFraction = reader.string(); - break; + message.latestPremiumFraction = reader.string() + break case 6: - message.cumulativePremiumFraction = reader.string(); - break; + message.cumulativePremiumFraction = reader.string() + break case 7: - message.blockHeight = reader.int64() as Long; - break; + message.blockHeight = reader.int64() as Long + break case 8: - message.blockTimeMs = reader.int64() as Long; - break; + message.blockTimeMs = reader.int64() as Long + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): FundingRateChangedEvent { @@ -776,94 +859,113 @@ export const FundingRateChangedEvent = { pair: isSet(object.pair) ? String(object.pair) : "", markPrice: isSet(object.markPrice) ? String(object.markPrice) : "", indexPrice: isSet(object.indexPrice) ? String(object.indexPrice) : "", - latestFundingRate: isSet(object.latestFundingRate) ? String(object.latestFundingRate) : "", - latestPremiumFraction: isSet(object.latestPremiumFraction) ? String(object.latestPremiumFraction) : "", + latestFundingRate: isSet(object.latestFundingRate) + ? String(object.latestFundingRate) + : "", + latestPremiumFraction: isSet(object.latestPremiumFraction) + ? String(object.latestPremiumFraction) + : "", cumulativePremiumFraction: isSet(object.cumulativePremiumFraction) ? String(object.cumulativePremiumFraction) : "", - blockHeight: isSet(object.blockHeight) ? Long.fromValue(object.blockHeight) : Long.ZERO, - blockTimeMs: isSet(object.blockTimeMs) ? Long.fromValue(object.blockTimeMs) : Long.ZERO, - }; + blockHeight: isSet(object.blockHeight) + ? Long.fromValue(object.blockHeight) + : Long.ZERO, + blockTimeMs: isSet(object.blockTimeMs) + ? Long.fromValue(object.blockTimeMs) + : Long.ZERO, + } }, toJSON(message: FundingRateChangedEvent): unknown { - const obj: any = {}; - message.pair !== undefined && (obj.pair = message.pair); - message.markPrice !== undefined && (obj.markPrice = message.markPrice); - message.indexPrice !== undefined && (obj.indexPrice = message.indexPrice); - message.latestFundingRate !== undefined && (obj.latestFundingRate = message.latestFundingRate); - message.latestPremiumFraction !== undefined && (obj.latestPremiumFraction = message.latestPremiumFraction); + const obj: any = {} + message.pair !== undefined && (obj.pair = message.pair) + message.markPrice !== undefined && (obj.markPrice = message.markPrice) + message.indexPrice !== undefined && (obj.indexPrice = message.indexPrice) + message.latestFundingRate !== undefined && + (obj.latestFundingRate = message.latestFundingRate) + message.latestPremiumFraction !== undefined && + (obj.latestPremiumFraction = message.latestPremiumFraction) message.cumulativePremiumFraction !== undefined && - (obj.cumulativePremiumFraction = message.cumulativePremiumFraction); - message.blockHeight !== undefined && (obj.blockHeight = (message.blockHeight || Long.ZERO).toString()); - message.blockTimeMs !== undefined && (obj.blockTimeMs = (message.blockTimeMs || Long.ZERO).toString()); - return obj; + (obj.cumulativePremiumFraction = message.cumulativePremiumFraction) + message.blockHeight !== undefined && + (obj.blockHeight = (message.blockHeight || Long.ZERO).toString()) + message.blockTimeMs !== undefined && + (obj.blockTimeMs = (message.blockTimeMs || Long.ZERO).toString()) + return obj }, - fromPartial, I>>(object: I): FundingRateChangedEvent { - const message = createBaseFundingRateChangedEvent(); - message.pair = object.pair ?? ""; - message.markPrice = object.markPrice ?? ""; - message.indexPrice = object.indexPrice ?? ""; - message.latestFundingRate = object.latestFundingRate ?? ""; - message.latestPremiumFraction = object.latestPremiumFraction ?? ""; - message.cumulativePremiumFraction = object.cumulativePremiumFraction ?? ""; - message.blockHeight = (object.blockHeight !== undefined && object.blockHeight !== null) - ? Long.fromValue(object.blockHeight) - : Long.ZERO; - message.blockTimeMs = (object.blockTimeMs !== undefined && object.blockTimeMs !== null) - ? Long.fromValue(object.blockTimeMs) - : Long.ZERO; - return message; + fromPartial, I>>( + object: I, + ): FundingRateChangedEvent { + const message = createBaseFundingRateChangedEvent() + message.pair = object.pair ?? "" + message.markPrice = object.markPrice ?? "" + message.indexPrice = object.indexPrice ?? "" + message.latestFundingRate = object.latestFundingRate ?? "" + message.latestPremiumFraction = object.latestPremiumFraction ?? "" + message.cumulativePremiumFraction = object.cumulativePremiumFraction ?? "" + message.blockHeight = + object.blockHeight !== undefined && object.blockHeight !== null + ? Long.fromValue(object.blockHeight) + : Long.ZERO + message.blockTimeMs = + object.blockTimeMs !== undefined && object.blockTimeMs !== null + ? Long.fromValue(object.blockTimeMs) + : Long.ZERO + return message }, -}; +} function createBaseLiquidationFailedEvent(): LiquidationFailedEvent { - return { pair: "", trader: "", liquidator: "", reason: 0 }; + return { pair: "", trader: "", liquidator: "", reason: 0 } } export const LiquidationFailedEvent = { - encode(message: LiquidationFailedEvent, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: LiquidationFailedEvent, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.pair !== "") { - writer.uint32(10).string(message.pair); + writer.uint32(10).string(message.pair) } if (message.trader !== "") { - writer.uint32(18).string(message.trader); + writer.uint32(18).string(message.trader) } if (message.liquidator !== "") { - writer.uint32(26).string(message.liquidator); + writer.uint32(26).string(message.liquidator) } if (message.reason !== 0) { - writer.uint32(32).int32(message.reason); + writer.uint32(32).int32(message.reason) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): LiquidationFailedEvent { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseLiquidationFailedEvent(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseLiquidationFailedEvent() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.pair = reader.string(); - break; + message.pair = reader.string() + break case 2: - message.trader = reader.string(); - break; + message.trader = reader.string() + break case 3: - message.liquidator = reader.string(); - break; + message.liquidator = reader.string() + break case 4: - message.reason = reader.int32() as any; - break; + message.reason = reader.int32() as any + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): LiquidationFailedEvent { @@ -871,87 +973,101 @@ export const LiquidationFailedEvent = { pair: isSet(object.pair) ? String(object.pair) : "", trader: isSet(object.trader) ? String(object.trader) : "", liquidator: isSet(object.liquidator) ? String(object.liquidator) : "", - reason: isSet(object.reason) ? liquidationFailedEvent_LiquidationFailedReasonFromJSON(object.reason) : 0, - }; + reason: isSet(object.reason) + ? liquidationFailedEvent_LiquidationFailedReasonFromJSON(object.reason) + : 0, + } }, toJSON(message: LiquidationFailedEvent): unknown { - const obj: any = {}; - message.pair !== undefined && (obj.pair = message.pair); - message.trader !== undefined && (obj.trader = message.trader); - message.liquidator !== undefined && (obj.liquidator = message.liquidator); - message.reason !== undefined && (obj.reason = liquidationFailedEvent_LiquidationFailedReasonToJSON(message.reason)); - return obj; + const obj: any = {} + message.pair !== undefined && (obj.pair = message.pair) + message.trader !== undefined && (obj.trader = message.trader) + message.liquidator !== undefined && (obj.liquidator = message.liquidator) + message.reason !== undefined && + (obj.reason = liquidationFailedEvent_LiquidationFailedReasonToJSON( + message.reason, + )) + return obj }, - fromPartial, I>>(object: I): LiquidationFailedEvent { - const message = createBaseLiquidationFailedEvent(); - message.pair = object.pair ?? ""; - message.trader = object.trader ?? ""; - message.liquidator = object.liquidator ?? ""; - message.reason = object.reason ?? 0; - return message; + fromPartial, I>>( + object: I, + ): LiquidationFailedEvent { + const message = createBaseLiquidationFailedEvent() + message.pair = object.pair ?? "" + message.trader = object.trader ?? "" + message.liquidator = object.liquidator ?? "" + message.reason = object.reason ?? 0 + return message }, -}; +} function createBaseMetricsEvent(): MetricsEvent { - return { pair: "", netSize: "", volumeQuote: "", volumeBase: "", blockHeight: Long.ZERO, blockTimeMs: Long.ZERO }; + return { + pair: "", + netSize: "", + volumeQuote: "", + volumeBase: "", + blockHeight: Long.ZERO, + blockTimeMs: Long.ZERO, + } } export const MetricsEvent = { encode(message: MetricsEvent, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.pair !== "") { - writer.uint32(10).string(message.pair); + writer.uint32(10).string(message.pair) } if (message.netSize !== "") { - writer.uint32(18).string(message.netSize); + writer.uint32(18).string(message.netSize) } if (message.volumeQuote !== "") { - writer.uint32(26).string(message.volumeQuote); + writer.uint32(26).string(message.volumeQuote) } if (message.volumeBase !== "") { - writer.uint32(34).string(message.volumeBase); + writer.uint32(34).string(message.volumeBase) } if (!message.blockHeight.isZero()) { - writer.uint32(40).int64(message.blockHeight); + writer.uint32(40).int64(message.blockHeight) } if (!message.blockTimeMs.isZero()) { - writer.uint32(48).int64(message.blockTimeMs); + writer.uint32(48).int64(message.blockTimeMs) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MetricsEvent { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMetricsEvent(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMetricsEvent() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.pair = reader.string(); - break; + message.pair = reader.string() + break case 2: - message.netSize = reader.string(); - break; + message.netSize = reader.string() + break case 3: - message.volumeQuote = reader.string(); - break; + message.volumeQuote = reader.string() + break case 4: - message.volumeBase = reader.string(); - break; + message.volumeBase = reader.string() + break case 5: - message.blockHeight = reader.int64() as Long; - break; + message.blockHeight = reader.int64() as Long + break case 6: - message.blockTimeMs = reader.int64() as Long; - break; + message.blockTimeMs = reader.int64() as Long + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): MetricsEvent { @@ -960,55 +1076,73 @@ export const MetricsEvent = { netSize: isSet(object.netSize) ? String(object.netSize) : "", volumeQuote: isSet(object.volumeQuote) ? String(object.volumeQuote) : "", volumeBase: isSet(object.volumeBase) ? String(object.volumeBase) : "", - blockHeight: isSet(object.blockHeight) ? Long.fromValue(object.blockHeight) : Long.ZERO, - blockTimeMs: isSet(object.blockTimeMs) ? Long.fromValue(object.blockTimeMs) : Long.ZERO, - }; + blockHeight: isSet(object.blockHeight) + ? Long.fromValue(object.blockHeight) + : Long.ZERO, + blockTimeMs: isSet(object.blockTimeMs) + ? Long.fromValue(object.blockTimeMs) + : Long.ZERO, + } }, toJSON(message: MetricsEvent): unknown { - const obj: any = {}; - message.pair !== undefined && (obj.pair = message.pair); - message.netSize !== undefined && (obj.netSize = message.netSize); - message.volumeQuote !== undefined && (obj.volumeQuote = message.volumeQuote); - message.volumeBase !== undefined && (obj.volumeBase = message.volumeBase); - message.blockHeight !== undefined && (obj.blockHeight = (message.blockHeight || Long.ZERO).toString()); - message.blockTimeMs !== undefined && (obj.blockTimeMs = (message.blockTimeMs || Long.ZERO).toString()); - return obj; + const obj: any = {} + message.pair !== undefined && (obj.pair = message.pair) + message.netSize !== undefined && (obj.netSize = message.netSize) + message.volumeQuote !== undefined && (obj.volumeQuote = message.volumeQuote) + message.volumeBase !== undefined && (obj.volumeBase = message.volumeBase) + message.blockHeight !== undefined && + (obj.blockHeight = (message.blockHeight || Long.ZERO).toString()) + message.blockTimeMs !== undefined && + (obj.blockTimeMs = (message.blockTimeMs || Long.ZERO).toString()) + return obj }, fromPartial, I>>(object: I): MetricsEvent { - const message = createBaseMetricsEvent(); - message.pair = object.pair ?? ""; - message.netSize = object.netSize ?? ""; - message.volumeQuote = object.volumeQuote ?? ""; - message.volumeBase = object.volumeBase ?? ""; - message.blockHeight = (object.blockHeight !== undefined && object.blockHeight !== null) - ? Long.fromValue(object.blockHeight) - : Long.ZERO; - message.blockTimeMs = (object.blockTimeMs !== undefined && object.blockTimeMs !== null) - ? Long.fromValue(object.blockTimeMs) - : Long.ZERO; - return message; + const message = createBaseMetricsEvent() + message.pair = object.pair ?? "" + message.netSize = object.netSize ?? "" + message.volumeQuote = object.volumeQuote ?? "" + message.volumeBase = object.volumeBase ?? "" + message.blockHeight = + object.blockHeight !== undefined && object.blockHeight !== null + ? Long.fromValue(object.blockHeight) + : Long.ZERO + message.blockTimeMs = + object.blockTimeMs !== undefined && object.blockTimeMs !== null + ? Long.fromValue(object.blockTimeMs) + : Long.ZERO + return message }, -}; +} -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/perp/v1/genesis.ts b/packages/protojs/src/perp/v1/genesis.ts index 2bb3249f..d289607c 100644 --- a/packages/protojs/src/perp/v1/genesis.ts +++ b/packages/protojs/src/perp/v1/genesis.ts @@ -1,64 +1,64 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { PairMetadata, Params, Position, PrepaidBadDebt } from "./state"; +import { Params, PairMetadata, Position, PrepaidBadDebt } from "./state" +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "nibiru.perp.v1"; +export const protobufPackage = "nibiru.perp.v1" /** GenesisState defines the perp module's genesis state. */ export interface GenesisState { - params?: Params; - pairMetadata: PairMetadata[]; - positions: Position[]; - prepaidBadDebts: PrepaidBadDebt[]; + params?: Params + pairMetadata: PairMetadata[] + positions: Position[] + prepaidBadDebts: PrepaidBadDebt[] } function createBaseGenesisState(): GenesisState { - return { params: undefined, pairMetadata: [], positions: [], prepaidBadDebts: [] }; + return { params: undefined, pairMetadata: [], positions: [], prepaidBadDebts: [] } } export const GenesisState = { encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.params !== undefined) { - Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + Params.encode(message.params, writer.uint32(10).fork()).ldelim() } for (const v of message.pairMetadata) { - PairMetadata.encode(v!, writer.uint32(18).fork()).ldelim(); + PairMetadata.encode(v!, writer.uint32(18).fork()).ldelim() } for (const v of message.positions) { - Position.encode(v!, writer.uint32(26).fork()).ldelim(); + Position.encode(v!, writer.uint32(26).fork()).ldelim() } for (const v of message.prepaidBadDebts) { - PrepaidBadDebt.encode(v!, writer.uint32(34).fork()).ldelim(); + PrepaidBadDebt.encode(v!, writer.uint32(34).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGenesisState(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseGenesisState() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.params = Params.decode(reader, reader.uint32()); - break; + message.params = Params.decode(reader, reader.uint32()) + break case 2: - message.pairMetadata.push(PairMetadata.decode(reader, reader.uint32())); - break; + message.pairMetadata.push(PairMetadata.decode(reader, reader.uint32())) + break case 3: - message.positions.push(Position.decode(reader, reader.uint32())); - break; + message.positions.push(Position.decode(reader, reader.uint32())) + break case 4: - message.prepaidBadDebts.push(PrepaidBadDebt.decode(reader, reader.uint32())); - break; + message.prepaidBadDebts.push(PrepaidBadDebt.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): GenesisState { @@ -67,63 +67,83 @@ export const GenesisState = { pairMetadata: Array.isArray(object?.pairMetadata) ? object.pairMetadata.map((e: any) => PairMetadata.fromJSON(e)) : [], - positions: Array.isArray(object?.positions) ? object.positions.map((e: any) => Position.fromJSON(e)) : [], + positions: Array.isArray(object?.positions) + ? object.positions.map((e: any) => Position.fromJSON(e)) + : [], prepaidBadDebts: Array.isArray(object?.prepaidBadDebts) ? object.prepaidBadDebts.map((e: any) => PrepaidBadDebt.fromJSON(e)) : [], - }; + } }, toJSON(message: GenesisState): unknown { - const obj: any = {}; - message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + const obj: any = {} + message.params !== undefined && + (obj.params = message.params ? Params.toJSON(message.params) : undefined) if (message.pairMetadata) { - obj.pairMetadata = message.pairMetadata.map((e) => e ? PairMetadata.toJSON(e) : undefined); + obj.pairMetadata = message.pairMetadata.map((e) => + e ? PairMetadata.toJSON(e) : undefined, + ) } else { - obj.pairMetadata = []; + obj.pairMetadata = [] } if (message.positions) { - obj.positions = message.positions.map((e) => e ? Position.toJSON(e) : undefined); + obj.positions = message.positions.map((e) => (e ? Position.toJSON(e) : undefined)) } else { - obj.positions = []; + obj.positions = [] } if (message.prepaidBadDebts) { - obj.prepaidBadDebts = message.prepaidBadDebts.map((e) => e ? PrepaidBadDebt.toJSON(e) : undefined); + obj.prepaidBadDebts = message.prepaidBadDebts.map((e) => + e ? PrepaidBadDebt.toJSON(e) : undefined, + ) } else { - obj.prepaidBadDebts = []; + obj.prepaidBadDebts = [] } - return obj; + return obj }, fromPartial, I>>(object: I): GenesisState { - const message = createBaseGenesisState(); - message.params = (object.params !== undefined && object.params !== null) - ? Params.fromPartial(object.params) - : undefined; - message.pairMetadata = object.pairMetadata?.map((e) => PairMetadata.fromPartial(e)) || []; - message.positions = object.positions?.map((e) => Position.fromPartial(e)) || []; - message.prepaidBadDebts = object.prepaidBadDebts?.map((e) => PrepaidBadDebt.fromPartial(e)) || []; - return message; + const message = createBaseGenesisState() + message.params = + object.params !== undefined && object.params !== null + ? Params.fromPartial(object.params) + : undefined + message.pairMetadata = + object.pairMetadata?.map((e) => PairMetadata.fromPartial(e)) || [] + message.positions = object.positions?.map((e) => Position.fromPartial(e)) || [] + message.prepaidBadDebts = + object.prepaidBadDebts?.map((e) => PrepaidBadDebt.fromPartial(e)) || [] + return message }, -}; +} -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/perp/v1/query.ts b/packages/protojs/src/perp/v1/query.ts index 49273286..f1fdc297 100644 --- a/packages/protojs/src/perp/v1/query.ts +++ b/packages/protojs/src/perp/v1/query.ts @@ -1,27 +1,26 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { Metrics, Params, Position } from "./state"; +import { Params, Position, Metrics } from "./state" +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "nibiru.perp.v1"; +export const protobufPackage = "nibiru.perp.v1" /** QueryParamsRequest is request type for the Query/Params RPC method. */ -export interface QueryParamsRequest { -} +export interface QueryParamsRequest {} /** QueryParamsResponse is response type for the Query/Params RPC method. */ export interface QueryParamsResponse { /** params holds all the parameters of this module. */ - params?: Params; + params?: Params } /** ---------------------------------------- Positions */ export interface QueryPositionsRequest { - trader: string; + trader: string } export interface QueryPositionsResponse { - positions: QueryPositionResponse[]; + positions: QueryPositionResponse[] } /** @@ -29,220 +28,241 @@ export interface QueryPositionsResponse { * module account. */ export interface QueryPositionRequest { - pair: string; - trader: string; + pair: string + trader: string } export interface QueryPositionResponse { /** The position as it exists in the blockchain state */ - position?: Position; + position?: Position /** * The position's current notional value, if it were to be entirely closed (in * margin units). */ - positionNotional: string; + positionNotional: string /** The position's unrealized PnL. */ - unrealizedPnl: string; + unrealizedPnl: string /** * margin ratio of the position based on the mark price, mark TWAP. The higher * value of the possible margin ratios (TWAP and instantaneous) is taken to be * 'marginRatioMark'. Calculated from margin, unrealized PnL, and position * notional. */ - marginRatioMark: string; + marginRatioMark: string /** * margin ratio of the position based on the index price. Calculated from * margin, unrealized PnL, and position notional. */ - marginRatioIndex: string; + marginRatioIndex: string /** BlockNumber is current block number at the time of query. */ - blockNumber: Long; + blockNumber: Long } export interface QueryCumulativePremiumFractionRequest { /** the pair to query for */ - pair: string; + pair: string } export interface QueryCumulativePremiumFractionResponse { /** The latest cumulative premium fraction. */ - cumulativePremiumFraction: string; - estimatedNextCumulativePremiumFraction: string; + cumulativePremiumFraction: string + estimatedNextCumulativePremiumFraction: string } export interface QueryMetricsRequest { /** the pair to query for */ - pair: string; + pair: string } export interface QueryMetricsResponse { /** list of perp metrics */ - metrics?: Metrics; + metrics?: Metrics } function createBaseQueryParamsRequest(): QueryParamsRequest { - return {}; + return {} } export const QueryParamsRequest = { encode(_: QueryParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryParamsRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryParamsRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(_: any): QueryParamsRequest { - return {}; + return {} }, toJSON(_: QueryParamsRequest): unknown { - const obj: any = {}; - return obj; + const obj: any = {} + return obj }, - fromPartial, I>>(_: I): QueryParamsRequest { - const message = createBaseQueryParamsRequest(); - return message; + fromPartial, I>>( + _: I, + ): QueryParamsRequest { + const message = createBaseQueryParamsRequest() + return message }, -}; +} function createBaseQueryParamsResponse(): QueryParamsResponse { - return { params: undefined }; + return { params: undefined } } export const QueryParamsResponse = { - encode(message: QueryParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryParamsResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.params !== undefined) { - Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + Params.encode(message.params, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryParamsResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryParamsResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.params = Params.decode(reader, reader.uint32()); - break; + message.params = Params.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryParamsResponse { - return { params: isSet(object.params) ? Params.fromJSON(object.params) : undefined }; + return { + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined, + } }, toJSON(message: QueryParamsResponse): unknown { - const obj: any = {}; - message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); - return obj; + const obj: any = {} + message.params !== undefined && + (obj.params = message.params ? Params.toJSON(message.params) : undefined) + return obj }, - fromPartial, I>>(object: I): QueryParamsResponse { - const message = createBaseQueryParamsResponse(); - message.params = (object.params !== undefined && object.params !== null) - ? Params.fromPartial(object.params) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): QueryParamsResponse { + const message = createBaseQueryParamsResponse() + message.params = + object.params !== undefined && object.params !== null + ? Params.fromPartial(object.params) + : undefined + return message }, -}; +} function createBaseQueryPositionsRequest(): QueryPositionsRequest { - return { trader: "" }; + return { trader: "" } } export const QueryPositionsRequest = { - encode(message: QueryPositionsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryPositionsRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.trader !== "") { - writer.uint32(10).string(message.trader); + writer.uint32(10).string(message.trader) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryPositionsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryPositionsRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryPositionsRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.trader = reader.string(); - break; + message.trader = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryPositionsRequest { - return { trader: isSet(object.trader) ? String(object.trader) : "" }; + return { + trader: isSet(object.trader) ? String(object.trader) : "", + } }, toJSON(message: QueryPositionsRequest): unknown { - const obj: any = {}; - message.trader !== undefined && (obj.trader = message.trader); - return obj; + const obj: any = {} + message.trader !== undefined && (obj.trader = message.trader) + return obj }, - fromPartial, I>>(object: I): QueryPositionsRequest { - const message = createBaseQueryPositionsRequest(); - message.trader = object.trader ?? ""; - return message; + fromPartial, I>>( + object: I, + ): QueryPositionsRequest { + const message = createBaseQueryPositionsRequest() + message.trader = object.trader ?? "" + return message }, -}; +} function createBaseQueryPositionsResponse(): QueryPositionsResponse { - return { positions: [] }; + return { positions: [] } } export const QueryPositionsResponse = { - encode(message: QueryPositionsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryPositionsResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { for (const v of message.positions) { - QueryPositionResponse.encode(v!, writer.uint32(10).fork()).ldelim(); + QueryPositionResponse.encode(v!, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryPositionsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryPositionsResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryPositionsResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.positions.push(QueryPositionResponse.decode(reader, reader.uint32())); - break; + message.positions.push(QueryPositionResponse.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryPositionsResponse { @@ -250,83 +270,93 @@ export const QueryPositionsResponse = { positions: Array.isArray(object?.positions) ? object.positions.map((e: any) => QueryPositionResponse.fromJSON(e)) : [], - }; + } }, toJSON(message: QueryPositionsResponse): unknown { - const obj: any = {}; + const obj: any = {} if (message.positions) { - obj.positions = message.positions.map((e) => e ? QueryPositionResponse.toJSON(e) : undefined); + obj.positions = message.positions.map((e) => + e ? QueryPositionResponse.toJSON(e) : undefined, + ) } else { - obj.positions = []; + obj.positions = [] } - return obj; + return obj }, - fromPartial, I>>(object: I): QueryPositionsResponse { - const message = createBaseQueryPositionsResponse(); - message.positions = object.positions?.map((e) => QueryPositionResponse.fromPartial(e)) || []; - return message; + fromPartial, I>>( + object: I, + ): QueryPositionsResponse { + const message = createBaseQueryPositionsResponse() + message.positions = + object.positions?.map((e) => QueryPositionResponse.fromPartial(e)) || [] + return message }, -}; +} function createBaseQueryPositionRequest(): QueryPositionRequest { - return { pair: "", trader: "" }; + return { pair: "", trader: "" } } export const QueryPositionRequest = { - encode(message: QueryPositionRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryPositionRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.pair !== "") { - writer.uint32(10).string(message.pair); + writer.uint32(10).string(message.pair) } if (message.trader !== "") { - writer.uint32(18).string(message.trader); + writer.uint32(18).string(message.trader) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryPositionRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryPositionRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryPositionRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.pair = reader.string(); - break; + message.pair = reader.string() + break case 2: - message.trader = reader.string(); - break; + message.trader = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryPositionRequest { return { pair: isSet(object.pair) ? String(object.pair) : "", trader: isSet(object.trader) ? String(object.trader) : "", - }; + } }, toJSON(message: QueryPositionRequest): unknown { - const obj: any = {}; - message.pair !== undefined && (obj.pair = message.pair); - message.trader !== undefined && (obj.trader = message.trader); - return obj; + const obj: any = {} + message.pair !== undefined && (obj.pair = message.pair) + message.trader !== undefined && (obj.trader = message.trader) + return obj }, - fromPartial, I>>(object: I): QueryPositionRequest { - const message = createBaseQueryPositionRequest(); - message.pair = object.pair ?? ""; - message.trader = object.trader ?? ""; - return message; + fromPartial, I>>( + object: I, + ): QueryPositionRequest { + const message = createBaseQueryPositionRequest() + message.pair = object.pair ?? "" + message.trader = object.trader ?? "" + return message }, -}; +} function createBaseQueryPositionResponse(): QueryPositionResponse { return { @@ -336,186 +366,220 @@ function createBaseQueryPositionResponse(): QueryPositionResponse { marginRatioMark: "", marginRatioIndex: "", blockNumber: Long.ZERO, - }; + } } export const QueryPositionResponse = { - encode(message: QueryPositionResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryPositionResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.position !== undefined) { - Position.encode(message.position, writer.uint32(10).fork()).ldelim(); + Position.encode(message.position, writer.uint32(10).fork()).ldelim() } if (message.positionNotional !== "") { - writer.uint32(18).string(message.positionNotional); + writer.uint32(18).string(message.positionNotional) } if (message.unrealizedPnl !== "") { - writer.uint32(26).string(message.unrealizedPnl); + writer.uint32(26).string(message.unrealizedPnl) } if (message.marginRatioMark !== "") { - writer.uint32(34).string(message.marginRatioMark); + writer.uint32(34).string(message.marginRatioMark) } if (message.marginRatioIndex !== "") { - writer.uint32(42).string(message.marginRatioIndex); + writer.uint32(42).string(message.marginRatioIndex) } if (!message.blockNumber.isZero()) { - writer.uint32(56).int64(message.blockNumber); + writer.uint32(56).int64(message.blockNumber) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryPositionResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryPositionResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryPositionResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.position = Position.decode(reader, reader.uint32()); - break; + message.position = Position.decode(reader, reader.uint32()) + break case 2: - message.positionNotional = reader.string(); - break; + message.positionNotional = reader.string() + break case 3: - message.unrealizedPnl = reader.string(); - break; + message.unrealizedPnl = reader.string() + break case 4: - message.marginRatioMark = reader.string(); - break; + message.marginRatioMark = reader.string() + break case 5: - message.marginRatioIndex = reader.string(); - break; + message.marginRatioIndex = reader.string() + break case 7: - message.blockNumber = reader.int64() as Long; - break; + message.blockNumber = reader.int64() as Long + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryPositionResponse { return { position: isSet(object.position) ? Position.fromJSON(object.position) : undefined, - positionNotional: isSet(object.positionNotional) ? String(object.positionNotional) : "", + positionNotional: isSet(object.positionNotional) + ? String(object.positionNotional) + : "", unrealizedPnl: isSet(object.unrealizedPnl) ? String(object.unrealizedPnl) : "", - marginRatioMark: isSet(object.marginRatioMark) ? String(object.marginRatioMark) : "", - marginRatioIndex: isSet(object.marginRatioIndex) ? String(object.marginRatioIndex) : "", - blockNumber: isSet(object.blockNumber) ? Long.fromValue(object.blockNumber) : Long.ZERO, - }; + marginRatioMark: isSet(object.marginRatioMark) + ? String(object.marginRatioMark) + : "", + marginRatioIndex: isSet(object.marginRatioIndex) + ? String(object.marginRatioIndex) + : "", + blockNumber: isSet(object.blockNumber) + ? Long.fromValue(object.blockNumber) + : Long.ZERO, + } }, toJSON(message: QueryPositionResponse): unknown { - const obj: any = {}; - message.position !== undefined && (obj.position = message.position ? Position.toJSON(message.position) : undefined); - message.positionNotional !== undefined && (obj.positionNotional = message.positionNotional); - message.unrealizedPnl !== undefined && (obj.unrealizedPnl = message.unrealizedPnl); - message.marginRatioMark !== undefined && (obj.marginRatioMark = message.marginRatioMark); - message.marginRatioIndex !== undefined && (obj.marginRatioIndex = message.marginRatioIndex); - message.blockNumber !== undefined && (obj.blockNumber = (message.blockNumber || Long.ZERO).toString()); - return obj; - }, - - fromPartial, I>>(object: I): QueryPositionResponse { - const message = createBaseQueryPositionResponse(); - message.position = (object.position !== undefined && object.position !== null) - ? Position.fromPartial(object.position) - : undefined; - message.positionNotional = object.positionNotional ?? ""; - message.unrealizedPnl = object.unrealizedPnl ?? ""; - message.marginRatioMark = object.marginRatioMark ?? ""; - message.marginRatioIndex = object.marginRatioIndex ?? ""; - message.blockNumber = (object.blockNumber !== undefined && object.blockNumber !== null) - ? Long.fromValue(object.blockNumber) - : Long.ZERO; - return message; - }, -}; + const obj: any = {} + message.position !== undefined && + (obj.position = message.position ? Position.toJSON(message.position) : undefined) + message.positionNotional !== undefined && + (obj.positionNotional = message.positionNotional) + message.unrealizedPnl !== undefined && (obj.unrealizedPnl = message.unrealizedPnl) + message.marginRatioMark !== undefined && + (obj.marginRatioMark = message.marginRatioMark) + message.marginRatioIndex !== undefined && + (obj.marginRatioIndex = message.marginRatioIndex) + message.blockNumber !== undefined && + (obj.blockNumber = (message.blockNumber || Long.ZERO).toString()) + return obj + }, + + fromPartial, I>>( + object: I, + ): QueryPositionResponse { + const message = createBaseQueryPositionResponse() + message.position = + object.position !== undefined && object.position !== null + ? Position.fromPartial(object.position) + : undefined + message.positionNotional = object.positionNotional ?? "" + message.unrealizedPnl = object.unrealizedPnl ?? "" + message.marginRatioMark = object.marginRatioMark ?? "" + message.marginRatioIndex = object.marginRatioIndex ?? "" + message.blockNumber = + object.blockNumber !== undefined && object.blockNumber !== null + ? Long.fromValue(object.blockNumber) + : Long.ZERO + return message + }, +} function createBaseQueryCumulativePremiumFractionRequest(): QueryCumulativePremiumFractionRequest { - return { pair: "" }; + return { pair: "" } } export const QueryCumulativePremiumFractionRequest = { - encode(message: QueryCumulativePremiumFractionRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryCumulativePremiumFractionRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.pair !== "") { - writer.uint32(10).string(message.pair); + writer.uint32(10).string(message.pair) } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryCumulativePremiumFractionRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryCumulativePremiumFractionRequest(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryCumulativePremiumFractionRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryCumulativePremiumFractionRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.pair = reader.string(); - break; + message.pair = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryCumulativePremiumFractionRequest { - return { pair: isSet(object.pair) ? String(object.pair) : "" }; + return { + pair: isSet(object.pair) ? String(object.pair) : "", + } }, toJSON(message: QueryCumulativePremiumFractionRequest): unknown { - const obj: any = {}; - message.pair !== undefined && (obj.pair = message.pair); - return obj; + const obj: any = {} + message.pair !== undefined && (obj.pair = message.pair) + return obj }, fromPartial, I>>( object: I, ): QueryCumulativePremiumFractionRequest { - const message = createBaseQueryCumulativePremiumFractionRequest(); - message.pair = object.pair ?? ""; - return message; + const message = createBaseQueryCumulativePremiumFractionRequest() + message.pair = object.pair ?? "" + return message }, -}; +} function createBaseQueryCumulativePremiumFractionResponse(): QueryCumulativePremiumFractionResponse { - return { cumulativePremiumFraction: "", estimatedNextCumulativePremiumFraction: "" }; + return { cumulativePremiumFraction: "", estimatedNextCumulativePremiumFraction: "" } } export const QueryCumulativePremiumFractionResponse = { - encode(message: QueryCumulativePremiumFractionResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryCumulativePremiumFractionResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.cumulativePremiumFraction !== "") { - writer.uint32(10).string(message.cumulativePremiumFraction); + writer.uint32(10).string(message.cumulativePremiumFraction) } if (message.estimatedNextCumulativePremiumFraction !== "") { - writer.uint32(18).string(message.estimatedNextCumulativePremiumFraction); + writer.uint32(18).string(message.estimatedNextCumulativePremiumFraction) } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryCumulativePremiumFractionResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryCumulativePremiumFractionResponse(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryCumulativePremiumFractionResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryCumulativePremiumFractionResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.cumulativePremiumFraction = reader.string(); - break; + message.cumulativePremiumFraction = reader.string() + break case 2: - message.estimatedNextCumulativePremiumFraction = reader.string(); - break; + message.estimatedNextCumulativePremiumFraction = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryCumulativePremiumFractionResponse { @@ -523,204 +587,240 @@ export const QueryCumulativePremiumFractionResponse = { cumulativePremiumFraction: isSet(object.cumulativePremiumFraction) ? String(object.cumulativePremiumFraction) : "", - estimatedNextCumulativePremiumFraction: isSet(object.estimatedNextCumulativePremiumFraction) + estimatedNextCumulativePremiumFraction: isSet( + object.estimatedNextCumulativePremiumFraction, + ) ? String(object.estimatedNextCumulativePremiumFraction) : "", - }; + } }, toJSON(message: QueryCumulativePremiumFractionResponse): unknown { - const obj: any = {}; + const obj: any = {} message.cumulativePremiumFraction !== undefined && - (obj.cumulativePremiumFraction = message.cumulativePremiumFraction); + (obj.cumulativePremiumFraction = message.cumulativePremiumFraction) message.estimatedNextCumulativePremiumFraction !== undefined && - (obj.estimatedNextCumulativePremiumFraction = message.estimatedNextCumulativePremiumFraction); - return obj; + (obj.estimatedNextCumulativePremiumFraction = + message.estimatedNextCumulativePremiumFraction) + return obj }, fromPartial, I>>( object: I, ): QueryCumulativePremiumFractionResponse { - const message = createBaseQueryCumulativePremiumFractionResponse(); - message.cumulativePremiumFraction = object.cumulativePremiumFraction ?? ""; - message.estimatedNextCumulativePremiumFraction = object.estimatedNextCumulativePremiumFraction ?? ""; - return message; + const message = createBaseQueryCumulativePremiumFractionResponse() + message.cumulativePremiumFraction = object.cumulativePremiumFraction ?? "" + message.estimatedNextCumulativePremiumFraction = + object.estimatedNextCumulativePremiumFraction ?? "" + return message }, -}; +} function createBaseQueryMetricsRequest(): QueryMetricsRequest { - return { pair: "" }; + return { pair: "" } } export const QueryMetricsRequest = { - encode(message: QueryMetricsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryMetricsRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.pair !== "") { - writer.uint32(10).string(message.pair); + writer.uint32(10).string(message.pair) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryMetricsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryMetricsRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryMetricsRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.pair = reader.string(); - break; + message.pair = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryMetricsRequest { - return { pair: isSet(object.pair) ? String(object.pair) : "" }; + return { + pair: isSet(object.pair) ? String(object.pair) : "", + } }, toJSON(message: QueryMetricsRequest): unknown { - const obj: any = {}; - message.pair !== undefined && (obj.pair = message.pair); - return obj; + const obj: any = {} + message.pair !== undefined && (obj.pair = message.pair) + return obj }, - fromPartial, I>>(object: I): QueryMetricsRequest { - const message = createBaseQueryMetricsRequest(); - message.pair = object.pair ?? ""; - return message; + fromPartial, I>>( + object: I, + ): QueryMetricsRequest { + const message = createBaseQueryMetricsRequest() + message.pair = object.pair ?? "" + return message }, -}; +} function createBaseQueryMetricsResponse(): QueryMetricsResponse { - return { metrics: undefined }; + return { metrics: undefined } } export const QueryMetricsResponse = { - encode(message: QueryMetricsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryMetricsResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.metrics !== undefined) { - Metrics.encode(message.metrics, writer.uint32(10).fork()).ldelim(); + Metrics.encode(message.metrics, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryMetricsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryMetricsResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryMetricsResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.metrics = Metrics.decode(reader, reader.uint32()); - break; + message.metrics = Metrics.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryMetricsResponse { - return { metrics: isSet(object.metrics) ? Metrics.fromJSON(object.metrics) : undefined }; + return { + metrics: isSet(object.metrics) ? Metrics.fromJSON(object.metrics) : undefined, + } }, toJSON(message: QueryMetricsResponse): unknown { - const obj: any = {}; - message.metrics !== undefined && (obj.metrics = message.metrics ? Metrics.toJSON(message.metrics) : undefined); - return obj; + const obj: any = {} + message.metrics !== undefined && + (obj.metrics = message.metrics ? Metrics.toJSON(message.metrics) : undefined) + return obj }, - fromPartial, I>>(object: I): QueryMetricsResponse { - const message = createBaseQueryMetricsResponse(); - message.metrics = (object.metrics !== undefined && object.metrics !== null) - ? Metrics.fromPartial(object.metrics) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): QueryMetricsResponse { + const message = createBaseQueryMetricsResponse() + message.metrics = + object.metrics !== undefined && object.metrics !== null + ? Metrics.fromPartial(object.metrics) + : undefined + return message }, -}; +} /** Query defines the gRPC querier service. */ export interface Query { /** Parameters queries the parameters of the x/perp module. */ - Params(request: QueryParamsRequest): Promise; - QueryPosition(request: QueryPositionRequest): Promise; - QueryPositions(request: QueryPositionsRequest): Promise; + Params(request: QueryParamsRequest): Promise + QueryPosition(request: QueryPositionRequest): Promise + QueryPositions(request: QueryPositionsRequest): Promise /** Queries the latest cumulative premium fraction and the estimated next cumulative premium fraction. */ CumulativePremiumFraction( request: QueryCumulativePremiumFractionRequest, - ): Promise; - Metrics(request: QueryMetricsRequest): Promise; + ): Promise + Metrics(request: QueryMetricsRequest): Promise } export class QueryClientImpl implements Query { - private readonly rpc: Rpc; + private readonly rpc: Rpc constructor(rpc: Rpc) { - this.rpc = rpc; - this.Params = this.Params.bind(this); - this.QueryPosition = this.QueryPosition.bind(this); - this.QueryPositions = this.QueryPositions.bind(this); - this.CumulativePremiumFraction = this.CumulativePremiumFraction.bind(this); - this.Metrics = this.Metrics.bind(this); + this.rpc = rpc + this.Params = this.Params.bind(this) + this.QueryPosition = this.QueryPosition.bind(this) + this.QueryPositions = this.QueryPositions.bind(this) + this.CumulativePremiumFraction = this.CumulativePremiumFraction.bind(this) + this.Metrics = this.Metrics.bind(this) } Params(request: QueryParamsRequest): Promise { - const data = QueryParamsRequest.encode(request).finish(); - const promise = this.rpc.request("nibiru.perp.v1.Query", "Params", data); - return promise.then((data) => QueryParamsResponse.decode(new _m0.Reader(data))); + const data = QueryParamsRequest.encode(request).finish() + const promise = this.rpc.request("nibiru.perp.v1.Query", "Params", data) + return promise.then((data) => QueryParamsResponse.decode(new _m0.Reader(data))) } QueryPosition(request: QueryPositionRequest): Promise { - const data = QueryPositionRequest.encode(request).finish(); - const promise = this.rpc.request("nibiru.perp.v1.Query", "QueryPosition", data); - return promise.then((data) => QueryPositionResponse.decode(new _m0.Reader(data))); + const data = QueryPositionRequest.encode(request).finish() + const promise = this.rpc.request("nibiru.perp.v1.Query", "QueryPosition", data) + return promise.then((data) => QueryPositionResponse.decode(new _m0.Reader(data))) } QueryPositions(request: QueryPositionsRequest): Promise { - const data = QueryPositionsRequest.encode(request).finish(); - const promise = this.rpc.request("nibiru.perp.v1.Query", "QueryPositions", data); - return promise.then((data) => QueryPositionsResponse.decode(new _m0.Reader(data))); + const data = QueryPositionsRequest.encode(request).finish() + const promise = this.rpc.request("nibiru.perp.v1.Query", "QueryPositions", data) + return promise.then((data) => QueryPositionsResponse.decode(new _m0.Reader(data))) } CumulativePremiumFraction( request: QueryCumulativePremiumFractionRequest, ): Promise { - const data = QueryCumulativePremiumFractionRequest.encode(request).finish(); - const promise = this.rpc.request("nibiru.perp.v1.Query", "CumulativePremiumFraction", data); - return promise.then((data) => QueryCumulativePremiumFractionResponse.decode(new _m0.Reader(data))); + const data = QueryCumulativePremiumFractionRequest.encode(request).finish() + const promise = this.rpc.request( + "nibiru.perp.v1.Query", + "CumulativePremiumFraction", + data, + ) + return promise.then((data) => + QueryCumulativePremiumFractionResponse.decode(new _m0.Reader(data)), + ) } Metrics(request: QueryMetricsRequest): Promise { - const data = QueryMetricsRequest.encode(request).finish(); - const promise = this.rpc.request("nibiru.perp.v1.Query", "Metrics", data); - return promise.then((data) => QueryMetricsResponse.decode(new _m0.Reader(data))); + const data = QueryMetricsRequest.encode(request).finish() + const promise = this.rpc.request("nibiru.perp.v1.Query", "Metrics", data) + return promise.then((data) => QueryMetricsResponse.decode(new _m0.Reader(data))) } } interface Rpc { - request(service: string, method: string, data: Uint8Array): Promise; + request(service: string, method: string, data: Uint8Array): Promise } -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/perp/v1/state.ts b/packages/protojs/src/perp/v1/state.ts index fb85c82d..05846e38 100644 --- a/packages/protojs/src/perp/v1/state.ts +++ b/packages/protojs/src/perp/v1/state.ts @@ -1,9 +1,9 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { Duration } from "../../google/protobuf/duration"; +import { Duration } from "../../google/protobuf/duration" +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "nibiru.perp.v1"; +export const protobufPackage = "nibiru.perp.v1" export enum Side { SIDE_UNSPECIFIED = 0, @@ -16,31 +16,31 @@ export function sideFromJSON(object: any): Side { switch (object) { case 0: case "SIDE_UNSPECIFIED": - return Side.SIDE_UNSPECIFIED; + return Side.SIDE_UNSPECIFIED case 1: case "BUY": - return Side.BUY; + return Side.BUY case 2: case "SELL": - return Side.SELL; + return Side.SELL case -1: case "UNRECOGNIZED": default: - return Side.UNRECOGNIZED; + return Side.UNRECOGNIZED } } export function sideToJSON(object: Side): string { switch (object) { case Side.SIDE_UNSPECIFIED: - return "SIDE_UNSPECIFIED"; + return "SIDE_UNSPECIFIED" case Side.BUY: - return "BUY"; + return "BUY" case Side.SELL: - return "SELL"; + return "SELL" case Side.UNRECOGNIZED: default: - return "UNRECOGNIZED"; + return "UNRECOGNIZED" } } @@ -56,36 +56,36 @@ export function pnLCalcOptionFromJSON(object: any): PnLCalcOption { switch (object) { case 0: case "PNL_CALC_OPTION_UNSPECIFIED": - return PnLCalcOption.PNL_CALC_OPTION_UNSPECIFIED; + return PnLCalcOption.PNL_CALC_OPTION_UNSPECIFIED case 1: case "SPOT_PRICE": - return PnLCalcOption.SPOT_PRICE; + return PnLCalcOption.SPOT_PRICE case 2: case "TWAP": - return PnLCalcOption.TWAP; + return PnLCalcOption.TWAP case 3: case "ORACLE": - return PnLCalcOption.ORACLE; + return PnLCalcOption.ORACLE case -1: case "UNRECOGNIZED": default: - return PnLCalcOption.UNRECOGNIZED; + return PnLCalcOption.UNRECOGNIZED } } export function pnLCalcOptionToJSON(object: PnLCalcOption): string { switch (object) { case PnLCalcOption.PNL_CALC_OPTION_UNSPECIFIED: - return "PNL_CALC_OPTION_UNSPECIFIED"; + return "PNL_CALC_OPTION_UNSPECIFIED" case PnLCalcOption.SPOT_PRICE: - return "SPOT_PRICE"; + return "SPOT_PRICE" case PnLCalcOption.TWAP: - return "TWAP"; + return "TWAP" case PnLCalcOption.ORACLE: - return "ORACLE"; + return "ORACLE" case PnLCalcOption.UNRECOGNIZED: default: - return "UNRECOGNIZED"; + return "UNRECOGNIZED" } } @@ -100,31 +100,31 @@ export function pnLPreferenceOptionFromJSON(object: any): PnLPreferenceOption { switch (object) { case 0: case "PNL_PREFERENCE_UNSPECIFIED": - return PnLPreferenceOption.PNL_PREFERENCE_UNSPECIFIED; + return PnLPreferenceOption.PNL_PREFERENCE_UNSPECIFIED case 1: case "MAX": - return PnLPreferenceOption.MAX; + return PnLPreferenceOption.MAX case 2: case "MIN": - return PnLPreferenceOption.MIN; + return PnLPreferenceOption.MIN case -1: case "UNRECOGNIZED": default: - return PnLPreferenceOption.UNRECOGNIZED; + return PnLPreferenceOption.UNRECOGNIZED } } export function pnLPreferenceOptionToJSON(object: PnLPreferenceOption): string { switch (object) { case PnLPreferenceOption.PNL_PREFERENCE_UNSPECIFIED: - return "PNL_PREFERENCE_UNSPECIFIED"; + return "PNL_PREFERENCE_UNSPECIFIED" case PnLPreferenceOption.MAX: - return "MAX"; + return "MAX" case PnLPreferenceOption.MIN: - return "MIN"; + return "MIN" case PnLPreferenceOption.UNRECOGNIZED: default: - return "UNRECOGNIZED"; + return "UNRECOGNIZED" } } @@ -136,70 +136,74 @@ export enum MarginCalculationPriceOption { UNRECOGNIZED = -1, } -export function marginCalculationPriceOptionFromJSON(object: any): MarginCalculationPriceOption { +export function marginCalculationPriceOptionFromJSON( + object: any, +): MarginCalculationPriceOption { switch (object) { case 0: case "MARGIN_CALCULATION_PRICE_OPTION_UNSPECIFIED": - return MarginCalculationPriceOption.MARGIN_CALCULATION_PRICE_OPTION_UNSPECIFIED; + return MarginCalculationPriceOption.MARGIN_CALCULATION_PRICE_OPTION_UNSPECIFIED case 1: case "SPOT": - return MarginCalculationPriceOption.SPOT; + return MarginCalculationPriceOption.SPOT case 2: case "INDEX": - return MarginCalculationPriceOption.INDEX; + return MarginCalculationPriceOption.INDEX case 3: case "MAX_PNL": - return MarginCalculationPriceOption.MAX_PNL; + return MarginCalculationPriceOption.MAX_PNL case -1: case "UNRECOGNIZED": default: - return MarginCalculationPriceOption.UNRECOGNIZED; + return MarginCalculationPriceOption.UNRECOGNIZED } } -export function marginCalculationPriceOptionToJSON(object: MarginCalculationPriceOption): string { +export function marginCalculationPriceOptionToJSON( + object: MarginCalculationPriceOption, +): string { switch (object) { case MarginCalculationPriceOption.MARGIN_CALCULATION_PRICE_OPTION_UNSPECIFIED: - return "MARGIN_CALCULATION_PRICE_OPTION_UNSPECIFIED"; + return "MARGIN_CALCULATION_PRICE_OPTION_UNSPECIFIED" case MarginCalculationPriceOption.SPOT: - return "SPOT"; + return "SPOT" case MarginCalculationPriceOption.INDEX: - return "INDEX"; + return "INDEX" case MarginCalculationPriceOption.MAX_PNL: - return "MAX_PNL"; + return "MAX_PNL" case MarginCalculationPriceOption.UNRECOGNIZED: default: - return "UNRECOGNIZED"; + return "UNRECOGNIZED" } } export interface Params { /** stopped identifies if the perp exchange is stopped or not */ - stopped: boolean; + stopped: boolean /** FeePoolFeeRatio is the ratio transferred to the the fee pool */ - feePoolFeeRatio: string; + feePoolFeeRatio: string /** EcosystemFundFeeRatio is the ratio transferred to the PerpEF. */ - ecosystemFundFeeRatio: string; + ecosystemFundFeeRatio: string /** * LiquidationFeeRatio is the percentage of liquidated position that will be * given to out as a reward. Half of the liquidation fee is given to the * liquidator, and the other half is given to the ecosystem fund. */ - liquidationFeeRatio: string; + liquidationFeeRatio: string /** * PartialLiquidationRatio is the share we try to liquidate if the margin is * higher than liquidation fee */ - partialLiquidationRatio: string; + partialLiquidationRatio: string /** specifies the interval on which the funding rate is updated */ - fundingRateInterval: string; + fundingRateInterval: string /** amount of time to look back for TWAP calculations */ - twapLookbackWindow?: Duration; + twapLookbackWindow?: Duration /** * whitelisted_liquidators defines the list of addresses * which are allowed to liquidate a position. */ - whitelistedLiquidators: string[]; + whitelistedLiquidators: string[] } /** @@ -208,99 +212,99 @@ export interface Params { */ export interface Position { /** address identifies the address owner of this position */ - traderAddress: string; + traderAddress: string /** pair identifies the pair associated with this position */ - pair: string; + pair: string /** Position size. */ - size: string; + size: string /** Amount of margin remaining in the position. */ - margin: string; + margin: string /** * OpenNotional is the quote denom value of the position when opening. * Used to calculate PnL. */ - openNotional: string; + openNotional: string /** * The most recent cumulative premium fraction this position has. * Used to calculate the next funding payment. */ - latestCumulativePremiumFraction: string; + latestCumulativePremiumFraction: string /** BlockNumber is the last block number when this position was updated. */ - blockNumber: Long; + blockNumber: Long } export interface PairMetadata { - pair: string; + pair: string /** * Latest cumulative premium fraction for a given pair. * Calculated once per funding rate interval. * A premium fraction is the difference between mark and index, divided by the number of payments per day. * (mark - index) / # payments in a day */ - latestCumulativePremiumFraction: string; + latestCumulativePremiumFraction: string } export interface PrepaidBadDebt { - denom: string; - amount: string; + denom: string + amount: string } export interface PositionResp { - position?: Position; + position?: Position /** The amount of quote assets exchanged. */ - exchangedNotionalValue: string; + exchangedNotionalValue: string /** The amount of base assets exchanged. */ - exchangedPositionSize: string; + exchangedPositionSize: string /** * The amount of bad debt accrued during this position change. * Measured in absolute value of quote units. * If greater than zero, then the position change event will likely fail. */ - badDebt: string; + badDebt: string /** The funding payment applied on this position change. */ - fundingPayment: string; + fundingPayment: string /** * The amount of PnL realized on this position changed, measured in quote * units. */ - realizedPnl: string; + realizedPnl: string /** The unrealized PnL in the position after the position change. */ - unrealizedPnlAfter: string; + unrealizedPnlAfter: string /** * The amount of margin the trader has to give to the vault. * A negative value means the vault pays the trader. */ - marginToVault: string; + marginToVault: string /** * The position's notional value after the position change, measured in quote * units. */ - positionNotional: string; + positionNotional: string } export interface LiquidateResp { /** Amount of bad debt created by the liquidation event */ - badDebt: string; + badDebt: string /** Fee paid to the liquidator */ - feeToLiquidator: string; + feeToLiquidator: string /** Fee paid to the Perp EF fund */ - feeToPerpEcosystemFund: string; + feeToPerpEcosystemFund: string /** Address of the liquidator */ - liquidator: string; + liquidator: string /** Position response from the close or open reverse position */ - positionResp?: PositionResp; + positionResp?: PositionResp } /** PoolMetrics is a structure that displays a snapshot of perp metrics for each pair. */ export interface Metrics { /** Pair identifier for the two assets. Always in format 'base:quote' */ - pair: string; + pair: string /** Sum of all active position sizes for the pair. */ - netSize: string; + netSize: string /** Total notional volume for the pair. */ - volumeQuote: string; + volumeQuote: string /** Total size volume for the pair. */ - volumeBase: string; + volumeBase: string } function createBaseParams(): Params { @@ -313,125 +317,145 @@ function createBaseParams(): Params { fundingRateInterval: "", twapLookbackWindow: undefined, whitelistedLiquidators: [], - }; + } } export const Params = { encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.stopped === true) { - writer.uint32(8).bool(message.stopped); + writer.uint32(8).bool(message.stopped) } if (message.feePoolFeeRatio !== "") { - writer.uint32(26).string(message.feePoolFeeRatio); + writer.uint32(26).string(message.feePoolFeeRatio) } if (message.ecosystemFundFeeRatio !== "") { - writer.uint32(34).string(message.ecosystemFundFeeRatio); + writer.uint32(34).string(message.ecosystemFundFeeRatio) } if (message.liquidationFeeRatio !== "") { - writer.uint32(42).string(message.liquidationFeeRatio); + writer.uint32(42).string(message.liquidationFeeRatio) } if (message.partialLiquidationRatio !== "") { - writer.uint32(50).string(message.partialLiquidationRatio); + writer.uint32(50).string(message.partialLiquidationRatio) } if (message.fundingRateInterval !== "") { - writer.uint32(58).string(message.fundingRateInterval); + writer.uint32(58).string(message.fundingRateInterval) } if (message.twapLookbackWindow !== undefined) { - Duration.encode(message.twapLookbackWindow, writer.uint32(66).fork()).ldelim(); + Duration.encode(message.twapLookbackWindow, writer.uint32(66).fork()).ldelim() } for (const v of message.whitelistedLiquidators) { - writer.uint32(74).string(v!); + writer.uint32(74).string(v!) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Params { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseParams(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseParams() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.stopped = reader.bool(); - break; + message.stopped = reader.bool() + break case 3: - message.feePoolFeeRatio = reader.string(); - break; + message.feePoolFeeRatio = reader.string() + break case 4: - message.ecosystemFundFeeRatio = reader.string(); - break; + message.ecosystemFundFeeRatio = reader.string() + break case 5: - message.liquidationFeeRatio = reader.string(); - break; + message.liquidationFeeRatio = reader.string() + break case 6: - message.partialLiquidationRatio = reader.string(); - break; + message.partialLiquidationRatio = reader.string() + break case 7: - message.fundingRateInterval = reader.string(); - break; + message.fundingRateInterval = reader.string() + break case 8: - message.twapLookbackWindow = Duration.decode(reader, reader.uint32()); - break; + message.twapLookbackWindow = Duration.decode(reader, reader.uint32()) + break case 9: - message.whitelistedLiquidators.push(reader.string()); - break; + message.whitelistedLiquidators.push(reader.string()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Params { return { stopped: isSet(object.stopped) ? Boolean(object.stopped) : false, - feePoolFeeRatio: isSet(object.feePoolFeeRatio) ? String(object.feePoolFeeRatio) : "", - ecosystemFundFeeRatio: isSet(object.ecosystemFundFeeRatio) ? String(object.ecosystemFundFeeRatio) : "", - liquidationFeeRatio: isSet(object.liquidationFeeRatio) ? String(object.liquidationFeeRatio) : "", - partialLiquidationRatio: isSet(object.partialLiquidationRatio) ? String(object.partialLiquidationRatio) : "", - fundingRateInterval: isSet(object.fundingRateInterval) ? String(object.fundingRateInterval) : "", - twapLookbackWindow: isSet(object.twapLookbackWindow) ? Duration.fromJSON(object.twapLookbackWindow) : undefined, + feePoolFeeRatio: isSet(object.feePoolFeeRatio) + ? String(object.feePoolFeeRatio) + : "", + ecosystemFundFeeRatio: isSet(object.ecosystemFundFeeRatio) + ? String(object.ecosystemFundFeeRatio) + : "", + liquidationFeeRatio: isSet(object.liquidationFeeRatio) + ? String(object.liquidationFeeRatio) + : "", + partialLiquidationRatio: isSet(object.partialLiquidationRatio) + ? String(object.partialLiquidationRatio) + : "", + fundingRateInterval: isSet(object.fundingRateInterval) + ? String(object.fundingRateInterval) + : "", + twapLookbackWindow: isSet(object.twapLookbackWindow) + ? Duration.fromJSON(object.twapLookbackWindow) + : undefined, whitelistedLiquidators: Array.isArray(object?.whitelistedLiquidators) ? object.whitelistedLiquidators.map((e: any) => String(e)) : [], - }; + } }, toJSON(message: Params): unknown { - const obj: any = {}; - message.stopped !== undefined && (obj.stopped = message.stopped); - message.feePoolFeeRatio !== undefined && (obj.feePoolFeeRatio = message.feePoolFeeRatio); - message.ecosystemFundFeeRatio !== undefined && (obj.ecosystemFundFeeRatio = message.ecosystemFundFeeRatio); - message.liquidationFeeRatio !== undefined && (obj.liquidationFeeRatio = message.liquidationFeeRatio); - message.partialLiquidationRatio !== undefined && (obj.partialLiquidationRatio = message.partialLiquidationRatio); - message.fundingRateInterval !== undefined && (obj.fundingRateInterval = message.fundingRateInterval); + const obj: any = {} + message.stopped !== undefined && (obj.stopped = message.stopped) + message.feePoolFeeRatio !== undefined && + (obj.feePoolFeeRatio = message.feePoolFeeRatio) + message.ecosystemFundFeeRatio !== undefined && + (obj.ecosystemFundFeeRatio = message.ecosystemFundFeeRatio) + message.liquidationFeeRatio !== undefined && + (obj.liquidationFeeRatio = message.liquidationFeeRatio) + message.partialLiquidationRatio !== undefined && + (obj.partialLiquidationRatio = message.partialLiquidationRatio) + message.fundingRateInterval !== undefined && + (obj.fundingRateInterval = message.fundingRateInterval) message.twapLookbackWindow !== undefined && - (obj.twapLookbackWindow = message.twapLookbackWindow ? Duration.toJSON(message.twapLookbackWindow) : undefined); + (obj.twapLookbackWindow = message.twapLookbackWindow + ? Duration.toJSON(message.twapLookbackWindow) + : undefined) if (message.whitelistedLiquidators) { - obj.whitelistedLiquidators = message.whitelistedLiquidators.map((e) => e); + obj.whitelistedLiquidators = message.whitelistedLiquidators.map((e) => e) } else { - obj.whitelistedLiquidators = []; + obj.whitelistedLiquidators = [] } - return obj; + return obj }, fromPartial, I>>(object: I): Params { - const message = createBaseParams(); - message.stopped = object.stopped ?? false; - message.feePoolFeeRatio = object.feePoolFeeRatio ?? ""; - message.ecosystemFundFeeRatio = object.ecosystemFundFeeRatio ?? ""; - message.liquidationFeeRatio = object.liquidationFeeRatio ?? ""; - message.partialLiquidationRatio = object.partialLiquidationRatio ?? ""; - message.fundingRateInterval = object.fundingRateInterval ?? ""; - message.twapLookbackWindow = (object.twapLookbackWindow !== undefined && object.twapLookbackWindow !== null) - ? Duration.fromPartial(object.twapLookbackWindow) - : undefined; - message.whitelistedLiquidators = object.whitelistedLiquidators?.map((e) => e) || []; - return message; - }, -}; + const message = createBaseParams() + message.stopped = object.stopped ?? false + message.feePoolFeeRatio = object.feePoolFeeRatio ?? "" + message.ecosystemFundFeeRatio = object.ecosystemFundFeeRatio ?? "" + message.liquidationFeeRatio = object.liquidationFeeRatio ?? "" + message.partialLiquidationRatio = object.partialLiquidationRatio ?? "" + message.fundingRateInterval = object.fundingRateInterval ?? "" + message.twapLookbackWindow = + object.twapLookbackWindow !== undefined && object.twapLookbackWindow !== null + ? Duration.fromPartial(object.twapLookbackWindow) + : undefined + message.whitelistedLiquidators = object.whitelistedLiquidators?.map((e) => e) || [] + return message + }, +} function createBasePosition(): Position { return { @@ -442,69 +466,69 @@ function createBasePosition(): Position { openNotional: "", latestCumulativePremiumFraction: "", blockNumber: Long.ZERO, - }; + } } export const Position = { encode(message: Position, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.traderAddress !== "") { - writer.uint32(10).string(message.traderAddress); + writer.uint32(10).string(message.traderAddress) } if (message.pair !== "") { - writer.uint32(18).string(message.pair); + writer.uint32(18).string(message.pair) } if (message.size !== "") { - writer.uint32(26).string(message.size); + writer.uint32(26).string(message.size) } if (message.margin !== "") { - writer.uint32(34).string(message.margin); + writer.uint32(34).string(message.margin) } if (message.openNotional !== "") { - writer.uint32(42).string(message.openNotional); + writer.uint32(42).string(message.openNotional) } if (message.latestCumulativePremiumFraction !== "") { - writer.uint32(50).string(message.latestCumulativePremiumFraction); + writer.uint32(50).string(message.latestCumulativePremiumFraction) } if (!message.blockNumber.isZero()) { - writer.uint32(56).int64(message.blockNumber); + writer.uint32(56).int64(message.blockNumber) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Position { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBasePosition(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBasePosition() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.traderAddress = reader.string(); - break; + message.traderAddress = reader.string() + break case 2: - message.pair = reader.string(); - break; + message.pair = reader.string() + break case 3: - message.size = reader.string(); - break; + message.size = reader.string() + break case 4: - message.margin = reader.string(); - break; + message.margin = reader.string() + break case 5: - message.openNotional = reader.string(); - break; + message.openNotional = reader.string() + break case 6: - message.latestCumulativePremiumFraction = reader.string(); - break; + message.latestCumulativePremiumFraction = reader.string() + break case 7: - message.blockNumber = reader.int64() as Long; - break; + message.blockNumber = reader.int64() as Long + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Position { @@ -517,72 +541,77 @@ export const Position = { latestCumulativePremiumFraction: isSet(object.latestCumulativePremiumFraction) ? String(object.latestCumulativePremiumFraction) : "", - blockNumber: isSet(object.blockNumber) ? Long.fromValue(object.blockNumber) : Long.ZERO, - }; + blockNumber: isSet(object.blockNumber) + ? Long.fromValue(object.blockNumber) + : Long.ZERO, + } }, toJSON(message: Position): unknown { - const obj: any = {}; - message.traderAddress !== undefined && (obj.traderAddress = message.traderAddress); - message.pair !== undefined && (obj.pair = message.pair); - message.size !== undefined && (obj.size = message.size); - message.margin !== undefined && (obj.margin = message.margin); - message.openNotional !== undefined && (obj.openNotional = message.openNotional); + const obj: any = {} + message.traderAddress !== undefined && (obj.traderAddress = message.traderAddress) + message.pair !== undefined && (obj.pair = message.pair) + message.size !== undefined && (obj.size = message.size) + message.margin !== undefined && (obj.margin = message.margin) + message.openNotional !== undefined && (obj.openNotional = message.openNotional) message.latestCumulativePremiumFraction !== undefined && - (obj.latestCumulativePremiumFraction = message.latestCumulativePremiumFraction); - message.blockNumber !== undefined && (obj.blockNumber = (message.blockNumber || Long.ZERO).toString()); - return obj; + (obj.latestCumulativePremiumFraction = message.latestCumulativePremiumFraction) + message.blockNumber !== undefined && + (obj.blockNumber = (message.blockNumber || Long.ZERO).toString()) + return obj }, fromPartial, I>>(object: I): Position { - const message = createBasePosition(); - message.traderAddress = object.traderAddress ?? ""; - message.pair = object.pair ?? ""; - message.size = object.size ?? ""; - message.margin = object.margin ?? ""; - message.openNotional = object.openNotional ?? ""; - message.latestCumulativePremiumFraction = object.latestCumulativePremiumFraction ?? ""; - message.blockNumber = (object.blockNumber !== undefined && object.blockNumber !== null) - ? Long.fromValue(object.blockNumber) - : Long.ZERO; - return message; - }, -}; + const message = createBasePosition() + message.traderAddress = object.traderAddress ?? "" + message.pair = object.pair ?? "" + message.size = object.size ?? "" + message.margin = object.margin ?? "" + message.openNotional = object.openNotional ?? "" + message.latestCumulativePremiumFraction = + object.latestCumulativePremiumFraction ?? "" + message.blockNumber = + object.blockNumber !== undefined && object.blockNumber !== null + ? Long.fromValue(object.blockNumber) + : Long.ZERO + return message + }, +} function createBasePairMetadata(): PairMetadata { - return { pair: "", latestCumulativePremiumFraction: "" }; + return { pair: "", latestCumulativePremiumFraction: "" } } export const PairMetadata = { encode(message: PairMetadata, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.pair !== "") { - writer.uint32(10).string(message.pair); + writer.uint32(10).string(message.pair) } if (message.latestCumulativePremiumFraction !== "") { - writer.uint32(18).string(message.latestCumulativePremiumFraction); + writer.uint32(18).string(message.latestCumulativePremiumFraction) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): PairMetadata { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBasePairMetadata(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBasePairMetadata() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.pair = reader.string(); - break; + message.pair = reader.string() + break case 2: - message.latestCumulativePremiumFraction = reader.string(); - break; + message.latestCumulativePremiumFraction = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): PairMetadata { @@ -591,82 +620,88 @@ export const PairMetadata = { latestCumulativePremiumFraction: isSet(object.latestCumulativePremiumFraction) ? String(object.latestCumulativePremiumFraction) : "", - }; + } }, toJSON(message: PairMetadata): unknown { - const obj: any = {}; - message.pair !== undefined && (obj.pair = message.pair); + const obj: any = {} + message.pair !== undefined && (obj.pair = message.pair) message.latestCumulativePremiumFraction !== undefined && - (obj.latestCumulativePremiumFraction = message.latestCumulativePremiumFraction); - return obj; + (obj.latestCumulativePremiumFraction = message.latestCumulativePremiumFraction) + return obj }, fromPartial, I>>(object: I): PairMetadata { - const message = createBasePairMetadata(); - message.pair = object.pair ?? ""; - message.latestCumulativePremiumFraction = object.latestCumulativePremiumFraction ?? ""; - return message; + const message = createBasePairMetadata() + message.pair = object.pair ?? "" + message.latestCumulativePremiumFraction = + object.latestCumulativePremiumFraction ?? "" + return message }, -}; +} function createBasePrepaidBadDebt(): PrepaidBadDebt { - return { denom: "", amount: "" }; + return { denom: "", amount: "" } } export const PrepaidBadDebt = { - encode(message: PrepaidBadDebt, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: PrepaidBadDebt, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.denom !== "") { - writer.uint32(10).string(message.denom); + writer.uint32(10).string(message.denom) } if (message.amount !== "") { - writer.uint32(18).string(message.amount); + writer.uint32(18).string(message.amount) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): PrepaidBadDebt { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBasePrepaidBadDebt(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBasePrepaidBadDebt() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.denom = reader.string(); - break; + message.denom = reader.string() + break case 2: - message.amount = reader.string(); - break; + message.amount = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): PrepaidBadDebt { return { denom: isSet(object.denom) ? String(object.denom) : "", amount: isSet(object.amount) ? String(object.amount) : "", - }; + } }, toJSON(message: PrepaidBadDebt): unknown { - const obj: any = {}; - message.denom !== undefined && (obj.denom = message.denom); - message.amount !== undefined && (obj.amount = message.amount); - return obj; + const obj: any = {} + message.denom !== undefined && (obj.denom = message.denom) + message.amount !== undefined && (obj.amount = message.amount) + return obj }, - fromPartial, I>>(object: I): PrepaidBadDebt { - const message = createBasePrepaidBadDebt(); - message.denom = object.denom ?? ""; - message.amount = object.amount ?? ""; - return message; + fromPartial, I>>( + object: I, + ): PrepaidBadDebt { + const message = createBasePrepaidBadDebt() + message.denom = object.denom ?? "" + message.amount = object.amount ?? "" + return message }, -}; +} function createBasePositionResp(): PositionResp { return { @@ -679,262 +714,296 @@ function createBasePositionResp(): PositionResp { unrealizedPnlAfter: "", marginToVault: "", positionNotional: "", - }; + } } export const PositionResp = { encode(message: PositionResp, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.position !== undefined) { - Position.encode(message.position, writer.uint32(10).fork()).ldelim(); + Position.encode(message.position, writer.uint32(10).fork()).ldelim() } if (message.exchangedNotionalValue !== "") { - writer.uint32(18).string(message.exchangedNotionalValue); + writer.uint32(18).string(message.exchangedNotionalValue) } if (message.exchangedPositionSize !== "") { - writer.uint32(26).string(message.exchangedPositionSize); + writer.uint32(26).string(message.exchangedPositionSize) } if (message.badDebt !== "") { - writer.uint32(34).string(message.badDebt); + writer.uint32(34).string(message.badDebt) } if (message.fundingPayment !== "") { - writer.uint32(42).string(message.fundingPayment); + writer.uint32(42).string(message.fundingPayment) } if (message.realizedPnl !== "") { - writer.uint32(50).string(message.realizedPnl); + writer.uint32(50).string(message.realizedPnl) } if (message.unrealizedPnlAfter !== "") { - writer.uint32(58).string(message.unrealizedPnlAfter); + writer.uint32(58).string(message.unrealizedPnlAfter) } if (message.marginToVault !== "") { - writer.uint32(66).string(message.marginToVault); + writer.uint32(66).string(message.marginToVault) } if (message.positionNotional !== "") { - writer.uint32(74).string(message.positionNotional); + writer.uint32(74).string(message.positionNotional) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): PositionResp { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBasePositionResp(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBasePositionResp() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.position = Position.decode(reader, reader.uint32()); - break; + message.position = Position.decode(reader, reader.uint32()) + break case 2: - message.exchangedNotionalValue = reader.string(); - break; + message.exchangedNotionalValue = reader.string() + break case 3: - message.exchangedPositionSize = reader.string(); - break; + message.exchangedPositionSize = reader.string() + break case 4: - message.badDebt = reader.string(); - break; + message.badDebt = reader.string() + break case 5: - message.fundingPayment = reader.string(); - break; + message.fundingPayment = reader.string() + break case 6: - message.realizedPnl = reader.string(); - break; + message.realizedPnl = reader.string() + break case 7: - message.unrealizedPnlAfter = reader.string(); - break; + message.unrealizedPnlAfter = reader.string() + break case 8: - message.marginToVault = reader.string(); - break; + message.marginToVault = reader.string() + break case 9: - message.positionNotional = reader.string(); - break; + message.positionNotional = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): PositionResp { return { position: isSet(object.position) ? Position.fromJSON(object.position) : undefined, - exchangedNotionalValue: isSet(object.exchangedNotionalValue) ? String(object.exchangedNotionalValue) : "", - exchangedPositionSize: isSet(object.exchangedPositionSize) ? String(object.exchangedPositionSize) : "", + exchangedNotionalValue: isSet(object.exchangedNotionalValue) + ? String(object.exchangedNotionalValue) + : "", + exchangedPositionSize: isSet(object.exchangedPositionSize) + ? String(object.exchangedPositionSize) + : "", badDebt: isSet(object.badDebt) ? String(object.badDebt) : "", fundingPayment: isSet(object.fundingPayment) ? String(object.fundingPayment) : "", realizedPnl: isSet(object.realizedPnl) ? String(object.realizedPnl) : "", - unrealizedPnlAfter: isSet(object.unrealizedPnlAfter) ? String(object.unrealizedPnlAfter) : "", + unrealizedPnlAfter: isSet(object.unrealizedPnlAfter) + ? String(object.unrealizedPnlAfter) + : "", marginToVault: isSet(object.marginToVault) ? String(object.marginToVault) : "", - positionNotional: isSet(object.positionNotional) ? String(object.positionNotional) : "", - }; + positionNotional: isSet(object.positionNotional) + ? String(object.positionNotional) + : "", + } }, toJSON(message: PositionResp): unknown { - const obj: any = {}; - message.position !== undefined && (obj.position = message.position ? Position.toJSON(message.position) : undefined); - message.exchangedNotionalValue !== undefined && (obj.exchangedNotionalValue = message.exchangedNotionalValue); - message.exchangedPositionSize !== undefined && (obj.exchangedPositionSize = message.exchangedPositionSize); - message.badDebt !== undefined && (obj.badDebt = message.badDebt); - message.fundingPayment !== undefined && (obj.fundingPayment = message.fundingPayment); - message.realizedPnl !== undefined && (obj.realizedPnl = message.realizedPnl); - message.unrealizedPnlAfter !== undefined && (obj.unrealizedPnlAfter = message.unrealizedPnlAfter); - message.marginToVault !== undefined && (obj.marginToVault = message.marginToVault); - message.positionNotional !== undefined && (obj.positionNotional = message.positionNotional); - return obj; + const obj: any = {} + message.position !== undefined && + (obj.position = message.position ? Position.toJSON(message.position) : undefined) + message.exchangedNotionalValue !== undefined && + (obj.exchangedNotionalValue = message.exchangedNotionalValue) + message.exchangedPositionSize !== undefined && + (obj.exchangedPositionSize = message.exchangedPositionSize) + message.badDebt !== undefined && (obj.badDebt = message.badDebt) + message.fundingPayment !== undefined && + (obj.fundingPayment = message.fundingPayment) + message.realizedPnl !== undefined && (obj.realizedPnl = message.realizedPnl) + message.unrealizedPnlAfter !== undefined && + (obj.unrealizedPnlAfter = message.unrealizedPnlAfter) + message.marginToVault !== undefined && (obj.marginToVault = message.marginToVault) + message.positionNotional !== undefined && + (obj.positionNotional = message.positionNotional) + return obj }, fromPartial, I>>(object: I): PositionResp { - const message = createBasePositionResp(); - message.position = (object.position !== undefined && object.position !== null) - ? Position.fromPartial(object.position) - : undefined; - message.exchangedNotionalValue = object.exchangedNotionalValue ?? ""; - message.exchangedPositionSize = object.exchangedPositionSize ?? ""; - message.badDebt = object.badDebt ?? ""; - message.fundingPayment = object.fundingPayment ?? ""; - message.realizedPnl = object.realizedPnl ?? ""; - message.unrealizedPnlAfter = object.unrealizedPnlAfter ?? ""; - message.marginToVault = object.marginToVault ?? ""; - message.positionNotional = object.positionNotional ?? ""; - return message; - }, -}; + const message = createBasePositionResp() + message.position = + object.position !== undefined && object.position !== null + ? Position.fromPartial(object.position) + : undefined + message.exchangedNotionalValue = object.exchangedNotionalValue ?? "" + message.exchangedPositionSize = object.exchangedPositionSize ?? "" + message.badDebt = object.badDebt ?? "" + message.fundingPayment = object.fundingPayment ?? "" + message.realizedPnl = object.realizedPnl ?? "" + message.unrealizedPnlAfter = object.unrealizedPnlAfter ?? "" + message.marginToVault = object.marginToVault ?? "" + message.positionNotional = object.positionNotional ?? "" + return message + }, +} function createBaseLiquidateResp(): LiquidateResp { - return { badDebt: "", feeToLiquidator: "", feeToPerpEcosystemFund: "", liquidator: "", positionResp: undefined }; + return { + badDebt: "", + feeToLiquidator: "", + feeToPerpEcosystemFund: "", + liquidator: "", + positionResp: undefined, + } } export const LiquidateResp = { encode(message: LiquidateResp, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.badDebt !== "") { - writer.uint32(10).string(message.badDebt); + writer.uint32(10).string(message.badDebt) } if (message.feeToLiquidator !== "") { - writer.uint32(18).string(message.feeToLiquidator); + writer.uint32(18).string(message.feeToLiquidator) } if (message.feeToPerpEcosystemFund !== "") { - writer.uint32(26).string(message.feeToPerpEcosystemFund); + writer.uint32(26).string(message.feeToPerpEcosystemFund) } if (message.liquidator !== "") { - writer.uint32(34).string(message.liquidator); + writer.uint32(34).string(message.liquidator) } if (message.positionResp !== undefined) { - PositionResp.encode(message.positionResp, writer.uint32(42).fork()).ldelim(); + PositionResp.encode(message.positionResp, writer.uint32(42).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): LiquidateResp { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseLiquidateResp(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseLiquidateResp() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.badDebt = reader.string(); - break; + message.badDebt = reader.string() + break case 2: - message.feeToLiquidator = reader.string(); - break; + message.feeToLiquidator = reader.string() + break case 3: - message.feeToPerpEcosystemFund = reader.string(); - break; + message.feeToPerpEcosystemFund = reader.string() + break case 4: - message.liquidator = reader.string(); - break; + message.liquidator = reader.string() + break case 5: - message.positionResp = PositionResp.decode(reader, reader.uint32()); - break; + message.positionResp = PositionResp.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): LiquidateResp { return { badDebt: isSet(object.badDebt) ? String(object.badDebt) : "", - feeToLiquidator: isSet(object.feeToLiquidator) ? String(object.feeToLiquidator) : "", - feeToPerpEcosystemFund: isSet(object.feeToPerpEcosystemFund) ? String(object.feeToPerpEcosystemFund) : "", + feeToLiquidator: isSet(object.feeToLiquidator) + ? String(object.feeToLiquidator) + : "", + feeToPerpEcosystemFund: isSet(object.feeToPerpEcosystemFund) + ? String(object.feeToPerpEcosystemFund) + : "", liquidator: isSet(object.liquidator) ? String(object.liquidator) : "", - positionResp: isSet(object.positionResp) ? PositionResp.fromJSON(object.positionResp) : undefined, - }; + positionResp: isSet(object.positionResp) + ? PositionResp.fromJSON(object.positionResp) + : undefined, + } }, toJSON(message: LiquidateResp): unknown { - const obj: any = {}; - message.badDebt !== undefined && (obj.badDebt = message.badDebt); - message.feeToLiquidator !== undefined && (obj.feeToLiquidator = message.feeToLiquidator); - message.feeToPerpEcosystemFund !== undefined && (obj.feeToPerpEcosystemFund = message.feeToPerpEcosystemFund); - message.liquidator !== undefined && (obj.liquidator = message.liquidator); + const obj: any = {} + message.badDebt !== undefined && (obj.badDebt = message.badDebt) + message.feeToLiquidator !== undefined && + (obj.feeToLiquidator = message.feeToLiquidator) + message.feeToPerpEcosystemFund !== undefined && + (obj.feeToPerpEcosystemFund = message.feeToPerpEcosystemFund) + message.liquidator !== undefined && (obj.liquidator = message.liquidator) message.positionResp !== undefined && - (obj.positionResp = message.positionResp ? PositionResp.toJSON(message.positionResp) : undefined); - return obj; + (obj.positionResp = message.positionResp + ? PositionResp.toJSON(message.positionResp) + : undefined) + return obj }, - fromPartial, I>>(object: I): LiquidateResp { - const message = createBaseLiquidateResp(); - message.badDebt = object.badDebt ?? ""; - message.feeToLiquidator = object.feeToLiquidator ?? ""; - message.feeToPerpEcosystemFund = object.feeToPerpEcosystemFund ?? ""; - message.liquidator = object.liquidator ?? ""; - message.positionResp = (object.positionResp !== undefined && object.positionResp !== null) - ? PositionResp.fromPartial(object.positionResp) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): LiquidateResp { + const message = createBaseLiquidateResp() + message.badDebt = object.badDebt ?? "" + message.feeToLiquidator = object.feeToLiquidator ?? "" + message.feeToPerpEcosystemFund = object.feeToPerpEcosystemFund ?? "" + message.liquidator = object.liquidator ?? "" + message.positionResp = + object.positionResp !== undefined && object.positionResp !== null + ? PositionResp.fromPartial(object.positionResp) + : undefined + return message }, -}; +} function createBaseMetrics(): Metrics { - return { pair: "", netSize: "", volumeQuote: "", volumeBase: "" }; + return { pair: "", netSize: "", volumeQuote: "", volumeBase: "" } } export const Metrics = { encode(message: Metrics, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.pair !== "") { - writer.uint32(10).string(message.pair); + writer.uint32(10).string(message.pair) } if (message.netSize !== "") { - writer.uint32(18).string(message.netSize); + writer.uint32(18).string(message.netSize) } if (message.volumeQuote !== "") { - writer.uint32(26).string(message.volumeQuote); + writer.uint32(26).string(message.volumeQuote) } if (message.volumeBase !== "") { - writer.uint32(34).string(message.volumeBase); + writer.uint32(34).string(message.volumeBase) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Metrics { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMetrics(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMetrics() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.pair = reader.string(); - break; + message.pair = reader.string() + break case 2: - message.netSize = reader.string(); - break; + message.netSize = reader.string() + break case 3: - message.volumeQuote = reader.string(); - break; + message.volumeQuote = reader.string() + break case 4: - message.volumeBase = reader.string(); - break; + message.volumeBase = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Metrics { @@ -943,45 +1012,55 @@ export const Metrics = { netSize: isSet(object.netSize) ? String(object.netSize) : "", volumeQuote: isSet(object.volumeQuote) ? String(object.volumeQuote) : "", volumeBase: isSet(object.volumeBase) ? String(object.volumeBase) : "", - }; + } }, toJSON(message: Metrics): unknown { - const obj: any = {}; - message.pair !== undefined && (obj.pair = message.pair); - message.netSize !== undefined && (obj.netSize = message.netSize); - message.volumeQuote !== undefined && (obj.volumeQuote = message.volumeQuote); - message.volumeBase !== undefined && (obj.volumeBase = message.volumeBase); - return obj; + const obj: any = {} + message.pair !== undefined && (obj.pair = message.pair) + message.netSize !== undefined && (obj.netSize = message.netSize) + message.volumeQuote !== undefined && (obj.volumeQuote = message.volumeQuote) + message.volumeBase !== undefined && (obj.volumeBase = message.volumeBase) + return obj }, fromPartial, I>>(object: I): Metrics { - const message = createBaseMetrics(); - message.pair = object.pair ?? ""; - message.netSize = object.netSize ?? ""; - message.volumeQuote = object.volumeQuote ?? ""; - message.volumeBase = object.volumeBase ?? ""; - return message; + const message = createBaseMetrics() + message.pair = object.pair ?? "" + message.netSize = object.netSize ?? "" + message.volumeQuote = object.volumeQuote ?? "" + message.volumeBase = object.volumeBase ?? "" + return message }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; +} -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/perp/v1/tx.ts b/packages/protojs/src/perp/v1/tx.ts index 86df9cc8..71ff6cac 100644 --- a/packages/protojs/src/perp/v1/tx.ts +++ b/packages/protojs/src/perp/v1/tx.ts @@ -1,161 +1,163 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { Coin } from "../../cosmos/base/v1beta1/coin"; -import { Position, Side, sideFromJSON, sideToJSON } from "./state"; +import { Coin } from "../../cosmos/base/v1beta1/coin" +import { Position, Side, sideFromJSON, sideToJSON } from "./state" +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "nibiru.perp.v1"; +export const protobufPackage = "nibiru.perp.v1" /** MsgRemoveMargin: Msg to remove margin. */ export interface MsgRemoveMargin { - sender: string; - pair: string; - margin?: Coin; + sender: string + pair: string + margin?: Coin } export interface MsgRemoveMarginResponse { /** tokens transferred back to the trader */ - marginOut?: Coin; + marginOut?: Coin /** the funding payment applied on this position interaction */ - fundingPayment: string; + fundingPayment: string /** The resulting position */ - position?: Position; + position?: Position } /** MsgAddMargin: Msg to remove margin. */ export interface MsgAddMargin { - sender: string; - pair: string; - margin?: Coin; + sender: string + pair: string + margin?: Coin } export interface MsgAddMarginResponse { - fundingPayment: string; - position?: Position; + fundingPayment: string + position?: Position } export interface MsgMultiLiquidate { - sender: string; - liquidations: MsgMultiLiquidate_Liquidation[]; + sender: string + liquidations: MsgMultiLiquidate_Liquidation[] } export interface MsgMultiLiquidate_Liquidation { - pair: string; - trader: string; + pair: string + trader: string } export interface MsgMultiLiquidateResponse { - liquidations: MsgMultiLiquidateResponse_LiquidationResponse[]; + liquidations: MsgMultiLiquidateResponse_LiquidationResponse[] } export interface MsgMultiLiquidateResponse_LiquidationResponse { - success: boolean; - error: string; - liquidatorFee?: Coin; + success: boolean + error: string + liquidatorFee?: Coin /** perp ecosystem fund */ - perpEfFee?: Coin; + perpEfFee?: Coin } export interface MsgOpenPosition { - sender: string; - pair: string; - side: Side; - quoteAssetAmount: string; - leverage: string; - baseAssetAmountLimit: string; + sender: string + pair: string + side: Side + quoteAssetAmount: string + leverage: string + baseAssetAmountLimit: string } export interface MsgOpenPositionResponse { - position?: Position; + position?: Position /** The amount of quote assets exchanged. */ - exchangedNotionalValue: string; + exchangedNotionalValue: string /** The amount of base assets exchanged. */ - exchangedPositionSize: string; + exchangedPositionSize: string /** The funding payment applied on this position change, measured in quote units. */ - fundingPayment: string; + fundingPayment: string /** The amount of PnL realized on this position changed, measured in quote units. */ - realizedPnl: string; + realizedPnl: string /** The unrealized PnL in the position after the position change, measured in quote units. */ - unrealizedPnlAfter: string; + unrealizedPnlAfter: string /** * The amount of margin the trader has to give to the vault. * A negative value means the vault pays the trader. */ - marginToVault: string; + marginToVault: string /** The position's notional value after the position change, measured in quote units. */ - positionNotional: string; + positionNotional: string } export interface MsgClosePosition { - sender: string; - pair: string; + sender: string + pair: string } export interface MsgClosePositionResponse { /** The amount of quote assets exchanged. */ - exchangedNotionalValue: string; + exchangedNotionalValue: string /** The amount of base assets exchanged. */ - exchangedPositionSize: string; + exchangedPositionSize: string /** The funding payment applied on this position change, measured in quote units. */ - fundingPayment: string; + fundingPayment: string /** The amount of PnL realized on this position changed, measured in quote units. */ - realizedPnl: string; + realizedPnl: string /** * The amount of margin the trader receives after closing the position, from the vault. * Should never be negative. */ - marginToTrader: string; + marginToTrader: string } export interface MsgDonateToEcosystemFund { - sender: string; + sender: string /** donation to the EF */ - donation?: Coin; + donation?: Coin } -export interface MsgDonateToEcosystemFundResponse { -} +export interface MsgDonateToEcosystemFundResponse {} function createBaseMsgRemoveMargin(): MsgRemoveMargin { - return { sender: "", pair: "", margin: undefined }; + return { sender: "", pair: "", margin: undefined } } export const MsgRemoveMargin = { - encode(message: MsgRemoveMargin, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: MsgRemoveMargin, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.sender !== "") { - writer.uint32(10).string(message.sender); + writer.uint32(10).string(message.sender) } if (message.pair !== "") { - writer.uint32(18).string(message.pair); + writer.uint32(18).string(message.pair) } if (message.margin !== undefined) { - Coin.encode(message.margin, writer.uint32(26).fork()).ldelim(); + Coin.encode(message.margin, writer.uint32(26).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MsgRemoveMargin { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgRemoveMargin(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgRemoveMargin() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.sender = reader.string(); - break; + message.sender = reader.string() + break case 2: - message.pair = reader.string(); - break; + message.pair = reader.string() + break case 3: - message.margin = Coin.decode(reader, reader.uint32()); - break; + message.margin = Coin.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): MsgRemoveMargin { @@ -163,68 +165,75 @@ export const MsgRemoveMargin = { sender: isSet(object.sender) ? String(object.sender) : "", pair: isSet(object.pair) ? String(object.pair) : "", margin: isSet(object.margin) ? Coin.fromJSON(object.margin) : undefined, - }; + } }, toJSON(message: MsgRemoveMargin): unknown { - const obj: any = {}; - message.sender !== undefined && (obj.sender = message.sender); - message.pair !== undefined && (obj.pair = message.pair); - message.margin !== undefined && (obj.margin = message.margin ? Coin.toJSON(message.margin) : undefined); - return obj; + const obj: any = {} + message.sender !== undefined && (obj.sender = message.sender) + message.pair !== undefined && (obj.pair = message.pair) + message.margin !== undefined && + (obj.margin = message.margin ? Coin.toJSON(message.margin) : undefined) + return obj }, - fromPartial, I>>(object: I): MsgRemoveMargin { - const message = createBaseMsgRemoveMargin(); - message.sender = object.sender ?? ""; - message.pair = object.pair ?? ""; - message.margin = (object.margin !== undefined && object.margin !== null) - ? Coin.fromPartial(object.margin) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): MsgRemoveMargin { + const message = createBaseMsgRemoveMargin() + message.sender = object.sender ?? "" + message.pair = object.pair ?? "" + message.margin = + object.margin !== undefined && object.margin !== null + ? Coin.fromPartial(object.margin) + : undefined + return message }, -}; +} function createBaseMsgRemoveMarginResponse(): MsgRemoveMarginResponse { - return { marginOut: undefined, fundingPayment: "", position: undefined }; + return { marginOut: undefined, fundingPayment: "", position: undefined } } export const MsgRemoveMarginResponse = { - encode(message: MsgRemoveMarginResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: MsgRemoveMarginResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.marginOut !== undefined) { - Coin.encode(message.marginOut, writer.uint32(10).fork()).ldelim(); + Coin.encode(message.marginOut, writer.uint32(10).fork()).ldelim() } if (message.fundingPayment !== "") { - writer.uint32(18).string(message.fundingPayment); + writer.uint32(18).string(message.fundingPayment) } if (message.position !== undefined) { - Position.encode(message.position, writer.uint32(26).fork()).ldelim(); + Position.encode(message.position, writer.uint32(26).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MsgRemoveMarginResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgRemoveMarginResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgRemoveMarginResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.marginOut = Coin.decode(reader, reader.uint32()); - break; + message.marginOut = Coin.decode(reader, reader.uint32()) + break case 2: - message.fundingPayment = reader.string(); - break; + message.fundingPayment = reader.string() + break case 3: - message.position = Position.decode(reader, reader.uint32()); - break; + message.position = Position.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): MsgRemoveMarginResponse { @@ -232,70 +241,77 @@ export const MsgRemoveMarginResponse = { marginOut: isSet(object.marginOut) ? Coin.fromJSON(object.marginOut) : undefined, fundingPayment: isSet(object.fundingPayment) ? String(object.fundingPayment) : "", position: isSet(object.position) ? Position.fromJSON(object.position) : undefined, - }; + } }, toJSON(message: MsgRemoveMarginResponse): unknown { - const obj: any = {}; - message.marginOut !== undefined && (obj.marginOut = message.marginOut ? Coin.toJSON(message.marginOut) : undefined); - message.fundingPayment !== undefined && (obj.fundingPayment = message.fundingPayment); - message.position !== undefined && (obj.position = message.position ? Position.toJSON(message.position) : undefined); - return obj; - }, - - fromPartial, I>>(object: I): MsgRemoveMarginResponse { - const message = createBaseMsgRemoveMarginResponse(); - message.marginOut = (object.marginOut !== undefined && object.marginOut !== null) - ? Coin.fromPartial(object.marginOut) - : undefined; - message.fundingPayment = object.fundingPayment ?? ""; - message.position = (object.position !== undefined && object.position !== null) - ? Position.fromPartial(object.position) - : undefined; - return message; - }, -}; + const obj: any = {} + message.marginOut !== undefined && + (obj.marginOut = message.marginOut ? Coin.toJSON(message.marginOut) : undefined) + message.fundingPayment !== undefined && + (obj.fundingPayment = message.fundingPayment) + message.position !== undefined && + (obj.position = message.position ? Position.toJSON(message.position) : undefined) + return obj + }, + + fromPartial, I>>( + object: I, + ): MsgRemoveMarginResponse { + const message = createBaseMsgRemoveMarginResponse() + message.marginOut = + object.marginOut !== undefined && object.marginOut !== null + ? Coin.fromPartial(object.marginOut) + : undefined + message.fundingPayment = object.fundingPayment ?? "" + message.position = + object.position !== undefined && object.position !== null + ? Position.fromPartial(object.position) + : undefined + return message + }, +} function createBaseMsgAddMargin(): MsgAddMargin { - return { sender: "", pair: "", margin: undefined }; + return { sender: "", pair: "", margin: undefined } } export const MsgAddMargin = { encode(message: MsgAddMargin, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.sender !== "") { - writer.uint32(10).string(message.sender); + writer.uint32(10).string(message.sender) } if (message.pair !== "") { - writer.uint32(18).string(message.pair); + writer.uint32(18).string(message.pair) } if (message.margin !== undefined) { - Coin.encode(message.margin, writer.uint32(26).fork()).ldelim(); + Coin.encode(message.margin, writer.uint32(26).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MsgAddMargin { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgAddMargin(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgAddMargin() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.sender = reader.string(); - break; + message.sender = reader.string() + break case 2: - message.pair = reader.string(); - break; + message.pair = reader.string() + break case 3: - message.margin = Coin.decode(reader, reader.uint32()); - break; + message.margin = Coin.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): MsgAddMargin { @@ -303,122 +319,137 @@ export const MsgAddMargin = { sender: isSet(object.sender) ? String(object.sender) : "", pair: isSet(object.pair) ? String(object.pair) : "", margin: isSet(object.margin) ? Coin.fromJSON(object.margin) : undefined, - }; + } }, toJSON(message: MsgAddMargin): unknown { - const obj: any = {}; - message.sender !== undefined && (obj.sender = message.sender); - message.pair !== undefined && (obj.pair = message.pair); - message.margin !== undefined && (obj.margin = message.margin ? Coin.toJSON(message.margin) : undefined); - return obj; + const obj: any = {} + message.sender !== undefined && (obj.sender = message.sender) + message.pair !== undefined && (obj.pair = message.pair) + message.margin !== undefined && + (obj.margin = message.margin ? Coin.toJSON(message.margin) : undefined) + return obj }, fromPartial, I>>(object: I): MsgAddMargin { - const message = createBaseMsgAddMargin(); - message.sender = object.sender ?? ""; - message.pair = object.pair ?? ""; - message.margin = (object.margin !== undefined && object.margin !== null) - ? Coin.fromPartial(object.margin) - : undefined; - return message; + const message = createBaseMsgAddMargin() + message.sender = object.sender ?? "" + message.pair = object.pair ?? "" + message.margin = + object.margin !== undefined && object.margin !== null + ? Coin.fromPartial(object.margin) + : undefined + return message }, -}; +} function createBaseMsgAddMarginResponse(): MsgAddMarginResponse { - return { fundingPayment: "", position: undefined }; + return { fundingPayment: "", position: undefined } } export const MsgAddMarginResponse = { - encode(message: MsgAddMarginResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: MsgAddMarginResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.fundingPayment !== "") { - writer.uint32(10).string(message.fundingPayment); + writer.uint32(10).string(message.fundingPayment) } if (message.position !== undefined) { - Position.encode(message.position, writer.uint32(18).fork()).ldelim(); + Position.encode(message.position, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MsgAddMarginResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgAddMarginResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgAddMarginResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.fundingPayment = reader.string(); - break; + message.fundingPayment = reader.string() + break case 2: - message.position = Position.decode(reader, reader.uint32()); - break; + message.position = Position.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): MsgAddMarginResponse { return { fundingPayment: isSet(object.fundingPayment) ? String(object.fundingPayment) : "", position: isSet(object.position) ? Position.fromJSON(object.position) : undefined, - }; + } }, toJSON(message: MsgAddMarginResponse): unknown { - const obj: any = {}; - message.fundingPayment !== undefined && (obj.fundingPayment = message.fundingPayment); - message.position !== undefined && (obj.position = message.position ? Position.toJSON(message.position) : undefined); - return obj; + const obj: any = {} + message.fundingPayment !== undefined && + (obj.fundingPayment = message.fundingPayment) + message.position !== undefined && + (obj.position = message.position ? Position.toJSON(message.position) : undefined) + return obj }, - fromPartial, I>>(object: I): MsgAddMarginResponse { - const message = createBaseMsgAddMarginResponse(); - message.fundingPayment = object.fundingPayment ?? ""; - message.position = (object.position !== undefined && object.position !== null) - ? Position.fromPartial(object.position) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): MsgAddMarginResponse { + const message = createBaseMsgAddMarginResponse() + message.fundingPayment = object.fundingPayment ?? "" + message.position = + object.position !== undefined && object.position !== null + ? Position.fromPartial(object.position) + : undefined + return message }, -}; +} function createBaseMsgMultiLiquidate(): MsgMultiLiquidate { - return { sender: "", liquidations: [] }; + return { sender: "", liquidations: [] } } export const MsgMultiLiquidate = { - encode(message: MsgMultiLiquidate, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: MsgMultiLiquidate, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.sender !== "") { - writer.uint32(10).string(message.sender); + writer.uint32(10).string(message.sender) } for (const v of message.liquidations) { - MsgMultiLiquidate_Liquidation.encode(v!, writer.uint32(18).fork()).ldelim(); + MsgMultiLiquidate_Liquidation.encode(v!, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MsgMultiLiquidate { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgMultiLiquidate(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgMultiLiquidate() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.sender = reader.string(); - break; + message.sender = reader.string() + break case 2: - message.liquidations.push(MsgMultiLiquidate_Liquidation.decode(reader, reader.uint32())); - break; + message.liquidations.push( + MsgMultiLiquidate_Liquidation.decode(reader, reader.uint32()), + ) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): MsgMultiLiquidate { @@ -427,287 +458,339 @@ export const MsgMultiLiquidate = { liquidations: Array.isArray(object?.liquidations) ? object.liquidations.map((e: any) => MsgMultiLiquidate_Liquidation.fromJSON(e)) : [], - }; + } }, toJSON(message: MsgMultiLiquidate): unknown { - const obj: any = {}; - message.sender !== undefined && (obj.sender = message.sender); + const obj: any = {} + message.sender !== undefined && (obj.sender = message.sender) if (message.liquidations) { - obj.liquidations = message.liquidations.map((e) => e ? MsgMultiLiquidate_Liquidation.toJSON(e) : undefined); + obj.liquidations = message.liquidations.map((e) => + e ? MsgMultiLiquidate_Liquidation.toJSON(e) : undefined, + ) } else { - obj.liquidations = []; + obj.liquidations = [] } - return obj; + return obj }, - fromPartial, I>>(object: I): MsgMultiLiquidate { - const message = createBaseMsgMultiLiquidate(); - message.sender = object.sender ?? ""; - message.liquidations = object.liquidations?.map((e) => MsgMultiLiquidate_Liquidation.fromPartial(e)) || []; - return message; + fromPartial, I>>( + object: I, + ): MsgMultiLiquidate { + const message = createBaseMsgMultiLiquidate() + message.sender = object.sender ?? "" + message.liquidations = + object.liquidations?.map((e) => MsgMultiLiquidate_Liquidation.fromPartial(e)) || + [] + return message }, -}; +} function createBaseMsgMultiLiquidate_Liquidation(): MsgMultiLiquidate_Liquidation { - return { pair: "", trader: "" }; + return { pair: "", trader: "" } } export const MsgMultiLiquidate_Liquidation = { - encode(message: MsgMultiLiquidate_Liquidation, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: MsgMultiLiquidate_Liquidation, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.pair !== "") { - writer.uint32(10).string(message.pair); + writer.uint32(10).string(message.pair) } if (message.trader !== "") { - writer.uint32(18).string(message.trader); + writer.uint32(18).string(message.trader) } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgMultiLiquidate_Liquidation { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgMultiLiquidate_Liquidation(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgMultiLiquidate_Liquidation { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgMultiLiquidate_Liquidation() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.pair = reader.string(); - break; + message.pair = reader.string() + break case 2: - message.trader = reader.string(); - break; + message.trader = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): MsgMultiLiquidate_Liquidation { return { pair: isSet(object.pair) ? String(object.pair) : "", trader: isSet(object.trader) ? String(object.trader) : "", - }; + } }, toJSON(message: MsgMultiLiquidate_Liquidation): unknown { - const obj: any = {}; - message.pair !== undefined && (obj.pair = message.pair); - message.trader !== undefined && (obj.trader = message.trader); - return obj; + const obj: any = {} + message.pair !== undefined && (obj.pair = message.pair) + message.trader !== undefined && (obj.trader = message.trader) + return obj }, fromPartial, I>>( object: I, ): MsgMultiLiquidate_Liquidation { - const message = createBaseMsgMultiLiquidate_Liquidation(); - message.pair = object.pair ?? ""; - message.trader = object.trader ?? ""; - return message; + const message = createBaseMsgMultiLiquidate_Liquidation() + message.pair = object.pair ?? "" + message.trader = object.trader ?? "" + return message }, -}; +} function createBaseMsgMultiLiquidateResponse(): MsgMultiLiquidateResponse { - return { liquidations: [] }; + return { liquidations: [] } } export const MsgMultiLiquidateResponse = { - encode(message: MsgMultiLiquidateResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: MsgMultiLiquidateResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { for (const v of message.liquidations) { - MsgMultiLiquidateResponse_LiquidationResponse.encode(v!, writer.uint32(10).fork()).ldelim(); + MsgMultiLiquidateResponse_LiquidationResponse.encode( + v!, + writer.uint32(10).fork(), + ).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MsgMultiLiquidateResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgMultiLiquidateResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgMultiLiquidateResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.liquidations.push(MsgMultiLiquidateResponse_LiquidationResponse.decode(reader, reader.uint32())); - break; + message.liquidations.push( + MsgMultiLiquidateResponse_LiquidationResponse.decode( + reader, + reader.uint32(), + ), + ) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): MsgMultiLiquidateResponse { return { liquidations: Array.isArray(object?.liquidations) - ? object.liquidations.map((e: any) => MsgMultiLiquidateResponse_LiquidationResponse.fromJSON(e)) + ? object.liquidations.map((e: any) => + MsgMultiLiquidateResponse_LiquidationResponse.fromJSON(e), + ) : [], - }; + } }, toJSON(message: MsgMultiLiquidateResponse): unknown { - const obj: any = {}; + const obj: any = {} if (message.liquidations) { obj.liquidations = message.liquidations.map((e) => - e ? MsgMultiLiquidateResponse_LiquidationResponse.toJSON(e) : undefined - ); + e ? MsgMultiLiquidateResponse_LiquidationResponse.toJSON(e) : undefined, + ) } else { - obj.liquidations = []; + obj.liquidations = [] } - return obj; + return obj }, - fromPartial, I>>(object: I): MsgMultiLiquidateResponse { - const message = createBaseMsgMultiLiquidateResponse(); + fromPartial, I>>( + object: I, + ): MsgMultiLiquidateResponse { + const message = createBaseMsgMultiLiquidateResponse() message.liquidations = - object.liquidations?.map((e) => MsgMultiLiquidateResponse_LiquidationResponse.fromPartial(e)) || []; - return message; + object.liquidations?.map((e) => + MsgMultiLiquidateResponse_LiquidationResponse.fromPartial(e), + ) || [] + return message }, -}; +} function createBaseMsgMultiLiquidateResponse_LiquidationResponse(): MsgMultiLiquidateResponse_LiquidationResponse { - return { success: false, error: "", liquidatorFee: undefined, perpEfFee: undefined }; + return { success: false, error: "", liquidatorFee: undefined, perpEfFee: undefined } } export const MsgMultiLiquidateResponse_LiquidationResponse = { - encode(message: MsgMultiLiquidateResponse_LiquidationResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: MsgMultiLiquidateResponse_LiquidationResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.success === true) { - writer.uint32(8).bool(message.success); + writer.uint32(8).bool(message.success) } if (message.error !== "") { - writer.uint32(18).string(message.error); + writer.uint32(18).string(message.error) } if (message.liquidatorFee !== undefined) { - Coin.encode(message.liquidatorFee, writer.uint32(26).fork()).ldelim(); + Coin.encode(message.liquidatorFee, writer.uint32(26).fork()).ldelim() } if (message.perpEfFee !== undefined) { - Coin.encode(message.perpEfFee, writer.uint32(34).fork()).ldelim(); + Coin.encode(message.perpEfFee, writer.uint32(34).fork()).ldelim() } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgMultiLiquidateResponse_LiquidationResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgMultiLiquidateResponse_LiquidationResponse(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgMultiLiquidateResponse_LiquidationResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgMultiLiquidateResponse_LiquidationResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.success = reader.bool(); - break; + message.success = reader.bool() + break case 2: - message.error = reader.string(); - break; + message.error = reader.string() + break case 3: - message.liquidatorFee = Coin.decode(reader, reader.uint32()); - break; + message.liquidatorFee = Coin.decode(reader, reader.uint32()) + break case 4: - message.perpEfFee = Coin.decode(reader, reader.uint32()); - break; + message.perpEfFee = Coin.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): MsgMultiLiquidateResponse_LiquidationResponse { return { success: isSet(object.success) ? Boolean(object.success) : false, error: isSet(object.error) ? String(object.error) : "", - liquidatorFee: isSet(object.liquidatorFee) ? Coin.fromJSON(object.liquidatorFee) : undefined, + liquidatorFee: isSet(object.liquidatorFee) + ? Coin.fromJSON(object.liquidatorFee) + : undefined, perpEfFee: isSet(object.perpEfFee) ? Coin.fromJSON(object.perpEfFee) : undefined, - }; + } }, toJSON(message: MsgMultiLiquidateResponse_LiquidationResponse): unknown { - const obj: any = {}; - message.success !== undefined && (obj.success = message.success); - message.error !== undefined && (obj.error = message.error); + const obj: any = {} + message.success !== undefined && (obj.success = message.success) + message.error !== undefined && (obj.error = message.error) message.liquidatorFee !== undefined && - (obj.liquidatorFee = message.liquidatorFee ? Coin.toJSON(message.liquidatorFee) : undefined); - message.perpEfFee !== undefined && (obj.perpEfFee = message.perpEfFee ? Coin.toJSON(message.perpEfFee) : undefined); - return obj; + (obj.liquidatorFee = message.liquidatorFee + ? Coin.toJSON(message.liquidatorFee) + : undefined) + message.perpEfFee !== undefined && + (obj.perpEfFee = message.perpEfFee ? Coin.toJSON(message.perpEfFee) : undefined) + return obj + }, + + fromPartial< + I extends Exact, I>, + >(object: I): MsgMultiLiquidateResponse_LiquidationResponse { + const message = createBaseMsgMultiLiquidateResponse_LiquidationResponse() + message.success = object.success ?? false + message.error = object.error ?? "" + message.liquidatorFee = + object.liquidatorFee !== undefined && object.liquidatorFee !== null + ? Coin.fromPartial(object.liquidatorFee) + : undefined + message.perpEfFee = + object.perpEfFee !== undefined && object.perpEfFee !== null + ? Coin.fromPartial(object.perpEfFee) + : undefined + return message }, - - fromPartial, I>>( - object: I, - ): MsgMultiLiquidateResponse_LiquidationResponse { - const message = createBaseMsgMultiLiquidateResponse_LiquidationResponse(); - message.success = object.success ?? false; - message.error = object.error ?? ""; - message.liquidatorFee = (object.liquidatorFee !== undefined && object.liquidatorFee !== null) - ? Coin.fromPartial(object.liquidatorFee) - : undefined; - message.perpEfFee = (object.perpEfFee !== undefined && object.perpEfFee !== null) - ? Coin.fromPartial(object.perpEfFee) - : undefined; - return message; - }, -}; +} function createBaseMsgOpenPosition(): MsgOpenPosition { - return { sender: "", pair: "", side: 0, quoteAssetAmount: "", leverage: "", baseAssetAmountLimit: "" }; + return { + sender: "", + pair: "", + side: 0, + quoteAssetAmount: "", + leverage: "", + baseAssetAmountLimit: "", + } } export const MsgOpenPosition = { - encode(message: MsgOpenPosition, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: MsgOpenPosition, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.sender !== "") { - writer.uint32(10).string(message.sender); + writer.uint32(10).string(message.sender) } if (message.pair !== "") { - writer.uint32(18).string(message.pair); + writer.uint32(18).string(message.pair) } if (message.side !== 0) { - writer.uint32(24).int32(message.side); + writer.uint32(24).int32(message.side) } if (message.quoteAssetAmount !== "") { - writer.uint32(34).string(message.quoteAssetAmount); + writer.uint32(34).string(message.quoteAssetAmount) } if (message.leverage !== "") { - writer.uint32(42).string(message.leverage); + writer.uint32(42).string(message.leverage) } if (message.baseAssetAmountLimit !== "") { - writer.uint32(50).string(message.baseAssetAmountLimit); + writer.uint32(50).string(message.baseAssetAmountLimit) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MsgOpenPosition { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgOpenPosition(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgOpenPosition() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.sender = reader.string(); - break; + message.sender = reader.string() + break case 2: - message.pair = reader.string(); - break; + message.pair = reader.string() + break case 3: - message.side = reader.int32() as any; - break; + message.side = reader.int32() as any + break case 4: - message.quoteAssetAmount = reader.string(); - break; + message.quoteAssetAmount = reader.string() + break case 5: - message.leverage = reader.string(); - break; + message.leverage = reader.string() + break case 6: - message.baseAssetAmountLimit = reader.string(); - break; + message.baseAssetAmountLimit = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): MsgOpenPosition { @@ -715,34 +798,42 @@ export const MsgOpenPosition = { sender: isSet(object.sender) ? String(object.sender) : "", pair: isSet(object.pair) ? String(object.pair) : "", side: isSet(object.side) ? sideFromJSON(object.side) : 0, - quoteAssetAmount: isSet(object.quoteAssetAmount) ? String(object.quoteAssetAmount) : "", + quoteAssetAmount: isSet(object.quoteAssetAmount) + ? String(object.quoteAssetAmount) + : "", leverage: isSet(object.leverage) ? String(object.leverage) : "", - baseAssetAmountLimit: isSet(object.baseAssetAmountLimit) ? String(object.baseAssetAmountLimit) : "", - }; + baseAssetAmountLimit: isSet(object.baseAssetAmountLimit) + ? String(object.baseAssetAmountLimit) + : "", + } }, toJSON(message: MsgOpenPosition): unknown { - const obj: any = {}; - message.sender !== undefined && (obj.sender = message.sender); - message.pair !== undefined && (obj.pair = message.pair); - message.side !== undefined && (obj.side = sideToJSON(message.side)); - message.quoteAssetAmount !== undefined && (obj.quoteAssetAmount = message.quoteAssetAmount); - message.leverage !== undefined && (obj.leverage = message.leverage); - message.baseAssetAmountLimit !== undefined && (obj.baseAssetAmountLimit = message.baseAssetAmountLimit); - return obj; - }, - - fromPartial, I>>(object: I): MsgOpenPosition { - const message = createBaseMsgOpenPosition(); - message.sender = object.sender ?? ""; - message.pair = object.pair ?? ""; - message.side = object.side ?? 0; - message.quoteAssetAmount = object.quoteAssetAmount ?? ""; - message.leverage = object.leverage ?? ""; - message.baseAssetAmountLimit = object.baseAssetAmountLimit ?? ""; - return message; - }, -}; + const obj: any = {} + message.sender !== undefined && (obj.sender = message.sender) + message.pair !== undefined && (obj.pair = message.pair) + message.side !== undefined && (obj.side = sideToJSON(message.side)) + message.quoteAssetAmount !== undefined && + (obj.quoteAssetAmount = message.quoteAssetAmount) + message.leverage !== undefined && (obj.leverage = message.leverage) + message.baseAssetAmountLimit !== undefined && + (obj.baseAssetAmountLimit = message.baseAssetAmountLimit) + return obj + }, + + fromPartial, I>>( + object: I, + ): MsgOpenPosition { + const message = createBaseMsgOpenPosition() + message.sender = object.sender ?? "" + message.pair = object.pair ?? "" + message.side = object.side ?? 0 + message.quoteAssetAmount = object.quoteAssetAmount ?? "" + message.leverage = object.leverage ?? "" + message.baseAssetAmountLimit = object.baseAssetAmountLimit ?? "" + return message + }, +} function createBaseMsgOpenPositionResponse(): MsgOpenPositionResponse { return { @@ -754,176 +845,201 @@ function createBaseMsgOpenPositionResponse(): MsgOpenPositionResponse { unrealizedPnlAfter: "", marginToVault: "", positionNotional: "", - }; + } } export const MsgOpenPositionResponse = { - encode(message: MsgOpenPositionResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: MsgOpenPositionResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.position !== undefined) { - Position.encode(message.position, writer.uint32(10).fork()).ldelim(); + Position.encode(message.position, writer.uint32(10).fork()).ldelim() } if (message.exchangedNotionalValue !== "") { - writer.uint32(18).string(message.exchangedNotionalValue); + writer.uint32(18).string(message.exchangedNotionalValue) } if (message.exchangedPositionSize !== "") { - writer.uint32(26).string(message.exchangedPositionSize); + writer.uint32(26).string(message.exchangedPositionSize) } if (message.fundingPayment !== "") { - writer.uint32(34).string(message.fundingPayment); + writer.uint32(34).string(message.fundingPayment) } if (message.realizedPnl !== "") { - writer.uint32(42).string(message.realizedPnl); + writer.uint32(42).string(message.realizedPnl) } if (message.unrealizedPnlAfter !== "") { - writer.uint32(50).string(message.unrealizedPnlAfter); + writer.uint32(50).string(message.unrealizedPnlAfter) } if (message.marginToVault !== "") { - writer.uint32(58).string(message.marginToVault); + writer.uint32(58).string(message.marginToVault) } if (message.positionNotional !== "") { - writer.uint32(66).string(message.positionNotional); + writer.uint32(66).string(message.positionNotional) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MsgOpenPositionResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgOpenPositionResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgOpenPositionResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.position = Position.decode(reader, reader.uint32()); - break; + message.position = Position.decode(reader, reader.uint32()) + break case 2: - message.exchangedNotionalValue = reader.string(); - break; + message.exchangedNotionalValue = reader.string() + break case 3: - message.exchangedPositionSize = reader.string(); - break; + message.exchangedPositionSize = reader.string() + break case 4: - message.fundingPayment = reader.string(); - break; + message.fundingPayment = reader.string() + break case 5: - message.realizedPnl = reader.string(); - break; + message.realizedPnl = reader.string() + break case 6: - message.unrealizedPnlAfter = reader.string(); - break; + message.unrealizedPnlAfter = reader.string() + break case 7: - message.marginToVault = reader.string(); - break; + message.marginToVault = reader.string() + break case 8: - message.positionNotional = reader.string(); - break; + message.positionNotional = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): MsgOpenPositionResponse { return { position: isSet(object.position) ? Position.fromJSON(object.position) : undefined, - exchangedNotionalValue: isSet(object.exchangedNotionalValue) ? String(object.exchangedNotionalValue) : "", - exchangedPositionSize: isSet(object.exchangedPositionSize) ? String(object.exchangedPositionSize) : "", + exchangedNotionalValue: isSet(object.exchangedNotionalValue) + ? String(object.exchangedNotionalValue) + : "", + exchangedPositionSize: isSet(object.exchangedPositionSize) + ? String(object.exchangedPositionSize) + : "", fundingPayment: isSet(object.fundingPayment) ? String(object.fundingPayment) : "", realizedPnl: isSet(object.realizedPnl) ? String(object.realizedPnl) : "", - unrealizedPnlAfter: isSet(object.unrealizedPnlAfter) ? String(object.unrealizedPnlAfter) : "", + unrealizedPnlAfter: isSet(object.unrealizedPnlAfter) + ? String(object.unrealizedPnlAfter) + : "", marginToVault: isSet(object.marginToVault) ? String(object.marginToVault) : "", - positionNotional: isSet(object.positionNotional) ? String(object.positionNotional) : "", - }; + positionNotional: isSet(object.positionNotional) + ? String(object.positionNotional) + : "", + } }, toJSON(message: MsgOpenPositionResponse): unknown { - const obj: any = {}; - message.position !== undefined && (obj.position = message.position ? Position.toJSON(message.position) : undefined); - message.exchangedNotionalValue !== undefined && (obj.exchangedNotionalValue = message.exchangedNotionalValue); - message.exchangedPositionSize !== undefined && (obj.exchangedPositionSize = message.exchangedPositionSize); - message.fundingPayment !== undefined && (obj.fundingPayment = message.fundingPayment); - message.realizedPnl !== undefined && (obj.realizedPnl = message.realizedPnl); - message.unrealizedPnlAfter !== undefined && (obj.unrealizedPnlAfter = message.unrealizedPnlAfter); - message.marginToVault !== undefined && (obj.marginToVault = message.marginToVault); - message.positionNotional !== undefined && (obj.positionNotional = message.positionNotional); - return obj; - }, - - fromPartial, I>>(object: I): MsgOpenPositionResponse { - const message = createBaseMsgOpenPositionResponse(); - message.position = (object.position !== undefined && object.position !== null) - ? Position.fromPartial(object.position) - : undefined; - message.exchangedNotionalValue = object.exchangedNotionalValue ?? ""; - message.exchangedPositionSize = object.exchangedPositionSize ?? ""; - message.fundingPayment = object.fundingPayment ?? ""; - message.realizedPnl = object.realizedPnl ?? ""; - message.unrealizedPnlAfter = object.unrealizedPnlAfter ?? ""; - message.marginToVault = object.marginToVault ?? ""; - message.positionNotional = object.positionNotional ?? ""; - return message; - }, -}; + const obj: any = {} + message.position !== undefined && + (obj.position = message.position ? Position.toJSON(message.position) : undefined) + message.exchangedNotionalValue !== undefined && + (obj.exchangedNotionalValue = message.exchangedNotionalValue) + message.exchangedPositionSize !== undefined && + (obj.exchangedPositionSize = message.exchangedPositionSize) + message.fundingPayment !== undefined && + (obj.fundingPayment = message.fundingPayment) + message.realizedPnl !== undefined && (obj.realizedPnl = message.realizedPnl) + message.unrealizedPnlAfter !== undefined && + (obj.unrealizedPnlAfter = message.unrealizedPnlAfter) + message.marginToVault !== undefined && (obj.marginToVault = message.marginToVault) + message.positionNotional !== undefined && + (obj.positionNotional = message.positionNotional) + return obj + }, + + fromPartial, I>>( + object: I, + ): MsgOpenPositionResponse { + const message = createBaseMsgOpenPositionResponse() + message.position = + object.position !== undefined && object.position !== null + ? Position.fromPartial(object.position) + : undefined + message.exchangedNotionalValue = object.exchangedNotionalValue ?? "" + message.exchangedPositionSize = object.exchangedPositionSize ?? "" + message.fundingPayment = object.fundingPayment ?? "" + message.realizedPnl = object.realizedPnl ?? "" + message.unrealizedPnlAfter = object.unrealizedPnlAfter ?? "" + message.marginToVault = object.marginToVault ?? "" + message.positionNotional = object.positionNotional ?? "" + return message + }, +} function createBaseMsgClosePosition(): MsgClosePosition { - return { sender: "", pair: "" }; + return { sender: "", pair: "" } } export const MsgClosePosition = { - encode(message: MsgClosePosition, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: MsgClosePosition, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.sender !== "") { - writer.uint32(10).string(message.sender); + writer.uint32(10).string(message.sender) } if (message.pair !== "") { - writer.uint32(18).string(message.pair); + writer.uint32(18).string(message.pair) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MsgClosePosition { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgClosePosition(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgClosePosition() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.sender = reader.string(); - break; + message.sender = reader.string() + break case 2: - message.pair = reader.string(); - break; + message.pair = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): MsgClosePosition { return { sender: isSet(object.sender) ? String(object.sender) : "", pair: isSet(object.pair) ? String(object.pair) : "", - }; + } }, toJSON(message: MsgClosePosition): unknown { - const obj: any = {}; - message.sender !== undefined && (obj.sender = message.sender); - message.pair !== undefined && (obj.pair = message.pair); - return obj; + const obj: any = {} + message.sender !== undefined && (obj.sender = message.sender) + message.pair !== undefined && (obj.pair = message.pair) + return obj }, - fromPartial, I>>(object: I): MsgClosePosition { - const message = createBaseMsgClosePosition(); - message.sender = object.sender ?? ""; - message.pair = object.pair ?? ""; - return message; + fromPartial, I>>( + object: I, + ): MsgClosePosition { + const message = createBaseMsgClosePosition() + message.sender = object.sender ?? "" + message.pair = object.pair ?? "" + return message }, -}; +} function createBaseMsgClosePositionResponse(): MsgClosePositionResponse { return { @@ -932,270 +1048,318 @@ function createBaseMsgClosePositionResponse(): MsgClosePositionResponse { fundingPayment: "", realizedPnl: "", marginToTrader: "", - }; + } } export const MsgClosePositionResponse = { - encode(message: MsgClosePositionResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: MsgClosePositionResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.exchangedNotionalValue !== "") { - writer.uint32(10).string(message.exchangedNotionalValue); + writer.uint32(10).string(message.exchangedNotionalValue) } if (message.exchangedPositionSize !== "") { - writer.uint32(18).string(message.exchangedPositionSize); + writer.uint32(18).string(message.exchangedPositionSize) } if (message.fundingPayment !== "") { - writer.uint32(26).string(message.fundingPayment); + writer.uint32(26).string(message.fundingPayment) } if (message.realizedPnl !== "") { - writer.uint32(34).string(message.realizedPnl); + writer.uint32(34).string(message.realizedPnl) } if (message.marginToTrader !== "") { - writer.uint32(58).string(message.marginToTrader); + writer.uint32(58).string(message.marginToTrader) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MsgClosePositionResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgClosePositionResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgClosePositionResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.exchangedNotionalValue = reader.string(); - break; + message.exchangedNotionalValue = reader.string() + break case 2: - message.exchangedPositionSize = reader.string(); - break; + message.exchangedPositionSize = reader.string() + break case 3: - message.fundingPayment = reader.string(); - break; + message.fundingPayment = reader.string() + break case 4: - message.realizedPnl = reader.string(); - break; + message.realizedPnl = reader.string() + break case 7: - message.marginToTrader = reader.string(); - break; + message.marginToTrader = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): MsgClosePositionResponse { return { - exchangedNotionalValue: isSet(object.exchangedNotionalValue) ? String(object.exchangedNotionalValue) : "", - exchangedPositionSize: isSet(object.exchangedPositionSize) ? String(object.exchangedPositionSize) : "", + exchangedNotionalValue: isSet(object.exchangedNotionalValue) + ? String(object.exchangedNotionalValue) + : "", + exchangedPositionSize: isSet(object.exchangedPositionSize) + ? String(object.exchangedPositionSize) + : "", fundingPayment: isSet(object.fundingPayment) ? String(object.fundingPayment) : "", realizedPnl: isSet(object.realizedPnl) ? String(object.realizedPnl) : "", marginToTrader: isSet(object.marginToTrader) ? String(object.marginToTrader) : "", - }; + } }, toJSON(message: MsgClosePositionResponse): unknown { - const obj: any = {}; - message.exchangedNotionalValue !== undefined && (obj.exchangedNotionalValue = message.exchangedNotionalValue); - message.exchangedPositionSize !== undefined && (obj.exchangedPositionSize = message.exchangedPositionSize); - message.fundingPayment !== undefined && (obj.fundingPayment = message.fundingPayment); - message.realizedPnl !== undefined && (obj.realizedPnl = message.realizedPnl); - message.marginToTrader !== undefined && (obj.marginToTrader = message.marginToTrader); - return obj; - }, - - fromPartial, I>>(object: I): MsgClosePositionResponse { - const message = createBaseMsgClosePositionResponse(); - message.exchangedNotionalValue = object.exchangedNotionalValue ?? ""; - message.exchangedPositionSize = object.exchangedPositionSize ?? ""; - message.fundingPayment = object.fundingPayment ?? ""; - message.realizedPnl = object.realizedPnl ?? ""; - message.marginToTrader = object.marginToTrader ?? ""; - return message; - }, -}; + const obj: any = {} + message.exchangedNotionalValue !== undefined && + (obj.exchangedNotionalValue = message.exchangedNotionalValue) + message.exchangedPositionSize !== undefined && + (obj.exchangedPositionSize = message.exchangedPositionSize) + message.fundingPayment !== undefined && + (obj.fundingPayment = message.fundingPayment) + message.realizedPnl !== undefined && (obj.realizedPnl = message.realizedPnl) + message.marginToTrader !== undefined && + (obj.marginToTrader = message.marginToTrader) + return obj + }, + + fromPartial, I>>( + object: I, + ): MsgClosePositionResponse { + const message = createBaseMsgClosePositionResponse() + message.exchangedNotionalValue = object.exchangedNotionalValue ?? "" + message.exchangedPositionSize = object.exchangedPositionSize ?? "" + message.fundingPayment = object.fundingPayment ?? "" + message.realizedPnl = object.realizedPnl ?? "" + message.marginToTrader = object.marginToTrader ?? "" + return message + }, +} function createBaseMsgDonateToEcosystemFund(): MsgDonateToEcosystemFund { - return { sender: "", donation: undefined }; + return { sender: "", donation: undefined } } export const MsgDonateToEcosystemFund = { - encode(message: MsgDonateToEcosystemFund, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: MsgDonateToEcosystemFund, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.sender !== "") { - writer.uint32(10).string(message.sender); + writer.uint32(10).string(message.sender) } if (message.donation !== undefined) { - Coin.encode(message.donation, writer.uint32(18).fork()).ldelim(); + Coin.encode(message.donation, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MsgDonateToEcosystemFund { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgDonateToEcosystemFund(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgDonateToEcosystemFund() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.sender = reader.string(); - break; + message.sender = reader.string() + break case 2: - message.donation = Coin.decode(reader, reader.uint32()); - break; + message.donation = Coin.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): MsgDonateToEcosystemFund { return { sender: isSet(object.sender) ? String(object.sender) : "", donation: isSet(object.donation) ? Coin.fromJSON(object.donation) : undefined, - }; + } }, toJSON(message: MsgDonateToEcosystemFund): unknown { - const obj: any = {}; - message.sender !== undefined && (obj.sender = message.sender); - message.donation !== undefined && (obj.donation = message.donation ? Coin.toJSON(message.donation) : undefined); - return obj; + const obj: any = {} + message.sender !== undefined && (obj.sender = message.sender) + message.donation !== undefined && + (obj.donation = message.donation ? Coin.toJSON(message.donation) : undefined) + return obj }, - fromPartial, I>>(object: I): MsgDonateToEcosystemFund { - const message = createBaseMsgDonateToEcosystemFund(); - message.sender = object.sender ?? ""; - message.donation = (object.donation !== undefined && object.donation !== null) - ? Coin.fromPartial(object.donation) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): MsgDonateToEcosystemFund { + const message = createBaseMsgDonateToEcosystemFund() + message.sender = object.sender ?? "" + message.donation = + object.donation !== undefined && object.donation !== null + ? Coin.fromPartial(object.donation) + : undefined + return message }, -}; +} function createBaseMsgDonateToEcosystemFundResponse(): MsgDonateToEcosystemFundResponse { - return {}; + return {} } export const MsgDonateToEcosystemFundResponse = { - encode(_: MsgDonateToEcosystemFundResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; + encode( + _: MsgDonateToEcosystemFundResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgDonateToEcosystemFundResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgDonateToEcosystemFundResponse(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgDonateToEcosystemFundResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgDonateToEcosystemFundResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(_: any): MsgDonateToEcosystemFundResponse { - return {}; + return {} }, toJSON(_: MsgDonateToEcosystemFundResponse): unknown { - const obj: any = {}; - return obj; + const obj: any = {} + return obj }, fromPartial, I>>( _: I, ): MsgDonateToEcosystemFundResponse { - const message = createBaseMsgDonateToEcosystemFundResponse(); - return message; + const message = createBaseMsgDonateToEcosystemFundResponse() + return message }, -}; +} /** Msg defines the x/perp Msg service. */ export interface Msg { - RemoveMargin(request: MsgRemoveMargin): Promise; - AddMargin(request: MsgAddMargin): Promise; - MultiLiquidate(request: MsgMultiLiquidate): Promise; - OpenPosition(request: MsgOpenPosition): Promise; - ClosePosition(request: MsgClosePosition): Promise; - DonateToEcosystemFund(request: MsgDonateToEcosystemFund): Promise; + RemoveMargin(request: MsgRemoveMargin): Promise + AddMargin(request: MsgAddMargin): Promise + MultiLiquidate(request: MsgMultiLiquidate): Promise + OpenPosition(request: MsgOpenPosition): Promise + ClosePosition(request: MsgClosePosition): Promise + DonateToEcosystemFund( + request: MsgDonateToEcosystemFund, + ): Promise } export class MsgClientImpl implements Msg { - private readonly rpc: Rpc; + private readonly rpc: Rpc constructor(rpc: Rpc) { - this.rpc = rpc; - this.RemoveMargin = this.RemoveMargin.bind(this); - this.AddMargin = this.AddMargin.bind(this); - this.MultiLiquidate = this.MultiLiquidate.bind(this); - this.OpenPosition = this.OpenPosition.bind(this); - this.ClosePosition = this.ClosePosition.bind(this); - this.DonateToEcosystemFund = this.DonateToEcosystemFund.bind(this); + this.rpc = rpc + this.RemoveMargin = this.RemoveMargin.bind(this) + this.AddMargin = this.AddMargin.bind(this) + this.MultiLiquidate = this.MultiLiquidate.bind(this) + this.OpenPosition = this.OpenPosition.bind(this) + this.ClosePosition = this.ClosePosition.bind(this) + this.DonateToEcosystemFund = this.DonateToEcosystemFund.bind(this) } RemoveMargin(request: MsgRemoveMargin): Promise { - const data = MsgRemoveMargin.encode(request).finish(); - const promise = this.rpc.request("nibiru.perp.v1.Msg", "RemoveMargin", data); - return promise.then((data) => MsgRemoveMarginResponse.decode(new _m0.Reader(data))); + const data = MsgRemoveMargin.encode(request).finish() + const promise = this.rpc.request("nibiru.perp.v1.Msg", "RemoveMargin", data) + return promise.then((data) => MsgRemoveMarginResponse.decode(new _m0.Reader(data))) } AddMargin(request: MsgAddMargin): Promise { - const data = MsgAddMargin.encode(request).finish(); - const promise = this.rpc.request("nibiru.perp.v1.Msg", "AddMargin", data); - return promise.then((data) => MsgAddMarginResponse.decode(new _m0.Reader(data))); + const data = MsgAddMargin.encode(request).finish() + const promise = this.rpc.request("nibiru.perp.v1.Msg", "AddMargin", data) + return promise.then((data) => MsgAddMarginResponse.decode(new _m0.Reader(data))) } MultiLiquidate(request: MsgMultiLiquidate): Promise { - const data = MsgMultiLiquidate.encode(request).finish(); - const promise = this.rpc.request("nibiru.perp.v1.Msg", "MultiLiquidate", data); - return promise.then((data) => MsgMultiLiquidateResponse.decode(new _m0.Reader(data))); + const data = MsgMultiLiquidate.encode(request).finish() + const promise = this.rpc.request("nibiru.perp.v1.Msg", "MultiLiquidate", data) + return promise.then((data) => + MsgMultiLiquidateResponse.decode(new _m0.Reader(data)), + ) } OpenPosition(request: MsgOpenPosition): Promise { - const data = MsgOpenPosition.encode(request).finish(); - const promise = this.rpc.request("nibiru.perp.v1.Msg", "OpenPosition", data); - return promise.then((data) => MsgOpenPositionResponse.decode(new _m0.Reader(data))); + const data = MsgOpenPosition.encode(request).finish() + const promise = this.rpc.request("nibiru.perp.v1.Msg", "OpenPosition", data) + return promise.then((data) => MsgOpenPositionResponse.decode(new _m0.Reader(data))) } ClosePosition(request: MsgClosePosition): Promise { - const data = MsgClosePosition.encode(request).finish(); - const promise = this.rpc.request("nibiru.perp.v1.Msg", "ClosePosition", data); - return promise.then((data) => MsgClosePositionResponse.decode(new _m0.Reader(data))); + const data = MsgClosePosition.encode(request).finish() + const promise = this.rpc.request("nibiru.perp.v1.Msg", "ClosePosition", data) + return promise.then((data) => MsgClosePositionResponse.decode(new _m0.Reader(data))) } - DonateToEcosystemFund(request: MsgDonateToEcosystemFund): Promise { - const data = MsgDonateToEcosystemFund.encode(request).finish(); - const promise = this.rpc.request("nibiru.perp.v1.Msg", "DonateToEcosystemFund", data); - return promise.then((data) => MsgDonateToEcosystemFundResponse.decode(new _m0.Reader(data))); + DonateToEcosystemFund( + request: MsgDonateToEcosystemFund, + ): Promise { + const data = MsgDonateToEcosystemFund.encode(request).finish() + const promise = this.rpc.request( + "nibiru.perp.v1.Msg", + "DonateToEcosystemFund", + data, + ) + return promise.then((data) => + MsgDonateToEcosystemFundResponse.decode(new _m0.Reader(data)), + ) } } interface Rpc { - request(service: string, method: string, data: Uint8Array): Promise; + request(service: string, method: string, data: Uint8Array): Promise } -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/spot/v1/event.ts b/packages/protojs/src/spot/v1/event.ts index 7de8a217..e0f401b6 100644 --- a/packages/protojs/src/spot/v1/event.ts +++ b/packages/protojs/src/spot/v1/event.ts @@ -1,326 +1,423 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { Coin } from "../../cosmos/base/v1beta1/coin"; +import { Coin } from "../../cosmos/base/v1beta1/coin" +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "nibiru.spot.v1"; +export const protobufPackage = "nibiru.spot.v1" export interface EventPoolJoined { - address: string; - poolId: Long; - tokensIn: Coin[]; - poolSharesOut?: Coin; - remCoins: Coin[]; + address: string + poolId: Long + tokensIn: Coin[] + poolSharesOut?: Coin + remCoins: Coin[] } export interface EventPoolCreated { - creator: string; - poolId: Long; + creator: string + poolId: Long + fees: Coin[] } export interface EventPoolExited { - address: string; - poolId: Long; - poolSharesIn?: Coin; - tokensOut: Coin[]; + address: string + poolId: Long + poolSharesIn?: Coin + tokensOut: Coin[] + fees: Coin[] } export interface EventAssetsSwapped { - address: string; - poolId: Long; - tokenIn?: Coin; - tokenOut?: Coin; + address: string + poolId: Long + tokenIn?: Coin + tokenOut?: Coin + fee?: Coin } function createBaseEventPoolJoined(): EventPoolJoined { - return { address: "", poolId: Long.UZERO, tokensIn: [], poolSharesOut: undefined, remCoins: [] }; + return { + address: "", + poolId: Long.UZERO, + tokensIn: [], + poolSharesOut: undefined, + remCoins: [], + } } export const EventPoolJoined = { - encode(message: EventPoolJoined, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: EventPoolJoined, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.address !== "") { - writer.uint32(10).string(message.address); + writer.uint32(10).string(message.address) } if (!message.poolId.isZero()) { - writer.uint32(16).uint64(message.poolId); + writer.uint32(16).uint64(message.poolId) } for (const v of message.tokensIn) { - Coin.encode(v!, writer.uint32(26).fork()).ldelim(); + Coin.encode(v!, writer.uint32(26).fork()).ldelim() } if (message.poolSharesOut !== undefined) { - Coin.encode(message.poolSharesOut, writer.uint32(34).fork()).ldelim(); + Coin.encode(message.poolSharesOut, writer.uint32(34).fork()).ldelim() } for (const v of message.remCoins) { - Coin.encode(v!, writer.uint32(42).fork()).ldelim(); + Coin.encode(v!, writer.uint32(42).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): EventPoolJoined { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseEventPoolJoined(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseEventPoolJoined() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.address = reader.string(); - break; + message.address = reader.string() + break case 2: - message.poolId = reader.uint64() as Long; - break; + message.poolId = reader.uint64() as Long + break case 3: - message.tokensIn.push(Coin.decode(reader, reader.uint32())); - break; + message.tokensIn.push(Coin.decode(reader, reader.uint32())) + break case 4: - message.poolSharesOut = Coin.decode(reader, reader.uint32()); - break; + message.poolSharesOut = Coin.decode(reader, reader.uint32()) + break case 5: - message.remCoins.push(Coin.decode(reader, reader.uint32())); - break; + message.remCoins.push(Coin.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): EventPoolJoined { return { address: isSet(object.address) ? String(object.address) : "", poolId: isSet(object.poolId) ? Long.fromValue(object.poolId) : Long.UZERO, - tokensIn: Array.isArray(object?.tokensIn) ? object.tokensIn.map((e: any) => Coin.fromJSON(e)) : [], - poolSharesOut: isSet(object.poolSharesOut) ? Coin.fromJSON(object.poolSharesOut) : undefined, - remCoins: Array.isArray(object?.remCoins) ? object.remCoins.map((e: any) => Coin.fromJSON(e)) : [], - }; + tokensIn: Array.isArray(object?.tokensIn) + ? object.tokensIn.map((e: any) => Coin.fromJSON(e)) + : [], + poolSharesOut: isSet(object.poolSharesOut) + ? Coin.fromJSON(object.poolSharesOut) + : undefined, + remCoins: Array.isArray(object?.remCoins) + ? object.remCoins.map((e: any) => Coin.fromJSON(e)) + : [], + } }, toJSON(message: EventPoolJoined): unknown { - const obj: any = {}; - message.address !== undefined && (obj.address = message.address); - message.poolId !== undefined && (obj.poolId = (message.poolId || Long.UZERO).toString()); + const obj: any = {} + message.address !== undefined && (obj.address = message.address) + message.poolId !== undefined && + (obj.poolId = (message.poolId || Long.UZERO).toString()) if (message.tokensIn) { - obj.tokensIn = message.tokensIn.map((e) => e ? Coin.toJSON(e) : undefined); + obj.tokensIn = message.tokensIn.map((e) => (e ? Coin.toJSON(e) : undefined)) } else { - obj.tokensIn = []; + obj.tokensIn = [] } message.poolSharesOut !== undefined && - (obj.poolSharesOut = message.poolSharesOut ? Coin.toJSON(message.poolSharesOut) : undefined); + (obj.poolSharesOut = message.poolSharesOut + ? Coin.toJSON(message.poolSharesOut) + : undefined) if (message.remCoins) { - obj.remCoins = message.remCoins.map((e) => e ? Coin.toJSON(e) : undefined); + obj.remCoins = message.remCoins.map((e) => (e ? Coin.toJSON(e) : undefined)) } else { - obj.remCoins = []; + obj.remCoins = [] } - return obj; + return obj }, - fromPartial, I>>(object: I): EventPoolJoined { - const message = createBaseEventPoolJoined(); - message.address = object.address ?? ""; - message.poolId = (object.poolId !== undefined && object.poolId !== null) - ? Long.fromValue(object.poolId) - : Long.UZERO; - message.tokensIn = object.tokensIn?.map((e) => Coin.fromPartial(e)) || []; - message.poolSharesOut = (object.poolSharesOut !== undefined && object.poolSharesOut !== null) - ? Coin.fromPartial(object.poolSharesOut) - : undefined; - message.remCoins = object.remCoins?.map((e) => Coin.fromPartial(e)) || []; - return message; + fromPartial, I>>( + object: I, + ): EventPoolJoined { + const message = createBaseEventPoolJoined() + message.address = object.address ?? "" + message.poolId = + object.poolId !== undefined && object.poolId !== null + ? Long.fromValue(object.poolId) + : Long.UZERO + message.tokensIn = object.tokensIn?.map((e) => Coin.fromPartial(e)) || [] + message.poolSharesOut = + object.poolSharesOut !== undefined && object.poolSharesOut !== null + ? Coin.fromPartial(object.poolSharesOut) + : undefined + message.remCoins = object.remCoins?.map((e) => Coin.fromPartial(e)) || [] + return message }, -}; +} function createBaseEventPoolCreated(): EventPoolCreated { - return { creator: "", poolId: Long.UZERO }; + return { creator: "", poolId: Long.UZERO, fees: [] } } export const EventPoolCreated = { - encode(message: EventPoolCreated, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: EventPoolCreated, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.creator !== "") { - writer.uint32(10).string(message.creator); + writer.uint32(10).string(message.creator) } if (!message.poolId.isZero()) { - writer.uint32(16).uint64(message.poolId); + writer.uint32(16).uint64(message.poolId) + } + for (const v of message.fees) { + Coin.encode(v!, writer.uint32(26).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): EventPoolCreated { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseEventPoolCreated(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseEventPoolCreated() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.creator = reader.string(); - break; + message.creator = reader.string() + break case 2: - message.poolId = reader.uint64() as Long; - break; + message.poolId = reader.uint64() as Long + break + case 3: + message.fees.push(Coin.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): EventPoolCreated { return { creator: isSet(object.creator) ? String(object.creator) : "", poolId: isSet(object.poolId) ? Long.fromValue(object.poolId) : Long.UZERO, - }; + fees: Array.isArray(object?.fees) + ? object.fees.map((e: any) => Coin.fromJSON(e)) + : [], + } }, toJSON(message: EventPoolCreated): unknown { - const obj: any = {}; - message.creator !== undefined && (obj.creator = message.creator); - message.poolId !== undefined && (obj.poolId = (message.poolId || Long.UZERO).toString()); - return obj; + const obj: any = {} + message.creator !== undefined && (obj.creator = message.creator) + message.poolId !== undefined && + (obj.poolId = (message.poolId || Long.UZERO).toString()) + if (message.fees) { + obj.fees = message.fees.map((e) => (e ? Coin.toJSON(e) : undefined)) + } else { + obj.fees = [] + } + return obj }, - fromPartial, I>>(object: I): EventPoolCreated { - const message = createBaseEventPoolCreated(); - message.creator = object.creator ?? ""; - message.poolId = (object.poolId !== undefined && object.poolId !== null) - ? Long.fromValue(object.poolId) - : Long.UZERO; - return message; + fromPartial, I>>( + object: I, + ): EventPoolCreated { + const message = createBaseEventPoolCreated() + message.creator = object.creator ?? "" + message.poolId = + object.poolId !== undefined && object.poolId !== null + ? Long.fromValue(object.poolId) + : Long.UZERO + message.fees = object.fees?.map((e) => Coin.fromPartial(e)) || [] + return message }, -}; +} function createBaseEventPoolExited(): EventPoolExited { - return { address: "", poolId: Long.UZERO, poolSharesIn: undefined, tokensOut: [] }; + return { + address: "", + poolId: Long.UZERO, + poolSharesIn: undefined, + tokensOut: [], + fees: [], + } } export const EventPoolExited = { - encode(message: EventPoolExited, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: EventPoolExited, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.address !== "") { - writer.uint32(10).string(message.address); + writer.uint32(10).string(message.address) } if (!message.poolId.isZero()) { - writer.uint32(16).uint64(message.poolId); + writer.uint32(16).uint64(message.poolId) } if (message.poolSharesIn !== undefined) { - Coin.encode(message.poolSharesIn, writer.uint32(26).fork()).ldelim(); + Coin.encode(message.poolSharesIn, writer.uint32(26).fork()).ldelim() } for (const v of message.tokensOut) { - Coin.encode(v!, writer.uint32(34).fork()).ldelim(); + Coin.encode(v!, writer.uint32(34).fork()).ldelim() } - return writer; + for (const v of message.fees) { + Coin.encode(v!, writer.uint32(42).fork()).ldelim() + } + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): EventPoolExited { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseEventPoolExited(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseEventPoolExited() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.address = reader.string(); - break; + message.address = reader.string() + break case 2: - message.poolId = reader.uint64() as Long; - break; + message.poolId = reader.uint64() as Long + break case 3: - message.poolSharesIn = Coin.decode(reader, reader.uint32()); - break; + message.poolSharesIn = Coin.decode(reader, reader.uint32()) + break case 4: - message.tokensOut.push(Coin.decode(reader, reader.uint32())); - break; + message.tokensOut.push(Coin.decode(reader, reader.uint32())) + break + case 5: + message.fees.push(Coin.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): EventPoolExited { return { address: isSet(object.address) ? String(object.address) : "", poolId: isSet(object.poolId) ? Long.fromValue(object.poolId) : Long.UZERO, - poolSharesIn: isSet(object.poolSharesIn) ? Coin.fromJSON(object.poolSharesIn) : undefined, - tokensOut: Array.isArray(object?.tokensOut) ? object.tokensOut.map((e: any) => Coin.fromJSON(e)) : [], - }; + poolSharesIn: isSet(object.poolSharesIn) + ? Coin.fromJSON(object.poolSharesIn) + : undefined, + tokensOut: Array.isArray(object?.tokensOut) + ? object.tokensOut.map((e: any) => Coin.fromJSON(e)) + : [], + fees: Array.isArray(object?.fees) + ? object.fees.map((e: any) => Coin.fromJSON(e)) + : [], + } }, toJSON(message: EventPoolExited): unknown { - const obj: any = {}; - message.address !== undefined && (obj.address = message.address); - message.poolId !== undefined && (obj.poolId = (message.poolId || Long.UZERO).toString()); + const obj: any = {} + message.address !== undefined && (obj.address = message.address) + message.poolId !== undefined && + (obj.poolId = (message.poolId || Long.UZERO).toString()) message.poolSharesIn !== undefined && - (obj.poolSharesIn = message.poolSharesIn ? Coin.toJSON(message.poolSharesIn) : undefined); + (obj.poolSharesIn = message.poolSharesIn + ? Coin.toJSON(message.poolSharesIn) + : undefined) if (message.tokensOut) { - obj.tokensOut = message.tokensOut.map((e) => e ? Coin.toJSON(e) : undefined); + obj.tokensOut = message.tokensOut.map((e) => (e ? Coin.toJSON(e) : undefined)) + } else { + obj.tokensOut = [] + } + if (message.fees) { + obj.fees = message.fees.map((e) => (e ? Coin.toJSON(e) : undefined)) } else { - obj.tokensOut = []; + obj.fees = [] } - return obj; + return obj }, - fromPartial, I>>(object: I): EventPoolExited { - const message = createBaseEventPoolExited(); - message.address = object.address ?? ""; - message.poolId = (object.poolId !== undefined && object.poolId !== null) - ? Long.fromValue(object.poolId) - : Long.UZERO; - message.poolSharesIn = (object.poolSharesIn !== undefined && object.poolSharesIn !== null) - ? Coin.fromPartial(object.poolSharesIn) - : undefined; - message.tokensOut = object.tokensOut?.map((e) => Coin.fromPartial(e)) || []; - return message; + fromPartial, I>>( + object: I, + ): EventPoolExited { + const message = createBaseEventPoolExited() + message.address = object.address ?? "" + message.poolId = + object.poolId !== undefined && object.poolId !== null + ? Long.fromValue(object.poolId) + : Long.UZERO + message.poolSharesIn = + object.poolSharesIn !== undefined && object.poolSharesIn !== null + ? Coin.fromPartial(object.poolSharesIn) + : undefined + message.tokensOut = object.tokensOut?.map((e) => Coin.fromPartial(e)) || [] + message.fees = object.fees?.map((e) => Coin.fromPartial(e)) || [] + return message }, -}; +} function createBaseEventAssetsSwapped(): EventAssetsSwapped { - return { address: "", poolId: Long.UZERO, tokenIn: undefined, tokenOut: undefined }; + return { + address: "", + poolId: Long.UZERO, + tokenIn: undefined, + tokenOut: undefined, + fee: undefined, + } } export const EventAssetsSwapped = { - encode(message: EventAssetsSwapped, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: EventAssetsSwapped, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.address !== "") { - writer.uint32(10).string(message.address); + writer.uint32(10).string(message.address) } if (!message.poolId.isZero()) { - writer.uint32(16).uint64(message.poolId); + writer.uint32(16).uint64(message.poolId) } if (message.tokenIn !== undefined) { - Coin.encode(message.tokenIn, writer.uint32(26).fork()).ldelim(); + Coin.encode(message.tokenIn, writer.uint32(26).fork()).ldelim() } if (message.tokenOut !== undefined) { - Coin.encode(message.tokenOut, writer.uint32(34).fork()).ldelim(); + Coin.encode(message.tokenOut, writer.uint32(34).fork()).ldelim() + } + if (message.fee !== undefined) { + Coin.encode(message.fee, writer.uint32(42).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): EventAssetsSwapped { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseEventAssetsSwapped(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseEventAssetsSwapped() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.address = reader.string(); - break; + message.address = reader.string() + break case 2: - message.poolId = reader.uint64() as Long; - break; + message.poolId = reader.uint64() as Long + break case 3: - message.tokenIn = Coin.decode(reader, reader.uint32()); - break; + message.tokenIn = Coin.decode(reader, reader.uint32()) + break case 4: - message.tokenOut = Coin.decode(reader, reader.uint32()); - break; + message.tokenOut = Coin.decode(reader, reader.uint32()) + break + case 5: + message.fee = Coin.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): EventAssetsSwapped { @@ -329,51 +426,76 @@ export const EventAssetsSwapped = { poolId: isSet(object.poolId) ? Long.fromValue(object.poolId) : Long.UZERO, tokenIn: isSet(object.tokenIn) ? Coin.fromJSON(object.tokenIn) : undefined, tokenOut: isSet(object.tokenOut) ? Coin.fromJSON(object.tokenOut) : undefined, - }; + fee: isSet(object.fee) ? Coin.fromJSON(object.fee) : undefined, + } }, toJSON(message: EventAssetsSwapped): unknown { - const obj: any = {}; - message.address !== undefined && (obj.address = message.address); - message.poolId !== undefined && (obj.poolId = (message.poolId || Long.UZERO).toString()); - message.tokenIn !== undefined && (obj.tokenIn = message.tokenIn ? Coin.toJSON(message.tokenIn) : undefined); - message.tokenOut !== undefined && (obj.tokenOut = message.tokenOut ? Coin.toJSON(message.tokenOut) : undefined); - return obj; + const obj: any = {} + message.address !== undefined && (obj.address = message.address) + message.poolId !== undefined && + (obj.poolId = (message.poolId || Long.UZERO).toString()) + message.tokenIn !== undefined && + (obj.tokenIn = message.tokenIn ? Coin.toJSON(message.tokenIn) : undefined) + message.tokenOut !== undefined && + (obj.tokenOut = message.tokenOut ? Coin.toJSON(message.tokenOut) : undefined) + message.fee !== undefined && + (obj.fee = message.fee ? Coin.toJSON(message.fee) : undefined) + return obj }, - fromPartial, I>>(object: I): EventAssetsSwapped { - const message = createBaseEventAssetsSwapped(); - message.address = object.address ?? ""; - message.poolId = (object.poolId !== undefined && object.poolId !== null) - ? Long.fromValue(object.poolId) - : Long.UZERO; - message.tokenIn = (object.tokenIn !== undefined && object.tokenIn !== null) - ? Coin.fromPartial(object.tokenIn) - : undefined; - message.tokenOut = (object.tokenOut !== undefined && object.tokenOut !== null) - ? Coin.fromPartial(object.tokenOut) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): EventAssetsSwapped { + const message = createBaseEventAssetsSwapped() + message.address = object.address ?? "" + message.poolId = + object.poolId !== undefined && object.poolId !== null + ? Long.fromValue(object.poolId) + : Long.UZERO + message.tokenIn = + object.tokenIn !== undefined && object.tokenIn !== null + ? Coin.fromPartial(object.tokenIn) + : undefined + message.tokenOut = + object.tokenOut !== undefined && object.tokenOut !== null + ? Coin.fromPartial(object.tokenOut) + : undefined + message.fee = + object.fee !== undefined && object.fee !== null + ? Coin.fromPartial(object.fee) + : undefined + return message }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; +} -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/spot/v1/genesis.ts b/packages/protojs/src/spot/v1/genesis.ts index 576e2e5e..be9002f7 100644 --- a/packages/protojs/src/spot/v1/genesis.ts +++ b/packages/protojs/src/spot/v1/genesis.ts @@ -1,81 +1,95 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { Params } from "./params"; +import { Params } from "./params" +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "nibiru.spot.v1"; +export const protobufPackage = "nibiru.spot.v1" /** GenesisState defines the spot module's genesis state. */ export interface GenesisState { - params?: Params; + params?: Params } function createBaseGenesisState(): GenesisState { - return { params: undefined }; + return { params: undefined } } export const GenesisState = { encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.params !== undefined) { - Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + Params.encode(message.params, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGenesisState(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseGenesisState() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.params = Params.decode(reader, reader.uint32()); - break; + message.params = Params.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): GenesisState { - return { params: isSet(object.params) ? Params.fromJSON(object.params) : undefined }; + return { + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined, + } }, toJSON(message: GenesisState): unknown { - const obj: any = {}; - message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); - return obj; + const obj: any = {} + message.params !== undefined && + (obj.params = message.params ? Params.toJSON(message.params) : undefined) + return obj }, fromPartial, I>>(object: I): GenesisState { - const message = createBaseGenesisState(); - message.params = (object.params !== undefined && object.params !== null) - ? Params.fromPartial(object.params) - : undefined; - return message; + const message = createBaseGenesisState() + message.params = + object.params !== undefined && object.params !== null + ? Params.fromPartial(object.params) + : undefined + return message }, -}; +} -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/spot/v1/params.ts b/packages/protojs/src/spot/v1/params.ts index 56ab638f..220ea163 100644 --- a/packages/protojs/src/spot/v1/params.ts +++ b/packages/protojs/src/spot/v1/params.ts @@ -1,119 +1,135 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { Coin } from "../../cosmos/base/v1beta1/coin"; +import Long from "long" +import { Coin } from "../../cosmos/base/v1beta1/coin" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "nibiru.spot.v1"; +export const protobufPackage = "nibiru.spot.v1" /** Params defines the parameters for the module. */ export interface Params { /** The start pool number, i.e. the first pool number that isn't taken yet. */ - startingPoolNumber: Long; + startingPoolNumber: Long /** The cost of creating a pool, taken from the pool creator's account. */ - poolCreationFee: Coin[]; + poolCreationFee: Coin[] /** The assets that can be used to create liquidity pools */ - whitelistedAsset: string[]; + whitelistedAsset: string[] } function createBaseParams(): Params { - return { startingPoolNumber: Long.UZERO, poolCreationFee: [], whitelistedAsset: [] }; + return { startingPoolNumber: Long.UZERO, poolCreationFee: [], whitelistedAsset: [] } } export const Params = { encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (!message.startingPoolNumber.isZero()) { - writer.uint32(8).uint64(message.startingPoolNumber); + writer.uint32(8).uint64(message.startingPoolNumber) } for (const v of message.poolCreationFee) { - Coin.encode(v!, writer.uint32(18).fork()).ldelim(); + Coin.encode(v!, writer.uint32(18).fork()).ldelim() } for (const v of message.whitelistedAsset) { - writer.uint32(26).string(v!); + writer.uint32(26).string(v!) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Params { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseParams(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseParams() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.startingPoolNumber = reader.uint64() as Long; - break; + message.startingPoolNumber = reader.uint64() as Long + break case 2: - message.poolCreationFee.push(Coin.decode(reader, reader.uint32())); - break; + message.poolCreationFee.push(Coin.decode(reader, reader.uint32())) + break case 3: - message.whitelistedAsset.push(reader.string()); - break; + message.whitelistedAsset.push(reader.string()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Params { return { - startingPoolNumber: isSet(object.startingPoolNumber) ? Long.fromValue(object.startingPoolNumber) : Long.UZERO, + startingPoolNumber: isSet(object.startingPoolNumber) + ? Long.fromValue(object.startingPoolNumber) + : Long.UZERO, poolCreationFee: Array.isArray(object?.poolCreationFee) ? object.poolCreationFee.map((e: any) => Coin.fromJSON(e)) : [], whitelistedAsset: Array.isArray(object?.whitelistedAsset) ? object.whitelistedAsset.map((e: any) => String(e)) : [], - }; + } }, toJSON(message: Params): unknown { - const obj: any = {}; + const obj: any = {} message.startingPoolNumber !== undefined && - (obj.startingPoolNumber = (message.startingPoolNumber || Long.UZERO).toString()); + (obj.startingPoolNumber = (message.startingPoolNumber || Long.UZERO).toString()) if (message.poolCreationFee) { - obj.poolCreationFee = message.poolCreationFee.map((e) => e ? Coin.toJSON(e) : undefined); + obj.poolCreationFee = message.poolCreationFee.map((e) => + e ? Coin.toJSON(e) : undefined, + ) } else { - obj.poolCreationFee = []; + obj.poolCreationFee = [] } if (message.whitelistedAsset) { - obj.whitelistedAsset = message.whitelistedAsset.map((e) => e); + obj.whitelistedAsset = message.whitelistedAsset.map((e) => e) } else { - obj.whitelistedAsset = []; + obj.whitelistedAsset = [] } - return obj; + return obj }, fromPartial, I>>(object: I): Params { - const message = createBaseParams(); - message.startingPoolNumber = (object.startingPoolNumber !== undefined && object.startingPoolNumber !== null) - ? Long.fromValue(object.startingPoolNumber) - : Long.UZERO; - message.poolCreationFee = object.poolCreationFee?.map((e) => Coin.fromPartial(e)) || []; - message.whitelistedAsset = object.whitelistedAsset?.map((e) => e) || []; - return message; + const message = createBaseParams() + message.startingPoolNumber = + object.startingPoolNumber !== undefined && object.startingPoolNumber !== null + ? Long.fromValue(object.startingPoolNumber) + : Long.UZERO + message.poolCreationFee = + object.poolCreationFee?.map((e) => Coin.fromPartial(e)) || [] + message.whitelistedAsset = object.whitelistedAsset?.map((e) => e) || [] + return message }, -}; +} -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/spot/v1/pool.ts b/packages/protojs/src/spot/v1/pool.ts index ee753d9f..8a48efc3 100644 --- a/packages/protojs/src/spot/v1/pool.ts +++ b/packages/protojs/src/spot/v1/pool.ts @@ -1,9 +1,9 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { Coin } from "../../cosmos/base/v1beta1/coin"; +import { Coin } from "../../cosmos/base/v1beta1/coin" +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "nibiru.spot.v1"; +export const protobufPackage = "nibiru.spot.v1" /** * - `balancer`: Balancer are pools defined by the equation xy=k, extended by the weighs introduced by Balancer. @@ -19,41 +19,41 @@ export function poolTypeFromJSON(object: any): PoolType { switch (object) { case 0: case "BALANCER": - return PoolType.BALANCER; + return PoolType.BALANCER case 1: case "STABLESWAP": - return PoolType.STABLESWAP; + return PoolType.STABLESWAP case -1: case "UNRECOGNIZED": default: - return PoolType.UNRECOGNIZED; + return PoolType.UNRECOGNIZED } } export function poolTypeToJSON(object: PoolType): string { switch (object) { case PoolType.BALANCER: - return "BALANCER"; + return "BALANCER" case PoolType.STABLESWAP: - return "STABLESWAP"; + return "STABLESWAP" case PoolType.UNRECOGNIZED: default: - return "UNRECOGNIZED"; + return "UNRECOGNIZED" } } /** Configuration parameters for the pool. */ export interface PoolParams { - swapFee: string; - exitFee: string; + swapFee: string + exitFee: string /** * Amplification Parameter (A): Larger value of A make the curve better resemble a straight * line in the center (when pool is near balance). Highly volatile assets should use a lower value, while assets that * are closer together may be best with a higher value. * This is only used if the pool_type is set to 1 (stableswap) */ - A: string; - poolType: PoolType; + A: string + poolType: PoolType } /** Which assets the pool contains. */ @@ -62,75 +62,75 @@ export interface PoolAsset { * Coins we are talking about, * the denomination must be unique amongst all PoolAssets for this pool. */ - token?: Coin; + token?: Coin /** Weight that is not normalized. This weight must be less than 2^50 */ - weight: string; + weight: string } export interface Pool { /** The pool id. */ - id: Long; + id: Long /** The pool account address. */ - address: string; + address: string /** Fees and other pool-specific parameters. */ - poolParams?: PoolParams; + poolParams?: PoolParams /** * These are assumed to be sorted by denomiation. * They contain the pool asset and the information about the weight */ - poolAssets: PoolAsset[]; + poolAssets: PoolAsset[] /** sum of all non-normalized pool weights */ - totalWeight: string; + totalWeight: string /** sum of all LP tokens sent out */ - totalShares?: Coin; + totalShares?: Coin } function createBasePoolParams(): PoolParams { - return { swapFee: "", exitFee: "", A: "", poolType: 0 }; + return { swapFee: "", exitFee: "", A: "", poolType: 0 } } export const PoolParams = { encode(message: PoolParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.swapFee !== "") { - writer.uint32(10).string(message.swapFee); + writer.uint32(10).string(message.swapFee) } if (message.exitFee !== "") { - writer.uint32(18).string(message.exitFee); + writer.uint32(18).string(message.exitFee) } if (message.A !== "") { - writer.uint32(26).string(message.A); + writer.uint32(26).string(message.A) } if (message.poolType !== 0) { - writer.uint32(32).int32(message.poolType); + writer.uint32(32).int32(message.poolType) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): PoolParams { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBasePoolParams(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBasePoolParams() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.swapFee = reader.string(); - break; + message.swapFee = reader.string() + break case 2: - message.exitFee = reader.string(); - break; + message.exitFee = reader.string() + break case 3: - message.A = reader.string(); - break; + message.A = reader.string() + break case 4: - message.poolType = reader.int32() as any; - break; + message.poolType = reader.int32() as any + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): PoolParams { @@ -139,85 +139,89 @@ export const PoolParams = { exitFee: isSet(object.exitFee) ? String(object.exitFee) : "", A: isSet(object.A) ? String(object.A) : "", poolType: isSet(object.poolType) ? poolTypeFromJSON(object.poolType) : 0, - }; + } }, toJSON(message: PoolParams): unknown { - const obj: any = {}; - message.swapFee !== undefined && (obj.swapFee = message.swapFee); - message.exitFee !== undefined && (obj.exitFee = message.exitFee); - message.A !== undefined && (obj.A = message.A); - message.poolType !== undefined && (obj.poolType = poolTypeToJSON(message.poolType)); - return obj; + const obj: any = {} + message.swapFee !== undefined && (obj.swapFee = message.swapFee) + message.exitFee !== undefined && (obj.exitFee = message.exitFee) + message.A !== undefined && (obj.A = message.A) + message.poolType !== undefined && (obj.poolType = poolTypeToJSON(message.poolType)) + return obj }, fromPartial, I>>(object: I): PoolParams { - const message = createBasePoolParams(); - message.swapFee = object.swapFee ?? ""; - message.exitFee = object.exitFee ?? ""; - message.A = object.A ?? ""; - message.poolType = object.poolType ?? 0; - return message; + const message = createBasePoolParams() + message.swapFee = object.swapFee ?? "" + message.exitFee = object.exitFee ?? "" + message.A = object.A ?? "" + message.poolType = object.poolType ?? 0 + return message }, -}; +} function createBasePoolAsset(): PoolAsset { - return { token: undefined, weight: "" }; + return { token: undefined, weight: "" } } export const PoolAsset = { encode(message: PoolAsset, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.token !== undefined) { - Coin.encode(message.token, writer.uint32(10).fork()).ldelim(); + Coin.encode(message.token, writer.uint32(10).fork()).ldelim() } if (message.weight !== "") { - writer.uint32(18).string(message.weight); + writer.uint32(18).string(message.weight) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): PoolAsset { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBasePoolAsset(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBasePoolAsset() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.token = Coin.decode(reader, reader.uint32()); - break; + message.token = Coin.decode(reader, reader.uint32()) + break case 2: - message.weight = reader.string(); - break; + message.weight = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): PoolAsset { return { token: isSet(object.token) ? Coin.fromJSON(object.token) : undefined, weight: isSet(object.weight) ? String(object.weight) : "", - }; + } }, toJSON(message: PoolAsset): unknown { - const obj: any = {}; - message.token !== undefined && (obj.token = message.token ? Coin.toJSON(message.token) : undefined); - message.weight !== undefined && (obj.weight = message.weight); - return obj; + const obj: any = {} + message.token !== undefined && + (obj.token = message.token ? Coin.toJSON(message.token) : undefined) + message.weight !== undefined && (obj.weight = message.weight) + return obj }, fromPartial, I>>(object: I): PoolAsset { - const message = createBasePoolAsset(); - message.token = (object.token !== undefined && object.token !== null) ? Coin.fromPartial(object.token) : undefined; - message.weight = object.weight ?? ""; - return message; + const message = createBasePoolAsset() + message.token = + object.token !== undefined && object.token !== null + ? Coin.fromPartial(object.token) + : undefined + message.weight = object.weight ?? "" + return message }, -}; +} function createBasePool(): Pool { return { @@ -227,126 +231,153 @@ function createBasePool(): Pool { poolAssets: [], totalWeight: "", totalShares: undefined, - }; + } } export const Pool = { encode(message: Pool, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (!message.id.isZero()) { - writer.uint32(8).uint64(message.id); + writer.uint32(8).uint64(message.id) } if (message.address !== "") { - writer.uint32(18).string(message.address); + writer.uint32(18).string(message.address) } if (message.poolParams !== undefined) { - PoolParams.encode(message.poolParams, writer.uint32(26).fork()).ldelim(); + PoolParams.encode(message.poolParams, writer.uint32(26).fork()).ldelim() } for (const v of message.poolAssets) { - PoolAsset.encode(v!, writer.uint32(34).fork()).ldelim(); + PoolAsset.encode(v!, writer.uint32(34).fork()).ldelim() } if (message.totalWeight !== "") { - writer.uint32(42).string(message.totalWeight); + writer.uint32(42).string(message.totalWeight) } if (message.totalShares !== undefined) { - Coin.encode(message.totalShares, writer.uint32(50).fork()).ldelim(); + Coin.encode(message.totalShares, writer.uint32(50).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Pool { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBasePool(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBasePool() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.id = reader.uint64() as Long; - break; + message.id = reader.uint64() as Long + break case 2: - message.address = reader.string(); - break; + message.address = reader.string() + break case 3: - message.poolParams = PoolParams.decode(reader, reader.uint32()); - break; + message.poolParams = PoolParams.decode(reader, reader.uint32()) + break case 4: - message.poolAssets.push(PoolAsset.decode(reader, reader.uint32())); - break; + message.poolAssets.push(PoolAsset.decode(reader, reader.uint32())) + break case 5: - message.totalWeight = reader.string(); - break; + message.totalWeight = reader.string() + break case 6: - message.totalShares = Coin.decode(reader, reader.uint32()); - break; + message.totalShares = Coin.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Pool { return { id: isSet(object.id) ? Long.fromValue(object.id) : Long.UZERO, address: isSet(object.address) ? String(object.address) : "", - poolParams: isSet(object.poolParams) ? PoolParams.fromJSON(object.poolParams) : undefined, - poolAssets: Array.isArray(object?.poolAssets) ? object.poolAssets.map((e: any) => PoolAsset.fromJSON(e)) : [], + poolParams: isSet(object.poolParams) + ? PoolParams.fromJSON(object.poolParams) + : undefined, + poolAssets: Array.isArray(object?.poolAssets) + ? object.poolAssets.map((e: any) => PoolAsset.fromJSON(e)) + : [], totalWeight: isSet(object.totalWeight) ? String(object.totalWeight) : "", - totalShares: isSet(object.totalShares) ? Coin.fromJSON(object.totalShares) : undefined, - }; + totalShares: isSet(object.totalShares) + ? Coin.fromJSON(object.totalShares) + : undefined, + } }, toJSON(message: Pool): unknown { - const obj: any = {}; - message.id !== undefined && (obj.id = (message.id || Long.UZERO).toString()); - message.address !== undefined && (obj.address = message.address); + const obj: any = {} + message.id !== undefined && (obj.id = (message.id || Long.UZERO).toString()) + message.address !== undefined && (obj.address = message.address) message.poolParams !== undefined && - (obj.poolParams = message.poolParams ? PoolParams.toJSON(message.poolParams) : undefined); + (obj.poolParams = message.poolParams + ? PoolParams.toJSON(message.poolParams) + : undefined) if (message.poolAssets) { - obj.poolAssets = message.poolAssets.map((e) => e ? PoolAsset.toJSON(e) : undefined); + obj.poolAssets = message.poolAssets.map((e) => + e ? PoolAsset.toJSON(e) : undefined, + ) } else { - obj.poolAssets = []; + obj.poolAssets = [] } - message.totalWeight !== undefined && (obj.totalWeight = message.totalWeight); + message.totalWeight !== undefined && (obj.totalWeight = message.totalWeight) message.totalShares !== undefined && - (obj.totalShares = message.totalShares ? Coin.toJSON(message.totalShares) : undefined); - return obj; + (obj.totalShares = message.totalShares + ? Coin.toJSON(message.totalShares) + : undefined) + return obj }, fromPartial, I>>(object: I): Pool { - const message = createBasePool(); - message.id = (object.id !== undefined && object.id !== null) ? Long.fromValue(object.id) : Long.UZERO; - message.address = object.address ?? ""; - message.poolParams = (object.poolParams !== undefined && object.poolParams !== null) - ? PoolParams.fromPartial(object.poolParams) - : undefined; - message.poolAssets = object.poolAssets?.map((e) => PoolAsset.fromPartial(e)) || []; - message.totalWeight = object.totalWeight ?? ""; - message.totalShares = (object.totalShares !== undefined && object.totalShares !== null) - ? Coin.fromPartial(object.totalShares) - : undefined; - return message; + const message = createBasePool() + message.id = + object.id !== undefined && object.id !== null + ? Long.fromValue(object.id) + : Long.UZERO + message.address = object.address ?? "" + message.poolParams = + object.poolParams !== undefined && object.poolParams !== null + ? PoolParams.fromPartial(object.poolParams) + : undefined + message.poolAssets = object.poolAssets?.map((e) => PoolAsset.fromPartial(e)) || [] + message.totalWeight = object.totalWeight ?? "" + message.totalShares = + object.totalShares !== undefined && object.totalShares !== null + ? Coin.fromPartial(object.totalShares) + : undefined + return message }, -}; +} -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/spot/v1/query.ts b/packages/protojs/src/spot/v1/query.ts index dbee0dbe..f737fabd 100644 --- a/packages/protojs/src/spot/v1/query.ts +++ b/packages/protojs/src/spot/v1/query.ts @@ -1,73 +1,69 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { PageRequest, PageResponse } from "../../cosmos/base/query/v1beta1/pagination"; -import { Coin } from "../../cosmos/base/v1beta1/coin"; -import { Params } from "./params"; -import { Pool, PoolParams } from "./pool"; +import { Params } from "./params" +import { Pool, PoolParams } from "./pool" +import { PageRequest, PageResponse } from "../../cosmos/base/query/v1beta1/pagination" +import { Coin } from "../../cosmos/base/v1beta1/coin" +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "nibiru.spot.v1"; +export const protobufPackage = "nibiru.spot.v1" /** QueryParamsRequest is request type for the Query/Params RPC method. */ -export interface QueryParamsRequest { -} +export interface QueryParamsRequest {} /** QueryParamsResponse is response type for the Query/Params RPC method. */ export interface QueryParamsResponse { /** params holds all the parameters of this module. */ - params?: Params; + params?: Params } -export interface QueryPoolNumberRequest { -} +export interface QueryPoolNumberRequest {} export interface QueryPoolNumberResponse { - poolId: Long; + poolId: Long } export interface QueryPoolRequest { - poolId: Long; + poolId: Long } export interface QueryPoolResponse { - pool?: Pool; + pool?: Pool } export interface QueryPoolsRequest { /** pagination defines an optional pagination for the request. */ - pagination?: PageRequest; + pagination?: PageRequest } export interface QueryPoolsResponse { - pools: Pool[]; + pools: Pool[] /** pagination defines the pagination in the response. */ - pagination?: PageResponse; + pagination?: PageResponse } export interface QueryPoolParamsRequest { - poolId: Long; + poolId: Long } export interface QueryPoolParamsResponse { - poolParams?: PoolParams; + poolParams?: PoolParams } -export interface QueryNumPoolsRequest { -} +export interface QueryNumPoolsRequest {} export interface QueryNumPoolsResponse { - numPools: Long; + numPools: Long } /** * -------------------------------------------- * Query total liquidity the protocol */ -export interface QueryTotalLiquidityRequest { -} +export interface QueryTotalLiquidityRequest {} export interface QueryTotalLiquidityResponse { - liquidity: Coin[]; + liquidity: Coin[] } /** @@ -75,20 +71,20 @@ export interface QueryTotalLiquidityResponse { * Query total liquidity for a pool */ export interface QueryTotalPoolLiquidityRequest { - poolId: Long; + poolId: Long } export interface QueryTotalPoolLiquidityResponse { - liquidity: Coin[]; + liquidity: Coin[] } export interface QueryTotalSharesRequest { - poolId: Long; + poolId: Long } export interface QueryTotalSharesResponse { /** sum of all LP tokens sent out */ - totalShares?: Coin; + totalShares?: Coin } /** @@ -97,15 +93,15 @@ export interface QueryTotalSharesResponse { * and tokenOutDenom=NIBI would give "9.123". */ export interface QuerySpotPriceRequest { - poolId: Long; + poolId: Long /** the denomination of the token you are giving into the pool */ - tokenInDenom: string; + tokenInDenom: string /** the denomination of the token you are taking out of the pool */ - tokenOutDenom: string; + tokenOutDenom: string } export interface QuerySpotPriceResponse { - spotPrice: string; + spotPrice: string } /** @@ -113,13 +109,14 @@ export interface QuerySpotPriceResponse { * the expected amount of tokens out received from a swap. */ export interface QuerySwapExactAmountInRequest { - poolId: Long; - tokenIn?: Coin; - tokenOutDenom: string; + poolId: Long + tokenIn?: Coin + tokenOutDenom: string } export interface QuerySwapExactAmountInResponse { - tokenOut?: Coin; + tokenOut?: Coin + fee?: Coin } /** @@ -127,959 +124,1120 @@ export interface QuerySwapExactAmountInResponse { * the expected amount of tokens in required to do the swap. */ export interface QuerySwapExactAmountOutRequest { - poolId: Long; - tokenOut?: Coin; - tokenInDenom: string; + poolId: Long + tokenOut?: Coin + tokenInDenom: string } export interface QuerySwapExactAmountOutResponse { - tokenIn?: Coin; + tokenIn?: Coin } export interface QueryJoinExactAmountInRequest { - poolId: Long; - tokensIn: Coin[]; + poolId: Long + tokensIn: Coin[] } export interface QueryJoinExactAmountInResponse { /** amount of pool shares returned to user after join */ - poolSharesOut: string; + poolSharesOut: string /** coins remaining after pool join */ - remCoins: Coin[]; + remCoins: Coin[] } export interface QueryJoinExactAmountOutRequest { - poolId: Long; + poolId: Long } -export interface QueryJoinExactAmountOutResponse { -} +export interface QueryJoinExactAmountOutResponse {} export interface QueryExitExactAmountInRequest { - poolId: Long; + poolId: Long /** amount of pool shares to return to pool */ - poolSharesIn: string; + poolSharesIn: string } export interface QueryExitExactAmountInResponse { /** coins obtained after exiting */ - tokensOut: Coin[]; + tokensOut: Coin[] + fees: Coin[] } export interface QueryExitExactAmountOutRequest { - poolId: Long; + poolId: Long } -export interface QueryExitExactAmountOutResponse { -} +export interface QueryExitExactAmountOutResponse {} function createBaseQueryParamsRequest(): QueryParamsRequest { - return {}; + return {} } export const QueryParamsRequest = { encode(_: QueryParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryParamsRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryParamsRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(_: any): QueryParamsRequest { - return {}; + return {} }, toJSON(_: QueryParamsRequest): unknown { - const obj: any = {}; - return obj; + const obj: any = {} + return obj }, - fromPartial, I>>(_: I): QueryParamsRequest { - const message = createBaseQueryParamsRequest(); - return message; + fromPartial, I>>( + _: I, + ): QueryParamsRequest { + const message = createBaseQueryParamsRequest() + return message }, -}; +} function createBaseQueryParamsResponse(): QueryParamsResponse { - return { params: undefined }; + return { params: undefined } } export const QueryParamsResponse = { - encode(message: QueryParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryParamsResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.params !== undefined) { - Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + Params.encode(message.params, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryParamsResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryParamsResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.params = Params.decode(reader, reader.uint32()); - break; + message.params = Params.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryParamsResponse { - return { params: isSet(object.params) ? Params.fromJSON(object.params) : undefined }; + return { + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined, + } }, toJSON(message: QueryParamsResponse): unknown { - const obj: any = {}; - message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); - return obj; + const obj: any = {} + message.params !== undefined && + (obj.params = message.params ? Params.toJSON(message.params) : undefined) + return obj }, - fromPartial, I>>(object: I): QueryParamsResponse { - const message = createBaseQueryParamsResponse(); - message.params = (object.params !== undefined && object.params !== null) - ? Params.fromPartial(object.params) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): QueryParamsResponse { + const message = createBaseQueryParamsResponse() + message.params = + object.params !== undefined && object.params !== null + ? Params.fromPartial(object.params) + : undefined + return message }, -}; +} function createBaseQueryPoolNumberRequest(): QueryPoolNumberRequest { - return {}; + return {} } export const QueryPoolNumberRequest = { - encode(_: QueryPoolNumberRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; + encode( + _: QueryPoolNumberRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryPoolNumberRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryPoolNumberRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryPoolNumberRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(_: any): QueryPoolNumberRequest { - return {}; + return {} }, toJSON(_: QueryPoolNumberRequest): unknown { - const obj: any = {}; - return obj; + const obj: any = {} + return obj }, - fromPartial, I>>(_: I): QueryPoolNumberRequest { - const message = createBaseQueryPoolNumberRequest(); - return message; + fromPartial, I>>( + _: I, + ): QueryPoolNumberRequest { + const message = createBaseQueryPoolNumberRequest() + return message }, -}; +} function createBaseQueryPoolNumberResponse(): QueryPoolNumberResponse { - return { poolId: Long.UZERO }; + return { poolId: Long.UZERO } } export const QueryPoolNumberResponse = { - encode(message: QueryPoolNumberResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryPoolNumberResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (!message.poolId.isZero()) { - writer.uint32(8).uint64(message.poolId); + writer.uint32(8).uint64(message.poolId) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryPoolNumberResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryPoolNumberResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryPoolNumberResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.poolId = reader.uint64() as Long; - break; + message.poolId = reader.uint64() as Long + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryPoolNumberResponse { - return { poolId: isSet(object.poolId) ? Long.fromValue(object.poolId) : Long.UZERO }; + return { + poolId: isSet(object.poolId) ? Long.fromValue(object.poolId) : Long.UZERO, + } }, toJSON(message: QueryPoolNumberResponse): unknown { - const obj: any = {}; - message.poolId !== undefined && (obj.poolId = (message.poolId || Long.UZERO).toString()); - return obj; + const obj: any = {} + message.poolId !== undefined && + (obj.poolId = (message.poolId || Long.UZERO).toString()) + return obj }, - fromPartial, I>>(object: I): QueryPoolNumberResponse { - const message = createBaseQueryPoolNumberResponse(); - message.poolId = (object.poolId !== undefined && object.poolId !== null) - ? Long.fromValue(object.poolId) - : Long.UZERO; - return message; + fromPartial, I>>( + object: I, + ): QueryPoolNumberResponse { + const message = createBaseQueryPoolNumberResponse() + message.poolId = + object.poolId !== undefined && object.poolId !== null + ? Long.fromValue(object.poolId) + : Long.UZERO + return message }, -}; +} function createBaseQueryPoolRequest(): QueryPoolRequest { - return { poolId: Long.UZERO }; + return { poolId: Long.UZERO } } export const QueryPoolRequest = { - encode(message: QueryPoolRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryPoolRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (!message.poolId.isZero()) { - writer.uint32(8).uint64(message.poolId); + writer.uint32(8).uint64(message.poolId) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryPoolRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryPoolRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryPoolRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.poolId = reader.uint64() as Long; - break; + message.poolId = reader.uint64() as Long + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryPoolRequest { - return { poolId: isSet(object.poolId) ? Long.fromValue(object.poolId) : Long.UZERO }; + return { + poolId: isSet(object.poolId) ? Long.fromValue(object.poolId) : Long.UZERO, + } }, toJSON(message: QueryPoolRequest): unknown { - const obj: any = {}; - message.poolId !== undefined && (obj.poolId = (message.poolId || Long.UZERO).toString()); - return obj; + const obj: any = {} + message.poolId !== undefined && + (obj.poolId = (message.poolId || Long.UZERO).toString()) + return obj }, - fromPartial, I>>(object: I): QueryPoolRequest { - const message = createBaseQueryPoolRequest(); - message.poolId = (object.poolId !== undefined && object.poolId !== null) - ? Long.fromValue(object.poolId) - : Long.UZERO; - return message; + fromPartial, I>>( + object: I, + ): QueryPoolRequest { + const message = createBaseQueryPoolRequest() + message.poolId = + object.poolId !== undefined && object.poolId !== null + ? Long.fromValue(object.poolId) + : Long.UZERO + return message }, -}; +} function createBaseQueryPoolResponse(): QueryPoolResponse { - return { pool: undefined }; + return { pool: undefined } } export const QueryPoolResponse = { - encode(message: QueryPoolResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryPoolResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.pool !== undefined) { - Pool.encode(message.pool, writer.uint32(10).fork()).ldelim(); + Pool.encode(message.pool, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryPoolResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryPoolResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryPoolResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.pool = Pool.decode(reader, reader.uint32()); - break; + message.pool = Pool.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryPoolResponse { - return { pool: isSet(object.pool) ? Pool.fromJSON(object.pool) : undefined }; + return { + pool: isSet(object.pool) ? Pool.fromJSON(object.pool) : undefined, + } }, toJSON(message: QueryPoolResponse): unknown { - const obj: any = {}; - message.pool !== undefined && (obj.pool = message.pool ? Pool.toJSON(message.pool) : undefined); - return obj; + const obj: any = {} + message.pool !== undefined && + (obj.pool = message.pool ? Pool.toJSON(message.pool) : undefined) + return obj }, - fromPartial, I>>(object: I): QueryPoolResponse { - const message = createBaseQueryPoolResponse(); - message.pool = (object.pool !== undefined && object.pool !== null) ? Pool.fromPartial(object.pool) : undefined; - return message; + fromPartial, I>>( + object: I, + ): QueryPoolResponse { + const message = createBaseQueryPoolResponse() + message.pool = + object.pool !== undefined && object.pool !== null + ? Pool.fromPartial(object.pool) + : undefined + return message }, -}; +} function createBaseQueryPoolsRequest(): QueryPoolsRequest { - return { pagination: undefined }; + return { pagination: undefined } } export const QueryPoolsRequest = { - encode(message: QueryPoolsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryPoolsRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryPoolsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryPoolsRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryPoolsRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; + message.pagination = PageRequest.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryPoolsRequest { - return { pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined }; + return { + pagination: isSet(object.pagination) + ? PageRequest.fromJSON(object.pagination) + : undefined, + } }, toJSON(message: QueryPoolsRequest): unknown { - const obj: any = {}; + const obj: any = {} message.pagination !== undefined && - (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); - return obj; + (obj.pagination = message.pagination + ? PageRequest.toJSON(message.pagination) + : undefined) + return obj }, - fromPartial, I>>(object: I): QueryPoolsRequest { - const message = createBaseQueryPoolsRequest(); - message.pagination = (object.pagination !== undefined && object.pagination !== null) - ? PageRequest.fromPartial(object.pagination) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): QueryPoolsRequest { + const message = createBaseQueryPoolsRequest() + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageRequest.fromPartial(object.pagination) + : undefined + return message }, -}; +} function createBaseQueryPoolsResponse(): QueryPoolsResponse { - return { pools: [], pagination: undefined }; + return { pools: [], pagination: undefined } } export const QueryPoolsResponse = { - encode(message: QueryPoolsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryPoolsResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { for (const v of message.pools) { - Pool.encode(v!, writer.uint32(10).fork()).ldelim(); + Pool.encode(v!, writer.uint32(10).fork()).ldelim() } if (message.pagination !== undefined) { - PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryPoolsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryPoolsResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryPoolsResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.pools.push(Pool.decode(reader, reader.uint32())); - break; + message.pools.push(Pool.decode(reader, reader.uint32())) + break case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; + message.pagination = PageResponse.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryPoolsResponse { return { - pools: Array.isArray(object?.pools) ? object.pools.map((e: any) => Pool.fromJSON(e)) : [], - pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, - }; + pools: Array.isArray(object?.pools) + ? object.pools.map((e: any) => Pool.fromJSON(e)) + : [], + pagination: isSet(object.pagination) + ? PageResponse.fromJSON(object.pagination) + : undefined, + } }, toJSON(message: QueryPoolsResponse): unknown { - const obj: any = {}; + const obj: any = {} if (message.pools) { - obj.pools = message.pools.map((e) => e ? Pool.toJSON(e) : undefined); + obj.pools = message.pools.map((e) => (e ? Pool.toJSON(e) : undefined)) } else { - obj.pools = []; + obj.pools = [] } message.pagination !== undefined && - (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); - return obj; + (obj.pagination = message.pagination + ? PageResponse.toJSON(message.pagination) + : undefined) + return obj }, - fromPartial, I>>(object: I): QueryPoolsResponse { - const message = createBaseQueryPoolsResponse(); - message.pools = object.pools?.map((e) => Pool.fromPartial(e)) || []; - message.pagination = (object.pagination !== undefined && object.pagination !== null) - ? PageResponse.fromPartial(object.pagination) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): QueryPoolsResponse { + const message = createBaseQueryPoolsResponse() + message.pools = object.pools?.map((e) => Pool.fromPartial(e)) || [] + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageResponse.fromPartial(object.pagination) + : undefined + return message }, -}; +} function createBaseQueryPoolParamsRequest(): QueryPoolParamsRequest { - return { poolId: Long.UZERO }; + return { poolId: Long.UZERO } } export const QueryPoolParamsRequest = { - encode(message: QueryPoolParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryPoolParamsRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (!message.poolId.isZero()) { - writer.uint32(8).uint64(message.poolId); + writer.uint32(8).uint64(message.poolId) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryPoolParamsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryPoolParamsRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryPoolParamsRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.poolId = reader.uint64() as Long; - break; + message.poolId = reader.uint64() as Long + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryPoolParamsRequest { - return { poolId: isSet(object.poolId) ? Long.fromValue(object.poolId) : Long.UZERO }; + return { + poolId: isSet(object.poolId) ? Long.fromValue(object.poolId) : Long.UZERO, + } }, toJSON(message: QueryPoolParamsRequest): unknown { - const obj: any = {}; - message.poolId !== undefined && (obj.poolId = (message.poolId || Long.UZERO).toString()); - return obj; + const obj: any = {} + message.poolId !== undefined && + (obj.poolId = (message.poolId || Long.UZERO).toString()) + return obj }, - fromPartial, I>>(object: I): QueryPoolParamsRequest { - const message = createBaseQueryPoolParamsRequest(); - message.poolId = (object.poolId !== undefined && object.poolId !== null) - ? Long.fromValue(object.poolId) - : Long.UZERO; - return message; + fromPartial, I>>( + object: I, + ): QueryPoolParamsRequest { + const message = createBaseQueryPoolParamsRequest() + message.poolId = + object.poolId !== undefined && object.poolId !== null + ? Long.fromValue(object.poolId) + : Long.UZERO + return message }, -}; +} function createBaseQueryPoolParamsResponse(): QueryPoolParamsResponse { - return { poolParams: undefined }; + return { poolParams: undefined } } export const QueryPoolParamsResponse = { - encode(message: QueryPoolParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryPoolParamsResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.poolParams !== undefined) { - PoolParams.encode(message.poolParams, writer.uint32(10).fork()).ldelim(); + PoolParams.encode(message.poolParams, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryPoolParamsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryPoolParamsResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryPoolParamsResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.poolParams = PoolParams.decode(reader, reader.uint32()); - break; + message.poolParams = PoolParams.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryPoolParamsResponse { - return { poolParams: isSet(object.poolParams) ? PoolParams.fromJSON(object.poolParams) : undefined }; + return { + poolParams: isSet(object.poolParams) + ? PoolParams.fromJSON(object.poolParams) + : undefined, + } }, toJSON(message: QueryPoolParamsResponse): unknown { - const obj: any = {}; + const obj: any = {} message.poolParams !== undefined && - (obj.poolParams = message.poolParams ? PoolParams.toJSON(message.poolParams) : undefined); - return obj; + (obj.poolParams = message.poolParams + ? PoolParams.toJSON(message.poolParams) + : undefined) + return obj }, - fromPartial, I>>(object: I): QueryPoolParamsResponse { - const message = createBaseQueryPoolParamsResponse(); - message.poolParams = (object.poolParams !== undefined && object.poolParams !== null) - ? PoolParams.fromPartial(object.poolParams) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): QueryPoolParamsResponse { + const message = createBaseQueryPoolParamsResponse() + message.poolParams = + object.poolParams !== undefined && object.poolParams !== null + ? PoolParams.fromPartial(object.poolParams) + : undefined + return message }, -}; +} function createBaseQueryNumPoolsRequest(): QueryNumPoolsRequest { - return {}; + return {} } export const QueryNumPoolsRequest = { - encode(_: QueryNumPoolsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; + encode( + _: QueryNumPoolsRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryNumPoolsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryNumPoolsRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryNumPoolsRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(_: any): QueryNumPoolsRequest { - return {}; + return {} }, toJSON(_: QueryNumPoolsRequest): unknown { - const obj: any = {}; - return obj; + const obj: any = {} + return obj }, - fromPartial, I>>(_: I): QueryNumPoolsRequest { - const message = createBaseQueryNumPoolsRequest(); - return message; + fromPartial, I>>( + _: I, + ): QueryNumPoolsRequest { + const message = createBaseQueryNumPoolsRequest() + return message }, -}; +} function createBaseQueryNumPoolsResponse(): QueryNumPoolsResponse { - return { numPools: Long.UZERO }; + return { numPools: Long.UZERO } } export const QueryNumPoolsResponse = { - encode(message: QueryNumPoolsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryNumPoolsResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (!message.numPools.isZero()) { - writer.uint32(8).uint64(message.numPools); + writer.uint32(8).uint64(message.numPools) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryNumPoolsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryNumPoolsResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryNumPoolsResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.numPools = reader.uint64() as Long; - break; + message.numPools = reader.uint64() as Long + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryNumPoolsResponse { - return { numPools: isSet(object.numPools) ? Long.fromValue(object.numPools) : Long.UZERO }; + return { + numPools: isSet(object.numPools) ? Long.fromValue(object.numPools) : Long.UZERO, + } }, toJSON(message: QueryNumPoolsResponse): unknown { - const obj: any = {}; - message.numPools !== undefined && (obj.numPools = (message.numPools || Long.UZERO).toString()); - return obj; + const obj: any = {} + message.numPools !== undefined && + (obj.numPools = (message.numPools || Long.UZERO).toString()) + return obj }, - fromPartial, I>>(object: I): QueryNumPoolsResponse { - const message = createBaseQueryNumPoolsResponse(); - message.numPools = (object.numPools !== undefined && object.numPools !== null) - ? Long.fromValue(object.numPools) - : Long.UZERO; - return message; + fromPartial, I>>( + object: I, + ): QueryNumPoolsResponse { + const message = createBaseQueryNumPoolsResponse() + message.numPools = + object.numPools !== undefined && object.numPools !== null + ? Long.fromValue(object.numPools) + : Long.UZERO + return message }, -}; +} function createBaseQueryTotalLiquidityRequest(): QueryTotalLiquidityRequest { - return {}; + return {} } export const QueryTotalLiquidityRequest = { - encode(_: QueryTotalLiquidityRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; + encode( + _: QueryTotalLiquidityRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryTotalLiquidityRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryTotalLiquidityRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryTotalLiquidityRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(_: any): QueryTotalLiquidityRequest { - return {}; + return {} }, toJSON(_: QueryTotalLiquidityRequest): unknown { - const obj: any = {}; - return obj; + const obj: any = {} + return obj }, - fromPartial, I>>(_: I): QueryTotalLiquidityRequest { - const message = createBaseQueryTotalLiquidityRequest(); - return message; + fromPartial, I>>( + _: I, + ): QueryTotalLiquidityRequest { + const message = createBaseQueryTotalLiquidityRequest() + return message }, -}; +} function createBaseQueryTotalLiquidityResponse(): QueryTotalLiquidityResponse { - return { liquidity: [] }; + return { liquidity: [] } } export const QueryTotalLiquidityResponse = { - encode(message: QueryTotalLiquidityResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryTotalLiquidityResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { for (const v of message.liquidity) { - Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + Coin.encode(v!, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryTotalLiquidityResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryTotalLiquidityResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryTotalLiquidityResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.liquidity.push(Coin.decode(reader, reader.uint32())); - break; + message.liquidity.push(Coin.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryTotalLiquidityResponse { - return { liquidity: Array.isArray(object?.liquidity) ? object.liquidity.map((e: any) => Coin.fromJSON(e)) : [] }; + return { + liquidity: Array.isArray(object?.liquidity) + ? object.liquidity.map((e: any) => Coin.fromJSON(e)) + : [], + } }, toJSON(message: QueryTotalLiquidityResponse): unknown { - const obj: any = {}; + const obj: any = {} if (message.liquidity) { - obj.liquidity = message.liquidity.map((e) => e ? Coin.toJSON(e) : undefined); + obj.liquidity = message.liquidity.map((e) => (e ? Coin.toJSON(e) : undefined)) } else { - obj.liquidity = []; + obj.liquidity = [] } - return obj; + return obj }, - fromPartial, I>>(object: I): QueryTotalLiquidityResponse { - const message = createBaseQueryTotalLiquidityResponse(); - message.liquidity = object.liquidity?.map((e) => Coin.fromPartial(e)) || []; - return message; + fromPartial, I>>( + object: I, + ): QueryTotalLiquidityResponse { + const message = createBaseQueryTotalLiquidityResponse() + message.liquidity = object.liquidity?.map((e) => Coin.fromPartial(e)) || [] + return message }, -}; +} function createBaseQueryTotalPoolLiquidityRequest(): QueryTotalPoolLiquidityRequest { - return { poolId: Long.UZERO }; + return { poolId: Long.UZERO } } export const QueryTotalPoolLiquidityRequest = { - encode(message: QueryTotalPoolLiquidityRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryTotalPoolLiquidityRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (!message.poolId.isZero()) { - writer.uint32(8).uint64(message.poolId); + writer.uint32(8).uint64(message.poolId) } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryTotalPoolLiquidityRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryTotalPoolLiquidityRequest(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryTotalPoolLiquidityRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryTotalPoolLiquidityRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.poolId = reader.uint64() as Long; - break; + message.poolId = reader.uint64() as Long + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryTotalPoolLiquidityRequest { - return { poolId: isSet(object.poolId) ? Long.fromValue(object.poolId) : Long.UZERO }; + return { + poolId: isSet(object.poolId) ? Long.fromValue(object.poolId) : Long.UZERO, + } }, toJSON(message: QueryTotalPoolLiquidityRequest): unknown { - const obj: any = {}; - message.poolId !== undefined && (obj.poolId = (message.poolId || Long.UZERO).toString()); - return obj; + const obj: any = {} + message.poolId !== undefined && + (obj.poolId = (message.poolId || Long.UZERO).toString()) + return obj }, fromPartial, I>>( object: I, ): QueryTotalPoolLiquidityRequest { - const message = createBaseQueryTotalPoolLiquidityRequest(); - message.poolId = (object.poolId !== undefined && object.poolId !== null) - ? Long.fromValue(object.poolId) - : Long.UZERO; - return message; + const message = createBaseQueryTotalPoolLiquidityRequest() + message.poolId = + object.poolId !== undefined && object.poolId !== null + ? Long.fromValue(object.poolId) + : Long.UZERO + return message }, -}; +} function createBaseQueryTotalPoolLiquidityResponse(): QueryTotalPoolLiquidityResponse { - return { liquidity: [] }; + return { liquidity: [] } } export const QueryTotalPoolLiquidityResponse = { - encode(message: QueryTotalPoolLiquidityResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryTotalPoolLiquidityResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { for (const v of message.liquidity) { - Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + Coin.encode(v!, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryTotalPoolLiquidityResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryTotalPoolLiquidityResponse(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryTotalPoolLiquidityResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryTotalPoolLiquidityResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.liquidity.push(Coin.decode(reader, reader.uint32())); - break; + message.liquidity.push(Coin.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryTotalPoolLiquidityResponse { - return { liquidity: Array.isArray(object?.liquidity) ? object.liquidity.map((e: any) => Coin.fromJSON(e)) : [] }; + return { + liquidity: Array.isArray(object?.liquidity) + ? object.liquidity.map((e: any) => Coin.fromJSON(e)) + : [], + } }, toJSON(message: QueryTotalPoolLiquidityResponse): unknown { - const obj: any = {}; + const obj: any = {} if (message.liquidity) { - obj.liquidity = message.liquidity.map((e) => e ? Coin.toJSON(e) : undefined); + obj.liquidity = message.liquidity.map((e) => (e ? Coin.toJSON(e) : undefined)) } else { - obj.liquidity = []; + obj.liquidity = [] } - return obj; + return obj }, fromPartial, I>>( object: I, ): QueryTotalPoolLiquidityResponse { - const message = createBaseQueryTotalPoolLiquidityResponse(); - message.liquidity = object.liquidity?.map((e) => Coin.fromPartial(e)) || []; - return message; + const message = createBaseQueryTotalPoolLiquidityResponse() + message.liquidity = object.liquidity?.map((e) => Coin.fromPartial(e)) || [] + return message }, -}; +} function createBaseQueryTotalSharesRequest(): QueryTotalSharesRequest { - return { poolId: Long.UZERO }; + return { poolId: Long.UZERO } } export const QueryTotalSharesRequest = { - encode(message: QueryTotalSharesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryTotalSharesRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (!message.poolId.isZero()) { - writer.uint32(8).uint64(message.poolId); + writer.uint32(8).uint64(message.poolId) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryTotalSharesRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryTotalSharesRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryTotalSharesRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.poolId = reader.uint64() as Long; - break; + message.poolId = reader.uint64() as Long + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryTotalSharesRequest { - return { poolId: isSet(object.poolId) ? Long.fromValue(object.poolId) : Long.UZERO }; + return { + poolId: isSet(object.poolId) ? Long.fromValue(object.poolId) : Long.UZERO, + } }, toJSON(message: QueryTotalSharesRequest): unknown { - const obj: any = {}; - message.poolId !== undefined && (obj.poolId = (message.poolId || Long.UZERO).toString()); - return obj; + const obj: any = {} + message.poolId !== undefined && + (obj.poolId = (message.poolId || Long.UZERO).toString()) + return obj }, - fromPartial, I>>(object: I): QueryTotalSharesRequest { - const message = createBaseQueryTotalSharesRequest(); - message.poolId = (object.poolId !== undefined && object.poolId !== null) - ? Long.fromValue(object.poolId) - : Long.UZERO; - return message; + fromPartial, I>>( + object: I, + ): QueryTotalSharesRequest { + const message = createBaseQueryTotalSharesRequest() + message.poolId = + object.poolId !== undefined && object.poolId !== null + ? Long.fromValue(object.poolId) + : Long.UZERO + return message }, -}; +} function createBaseQueryTotalSharesResponse(): QueryTotalSharesResponse { - return { totalShares: undefined }; + return { totalShares: undefined } } export const QueryTotalSharesResponse = { - encode(message: QueryTotalSharesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryTotalSharesResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.totalShares !== undefined) { - Coin.encode(message.totalShares, writer.uint32(10).fork()).ldelim(); + Coin.encode(message.totalShares, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryTotalSharesResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryTotalSharesResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryTotalSharesResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.totalShares = Coin.decode(reader, reader.uint32()); - break; + message.totalShares = Coin.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryTotalSharesResponse { - return { totalShares: isSet(object.totalShares) ? Coin.fromJSON(object.totalShares) : undefined }; + return { + totalShares: isSet(object.totalShares) + ? Coin.fromJSON(object.totalShares) + : undefined, + } }, toJSON(message: QueryTotalSharesResponse): unknown { - const obj: any = {}; + const obj: any = {} message.totalShares !== undefined && - (obj.totalShares = message.totalShares ? Coin.toJSON(message.totalShares) : undefined); - return obj; + (obj.totalShares = message.totalShares + ? Coin.toJSON(message.totalShares) + : undefined) + return obj }, - fromPartial, I>>(object: I): QueryTotalSharesResponse { - const message = createBaseQueryTotalSharesResponse(); - message.totalShares = (object.totalShares !== undefined && object.totalShares !== null) - ? Coin.fromPartial(object.totalShares) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): QueryTotalSharesResponse { + const message = createBaseQueryTotalSharesResponse() + message.totalShares = + object.totalShares !== undefined && object.totalShares !== null + ? Coin.fromPartial(object.totalShares) + : undefined + return message }, -}; +} function createBaseQuerySpotPriceRequest(): QuerySpotPriceRequest { - return { poolId: Long.UZERO, tokenInDenom: "", tokenOutDenom: "" }; + return { poolId: Long.UZERO, tokenInDenom: "", tokenOutDenom: "" } } export const QuerySpotPriceRequest = { - encode(message: QuerySpotPriceRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QuerySpotPriceRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (!message.poolId.isZero()) { - writer.uint32(8).uint64(message.poolId); + writer.uint32(8).uint64(message.poolId) } if (message.tokenInDenom !== "") { - writer.uint32(18).string(message.tokenInDenom); + writer.uint32(18).string(message.tokenInDenom) } if (message.tokenOutDenom !== "") { - writer.uint32(26).string(message.tokenOutDenom); + writer.uint32(26).string(message.tokenOutDenom) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QuerySpotPriceRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQuerySpotPriceRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQuerySpotPriceRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.poolId = reader.uint64() as Long; - break; + message.poolId = reader.uint64() as Long + break case 2: - message.tokenInDenom = reader.string(); - break; + message.tokenInDenom = reader.string() + break case 3: - message.tokenOutDenom = reader.string(); - break; + message.tokenOutDenom = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QuerySpotPriceRequest { @@ -1087,115 +1245,132 @@ export const QuerySpotPriceRequest = { poolId: isSet(object.poolId) ? Long.fromValue(object.poolId) : Long.UZERO, tokenInDenom: isSet(object.tokenInDenom) ? String(object.tokenInDenom) : "", tokenOutDenom: isSet(object.tokenOutDenom) ? String(object.tokenOutDenom) : "", - }; + } }, toJSON(message: QuerySpotPriceRequest): unknown { - const obj: any = {}; - message.poolId !== undefined && (obj.poolId = (message.poolId || Long.UZERO).toString()); - message.tokenInDenom !== undefined && (obj.tokenInDenom = message.tokenInDenom); - message.tokenOutDenom !== undefined && (obj.tokenOutDenom = message.tokenOutDenom); - return obj; + const obj: any = {} + message.poolId !== undefined && + (obj.poolId = (message.poolId || Long.UZERO).toString()) + message.tokenInDenom !== undefined && (obj.tokenInDenom = message.tokenInDenom) + message.tokenOutDenom !== undefined && (obj.tokenOutDenom = message.tokenOutDenom) + return obj }, - fromPartial, I>>(object: I): QuerySpotPriceRequest { - const message = createBaseQuerySpotPriceRequest(); - message.poolId = (object.poolId !== undefined && object.poolId !== null) - ? Long.fromValue(object.poolId) - : Long.UZERO; - message.tokenInDenom = object.tokenInDenom ?? ""; - message.tokenOutDenom = object.tokenOutDenom ?? ""; - return message; + fromPartial, I>>( + object: I, + ): QuerySpotPriceRequest { + const message = createBaseQuerySpotPriceRequest() + message.poolId = + object.poolId !== undefined && object.poolId !== null + ? Long.fromValue(object.poolId) + : Long.UZERO + message.tokenInDenom = object.tokenInDenom ?? "" + message.tokenOutDenom = object.tokenOutDenom ?? "" + return message }, -}; +} function createBaseQuerySpotPriceResponse(): QuerySpotPriceResponse { - return { spotPrice: "" }; + return { spotPrice: "" } } export const QuerySpotPriceResponse = { - encode(message: QuerySpotPriceResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QuerySpotPriceResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.spotPrice !== "") { - writer.uint32(10).string(message.spotPrice); + writer.uint32(10).string(message.spotPrice) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QuerySpotPriceResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQuerySpotPriceResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQuerySpotPriceResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.spotPrice = reader.string(); - break; + message.spotPrice = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QuerySpotPriceResponse { - return { spotPrice: isSet(object.spotPrice) ? String(object.spotPrice) : "" }; + return { + spotPrice: isSet(object.spotPrice) ? String(object.spotPrice) : "", + } }, toJSON(message: QuerySpotPriceResponse): unknown { - const obj: any = {}; - message.spotPrice !== undefined && (obj.spotPrice = message.spotPrice); - return obj; + const obj: any = {} + message.spotPrice !== undefined && (obj.spotPrice = message.spotPrice) + return obj }, - fromPartial, I>>(object: I): QuerySpotPriceResponse { - const message = createBaseQuerySpotPriceResponse(); - message.spotPrice = object.spotPrice ?? ""; - return message; + fromPartial, I>>( + object: I, + ): QuerySpotPriceResponse { + const message = createBaseQuerySpotPriceResponse() + message.spotPrice = object.spotPrice ?? "" + return message }, -}; +} function createBaseQuerySwapExactAmountInRequest(): QuerySwapExactAmountInRequest { - return { poolId: Long.UZERO, tokenIn: undefined, tokenOutDenom: "" }; + return { poolId: Long.UZERO, tokenIn: undefined, tokenOutDenom: "" } } export const QuerySwapExactAmountInRequest = { - encode(message: QuerySwapExactAmountInRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QuerySwapExactAmountInRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (!message.poolId.isZero()) { - writer.uint32(8).uint64(message.poolId); + writer.uint32(8).uint64(message.poolId) } if (message.tokenIn !== undefined) { - Coin.encode(message.tokenIn, writer.uint32(18).fork()).ldelim(); + Coin.encode(message.tokenIn, writer.uint32(18).fork()).ldelim() } if (message.tokenOutDenom !== "") { - writer.uint32(26).string(message.tokenOutDenom); + writer.uint32(26).string(message.tokenOutDenom) } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): QuerySwapExactAmountInRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQuerySwapExactAmountInRequest(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QuerySwapExactAmountInRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQuerySwapExactAmountInRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.poolId = reader.uint64() as Long; - break; + message.poolId = reader.uint64() as Long + break case 2: - message.tokenIn = Coin.decode(reader, reader.uint32()); - break; + message.tokenIn = Coin.decode(reader, reader.uint32()) + break case 3: - message.tokenOutDenom = reader.string(); - break; + message.tokenOutDenom = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QuerySwapExactAmountInRequest { @@ -1203,123 +1378,156 @@ export const QuerySwapExactAmountInRequest = { poolId: isSet(object.poolId) ? Long.fromValue(object.poolId) : Long.UZERO, tokenIn: isSet(object.tokenIn) ? Coin.fromJSON(object.tokenIn) : undefined, tokenOutDenom: isSet(object.tokenOutDenom) ? String(object.tokenOutDenom) : "", - }; + } }, toJSON(message: QuerySwapExactAmountInRequest): unknown { - const obj: any = {}; - message.poolId !== undefined && (obj.poolId = (message.poolId || Long.UZERO).toString()); - message.tokenIn !== undefined && (obj.tokenIn = message.tokenIn ? Coin.toJSON(message.tokenIn) : undefined); - message.tokenOutDenom !== undefined && (obj.tokenOutDenom = message.tokenOutDenom); - return obj; + const obj: any = {} + message.poolId !== undefined && + (obj.poolId = (message.poolId || Long.UZERO).toString()) + message.tokenIn !== undefined && + (obj.tokenIn = message.tokenIn ? Coin.toJSON(message.tokenIn) : undefined) + message.tokenOutDenom !== undefined && (obj.tokenOutDenom = message.tokenOutDenom) + return obj }, fromPartial, I>>( object: I, ): QuerySwapExactAmountInRequest { - const message = createBaseQuerySwapExactAmountInRequest(); - message.poolId = (object.poolId !== undefined && object.poolId !== null) - ? Long.fromValue(object.poolId) - : Long.UZERO; - message.tokenIn = (object.tokenIn !== undefined && object.tokenIn !== null) - ? Coin.fromPartial(object.tokenIn) - : undefined; - message.tokenOutDenom = object.tokenOutDenom ?? ""; - return message; - }, -}; + const message = createBaseQuerySwapExactAmountInRequest() + message.poolId = + object.poolId !== undefined && object.poolId !== null + ? Long.fromValue(object.poolId) + : Long.UZERO + message.tokenIn = + object.tokenIn !== undefined && object.tokenIn !== null + ? Coin.fromPartial(object.tokenIn) + : undefined + message.tokenOutDenom = object.tokenOutDenom ?? "" + return message + }, +} function createBaseQuerySwapExactAmountInResponse(): QuerySwapExactAmountInResponse { - return { tokenOut: undefined }; + return { tokenOut: undefined, fee: undefined } } export const QuerySwapExactAmountInResponse = { - encode(message: QuerySwapExactAmountInResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QuerySwapExactAmountInResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.tokenOut !== undefined) { - Coin.encode(message.tokenOut, writer.uint32(18).fork()).ldelim(); + Coin.encode(message.tokenOut, writer.uint32(18).fork()).ldelim() + } + if (message.fee !== undefined) { + Coin.encode(message.fee, writer.uint32(26).fork()).ldelim() } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): QuerySwapExactAmountInResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQuerySwapExactAmountInResponse(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QuerySwapExactAmountInResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQuerySwapExactAmountInResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 2: - message.tokenOut = Coin.decode(reader, reader.uint32()); - break; + message.tokenOut = Coin.decode(reader, reader.uint32()) + break + case 3: + message.fee = Coin.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QuerySwapExactAmountInResponse { - return { tokenOut: isSet(object.tokenOut) ? Coin.fromJSON(object.tokenOut) : undefined }; + return { + tokenOut: isSet(object.tokenOut) ? Coin.fromJSON(object.tokenOut) : undefined, + fee: isSet(object.fee) ? Coin.fromJSON(object.fee) : undefined, + } }, toJSON(message: QuerySwapExactAmountInResponse): unknown { - const obj: any = {}; - message.tokenOut !== undefined && (obj.tokenOut = message.tokenOut ? Coin.toJSON(message.tokenOut) : undefined); - return obj; + const obj: any = {} + message.tokenOut !== undefined && + (obj.tokenOut = message.tokenOut ? Coin.toJSON(message.tokenOut) : undefined) + message.fee !== undefined && + (obj.fee = message.fee ? Coin.toJSON(message.fee) : undefined) + return obj }, fromPartial, I>>( object: I, ): QuerySwapExactAmountInResponse { - const message = createBaseQuerySwapExactAmountInResponse(); - message.tokenOut = (object.tokenOut !== undefined && object.tokenOut !== null) - ? Coin.fromPartial(object.tokenOut) - : undefined; - return message; + const message = createBaseQuerySwapExactAmountInResponse() + message.tokenOut = + object.tokenOut !== undefined && object.tokenOut !== null + ? Coin.fromPartial(object.tokenOut) + : undefined + message.fee = + object.fee !== undefined && object.fee !== null + ? Coin.fromPartial(object.fee) + : undefined + return message }, -}; +} function createBaseQuerySwapExactAmountOutRequest(): QuerySwapExactAmountOutRequest { - return { poolId: Long.UZERO, tokenOut: undefined, tokenInDenom: "" }; + return { poolId: Long.UZERO, tokenOut: undefined, tokenInDenom: "" } } export const QuerySwapExactAmountOutRequest = { - encode(message: QuerySwapExactAmountOutRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QuerySwapExactAmountOutRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (!message.poolId.isZero()) { - writer.uint32(8).uint64(message.poolId); + writer.uint32(8).uint64(message.poolId) } if (message.tokenOut !== undefined) { - Coin.encode(message.tokenOut, writer.uint32(18).fork()).ldelim(); + Coin.encode(message.tokenOut, writer.uint32(18).fork()).ldelim() } if (message.tokenInDenom !== "") { - writer.uint32(26).string(message.tokenInDenom); + writer.uint32(26).string(message.tokenInDenom) } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): QuerySwapExactAmountOutRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQuerySwapExactAmountOutRequest(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QuerySwapExactAmountOutRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQuerySwapExactAmountOutRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.poolId = reader.uint64() as Long; - break; + message.poolId = reader.uint64() as Long + break case 2: - message.tokenOut = Coin.decode(reader, reader.uint32()); - break; + message.tokenOut = Coin.decode(reader, reader.uint32()) + break case 3: - message.tokenInDenom = reader.string(); - break; + message.tokenInDenom = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QuerySwapExactAmountOutRequest { @@ -1327,701 +1535,884 @@ export const QuerySwapExactAmountOutRequest = { poolId: isSet(object.poolId) ? Long.fromValue(object.poolId) : Long.UZERO, tokenOut: isSet(object.tokenOut) ? Coin.fromJSON(object.tokenOut) : undefined, tokenInDenom: isSet(object.tokenInDenom) ? String(object.tokenInDenom) : "", - }; + } }, toJSON(message: QuerySwapExactAmountOutRequest): unknown { - const obj: any = {}; - message.poolId !== undefined && (obj.poolId = (message.poolId || Long.UZERO).toString()); - message.tokenOut !== undefined && (obj.tokenOut = message.tokenOut ? Coin.toJSON(message.tokenOut) : undefined); - message.tokenInDenom !== undefined && (obj.tokenInDenom = message.tokenInDenom); - return obj; + const obj: any = {} + message.poolId !== undefined && + (obj.poolId = (message.poolId || Long.UZERO).toString()) + message.tokenOut !== undefined && + (obj.tokenOut = message.tokenOut ? Coin.toJSON(message.tokenOut) : undefined) + message.tokenInDenom !== undefined && (obj.tokenInDenom = message.tokenInDenom) + return obj }, fromPartial, I>>( object: I, ): QuerySwapExactAmountOutRequest { - const message = createBaseQuerySwapExactAmountOutRequest(); - message.poolId = (object.poolId !== undefined && object.poolId !== null) - ? Long.fromValue(object.poolId) - : Long.UZERO; - message.tokenOut = (object.tokenOut !== undefined && object.tokenOut !== null) - ? Coin.fromPartial(object.tokenOut) - : undefined; - message.tokenInDenom = object.tokenInDenom ?? ""; - return message; - }, -}; + const message = createBaseQuerySwapExactAmountOutRequest() + message.poolId = + object.poolId !== undefined && object.poolId !== null + ? Long.fromValue(object.poolId) + : Long.UZERO + message.tokenOut = + object.tokenOut !== undefined && object.tokenOut !== null + ? Coin.fromPartial(object.tokenOut) + : undefined + message.tokenInDenom = object.tokenInDenom ?? "" + return message + }, +} function createBaseQuerySwapExactAmountOutResponse(): QuerySwapExactAmountOutResponse { - return { tokenIn: undefined }; + return { tokenIn: undefined } } export const QuerySwapExactAmountOutResponse = { - encode(message: QuerySwapExactAmountOutResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QuerySwapExactAmountOutResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.tokenIn !== undefined) { - Coin.encode(message.tokenIn, writer.uint32(18).fork()).ldelim(); + Coin.encode(message.tokenIn, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): QuerySwapExactAmountOutResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQuerySwapExactAmountOutResponse(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QuerySwapExactAmountOutResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQuerySwapExactAmountOutResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 2: - message.tokenIn = Coin.decode(reader, reader.uint32()); - break; + message.tokenIn = Coin.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QuerySwapExactAmountOutResponse { - return { tokenIn: isSet(object.tokenIn) ? Coin.fromJSON(object.tokenIn) : undefined }; + return { + tokenIn: isSet(object.tokenIn) ? Coin.fromJSON(object.tokenIn) : undefined, + } }, toJSON(message: QuerySwapExactAmountOutResponse): unknown { - const obj: any = {}; - message.tokenIn !== undefined && (obj.tokenIn = message.tokenIn ? Coin.toJSON(message.tokenIn) : undefined); - return obj; + const obj: any = {} + message.tokenIn !== undefined && + (obj.tokenIn = message.tokenIn ? Coin.toJSON(message.tokenIn) : undefined) + return obj }, fromPartial, I>>( object: I, ): QuerySwapExactAmountOutResponse { - const message = createBaseQuerySwapExactAmountOutResponse(); - message.tokenIn = (object.tokenIn !== undefined && object.tokenIn !== null) - ? Coin.fromPartial(object.tokenIn) - : undefined; - return message; + const message = createBaseQuerySwapExactAmountOutResponse() + message.tokenIn = + object.tokenIn !== undefined && object.tokenIn !== null + ? Coin.fromPartial(object.tokenIn) + : undefined + return message }, -}; +} function createBaseQueryJoinExactAmountInRequest(): QueryJoinExactAmountInRequest { - return { poolId: Long.UZERO, tokensIn: [] }; + return { poolId: Long.UZERO, tokensIn: [] } } export const QueryJoinExactAmountInRequest = { - encode(message: QueryJoinExactAmountInRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryJoinExactAmountInRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (!message.poolId.isZero()) { - writer.uint32(8).uint64(message.poolId); + writer.uint32(8).uint64(message.poolId) } for (const v of message.tokensIn) { - Coin.encode(v!, writer.uint32(18).fork()).ldelim(); + Coin.encode(v!, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryJoinExactAmountInRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryJoinExactAmountInRequest(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryJoinExactAmountInRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryJoinExactAmountInRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.poolId = reader.uint64() as Long; - break; + message.poolId = reader.uint64() as Long + break case 2: - message.tokensIn.push(Coin.decode(reader, reader.uint32())); - break; + message.tokensIn.push(Coin.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryJoinExactAmountInRequest { return { poolId: isSet(object.poolId) ? Long.fromValue(object.poolId) : Long.UZERO, - tokensIn: Array.isArray(object?.tokensIn) ? object.tokensIn.map((e: any) => Coin.fromJSON(e)) : [], - }; + tokensIn: Array.isArray(object?.tokensIn) + ? object.tokensIn.map((e: any) => Coin.fromJSON(e)) + : [], + } }, toJSON(message: QueryJoinExactAmountInRequest): unknown { - const obj: any = {}; - message.poolId !== undefined && (obj.poolId = (message.poolId || Long.UZERO).toString()); + const obj: any = {} + message.poolId !== undefined && + (obj.poolId = (message.poolId || Long.UZERO).toString()) if (message.tokensIn) { - obj.tokensIn = message.tokensIn.map((e) => e ? Coin.toJSON(e) : undefined); + obj.tokensIn = message.tokensIn.map((e) => (e ? Coin.toJSON(e) : undefined)) } else { - obj.tokensIn = []; + obj.tokensIn = [] } - return obj; + return obj }, fromPartial, I>>( object: I, ): QueryJoinExactAmountInRequest { - const message = createBaseQueryJoinExactAmountInRequest(); - message.poolId = (object.poolId !== undefined && object.poolId !== null) - ? Long.fromValue(object.poolId) - : Long.UZERO; - message.tokensIn = object.tokensIn?.map((e) => Coin.fromPartial(e)) || []; - return message; + const message = createBaseQueryJoinExactAmountInRequest() + message.poolId = + object.poolId !== undefined && object.poolId !== null + ? Long.fromValue(object.poolId) + : Long.UZERO + message.tokensIn = object.tokensIn?.map((e) => Coin.fromPartial(e)) || [] + return message }, -}; +} function createBaseQueryJoinExactAmountInResponse(): QueryJoinExactAmountInResponse { - return { poolSharesOut: "", remCoins: [] }; + return { poolSharesOut: "", remCoins: [] } } export const QueryJoinExactAmountInResponse = { - encode(message: QueryJoinExactAmountInResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryJoinExactAmountInResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.poolSharesOut !== "") { - writer.uint32(10).string(message.poolSharesOut); + writer.uint32(10).string(message.poolSharesOut) } for (const v of message.remCoins) { - Coin.encode(v!, writer.uint32(18).fork()).ldelim(); + Coin.encode(v!, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryJoinExactAmountInResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryJoinExactAmountInResponse(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryJoinExactAmountInResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryJoinExactAmountInResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.poolSharesOut = reader.string(); - break; + message.poolSharesOut = reader.string() + break case 2: - message.remCoins.push(Coin.decode(reader, reader.uint32())); - break; + message.remCoins.push(Coin.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryJoinExactAmountInResponse { return { poolSharesOut: isSet(object.poolSharesOut) ? String(object.poolSharesOut) : "", - remCoins: Array.isArray(object?.remCoins) ? object.remCoins.map((e: any) => Coin.fromJSON(e)) : [], - }; + remCoins: Array.isArray(object?.remCoins) + ? object.remCoins.map((e: any) => Coin.fromJSON(e)) + : [], + } }, toJSON(message: QueryJoinExactAmountInResponse): unknown { - const obj: any = {}; - message.poolSharesOut !== undefined && (obj.poolSharesOut = message.poolSharesOut); + const obj: any = {} + message.poolSharesOut !== undefined && (obj.poolSharesOut = message.poolSharesOut) if (message.remCoins) { - obj.remCoins = message.remCoins.map((e) => e ? Coin.toJSON(e) : undefined); + obj.remCoins = message.remCoins.map((e) => (e ? Coin.toJSON(e) : undefined)) } else { - obj.remCoins = []; + obj.remCoins = [] } - return obj; + return obj }, fromPartial, I>>( object: I, ): QueryJoinExactAmountInResponse { - const message = createBaseQueryJoinExactAmountInResponse(); - message.poolSharesOut = object.poolSharesOut ?? ""; - message.remCoins = object.remCoins?.map((e) => Coin.fromPartial(e)) || []; - return message; + const message = createBaseQueryJoinExactAmountInResponse() + message.poolSharesOut = object.poolSharesOut ?? "" + message.remCoins = object.remCoins?.map((e) => Coin.fromPartial(e)) || [] + return message }, -}; +} function createBaseQueryJoinExactAmountOutRequest(): QueryJoinExactAmountOutRequest { - return { poolId: Long.UZERO }; + return { poolId: Long.UZERO } } export const QueryJoinExactAmountOutRequest = { - encode(message: QueryJoinExactAmountOutRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryJoinExactAmountOutRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (!message.poolId.isZero()) { - writer.uint32(8).uint64(message.poolId); + writer.uint32(8).uint64(message.poolId) } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryJoinExactAmountOutRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryJoinExactAmountOutRequest(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryJoinExactAmountOutRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryJoinExactAmountOutRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.poolId = reader.uint64() as Long; - break; + message.poolId = reader.uint64() as Long + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryJoinExactAmountOutRequest { - return { poolId: isSet(object.poolId) ? Long.fromValue(object.poolId) : Long.UZERO }; + return { + poolId: isSet(object.poolId) ? Long.fromValue(object.poolId) : Long.UZERO, + } }, toJSON(message: QueryJoinExactAmountOutRequest): unknown { - const obj: any = {}; - message.poolId !== undefined && (obj.poolId = (message.poolId || Long.UZERO).toString()); - return obj; + const obj: any = {} + message.poolId !== undefined && + (obj.poolId = (message.poolId || Long.UZERO).toString()) + return obj }, fromPartial, I>>( object: I, ): QueryJoinExactAmountOutRequest { - const message = createBaseQueryJoinExactAmountOutRequest(); - message.poolId = (object.poolId !== undefined && object.poolId !== null) - ? Long.fromValue(object.poolId) - : Long.UZERO; - return message; + const message = createBaseQueryJoinExactAmountOutRequest() + message.poolId = + object.poolId !== undefined && object.poolId !== null + ? Long.fromValue(object.poolId) + : Long.UZERO + return message }, -}; +} function createBaseQueryJoinExactAmountOutResponse(): QueryJoinExactAmountOutResponse { - return {}; + return {} } export const QueryJoinExactAmountOutResponse = { - encode(_: QueryJoinExactAmountOutResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): QueryJoinExactAmountOutResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryJoinExactAmountOutResponse(); + encode( + _: QueryJoinExactAmountOutResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryJoinExactAmountOutResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryJoinExactAmountOutResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(_: any): QueryJoinExactAmountOutResponse { - return {}; + return {} }, toJSON(_: QueryJoinExactAmountOutResponse): unknown { - const obj: any = {}; - return obj; + const obj: any = {} + return obj }, - fromPartial, I>>(_: I): QueryJoinExactAmountOutResponse { - const message = createBaseQueryJoinExactAmountOutResponse(); - return message; + fromPartial, I>>( + _: I, + ): QueryJoinExactAmountOutResponse { + const message = createBaseQueryJoinExactAmountOutResponse() + return message }, -}; +} function createBaseQueryExitExactAmountInRequest(): QueryExitExactAmountInRequest { - return { poolId: Long.UZERO, poolSharesIn: "" }; + return { poolId: Long.UZERO, poolSharesIn: "" } } export const QueryExitExactAmountInRequest = { - encode(message: QueryExitExactAmountInRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryExitExactAmountInRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (!message.poolId.isZero()) { - writer.uint32(8).uint64(message.poolId); + writer.uint32(8).uint64(message.poolId) } if (message.poolSharesIn !== "") { - writer.uint32(18).string(message.poolSharesIn); + writer.uint32(18).string(message.poolSharesIn) } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryExitExactAmountInRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryExitExactAmountInRequest(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryExitExactAmountInRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryExitExactAmountInRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.poolId = reader.uint64() as Long; - break; + message.poolId = reader.uint64() as Long + break case 2: - message.poolSharesIn = reader.string(); - break; + message.poolSharesIn = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryExitExactAmountInRequest { return { poolId: isSet(object.poolId) ? Long.fromValue(object.poolId) : Long.UZERO, poolSharesIn: isSet(object.poolSharesIn) ? String(object.poolSharesIn) : "", - }; + } }, toJSON(message: QueryExitExactAmountInRequest): unknown { - const obj: any = {}; - message.poolId !== undefined && (obj.poolId = (message.poolId || Long.UZERO).toString()); - message.poolSharesIn !== undefined && (obj.poolSharesIn = message.poolSharesIn); - return obj; + const obj: any = {} + message.poolId !== undefined && + (obj.poolId = (message.poolId || Long.UZERO).toString()) + message.poolSharesIn !== undefined && (obj.poolSharesIn = message.poolSharesIn) + return obj }, fromPartial, I>>( object: I, ): QueryExitExactAmountInRequest { - const message = createBaseQueryExitExactAmountInRequest(); - message.poolId = (object.poolId !== undefined && object.poolId !== null) - ? Long.fromValue(object.poolId) - : Long.UZERO; - message.poolSharesIn = object.poolSharesIn ?? ""; - return message; + const message = createBaseQueryExitExactAmountInRequest() + message.poolId = + object.poolId !== undefined && object.poolId !== null + ? Long.fromValue(object.poolId) + : Long.UZERO + message.poolSharesIn = object.poolSharesIn ?? "" + return message }, -}; +} function createBaseQueryExitExactAmountInResponse(): QueryExitExactAmountInResponse { - return { tokensOut: [] }; + return { tokensOut: [], fees: [] } } export const QueryExitExactAmountInResponse = { - encode(message: QueryExitExactAmountInResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryExitExactAmountInResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { for (const v of message.tokensOut) { - Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + Coin.encode(v!, writer.uint32(10).fork()).ldelim() } - return writer; + for (const v of message.fees) { + Coin.encode(v!, writer.uint32(18).fork()).ldelim() + } + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryExitExactAmountInResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryExitExactAmountInResponse(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryExitExactAmountInResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryExitExactAmountInResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.tokensOut.push(Coin.decode(reader, reader.uint32())); - break; + message.tokensOut.push(Coin.decode(reader, reader.uint32())) + break + case 2: + message.fees.push(Coin.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryExitExactAmountInResponse { - return { tokensOut: Array.isArray(object?.tokensOut) ? object.tokensOut.map((e: any) => Coin.fromJSON(e)) : [] }; + return { + tokensOut: Array.isArray(object?.tokensOut) + ? object.tokensOut.map((e: any) => Coin.fromJSON(e)) + : [], + fees: Array.isArray(object?.fees) + ? object.fees.map((e: any) => Coin.fromJSON(e)) + : [], + } }, toJSON(message: QueryExitExactAmountInResponse): unknown { - const obj: any = {}; + const obj: any = {} if (message.tokensOut) { - obj.tokensOut = message.tokensOut.map((e) => e ? Coin.toJSON(e) : undefined); + obj.tokensOut = message.tokensOut.map((e) => (e ? Coin.toJSON(e) : undefined)) + } else { + obj.tokensOut = [] + } + if (message.fees) { + obj.fees = message.fees.map((e) => (e ? Coin.toJSON(e) : undefined)) } else { - obj.tokensOut = []; + obj.fees = [] } - return obj; + return obj }, fromPartial, I>>( object: I, ): QueryExitExactAmountInResponse { - const message = createBaseQueryExitExactAmountInResponse(); - message.tokensOut = object.tokensOut?.map((e) => Coin.fromPartial(e)) || []; - return message; + const message = createBaseQueryExitExactAmountInResponse() + message.tokensOut = object.tokensOut?.map((e) => Coin.fromPartial(e)) || [] + message.fees = object.fees?.map((e) => Coin.fromPartial(e)) || [] + return message }, -}; +} function createBaseQueryExitExactAmountOutRequest(): QueryExitExactAmountOutRequest { - return { poolId: Long.UZERO }; + return { poolId: Long.UZERO } } export const QueryExitExactAmountOutRequest = { - encode(message: QueryExitExactAmountOutRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryExitExactAmountOutRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (!message.poolId.isZero()) { - writer.uint32(8).uint64(message.poolId); + writer.uint32(8).uint64(message.poolId) } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryExitExactAmountOutRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryExitExactAmountOutRequest(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryExitExactAmountOutRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryExitExactAmountOutRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.poolId = reader.uint64() as Long; - break; + message.poolId = reader.uint64() as Long + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryExitExactAmountOutRequest { - return { poolId: isSet(object.poolId) ? Long.fromValue(object.poolId) : Long.UZERO }; + return { + poolId: isSet(object.poolId) ? Long.fromValue(object.poolId) : Long.UZERO, + } }, toJSON(message: QueryExitExactAmountOutRequest): unknown { - const obj: any = {}; - message.poolId !== undefined && (obj.poolId = (message.poolId || Long.UZERO).toString()); - return obj; + const obj: any = {} + message.poolId !== undefined && + (obj.poolId = (message.poolId || Long.UZERO).toString()) + return obj }, fromPartial, I>>( object: I, ): QueryExitExactAmountOutRequest { - const message = createBaseQueryExitExactAmountOutRequest(); - message.poolId = (object.poolId !== undefined && object.poolId !== null) - ? Long.fromValue(object.poolId) - : Long.UZERO; - return message; + const message = createBaseQueryExitExactAmountOutRequest() + message.poolId = + object.poolId !== undefined && object.poolId !== null + ? Long.fromValue(object.poolId) + : Long.UZERO + return message }, -}; +} function createBaseQueryExitExactAmountOutResponse(): QueryExitExactAmountOutResponse { - return {}; + return {} } export const QueryExitExactAmountOutResponse = { - encode(_: QueryExitExactAmountOutResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): QueryExitExactAmountOutResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryExitExactAmountOutResponse(); + encode( + _: QueryExitExactAmountOutResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryExitExactAmountOutResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryExitExactAmountOutResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(_: any): QueryExitExactAmountOutResponse { - return {}; + return {} }, toJSON(_: QueryExitExactAmountOutResponse): unknown { - const obj: any = {}; - return obj; + const obj: any = {} + return obj }, - fromPartial, I>>(_: I): QueryExitExactAmountOutResponse { - const message = createBaseQueryExitExactAmountOutResponse(); - return message; + fromPartial, I>>( + _: I, + ): QueryExitExactAmountOutResponse { + const message = createBaseQueryExitExactAmountOutResponse() + return message }, -}; +} /** Query defines the gRPC querier service. */ export interface Query { /** Parameters of the spot module. */ - Params(request: QueryParamsRequest): Promise; + Params(request: QueryParamsRequest): Promise /** Next available pool id number. */ - PoolNumber(request: QueryPoolNumberRequest): Promise; + PoolNumber(request: QueryPoolNumberRequest): Promise /** Fetch a pool by id. */ - Pool(request: QueryPoolRequest): Promise; + Pool(request: QueryPoolRequest): Promise /** Returns all pools. */ - Pools(request: QueryPoolsRequest): Promise; + Pools(request: QueryPoolsRequest): Promise /** Parameters of a single pool. */ - PoolParams(request: QueryPoolParamsRequest): Promise; + PoolParams(request: QueryPoolParamsRequest): Promise /** Number of pools. */ - NumPools(request: QueryNumPoolsRequest): Promise; + NumPools(request: QueryNumPoolsRequest): Promise /** Total liquidity across all pools. */ - TotalLiquidity(request: QueryTotalLiquidityRequest): Promise; + TotalLiquidity( + request: QueryTotalLiquidityRequest, + ): Promise /** Total liquidity in a single pool. */ - TotalPoolLiquidity(request: QueryTotalPoolLiquidityRequest): Promise; + TotalPoolLiquidity( + request: QueryTotalPoolLiquidityRequest, + ): Promise /** Total shares in a single pool. */ - TotalShares(request: QueryTotalSharesRequest): Promise; + TotalShares(request: QueryTotalSharesRequest): Promise /** Instantaneous price of an asset in a pool. */ - SpotPrice(request: QuerySpotPriceRequest): Promise; + SpotPrice(request: QuerySpotPriceRequest): Promise /** * Estimates the amount of assets returned given an exact amount of tokens to * swap. */ - EstimateSwapExactAmountIn(request: QuerySwapExactAmountInRequest): Promise; + EstimateSwapExactAmountIn( + request: QuerySwapExactAmountInRequest, + ): Promise /** * Estimates the amount of tokens required to return the exact amount of * assets requested. */ - EstimateSwapExactAmountOut(request: QuerySwapExactAmountOutRequest): Promise; + EstimateSwapExactAmountOut( + request: QuerySwapExactAmountOutRequest, + ): Promise /** * Estimates the amount of pool shares returned given an amount of tokens to * join. */ - EstimateJoinExactAmountIn(request: QueryJoinExactAmountInRequest): Promise; + EstimateJoinExactAmountIn( + request: QueryJoinExactAmountInRequest, + ): Promise /** * Estimates the amount of tokens required to obtain an exact amount of pool * shares. */ - EstimateJoinExactAmountOut(request: QueryJoinExactAmountOutRequest): Promise; + EstimateJoinExactAmountOut( + request: QueryJoinExactAmountOutRequest, + ): Promise /** * Estimates the amount of tokens returned to the user given an exact amount * of pool shares. */ - EstimateExitExactAmountIn(request: QueryExitExactAmountInRequest): Promise; + EstimateExitExactAmountIn( + request: QueryExitExactAmountInRequest, + ): Promise /** * Estimates the amount of pool shares required to extract an exact amount of * tokens from the pool. */ - EstimateExitExactAmountOut(request: QueryExitExactAmountOutRequest): Promise; + EstimateExitExactAmountOut( + request: QueryExitExactAmountOutRequest, + ): Promise } export class QueryClientImpl implements Query { - private readonly rpc: Rpc; + private readonly rpc: Rpc constructor(rpc: Rpc) { - this.rpc = rpc; - this.Params = this.Params.bind(this); - this.PoolNumber = this.PoolNumber.bind(this); - this.Pool = this.Pool.bind(this); - this.Pools = this.Pools.bind(this); - this.PoolParams = this.PoolParams.bind(this); - this.NumPools = this.NumPools.bind(this); - this.TotalLiquidity = this.TotalLiquidity.bind(this); - this.TotalPoolLiquidity = this.TotalPoolLiquidity.bind(this); - this.TotalShares = this.TotalShares.bind(this); - this.SpotPrice = this.SpotPrice.bind(this); - this.EstimateSwapExactAmountIn = this.EstimateSwapExactAmountIn.bind(this); - this.EstimateSwapExactAmountOut = this.EstimateSwapExactAmountOut.bind(this); - this.EstimateJoinExactAmountIn = this.EstimateJoinExactAmountIn.bind(this); - this.EstimateJoinExactAmountOut = this.EstimateJoinExactAmountOut.bind(this); - this.EstimateExitExactAmountIn = this.EstimateExitExactAmountIn.bind(this); - this.EstimateExitExactAmountOut = this.EstimateExitExactAmountOut.bind(this); + this.rpc = rpc + this.Params = this.Params.bind(this) + this.PoolNumber = this.PoolNumber.bind(this) + this.Pool = this.Pool.bind(this) + this.Pools = this.Pools.bind(this) + this.PoolParams = this.PoolParams.bind(this) + this.NumPools = this.NumPools.bind(this) + this.TotalLiquidity = this.TotalLiquidity.bind(this) + this.TotalPoolLiquidity = this.TotalPoolLiquidity.bind(this) + this.TotalShares = this.TotalShares.bind(this) + this.SpotPrice = this.SpotPrice.bind(this) + this.EstimateSwapExactAmountIn = this.EstimateSwapExactAmountIn.bind(this) + this.EstimateSwapExactAmountOut = this.EstimateSwapExactAmountOut.bind(this) + this.EstimateJoinExactAmountIn = this.EstimateJoinExactAmountIn.bind(this) + this.EstimateJoinExactAmountOut = this.EstimateJoinExactAmountOut.bind(this) + this.EstimateExitExactAmountIn = this.EstimateExitExactAmountIn.bind(this) + this.EstimateExitExactAmountOut = this.EstimateExitExactAmountOut.bind(this) } Params(request: QueryParamsRequest): Promise { - const data = QueryParamsRequest.encode(request).finish(); - const promise = this.rpc.request("nibiru.spot.v1.Query", "Params", data); - return promise.then((data) => QueryParamsResponse.decode(new _m0.Reader(data))); + const data = QueryParamsRequest.encode(request).finish() + const promise = this.rpc.request("nibiru.spot.v1.Query", "Params", data) + return promise.then((data) => QueryParamsResponse.decode(new _m0.Reader(data))) } PoolNumber(request: QueryPoolNumberRequest): Promise { - const data = QueryPoolNumberRequest.encode(request).finish(); - const promise = this.rpc.request("nibiru.spot.v1.Query", "PoolNumber", data); - return promise.then((data) => QueryPoolNumberResponse.decode(new _m0.Reader(data))); + const data = QueryPoolNumberRequest.encode(request).finish() + const promise = this.rpc.request("nibiru.spot.v1.Query", "PoolNumber", data) + return promise.then((data) => QueryPoolNumberResponse.decode(new _m0.Reader(data))) } Pool(request: QueryPoolRequest): Promise { - const data = QueryPoolRequest.encode(request).finish(); - const promise = this.rpc.request("nibiru.spot.v1.Query", "Pool", data); - return promise.then((data) => QueryPoolResponse.decode(new _m0.Reader(data))); + const data = QueryPoolRequest.encode(request).finish() + const promise = this.rpc.request("nibiru.spot.v1.Query", "Pool", data) + return promise.then((data) => QueryPoolResponse.decode(new _m0.Reader(data))) } Pools(request: QueryPoolsRequest): Promise { - const data = QueryPoolsRequest.encode(request).finish(); - const promise = this.rpc.request("nibiru.spot.v1.Query", "Pools", data); - return promise.then((data) => QueryPoolsResponse.decode(new _m0.Reader(data))); + const data = QueryPoolsRequest.encode(request).finish() + const promise = this.rpc.request("nibiru.spot.v1.Query", "Pools", data) + return promise.then((data) => QueryPoolsResponse.decode(new _m0.Reader(data))) } PoolParams(request: QueryPoolParamsRequest): Promise { - const data = QueryPoolParamsRequest.encode(request).finish(); - const promise = this.rpc.request("nibiru.spot.v1.Query", "PoolParams", data); - return promise.then((data) => QueryPoolParamsResponse.decode(new _m0.Reader(data))); + const data = QueryPoolParamsRequest.encode(request).finish() + const promise = this.rpc.request("nibiru.spot.v1.Query", "PoolParams", data) + return promise.then((data) => QueryPoolParamsResponse.decode(new _m0.Reader(data))) } NumPools(request: QueryNumPoolsRequest): Promise { - const data = QueryNumPoolsRequest.encode(request).finish(); - const promise = this.rpc.request("nibiru.spot.v1.Query", "NumPools", data); - return promise.then((data) => QueryNumPoolsResponse.decode(new _m0.Reader(data))); + const data = QueryNumPoolsRequest.encode(request).finish() + const promise = this.rpc.request("nibiru.spot.v1.Query", "NumPools", data) + return promise.then((data) => QueryNumPoolsResponse.decode(new _m0.Reader(data))) } - TotalLiquidity(request: QueryTotalLiquidityRequest): Promise { - const data = QueryTotalLiquidityRequest.encode(request).finish(); - const promise = this.rpc.request("nibiru.spot.v1.Query", "TotalLiquidity", data); - return promise.then((data) => QueryTotalLiquidityResponse.decode(new _m0.Reader(data))); + TotalLiquidity( + request: QueryTotalLiquidityRequest, + ): Promise { + const data = QueryTotalLiquidityRequest.encode(request).finish() + const promise = this.rpc.request("nibiru.spot.v1.Query", "TotalLiquidity", data) + return promise.then((data) => + QueryTotalLiquidityResponse.decode(new _m0.Reader(data)), + ) } - TotalPoolLiquidity(request: QueryTotalPoolLiquidityRequest): Promise { - const data = QueryTotalPoolLiquidityRequest.encode(request).finish(); - const promise = this.rpc.request("nibiru.spot.v1.Query", "TotalPoolLiquidity", data); - return promise.then((data) => QueryTotalPoolLiquidityResponse.decode(new _m0.Reader(data))); + TotalPoolLiquidity( + request: QueryTotalPoolLiquidityRequest, + ): Promise { + const data = QueryTotalPoolLiquidityRequest.encode(request).finish() + const promise = this.rpc.request("nibiru.spot.v1.Query", "TotalPoolLiquidity", data) + return promise.then((data) => + QueryTotalPoolLiquidityResponse.decode(new _m0.Reader(data)), + ) } TotalShares(request: QueryTotalSharesRequest): Promise { - const data = QueryTotalSharesRequest.encode(request).finish(); - const promise = this.rpc.request("nibiru.spot.v1.Query", "TotalShares", data); - return promise.then((data) => QueryTotalSharesResponse.decode(new _m0.Reader(data))); + const data = QueryTotalSharesRequest.encode(request).finish() + const promise = this.rpc.request("nibiru.spot.v1.Query", "TotalShares", data) + return promise.then((data) => QueryTotalSharesResponse.decode(new _m0.Reader(data))) } SpotPrice(request: QuerySpotPriceRequest): Promise { - const data = QuerySpotPriceRequest.encode(request).finish(); - const promise = this.rpc.request("nibiru.spot.v1.Query", "SpotPrice", data); - return promise.then((data) => QuerySpotPriceResponse.decode(new _m0.Reader(data))); + const data = QuerySpotPriceRequest.encode(request).finish() + const promise = this.rpc.request("nibiru.spot.v1.Query", "SpotPrice", data) + return promise.then((data) => QuerySpotPriceResponse.decode(new _m0.Reader(data))) } - EstimateSwapExactAmountIn(request: QuerySwapExactAmountInRequest): Promise { - const data = QuerySwapExactAmountInRequest.encode(request).finish(); - const promise = this.rpc.request("nibiru.spot.v1.Query", "EstimateSwapExactAmountIn", data); - return promise.then((data) => QuerySwapExactAmountInResponse.decode(new _m0.Reader(data))); + EstimateSwapExactAmountIn( + request: QuerySwapExactAmountInRequest, + ): Promise { + const data = QuerySwapExactAmountInRequest.encode(request).finish() + const promise = this.rpc.request( + "nibiru.spot.v1.Query", + "EstimateSwapExactAmountIn", + data, + ) + return promise.then((data) => + QuerySwapExactAmountInResponse.decode(new _m0.Reader(data)), + ) } - EstimateSwapExactAmountOut(request: QuerySwapExactAmountOutRequest): Promise { - const data = QuerySwapExactAmountOutRequest.encode(request).finish(); - const promise = this.rpc.request("nibiru.spot.v1.Query", "EstimateSwapExactAmountOut", data); - return promise.then((data) => QuerySwapExactAmountOutResponse.decode(new _m0.Reader(data))); + EstimateSwapExactAmountOut( + request: QuerySwapExactAmountOutRequest, + ): Promise { + const data = QuerySwapExactAmountOutRequest.encode(request).finish() + const promise = this.rpc.request( + "nibiru.spot.v1.Query", + "EstimateSwapExactAmountOut", + data, + ) + return promise.then((data) => + QuerySwapExactAmountOutResponse.decode(new _m0.Reader(data)), + ) } - EstimateJoinExactAmountIn(request: QueryJoinExactAmountInRequest): Promise { - const data = QueryJoinExactAmountInRequest.encode(request).finish(); - const promise = this.rpc.request("nibiru.spot.v1.Query", "EstimateJoinExactAmountIn", data); - return promise.then((data) => QueryJoinExactAmountInResponse.decode(new _m0.Reader(data))); + EstimateJoinExactAmountIn( + request: QueryJoinExactAmountInRequest, + ): Promise { + const data = QueryJoinExactAmountInRequest.encode(request).finish() + const promise = this.rpc.request( + "nibiru.spot.v1.Query", + "EstimateJoinExactAmountIn", + data, + ) + return promise.then((data) => + QueryJoinExactAmountInResponse.decode(new _m0.Reader(data)), + ) } - EstimateJoinExactAmountOut(request: QueryJoinExactAmountOutRequest): Promise { - const data = QueryJoinExactAmountOutRequest.encode(request).finish(); - const promise = this.rpc.request("nibiru.spot.v1.Query", "EstimateJoinExactAmountOut", data); - return promise.then((data) => QueryJoinExactAmountOutResponse.decode(new _m0.Reader(data))); + EstimateJoinExactAmountOut( + request: QueryJoinExactAmountOutRequest, + ): Promise { + const data = QueryJoinExactAmountOutRequest.encode(request).finish() + const promise = this.rpc.request( + "nibiru.spot.v1.Query", + "EstimateJoinExactAmountOut", + data, + ) + return promise.then((data) => + QueryJoinExactAmountOutResponse.decode(new _m0.Reader(data)), + ) } - EstimateExitExactAmountIn(request: QueryExitExactAmountInRequest): Promise { - const data = QueryExitExactAmountInRequest.encode(request).finish(); - const promise = this.rpc.request("nibiru.spot.v1.Query", "EstimateExitExactAmountIn", data); - return promise.then((data) => QueryExitExactAmountInResponse.decode(new _m0.Reader(data))); + EstimateExitExactAmountIn( + request: QueryExitExactAmountInRequest, + ): Promise { + const data = QueryExitExactAmountInRequest.encode(request).finish() + const promise = this.rpc.request( + "nibiru.spot.v1.Query", + "EstimateExitExactAmountIn", + data, + ) + return promise.then((data) => + QueryExitExactAmountInResponse.decode(new _m0.Reader(data)), + ) } - EstimateExitExactAmountOut(request: QueryExitExactAmountOutRequest): Promise { - const data = QueryExitExactAmountOutRequest.encode(request).finish(); - const promise = this.rpc.request("nibiru.spot.v1.Query", "EstimateExitExactAmountOut", data); - return promise.then((data) => QueryExitExactAmountOutResponse.decode(new _m0.Reader(data))); + EstimateExitExactAmountOut( + request: QueryExitExactAmountOutRequest, + ): Promise { + const data = QueryExitExactAmountOutRequest.encode(request).finish() + const promise = this.rpc.request( + "nibiru.spot.v1.Query", + "EstimateExitExactAmountOut", + data, + ) + return promise.then((data) => + QueryExitExactAmountOutResponse.decode(new _m0.Reader(data)), + ) } } interface Rpc { - request(service: string, method: string, data: Uint8Array): Promise; -} - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; + request(service: string, method: string, data: Uint8Array): Promise +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/spot/v1/tx.ts b/packages/protojs/src/spot/v1/tx.ts index df5150d5..23fa02c9 100644 --- a/packages/protojs/src/spot/v1/tx.ts +++ b/packages/protojs/src/spot/v1/tx.ts @@ -1,510 +1,567 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { Coin } from "../../cosmos/base/v1beta1/coin"; -import { Pool, PoolAsset, PoolParams } from "./pool"; +import { PoolParams, Pool, PoolAsset } from "./pool" +import { Coin } from "../../cosmos/base/v1beta1/coin" +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "nibiru.spot.v1"; +export const protobufPackage = "nibiru.spot.v1" export interface MsgCreatePool { - creator: string; - poolParams?: PoolParams; - poolAssets: PoolAsset[]; + creator: string + poolParams?: PoolParams + poolAssets: PoolAsset[] } export interface MsgCreatePoolResponse { - poolId: Long; + poolId: Long } /** Message to join a pool (identified by poolId) with a set of tokens to deposit. */ export interface MsgJoinPool { - sender: string; - poolId: Long; - tokensIn: Coin[]; - useAllCoins: boolean; + sender: string + poolId: Long + tokensIn: Coin[] + useAllCoins: boolean } /** Response when a user joins a pool. */ export interface MsgJoinPoolResponse { /** the final state of the pool after a join */ - pool?: Pool; + pool?: Pool /** sum of LP tokens minted from the join */ - numPoolSharesOut?: Coin; + numPoolSharesOut?: Coin /** remaining tokens from attempting to join the pool */ - remainingCoins: Coin[]; + remainingCoins: Coin[] } export interface MsgExitPool { - sender: string; - poolId: Long; - poolShares?: Coin; + sender: string + poolId: Long + poolShares?: Coin } export interface MsgExitPoolResponse { - tokensOut: Coin[]; + tokensOut: Coin[] } export interface MsgSwapAssets { - sender: string; - poolId: Long; - tokenIn?: Coin; - tokenOutDenom: string; + sender: string + poolId: Long + tokenIn?: Coin + tokenOutDenom: string } export interface MsgSwapAssetsResponse { - tokenOut?: Coin; + tokenOut?: Coin } function createBaseMsgCreatePool(): MsgCreatePool { - return { creator: "", poolParams: undefined, poolAssets: [] }; + return { creator: "", poolParams: undefined, poolAssets: [] } } export const MsgCreatePool = { encode(message: MsgCreatePool, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.creator !== "") { - writer.uint32(10).string(message.creator); + writer.uint32(10).string(message.creator) } if (message.poolParams !== undefined) { - PoolParams.encode(message.poolParams, writer.uint32(18).fork()).ldelim(); + PoolParams.encode(message.poolParams, writer.uint32(18).fork()).ldelim() } for (const v of message.poolAssets) { - PoolAsset.encode(v!, writer.uint32(26).fork()).ldelim(); + PoolAsset.encode(v!, writer.uint32(26).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreatePool { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgCreatePool(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgCreatePool() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.creator = reader.string(); - break; + message.creator = reader.string() + break case 2: - message.poolParams = PoolParams.decode(reader, reader.uint32()); - break; + message.poolParams = PoolParams.decode(reader, reader.uint32()) + break case 3: - message.poolAssets.push(PoolAsset.decode(reader, reader.uint32())); - break; + message.poolAssets.push(PoolAsset.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): MsgCreatePool { return { creator: isSet(object.creator) ? String(object.creator) : "", - poolParams: isSet(object.poolParams) ? PoolParams.fromJSON(object.poolParams) : undefined, - poolAssets: Array.isArray(object?.poolAssets) ? object.poolAssets.map((e: any) => PoolAsset.fromJSON(e)) : [], - }; + poolParams: isSet(object.poolParams) + ? PoolParams.fromJSON(object.poolParams) + : undefined, + poolAssets: Array.isArray(object?.poolAssets) + ? object.poolAssets.map((e: any) => PoolAsset.fromJSON(e)) + : [], + } }, toJSON(message: MsgCreatePool): unknown { - const obj: any = {}; - message.creator !== undefined && (obj.creator = message.creator); + const obj: any = {} + message.creator !== undefined && (obj.creator = message.creator) message.poolParams !== undefined && - (obj.poolParams = message.poolParams ? PoolParams.toJSON(message.poolParams) : undefined); + (obj.poolParams = message.poolParams + ? PoolParams.toJSON(message.poolParams) + : undefined) if (message.poolAssets) { - obj.poolAssets = message.poolAssets.map((e) => e ? PoolAsset.toJSON(e) : undefined); + obj.poolAssets = message.poolAssets.map((e) => + e ? PoolAsset.toJSON(e) : undefined, + ) } else { - obj.poolAssets = []; + obj.poolAssets = [] } - return obj; + return obj }, - fromPartial, I>>(object: I): MsgCreatePool { - const message = createBaseMsgCreatePool(); - message.creator = object.creator ?? ""; - message.poolParams = (object.poolParams !== undefined && object.poolParams !== null) - ? PoolParams.fromPartial(object.poolParams) - : undefined; - message.poolAssets = object.poolAssets?.map((e) => PoolAsset.fromPartial(e)) || []; - return message; + fromPartial, I>>( + object: I, + ): MsgCreatePool { + const message = createBaseMsgCreatePool() + message.creator = object.creator ?? "" + message.poolParams = + object.poolParams !== undefined && object.poolParams !== null + ? PoolParams.fromPartial(object.poolParams) + : undefined + message.poolAssets = object.poolAssets?.map((e) => PoolAsset.fromPartial(e)) || [] + return message }, -}; +} function createBaseMsgCreatePoolResponse(): MsgCreatePoolResponse { - return { poolId: Long.UZERO }; + return { poolId: Long.UZERO } } export const MsgCreatePoolResponse = { - encode(message: MsgCreatePoolResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: MsgCreatePoolResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (!message.poolId.isZero()) { - writer.uint32(8).uint64(message.poolId); + writer.uint32(8).uint64(message.poolId) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreatePoolResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgCreatePoolResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgCreatePoolResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.poolId = reader.uint64() as Long; - break; + message.poolId = reader.uint64() as Long + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): MsgCreatePoolResponse { - return { poolId: isSet(object.poolId) ? Long.fromValue(object.poolId) : Long.UZERO }; + return { + poolId: isSet(object.poolId) ? Long.fromValue(object.poolId) : Long.UZERO, + } }, toJSON(message: MsgCreatePoolResponse): unknown { - const obj: any = {}; - message.poolId !== undefined && (obj.poolId = (message.poolId || Long.UZERO).toString()); - return obj; - }, - - fromPartial, I>>(object: I): MsgCreatePoolResponse { - const message = createBaseMsgCreatePoolResponse(); - message.poolId = (object.poolId !== undefined && object.poolId !== null) - ? Long.fromValue(object.poolId) - : Long.UZERO; - return message; + const obj: any = {} + message.poolId !== undefined && + (obj.poolId = (message.poolId || Long.UZERO).toString()) + return obj + }, + + fromPartial, I>>( + object: I, + ): MsgCreatePoolResponse { + const message = createBaseMsgCreatePoolResponse() + message.poolId = + object.poolId !== undefined && object.poolId !== null + ? Long.fromValue(object.poolId) + : Long.UZERO + return message }, -}; +} function createBaseMsgJoinPool(): MsgJoinPool { - return { sender: "", poolId: Long.UZERO, tokensIn: [], useAllCoins: false }; + return { sender: "", poolId: Long.UZERO, tokensIn: [], useAllCoins: false } } export const MsgJoinPool = { encode(message: MsgJoinPool, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.sender !== "") { - writer.uint32(10).string(message.sender); + writer.uint32(10).string(message.sender) } if (!message.poolId.isZero()) { - writer.uint32(16).uint64(message.poolId); + writer.uint32(16).uint64(message.poolId) } for (const v of message.tokensIn) { - Coin.encode(v!, writer.uint32(26).fork()).ldelim(); + Coin.encode(v!, writer.uint32(26).fork()).ldelim() } if (message.useAllCoins === true) { - writer.uint32(32).bool(message.useAllCoins); + writer.uint32(32).bool(message.useAllCoins) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MsgJoinPool { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgJoinPool(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgJoinPool() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.sender = reader.string(); - break; + message.sender = reader.string() + break case 2: - message.poolId = reader.uint64() as Long; - break; + message.poolId = reader.uint64() as Long + break case 3: - message.tokensIn.push(Coin.decode(reader, reader.uint32())); - break; + message.tokensIn.push(Coin.decode(reader, reader.uint32())) + break case 4: - message.useAllCoins = reader.bool(); - break; + message.useAllCoins = reader.bool() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): MsgJoinPool { return { sender: isSet(object.sender) ? String(object.sender) : "", poolId: isSet(object.poolId) ? Long.fromValue(object.poolId) : Long.UZERO, - tokensIn: Array.isArray(object?.tokensIn) ? object.tokensIn.map((e: any) => Coin.fromJSON(e)) : [], + tokensIn: Array.isArray(object?.tokensIn) + ? object.tokensIn.map((e: any) => Coin.fromJSON(e)) + : [], useAllCoins: isSet(object.useAllCoins) ? Boolean(object.useAllCoins) : false, - }; + } }, toJSON(message: MsgJoinPool): unknown { - const obj: any = {}; - message.sender !== undefined && (obj.sender = message.sender); - message.poolId !== undefined && (obj.poolId = (message.poolId || Long.UZERO).toString()); + const obj: any = {} + message.sender !== undefined && (obj.sender = message.sender) + message.poolId !== undefined && + (obj.poolId = (message.poolId || Long.UZERO).toString()) if (message.tokensIn) { - obj.tokensIn = message.tokensIn.map((e) => e ? Coin.toJSON(e) : undefined); + obj.tokensIn = message.tokensIn.map((e) => (e ? Coin.toJSON(e) : undefined)) } else { - obj.tokensIn = []; + obj.tokensIn = [] } - message.useAllCoins !== undefined && (obj.useAllCoins = message.useAllCoins); - return obj; + message.useAllCoins !== undefined && (obj.useAllCoins = message.useAllCoins) + return obj }, fromPartial, I>>(object: I): MsgJoinPool { - const message = createBaseMsgJoinPool(); - message.sender = object.sender ?? ""; - message.poolId = (object.poolId !== undefined && object.poolId !== null) - ? Long.fromValue(object.poolId) - : Long.UZERO; - message.tokensIn = object.tokensIn?.map((e) => Coin.fromPartial(e)) || []; - message.useAllCoins = object.useAllCoins ?? false; - return message; + const message = createBaseMsgJoinPool() + message.sender = object.sender ?? "" + message.poolId = + object.poolId !== undefined && object.poolId !== null + ? Long.fromValue(object.poolId) + : Long.UZERO + message.tokensIn = object.tokensIn?.map((e) => Coin.fromPartial(e)) || [] + message.useAllCoins = object.useAllCoins ?? false + return message }, -}; +} function createBaseMsgJoinPoolResponse(): MsgJoinPoolResponse { - return { pool: undefined, numPoolSharesOut: undefined, remainingCoins: [] }; + return { pool: undefined, numPoolSharesOut: undefined, remainingCoins: [] } } export const MsgJoinPoolResponse = { - encode(message: MsgJoinPoolResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: MsgJoinPoolResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.pool !== undefined) { - Pool.encode(message.pool, writer.uint32(10).fork()).ldelim(); + Pool.encode(message.pool, writer.uint32(10).fork()).ldelim() } if (message.numPoolSharesOut !== undefined) { - Coin.encode(message.numPoolSharesOut, writer.uint32(18).fork()).ldelim(); + Coin.encode(message.numPoolSharesOut, writer.uint32(18).fork()).ldelim() } for (const v of message.remainingCoins) { - Coin.encode(v!, writer.uint32(26).fork()).ldelim(); + Coin.encode(v!, writer.uint32(26).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MsgJoinPoolResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgJoinPoolResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgJoinPoolResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.pool = Pool.decode(reader, reader.uint32()); - break; + message.pool = Pool.decode(reader, reader.uint32()) + break case 2: - message.numPoolSharesOut = Coin.decode(reader, reader.uint32()); - break; + message.numPoolSharesOut = Coin.decode(reader, reader.uint32()) + break case 3: - message.remainingCoins.push(Coin.decode(reader, reader.uint32())); - break; + message.remainingCoins.push(Coin.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): MsgJoinPoolResponse { return { pool: isSet(object.pool) ? Pool.fromJSON(object.pool) : undefined, - numPoolSharesOut: isSet(object.numPoolSharesOut) ? Coin.fromJSON(object.numPoolSharesOut) : undefined, + numPoolSharesOut: isSet(object.numPoolSharesOut) + ? Coin.fromJSON(object.numPoolSharesOut) + : undefined, remainingCoins: Array.isArray(object?.remainingCoins) ? object.remainingCoins.map((e: any) => Coin.fromJSON(e)) : [], - }; + } }, toJSON(message: MsgJoinPoolResponse): unknown { - const obj: any = {}; - message.pool !== undefined && (obj.pool = message.pool ? Pool.toJSON(message.pool) : undefined); + const obj: any = {} + message.pool !== undefined && + (obj.pool = message.pool ? Pool.toJSON(message.pool) : undefined) message.numPoolSharesOut !== undefined && - (obj.numPoolSharesOut = message.numPoolSharesOut ? Coin.toJSON(message.numPoolSharesOut) : undefined); + (obj.numPoolSharesOut = message.numPoolSharesOut + ? Coin.toJSON(message.numPoolSharesOut) + : undefined) if (message.remainingCoins) { - obj.remainingCoins = message.remainingCoins.map((e) => e ? Coin.toJSON(e) : undefined); + obj.remainingCoins = message.remainingCoins.map((e) => + e ? Coin.toJSON(e) : undefined, + ) } else { - obj.remainingCoins = []; - } - return obj; - }, - - fromPartial, I>>(object: I): MsgJoinPoolResponse { - const message = createBaseMsgJoinPoolResponse(); - message.pool = (object.pool !== undefined && object.pool !== null) ? Pool.fromPartial(object.pool) : undefined; - message.numPoolSharesOut = (object.numPoolSharesOut !== undefined && object.numPoolSharesOut !== null) - ? Coin.fromPartial(object.numPoolSharesOut) - : undefined; - message.remainingCoins = object.remainingCoins?.map((e) => Coin.fromPartial(e)) || []; - return message; + obj.remainingCoins = [] + } + return obj + }, + + fromPartial, I>>( + object: I, + ): MsgJoinPoolResponse { + const message = createBaseMsgJoinPoolResponse() + message.pool = + object.pool !== undefined && object.pool !== null + ? Pool.fromPartial(object.pool) + : undefined + message.numPoolSharesOut = + object.numPoolSharesOut !== undefined && object.numPoolSharesOut !== null + ? Coin.fromPartial(object.numPoolSharesOut) + : undefined + message.remainingCoins = + object.remainingCoins?.map((e) => Coin.fromPartial(e)) || [] + return message }, -}; +} function createBaseMsgExitPool(): MsgExitPool { - return { sender: "", poolId: Long.UZERO, poolShares: undefined }; + return { sender: "", poolId: Long.UZERO, poolShares: undefined } } export const MsgExitPool = { encode(message: MsgExitPool, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.sender !== "") { - writer.uint32(10).string(message.sender); + writer.uint32(10).string(message.sender) } if (!message.poolId.isZero()) { - writer.uint32(16).uint64(message.poolId); + writer.uint32(16).uint64(message.poolId) } if (message.poolShares !== undefined) { - Coin.encode(message.poolShares, writer.uint32(26).fork()).ldelim(); + Coin.encode(message.poolShares, writer.uint32(26).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MsgExitPool { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgExitPool(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgExitPool() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.sender = reader.string(); - break; + message.sender = reader.string() + break case 2: - message.poolId = reader.uint64() as Long; - break; + message.poolId = reader.uint64() as Long + break case 3: - message.poolShares = Coin.decode(reader, reader.uint32()); - break; + message.poolShares = Coin.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): MsgExitPool { return { sender: isSet(object.sender) ? String(object.sender) : "", poolId: isSet(object.poolId) ? Long.fromValue(object.poolId) : Long.UZERO, - poolShares: isSet(object.poolShares) ? Coin.fromJSON(object.poolShares) : undefined, - }; + poolShares: isSet(object.poolShares) + ? Coin.fromJSON(object.poolShares) + : undefined, + } }, toJSON(message: MsgExitPool): unknown { - const obj: any = {}; - message.sender !== undefined && (obj.sender = message.sender); - message.poolId !== undefined && (obj.poolId = (message.poolId || Long.UZERO).toString()); + const obj: any = {} + message.sender !== undefined && (obj.sender = message.sender) + message.poolId !== undefined && + (obj.poolId = (message.poolId || Long.UZERO).toString()) message.poolShares !== undefined && - (obj.poolShares = message.poolShares ? Coin.toJSON(message.poolShares) : undefined); - return obj; + (obj.poolShares = message.poolShares + ? Coin.toJSON(message.poolShares) + : undefined) + return obj }, fromPartial, I>>(object: I): MsgExitPool { - const message = createBaseMsgExitPool(); - message.sender = object.sender ?? ""; - message.poolId = (object.poolId !== undefined && object.poolId !== null) - ? Long.fromValue(object.poolId) - : Long.UZERO; - message.poolShares = (object.poolShares !== undefined && object.poolShares !== null) - ? Coin.fromPartial(object.poolShares) - : undefined; - return message; - }, -}; + const message = createBaseMsgExitPool() + message.sender = object.sender ?? "" + message.poolId = + object.poolId !== undefined && object.poolId !== null + ? Long.fromValue(object.poolId) + : Long.UZERO + message.poolShares = + object.poolShares !== undefined && object.poolShares !== null + ? Coin.fromPartial(object.poolShares) + : undefined + return message + }, +} function createBaseMsgExitPoolResponse(): MsgExitPoolResponse { - return { tokensOut: [] }; + return { tokensOut: [] } } export const MsgExitPoolResponse = { - encode(message: MsgExitPoolResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: MsgExitPoolResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { for (const v of message.tokensOut) { - Coin.encode(v!, writer.uint32(26).fork()).ldelim(); + Coin.encode(v!, writer.uint32(26).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MsgExitPoolResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgExitPoolResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgExitPoolResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 3: - message.tokensOut.push(Coin.decode(reader, reader.uint32())); - break; + message.tokensOut.push(Coin.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): MsgExitPoolResponse { - return { tokensOut: Array.isArray(object?.tokensOut) ? object.tokensOut.map((e: any) => Coin.fromJSON(e)) : [] }; + return { + tokensOut: Array.isArray(object?.tokensOut) + ? object.tokensOut.map((e: any) => Coin.fromJSON(e)) + : [], + } }, toJSON(message: MsgExitPoolResponse): unknown { - const obj: any = {}; + const obj: any = {} if (message.tokensOut) { - obj.tokensOut = message.tokensOut.map((e) => e ? Coin.toJSON(e) : undefined); + obj.tokensOut = message.tokensOut.map((e) => (e ? Coin.toJSON(e) : undefined)) } else { - obj.tokensOut = []; + obj.tokensOut = [] } - return obj; + return obj }, - fromPartial, I>>(object: I): MsgExitPoolResponse { - const message = createBaseMsgExitPoolResponse(); - message.tokensOut = object.tokensOut?.map((e) => Coin.fromPartial(e)) || []; - return message; + fromPartial, I>>( + object: I, + ): MsgExitPoolResponse { + const message = createBaseMsgExitPoolResponse() + message.tokensOut = object.tokensOut?.map((e) => Coin.fromPartial(e)) || [] + return message }, -}; +} function createBaseMsgSwapAssets(): MsgSwapAssets { - return { sender: "", poolId: Long.UZERO, tokenIn: undefined, tokenOutDenom: "" }; + return { sender: "", poolId: Long.UZERO, tokenIn: undefined, tokenOutDenom: "" } } export const MsgSwapAssets = { encode(message: MsgSwapAssets, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.sender !== "") { - writer.uint32(10).string(message.sender); + writer.uint32(10).string(message.sender) } if (!message.poolId.isZero()) { - writer.uint32(16).uint64(message.poolId); + writer.uint32(16).uint64(message.poolId) } if (message.tokenIn !== undefined) { - Coin.encode(message.tokenIn, writer.uint32(26).fork()).ldelim(); + Coin.encode(message.tokenIn, writer.uint32(26).fork()).ldelim() } if (message.tokenOutDenom !== "") { - writer.uint32(34).string(message.tokenOutDenom); + writer.uint32(34).string(message.tokenOutDenom) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MsgSwapAssets { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgSwapAssets(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgSwapAssets() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.sender = reader.string(); - break; + message.sender = reader.string() + break case 2: - message.poolId = reader.uint64() as Long; - break; + message.poolId = reader.uint64() as Long + break case 3: - message.tokenIn = Coin.decode(reader, reader.uint32()); - break; + message.tokenIn = Coin.decode(reader, reader.uint32()) + break case 4: - message.tokenOutDenom = reader.string(); - break; + message.tokenOutDenom = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): MsgSwapAssets { @@ -513,148 +570,173 @@ export const MsgSwapAssets = { poolId: isSet(object.poolId) ? Long.fromValue(object.poolId) : Long.UZERO, tokenIn: isSet(object.tokenIn) ? Coin.fromJSON(object.tokenIn) : undefined, tokenOutDenom: isSet(object.tokenOutDenom) ? String(object.tokenOutDenom) : "", - }; + } }, toJSON(message: MsgSwapAssets): unknown { - const obj: any = {}; - message.sender !== undefined && (obj.sender = message.sender); - message.poolId !== undefined && (obj.poolId = (message.poolId || Long.UZERO).toString()); - message.tokenIn !== undefined && (obj.tokenIn = message.tokenIn ? Coin.toJSON(message.tokenIn) : undefined); - message.tokenOutDenom !== undefined && (obj.tokenOutDenom = message.tokenOutDenom); - return obj; - }, - - fromPartial, I>>(object: I): MsgSwapAssets { - const message = createBaseMsgSwapAssets(); - message.sender = object.sender ?? ""; - message.poolId = (object.poolId !== undefined && object.poolId !== null) - ? Long.fromValue(object.poolId) - : Long.UZERO; - message.tokenIn = (object.tokenIn !== undefined && object.tokenIn !== null) - ? Coin.fromPartial(object.tokenIn) - : undefined; - message.tokenOutDenom = object.tokenOutDenom ?? ""; - return message; - }, -}; + const obj: any = {} + message.sender !== undefined && (obj.sender = message.sender) + message.poolId !== undefined && + (obj.poolId = (message.poolId || Long.UZERO).toString()) + message.tokenIn !== undefined && + (obj.tokenIn = message.tokenIn ? Coin.toJSON(message.tokenIn) : undefined) + message.tokenOutDenom !== undefined && (obj.tokenOutDenom = message.tokenOutDenom) + return obj + }, + + fromPartial, I>>( + object: I, + ): MsgSwapAssets { + const message = createBaseMsgSwapAssets() + message.sender = object.sender ?? "" + message.poolId = + object.poolId !== undefined && object.poolId !== null + ? Long.fromValue(object.poolId) + : Long.UZERO + message.tokenIn = + object.tokenIn !== undefined && object.tokenIn !== null + ? Coin.fromPartial(object.tokenIn) + : undefined + message.tokenOutDenom = object.tokenOutDenom ?? "" + return message + }, +} function createBaseMsgSwapAssetsResponse(): MsgSwapAssetsResponse { - return { tokenOut: undefined }; + return { tokenOut: undefined } } export const MsgSwapAssetsResponse = { - encode(message: MsgSwapAssetsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: MsgSwapAssetsResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.tokenOut !== undefined) { - Coin.encode(message.tokenOut, writer.uint32(26).fork()).ldelim(); + Coin.encode(message.tokenOut, writer.uint32(26).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MsgSwapAssetsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgSwapAssetsResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgSwapAssetsResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 3: - message.tokenOut = Coin.decode(reader, reader.uint32()); - break; + message.tokenOut = Coin.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): MsgSwapAssetsResponse { - return { tokenOut: isSet(object.tokenOut) ? Coin.fromJSON(object.tokenOut) : undefined }; + return { + tokenOut: isSet(object.tokenOut) ? Coin.fromJSON(object.tokenOut) : undefined, + } }, toJSON(message: MsgSwapAssetsResponse): unknown { - const obj: any = {}; - message.tokenOut !== undefined && (obj.tokenOut = message.tokenOut ? Coin.toJSON(message.tokenOut) : undefined); - return obj; - }, - - fromPartial, I>>(object: I): MsgSwapAssetsResponse { - const message = createBaseMsgSwapAssetsResponse(); - message.tokenOut = (object.tokenOut !== undefined && object.tokenOut !== null) - ? Coin.fromPartial(object.tokenOut) - : undefined; - return message; + const obj: any = {} + message.tokenOut !== undefined && + (obj.tokenOut = message.tokenOut ? Coin.toJSON(message.tokenOut) : undefined) + return obj + }, + + fromPartial, I>>( + object: I, + ): MsgSwapAssetsResponse { + const message = createBaseMsgSwapAssetsResponse() + message.tokenOut = + object.tokenOut !== undefined && object.tokenOut !== null + ? Coin.fromPartial(object.tokenOut) + : undefined + return message }, -}; +} /** Msg defines the Msg service. */ export interface Msg { /** Used to create a pool. */ - CreatePool(request: MsgCreatePool): Promise; + CreatePool(request: MsgCreatePool): Promise /** Join a pool as a liquidity provider. */ - JoinPool(request: MsgJoinPool): Promise; + JoinPool(request: MsgJoinPool): Promise /** Exit a pool position by returning LP shares */ - ExitPool(request: MsgExitPool): Promise; + ExitPool(request: MsgExitPool): Promise /** Swap assets in a pool */ - SwapAssets(request: MsgSwapAssets): Promise; + SwapAssets(request: MsgSwapAssets): Promise } export class MsgClientImpl implements Msg { - private readonly rpc: Rpc; + private readonly rpc: Rpc constructor(rpc: Rpc) { - this.rpc = rpc; - this.CreatePool = this.CreatePool.bind(this); - this.JoinPool = this.JoinPool.bind(this); - this.ExitPool = this.ExitPool.bind(this); - this.SwapAssets = this.SwapAssets.bind(this); + this.rpc = rpc + this.CreatePool = this.CreatePool.bind(this) + this.JoinPool = this.JoinPool.bind(this) + this.ExitPool = this.ExitPool.bind(this) + this.SwapAssets = this.SwapAssets.bind(this) } CreatePool(request: MsgCreatePool): Promise { - const data = MsgCreatePool.encode(request).finish(); - const promise = this.rpc.request("nibiru.spot.v1.Msg", "CreatePool", data); - return promise.then((data) => MsgCreatePoolResponse.decode(new _m0.Reader(data))); + const data = MsgCreatePool.encode(request).finish() + const promise = this.rpc.request("nibiru.spot.v1.Msg", "CreatePool", data) + return promise.then((data) => MsgCreatePoolResponse.decode(new _m0.Reader(data))) } JoinPool(request: MsgJoinPool): Promise { - const data = MsgJoinPool.encode(request).finish(); - const promise = this.rpc.request("nibiru.spot.v1.Msg", "JoinPool", data); - return promise.then((data) => MsgJoinPoolResponse.decode(new _m0.Reader(data))); + const data = MsgJoinPool.encode(request).finish() + const promise = this.rpc.request("nibiru.spot.v1.Msg", "JoinPool", data) + return promise.then((data) => MsgJoinPoolResponse.decode(new _m0.Reader(data))) } ExitPool(request: MsgExitPool): Promise { - const data = MsgExitPool.encode(request).finish(); - const promise = this.rpc.request("nibiru.spot.v1.Msg", "ExitPool", data); - return promise.then((data) => MsgExitPoolResponse.decode(new _m0.Reader(data))); + const data = MsgExitPool.encode(request).finish() + const promise = this.rpc.request("nibiru.spot.v1.Msg", "ExitPool", data) + return promise.then((data) => MsgExitPoolResponse.decode(new _m0.Reader(data))) } SwapAssets(request: MsgSwapAssets): Promise { - const data = MsgSwapAssets.encode(request).finish(); - const promise = this.rpc.request("nibiru.spot.v1.Msg", "SwapAssets", data); - return promise.then((data) => MsgSwapAssetsResponse.decode(new _m0.Reader(data))); + const data = MsgSwapAssets.encode(request).finish() + const promise = this.rpc.request("nibiru.spot.v1.Msg", "SwapAssets", data) + return promise.then((data) => MsgSwapAssetsResponse.decode(new _m0.Reader(data))) } } interface Rpc { - request(service: string, method: string, data: Uint8Array): Promise; + request(service: string, method: string, data: Uint8Array): Promise } -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/stablecoin/events.ts b/packages/protojs/src/stablecoin/events.ts index c1b8fdc9..1092bdbb 100644 --- a/packages/protojs/src/stablecoin/events.ts +++ b/packages/protojs/src/stablecoin/events.ts @@ -1,86 +1,86 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { Coin } from "../cosmos/base/v1beta1/coin"; +import { Coin } from "../cosmos/base/v1beta1/coin" +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "nibiru.stablecoin.v1"; +export const protobufPackage = "nibiru.stablecoin.v1" export interface EventTransfer { - coin?: Coin; - from: string; - to: string; + coin?: Coin + from: string + to: string } export interface EventMintStable { - amount: string; + amount: string } export interface EventBurnStable { - amount: string; + amount: string } export interface EventMintNIBI { - amount: string; + amount: string } export interface EventBurnNIBI { - amount: string; + amount: string } export interface EventRecollateralize { - caller: string; - inCoin?: Coin; - outCoin?: Coin; - collRatio: string; + caller: string + inCoin?: Coin + outCoin?: Coin + collRatio: string } export interface EventBuyback { - caller: string; - inCoin?: Coin; - outCoin?: Coin; - collRatio: string; + caller: string + inCoin?: Coin + outCoin?: Coin + collRatio: string } function createBaseEventTransfer(): EventTransfer { - return { coin: undefined, from: "", to: "" }; + return { coin: undefined, from: "", to: "" } } export const EventTransfer = { encode(message: EventTransfer, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.coin !== undefined) { - Coin.encode(message.coin, writer.uint32(10).fork()).ldelim(); + Coin.encode(message.coin, writer.uint32(10).fork()).ldelim() } if (message.from !== "") { - writer.uint32(18).string(message.from); + writer.uint32(18).string(message.from) } if (message.to !== "") { - writer.uint32(26).string(message.to); + writer.uint32(26).string(message.to) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): EventTransfer { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseEventTransfer(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseEventTransfer() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.coin = Coin.decode(reader, reader.uint32()); - break; + message.coin = Coin.decode(reader, reader.uint32()) + break case 2: - message.from = reader.string(); - break; + message.from = reader.string() + break case 3: - message.to = reader.string(); - break; + message.to = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): EventTransfer { @@ -88,260 +88,291 @@ export const EventTransfer = { coin: isSet(object.coin) ? Coin.fromJSON(object.coin) : undefined, from: isSet(object.from) ? String(object.from) : "", to: isSet(object.to) ? String(object.to) : "", - }; + } }, toJSON(message: EventTransfer): unknown { - const obj: any = {}; - message.coin !== undefined && (obj.coin = message.coin ? Coin.toJSON(message.coin) : undefined); - message.from !== undefined && (obj.from = message.from); - message.to !== undefined && (obj.to = message.to); - return obj; - }, - - fromPartial, I>>(object: I): EventTransfer { - const message = createBaseEventTransfer(); - message.coin = (object.coin !== undefined && object.coin !== null) ? Coin.fromPartial(object.coin) : undefined; - message.from = object.from ?? ""; - message.to = object.to ?? ""; - return message; + const obj: any = {} + message.coin !== undefined && + (obj.coin = message.coin ? Coin.toJSON(message.coin) : undefined) + message.from !== undefined && (obj.from = message.from) + message.to !== undefined && (obj.to = message.to) + return obj + }, + + fromPartial, I>>( + object: I, + ): EventTransfer { + const message = createBaseEventTransfer() + message.coin = + object.coin !== undefined && object.coin !== null + ? Coin.fromPartial(object.coin) + : undefined + message.from = object.from ?? "" + message.to = object.to ?? "" + return message }, -}; +} function createBaseEventMintStable(): EventMintStable { - return { amount: "" }; + return { amount: "" } } export const EventMintStable = { - encode(message: EventMintStable, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: EventMintStable, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.amount !== "") { - writer.uint32(10).string(message.amount); + writer.uint32(10).string(message.amount) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): EventMintStable { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseEventMintStable(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseEventMintStable() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.amount = reader.string(); - break; + message.amount = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): EventMintStable { - return { amount: isSet(object.amount) ? String(object.amount) : "" }; + return { + amount: isSet(object.amount) ? String(object.amount) : "", + } }, toJSON(message: EventMintStable): unknown { - const obj: any = {}; - message.amount !== undefined && (obj.amount = message.amount); - return obj; + const obj: any = {} + message.amount !== undefined && (obj.amount = message.amount) + return obj }, - fromPartial, I>>(object: I): EventMintStable { - const message = createBaseEventMintStable(); - message.amount = object.amount ?? ""; - return message; + fromPartial, I>>( + object: I, + ): EventMintStable { + const message = createBaseEventMintStable() + message.amount = object.amount ?? "" + return message }, -}; +} function createBaseEventBurnStable(): EventBurnStable { - return { amount: "" }; + return { amount: "" } } export const EventBurnStable = { - encode(message: EventBurnStable, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: EventBurnStable, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.amount !== "") { - writer.uint32(10).string(message.amount); + writer.uint32(10).string(message.amount) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): EventBurnStable { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseEventBurnStable(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseEventBurnStable() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.amount = reader.string(); - break; + message.amount = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): EventBurnStable { - return { amount: isSet(object.amount) ? String(object.amount) : "" }; + return { + amount: isSet(object.amount) ? String(object.amount) : "", + } }, toJSON(message: EventBurnStable): unknown { - const obj: any = {}; - message.amount !== undefined && (obj.amount = message.amount); - return obj; + const obj: any = {} + message.amount !== undefined && (obj.amount = message.amount) + return obj }, - fromPartial, I>>(object: I): EventBurnStable { - const message = createBaseEventBurnStable(); - message.amount = object.amount ?? ""; - return message; + fromPartial, I>>( + object: I, + ): EventBurnStable { + const message = createBaseEventBurnStable() + message.amount = object.amount ?? "" + return message }, -}; +} function createBaseEventMintNIBI(): EventMintNIBI { - return { amount: "" }; + return { amount: "" } } export const EventMintNIBI = { encode(message: EventMintNIBI, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.amount !== "") { - writer.uint32(10).string(message.amount); + writer.uint32(10).string(message.amount) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): EventMintNIBI { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseEventMintNIBI(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseEventMintNIBI() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.amount = reader.string(); - break; + message.amount = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): EventMintNIBI { - return { amount: isSet(object.amount) ? String(object.amount) : "" }; + return { + amount: isSet(object.amount) ? String(object.amount) : "", + } }, toJSON(message: EventMintNIBI): unknown { - const obj: any = {}; - message.amount !== undefined && (obj.amount = message.amount); - return obj; + const obj: any = {} + message.amount !== undefined && (obj.amount = message.amount) + return obj }, - fromPartial, I>>(object: I): EventMintNIBI { - const message = createBaseEventMintNIBI(); - message.amount = object.amount ?? ""; - return message; + fromPartial, I>>( + object: I, + ): EventMintNIBI { + const message = createBaseEventMintNIBI() + message.amount = object.amount ?? "" + return message }, -}; +} function createBaseEventBurnNIBI(): EventBurnNIBI { - return { amount: "" }; + return { amount: "" } } export const EventBurnNIBI = { encode(message: EventBurnNIBI, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.amount !== "") { - writer.uint32(10).string(message.amount); + writer.uint32(10).string(message.amount) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): EventBurnNIBI { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseEventBurnNIBI(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseEventBurnNIBI() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.amount = reader.string(); - break; + message.amount = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): EventBurnNIBI { - return { amount: isSet(object.amount) ? String(object.amount) : "" }; + return { + amount: isSet(object.amount) ? String(object.amount) : "", + } }, toJSON(message: EventBurnNIBI): unknown { - const obj: any = {}; - message.amount !== undefined && (obj.amount = message.amount); - return obj; + const obj: any = {} + message.amount !== undefined && (obj.amount = message.amount) + return obj }, - fromPartial, I>>(object: I): EventBurnNIBI { - const message = createBaseEventBurnNIBI(); - message.amount = object.amount ?? ""; - return message; + fromPartial, I>>( + object: I, + ): EventBurnNIBI { + const message = createBaseEventBurnNIBI() + message.amount = object.amount ?? "" + return message }, -}; +} function createBaseEventRecollateralize(): EventRecollateralize { - return { caller: "", inCoin: undefined, outCoin: undefined, collRatio: "" }; + return { caller: "", inCoin: undefined, outCoin: undefined, collRatio: "" } } export const EventRecollateralize = { - encode(message: EventRecollateralize, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: EventRecollateralize, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.caller !== "") { - writer.uint32(10).string(message.caller); + writer.uint32(10).string(message.caller) } if (message.inCoin !== undefined) { - Coin.encode(message.inCoin, writer.uint32(18).fork()).ldelim(); + Coin.encode(message.inCoin, writer.uint32(18).fork()).ldelim() } if (message.outCoin !== undefined) { - Coin.encode(message.outCoin, writer.uint32(26).fork()).ldelim(); + Coin.encode(message.outCoin, writer.uint32(26).fork()).ldelim() } if (message.collRatio !== "") { - writer.uint32(34).string(message.collRatio); + writer.uint32(34).string(message.collRatio) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): EventRecollateralize { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseEventRecollateralize(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseEventRecollateralize() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.caller = reader.string(); - break; + message.caller = reader.string() + break case 2: - message.inCoin = Coin.decode(reader, reader.uint32()); - break; + message.inCoin = Coin.decode(reader, reader.uint32()) + break case 3: - message.outCoin = Coin.decode(reader, reader.uint32()); - break; + message.outCoin = Coin.decode(reader, reader.uint32()) + break case 4: - message.collRatio = reader.string(); - break; + message.collRatio = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): EventRecollateralize { @@ -350,78 +381,84 @@ export const EventRecollateralize = { inCoin: isSet(object.inCoin) ? Coin.fromJSON(object.inCoin) : undefined, outCoin: isSet(object.outCoin) ? Coin.fromJSON(object.outCoin) : undefined, collRatio: isSet(object.collRatio) ? String(object.collRatio) : "", - }; + } }, toJSON(message: EventRecollateralize): unknown { - const obj: any = {}; - message.caller !== undefined && (obj.caller = message.caller); - message.inCoin !== undefined && (obj.inCoin = message.inCoin ? Coin.toJSON(message.inCoin) : undefined); - message.outCoin !== undefined && (obj.outCoin = message.outCoin ? Coin.toJSON(message.outCoin) : undefined); - message.collRatio !== undefined && (obj.collRatio = message.collRatio); - return obj; - }, - - fromPartial, I>>(object: I): EventRecollateralize { - const message = createBaseEventRecollateralize(); - message.caller = object.caller ?? ""; - message.inCoin = (object.inCoin !== undefined && object.inCoin !== null) - ? Coin.fromPartial(object.inCoin) - : undefined; - message.outCoin = (object.outCoin !== undefined && object.outCoin !== null) - ? Coin.fromPartial(object.outCoin) - : undefined; - message.collRatio = object.collRatio ?? ""; - return message; - }, -}; + const obj: any = {} + message.caller !== undefined && (obj.caller = message.caller) + message.inCoin !== undefined && + (obj.inCoin = message.inCoin ? Coin.toJSON(message.inCoin) : undefined) + message.outCoin !== undefined && + (obj.outCoin = message.outCoin ? Coin.toJSON(message.outCoin) : undefined) + message.collRatio !== undefined && (obj.collRatio = message.collRatio) + return obj + }, + + fromPartial, I>>( + object: I, + ): EventRecollateralize { + const message = createBaseEventRecollateralize() + message.caller = object.caller ?? "" + message.inCoin = + object.inCoin !== undefined && object.inCoin !== null + ? Coin.fromPartial(object.inCoin) + : undefined + message.outCoin = + object.outCoin !== undefined && object.outCoin !== null + ? Coin.fromPartial(object.outCoin) + : undefined + message.collRatio = object.collRatio ?? "" + return message + }, +} function createBaseEventBuyback(): EventBuyback { - return { caller: "", inCoin: undefined, outCoin: undefined, collRatio: "" }; + return { caller: "", inCoin: undefined, outCoin: undefined, collRatio: "" } } export const EventBuyback = { encode(message: EventBuyback, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.caller !== "") { - writer.uint32(10).string(message.caller); + writer.uint32(10).string(message.caller) } if (message.inCoin !== undefined) { - Coin.encode(message.inCoin, writer.uint32(18).fork()).ldelim(); + Coin.encode(message.inCoin, writer.uint32(18).fork()).ldelim() } if (message.outCoin !== undefined) { - Coin.encode(message.outCoin, writer.uint32(26).fork()).ldelim(); + Coin.encode(message.outCoin, writer.uint32(26).fork()).ldelim() } if (message.collRatio !== "") { - writer.uint32(34).string(message.collRatio); + writer.uint32(34).string(message.collRatio) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): EventBuyback { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseEventBuyback(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseEventBuyback() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.caller = reader.string(); - break; + message.caller = reader.string() + break case 2: - message.inCoin = Coin.decode(reader, reader.uint32()); - break; + message.inCoin = Coin.decode(reader, reader.uint32()) + break case 3: - message.outCoin = Coin.decode(reader, reader.uint32()); - break; + message.outCoin = Coin.decode(reader, reader.uint32()) + break case 4: - message.collRatio = reader.string(); - break; + message.collRatio = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): EventBuyback { @@ -430,49 +467,63 @@ export const EventBuyback = { inCoin: isSet(object.inCoin) ? Coin.fromJSON(object.inCoin) : undefined, outCoin: isSet(object.outCoin) ? Coin.fromJSON(object.outCoin) : undefined, collRatio: isSet(object.collRatio) ? String(object.collRatio) : "", - }; + } }, toJSON(message: EventBuyback): unknown { - const obj: any = {}; - message.caller !== undefined && (obj.caller = message.caller); - message.inCoin !== undefined && (obj.inCoin = message.inCoin ? Coin.toJSON(message.inCoin) : undefined); - message.outCoin !== undefined && (obj.outCoin = message.outCoin ? Coin.toJSON(message.outCoin) : undefined); - message.collRatio !== undefined && (obj.collRatio = message.collRatio); - return obj; + const obj: any = {} + message.caller !== undefined && (obj.caller = message.caller) + message.inCoin !== undefined && + (obj.inCoin = message.inCoin ? Coin.toJSON(message.inCoin) : undefined) + message.outCoin !== undefined && + (obj.outCoin = message.outCoin ? Coin.toJSON(message.outCoin) : undefined) + message.collRatio !== undefined && (obj.collRatio = message.collRatio) + return obj }, fromPartial, I>>(object: I): EventBuyback { - const message = createBaseEventBuyback(); - message.caller = object.caller ?? ""; - message.inCoin = (object.inCoin !== undefined && object.inCoin !== null) - ? Coin.fromPartial(object.inCoin) - : undefined; - message.outCoin = (object.outCoin !== undefined && object.outCoin !== null) - ? Coin.fromPartial(object.outCoin) - : undefined; - message.collRatio = object.collRatio ?? ""; - return message; - }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; + const message = createBaseEventBuyback() + message.caller = object.caller ?? "" + message.inCoin = + object.inCoin !== undefined && object.inCoin !== null + ? Coin.fromPartial(object.inCoin) + : undefined + message.outCoin = + object.outCoin !== undefined && object.outCoin !== null + ? Coin.fromPartial(object.outCoin) + : undefined + message.collRatio = object.collRatio ?? "" + return message + }, +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/stablecoin/genesis.ts b/packages/protojs/src/stablecoin/genesis.ts index f1dfc9fc..0bdfe670 100644 --- a/packages/protojs/src/stablecoin/genesis.ts +++ b/packages/protojs/src/stablecoin/genesis.ts @@ -1,97 +1,114 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { Coin } from "../cosmos/base/v1beta1/coin"; -import { Params } from "./params"; +import { Params } from "./params" +import { Coin } from "../cosmos/base/v1beta1/coin" +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "nibiru.stablecoin.v1"; +export const protobufPackage = "nibiru.stablecoin.v1" /** GenesisState defines the stablecoin module's genesis state. */ export interface GenesisState { - params?: Params; - moduleAccountBalance?: Coin; + params?: Params + moduleAccountBalance?: Coin } function createBaseGenesisState(): GenesisState { - return { params: undefined, moduleAccountBalance: undefined }; + return { params: undefined, moduleAccountBalance: undefined } } export const GenesisState = { encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.params !== undefined) { - Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + Params.encode(message.params, writer.uint32(10).fork()).ldelim() } if (message.moduleAccountBalance !== undefined) { - Coin.encode(message.moduleAccountBalance, writer.uint32(18).fork()).ldelim(); + Coin.encode(message.moduleAccountBalance, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGenesisState(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseGenesisState() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.params = Params.decode(reader, reader.uint32()); - break; + message.params = Params.decode(reader, reader.uint32()) + break case 2: - message.moduleAccountBalance = Coin.decode(reader, reader.uint32()); - break; + message.moduleAccountBalance = Coin.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): GenesisState { return { params: isSet(object.params) ? Params.fromJSON(object.params) : undefined, - moduleAccountBalance: isSet(object.moduleAccountBalance) ? Coin.fromJSON(object.moduleAccountBalance) : undefined, - }; + moduleAccountBalance: isSet(object.moduleAccountBalance) + ? Coin.fromJSON(object.moduleAccountBalance) + : undefined, + } }, toJSON(message: GenesisState): unknown { - const obj: any = {}; - message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + const obj: any = {} + message.params !== undefined && + (obj.params = message.params ? Params.toJSON(message.params) : undefined) message.moduleAccountBalance !== undefined && - (obj.moduleAccountBalance = message.moduleAccountBalance ? Coin.toJSON(message.moduleAccountBalance) : undefined); - return obj; + (obj.moduleAccountBalance = message.moduleAccountBalance + ? Coin.toJSON(message.moduleAccountBalance) + : undefined) + return obj }, fromPartial, I>>(object: I): GenesisState { - const message = createBaseGenesisState(); - message.params = (object.params !== undefined && object.params !== null) - ? Params.fromPartial(object.params) - : undefined; - message.moduleAccountBalance = (object.moduleAccountBalance !== undefined && object.moduleAccountBalance !== null) - ? Coin.fromPartial(object.moduleAccountBalance) - : undefined; - return message; + const message = createBaseGenesisState() + message.params = + object.params !== undefined && object.params !== null + ? Params.fromPartial(object.params) + : undefined + message.moduleAccountBalance = + object.moduleAccountBalance !== undefined && object.moduleAccountBalance !== null + ? Coin.fromPartial(object.moduleAccountBalance) + : undefined + return message }, -}; +} -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/stablecoin/params.ts b/packages/protojs/src/stablecoin/params.ts index 3785931a..c52da222 100644 --- a/packages/protojs/src/stablecoin/params.ts +++ b/packages/protojs/src/stablecoin/params.ts @@ -1,32 +1,32 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "nibiru.stablecoin.v1"; +export const protobufPackage = "nibiru.stablecoin.v1" /** Params defines the parameters for the module. */ export interface Params { /** collRatio is the ratio needed as collateral to exchange for stables */ - collRatio: Long; + collRatio: Long /** feeRatio is the ratio taken as fees when minting or burning stables */ - feeRatio: Long; + feeRatio: Long /** efFeeRatio is the ratio taken from the fees that goes to Ecosystem Fund */ - efFeeRatio: Long; + efFeeRatio: Long /** * BonusRateRecoll is the percentage of extra stablecoin value given to the caller * of 'Recollateralize' in units of governance tokens. */ - bonusRateRecoll: Long; + bonusRateRecoll: Long /** distr_epoch_identifier defines the frequnecy of update for the collateral ratio */ - distrEpochIdentifier: string; + distrEpochIdentifier: string /** adjustmentStep is the size of the step taken when updating the collateral ratio */ - adjustmentStep: Long; + adjustmentStep: Long /** priceLowerBound is the lower bound for the stable coin to trigger a collateral ratio update */ - priceLowerBound: Long; + priceLowerBound: Long /** priceUpperBound is the upper bound for the stable coin to trigger a collateral ratio update */ - priceUpperBound: Long; + priceUpperBound: Long /** isCollateralRatioValid checks if the collateral ratio is correctly updated */ - isCollateralRatioValid: boolean; + isCollateralRatioValid: boolean } function createBaseParams(): Params { @@ -40,157 +40,197 @@ function createBaseParams(): Params { priceLowerBound: Long.ZERO, priceUpperBound: Long.ZERO, isCollateralRatioValid: false, - }; + } } export const Params = { encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (!message.collRatio.isZero()) { - writer.uint32(8).int64(message.collRatio); + writer.uint32(8).int64(message.collRatio) } if (!message.feeRatio.isZero()) { - writer.uint32(16).int64(message.feeRatio); + writer.uint32(16).int64(message.feeRatio) } if (!message.efFeeRatio.isZero()) { - writer.uint32(24).int64(message.efFeeRatio); + writer.uint32(24).int64(message.efFeeRatio) } if (!message.bonusRateRecoll.isZero()) { - writer.uint32(32).int64(message.bonusRateRecoll); + writer.uint32(32).int64(message.bonusRateRecoll) } if (message.distrEpochIdentifier !== "") { - writer.uint32(42).string(message.distrEpochIdentifier); + writer.uint32(42).string(message.distrEpochIdentifier) } if (!message.adjustmentStep.isZero()) { - writer.uint32(48).int64(message.adjustmentStep); + writer.uint32(48).int64(message.adjustmentStep) } if (!message.priceLowerBound.isZero()) { - writer.uint32(56).int64(message.priceLowerBound); + writer.uint32(56).int64(message.priceLowerBound) } if (!message.priceUpperBound.isZero()) { - writer.uint32(64).int64(message.priceUpperBound); + writer.uint32(64).int64(message.priceUpperBound) } if (message.isCollateralRatioValid === true) { - writer.uint32(72).bool(message.isCollateralRatioValid); + writer.uint32(72).bool(message.isCollateralRatioValid) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Params { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseParams(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseParams() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.collRatio = reader.int64() as Long; - break; + message.collRatio = reader.int64() as Long + break case 2: - message.feeRatio = reader.int64() as Long; - break; + message.feeRatio = reader.int64() as Long + break case 3: - message.efFeeRatio = reader.int64() as Long; - break; + message.efFeeRatio = reader.int64() as Long + break case 4: - message.bonusRateRecoll = reader.int64() as Long; - break; + message.bonusRateRecoll = reader.int64() as Long + break case 5: - message.distrEpochIdentifier = reader.string(); - break; + message.distrEpochIdentifier = reader.string() + break case 6: - message.adjustmentStep = reader.int64() as Long; - break; + message.adjustmentStep = reader.int64() as Long + break case 7: - message.priceLowerBound = reader.int64() as Long; - break; + message.priceLowerBound = reader.int64() as Long + break case 8: - message.priceUpperBound = reader.int64() as Long; - break; + message.priceUpperBound = reader.int64() as Long + break case 9: - message.isCollateralRatioValid = reader.bool(); - break; + message.isCollateralRatioValid = reader.bool() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Params { return { collRatio: isSet(object.collRatio) ? Long.fromValue(object.collRatio) : Long.ZERO, feeRatio: isSet(object.feeRatio) ? Long.fromValue(object.feeRatio) : Long.ZERO, - efFeeRatio: isSet(object.efFeeRatio) ? Long.fromValue(object.efFeeRatio) : Long.ZERO, - bonusRateRecoll: isSet(object.bonusRateRecoll) ? Long.fromValue(object.bonusRateRecoll) : Long.ZERO, - distrEpochIdentifier: isSet(object.distrEpochIdentifier) ? String(object.distrEpochIdentifier) : "", - adjustmentStep: isSet(object.adjustmentStep) ? Long.fromValue(object.adjustmentStep) : Long.ZERO, - priceLowerBound: isSet(object.priceLowerBound) ? Long.fromValue(object.priceLowerBound) : Long.ZERO, - priceUpperBound: isSet(object.priceUpperBound) ? Long.fromValue(object.priceUpperBound) : Long.ZERO, - isCollateralRatioValid: isSet(object.isCollateralRatioValid) ? Boolean(object.isCollateralRatioValid) : false, - }; + efFeeRatio: isSet(object.efFeeRatio) + ? Long.fromValue(object.efFeeRatio) + : Long.ZERO, + bonusRateRecoll: isSet(object.bonusRateRecoll) + ? Long.fromValue(object.bonusRateRecoll) + : Long.ZERO, + distrEpochIdentifier: isSet(object.distrEpochIdentifier) + ? String(object.distrEpochIdentifier) + : "", + adjustmentStep: isSet(object.adjustmentStep) + ? Long.fromValue(object.adjustmentStep) + : Long.ZERO, + priceLowerBound: isSet(object.priceLowerBound) + ? Long.fromValue(object.priceLowerBound) + : Long.ZERO, + priceUpperBound: isSet(object.priceUpperBound) + ? Long.fromValue(object.priceUpperBound) + : Long.ZERO, + isCollateralRatioValid: isSet(object.isCollateralRatioValid) + ? Boolean(object.isCollateralRatioValid) + : false, + } }, toJSON(message: Params): unknown { - const obj: any = {}; - message.collRatio !== undefined && (obj.collRatio = (message.collRatio || Long.ZERO).toString()); - message.feeRatio !== undefined && (obj.feeRatio = (message.feeRatio || Long.ZERO).toString()); - message.efFeeRatio !== undefined && (obj.efFeeRatio = (message.efFeeRatio || Long.ZERO).toString()); - message.bonusRateRecoll !== undefined && (obj.bonusRateRecoll = (message.bonusRateRecoll || Long.ZERO).toString()); - message.distrEpochIdentifier !== undefined && (obj.distrEpochIdentifier = message.distrEpochIdentifier); - message.adjustmentStep !== undefined && (obj.adjustmentStep = (message.adjustmentStep || Long.ZERO).toString()); - message.priceLowerBound !== undefined && (obj.priceLowerBound = (message.priceLowerBound || Long.ZERO).toString()); - message.priceUpperBound !== undefined && (obj.priceUpperBound = (message.priceUpperBound || Long.ZERO).toString()); - message.isCollateralRatioValid !== undefined && (obj.isCollateralRatioValid = message.isCollateralRatioValid); - return obj; + const obj: any = {} + message.collRatio !== undefined && + (obj.collRatio = (message.collRatio || Long.ZERO).toString()) + message.feeRatio !== undefined && + (obj.feeRatio = (message.feeRatio || Long.ZERO).toString()) + message.efFeeRatio !== undefined && + (obj.efFeeRatio = (message.efFeeRatio || Long.ZERO).toString()) + message.bonusRateRecoll !== undefined && + (obj.bonusRateRecoll = (message.bonusRateRecoll || Long.ZERO).toString()) + message.distrEpochIdentifier !== undefined && + (obj.distrEpochIdentifier = message.distrEpochIdentifier) + message.adjustmentStep !== undefined && + (obj.adjustmentStep = (message.adjustmentStep || Long.ZERO).toString()) + message.priceLowerBound !== undefined && + (obj.priceLowerBound = (message.priceLowerBound || Long.ZERO).toString()) + message.priceUpperBound !== undefined && + (obj.priceUpperBound = (message.priceUpperBound || Long.ZERO).toString()) + message.isCollateralRatioValid !== undefined && + (obj.isCollateralRatioValid = message.isCollateralRatioValid) + return obj }, fromPartial, I>>(object: I): Params { - const message = createBaseParams(); - message.collRatio = (object.collRatio !== undefined && object.collRatio !== null) - ? Long.fromValue(object.collRatio) - : Long.ZERO; - message.feeRatio = (object.feeRatio !== undefined && object.feeRatio !== null) - ? Long.fromValue(object.feeRatio) - : Long.ZERO; - message.efFeeRatio = (object.efFeeRatio !== undefined && object.efFeeRatio !== null) - ? Long.fromValue(object.efFeeRatio) - : Long.ZERO; - message.bonusRateRecoll = (object.bonusRateRecoll !== undefined && object.bonusRateRecoll !== null) - ? Long.fromValue(object.bonusRateRecoll) - : Long.ZERO; - message.distrEpochIdentifier = object.distrEpochIdentifier ?? ""; - message.adjustmentStep = (object.adjustmentStep !== undefined && object.adjustmentStep !== null) - ? Long.fromValue(object.adjustmentStep) - : Long.ZERO; - message.priceLowerBound = (object.priceLowerBound !== undefined && object.priceLowerBound !== null) - ? Long.fromValue(object.priceLowerBound) - : Long.ZERO; - message.priceUpperBound = (object.priceUpperBound !== undefined && object.priceUpperBound !== null) - ? Long.fromValue(object.priceUpperBound) - : Long.ZERO; - message.isCollateralRatioValid = object.isCollateralRatioValid ?? false; - return message; + const message = createBaseParams() + message.collRatio = + object.collRatio !== undefined && object.collRatio !== null + ? Long.fromValue(object.collRatio) + : Long.ZERO + message.feeRatio = + object.feeRatio !== undefined && object.feeRatio !== null + ? Long.fromValue(object.feeRatio) + : Long.ZERO + message.efFeeRatio = + object.efFeeRatio !== undefined && object.efFeeRatio !== null + ? Long.fromValue(object.efFeeRatio) + : Long.ZERO + message.bonusRateRecoll = + object.bonusRateRecoll !== undefined && object.bonusRateRecoll !== null + ? Long.fromValue(object.bonusRateRecoll) + : Long.ZERO + message.distrEpochIdentifier = object.distrEpochIdentifier ?? "" + message.adjustmentStep = + object.adjustmentStep !== undefined && object.adjustmentStep !== null + ? Long.fromValue(object.adjustmentStep) + : Long.ZERO + message.priceLowerBound = + object.priceLowerBound !== undefined && object.priceLowerBound !== null + ? Long.fromValue(object.priceLowerBound) + : Long.ZERO + message.priceUpperBound = + object.priceUpperBound !== undefined && object.priceUpperBound !== null + ? Long.fromValue(object.priceUpperBound) + : Long.ZERO + message.isCollateralRatioValid = object.isCollateralRatioValid ?? false + return message }, -}; +} -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/stablecoin/query.ts b/packages/protojs/src/stablecoin/query.ts index 5ea79c28..c52566f5 100644 --- a/packages/protojs/src/stablecoin/query.ts +++ b/packages/protojs/src/stablecoin/query.ts @@ -1,223 +1,241 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { Coin } from "../cosmos/base/v1beta1/coin"; -import { Params } from "./params"; +import { Params } from "./params" +import { Coin } from "../cosmos/base/v1beta1/coin" +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "nibiru.stablecoin.v1"; +export const protobufPackage = "nibiru.stablecoin.v1" /** QueryParamsRequest is request type for the Query/Params RPC method. */ -export interface QueryParamsRequest { -} +export interface QueryParamsRequest {} /** QueryParamsResponse is response type for the Query/Params RPC method. */ export interface QueryParamsResponse { /** params holds all the parameters of this module. */ - params?: Params; + params?: Params } /** * QueryModuleAccountBalances is the request type for the balance of the * x/stablecoin module account. */ -export interface QueryModuleAccountBalances { -} +export interface QueryModuleAccountBalances {} export interface QueryModuleAccountBalancesResponse { /** ModuleAccountBalances is the balance of all coins in the x/stablecoin module. */ - moduleAccountBalances: Coin[]; + moduleAccountBalances: Coin[] } /** * QueryCirculatingSupplies is the request type for the circulating supply of * both NIBI and NUSD. */ -export interface QueryCirculatingSupplies { -} +export interface QueryCirculatingSupplies {} export interface QueryCirculatingSuppliesResponse { - nibi?: Coin; - nusd?: Coin; + nibi?: Coin + nusd?: Coin } /** QueryGovToMintStable is the request type for the Query/GovToMintStable RPC method */ export interface QueryGovToMintStable { - collateral?: Coin; + collateral?: Coin } /** QueryGovToMintStableResponse is the response type for 'QueryGovToMintStable' */ export interface QueryGovToMintStableResponse { - gov?: Coin; + gov?: Coin } export interface LiquidityRatioInfo { - liquidityRatio: string; - upperBand: string; - lowerBand: string; + liquidityRatio: string + upperBand: string + lowerBand: string } -export interface QueryLiquidityRatioInfoRequest { -} +export interface QueryLiquidityRatioInfoRequest {} export interface QueryLiquidityRatioInfoResponse { - info?: LiquidityRatioInfo; + info?: LiquidityRatioInfo } function createBaseQueryParamsRequest(): QueryParamsRequest { - return {}; + return {} } export const QueryParamsRequest = { encode(_: QueryParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryParamsRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryParamsRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(_: any): QueryParamsRequest { - return {}; + return {} }, toJSON(_: QueryParamsRequest): unknown { - const obj: any = {}; - return obj; + const obj: any = {} + return obj }, - fromPartial, I>>(_: I): QueryParamsRequest { - const message = createBaseQueryParamsRequest(); - return message; + fromPartial, I>>( + _: I, + ): QueryParamsRequest { + const message = createBaseQueryParamsRequest() + return message }, -}; +} function createBaseQueryParamsResponse(): QueryParamsResponse { - return { params: undefined }; + return { params: undefined } } export const QueryParamsResponse = { - encode(message: QueryParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryParamsResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.params !== undefined) { - Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + Params.encode(message.params, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryParamsResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryParamsResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.params = Params.decode(reader, reader.uint32()); - break; + message.params = Params.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryParamsResponse { - return { params: isSet(object.params) ? Params.fromJSON(object.params) : undefined }; + return { + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined, + } }, toJSON(message: QueryParamsResponse): unknown { - const obj: any = {}; - message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); - return obj; + const obj: any = {} + message.params !== undefined && + (obj.params = message.params ? Params.toJSON(message.params) : undefined) + return obj }, - fromPartial, I>>(object: I): QueryParamsResponse { - const message = createBaseQueryParamsResponse(); - message.params = (object.params !== undefined && object.params !== null) - ? Params.fromPartial(object.params) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): QueryParamsResponse { + const message = createBaseQueryParamsResponse() + message.params = + object.params !== undefined && object.params !== null + ? Params.fromPartial(object.params) + : undefined + return message }, -}; +} function createBaseQueryModuleAccountBalances(): QueryModuleAccountBalances { - return {}; + return {} } export const QueryModuleAccountBalances = { - encode(_: QueryModuleAccountBalances, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; + encode( + _: QueryModuleAccountBalances, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryModuleAccountBalances { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryModuleAccountBalances(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryModuleAccountBalances() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(_: any): QueryModuleAccountBalances { - return {}; + return {} }, toJSON(_: QueryModuleAccountBalances): unknown { - const obj: any = {}; - return obj; + const obj: any = {} + return obj }, - fromPartial, I>>(_: I): QueryModuleAccountBalances { - const message = createBaseQueryModuleAccountBalances(); - return message; + fromPartial, I>>( + _: I, + ): QueryModuleAccountBalances { + const message = createBaseQueryModuleAccountBalances() + return message }, -}; +} function createBaseQueryModuleAccountBalancesResponse(): QueryModuleAccountBalancesResponse { - return { moduleAccountBalances: [] }; + return { moduleAccountBalances: [] } } export const QueryModuleAccountBalancesResponse = { - encode(message: QueryModuleAccountBalancesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryModuleAccountBalancesResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { for (const v of message.moduleAccountBalances) { - Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + Coin.encode(v!, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryModuleAccountBalancesResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryModuleAccountBalancesResponse(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryModuleAccountBalancesResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryModuleAccountBalancesResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.moduleAccountBalances.push(Coin.decode(reader, reader.uint32())); - break; + message.moduleAccountBalances.push(Coin.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryModuleAccountBalancesResponse { @@ -225,264 +243,315 @@ export const QueryModuleAccountBalancesResponse = { moduleAccountBalances: Array.isArray(object?.moduleAccountBalances) ? object.moduleAccountBalances.map((e: any) => Coin.fromJSON(e)) : [], - }; + } }, toJSON(message: QueryModuleAccountBalancesResponse): unknown { - const obj: any = {}; + const obj: any = {} if (message.moduleAccountBalances) { - obj.moduleAccountBalances = message.moduleAccountBalances.map((e) => e ? Coin.toJSON(e) : undefined); + obj.moduleAccountBalances = message.moduleAccountBalances.map((e) => + e ? Coin.toJSON(e) : undefined, + ) } else { - obj.moduleAccountBalances = []; + obj.moduleAccountBalances = [] } - return obj; + return obj }, fromPartial, I>>( object: I, ): QueryModuleAccountBalancesResponse { - const message = createBaseQueryModuleAccountBalancesResponse(); - message.moduleAccountBalances = object.moduleAccountBalances?.map((e) => Coin.fromPartial(e)) || []; - return message; + const message = createBaseQueryModuleAccountBalancesResponse() + message.moduleAccountBalances = + object.moduleAccountBalances?.map((e) => Coin.fromPartial(e)) || [] + return message }, -}; +} function createBaseQueryCirculatingSupplies(): QueryCirculatingSupplies { - return {}; + return {} } export const QueryCirculatingSupplies = { - encode(_: QueryCirculatingSupplies, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; + encode( + _: QueryCirculatingSupplies, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryCirculatingSupplies { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryCirculatingSupplies(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryCirculatingSupplies() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(_: any): QueryCirculatingSupplies { - return {}; + return {} }, toJSON(_: QueryCirculatingSupplies): unknown { - const obj: any = {}; - return obj; + const obj: any = {} + return obj }, - fromPartial, I>>(_: I): QueryCirculatingSupplies { - const message = createBaseQueryCirculatingSupplies(); - return message; + fromPartial, I>>( + _: I, + ): QueryCirculatingSupplies { + const message = createBaseQueryCirculatingSupplies() + return message }, -}; +} function createBaseQueryCirculatingSuppliesResponse(): QueryCirculatingSuppliesResponse { - return { nibi: undefined, nusd: undefined }; + return { nibi: undefined, nusd: undefined } } export const QueryCirculatingSuppliesResponse = { - encode(message: QueryCirculatingSuppliesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryCirculatingSuppliesResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.nibi !== undefined) { - Coin.encode(message.nibi, writer.uint32(10).fork()).ldelim(); + Coin.encode(message.nibi, writer.uint32(10).fork()).ldelim() } if (message.nusd !== undefined) { - Coin.encode(message.nusd, writer.uint32(18).fork()).ldelim(); + Coin.encode(message.nusd, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryCirculatingSuppliesResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryCirculatingSuppliesResponse(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryCirculatingSuppliesResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryCirculatingSuppliesResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.nibi = Coin.decode(reader, reader.uint32()); - break; + message.nibi = Coin.decode(reader, reader.uint32()) + break case 2: - message.nusd = Coin.decode(reader, reader.uint32()); - break; + message.nusd = Coin.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryCirculatingSuppliesResponse { return { nibi: isSet(object.nibi) ? Coin.fromJSON(object.nibi) : undefined, nusd: isSet(object.nusd) ? Coin.fromJSON(object.nusd) : undefined, - }; + } }, toJSON(message: QueryCirculatingSuppliesResponse): unknown { - const obj: any = {}; - message.nibi !== undefined && (obj.nibi = message.nibi ? Coin.toJSON(message.nibi) : undefined); - message.nusd !== undefined && (obj.nusd = message.nusd ? Coin.toJSON(message.nusd) : undefined); - return obj; + const obj: any = {} + message.nibi !== undefined && + (obj.nibi = message.nibi ? Coin.toJSON(message.nibi) : undefined) + message.nusd !== undefined && + (obj.nusd = message.nusd ? Coin.toJSON(message.nusd) : undefined) + return obj }, fromPartial, I>>( object: I, ): QueryCirculatingSuppliesResponse { - const message = createBaseQueryCirculatingSuppliesResponse(); - message.nibi = (object.nibi !== undefined && object.nibi !== null) ? Coin.fromPartial(object.nibi) : undefined; - message.nusd = (object.nusd !== undefined && object.nusd !== null) ? Coin.fromPartial(object.nusd) : undefined; - return message; + const message = createBaseQueryCirculatingSuppliesResponse() + message.nibi = + object.nibi !== undefined && object.nibi !== null + ? Coin.fromPartial(object.nibi) + : undefined + message.nusd = + object.nusd !== undefined && object.nusd !== null + ? Coin.fromPartial(object.nusd) + : undefined + return message }, -}; +} function createBaseQueryGovToMintStable(): QueryGovToMintStable { - return { collateral: undefined }; + return { collateral: undefined } } export const QueryGovToMintStable = { - encode(message: QueryGovToMintStable, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryGovToMintStable, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.collateral !== undefined) { - Coin.encode(message.collateral, writer.uint32(10).fork()).ldelim(); + Coin.encode(message.collateral, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryGovToMintStable { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryGovToMintStable(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryGovToMintStable() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.collateral = Coin.decode(reader, reader.uint32()); - break; + message.collateral = Coin.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryGovToMintStable { - return { collateral: isSet(object.collateral) ? Coin.fromJSON(object.collateral) : undefined }; + return { + collateral: isSet(object.collateral) + ? Coin.fromJSON(object.collateral) + : undefined, + } }, toJSON(message: QueryGovToMintStable): unknown { - const obj: any = {}; + const obj: any = {} message.collateral !== undefined && - (obj.collateral = message.collateral ? Coin.toJSON(message.collateral) : undefined); - return obj; + (obj.collateral = message.collateral + ? Coin.toJSON(message.collateral) + : undefined) + return obj }, - fromPartial, I>>(object: I): QueryGovToMintStable { - const message = createBaseQueryGovToMintStable(); - message.collateral = (object.collateral !== undefined && object.collateral !== null) - ? Coin.fromPartial(object.collateral) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): QueryGovToMintStable { + const message = createBaseQueryGovToMintStable() + message.collateral = + object.collateral !== undefined && object.collateral !== null + ? Coin.fromPartial(object.collateral) + : undefined + return message }, -}; +} function createBaseQueryGovToMintStableResponse(): QueryGovToMintStableResponse { - return { gov: undefined }; + return { gov: undefined } } export const QueryGovToMintStableResponse = { - encode(message: QueryGovToMintStableResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryGovToMintStableResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.gov !== undefined) { - Coin.encode(message.gov, writer.uint32(10).fork()).ldelim(); + Coin.encode(message.gov, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryGovToMintStableResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryGovToMintStableResponse(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryGovToMintStableResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryGovToMintStableResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.gov = Coin.decode(reader, reader.uint32()); - break; + message.gov = Coin.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryGovToMintStableResponse { - return { gov: isSet(object.gov) ? Coin.fromJSON(object.gov) : undefined }; + return { + gov: isSet(object.gov) ? Coin.fromJSON(object.gov) : undefined, + } }, toJSON(message: QueryGovToMintStableResponse): unknown { - const obj: any = {}; - message.gov !== undefined && (obj.gov = message.gov ? Coin.toJSON(message.gov) : undefined); - return obj; + const obj: any = {} + message.gov !== undefined && + (obj.gov = message.gov ? Coin.toJSON(message.gov) : undefined) + return obj }, - fromPartial, I>>(object: I): QueryGovToMintStableResponse { - const message = createBaseQueryGovToMintStableResponse(); - message.gov = (object.gov !== undefined && object.gov !== null) ? Coin.fromPartial(object.gov) : undefined; - return message; + fromPartial, I>>( + object: I, + ): QueryGovToMintStableResponse { + const message = createBaseQueryGovToMintStableResponse() + message.gov = + object.gov !== undefined && object.gov !== null + ? Coin.fromPartial(object.gov) + : undefined + return message }, -}; +} function createBaseLiquidityRatioInfo(): LiquidityRatioInfo { - return { liquidityRatio: "", upperBand: "", lowerBand: "" }; + return { liquidityRatio: "", upperBand: "", lowerBand: "" } } export const LiquidityRatioInfo = { - encode(message: LiquidityRatioInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: LiquidityRatioInfo, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.liquidityRatio !== "") { - writer.uint32(10).string(message.liquidityRatio); + writer.uint32(10).string(message.liquidityRatio) } if (message.upperBand !== "") { - writer.uint32(18).string(message.upperBand); + writer.uint32(18).string(message.upperBand) } if (message.lowerBand !== "") { - writer.uint32(26).string(message.lowerBand); + writer.uint32(26).string(message.lowerBand) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): LiquidityRatioInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseLiquidityRatioInfo(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseLiquidityRatioInfo() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.liquidityRatio = reader.string(); - break; + message.liquidityRatio = reader.string() + break case 2: - message.upperBand = reader.string(); - break; + message.upperBand = reader.string() + break case 3: - message.lowerBand = reader.string(); - break; + message.lowerBand = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): LiquidityRatioInfo { @@ -490,181 +559,242 @@ export const LiquidityRatioInfo = { liquidityRatio: isSet(object.liquidityRatio) ? String(object.liquidityRatio) : "", upperBand: isSet(object.upperBand) ? String(object.upperBand) : "", lowerBand: isSet(object.lowerBand) ? String(object.lowerBand) : "", - }; + } }, toJSON(message: LiquidityRatioInfo): unknown { - const obj: any = {}; - message.liquidityRatio !== undefined && (obj.liquidityRatio = message.liquidityRatio); - message.upperBand !== undefined && (obj.upperBand = message.upperBand); - message.lowerBand !== undefined && (obj.lowerBand = message.lowerBand); - return obj; + const obj: any = {} + message.liquidityRatio !== undefined && + (obj.liquidityRatio = message.liquidityRatio) + message.upperBand !== undefined && (obj.upperBand = message.upperBand) + message.lowerBand !== undefined && (obj.lowerBand = message.lowerBand) + return obj }, - fromPartial, I>>(object: I): LiquidityRatioInfo { - const message = createBaseLiquidityRatioInfo(); - message.liquidityRatio = object.liquidityRatio ?? ""; - message.upperBand = object.upperBand ?? ""; - message.lowerBand = object.lowerBand ?? ""; - return message; + fromPartial, I>>( + object: I, + ): LiquidityRatioInfo { + const message = createBaseLiquidityRatioInfo() + message.liquidityRatio = object.liquidityRatio ?? "" + message.upperBand = object.upperBand ?? "" + message.lowerBand = object.lowerBand ?? "" + return message }, -}; +} function createBaseQueryLiquidityRatioInfoRequest(): QueryLiquidityRatioInfoRequest { - return {}; + return {} } export const QueryLiquidityRatioInfoRequest = { - encode(_: QueryLiquidityRatioInfoRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): QueryLiquidityRatioInfoRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryLiquidityRatioInfoRequest(); + encode( + _: QueryLiquidityRatioInfoRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryLiquidityRatioInfoRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryLiquidityRatioInfoRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(_: any): QueryLiquidityRatioInfoRequest { - return {}; + return {} }, toJSON(_: QueryLiquidityRatioInfoRequest): unknown { - const obj: any = {}; - return obj; + const obj: any = {} + return obj }, - fromPartial, I>>(_: I): QueryLiquidityRatioInfoRequest { - const message = createBaseQueryLiquidityRatioInfoRequest(); - return message; + fromPartial, I>>( + _: I, + ): QueryLiquidityRatioInfoRequest { + const message = createBaseQueryLiquidityRatioInfoRequest() + return message }, -}; +} function createBaseQueryLiquidityRatioInfoResponse(): QueryLiquidityRatioInfoResponse { - return { info: undefined }; + return { info: undefined } } export const QueryLiquidityRatioInfoResponse = { - encode(message: QueryLiquidityRatioInfoResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryLiquidityRatioInfoResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.info !== undefined) { - LiquidityRatioInfo.encode(message.info, writer.uint32(10).fork()).ldelim(); + LiquidityRatioInfo.encode(message.info, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryLiquidityRatioInfoResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryLiquidityRatioInfoResponse(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryLiquidityRatioInfoResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryLiquidityRatioInfoResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.info = LiquidityRatioInfo.decode(reader, reader.uint32()); - break; + message.info = LiquidityRatioInfo.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryLiquidityRatioInfoResponse { - return { info: isSet(object.info) ? LiquidityRatioInfo.fromJSON(object.info) : undefined }; + return { + info: isSet(object.info) ? LiquidityRatioInfo.fromJSON(object.info) : undefined, + } }, toJSON(message: QueryLiquidityRatioInfoResponse): unknown { - const obj: any = {}; - message.info !== undefined && (obj.info = message.info ? LiquidityRatioInfo.toJSON(message.info) : undefined); - return obj; + const obj: any = {} + message.info !== undefined && + (obj.info = message.info ? LiquidityRatioInfo.toJSON(message.info) : undefined) + return obj }, fromPartial, I>>( object: I, ): QueryLiquidityRatioInfoResponse { - const message = createBaseQueryLiquidityRatioInfoResponse(); - message.info = (object.info !== undefined && object.info !== null) - ? LiquidityRatioInfo.fromPartial(object.info) - : undefined; - return message; + const message = createBaseQueryLiquidityRatioInfoResponse() + message.info = + object.info !== undefined && object.info !== null + ? LiquidityRatioInfo.fromPartial(object.info) + : undefined + return message }, -}; +} /** Query defines the gRPC querier service. */ export interface Query { /** Parameters queries the parameters of the x/stablecoin module. */ - Params(request: QueryParamsRequest): Promise; + Params(request: QueryParamsRequest): Promise /** ModuleAccountBalances queries the account balance of x/stablecoin. */ - ModuleAccountBalances(request: QueryModuleAccountBalances): Promise; - CirculatingSupplies(request: QueryCirculatingSupplies): Promise; - LiquidityRatioInfo(request: QueryLiquidityRatioInfoRequest): Promise; + ModuleAccountBalances( + request: QueryModuleAccountBalances, + ): Promise + CirculatingSupplies( + request: QueryCirculatingSupplies, + ): Promise + LiquidityRatioInfo( + request: QueryLiquidityRatioInfoRequest, + ): Promise } export class QueryClientImpl implements Query { - private readonly rpc: Rpc; + private readonly rpc: Rpc constructor(rpc: Rpc) { - this.rpc = rpc; - this.Params = this.Params.bind(this); - this.ModuleAccountBalances = this.ModuleAccountBalances.bind(this); - this.CirculatingSupplies = this.CirculatingSupplies.bind(this); - this.LiquidityRatioInfo = this.LiquidityRatioInfo.bind(this); + this.rpc = rpc + this.Params = this.Params.bind(this) + this.ModuleAccountBalances = this.ModuleAccountBalances.bind(this) + this.CirculatingSupplies = this.CirculatingSupplies.bind(this) + this.LiquidityRatioInfo = this.LiquidityRatioInfo.bind(this) } Params(request: QueryParamsRequest): Promise { - const data = QueryParamsRequest.encode(request).finish(); - const promise = this.rpc.request("nibiru.stablecoin.v1.Query", "Params", data); - return promise.then((data) => QueryParamsResponse.decode(new _m0.Reader(data))); + const data = QueryParamsRequest.encode(request).finish() + const promise = this.rpc.request("nibiru.stablecoin.v1.Query", "Params", data) + return promise.then((data) => QueryParamsResponse.decode(new _m0.Reader(data))) } - ModuleAccountBalances(request: QueryModuleAccountBalances): Promise { - const data = QueryModuleAccountBalances.encode(request).finish(); - const promise = this.rpc.request("nibiru.stablecoin.v1.Query", "ModuleAccountBalances", data); - return promise.then((data) => QueryModuleAccountBalancesResponse.decode(new _m0.Reader(data))); + ModuleAccountBalances( + request: QueryModuleAccountBalances, + ): Promise { + const data = QueryModuleAccountBalances.encode(request).finish() + const promise = this.rpc.request( + "nibiru.stablecoin.v1.Query", + "ModuleAccountBalances", + data, + ) + return promise.then((data) => + QueryModuleAccountBalancesResponse.decode(new _m0.Reader(data)), + ) } - CirculatingSupplies(request: QueryCirculatingSupplies): Promise { - const data = QueryCirculatingSupplies.encode(request).finish(); - const promise = this.rpc.request("nibiru.stablecoin.v1.Query", "CirculatingSupplies", data); - return promise.then((data) => QueryCirculatingSuppliesResponse.decode(new _m0.Reader(data))); + CirculatingSupplies( + request: QueryCirculatingSupplies, + ): Promise { + const data = QueryCirculatingSupplies.encode(request).finish() + const promise = this.rpc.request( + "nibiru.stablecoin.v1.Query", + "CirculatingSupplies", + data, + ) + return promise.then((data) => + QueryCirculatingSuppliesResponse.decode(new _m0.Reader(data)), + ) } - LiquidityRatioInfo(request: QueryLiquidityRatioInfoRequest): Promise { - const data = QueryLiquidityRatioInfoRequest.encode(request).finish(); - const promise = this.rpc.request("nibiru.stablecoin.v1.Query", "LiquidityRatioInfo", data); - return promise.then((data) => QueryLiquidityRatioInfoResponse.decode(new _m0.Reader(data))); + LiquidityRatioInfo( + request: QueryLiquidityRatioInfoRequest, + ): Promise { + const data = QueryLiquidityRatioInfoRequest.encode(request).finish() + const promise = this.rpc.request( + "nibiru.stablecoin.v1.Query", + "LiquidityRatioInfo", + data, + ) + return promise.then((data) => + QueryLiquidityRatioInfoResponse.decode(new _m0.Reader(data)), + ) } } interface Rpc { - request(service: string, method: string, data: Uint8Array): Promise; + request(service: string, method: string, data: Uint8Array): Promise } -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/stablecoin/tx.ts b/packages/protojs/src/stablecoin/tx.ts index 44d8d64e..2ae810d6 100644 --- a/packages/protojs/src/stablecoin/tx.ts +++ b/packages/protojs/src/stablecoin/tx.ts @@ -1,9 +1,9 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { Coin } from "../cosmos/base/v1beta1/coin"; +import { Coin } from "../cosmos/base/v1beta1/coin" +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "nibiru.stablecoin.v1"; +export const protobufPackage = "nibiru.stablecoin.v1" /** * MsgMintStable: Msg to mint NUSD. A user deposits NIBI and collateral and gets @@ -11,8 +11,8 @@ export const protobufPackage = "nibiru.stablecoin.v1"; * by the oracle library and the current collateral ratio for the protocol. */ export interface MsgMintStable { - creator: string; - stable?: Coin; + creator: string + stable?: Coin } /** @@ -20,9 +20,9 @@ export interface MsgMintStable { * mint transaction */ export interface MsgMintStableResponse { - stable?: Coin; - usedCoins: Coin[]; - feesPayed: Coin[]; + stable?: Coin + usedCoins: Coin[] + feesPayed: Coin[] } /** @@ -31,8 +31,8 @@ export interface MsgMintStableResponse { * the x/oracle library and the current collateral ratio. */ export interface MsgBurnStable { - creator: string; - stable?: Coin; + creator: string + stable?: Coin } /** @@ -40,519 +40,589 @@ export interface MsgBurnStable { * token the user will receive after their burn transaction. */ export interface MsgBurnStableResponse { - collateral?: Coin; - gov?: Coin; - feesPayed: Coin[]; + collateral?: Coin + gov?: Coin + feesPayed: Coin[] } /** MsgRecollateralize */ export interface MsgRecollateralize { - creator: string; - coll?: Coin; + creator: string + coll?: Coin } /** MsgRecollateralizeResponse is the output of a successful 'Recollateralize' */ export interface MsgRecollateralizeResponse { /** Gov (sdk.Coin): Tokens rewarded to the caller in exchange for her collateral. */ - gov?: Coin; + gov?: Coin } /** MsgBuyback */ export interface MsgBuyback { - creator: string; + creator: string /** * Gov (sdk.Coin): Tokens the caller wants to sell to the protocol in exchange * for collateral. */ - gov?: Coin; + gov?: Coin } /** MsgBuybackResponse is the output of a successful 'Buyback' */ export interface MsgBuybackResponse { /** Coll (sdk.Coin): Tokens sold to the caller in exchange for her collateral. */ - coll?: Coin; + coll?: Coin } function createBaseMsgMintStable(): MsgMintStable { - return { creator: "", stable: undefined }; + return { creator: "", stable: undefined } } export const MsgMintStable = { encode(message: MsgMintStable, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.creator !== "") { - writer.uint32(10).string(message.creator); + writer.uint32(10).string(message.creator) } if (message.stable !== undefined) { - Coin.encode(message.stable, writer.uint32(18).fork()).ldelim(); + Coin.encode(message.stable, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MsgMintStable { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgMintStable(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgMintStable() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.creator = reader.string(); - break; + message.creator = reader.string() + break case 2: - message.stable = Coin.decode(reader, reader.uint32()); - break; + message.stable = Coin.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): MsgMintStable { return { creator: isSet(object.creator) ? String(object.creator) : "", stable: isSet(object.stable) ? Coin.fromJSON(object.stable) : undefined, - }; + } }, toJSON(message: MsgMintStable): unknown { - const obj: any = {}; - message.creator !== undefined && (obj.creator = message.creator); - message.stable !== undefined && (obj.stable = message.stable ? Coin.toJSON(message.stable) : undefined); - return obj; - }, - - fromPartial, I>>(object: I): MsgMintStable { - const message = createBaseMsgMintStable(); - message.creator = object.creator ?? ""; - message.stable = (object.stable !== undefined && object.stable !== null) - ? Coin.fromPartial(object.stable) - : undefined; - return message; + const obj: any = {} + message.creator !== undefined && (obj.creator = message.creator) + message.stable !== undefined && + (obj.stable = message.stable ? Coin.toJSON(message.stable) : undefined) + return obj + }, + + fromPartial, I>>( + object: I, + ): MsgMintStable { + const message = createBaseMsgMintStable() + message.creator = object.creator ?? "" + message.stable = + object.stable !== undefined && object.stable !== null + ? Coin.fromPartial(object.stable) + : undefined + return message }, -}; +} function createBaseMsgMintStableResponse(): MsgMintStableResponse { - return { stable: undefined, usedCoins: [], feesPayed: [] }; + return { stable: undefined, usedCoins: [], feesPayed: [] } } export const MsgMintStableResponse = { - encode(message: MsgMintStableResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: MsgMintStableResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.stable !== undefined) { - Coin.encode(message.stable, writer.uint32(10).fork()).ldelim(); + Coin.encode(message.stable, writer.uint32(10).fork()).ldelim() } for (const v of message.usedCoins) { - Coin.encode(v!, writer.uint32(18).fork()).ldelim(); + Coin.encode(v!, writer.uint32(18).fork()).ldelim() } for (const v of message.feesPayed) { - Coin.encode(v!, writer.uint32(26).fork()).ldelim(); + Coin.encode(v!, writer.uint32(26).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MsgMintStableResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgMintStableResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgMintStableResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.stable = Coin.decode(reader, reader.uint32()); - break; + message.stable = Coin.decode(reader, reader.uint32()) + break case 2: - message.usedCoins.push(Coin.decode(reader, reader.uint32())); - break; + message.usedCoins.push(Coin.decode(reader, reader.uint32())) + break case 3: - message.feesPayed.push(Coin.decode(reader, reader.uint32())); - break; + message.feesPayed.push(Coin.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): MsgMintStableResponse { return { stable: isSet(object.stable) ? Coin.fromJSON(object.stable) : undefined, - usedCoins: Array.isArray(object?.usedCoins) ? object.usedCoins.map((e: any) => Coin.fromJSON(e)) : [], - feesPayed: Array.isArray(object?.feesPayed) ? object.feesPayed.map((e: any) => Coin.fromJSON(e)) : [], - }; + usedCoins: Array.isArray(object?.usedCoins) + ? object.usedCoins.map((e: any) => Coin.fromJSON(e)) + : [], + feesPayed: Array.isArray(object?.feesPayed) + ? object.feesPayed.map((e: any) => Coin.fromJSON(e)) + : [], + } }, toJSON(message: MsgMintStableResponse): unknown { - const obj: any = {}; - message.stable !== undefined && (obj.stable = message.stable ? Coin.toJSON(message.stable) : undefined); + const obj: any = {} + message.stable !== undefined && + (obj.stable = message.stable ? Coin.toJSON(message.stable) : undefined) if (message.usedCoins) { - obj.usedCoins = message.usedCoins.map((e) => e ? Coin.toJSON(e) : undefined); + obj.usedCoins = message.usedCoins.map((e) => (e ? Coin.toJSON(e) : undefined)) } else { - obj.usedCoins = []; + obj.usedCoins = [] } if (message.feesPayed) { - obj.feesPayed = message.feesPayed.map((e) => e ? Coin.toJSON(e) : undefined); + obj.feesPayed = message.feesPayed.map((e) => (e ? Coin.toJSON(e) : undefined)) } else { - obj.feesPayed = []; + obj.feesPayed = [] } - return obj; + return obj }, - fromPartial, I>>(object: I): MsgMintStableResponse { - const message = createBaseMsgMintStableResponse(); - message.stable = (object.stable !== undefined && object.stable !== null) - ? Coin.fromPartial(object.stable) - : undefined; - message.usedCoins = object.usedCoins?.map((e) => Coin.fromPartial(e)) || []; - message.feesPayed = object.feesPayed?.map((e) => Coin.fromPartial(e)) || []; - return message; + fromPartial, I>>( + object: I, + ): MsgMintStableResponse { + const message = createBaseMsgMintStableResponse() + message.stable = + object.stable !== undefined && object.stable !== null + ? Coin.fromPartial(object.stable) + : undefined + message.usedCoins = object.usedCoins?.map((e) => Coin.fromPartial(e)) || [] + message.feesPayed = object.feesPayed?.map((e) => Coin.fromPartial(e)) || [] + return message }, -}; +} function createBaseMsgBurnStable(): MsgBurnStable { - return { creator: "", stable: undefined }; + return { creator: "", stable: undefined } } export const MsgBurnStable = { encode(message: MsgBurnStable, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.creator !== "") { - writer.uint32(10).string(message.creator); + writer.uint32(10).string(message.creator) } if (message.stable !== undefined) { - Coin.encode(message.stable, writer.uint32(18).fork()).ldelim(); + Coin.encode(message.stable, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MsgBurnStable { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgBurnStable(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgBurnStable() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.creator = reader.string(); - break; + message.creator = reader.string() + break case 2: - message.stable = Coin.decode(reader, reader.uint32()); - break; + message.stable = Coin.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): MsgBurnStable { return { creator: isSet(object.creator) ? String(object.creator) : "", stable: isSet(object.stable) ? Coin.fromJSON(object.stable) : undefined, - }; + } }, toJSON(message: MsgBurnStable): unknown { - const obj: any = {}; - message.creator !== undefined && (obj.creator = message.creator); - message.stable !== undefined && (obj.stable = message.stable ? Coin.toJSON(message.stable) : undefined); - return obj; - }, - - fromPartial, I>>(object: I): MsgBurnStable { - const message = createBaseMsgBurnStable(); - message.creator = object.creator ?? ""; - message.stable = (object.stable !== undefined && object.stable !== null) - ? Coin.fromPartial(object.stable) - : undefined; - return message; + const obj: any = {} + message.creator !== undefined && (obj.creator = message.creator) + message.stable !== undefined && + (obj.stable = message.stable ? Coin.toJSON(message.stable) : undefined) + return obj + }, + + fromPartial, I>>( + object: I, + ): MsgBurnStable { + const message = createBaseMsgBurnStable() + message.creator = object.creator ?? "" + message.stable = + object.stable !== undefined && object.stable !== null + ? Coin.fromPartial(object.stable) + : undefined + return message }, -}; +} function createBaseMsgBurnStableResponse(): MsgBurnStableResponse { - return { collateral: undefined, gov: undefined, feesPayed: [] }; + return { collateral: undefined, gov: undefined, feesPayed: [] } } export const MsgBurnStableResponse = { - encode(message: MsgBurnStableResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: MsgBurnStableResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.collateral !== undefined) { - Coin.encode(message.collateral, writer.uint32(10).fork()).ldelim(); + Coin.encode(message.collateral, writer.uint32(10).fork()).ldelim() } if (message.gov !== undefined) { - Coin.encode(message.gov, writer.uint32(18).fork()).ldelim(); + Coin.encode(message.gov, writer.uint32(18).fork()).ldelim() } for (const v of message.feesPayed) { - Coin.encode(v!, writer.uint32(26).fork()).ldelim(); + Coin.encode(v!, writer.uint32(26).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MsgBurnStableResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgBurnStableResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgBurnStableResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.collateral = Coin.decode(reader, reader.uint32()); - break; + message.collateral = Coin.decode(reader, reader.uint32()) + break case 2: - message.gov = Coin.decode(reader, reader.uint32()); - break; + message.gov = Coin.decode(reader, reader.uint32()) + break case 3: - message.feesPayed.push(Coin.decode(reader, reader.uint32())); - break; + message.feesPayed.push(Coin.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): MsgBurnStableResponse { return { - collateral: isSet(object.collateral) ? Coin.fromJSON(object.collateral) : undefined, + collateral: isSet(object.collateral) + ? Coin.fromJSON(object.collateral) + : undefined, gov: isSet(object.gov) ? Coin.fromJSON(object.gov) : undefined, - feesPayed: Array.isArray(object?.feesPayed) ? object.feesPayed.map((e: any) => Coin.fromJSON(e)) : [], - }; + feesPayed: Array.isArray(object?.feesPayed) + ? object.feesPayed.map((e: any) => Coin.fromJSON(e)) + : [], + } }, toJSON(message: MsgBurnStableResponse): unknown { - const obj: any = {}; + const obj: any = {} message.collateral !== undefined && - (obj.collateral = message.collateral ? Coin.toJSON(message.collateral) : undefined); - message.gov !== undefined && (obj.gov = message.gov ? Coin.toJSON(message.gov) : undefined); + (obj.collateral = message.collateral + ? Coin.toJSON(message.collateral) + : undefined) + message.gov !== undefined && + (obj.gov = message.gov ? Coin.toJSON(message.gov) : undefined) if (message.feesPayed) { - obj.feesPayed = message.feesPayed.map((e) => e ? Coin.toJSON(e) : undefined); + obj.feesPayed = message.feesPayed.map((e) => (e ? Coin.toJSON(e) : undefined)) } else { - obj.feesPayed = []; + obj.feesPayed = [] } - return obj; - }, - - fromPartial, I>>(object: I): MsgBurnStableResponse { - const message = createBaseMsgBurnStableResponse(); - message.collateral = (object.collateral !== undefined && object.collateral !== null) - ? Coin.fromPartial(object.collateral) - : undefined; - message.gov = (object.gov !== undefined && object.gov !== null) ? Coin.fromPartial(object.gov) : undefined; - message.feesPayed = object.feesPayed?.map((e) => Coin.fromPartial(e)) || []; - return message; + return obj + }, + + fromPartial, I>>( + object: I, + ): MsgBurnStableResponse { + const message = createBaseMsgBurnStableResponse() + message.collateral = + object.collateral !== undefined && object.collateral !== null + ? Coin.fromPartial(object.collateral) + : undefined + message.gov = + object.gov !== undefined && object.gov !== null + ? Coin.fromPartial(object.gov) + : undefined + message.feesPayed = object.feesPayed?.map((e) => Coin.fromPartial(e)) || [] + return message }, -}; +} function createBaseMsgRecollateralize(): MsgRecollateralize { - return { creator: "", coll: undefined }; + return { creator: "", coll: undefined } } export const MsgRecollateralize = { - encode(message: MsgRecollateralize, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: MsgRecollateralize, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.creator !== "") { - writer.uint32(10).string(message.creator); + writer.uint32(10).string(message.creator) } if (message.coll !== undefined) { - Coin.encode(message.coll, writer.uint32(18).fork()).ldelim(); + Coin.encode(message.coll, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MsgRecollateralize { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgRecollateralize(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgRecollateralize() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.creator = reader.string(); - break; + message.creator = reader.string() + break case 2: - message.coll = Coin.decode(reader, reader.uint32()); - break; + message.coll = Coin.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): MsgRecollateralize { return { creator: isSet(object.creator) ? String(object.creator) : "", coll: isSet(object.coll) ? Coin.fromJSON(object.coll) : undefined, - }; + } }, toJSON(message: MsgRecollateralize): unknown { - const obj: any = {}; - message.creator !== undefined && (obj.creator = message.creator); - message.coll !== undefined && (obj.coll = message.coll ? Coin.toJSON(message.coll) : undefined); - return obj; - }, - - fromPartial, I>>(object: I): MsgRecollateralize { - const message = createBaseMsgRecollateralize(); - message.creator = object.creator ?? ""; - message.coll = (object.coll !== undefined && object.coll !== null) ? Coin.fromPartial(object.coll) : undefined; - return message; + const obj: any = {} + message.creator !== undefined && (obj.creator = message.creator) + message.coll !== undefined && + (obj.coll = message.coll ? Coin.toJSON(message.coll) : undefined) + return obj + }, + + fromPartial, I>>( + object: I, + ): MsgRecollateralize { + const message = createBaseMsgRecollateralize() + message.creator = object.creator ?? "" + message.coll = + object.coll !== undefined && object.coll !== null + ? Coin.fromPartial(object.coll) + : undefined + return message }, -}; +} function createBaseMsgRecollateralizeResponse(): MsgRecollateralizeResponse { - return { gov: undefined }; + return { gov: undefined } } export const MsgRecollateralizeResponse = { - encode(message: MsgRecollateralizeResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: MsgRecollateralizeResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.gov !== undefined) { - Coin.encode(message.gov, writer.uint32(10).fork()).ldelim(); + Coin.encode(message.gov, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MsgRecollateralizeResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgRecollateralizeResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgRecollateralizeResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.gov = Coin.decode(reader, reader.uint32()); - break; + message.gov = Coin.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): MsgRecollateralizeResponse { - return { gov: isSet(object.gov) ? Coin.fromJSON(object.gov) : undefined }; + return { + gov: isSet(object.gov) ? Coin.fromJSON(object.gov) : undefined, + } }, toJSON(message: MsgRecollateralizeResponse): unknown { - const obj: any = {}; - message.gov !== undefined && (obj.gov = message.gov ? Coin.toJSON(message.gov) : undefined); - return obj; + const obj: any = {} + message.gov !== undefined && + (obj.gov = message.gov ? Coin.toJSON(message.gov) : undefined) + return obj + }, + + fromPartial, I>>( + object: I, + ): MsgRecollateralizeResponse { + const message = createBaseMsgRecollateralizeResponse() + message.gov = + object.gov !== undefined && object.gov !== null + ? Coin.fromPartial(object.gov) + : undefined + return message }, - - fromPartial, I>>(object: I): MsgRecollateralizeResponse { - const message = createBaseMsgRecollateralizeResponse(); - message.gov = (object.gov !== undefined && object.gov !== null) ? Coin.fromPartial(object.gov) : undefined; - return message; - }, -}; +} function createBaseMsgBuyback(): MsgBuyback { - return { creator: "", gov: undefined }; + return { creator: "", gov: undefined } } export const MsgBuyback = { encode(message: MsgBuyback, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.creator !== "") { - writer.uint32(10).string(message.creator); + writer.uint32(10).string(message.creator) } if (message.gov !== undefined) { - Coin.encode(message.gov, writer.uint32(18).fork()).ldelim(); + Coin.encode(message.gov, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MsgBuyback { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgBuyback(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgBuyback() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.creator = reader.string(); - break; + message.creator = reader.string() + break case 2: - message.gov = Coin.decode(reader, reader.uint32()); - break; + message.gov = Coin.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): MsgBuyback { return { creator: isSet(object.creator) ? String(object.creator) : "", gov: isSet(object.gov) ? Coin.fromJSON(object.gov) : undefined, - }; + } }, toJSON(message: MsgBuyback): unknown { - const obj: any = {}; - message.creator !== undefined && (obj.creator = message.creator); - message.gov !== undefined && (obj.gov = message.gov ? Coin.toJSON(message.gov) : undefined); - return obj; + const obj: any = {} + message.creator !== undefined && (obj.creator = message.creator) + message.gov !== undefined && + (obj.gov = message.gov ? Coin.toJSON(message.gov) : undefined) + return obj }, fromPartial, I>>(object: I): MsgBuyback { - const message = createBaseMsgBuyback(); - message.creator = object.creator ?? ""; - message.gov = (object.gov !== undefined && object.gov !== null) ? Coin.fromPartial(object.gov) : undefined; - return message; + const message = createBaseMsgBuyback() + message.creator = object.creator ?? "" + message.gov = + object.gov !== undefined && object.gov !== null + ? Coin.fromPartial(object.gov) + : undefined + return message }, -}; +} function createBaseMsgBuybackResponse(): MsgBuybackResponse { - return { coll: undefined }; + return { coll: undefined } } export const MsgBuybackResponse = { - encode(message: MsgBuybackResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: MsgBuybackResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.coll !== undefined) { - Coin.encode(message.coll, writer.uint32(10).fork()).ldelim(); + Coin.encode(message.coll, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MsgBuybackResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgBuybackResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgBuybackResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.coll = Coin.decode(reader, reader.uint32()); - break; + message.coll = Coin.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): MsgBuybackResponse { - return { coll: isSet(object.coll) ? Coin.fromJSON(object.coll) : undefined }; + return { + coll: isSet(object.coll) ? Coin.fromJSON(object.coll) : undefined, + } }, toJSON(message: MsgBuybackResponse): unknown { - const obj: any = {}; - message.coll !== undefined && (obj.coll = message.coll ? Coin.toJSON(message.coll) : undefined); - return obj; - }, - - fromPartial, I>>(object: I): MsgBuybackResponse { - const message = createBaseMsgBuybackResponse(); - message.coll = (object.coll !== undefined && object.coll !== null) ? Coin.fromPartial(object.coll) : undefined; - return message; + const obj: any = {} + message.coll !== undefined && + (obj.coll = message.coll ? Coin.toJSON(message.coll) : undefined) + return obj + }, + + fromPartial, I>>( + object: I, + ): MsgBuybackResponse { + const message = createBaseMsgBuybackResponse() + message.coll = + object.coll !== undefined && object.coll !== null + ? Coin.fromPartial(object.coll) + : undefined + return message }, -}; +} /** Msg defines the x/stablecoin Msg service. */ export interface Msg { @@ -560,82 +630,98 @@ export interface Msg { * MintStable defines a method for trading a mixture of GOV and COLL to mint an * equivalent value of stablecoins. */ - MintStable(request: MsgMintStable): Promise; + MintStable(request: MsgMintStable): Promise /** * BurnStable defines a method for redeeming/burning stablecoins to receive an * equivalent value as a mixture of governance and collateral tokens. */ - BurnStable(request: MsgBurnStable): Promise; + BurnStable(request: MsgBurnStable): Promise /** * Recollateralize defines a method for manually adding collateral to the * protocol in exchange for an equivalent stablecoin value in governance tokens * plus a small bonus. */ - Recollateralize(request: MsgRecollateralize): Promise; + Recollateralize(request: MsgRecollateralize): Promise /** * Buyback defines a method for manually adding NIBI to the protocol * in exchange for an equivalent stablecoin value in collateral, effectively * executing a share buyback for Nibiru Chain. The NIBI purchased by the protocol * is then burned, distributing value to all NIBI hodlers. */ - Buyback(request: MsgBuyback): Promise; + Buyback(request: MsgBuyback): Promise } export class MsgClientImpl implements Msg { - private readonly rpc: Rpc; + private readonly rpc: Rpc constructor(rpc: Rpc) { - this.rpc = rpc; - this.MintStable = this.MintStable.bind(this); - this.BurnStable = this.BurnStable.bind(this); - this.Recollateralize = this.Recollateralize.bind(this); - this.Buyback = this.Buyback.bind(this); + this.rpc = rpc + this.MintStable = this.MintStable.bind(this) + this.BurnStable = this.BurnStable.bind(this) + this.Recollateralize = this.Recollateralize.bind(this) + this.Buyback = this.Buyback.bind(this) } MintStable(request: MsgMintStable): Promise { - const data = MsgMintStable.encode(request).finish(); - const promise = this.rpc.request("nibiru.stablecoin.v1.Msg", "MintStable", data); - return promise.then((data) => MsgMintStableResponse.decode(new _m0.Reader(data))); + const data = MsgMintStable.encode(request).finish() + const promise = this.rpc.request("nibiru.stablecoin.v1.Msg", "MintStable", data) + return promise.then((data) => MsgMintStableResponse.decode(new _m0.Reader(data))) } BurnStable(request: MsgBurnStable): Promise { - const data = MsgBurnStable.encode(request).finish(); - const promise = this.rpc.request("nibiru.stablecoin.v1.Msg", "BurnStable", data); - return promise.then((data) => MsgBurnStableResponse.decode(new _m0.Reader(data))); + const data = MsgBurnStable.encode(request).finish() + const promise = this.rpc.request("nibiru.stablecoin.v1.Msg", "BurnStable", data) + return promise.then((data) => MsgBurnStableResponse.decode(new _m0.Reader(data))) } Recollateralize(request: MsgRecollateralize): Promise { - const data = MsgRecollateralize.encode(request).finish(); - const promise = this.rpc.request("nibiru.stablecoin.v1.Msg", "Recollateralize", data); - return promise.then((data) => MsgRecollateralizeResponse.decode(new _m0.Reader(data))); + const data = MsgRecollateralize.encode(request).finish() + const promise = this.rpc.request( + "nibiru.stablecoin.v1.Msg", + "Recollateralize", + data, + ) + return promise.then((data) => + MsgRecollateralizeResponse.decode(new _m0.Reader(data)), + ) } Buyback(request: MsgBuyback): Promise { - const data = MsgBuyback.encode(request).finish(); - const promise = this.rpc.request("nibiru.stablecoin.v1.Msg", "Buyback", data); - return promise.then((data) => MsgBuybackResponse.decode(new _m0.Reader(data))); + const data = MsgBuyback.encode(request).finish() + const promise = this.rpc.request("nibiru.stablecoin.v1.Msg", "Buyback", data) + return promise.then((data) => MsgBuybackResponse.decode(new _m0.Reader(data))) } } interface Rpc { - request(service: string, method: string, data: Uint8Array): Promise; + request(service: string, method: string, data: Uint8Array): Promise } -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/tendermint/abci/types.ts b/packages/protojs/src/tendermint/abci/types.ts index c383f75a..cbaec1bf 100644 --- a/packages/protojs/src/tendermint/abci/types.ts +++ b/packages/protojs/src/tendermint/abci/types.ts @@ -1,13 +1,13 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { Timestamp } from "../../google/protobuf/timestamp"; -import { PublicKey } from "../crypto/keys"; -import { ProofOps } from "../crypto/proof"; -import { EvidenceParams, ValidatorParams, VersionParams } from "../types/params"; -import { Header } from "../types/types"; +import { Header } from "../types/types" +import { ProofOps } from "../crypto/proof" +import { EvidenceParams, ValidatorParams, VersionParams } from "../types/params" +import { PublicKey } from "../crypto/keys" +import { Timestamp } from "../../google/protobuf/timestamp" +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "tendermint.abci"; +export const protobufPackage = "tendermint.abci" export enum CheckTxType { NEW = 0, @@ -19,26 +19,26 @@ export function checkTxTypeFromJSON(object: any): CheckTxType { switch (object) { case 0: case "NEW": - return CheckTxType.NEW; + return CheckTxType.NEW case 1: case "RECHECK": - return CheckTxType.RECHECK; + return CheckTxType.RECHECK case -1: case "UNRECOGNIZED": default: - return CheckTxType.UNRECOGNIZED; + return CheckTxType.UNRECOGNIZED } } export function checkTxTypeToJSON(object: CheckTxType): string { switch (object) { case CheckTxType.NEW: - return "NEW"; + return "NEW" case CheckTxType.RECHECK: - return "RECHECK"; + return "RECHECK" case CheckTxType.UNRECOGNIZED: default: - return "UNRECOGNIZED"; + return "UNRECOGNIZED" } } @@ -53,259 +53,255 @@ export function evidenceTypeFromJSON(object: any): EvidenceType { switch (object) { case 0: case "UNKNOWN": - return EvidenceType.UNKNOWN; + return EvidenceType.UNKNOWN case 1: case "DUPLICATE_VOTE": - return EvidenceType.DUPLICATE_VOTE; + return EvidenceType.DUPLICATE_VOTE case 2: case "LIGHT_CLIENT_ATTACK": - return EvidenceType.LIGHT_CLIENT_ATTACK; + return EvidenceType.LIGHT_CLIENT_ATTACK case -1: case "UNRECOGNIZED": default: - return EvidenceType.UNRECOGNIZED; + return EvidenceType.UNRECOGNIZED } } export function evidenceTypeToJSON(object: EvidenceType): string { switch (object) { case EvidenceType.UNKNOWN: - return "UNKNOWN"; + return "UNKNOWN" case EvidenceType.DUPLICATE_VOTE: - return "DUPLICATE_VOTE"; + return "DUPLICATE_VOTE" case EvidenceType.LIGHT_CLIENT_ATTACK: - return "LIGHT_CLIENT_ATTACK"; + return "LIGHT_CLIENT_ATTACK" case EvidenceType.UNRECOGNIZED: default: - return "UNRECOGNIZED"; + return "UNRECOGNIZED" } } export interface Request { - echo?: RequestEcho | undefined; - flush?: RequestFlush | undefined; - info?: RequestInfo | undefined; - setOption?: RequestSetOption | undefined; - initChain?: RequestInitChain | undefined; - query?: RequestQuery | undefined; - beginBlock?: RequestBeginBlock | undefined; - checkTx?: RequestCheckTx | undefined; - deliverTx?: RequestDeliverTx | undefined; - endBlock?: RequestEndBlock | undefined; - commit?: RequestCommit | undefined; - listSnapshots?: RequestListSnapshots | undefined; - offerSnapshot?: RequestOfferSnapshot | undefined; - loadSnapshotChunk?: RequestLoadSnapshotChunk | undefined; - applySnapshotChunk?: RequestApplySnapshotChunk | undefined; + echo?: RequestEcho | undefined + flush?: RequestFlush | undefined + info?: RequestInfo | undefined + setOption?: RequestSetOption | undefined + initChain?: RequestInitChain | undefined + query?: RequestQuery | undefined + beginBlock?: RequestBeginBlock | undefined + checkTx?: RequestCheckTx | undefined + deliverTx?: RequestDeliverTx | undefined + endBlock?: RequestEndBlock | undefined + commit?: RequestCommit | undefined + listSnapshots?: RequestListSnapshots | undefined + offerSnapshot?: RequestOfferSnapshot | undefined + loadSnapshotChunk?: RequestLoadSnapshotChunk | undefined + applySnapshotChunk?: RequestApplySnapshotChunk | undefined } export interface RequestEcho { - message: string; + message: string } -export interface RequestFlush { -} +export interface RequestFlush {} export interface RequestInfo { - version: string; - blockVersion: Long; - p2pVersion: Long; + version: string + blockVersion: Long + p2pVersion: Long } /** nondeterministic */ export interface RequestSetOption { - key: string; - value: string; + key: string + value: string } export interface RequestInitChain { - time?: Date; - chainId: string; - consensusParams?: ConsensusParams; - validators: ValidatorUpdate[]; - appStateBytes: Uint8Array; - initialHeight: Long; + time?: Date + chainId: string + consensusParams?: ConsensusParams + validators: ValidatorUpdate[] + appStateBytes: Uint8Array + initialHeight: Long } export interface RequestQuery { - data: Uint8Array; - path: string; - height: Long; - prove: boolean; + data: Uint8Array + path: string + height: Long + prove: boolean } export interface RequestBeginBlock { - hash: Uint8Array; - header?: Header; - lastCommitInfo?: LastCommitInfo; - byzantineValidators: Evidence[]; + hash: Uint8Array + header?: Header + lastCommitInfo?: LastCommitInfo + byzantineValidators: Evidence[] } export interface RequestCheckTx { - tx: Uint8Array; - type: CheckTxType; + tx: Uint8Array + type: CheckTxType } export interface RequestDeliverTx { - tx: Uint8Array; + tx: Uint8Array } export interface RequestEndBlock { - height: Long; + height: Long } -export interface RequestCommit { -} +export interface RequestCommit {} /** lists available snapshots */ -export interface RequestListSnapshots { -} +export interface RequestListSnapshots {} /** offers a snapshot to the application */ export interface RequestOfferSnapshot { /** snapshot offered by peers */ - snapshot?: Snapshot; + snapshot?: Snapshot /** light client-verified app hash for snapshot height */ - appHash: Uint8Array; + appHash: Uint8Array } /** loads a snapshot chunk */ export interface RequestLoadSnapshotChunk { - height: Long; - format: number; - chunk: number; + height: Long + format: number + chunk: number } /** Applies a snapshot chunk */ export interface RequestApplySnapshotChunk { - index: number; - chunk: Uint8Array; - sender: string; + index: number + chunk: Uint8Array + sender: string } export interface Response { - exception?: ResponseException | undefined; - echo?: ResponseEcho | undefined; - flush?: ResponseFlush | undefined; - info?: ResponseInfo | undefined; - setOption?: ResponseSetOption | undefined; - initChain?: ResponseInitChain | undefined; - query?: ResponseQuery | undefined; - beginBlock?: ResponseBeginBlock | undefined; - checkTx?: ResponseCheckTx | undefined; - deliverTx?: ResponseDeliverTx | undefined; - endBlock?: ResponseEndBlock | undefined; - commit?: ResponseCommit | undefined; - listSnapshots?: ResponseListSnapshots | undefined; - offerSnapshot?: ResponseOfferSnapshot | undefined; - loadSnapshotChunk?: ResponseLoadSnapshotChunk | undefined; - applySnapshotChunk?: ResponseApplySnapshotChunk | undefined; + exception?: ResponseException | undefined + echo?: ResponseEcho | undefined + flush?: ResponseFlush | undefined + info?: ResponseInfo | undefined + setOption?: ResponseSetOption | undefined + initChain?: ResponseInitChain | undefined + query?: ResponseQuery | undefined + beginBlock?: ResponseBeginBlock | undefined + checkTx?: ResponseCheckTx | undefined + deliverTx?: ResponseDeliverTx | undefined + endBlock?: ResponseEndBlock | undefined + commit?: ResponseCommit | undefined + listSnapshots?: ResponseListSnapshots | undefined + offerSnapshot?: ResponseOfferSnapshot | undefined + loadSnapshotChunk?: ResponseLoadSnapshotChunk | undefined + applySnapshotChunk?: ResponseApplySnapshotChunk | undefined } /** nondeterministic */ export interface ResponseException { - error: string; + error: string } export interface ResponseEcho { - message: string; + message: string } -export interface ResponseFlush { -} +export interface ResponseFlush {} export interface ResponseInfo { - data: string; - version: string; - appVersion: Long; - lastBlockHeight: Long; - lastBlockAppHash: Uint8Array; + data: string + version: string + appVersion: Long + lastBlockHeight: Long + lastBlockAppHash: Uint8Array } /** nondeterministic */ export interface ResponseSetOption { - code: number; + code: number /** bytes data = 2; */ - log: string; - info: string; + log: string + info: string } export interface ResponseInitChain { - consensusParams?: ConsensusParams; - validators: ValidatorUpdate[]; - appHash: Uint8Array; + consensusParams?: ConsensusParams + validators: ValidatorUpdate[] + appHash: Uint8Array } export interface ResponseQuery { - code: number; + code: number /** bytes data = 2; // use "value" instead. */ - log: string; + log: string /** nondeterministic */ - info: string; - index: Long; - key: Uint8Array; - value: Uint8Array; - proofOps?: ProofOps; - height: Long; - codespace: string; + info: string + index: Long + key: Uint8Array + value: Uint8Array + proofOps?: ProofOps + height: Long + codespace: string } export interface ResponseBeginBlock { - events: Event[]; + events: Event[] } export interface ResponseCheckTx { - code: number; - data: Uint8Array; + code: number + data: Uint8Array /** nondeterministic */ - log: string; + log: string /** nondeterministic */ - info: string; - gasWanted: Long; - gasUsed: Long; - events: Event[]; - codespace: string; - sender: string; - priority: Long; + info: string + gasWanted: Long + gasUsed: Long + events: Event[] + codespace: string + sender: string + priority: Long /** * mempool_error is set by Tendermint. * ABCI applictions creating a ResponseCheckTX should not set mempool_error. */ - mempoolError: string; + mempoolError: string } export interface ResponseDeliverTx { - code: number; - data: Uint8Array; + code: number + data: Uint8Array /** nondeterministic */ - log: string; + log: string /** nondeterministic */ - info: string; - gasWanted: Long; - gasUsed: Long; + info: string + gasWanted: Long + gasUsed: Long /** nondeterministic */ - events: Event[]; - codespace: string; + events: Event[] + codespace: string } export interface ResponseEndBlock { - validatorUpdates: ValidatorUpdate[]; - consensusParamUpdates?: ConsensusParams; - events: Event[]; + validatorUpdates: ValidatorUpdate[] + consensusParamUpdates?: ConsensusParams + events: Event[] } export interface ResponseCommit { /** reserve 1 */ - data: Uint8Array; - retainHeight: Long; + data: Uint8Array + retainHeight: Long } export interface ResponseListSnapshots { - snapshots: Snapshot[]; + snapshots: Snapshot[] } export interface ResponseOfferSnapshot { - result: ResponseOfferSnapshot_Result; + result: ResponseOfferSnapshot_Result } export enum ResponseOfferSnapshot_Result { @@ -324,63 +320,67 @@ export enum ResponseOfferSnapshot_Result { UNRECOGNIZED = -1, } -export function responseOfferSnapshot_ResultFromJSON(object: any): ResponseOfferSnapshot_Result { +export function responseOfferSnapshot_ResultFromJSON( + object: any, +): ResponseOfferSnapshot_Result { switch (object) { case 0: case "UNKNOWN": - return ResponseOfferSnapshot_Result.UNKNOWN; + return ResponseOfferSnapshot_Result.UNKNOWN case 1: case "ACCEPT": - return ResponseOfferSnapshot_Result.ACCEPT; + return ResponseOfferSnapshot_Result.ACCEPT case 2: case "ABORT": - return ResponseOfferSnapshot_Result.ABORT; + return ResponseOfferSnapshot_Result.ABORT case 3: case "REJECT": - return ResponseOfferSnapshot_Result.REJECT; + return ResponseOfferSnapshot_Result.REJECT case 4: case "REJECT_FORMAT": - return ResponseOfferSnapshot_Result.REJECT_FORMAT; + return ResponseOfferSnapshot_Result.REJECT_FORMAT case 5: case "REJECT_SENDER": - return ResponseOfferSnapshot_Result.REJECT_SENDER; + return ResponseOfferSnapshot_Result.REJECT_SENDER case -1: case "UNRECOGNIZED": default: - return ResponseOfferSnapshot_Result.UNRECOGNIZED; + return ResponseOfferSnapshot_Result.UNRECOGNIZED } } -export function responseOfferSnapshot_ResultToJSON(object: ResponseOfferSnapshot_Result): string { +export function responseOfferSnapshot_ResultToJSON( + object: ResponseOfferSnapshot_Result, +): string { switch (object) { case ResponseOfferSnapshot_Result.UNKNOWN: - return "UNKNOWN"; + return "UNKNOWN" case ResponseOfferSnapshot_Result.ACCEPT: - return "ACCEPT"; + return "ACCEPT" case ResponseOfferSnapshot_Result.ABORT: - return "ABORT"; + return "ABORT" case ResponseOfferSnapshot_Result.REJECT: - return "REJECT"; + return "REJECT" case ResponseOfferSnapshot_Result.REJECT_FORMAT: - return "REJECT_FORMAT"; + return "REJECT_FORMAT" case ResponseOfferSnapshot_Result.REJECT_SENDER: - return "REJECT_SENDER"; + return "REJECT_SENDER" case ResponseOfferSnapshot_Result.UNRECOGNIZED: default: - return "UNRECOGNIZED"; + return "UNRECOGNIZED" } } export interface ResponseLoadSnapshotChunk { - chunk: Uint8Array; + chunk: Uint8Array } export interface ResponseApplySnapshotChunk { - result: ResponseApplySnapshotChunk_Result; + result: ResponseApplySnapshotChunk_Result /** Chunks to refetch and reapply */ - refetchChunks: number[]; + refetchChunks: number[] /** Chunk senders to reject and ban */ - rejectSenders: string[]; + rejectSenders: string[] } export enum ResponseApplySnapshotChunk_Result { @@ -399,50 +399,54 @@ export enum ResponseApplySnapshotChunk_Result { UNRECOGNIZED = -1, } -export function responseApplySnapshotChunk_ResultFromJSON(object: any): ResponseApplySnapshotChunk_Result { +export function responseApplySnapshotChunk_ResultFromJSON( + object: any, +): ResponseApplySnapshotChunk_Result { switch (object) { case 0: case "UNKNOWN": - return ResponseApplySnapshotChunk_Result.UNKNOWN; + return ResponseApplySnapshotChunk_Result.UNKNOWN case 1: case "ACCEPT": - return ResponseApplySnapshotChunk_Result.ACCEPT; + return ResponseApplySnapshotChunk_Result.ACCEPT case 2: case "ABORT": - return ResponseApplySnapshotChunk_Result.ABORT; + return ResponseApplySnapshotChunk_Result.ABORT case 3: case "RETRY": - return ResponseApplySnapshotChunk_Result.RETRY; + return ResponseApplySnapshotChunk_Result.RETRY case 4: case "RETRY_SNAPSHOT": - return ResponseApplySnapshotChunk_Result.RETRY_SNAPSHOT; + return ResponseApplySnapshotChunk_Result.RETRY_SNAPSHOT case 5: case "REJECT_SNAPSHOT": - return ResponseApplySnapshotChunk_Result.REJECT_SNAPSHOT; + return ResponseApplySnapshotChunk_Result.REJECT_SNAPSHOT case -1: case "UNRECOGNIZED": default: - return ResponseApplySnapshotChunk_Result.UNRECOGNIZED; + return ResponseApplySnapshotChunk_Result.UNRECOGNIZED } } -export function responseApplySnapshotChunk_ResultToJSON(object: ResponseApplySnapshotChunk_Result): string { +export function responseApplySnapshotChunk_ResultToJSON( + object: ResponseApplySnapshotChunk_Result, +): string { switch (object) { case ResponseApplySnapshotChunk_Result.UNKNOWN: - return "UNKNOWN"; + return "UNKNOWN" case ResponseApplySnapshotChunk_Result.ACCEPT: - return "ACCEPT"; + return "ACCEPT" case ResponseApplySnapshotChunk_Result.ABORT: - return "ABORT"; + return "ABORT" case ResponseApplySnapshotChunk_Result.RETRY: - return "RETRY"; + return "RETRY" case ResponseApplySnapshotChunk_Result.RETRY_SNAPSHOT: - return "RETRY_SNAPSHOT"; + return "RETRY_SNAPSHOT" case ResponseApplySnapshotChunk_Result.REJECT_SNAPSHOT: - return "REJECT_SNAPSHOT"; + return "REJECT_SNAPSHOT" case ResponseApplySnapshotChunk_Result.UNRECOGNIZED: default: - return "UNRECOGNIZED"; + return "UNRECOGNIZED" } } @@ -451,23 +455,23 @@ export function responseApplySnapshotChunk_ResultToJSON(object: ResponseApplySna * that can be adjusted by the abci app */ export interface ConsensusParams { - block?: BlockParams; - evidence?: EvidenceParams; - validator?: ValidatorParams; - version?: VersionParams; + block?: BlockParams + evidence?: EvidenceParams + validator?: ValidatorParams + version?: VersionParams } /** BlockParams contains limits on the block size. */ export interface BlockParams { /** Note: must be greater than 0 */ - maxBytes: Long; + maxBytes: Long /** Note: must be greater or equal to -1 */ - maxGas: Long; + maxGas: Long } export interface LastCommitInfo { - round: number; - votes: VoteInfo[]; + round: number + votes: VoteInfo[] } /** @@ -476,16 +480,16 @@ export interface LastCommitInfo { * Later, transactions may be queried using these events. */ export interface Event { - type: string; - attributes: EventAttribute[]; + type: string + attributes: EventAttribute[] } /** EventAttribute is a single key-value pair, associated with an event. */ export interface EventAttribute { - key: Uint8Array; - value: Uint8Array; + key: Uint8Array + value: Uint8Array /** nondeterministic */ - index: boolean; + index: boolean } /** @@ -494,59 +498,59 @@ export interface EventAttribute { * One usage is indexing transaction results. */ export interface TxResult { - height: Long; - index: number; - tx: Uint8Array; - result?: ResponseDeliverTx; + height: Long + index: number + tx: Uint8Array + result?: ResponseDeliverTx } /** Validator */ export interface Validator { /** The first 20 bytes of SHA256(public key) */ - address: Uint8Array; + address: Uint8Array /** PubKey pub_key = 2 [(gogoproto.nullable)=false]; */ - power: Long; + power: Long } /** ValidatorUpdate */ export interface ValidatorUpdate { - pubKey?: PublicKey; - power: Long; + pubKey?: PublicKey + power: Long } /** VoteInfo */ export interface VoteInfo { - validator?: Validator; - signedLastBlock: boolean; + validator?: Validator + signedLastBlock: boolean } export interface Evidence { - type: EvidenceType; + type: EvidenceType /** The offending validator */ - validator?: Validator; + validator?: Validator /** The height when the offense occurred */ - height: Long; + height: Long /** The corresponding time where the offense occurred */ - time?: Date; + time?: Date /** * Total voting power of the validator set in case the ABCI application does * not store historical validators. * https://github.com/tendermint/tendermint/issues/4581 */ - totalVotingPower: Long; + totalVotingPower: Long } export interface Snapshot { /** The height at which the snapshot was taken */ - height: Long; + height: Long /** The application-specific snapshot format */ - format: number; + format: number /** Number of chunks in the snapshot */ - chunks: number; + chunks: number /** Arbitrary snapshot hash, equal only if identical */ - hash: Uint8Array; + hash: Uint8Array /** Arbitrary application metadata */ - metadata: Uint8Array; + metadata: Uint8Array } function createBaseRequest(): Request { @@ -566,117 +570,135 @@ function createBaseRequest(): Request { offerSnapshot: undefined, loadSnapshotChunk: undefined, applySnapshotChunk: undefined, - }; + } } export const Request = { encode(message: Request, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.echo !== undefined) { - RequestEcho.encode(message.echo, writer.uint32(10).fork()).ldelim(); + RequestEcho.encode(message.echo, writer.uint32(10).fork()).ldelim() } if (message.flush !== undefined) { - RequestFlush.encode(message.flush, writer.uint32(18).fork()).ldelim(); + RequestFlush.encode(message.flush, writer.uint32(18).fork()).ldelim() } if (message.info !== undefined) { - RequestInfo.encode(message.info, writer.uint32(26).fork()).ldelim(); + RequestInfo.encode(message.info, writer.uint32(26).fork()).ldelim() } if (message.setOption !== undefined) { - RequestSetOption.encode(message.setOption, writer.uint32(34).fork()).ldelim(); + RequestSetOption.encode(message.setOption, writer.uint32(34).fork()).ldelim() } if (message.initChain !== undefined) { - RequestInitChain.encode(message.initChain, writer.uint32(42).fork()).ldelim(); + RequestInitChain.encode(message.initChain, writer.uint32(42).fork()).ldelim() } if (message.query !== undefined) { - RequestQuery.encode(message.query, writer.uint32(50).fork()).ldelim(); + RequestQuery.encode(message.query, writer.uint32(50).fork()).ldelim() } if (message.beginBlock !== undefined) { - RequestBeginBlock.encode(message.beginBlock, writer.uint32(58).fork()).ldelim(); + RequestBeginBlock.encode(message.beginBlock, writer.uint32(58).fork()).ldelim() } if (message.checkTx !== undefined) { - RequestCheckTx.encode(message.checkTx, writer.uint32(66).fork()).ldelim(); + RequestCheckTx.encode(message.checkTx, writer.uint32(66).fork()).ldelim() } if (message.deliverTx !== undefined) { - RequestDeliverTx.encode(message.deliverTx, writer.uint32(74).fork()).ldelim(); + RequestDeliverTx.encode(message.deliverTx, writer.uint32(74).fork()).ldelim() } if (message.endBlock !== undefined) { - RequestEndBlock.encode(message.endBlock, writer.uint32(82).fork()).ldelim(); + RequestEndBlock.encode(message.endBlock, writer.uint32(82).fork()).ldelim() } if (message.commit !== undefined) { - RequestCommit.encode(message.commit, writer.uint32(90).fork()).ldelim(); + RequestCommit.encode(message.commit, writer.uint32(90).fork()).ldelim() } if (message.listSnapshots !== undefined) { - RequestListSnapshots.encode(message.listSnapshots, writer.uint32(98).fork()).ldelim(); + RequestListSnapshots.encode( + message.listSnapshots, + writer.uint32(98).fork(), + ).ldelim() } if (message.offerSnapshot !== undefined) { - RequestOfferSnapshot.encode(message.offerSnapshot, writer.uint32(106).fork()).ldelim(); + RequestOfferSnapshot.encode( + message.offerSnapshot, + writer.uint32(106).fork(), + ).ldelim() } if (message.loadSnapshotChunk !== undefined) { - RequestLoadSnapshotChunk.encode(message.loadSnapshotChunk, writer.uint32(114).fork()).ldelim(); + RequestLoadSnapshotChunk.encode( + message.loadSnapshotChunk, + writer.uint32(114).fork(), + ).ldelim() } if (message.applySnapshotChunk !== undefined) { - RequestApplySnapshotChunk.encode(message.applySnapshotChunk, writer.uint32(122).fork()).ldelim(); + RequestApplySnapshotChunk.encode( + message.applySnapshotChunk, + writer.uint32(122).fork(), + ).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Request { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.echo = RequestEcho.decode(reader, reader.uint32()); - break; + message.echo = RequestEcho.decode(reader, reader.uint32()) + break case 2: - message.flush = RequestFlush.decode(reader, reader.uint32()); - break; + message.flush = RequestFlush.decode(reader, reader.uint32()) + break case 3: - message.info = RequestInfo.decode(reader, reader.uint32()); - break; + message.info = RequestInfo.decode(reader, reader.uint32()) + break case 4: - message.setOption = RequestSetOption.decode(reader, reader.uint32()); - break; + message.setOption = RequestSetOption.decode(reader, reader.uint32()) + break case 5: - message.initChain = RequestInitChain.decode(reader, reader.uint32()); - break; + message.initChain = RequestInitChain.decode(reader, reader.uint32()) + break case 6: - message.query = RequestQuery.decode(reader, reader.uint32()); - break; + message.query = RequestQuery.decode(reader, reader.uint32()) + break case 7: - message.beginBlock = RequestBeginBlock.decode(reader, reader.uint32()); - break; + message.beginBlock = RequestBeginBlock.decode(reader, reader.uint32()) + break case 8: - message.checkTx = RequestCheckTx.decode(reader, reader.uint32()); - break; + message.checkTx = RequestCheckTx.decode(reader, reader.uint32()) + break case 9: - message.deliverTx = RequestDeliverTx.decode(reader, reader.uint32()); - break; + message.deliverTx = RequestDeliverTx.decode(reader, reader.uint32()) + break case 10: - message.endBlock = RequestEndBlock.decode(reader, reader.uint32()); - break; + message.endBlock = RequestEndBlock.decode(reader, reader.uint32()) + break case 11: - message.commit = RequestCommit.decode(reader, reader.uint32()); - break; + message.commit = RequestCommit.decode(reader, reader.uint32()) + break case 12: - message.listSnapshots = RequestListSnapshots.decode(reader, reader.uint32()); - break; + message.listSnapshots = RequestListSnapshots.decode(reader, reader.uint32()) + break case 13: - message.offerSnapshot = RequestOfferSnapshot.decode(reader, reader.uint32()); - break; + message.offerSnapshot = RequestOfferSnapshot.decode(reader, reader.uint32()) + break case 14: - message.loadSnapshotChunk = RequestLoadSnapshotChunk.decode(reader, reader.uint32()); - break; + message.loadSnapshotChunk = RequestLoadSnapshotChunk.decode( + reader, + reader.uint32(), + ) + break case 15: - message.applySnapshotChunk = RequestApplySnapshotChunk.decode(reader, reader.uint32()); - break; + message.applySnapshotChunk = RequestApplySnapshotChunk.decode( + reader, + reader.uint32(), + ) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Request { @@ -684,319 +706,391 @@ export const Request = { echo: isSet(object.echo) ? RequestEcho.fromJSON(object.echo) : undefined, flush: isSet(object.flush) ? RequestFlush.fromJSON(object.flush) : undefined, info: isSet(object.info) ? RequestInfo.fromJSON(object.info) : undefined, - setOption: isSet(object.setOption) ? RequestSetOption.fromJSON(object.setOption) : undefined, - initChain: isSet(object.initChain) ? RequestInitChain.fromJSON(object.initChain) : undefined, + setOption: isSet(object.setOption) + ? RequestSetOption.fromJSON(object.setOption) + : undefined, + initChain: isSet(object.initChain) + ? RequestInitChain.fromJSON(object.initChain) + : undefined, query: isSet(object.query) ? RequestQuery.fromJSON(object.query) : undefined, - beginBlock: isSet(object.beginBlock) ? RequestBeginBlock.fromJSON(object.beginBlock) : undefined, - checkTx: isSet(object.checkTx) ? RequestCheckTx.fromJSON(object.checkTx) : undefined, - deliverTx: isSet(object.deliverTx) ? RequestDeliverTx.fromJSON(object.deliverTx) : undefined, - endBlock: isSet(object.endBlock) ? RequestEndBlock.fromJSON(object.endBlock) : undefined, + beginBlock: isSet(object.beginBlock) + ? RequestBeginBlock.fromJSON(object.beginBlock) + : undefined, + checkTx: isSet(object.checkTx) + ? RequestCheckTx.fromJSON(object.checkTx) + : undefined, + deliverTx: isSet(object.deliverTx) + ? RequestDeliverTx.fromJSON(object.deliverTx) + : undefined, + endBlock: isSet(object.endBlock) + ? RequestEndBlock.fromJSON(object.endBlock) + : undefined, commit: isSet(object.commit) ? RequestCommit.fromJSON(object.commit) : undefined, - listSnapshots: isSet(object.listSnapshots) ? RequestListSnapshots.fromJSON(object.listSnapshots) : undefined, - offerSnapshot: isSet(object.offerSnapshot) ? RequestOfferSnapshot.fromJSON(object.offerSnapshot) : undefined, + listSnapshots: isSet(object.listSnapshots) + ? RequestListSnapshots.fromJSON(object.listSnapshots) + : undefined, + offerSnapshot: isSet(object.offerSnapshot) + ? RequestOfferSnapshot.fromJSON(object.offerSnapshot) + : undefined, loadSnapshotChunk: isSet(object.loadSnapshotChunk) ? RequestLoadSnapshotChunk.fromJSON(object.loadSnapshotChunk) : undefined, applySnapshotChunk: isSet(object.applySnapshotChunk) ? RequestApplySnapshotChunk.fromJSON(object.applySnapshotChunk) : undefined, - }; + } }, toJSON(message: Request): unknown { - const obj: any = {}; - message.echo !== undefined && (obj.echo = message.echo ? RequestEcho.toJSON(message.echo) : undefined); - message.flush !== undefined && (obj.flush = message.flush ? RequestFlush.toJSON(message.flush) : undefined); - message.info !== undefined && (obj.info = message.info ? RequestInfo.toJSON(message.info) : undefined); + const obj: any = {} + message.echo !== undefined && + (obj.echo = message.echo ? RequestEcho.toJSON(message.echo) : undefined) + message.flush !== undefined && + (obj.flush = message.flush ? RequestFlush.toJSON(message.flush) : undefined) + message.info !== undefined && + (obj.info = message.info ? RequestInfo.toJSON(message.info) : undefined) message.setOption !== undefined && - (obj.setOption = message.setOption ? RequestSetOption.toJSON(message.setOption) : undefined); + (obj.setOption = message.setOption + ? RequestSetOption.toJSON(message.setOption) + : undefined) message.initChain !== undefined && - (obj.initChain = message.initChain ? RequestInitChain.toJSON(message.initChain) : undefined); - message.query !== undefined && (obj.query = message.query ? RequestQuery.toJSON(message.query) : undefined); + (obj.initChain = message.initChain + ? RequestInitChain.toJSON(message.initChain) + : undefined) + message.query !== undefined && + (obj.query = message.query ? RequestQuery.toJSON(message.query) : undefined) message.beginBlock !== undefined && - (obj.beginBlock = message.beginBlock ? RequestBeginBlock.toJSON(message.beginBlock) : undefined); + (obj.beginBlock = message.beginBlock + ? RequestBeginBlock.toJSON(message.beginBlock) + : undefined) message.checkTx !== undefined && - (obj.checkTx = message.checkTx ? RequestCheckTx.toJSON(message.checkTx) : undefined); + (obj.checkTx = message.checkTx + ? RequestCheckTx.toJSON(message.checkTx) + : undefined) message.deliverTx !== undefined && - (obj.deliverTx = message.deliverTx ? RequestDeliverTx.toJSON(message.deliverTx) : undefined); + (obj.deliverTx = message.deliverTx + ? RequestDeliverTx.toJSON(message.deliverTx) + : undefined) message.endBlock !== undefined && - (obj.endBlock = message.endBlock ? RequestEndBlock.toJSON(message.endBlock) : undefined); - message.commit !== undefined && (obj.commit = message.commit ? RequestCommit.toJSON(message.commit) : undefined); + (obj.endBlock = message.endBlock + ? RequestEndBlock.toJSON(message.endBlock) + : undefined) + message.commit !== undefined && + (obj.commit = message.commit ? RequestCommit.toJSON(message.commit) : undefined) message.listSnapshots !== undefined && - (obj.listSnapshots = message.listSnapshots ? RequestListSnapshots.toJSON(message.listSnapshots) : undefined); + (obj.listSnapshots = message.listSnapshots + ? RequestListSnapshots.toJSON(message.listSnapshots) + : undefined) message.offerSnapshot !== undefined && - (obj.offerSnapshot = message.offerSnapshot ? RequestOfferSnapshot.toJSON(message.offerSnapshot) : undefined); - message.loadSnapshotChunk !== undefined && (obj.loadSnapshotChunk = message.loadSnapshotChunk - ? RequestLoadSnapshotChunk.toJSON(message.loadSnapshotChunk) - : undefined); - message.applySnapshotChunk !== undefined && (obj.applySnapshotChunk = message.applySnapshotChunk - ? RequestApplySnapshotChunk.toJSON(message.applySnapshotChunk) - : undefined); - return obj; + (obj.offerSnapshot = message.offerSnapshot + ? RequestOfferSnapshot.toJSON(message.offerSnapshot) + : undefined) + message.loadSnapshotChunk !== undefined && + (obj.loadSnapshotChunk = message.loadSnapshotChunk + ? RequestLoadSnapshotChunk.toJSON(message.loadSnapshotChunk) + : undefined) + message.applySnapshotChunk !== undefined && + (obj.applySnapshotChunk = message.applySnapshotChunk + ? RequestApplySnapshotChunk.toJSON(message.applySnapshotChunk) + : undefined) + return obj }, fromPartial, I>>(object: I): Request { - const message = createBaseRequest(); - message.echo = (object.echo !== undefined && object.echo !== null) - ? RequestEcho.fromPartial(object.echo) - : undefined; - message.flush = (object.flush !== undefined && object.flush !== null) - ? RequestFlush.fromPartial(object.flush) - : undefined; - message.info = (object.info !== undefined && object.info !== null) - ? RequestInfo.fromPartial(object.info) - : undefined; - message.setOption = (object.setOption !== undefined && object.setOption !== null) - ? RequestSetOption.fromPartial(object.setOption) - : undefined; - message.initChain = (object.initChain !== undefined && object.initChain !== null) - ? RequestInitChain.fromPartial(object.initChain) - : undefined; - message.query = (object.query !== undefined && object.query !== null) - ? RequestQuery.fromPartial(object.query) - : undefined; - message.beginBlock = (object.beginBlock !== undefined && object.beginBlock !== null) - ? RequestBeginBlock.fromPartial(object.beginBlock) - : undefined; - message.checkTx = (object.checkTx !== undefined && object.checkTx !== null) - ? RequestCheckTx.fromPartial(object.checkTx) - : undefined; - message.deliverTx = (object.deliverTx !== undefined && object.deliverTx !== null) - ? RequestDeliverTx.fromPartial(object.deliverTx) - : undefined; - message.endBlock = (object.endBlock !== undefined && object.endBlock !== null) - ? RequestEndBlock.fromPartial(object.endBlock) - : undefined; - message.commit = (object.commit !== undefined && object.commit !== null) - ? RequestCommit.fromPartial(object.commit) - : undefined; - message.listSnapshots = (object.listSnapshots !== undefined && object.listSnapshots !== null) - ? RequestListSnapshots.fromPartial(object.listSnapshots) - : undefined; - message.offerSnapshot = (object.offerSnapshot !== undefined && object.offerSnapshot !== null) - ? RequestOfferSnapshot.fromPartial(object.offerSnapshot) - : undefined; - message.loadSnapshotChunk = (object.loadSnapshotChunk !== undefined && object.loadSnapshotChunk !== null) - ? RequestLoadSnapshotChunk.fromPartial(object.loadSnapshotChunk) - : undefined; - message.applySnapshotChunk = (object.applySnapshotChunk !== undefined && object.applySnapshotChunk !== null) - ? RequestApplySnapshotChunk.fromPartial(object.applySnapshotChunk) - : undefined; - return message; - }, -}; + const message = createBaseRequest() + message.echo = + object.echo !== undefined && object.echo !== null + ? RequestEcho.fromPartial(object.echo) + : undefined + message.flush = + object.flush !== undefined && object.flush !== null + ? RequestFlush.fromPartial(object.flush) + : undefined + message.info = + object.info !== undefined && object.info !== null + ? RequestInfo.fromPartial(object.info) + : undefined + message.setOption = + object.setOption !== undefined && object.setOption !== null + ? RequestSetOption.fromPartial(object.setOption) + : undefined + message.initChain = + object.initChain !== undefined && object.initChain !== null + ? RequestInitChain.fromPartial(object.initChain) + : undefined + message.query = + object.query !== undefined && object.query !== null + ? RequestQuery.fromPartial(object.query) + : undefined + message.beginBlock = + object.beginBlock !== undefined && object.beginBlock !== null + ? RequestBeginBlock.fromPartial(object.beginBlock) + : undefined + message.checkTx = + object.checkTx !== undefined && object.checkTx !== null + ? RequestCheckTx.fromPartial(object.checkTx) + : undefined + message.deliverTx = + object.deliverTx !== undefined && object.deliverTx !== null + ? RequestDeliverTx.fromPartial(object.deliverTx) + : undefined + message.endBlock = + object.endBlock !== undefined && object.endBlock !== null + ? RequestEndBlock.fromPartial(object.endBlock) + : undefined + message.commit = + object.commit !== undefined && object.commit !== null + ? RequestCommit.fromPartial(object.commit) + : undefined + message.listSnapshots = + object.listSnapshots !== undefined && object.listSnapshots !== null + ? RequestListSnapshots.fromPartial(object.listSnapshots) + : undefined + message.offerSnapshot = + object.offerSnapshot !== undefined && object.offerSnapshot !== null + ? RequestOfferSnapshot.fromPartial(object.offerSnapshot) + : undefined + message.loadSnapshotChunk = + object.loadSnapshotChunk !== undefined && object.loadSnapshotChunk !== null + ? RequestLoadSnapshotChunk.fromPartial(object.loadSnapshotChunk) + : undefined + message.applySnapshotChunk = + object.applySnapshotChunk !== undefined && object.applySnapshotChunk !== null + ? RequestApplySnapshotChunk.fromPartial(object.applySnapshotChunk) + : undefined + return message + }, +} function createBaseRequestEcho(): RequestEcho { - return { message: "" }; + return { message: "" } } export const RequestEcho = { encode(message: RequestEcho, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.message !== "") { - writer.uint32(10).string(message.message); + writer.uint32(10).string(message.message) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): RequestEcho { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseRequestEcho(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseRequestEcho() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.message = reader.string(); - break; + message.message = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): RequestEcho { - return { message: isSet(object.message) ? String(object.message) : "" }; + return { + message: isSet(object.message) ? String(object.message) : "", + } }, toJSON(message: RequestEcho): unknown { - const obj: any = {}; - message.message !== undefined && (obj.message = message.message); - return obj; + const obj: any = {} + message.message !== undefined && (obj.message = message.message) + return obj }, fromPartial, I>>(object: I): RequestEcho { - const message = createBaseRequestEcho(); - message.message = object.message ?? ""; - return message; + const message = createBaseRequestEcho() + message.message = object.message ?? "" + return message }, -}; +} function createBaseRequestFlush(): RequestFlush { - return {}; + return {} } export const RequestFlush = { encode(_: RequestFlush, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): RequestFlush { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseRequestFlush(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseRequestFlush() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(_: any): RequestFlush { - return {}; + return {} }, toJSON(_: RequestFlush): unknown { - const obj: any = {}; - return obj; + const obj: any = {} + return obj }, fromPartial, I>>(_: I): RequestFlush { - const message = createBaseRequestFlush(); - return message; + const message = createBaseRequestFlush() + return message }, -}; +} function createBaseRequestInfo(): RequestInfo { - return { version: "", blockVersion: Long.UZERO, p2pVersion: Long.UZERO }; + return { version: "", blockVersion: Long.UZERO, p2pVersion: Long.UZERO } } export const RequestInfo = { encode(message: RequestInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.version !== "") { - writer.uint32(10).string(message.version); + writer.uint32(10).string(message.version) } if (!message.blockVersion.isZero()) { - writer.uint32(16).uint64(message.blockVersion); + writer.uint32(16).uint64(message.blockVersion) } if (!message.p2pVersion.isZero()) { - writer.uint32(24).uint64(message.p2pVersion); + writer.uint32(24).uint64(message.p2pVersion) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): RequestInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseRequestInfo(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseRequestInfo() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.version = reader.string(); - break; + message.version = reader.string() + break case 2: - message.blockVersion = reader.uint64() as Long; - break; + message.blockVersion = reader.uint64() as Long + break case 3: - message.p2pVersion = reader.uint64() as Long; - break; + message.p2pVersion = reader.uint64() as Long + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): RequestInfo { return { version: isSet(object.version) ? String(object.version) : "", - blockVersion: isSet(object.blockVersion) ? Long.fromValue(object.blockVersion) : Long.UZERO, - p2pVersion: isSet(object.p2pVersion) ? Long.fromValue(object.p2pVersion) : Long.UZERO, - }; + blockVersion: isSet(object.blockVersion) + ? Long.fromValue(object.blockVersion) + : Long.UZERO, + p2pVersion: isSet(object.p2pVersion) + ? Long.fromValue(object.p2pVersion) + : Long.UZERO, + } }, toJSON(message: RequestInfo): unknown { - const obj: any = {}; - message.version !== undefined && (obj.version = message.version); - message.blockVersion !== undefined && (obj.blockVersion = (message.blockVersion || Long.UZERO).toString()); - message.p2pVersion !== undefined && (obj.p2pVersion = (message.p2pVersion || Long.UZERO).toString()); - return obj; + const obj: any = {} + message.version !== undefined && (obj.version = message.version) + message.blockVersion !== undefined && + (obj.blockVersion = (message.blockVersion || Long.UZERO).toString()) + message.p2pVersion !== undefined && + (obj.p2pVersion = (message.p2pVersion || Long.UZERO).toString()) + return obj }, fromPartial, I>>(object: I): RequestInfo { - const message = createBaseRequestInfo(); - message.version = object.version ?? ""; - message.blockVersion = (object.blockVersion !== undefined && object.blockVersion !== null) - ? Long.fromValue(object.blockVersion) - : Long.UZERO; - message.p2pVersion = (object.p2pVersion !== undefined && object.p2pVersion !== null) - ? Long.fromValue(object.p2pVersion) - : Long.UZERO; - return message; - }, -}; + const message = createBaseRequestInfo() + message.version = object.version ?? "" + message.blockVersion = + object.blockVersion !== undefined && object.blockVersion !== null + ? Long.fromValue(object.blockVersion) + : Long.UZERO + message.p2pVersion = + object.p2pVersion !== undefined && object.p2pVersion !== null + ? Long.fromValue(object.p2pVersion) + : Long.UZERO + return message + }, +} function createBaseRequestSetOption(): RequestSetOption { - return { key: "", value: "" }; + return { key: "", value: "" } } export const RequestSetOption = { - encode(message: RequestSetOption, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: RequestSetOption, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.key !== "") { - writer.uint32(10).string(message.key); + writer.uint32(10).string(message.key) } if (message.value !== "") { - writer.uint32(18).string(message.value); + writer.uint32(18).string(message.value) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): RequestSetOption { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseRequestSetOption(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseRequestSetOption() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.key = reader.string(); - break; + message.key = reader.string() + break case 2: - message.value = reader.string(); - break; + message.value = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): RequestSetOption { - return { key: isSet(object.key) ? String(object.key) : "", value: isSet(object.value) ? String(object.value) : "" }; + return { + key: isSet(object.key) ? String(object.key) : "", + value: isSet(object.value) ? String(object.value) : "", + } }, toJSON(message: RequestSetOption): unknown { - const obj: any = {}; - message.key !== undefined && (obj.key = message.key); - message.value !== undefined && (obj.value = message.value); - return obj; + const obj: any = {} + message.key !== undefined && (obj.key = message.key) + message.value !== undefined && (obj.value = message.value) + return obj }, - fromPartial, I>>(object: I): RequestSetOption { - const message = createBaseRequestSetOption(); - message.key = object.key ?? ""; - message.value = object.value ?? ""; - return message; + fromPartial, I>>( + object: I, + ): RequestSetOption { + const message = createBaseRequestSetOption() + message.key = object.key ?? "" + message.value = object.value ?? "" + return message }, -}; +} function createBaseRequestInitChain(): RequestInitChain { return { @@ -1006,159 +1100,178 @@ function createBaseRequestInitChain(): RequestInitChain { validators: [], appStateBytes: new Uint8Array(), initialHeight: Long.ZERO, - }; + } } export const RequestInitChain = { - encode(message: RequestInitChain, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: RequestInitChain, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.time !== undefined) { - Timestamp.encode(toTimestamp(message.time), writer.uint32(10).fork()).ldelim(); + Timestamp.encode(toTimestamp(message.time), writer.uint32(10).fork()).ldelim() } if (message.chainId !== "") { - writer.uint32(18).string(message.chainId); + writer.uint32(18).string(message.chainId) } if (message.consensusParams !== undefined) { - ConsensusParams.encode(message.consensusParams, writer.uint32(26).fork()).ldelim(); + ConsensusParams.encode(message.consensusParams, writer.uint32(26).fork()).ldelim() } for (const v of message.validators) { - ValidatorUpdate.encode(v!, writer.uint32(34).fork()).ldelim(); + ValidatorUpdate.encode(v!, writer.uint32(34).fork()).ldelim() } if (message.appStateBytes.length !== 0) { - writer.uint32(42).bytes(message.appStateBytes); + writer.uint32(42).bytes(message.appStateBytes) } if (!message.initialHeight.isZero()) { - writer.uint32(48).int64(message.initialHeight); + writer.uint32(48).int64(message.initialHeight) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): RequestInitChain { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseRequestInitChain(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseRequestInitChain() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.time = fromTimestamp(Timestamp.decode(reader, reader.uint32())); - break; + message.time = fromTimestamp(Timestamp.decode(reader, reader.uint32())) + break case 2: - message.chainId = reader.string(); - break; + message.chainId = reader.string() + break case 3: - message.consensusParams = ConsensusParams.decode(reader, reader.uint32()); - break; + message.consensusParams = ConsensusParams.decode(reader, reader.uint32()) + break case 4: - message.validators.push(ValidatorUpdate.decode(reader, reader.uint32())); - break; + message.validators.push(ValidatorUpdate.decode(reader, reader.uint32())) + break case 5: - message.appStateBytes = reader.bytes(); - break; + message.appStateBytes = reader.bytes() + break case 6: - message.initialHeight = reader.int64() as Long; - break; + message.initialHeight = reader.int64() as Long + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): RequestInitChain { return { time: isSet(object.time) ? fromJsonTimestamp(object.time) : undefined, chainId: isSet(object.chainId) ? String(object.chainId) : "", - consensusParams: isSet(object.consensusParams) ? ConsensusParams.fromJSON(object.consensusParams) : undefined, + consensusParams: isSet(object.consensusParams) + ? ConsensusParams.fromJSON(object.consensusParams) + : undefined, validators: Array.isArray(object?.validators) ? object.validators.map((e: any) => ValidatorUpdate.fromJSON(e)) : [], - appStateBytes: isSet(object.appStateBytes) ? bytesFromBase64(object.appStateBytes) : new Uint8Array(), - initialHeight: isSet(object.initialHeight) ? Long.fromValue(object.initialHeight) : Long.ZERO, - }; + appStateBytes: isSet(object.appStateBytes) + ? bytesFromBase64(object.appStateBytes) + : new Uint8Array(), + initialHeight: isSet(object.initialHeight) + ? Long.fromValue(object.initialHeight) + : Long.ZERO, + } }, toJSON(message: RequestInitChain): unknown { - const obj: any = {}; - message.time !== undefined && (obj.time = message.time.toISOString()); - message.chainId !== undefined && (obj.chainId = message.chainId); + const obj: any = {} + message.time !== undefined && (obj.time = message.time.toISOString()) + message.chainId !== undefined && (obj.chainId = message.chainId) message.consensusParams !== undefined && - (obj.consensusParams = message.consensusParams ? ConsensusParams.toJSON(message.consensusParams) : undefined); + (obj.consensusParams = message.consensusParams + ? ConsensusParams.toJSON(message.consensusParams) + : undefined) if (message.validators) { - obj.validators = message.validators.map((e) => e ? ValidatorUpdate.toJSON(e) : undefined); + obj.validators = message.validators.map((e) => + e ? ValidatorUpdate.toJSON(e) : undefined, + ) } else { - obj.validators = []; + obj.validators = [] } message.appStateBytes !== undefined && (obj.appStateBytes = base64FromBytes( message.appStateBytes !== undefined ? message.appStateBytes : new Uint8Array(), - )); - message.initialHeight !== undefined && (obj.initialHeight = (message.initialHeight || Long.ZERO).toString()); - return obj; - }, - - fromPartial, I>>(object: I): RequestInitChain { - const message = createBaseRequestInitChain(); - message.time = object.time ?? undefined; - message.chainId = object.chainId ?? ""; - message.consensusParams = (object.consensusParams !== undefined && object.consensusParams !== null) - ? ConsensusParams.fromPartial(object.consensusParams) - : undefined; - message.validators = object.validators?.map((e) => ValidatorUpdate.fromPartial(e)) || []; - message.appStateBytes = object.appStateBytes ?? new Uint8Array(); - message.initialHeight = (object.initialHeight !== undefined && object.initialHeight !== null) - ? Long.fromValue(object.initialHeight) - : Long.ZERO; - return message; - }, -}; + )) + message.initialHeight !== undefined && + (obj.initialHeight = (message.initialHeight || Long.ZERO).toString()) + return obj + }, + + fromPartial, I>>( + object: I, + ): RequestInitChain { + const message = createBaseRequestInitChain() + message.time = object.time ?? undefined + message.chainId = object.chainId ?? "" + message.consensusParams = + object.consensusParams !== undefined && object.consensusParams !== null + ? ConsensusParams.fromPartial(object.consensusParams) + : undefined + message.validators = + object.validators?.map((e) => ValidatorUpdate.fromPartial(e)) || [] + message.appStateBytes = object.appStateBytes ?? new Uint8Array() + message.initialHeight = + object.initialHeight !== undefined && object.initialHeight !== null + ? Long.fromValue(object.initialHeight) + : Long.ZERO + return message + }, +} function createBaseRequestQuery(): RequestQuery { - return { data: new Uint8Array(), path: "", height: Long.ZERO, prove: false }; + return { data: new Uint8Array(), path: "", height: Long.ZERO, prove: false } } export const RequestQuery = { encode(message: RequestQuery, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.data.length !== 0) { - writer.uint32(10).bytes(message.data); + writer.uint32(10).bytes(message.data) } if (message.path !== "") { - writer.uint32(18).string(message.path); + writer.uint32(18).string(message.path) } if (!message.height.isZero()) { - writer.uint32(24).int64(message.height); + writer.uint32(24).int64(message.height) } if (message.prove === true) { - writer.uint32(32).bool(message.prove); + writer.uint32(32).bool(message.prove) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): RequestQuery { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseRequestQuery(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseRequestQuery() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.data = reader.bytes(); - break; + message.data = reader.bytes() + break case 2: - message.path = reader.string(); - break; + message.path = reader.string() + break case 3: - message.height = reader.int64() as Long; - break; + message.height = reader.int64() as Long + break case 4: - message.prove = reader.bool(); - break; + message.prove = reader.bool() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): RequestQuery { @@ -1167,452 +1280,524 @@ export const RequestQuery = { path: isSet(object.path) ? String(object.path) : "", height: isSet(object.height) ? Long.fromValue(object.height) : Long.ZERO, prove: isSet(object.prove) ? Boolean(object.prove) : false, - }; + } }, toJSON(message: RequestQuery): unknown { - const obj: any = {}; + const obj: any = {} message.data !== undefined && - (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); - message.path !== undefined && (obj.path = message.path); - message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); - message.prove !== undefined && (obj.prove = message.prove); - return obj; + (obj.data = base64FromBytes( + message.data !== undefined ? message.data : new Uint8Array(), + )) + message.path !== undefined && (obj.path = message.path) + message.height !== undefined && + (obj.height = (message.height || Long.ZERO).toString()) + message.prove !== undefined && (obj.prove = message.prove) + return obj }, fromPartial, I>>(object: I): RequestQuery { - const message = createBaseRequestQuery(); - message.data = object.data ?? new Uint8Array(); - message.path = object.path ?? ""; - message.height = (object.height !== undefined && object.height !== null) - ? Long.fromValue(object.height) - : Long.ZERO; - message.prove = object.prove ?? false; - return message; + const message = createBaseRequestQuery() + message.data = object.data ?? new Uint8Array() + message.path = object.path ?? "" + message.height = + object.height !== undefined && object.height !== null + ? Long.fromValue(object.height) + : Long.ZERO + message.prove = object.prove ?? false + return message }, -}; +} function createBaseRequestBeginBlock(): RequestBeginBlock { - return { hash: new Uint8Array(), header: undefined, lastCommitInfo: undefined, byzantineValidators: [] }; + return { + hash: new Uint8Array(), + header: undefined, + lastCommitInfo: undefined, + byzantineValidators: [], + } } export const RequestBeginBlock = { - encode(message: RequestBeginBlock, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: RequestBeginBlock, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.hash.length !== 0) { - writer.uint32(10).bytes(message.hash); + writer.uint32(10).bytes(message.hash) } if (message.header !== undefined) { - Header.encode(message.header, writer.uint32(18).fork()).ldelim(); + Header.encode(message.header, writer.uint32(18).fork()).ldelim() } if (message.lastCommitInfo !== undefined) { - LastCommitInfo.encode(message.lastCommitInfo, writer.uint32(26).fork()).ldelim(); + LastCommitInfo.encode(message.lastCommitInfo, writer.uint32(26).fork()).ldelim() } for (const v of message.byzantineValidators) { - Evidence.encode(v!, writer.uint32(34).fork()).ldelim(); + Evidence.encode(v!, writer.uint32(34).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): RequestBeginBlock { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseRequestBeginBlock(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseRequestBeginBlock() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.hash = reader.bytes(); - break; + message.hash = reader.bytes() + break case 2: - message.header = Header.decode(reader, reader.uint32()); - break; + message.header = Header.decode(reader, reader.uint32()) + break case 3: - message.lastCommitInfo = LastCommitInfo.decode(reader, reader.uint32()); - break; + message.lastCommitInfo = LastCommitInfo.decode(reader, reader.uint32()) + break case 4: - message.byzantineValidators.push(Evidence.decode(reader, reader.uint32())); - break; + message.byzantineValidators.push(Evidence.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): RequestBeginBlock { return { hash: isSet(object.hash) ? bytesFromBase64(object.hash) : new Uint8Array(), header: isSet(object.header) ? Header.fromJSON(object.header) : undefined, - lastCommitInfo: isSet(object.lastCommitInfo) ? LastCommitInfo.fromJSON(object.lastCommitInfo) : undefined, + lastCommitInfo: isSet(object.lastCommitInfo) + ? LastCommitInfo.fromJSON(object.lastCommitInfo) + : undefined, byzantineValidators: Array.isArray(object?.byzantineValidators) ? object.byzantineValidators.map((e: any) => Evidence.fromJSON(e)) : [], - }; + } }, toJSON(message: RequestBeginBlock): unknown { - const obj: any = {}; + const obj: any = {} message.hash !== undefined && - (obj.hash = base64FromBytes(message.hash !== undefined ? message.hash : new Uint8Array())); - message.header !== undefined && (obj.header = message.header ? Header.toJSON(message.header) : undefined); + (obj.hash = base64FromBytes( + message.hash !== undefined ? message.hash : new Uint8Array(), + )) + message.header !== undefined && + (obj.header = message.header ? Header.toJSON(message.header) : undefined) message.lastCommitInfo !== undefined && - (obj.lastCommitInfo = message.lastCommitInfo ? LastCommitInfo.toJSON(message.lastCommitInfo) : undefined); + (obj.lastCommitInfo = message.lastCommitInfo + ? LastCommitInfo.toJSON(message.lastCommitInfo) + : undefined) if (message.byzantineValidators) { - obj.byzantineValidators = message.byzantineValidators.map((e) => e ? Evidence.toJSON(e) : undefined); + obj.byzantineValidators = message.byzantineValidators.map((e) => + e ? Evidence.toJSON(e) : undefined, + ) } else { - obj.byzantineValidators = []; - } - return obj; + obj.byzantineValidators = [] + } + return obj + }, + + fromPartial, I>>( + object: I, + ): RequestBeginBlock { + const message = createBaseRequestBeginBlock() + message.hash = object.hash ?? new Uint8Array() + message.header = + object.header !== undefined && object.header !== null + ? Header.fromPartial(object.header) + : undefined + message.lastCommitInfo = + object.lastCommitInfo !== undefined && object.lastCommitInfo !== null + ? LastCommitInfo.fromPartial(object.lastCommitInfo) + : undefined + message.byzantineValidators = + object.byzantineValidators?.map((e) => Evidence.fromPartial(e)) || [] + return message }, - - fromPartial, I>>(object: I): RequestBeginBlock { - const message = createBaseRequestBeginBlock(); - message.hash = object.hash ?? new Uint8Array(); - message.header = (object.header !== undefined && object.header !== null) - ? Header.fromPartial(object.header) - : undefined; - message.lastCommitInfo = (object.lastCommitInfo !== undefined && object.lastCommitInfo !== null) - ? LastCommitInfo.fromPartial(object.lastCommitInfo) - : undefined; - message.byzantineValidators = object.byzantineValidators?.map((e) => Evidence.fromPartial(e)) || []; - return message; - }, -}; +} function createBaseRequestCheckTx(): RequestCheckTx { - return { tx: new Uint8Array(), type: 0 }; + return { tx: new Uint8Array(), type: 0 } } export const RequestCheckTx = { - encode(message: RequestCheckTx, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: RequestCheckTx, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.tx.length !== 0) { - writer.uint32(10).bytes(message.tx); + writer.uint32(10).bytes(message.tx) } if (message.type !== 0) { - writer.uint32(16).int32(message.type); + writer.uint32(16).int32(message.type) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): RequestCheckTx { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseRequestCheckTx(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseRequestCheckTx() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.tx = reader.bytes(); - break; + message.tx = reader.bytes() + break case 2: - message.type = reader.int32() as any; - break; + message.type = reader.int32() as any + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): RequestCheckTx { return { tx: isSet(object.tx) ? bytesFromBase64(object.tx) : new Uint8Array(), type: isSet(object.type) ? checkTxTypeFromJSON(object.type) : 0, - }; + } }, toJSON(message: RequestCheckTx): unknown { - const obj: any = {}; - message.tx !== undefined && (obj.tx = base64FromBytes(message.tx !== undefined ? message.tx : new Uint8Array())); - message.type !== undefined && (obj.type = checkTxTypeToJSON(message.type)); - return obj; - }, - - fromPartial, I>>(object: I): RequestCheckTx { - const message = createBaseRequestCheckTx(); - message.tx = object.tx ?? new Uint8Array(); - message.type = object.type ?? 0; - return message; + const obj: any = {} + message.tx !== undefined && + (obj.tx = base64FromBytes( + message.tx !== undefined ? message.tx : new Uint8Array(), + )) + message.type !== undefined && (obj.type = checkTxTypeToJSON(message.type)) + return obj + }, + + fromPartial, I>>( + object: I, + ): RequestCheckTx { + const message = createBaseRequestCheckTx() + message.tx = object.tx ?? new Uint8Array() + message.type = object.type ?? 0 + return message }, -}; +} function createBaseRequestDeliverTx(): RequestDeliverTx { - return { tx: new Uint8Array() }; + return { tx: new Uint8Array() } } export const RequestDeliverTx = { - encode(message: RequestDeliverTx, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: RequestDeliverTx, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.tx.length !== 0) { - writer.uint32(10).bytes(message.tx); + writer.uint32(10).bytes(message.tx) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): RequestDeliverTx { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseRequestDeliverTx(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseRequestDeliverTx() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.tx = reader.bytes(); - break; + message.tx = reader.bytes() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): RequestDeliverTx { - return { tx: isSet(object.tx) ? bytesFromBase64(object.tx) : new Uint8Array() }; + return { + tx: isSet(object.tx) ? bytesFromBase64(object.tx) : new Uint8Array(), + } }, toJSON(message: RequestDeliverTx): unknown { - const obj: any = {}; - message.tx !== undefined && (obj.tx = base64FromBytes(message.tx !== undefined ? message.tx : new Uint8Array())); - return obj; + const obj: any = {} + message.tx !== undefined && + (obj.tx = base64FromBytes( + message.tx !== undefined ? message.tx : new Uint8Array(), + )) + return obj }, - fromPartial, I>>(object: I): RequestDeliverTx { - const message = createBaseRequestDeliverTx(); - message.tx = object.tx ?? new Uint8Array(); - return message; + fromPartial, I>>( + object: I, + ): RequestDeliverTx { + const message = createBaseRequestDeliverTx() + message.tx = object.tx ?? new Uint8Array() + return message }, -}; +} function createBaseRequestEndBlock(): RequestEndBlock { - return { height: Long.ZERO }; + return { height: Long.ZERO } } export const RequestEndBlock = { - encode(message: RequestEndBlock, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: RequestEndBlock, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (!message.height.isZero()) { - writer.uint32(8).int64(message.height); + writer.uint32(8).int64(message.height) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): RequestEndBlock { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseRequestEndBlock(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseRequestEndBlock() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.height = reader.int64() as Long; - break; + message.height = reader.int64() as Long + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): RequestEndBlock { - return { height: isSet(object.height) ? Long.fromValue(object.height) : Long.ZERO }; + return { + height: isSet(object.height) ? Long.fromValue(object.height) : Long.ZERO, + } }, toJSON(message: RequestEndBlock): unknown { - const obj: any = {}; - message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); - return obj; - }, - - fromPartial, I>>(object: I): RequestEndBlock { - const message = createBaseRequestEndBlock(); - message.height = (object.height !== undefined && object.height !== null) - ? Long.fromValue(object.height) - : Long.ZERO; - return message; + const obj: any = {} + message.height !== undefined && + (obj.height = (message.height || Long.ZERO).toString()) + return obj + }, + + fromPartial, I>>( + object: I, + ): RequestEndBlock { + const message = createBaseRequestEndBlock() + message.height = + object.height !== undefined && object.height !== null + ? Long.fromValue(object.height) + : Long.ZERO + return message }, -}; +} function createBaseRequestCommit(): RequestCommit { - return {}; + return {} } export const RequestCommit = { encode(_: RequestCommit, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): RequestCommit { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseRequestCommit(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseRequestCommit() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(_: any): RequestCommit { - return {}; + return {} }, toJSON(_: RequestCommit): unknown { - const obj: any = {}; - return obj; + const obj: any = {} + return obj }, fromPartial, I>>(_: I): RequestCommit { - const message = createBaseRequestCommit(); - return message; + const message = createBaseRequestCommit() + return message }, -}; +} function createBaseRequestListSnapshots(): RequestListSnapshots { - return {}; + return {} } export const RequestListSnapshots = { - encode(_: RequestListSnapshots, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; + encode( + _: RequestListSnapshots, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): RequestListSnapshots { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseRequestListSnapshots(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseRequestListSnapshots() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(_: any): RequestListSnapshots { - return {}; + return {} }, toJSON(_: RequestListSnapshots): unknown { - const obj: any = {}; - return obj; + const obj: any = {} + return obj }, - fromPartial, I>>(_: I): RequestListSnapshots { - const message = createBaseRequestListSnapshots(); - return message; + fromPartial, I>>( + _: I, + ): RequestListSnapshots { + const message = createBaseRequestListSnapshots() + return message }, -}; +} function createBaseRequestOfferSnapshot(): RequestOfferSnapshot { - return { snapshot: undefined, appHash: new Uint8Array() }; + return { snapshot: undefined, appHash: new Uint8Array() } } export const RequestOfferSnapshot = { - encode(message: RequestOfferSnapshot, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: RequestOfferSnapshot, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.snapshot !== undefined) { - Snapshot.encode(message.snapshot, writer.uint32(10).fork()).ldelim(); + Snapshot.encode(message.snapshot, writer.uint32(10).fork()).ldelim() } if (message.appHash.length !== 0) { - writer.uint32(18).bytes(message.appHash); + writer.uint32(18).bytes(message.appHash) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): RequestOfferSnapshot { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseRequestOfferSnapshot(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseRequestOfferSnapshot() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.snapshot = Snapshot.decode(reader, reader.uint32()); - break; + message.snapshot = Snapshot.decode(reader, reader.uint32()) + break case 2: - message.appHash = reader.bytes(); - break; + message.appHash = reader.bytes() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): RequestOfferSnapshot { return { snapshot: isSet(object.snapshot) ? Snapshot.fromJSON(object.snapshot) : undefined, - appHash: isSet(object.appHash) ? bytesFromBase64(object.appHash) : new Uint8Array(), - }; + appHash: isSet(object.appHash) + ? bytesFromBase64(object.appHash) + : new Uint8Array(), + } }, toJSON(message: RequestOfferSnapshot): unknown { - const obj: any = {}; - message.snapshot !== undefined && (obj.snapshot = message.snapshot ? Snapshot.toJSON(message.snapshot) : undefined); + const obj: any = {} + message.snapshot !== undefined && + (obj.snapshot = message.snapshot ? Snapshot.toJSON(message.snapshot) : undefined) message.appHash !== undefined && - (obj.appHash = base64FromBytes(message.appHash !== undefined ? message.appHash : new Uint8Array())); - return obj; - }, - - fromPartial, I>>(object: I): RequestOfferSnapshot { - const message = createBaseRequestOfferSnapshot(); - message.snapshot = (object.snapshot !== undefined && object.snapshot !== null) - ? Snapshot.fromPartial(object.snapshot) - : undefined; - message.appHash = object.appHash ?? new Uint8Array(); - return message; + (obj.appHash = base64FromBytes( + message.appHash !== undefined ? message.appHash : new Uint8Array(), + )) + return obj + }, + + fromPartial, I>>( + object: I, + ): RequestOfferSnapshot { + const message = createBaseRequestOfferSnapshot() + message.snapshot = + object.snapshot !== undefined && object.snapshot !== null + ? Snapshot.fromPartial(object.snapshot) + : undefined + message.appHash = object.appHash ?? new Uint8Array() + return message }, -}; +} function createBaseRequestLoadSnapshotChunk(): RequestLoadSnapshotChunk { - return { height: Long.UZERO, format: 0, chunk: 0 }; + return { height: Long.UZERO, format: 0, chunk: 0 } } export const RequestLoadSnapshotChunk = { - encode(message: RequestLoadSnapshotChunk, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: RequestLoadSnapshotChunk, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (!message.height.isZero()) { - writer.uint32(8).uint64(message.height); + writer.uint32(8).uint64(message.height) } if (message.format !== 0) { - writer.uint32(16).uint32(message.format); + writer.uint32(16).uint32(message.format) } if (message.chunk !== 0) { - writer.uint32(24).uint32(message.chunk); + writer.uint32(24).uint32(message.chunk) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): RequestLoadSnapshotChunk { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseRequestLoadSnapshotChunk(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseRequestLoadSnapshotChunk() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.height = reader.uint64() as Long; - break; + message.height = reader.uint64() as Long + break case 2: - message.format = reader.uint32(); - break; + message.format = reader.uint32() + break case 3: - message.chunk = reader.uint32(); - break; + message.chunk = reader.uint32() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): RequestLoadSnapshotChunk { @@ -1620,68 +1805,75 @@ export const RequestLoadSnapshotChunk = { height: isSet(object.height) ? Long.fromValue(object.height) : Long.UZERO, format: isSet(object.format) ? Number(object.format) : 0, chunk: isSet(object.chunk) ? Number(object.chunk) : 0, - }; + } }, toJSON(message: RequestLoadSnapshotChunk): unknown { - const obj: any = {}; - message.height !== undefined && (obj.height = (message.height || Long.UZERO).toString()); - message.format !== undefined && (obj.format = Math.round(message.format)); - message.chunk !== undefined && (obj.chunk = Math.round(message.chunk)); - return obj; + const obj: any = {} + message.height !== undefined && + (obj.height = (message.height || Long.UZERO).toString()) + message.format !== undefined && (obj.format = Math.round(message.format)) + message.chunk !== undefined && (obj.chunk = Math.round(message.chunk)) + return obj + }, + + fromPartial, I>>( + object: I, + ): RequestLoadSnapshotChunk { + const message = createBaseRequestLoadSnapshotChunk() + message.height = + object.height !== undefined && object.height !== null + ? Long.fromValue(object.height) + : Long.UZERO + message.format = object.format ?? 0 + message.chunk = object.chunk ?? 0 + return message }, - - fromPartial, I>>(object: I): RequestLoadSnapshotChunk { - const message = createBaseRequestLoadSnapshotChunk(); - message.height = (object.height !== undefined && object.height !== null) - ? Long.fromValue(object.height) - : Long.UZERO; - message.format = object.format ?? 0; - message.chunk = object.chunk ?? 0; - return message; - }, -}; +} function createBaseRequestApplySnapshotChunk(): RequestApplySnapshotChunk { - return { index: 0, chunk: new Uint8Array(), sender: "" }; + return { index: 0, chunk: new Uint8Array(), sender: "" } } export const RequestApplySnapshotChunk = { - encode(message: RequestApplySnapshotChunk, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: RequestApplySnapshotChunk, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.index !== 0) { - writer.uint32(8).uint32(message.index); + writer.uint32(8).uint32(message.index) } if (message.chunk.length !== 0) { - writer.uint32(18).bytes(message.chunk); + writer.uint32(18).bytes(message.chunk) } if (message.sender !== "") { - writer.uint32(26).string(message.sender); + writer.uint32(26).string(message.sender) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): RequestApplySnapshotChunk { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseRequestApplySnapshotChunk(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseRequestApplySnapshotChunk() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.index = reader.uint32(); - break; + message.index = reader.uint32() + break case 2: - message.chunk = reader.bytes(); - break; + message.chunk = reader.bytes() + break case 3: - message.sender = reader.string(); - break; + message.sender = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): RequestApplySnapshotChunk { @@ -1689,26 +1881,30 @@ export const RequestApplySnapshotChunk = { index: isSet(object.index) ? Number(object.index) : 0, chunk: isSet(object.chunk) ? bytesFromBase64(object.chunk) : new Uint8Array(), sender: isSet(object.sender) ? String(object.sender) : "", - }; + } }, toJSON(message: RequestApplySnapshotChunk): unknown { - const obj: any = {}; - message.index !== undefined && (obj.index = Math.round(message.index)); + const obj: any = {} + message.index !== undefined && (obj.index = Math.round(message.index)) message.chunk !== undefined && - (obj.chunk = base64FromBytes(message.chunk !== undefined ? message.chunk : new Uint8Array())); - message.sender !== undefined && (obj.sender = message.sender); - return obj; + (obj.chunk = base64FromBytes( + message.chunk !== undefined ? message.chunk : new Uint8Array(), + )) + message.sender !== undefined && (obj.sender = message.sender) + return obj + }, + + fromPartial, I>>( + object: I, + ): RequestApplySnapshotChunk { + const message = createBaseRequestApplySnapshotChunk() + message.index = object.index ?? 0 + message.chunk = object.chunk ?? new Uint8Array() + message.sender = object.sender ?? "" + return message }, - - fromPartial, I>>(object: I): RequestApplySnapshotChunk { - const message = createBaseRequestApplySnapshotChunk(); - message.index = object.index ?? 0; - message.chunk = object.chunk ?? new Uint8Array(); - message.sender = object.sender ?? ""; - return message; - }, -}; +} function createBaseResponse(): Response { return { @@ -1728,370 +1924,456 @@ function createBaseResponse(): Response { offerSnapshot: undefined, loadSnapshotChunk: undefined, applySnapshotChunk: undefined, - }; + } } export const Response = { encode(message: Response, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.exception !== undefined) { - ResponseException.encode(message.exception, writer.uint32(10).fork()).ldelim(); + ResponseException.encode(message.exception, writer.uint32(10).fork()).ldelim() } if (message.echo !== undefined) { - ResponseEcho.encode(message.echo, writer.uint32(18).fork()).ldelim(); + ResponseEcho.encode(message.echo, writer.uint32(18).fork()).ldelim() } if (message.flush !== undefined) { - ResponseFlush.encode(message.flush, writer.uint32(26).fork()).ldelim(); + ResponseFlush.encode(message.flush, writer.uint32(26).fork()).ldelim() } if (message.info !== undefined) { - ResponseInfo.encode(message.info, writer.uint32(34).fork()).ldelim(); + ResponseInfo.encode(message.info, writer.uint32(34).fork()).ldelim() } if (message.setOption !== undefined) { - ResponseSetOption.encode(message.setOption, writer.uint32(42).fork()).ldelim(); + ResponseSetOption.encode(message.setOption, writer.uint32(42).fork()).ldelim() } if (message.initChain !== undefined) { - ResponseInitChain.encode(message.initChain, writer.uint32(50).fork()).ldelim(); + ResponseInitChain.encode(message.initChain, writer.uint32(50).fork()).ldelim() } if (message.query !== undefined) { - ResponseQuery.encode(message.query, writer.uint32(58).fork()).ldelim(); + ResponseQuery.encode(message.query, writer.uint32(58).fork()).ldelim() } if (message.beginBlock !== undefined) { - ResponseBeginBlock.encode(message.beginBlock, writer.uint32(66).fork()).ldelim(); + ResponseBeginBlock.encode(message.beginBlock, writer.uint32(66).fork()).ldelim() } if (message.checkTx !== undefined) { - ResponseCheckTx.encode(message.checkTx, writer.uint32(74).fork()).ldelim(); + ResponseCheckTx.encode(message.checkTx, writer.uint32(74).fork()).ldelim() } if (message.deliverTx !== undefined) { - ResponseDeliverTx.encode(message.deliverTx, writer.uint32(82).fork()).ldelim(); + ResponseDeliverTx.encode(message.deliverTx, writer.uint32(82).fork()).ldelim() } if (message.endBlock !== undefined) { - ResponseEndBlock.encode(message.endBlock, writer.uint32(90).fork()).ldelim(); + ResponseEndBlock.encode(message.endBlock, writer.uint32(90).fork()).ldelim() } if (message.commit !== undefined) { - ResponseCommit.encode(message.commit, writer.uint32(98).fork()).ldelim(); + ResponseCommit.encode(message.commit, writer.uint32(98).fork()).ldelim() } if (message.listSnapshots !== undefined) { - ResponseListSnapshots.encode(message.listSnapshots, writer.uint32(106).fork()).ldelim(); + ResponseListSnapshots.encode( + message.listSnapshots, + writer.uint32(106).fork(), + ).ldelim() } if (message.offerSnapshot !== undefined) { - ResponseOfferSnapshot.encode(message.offerSnapshot, writer.uint32(114).fork()).ldelim(); + ResponseOfferSnapshot.encode( + message.offerSnapshot, + writer.uint32(114).fork(), + ).ldelim() } if (message.loadSnapshotChunk !== undefined) { - ResponseLoadSnapshotChunk.encode(message.loadSnapshotChunk, writer.uint32(122).fork()).ldelim(); + ResponseLoadSnapshotChunk.encode( + message.loadSnapshotChunk, + writer.uint32(122).fork(), + ).ldelim() } if (message.applySnapshotChunk !== undefined) { - ResponseApplySnapshotChunk.encode(message.applySnapshotChunk, writer.uint32(130).fork()).ldelim(); + ResponseApplySnapshotChunk.encode( + message.applySnapshotChunk, + writer.uint32(130).fork(), + ).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Response { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.exception = ResponseException.decode(reader, reader.uint32()); - break; + message.exception = ResponseException.decode(reader, reader.uint32()) + break case 2: - message.echo = ResponseEcho.decode(reader, reader.uint32()); - break; + message.echo = ResponseEcho.decode(reader, reader.uint32()) + break case 3: - message.flush = ResponseFlush.decode(reader, reader.uint32()); - break; + message.flush = ResponseFlush.decode(reader, reader.uint32()) + break case 4: - message.info = ResponseInfo.decode(reader, reader.uint32()); - break; + message.info = ResponseInfo.decode(reader, reader.uint32()) + break case 5: - message.setOption = ResponseSetOption.decode(reader, reader.uint32()); - break; + message.setOption = ResponseSetOption.decode(reader, reader.uint32()) + break case 6: - message.initChain = ResponseInitChain.decode(reader, reader.uint32()); - break; + message.initChain = ResponseInitChain.decode(reader, reader.uint32()) + break case 7: - message.query = ResponseQuery.decode(reader, reader.uint32()); - break; + message.query = ResponseQuery.decode(reader, reader.uint32()) + break case 8: - message.beginBlock = ResponseBeginBlock.decode(reader, reader.uint32()); - break; + message.beginBlock = ResponseBeginBlock.decode(reader, reader.uint32()) + break case 9: - message.checkTx = ResponseCheckTx.decode(reader, reader.uint32()); - break; + message.checkTx = ResponseCheckTx.decode(reader, reader.uint32()) + break case 10: - message.deliverTx = ResponseDeliverTx.decode(reader, reader.uint32()); - break; + message.deliverTx = ResponseDeliverTx.decode(reader, reader.uint32()) + break case 11: - message.endBlock = ResponseEndBlock.decode(reader, reader.uint32()); - break; + message.endBlock = ResponseEndBlock.decode(reader, reader.uint32()) + break case 12: - message.commit = ResponseCommit.decode(reader, reader.uint32()); - break; + message.commit = ResponseCommit.decode(reader, reader.uint32()) + break case 13: - message.listSnapshots = ResponseListSnapshots.decode(reader, reader.uint32()); - break; + message.listSnapshots = ResponseListSnapshots.decode(reader, reader.uint32()) + break case 14: - message.offerSnapshot = ResponseOfferSnapshot.decode(reader, reader.uint32()); - break; + message.offerSnapshot = ResponseOfferSnapshot.decode(reader, reader.uint32()) + break case 15: - message.loadSnapshotChunk = ResponseLoadSnapshotChunk.decode(reader, reader.uint32()); - break; + message.loadSnapshotChunk = ResponseLoadSnapshotChunk.decode( + reader, + reader.uint32(), + ) + break case 16: - message.applySnapshotChunk = ResponseApplySnapshotChunk.decode(reader, reader.uint32()); - break; + message.applySnapshotChunk = ResponseApplySnapshotChunk.decode( + reader, + reader.uint32(), + ) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Response { return { - exception: isSet(object.exception) ? ResponseException.fromJSON(object.exception) : undefined, + exception: isSet(object.exception) + ? ResponseException.fromJSON(object.exception) + : undefined, echo: isSet(object.echo) ? ResponseEcho.fromJSON(object.echo) : undefined, flush: isSet(object.flush) ? ResponseFlush.fromJSON(object.flush) : undefined, info: isSet(object.info) ? ResponseInfo.fromJSON(object.info) : undefined, - setOption: isSet(object.setOption) ? ResponseSetOption.fromJSON(object.setOption) : undefined, - initChain: isSet(object.initChain) ? ResponseInitChain.fromJSON(object.initChain) : undefined, + setOption: isSet(object.setOption) + ? ResponseSetOption.fromJSON(object.setOption) + : undefined, + initChain: isSet(object.initChain) + ? ResponseInitChain.fromJSON(object.initChain) + : undefined, query: isSet(object.query) ? ResponseQuery.fromJSON(object.query) : undefined, - beginBlock: isSet(object.beginBlock) ? ResponseBeginBlock.fromJSON(object.beginBlock) : undefined, - checkTx: isSet(object.checkTx) ? ResponseCheckTx.fromJSON(object.checkTx) : undefined, - deliverTx: isSet(object.deliverTx) ? ResponseDeliverTx.fromJSON(object.deliverTx) : undefined, - endBlock: isSet(object.endBlock) ? ResponseEndBlock.fromJSON(object.endBlock) : undefined, + beginBlock: isSet(object.beginBlock) + ? ResponseBeginBlock.fromJSON(object.beginBlock) + : undefined, + checkTx: isSet(object.checkTx) + ? ResponseCheckTx.fromJSON(object.checkTx) + : undefined, + deliverTx: isSet(object.deliverTx) + ? ResponseDeliverTx.fromJSON(object.deliverTx) + : undefined, + endBlock: isSet(object.endBlock) + ? ResponseEndBlock.fromJSON(object.endBlock) + : undefined, commit: isSet(object.commit) ? ResponseCommit.fromJSON(object.commit) : undefined, - listSnapshots: isSet(object.listSnapshots) ? ResponseListSnapshots.fromJSON(object.listSnapshots) : undefined, - offerSnapshot: isSet(object.offerSnapshot) ? ResponseOfferSnapshot.fromJSON(object.offerSnapshot) : undefined, + listSnapshots: isSet(object.listSnapshots) + ? ResponseListSnapshots.fromJSON(object.listSnapshots) + : undefined, + offerSnapshot: isSet(object.offerSnapshot) + ? ResponseOfferSnapshot.fromJSON(object.offerSnapshot) + : undefined, loadSnapshotChunk: isSet(object.loadSnapshotChunk) ? ResponseLoadSnapshotChunk.fromJSON(object.loadSnapshotChunk) : undefined, applySnapshotChunk: isSet(object.applySnapshotChunk) ? ResponseApplySnapshotChunk.fromJSON(object.applySnapshotChunk) : undefined, - }; + } }, toJSON(message: Response): unknown { - const obj: any = {}; + const obj: any = {} message.exception !== undefined && - (obj.exception = message.exception ? ResponseException.toJSON(message.exception) : undefined); - message.echo !== undefined && (obj.echo = message.echo ? ResponseEcho.toJSON(message.echo) : undefined); - message.flush !== undefined && (obj.flush = message.flush ? ResponseFlush.toJSON(message.flush) : undefined); - message.info !== undefined && (obj.info = message.info ? ResponseInfo.toJSON(message.info) : undefined); + (obj.exception = message.exception + ? ResponseException.toJSON(message.exception) + : undefined) + message.echo !== undefined && + (obj.echo = message.echo ? ResponseEcho.toJSON(message.echo) : undefined) + message.flush !== undefined && + (obj.flush = message.flush ? ResponseFlush.toJSON(message.flush) : undefined) + message.info !== undefined && + (obj.info = message.info ? ResponseInfo.toJSON(message.info) : undefined) message.setOption !== undefined && - (obj.setOption = message.setOption ? ResponseSetOption.toJSON(message.setOption) : undefined); + (obj.setOption = message.setOption + ? ResponseSetOption.toJSON(message.setOption) + : undefined) message.initChain !== undefined && - (obj.initChain = message.initChain ? ResponseInitChain.toJSON(message.initChain) : undefined); - message.query !== undefined && (obj.query = message.query ? ResponseQuery.toJSON(message.query) : undefined); + (obj.initChain = message.initChain + ? ResponseInitChain.toJSON(message.initChain) + : undefined) + message.query !== undefined && + (obj.query = message.query ? ResponseQuery.toJSON(message.query) : undefined) message.beginBlock !== undefined && - (obj.beginBlock = message.beginBlock ? ResponseBeginBlock.toJSON(message.beginBlock) : undefined); + (obj.beginBlock = message.beginBlock + ? ResponseBeginBlock.toJSON(message.beginBlock) + : undefined) message.checkTx !== undefined && - (obj.checkTx = message.checkTx ? ResponseCheckTx.toJSON(message.checkTx) : undefined); + (obj.checkTx = message.checkTx + ? ResponseCheckTx.toJSON(message.checkTx) + : undefined) message.deliverTx !== undefined && - (obj.deliverTx = message.deliverTx ? ResponseDeliverTx.toJSON(message.deliverTx) : undefined); + (obj.deliverTx = message.deliverTx + ? ResponseDeliverTx.toJSON(message.deliverTx) + : undefined) message.endBlock !== undefined && - (obj.endBlock = message.endBlock ? ResponseEndBlock.toJSON(message.endBlock) : undefined); - message.commit !== undefined && (obj.commit = message.commit ? ResponseCommit.toJSON(message.commit) : undefined); + (obj.endBlock = message.endBlock + ? ResponseEndBlock.toJSON(message.endBlock) + : undefined) + message.commit !== undefined && + (obj.commit = message.commit ? ResponseCommit.toJSON(message.commit) : undefined) message.listSnapshots !== undefined && - (obj.listSnapshots = message.listSnapshots ? ResponseListSnapshots.toJSON(message.listSnapshots) : undefined); + (obj.listSnapshots = message.listSnapshots + ? ResponseListSnapshots.toJSON(message.listSnapshots) + : undefined) message.offerSnapshot !== undefined && - (obj.offerSnapshot = message.offerSnapshot ? ResponseOfferSnapshot.toJSON(message.offerSnapshot) : undefined); - message.loadSnapshotChunk !== undefined && (obj.loadSnapshotChunk = message.loadSnapshotChunk - ? ResponseLoadSnapshotChunk.toJSON(message.loadSnapshotChunk) - : undefined); - message.applySnapshotChunk !== undefined && (obj.applySnapshotChunk = message.applySnapshotChunk - ? ResponseApplySnapshotChunk.toJSON(message.applySnapshotChunk) - : undefined); - return obj; + (obj.offerSnapshot = message.offerSnapshot + ? ResponseOfferSnapshot.toJSON(message.offerSnapshot) + : undefined) + message.loadSnapshotChunk !== undefined && + (obj.loadSnapshotChunk = message.loadSnapshotChunk + ? ResponseLoadSnapshotChunk.toJSON(message.loadSnapshotChunk) + : undefined) + message.applySnapshotChunk !== undefined && + (obj.applySnapshotChunk = message.applySnapshotChunk + ? ResponseApplySnapshotChunk.toJSON(message.applySnapshotChunk) + : undefined) + return obj }, fromPartial, I>>(object: I): Response { - const message = createBaseResponse(); - message.exception = (object.exception !== undefined && object.exception !== null) - ? ResponseException.fromPartial(object.exception) - : undefined; - message.echo = (object.echo !== undefined && object.echo !== null) - ? ResponseEcho.fromPartial(object.echo) - : undefined; - message.flush = (object.flush !== undefined && object.flush !== null) - ? ResponseFlush.fromPartial(object.flush) - : undefined; - message.info = (object.info !== undefined && object.info !== null) - ? ResponseInfo.fromPartial(object.info) - : undefined; - message.setOption = (object.setOption !== undefined && object.setOption !== null) - ? ResponseSetOption.fromPartial(object.setOption) - : undefined; - message.initChain = (object.initChain !== undefined && object.initChain !== null) - ? ResponseInitChain.fromPartial(object.initChain) - : undefined; - message.query = (object.query !== undefined && object.query !== null) - ? ResponseQuery.fromPartial(object.query) - : undefined; - message.beginBlock = (object.beginBlock !== undefined && object.beginBlock !== null) - ? ResponseBeginBlock.fromPartial(object.beginBlock) - : undefined; - message.checkTx = (object.checkTx !== undefined && object.checkTx !== null) - ? ResponseCheckTx.fromPartial(object.checkTx) - : undefined; - message.deliverTx = (object.deliverTx !== undefined && object.deliverTx !== null) - ? ResponseDeliverTx.fromPartial(object.deliverTx) - : undefined; - message.endBlock = (object.endBlock !== undefined && object.endBlock !== null) - ? ResponseEndBlock.fromPartial(object.endBlock) - : undefined; - message.commit = (object.commit !== undefined && object.commit !== null) - ? ResponseCommit.fromPartial(object.commit) - : undefined; - message.listSnapshots = (object.listSnapshots !== undefined && object.listSnapshots !== null) - ? ResponseListSnapshots.fromPartial(object.listSnapshots) - : undefined; - message.offerSnapshot = (object.offerSnapshot !== undefined && object.offerSnapshot !== null) - ? ResponseOfferSnapshot.fromPartial(object.offerSnapshot) - : undefined; - message.loadSnapshotChunk = (object.loadSnapshotChunk !== undefined && object.loadSnapshotChunk !== null) - ? ResponseLoadSnapshotChunk.fromPartial(object.loadSnapshotChunk) - : undefined; - message.applySnapshotChunk = (object.applySnapshotChunk !== undefined && object.applySnapshotChunk !== null) - ? ResponseApplySnapshotChunk.fromPartial(object.applySnapshotChunk) - : undefined; - return message; - }, -}; + const message = createBaseResponse() + message.exception = + object.exception !== undefined && object.exception !== null + ? ResponseException.fromPartial(object.exception) + : undefined + message.echo = + object.echo !== undefined && object.echo !== null + ? ResponseEcho.fromPartial(object.echo) + : undefined + message.flush = + object.flush !== undefined && object.flush !== null + ? ResponseFlush.fromPartial(object.flush) + : undefined + message.info = + object.info !== undefined && object.info !== null + ? ResponseInfo.fromPartial(object.info) + : undefined + message.setOption = + object.setOption !== undefined && object.setOption !== null + ? ResponseSetOption.fromPartial(object.setOption) + : undefined + message.initChain = + object.initChain !== undefined && object.initChain !== null + ? ResponseInitChain.fromPartial(object.initChain) + : undefined + message.query = + object.query !== undefined && object.query !== null + ? ResponseQuery.fromPartial(object.query) + : undefined + message.beginBlock = + object.beginBlock !== undefined && object.beginBlock !== null + ? ResponseBeginBlock.fromPartial(object.beginBlock) + : undefined + message.checkTx = + object.checkTx !== undefined && object.checkTx !== null + ? ResponseCheckTx.fromPartial(object.checkTx) + : undefined + message.deliverTx = + object.deliverTx !== undefined && object.deliverTx !== null + ? ResponseDeliverTx.fromPartial(object.deliverTx) + : undefined + message.endBlock = + object.endBlock !== undefined && object.endBlock !== null + ? ResponseEndBlock.fromPartial(object.endBlock) + : undefined + message.commit = + object.commit !== undefined && object.commit !== null + ? ResponseCommit.fromPartial(object.commit) + : undefined + message.listSnapshots = + object.listSnapshots !== undefined && object.listSnapshots !== null + ? ResponseListSnapshots.fromPartial(object.listSnapshots) + : undefined + message.offerSnapshot = + object.offerSnapshot !== undefined && object.offerSnapshot !== null + ? ResponseOfferSnapshot.fromPartial(object.offerSnapshot) + : undefined + message.loadSnapshotChunk = + object.loadSnapshotChunk !== undefined && object.loadSnapshotChunk !== null + ? ResponseLoadSnapshotChunk.fromPartial(object.loadSnapshotChunk) + : undefined + message.applySnapshotChunk = + object.applySnapshotChunk !== undefined && object.applySnapshotChunk !== null + ? ResponseApplySnapshotChunk.fromPartial(object.applySnapshotChunk) + : undefined + return message + }, +} function createBaseResponseException(): ResponseException { - return { error: "" }; + return { error: "" } } export const ResponseException = { - encode(message: ResponseException, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: ResponseException, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.error !== "") { - writer.uint32(10).string(message.error); + writer.uint32(10).string(message.error) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): ResponseException { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseResponseException(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseResponseException() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.error = reader.string(); - break; + message.error = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): ResponseException { - return { error: isSet(object.error) ? String(object.error) : "" }; + return { + error: isSet(object.error) ? String(object.error) : "", + } }, toJSON(message: ResponseException): unknown { - const obj: any = {}; - message.error !== undefined && (obj.error = message.error); - return obj; + const obj: any = {} + message.error !== undefined && (obj.error = message.error) + return obj }, - fromPartial, I>>(object: I): ResponseException { - const message = createBaseResponseException(); - message.error = object.error ?? ""; - return message; + fromPartial, I>>( + object: I, + ): ResponseException { + const message = createBaseResponseException() + message.error = object.error ?? "" + return message }, -}; +} function createBaseResponseEcho(): ResponseEcho { - return { message: "" }; + return { message: "" } } export const ResponseEcho = { encode(message: ResponseEcho, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.message !== "") { - writer.uint32(10).string(message.message); + writer.uint32(10).string(message.message) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): ResponseEcho { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseResponseEcho(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseResponseEcho() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.message = reader.string(); - break; + message.message = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): ResponseEcho { - return { message: isSet(object.message) ? String(object.message) : "" }; + return { + message: isSet(object.message) ? String(object.message) : "", + } }, toJSON(message: ResponseEcho): unknown { - const obj: any = {}; - message.message !== undefined && (obj.message = message.message); - return obj; + const obj: any = {} + message.message !== undefined && (obj.message = message.message) + return obj }, fromPartial, I>>(object: I): ResponseEcho { - const message = createBaseResponseEcho(); - message.message = object.message ?? ""; - return message; + const message = createBaseResponseEcho() + message.message = object.message ?? "" + return message }, -}; +} function createBaseResponseFlush(): ResponseFlush { - return {}; + return {} } export const ResponseFlush = { encode(_: ResponseFlush, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): ResponseFlush { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseResponseFlush(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseResponseFlush() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(_: any): ResponseFlush { - return {}; + return {} }, toJSON(_: ResponseFlush): unknown { - const obj: any = {}; - return obj; + const obj: any = {} + return obj }, fromPartial, I>>(_: I): ResponseFlush { - const message = createBaseResponseFlush(); - return message; + const message = createBaseResponseFlush() + return message }, -}; +} function createBaseResponseInfo(): ResponseInfo { return { @@ -2100,137 +2382,152 @@ function createBaseResponseInfo(): ResponseInfo { appVersion: Long.UZERO, lastBlockHeight: Long.ZERO, lastBlockAppHash: new Uint8Array(), - }; + } } export const ResponseInfo = { encode(message: ResponseInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.data !== "") { - writer.uint32(10).string(message.data); + writer.uint32(10).string(message.data) } if (message.version !== "") { - writer.uint32(18).string(message.version); + writer.uint32(18).string(message.version) } if (!message.appVersion.isZero()) { - writer.uint32(24).uint64(message.appVersion); + writer.uint32(24).uint64(message.appVersion) } if (!message.lastBlockHeight.isZero()) { - writer.uint32(32).int64(message.lastBlockHeight); + writer.uint32(32).int64(message.lastBlockHeight) } if (message.lastBlockAppHash.length !== 0) { - writer.uint32(42).bytes(message.lastBlockAppHash); + writer.uint32(42).bytes(message.lastBlockAppHash) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): ResponseInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseResponseInfo(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseResponseInfo() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.data = reader.string(); - break; + message.data = reader.string() + break case 2: - message.version = reader.string(); - break; + message.version = reader.string() + break case 3: - message.appVersion = reader.uint64() as Long; - break; + message.appVersion = reader.uint64() as Long + break case 4: - message.lastBlockHeight = reader.int64() as Long; - break; + message.lastBlockHeight = reader.int64() as Long + break case 5: - message.lastBlockAppHash = reader.bytes(); - break; + message.lastBlockAppHash = reader.bytes() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): ResponseInfo { return { data: isSet(object.data) ? String(object.data) : "", version: isSet(object.version) ? String(object.version) : "", - appVersion: isSet(object.appVersion) ? Long.fromValue(object.appVersion) : Long.UZERO, - lastBlockHeight: isSet(object.lastBlockHeight) ? Long.fromValue(object.lastBlockHeight) : Long.ZERO, - lastBlockAppHash: isSet(object.lastBlockAppHash) ? bytesFromBase64(object.lastBlockAppHash) : new Uint8Array(), - }; + appVersion: isSet(object.appVersion) + ? Long.fromValue(object.appVersion) + : Long.UZERO, + lastBlockHeight: isSet(object.lastBlockHeight) + ? Long.fromValue(object.lastBlockHeight) + : Long.ZERO, + lastBlockAppHash: isSet(object.lastBlockAppHash) + ? bytesFromBase64(object.lastBlockAppHash) + : new Uint8Array(), + } }, toJSON(message: ResponseInfo): unknown { - const obj: any = {}; - message.data !== undefined && (obj.data = message.data); - message.version !== undefined && (obj.version = message.version); - message.appVersion !== undefined && (obj.appVersion = (message.appVersion || Long.UZERO).toString()); - message.lastBlockHeight !== undefined && (obj.lastBlockHeight = (message.lastBlockHeight || Long.ZERO).toString()); + const obj: any = {} + message.data !== undefined && (obj.data = message.data) + message.version !== undefined && (obj.version = message.version) + message.appVersion !== undefined && + (obj.appVersion = (message.appVersion || Long.UZERO).toString()) + message.lastBlockHeight !== undefined && + (obj.lastBlockHeight = (message.lastBlockHeight || Long.ZERO).toString()) message.lastBlockAppHash !== undefined && (obj.lastBlockAppHash = base64FromBytes( - message.lastBlockAppHash !== undefined ? message.lastBlockAppHash : new Uint8Array(), - )); - return obj; + message.lastBlockAppHash !== undefined + ? message.lastBlockAppHash + : new Uint8Array(), + )) + return obj }, fromPartial, I>>(object: I): ResponseInfo { - const message = createBaseResponseInfo(); - message.data = object.data ?? ""; - message.version = object.version ?? ""; - message.appVersion = (object.appVersion !== undefined && object.appVersion !== null) - ? Long.fromValue(object.appVersion) - : Long.UZERO; - message.lastBlockHeight = (object.lastBlockHeight !== undefined && object.lastBlockHeight !== null) - ? Long.fromValue(object.lastBlockHeight) - : Long.ZERO; - message.lastBlockAppHash = object.lastBlockAppHash ?? new Uint8Array(); - return message; - }, -}; + const message = createBaseResponseInfo() + message.data = object.data ?? "" + message.version = object.version ?? "" + message.appVersion = + object.appVersion !== undefined && object.appVersion !== null + ? Long.fromValue(object.appVersion) + : Long.UZERO + message.lastBlockHeight = + object.lastBlockHeight !== undefined && object.lastBlockHeight !== null + ? Long.fromValue(object.lastBlockHeight) + : Long.ZERO + message.lastBlockAppHash = object.lastBlockAppHash ?? new Uint8Array() + return message + }, +} function createBaseResponseSetOption(): ResponseSetOption { - return { code: 0, log: "", info: "" }; + return { code: 0, log: "", info: "" } } export const ResponseSetOption = { - encode(message: ResponseSetOption, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: ResponseSetOption, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.code !== 0) { - writer.uint32(8).uint32(message.code); + writer.uint32(8).uint32(message.code) } if (message.log !== "") { - writer.uint32(26).string(message.log); + writer.uint32(26).string(message.log) } if (message.info !== "") { - writer.uint32(34).string(message.info); + writer.uint32(34).string(message.info) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): ResponseSetOption { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseResponseSetOption(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseResponseSetOption() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.code = reader.uint32(); - break; + message.code = reader.uint32() + break case 3: - message.log = reader.string(); - break; + message.log = reader.string() + break case 4: - message.info = reader.string(); - break; + message.info = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): ResponseSetOption { @@ -2238,102 +2535,121 @@ export const ResponseSetOption = { code: isSet(object.code) ? Number(object.code) : 0, log: isSet(object.log) ? String(object.log) : "", info: isSet(object.info) ? String(object.info) : "", - }; + } }, toJSON(message: ResponseSetOption): unknown { - const obj: any = {}; - message.code !== undefined && (obj.code = Math.round(message.code)); - message.log !== undefined && (obj.log = message.log); - message.info !== undefined && (obj.info = message.info); - return obj; + const obj: any = {} + message.code !== undefined && (obj.code = Math.round(message.code)) + message.log !== undefined && (obj.log = message.log) + message.info !== undefined && (obj.info = message.info) + return obj + }, + + fromPartial, I>>( + object: I, + ): ResponseSetOption { + const message = createBaseResponseSetOption() + message.code = object.code ?? 0 + message.log = object.log ?? "" + message.info = object.info ?? "" + return message }, - - fromPartial, I>>(object: I): ResponseSetOption { - const message = createBaseResponseSetOption(); - message.code = object.code ?? 0; - message.log = object.log ?? ""; - message.info = object.info ?? ""; - return message; - }, -}; +} function createBaseResponseInitChain(): ResponseInitChain { - return { consensusParams: undefined, validators: [], appHash: new Uint8Array() }; + return { consensusParams: undefined, validators: [], appHash: new Uint8Array() } } export const ResponseInitChain = { - encode(message: ResponseInitChain, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: ResponseInitChain, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.consensusParams !== undefined) { - ConsensusParams.encode(message.consensusParams, writer.uint32(10).fork()).ldelim(); + ConsensusParams.encode(message.consensusParams, writer.uint32(10).fork()).ldelim() } for (const v of message.validators) { - ValidatorUpdate.encode(v!, writer.uint32(18).fork()).ldelim(); + ValidatorUpdate.encode(v!, writer.uint32(18).fork()).ldelim() } if (message.appHash.length !== 0) { - writer.uint32(26).bytes(message.appHash); + writer.uint32(26).bytes(message.appHash) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): ResponseInitChain { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseResponseInitChain(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseResponseInitChain() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.consensusParams = ConsensusParams.decode(reader, reader.uint32()); - break; + message.consensusParams = ConsensusParams.decode(reader, reader.uint32()) + break case 2: - message.validators.push(ValidatorUpdate.decode(reader, reader.uint32())); - break; + message.validators.push(ValidatorUpdate.decode(reader, reader.uint32())) + break case 3: - message.appHash = reader.bytes(); - break; + message.appHash = reader.bytes() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): ResponseInitChain { return { - consensusParams: isSet(object.consensusParams) ? ConsensusParams.fromJSON(object.consensusParams) : undefined, + consensusParams: isSet(object.consensusParams) + ? ConsensusParams.fromJSON(object.consensusParams) + : undefined, validators: Array.isArray(object?.validators) ? object.validators.map((e: any) => ValidatorUpdate.fromJSON(e)) : [], - appHash: isSet(object.appHash) ? bytesFromBase64(object.appHash) : new Uint8Array(), - }; + appHash: isSet(object.appHash) + ? bytesFromBase64(object.appHash) + : new Uint8Array(), + } }, toJSON(message: ResponseInitChain): unknown { - const obj: any = {}; + const obj: any = {} message.consensusParams !== undefined && - (obj.consensusParams = message.consensusParams ? ConsensusParams.toJSON(message.consensusParams) : undefined); + (obj.consensusParams = message.consensusParams + ? ConsensusParams.toJSON(message.consensusParams) + : undefined) if (message.validators) { - obj.validators = message.validators.map((e) => e ? ValidatorUpdate.toJSON(e) : undefined); + obj.validators = message.validators.map((e) => + e ? ValidatorUpdate.toJSON(e) : undefined, + ) } else { - obj.validators = []; + obj.validators = [] } message.appHash !== undefined && - (obj.appHash = base64FromBytes(message.appHash !== undefined ? message.appHash : new Uint8Array())); - return obj; + (obj.appHash = base64FromBytes( + message.appHash !== undefined ? message.appHash : new Uint8Array(), + )) + return obj + }, + + fromPartial, I>>( + object: I, + ): ResponseInitChain { + const message = createBaseResponseInitChain() + message.consensusParams = + object.consensusParams !== undefined && object.consensusParams !== null + ? ConsensusParams.fromPartial(object.consensusParams) + : undefined + message.validators = + object.validators?.map((e) => ValidatorUpdate.fromPartial(e)) || [] + message.appHash = object.appHash ?? new Uint8Array() + return message }, - - fromPartial, I>>(object: I): ResponseInitChain { - const message = createBaseResponseInitChain(); - message.consensusParams = (object.consensusParams !== undefined && object.consensusParams !== null) - ? ConsensusParams.fromPartial(object.consensusParams) - : undefined; - message.validators = object.validators?.map((e) => ValidatorUpdate.fromPartial(e)) || []; - message.appHash = object.appHash ?? new Uint8Array(); - return message; - }, -}; +} function createBaseResponseQuery(): ResponseQuery { return { @@ -2346,81 +2662,81 @@ function createBaseResponseQuery(): ResponseQuery { proofOps: undefined, height: Long.ZERO, codespace: "", - }; + } } export const ResponseQuery = { encode(message: ResponseQuery, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.code !== 0) { - writer.uint32(8).uint32(message.code); + writer.uint32(8).uint32(message.code) } if (message.log !== "") { - writer.uint32(26).string(message.log); + writer.uint32(26).string(message.log) } if (message.info !== "") { - writer.uint32(34).string(message.info); + writer.uint32(34).string(message.info) } if (!message.index.isZero()) { - writer.uint32(40).int64(message.index); + writer.uint32(40).int64(message.index) } if (message.key.length !== 0) { - writer.uint32(50).bytes(message.key); + writer.uint32(50).bytes(message.key) } if (message.value.length !== 0) { - writer.uint32(58).bytes(message.value); + writer.uint32(58).bytes(message.value) } if (message.proofOps !== undefined) { - ProofOps.encode(message.proofOps, writer.uint32(66).fork()).ldelim(); + ProofOps.encode(message.proofOps, writer.uint32(66).fork()).ldelim() } if (!message.height.isZero()) { - writer.uint32(72).int64(message.height); + writer.uint32(72).int64(message.height) } if (message.codespace !== "") { - writer.uint32(82).string(message.codespace); + writer.uint32(82).string(message.codespace) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): ResponseQuery { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseResponseQuery(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseResponseQuery() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.code = reader.uint32(); - break; + message.code = reader.uint32() + break case 3: - message.log = reader.string(); - break; + message.log = reader.string() + break case 4: - message.info = reader.string(); - break; + message.info = reader.string() + break case 5: - message.index = reader.int64() as Long; - break; + message.index = reader.int64() as Long + break case 6: - message.key = reader.bytes(); - break; + message.key = reader.bytes() + break case 7: - message.value = reader.bytes(); - break; + message.value = reader.bytes() + break case 8: - message.proofOps = ProofOps.decode(reader, reader.uint32()); - break; + message.proofOps = ProofOps.decode(reader, reader.uint32()) + break case 9: - message.height = reader.int64() as Long; - break; + message.height = reader.int64() as Long + break case 10: - message.codespace = reader.string(); - break; + message.codespace = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): ResponseQuery { @@ -2434,94 +2750,116 @@ export const ResponseQuery = { proofOps: isSet(object.proofOps) ? ProofOps.fromJSON(object.proofOps) : undefined, height: isSet(object.height) ? Long.fromValue(object.height) : Long.ZERO, codespace: isSet(object.codespace) ? String(object.codespace) : "", - }; + } }, toJSON(message: ResponseQuery): unknown { - const obj: any = {}; - message.code !== undefined && (obj.code = Math.round(message.code)); - message.log !== undefined && (obj.log = message.log); - message.info !== undefined && (obj.info = message.info); - message.index !== undefined && (obj.index = (message.index || Long.ZERO).toString()); + const obj: any = {} + message.code !== undefined && (obj.code = Math.round(message.code)) + message.log !== undefined && (obj.log = message.log) + message.info !== undefined && (obj.info = message.info) + message.index !== undefined && (obj.index = (message.index || Long.ZERO).toString()) message.key !== undefined && - (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); + (obj.key = base64FromBytes( + message.key !== undefined ? message.key : new Uint8Array(), + )) message.value !== undefined && - (obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array())); - message.proofOps !== undefined && (obj.proofOps = message.proofOps ? ProofOps.toJSON(message.proofOps) : undefined); - message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); - message.codespace !== undefined && (obj.codespace = message.codespace); - return obj; - }, - - fromPartial, I>>(object: I): ResponseQuery { - const message = createBaseResponseQuery(); - message.code = object.code ?? 0; - message.log = object.log ?? ""; - message.info = object.info ?? ""; - message.index = (object.index !== undefined && object.index !== null) ? Long.fromValue(object.index) : Long.ZERO; - message.key = object.key ?? new Uint8Array(); - message.value = object.value ?? new Uint8Array(); - message.proofOps = (object.proofOps !== undefined && object.proofOps !== null) - ? ProofOps.fromPartial(object.proofOps) - : undefined; - message.height = (object.height !== undefined && object.height !== null) - ? Long.fromValue(object.height) - : Long.ZERO; - message.codespace = object.codespace ?? ""; - return message; - }, -}; + (obj.value = base64FromBytes( + message.value !== undefined ? message.value : new Uint8Array(), + )) + message.proofOps !== undefined && + (obj.proofOps = message.proofOps ? ProofOps.toJSON(message.proofOps) : undefined) + message.height !== undefined && + (obj.height = (message.height || Long.ZERO).toString()) + message.codespace !== undefined && (obj.codespace = message.codespace) + return obj + }, + + fromPartial, I>>( + object: I, + ): ResponseQuery { + const message = createBaseResponseQuery() + message.code = object.code ?? 0 + message.log = object.log ?? "" + message.info = object.info ?? "" + message.index = + object.index !== undefined && object.index !== null + ? Long.fromValue(object.index) + : Long.ZERO + message.key = object.key ?? new Uint8Array() + message.value = object.value ?? new Uint8Array() + message.proofOps = + object.proofOps !== undefined && object.proofOps !== null + ? ProofOps.fromPartial(object.proofOps) + : undefined + message.height = + object.height !== undefined && object.height !== null + ? Long.fromValue(object.height) + : Long.ZERO + message.codespace = object.codespace ?? "" + return message + }, +} function createBaseResponseBeginBlock(): ResponseBeginBlock { - return { events: [] }; + return { events: [] } } export const ResponseBeginBlock = { - encode(message: ResponseBeginBlock, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: ResponseBeginBlock, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { for (const v of message.events) { - Event.encode(v!, writer.uint32(10).fork()).ldelim(); + Event.encode(v!, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): ResponseBeginBlock { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseResponseBeginBlock(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseResponseBeginBlock() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.events.push(Event.decode(reader, reader.uint32())); - break; + message.events.push(Event.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): ResponseBeginBlock { - return { events: Array.isArray(object?.events) ? object.events.map((e: any) => Event.fromJSON(e)) : [] }; + return { + events: Array.isArray(object?.events) + ? object.events.map((e: any) => Event.fromJSON(e)) + : [], + } }, toJSON(message: ResponseBeginBlock): unknown { - const obj: any = {}; + const obj: any = {} if (message.events) { - obj.events = message.events.map((e) => e ? Event.toJSON(e) : undefined); + obj.events = message.events.map((e) => (e ? Event.toJSON(e) : undefined)) } else { - obj.events = []; + obj.events = [] } - return obj; + return obj }, - fromPartial, I>>(object: I): ResponseBeginBlock { - const message = createBaseResponseBeginBlock(); - message.events = object.events?.map((e) => Event.fromPartial(e)) || []; - return message; + fromPartial, I>>( + object: I, + ): ResponseBeginBlock { + const message = createBaseResponseBeginBlock() + message.events = object.events?.map((e) => Event.fromPartial(e)) || [] + return message }, -}; +} function createBaseResponseCheckTx(): ResponseCheckTx { return { @@ -2536,93 +2874,96 @@ function createBaseResponseCheckTx(): ResponseCheckTx { sender: "", priority: Long.ZERO, mempoolError: "", - }; + } } export const ResponseCheckTx = { - encode(message: ResponseCheckTx, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: ResponseCheckTx, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.code !== 0) { - writer.uint32(8).uint32(message.code); + writer.uint32(8).uint32(message.code) } if (message.data.length !== 0) { - writer.uint32(18).bytes(message.data); + writer.uint32(18).bytes(message.data) } if (message.log !== "") { - writer.uint32(26).string(message.log); + writer.uint32(26).string(message.log) } if (message.info !== "") { - writer.uint32(34).string(message.info); + writer.uint32(34).string(message.info) } if (!message.gasWanted.isZero()) { - writer.uint32(40).int64(message.gasWanted); + writer.uint32(40).int64(message.gasWanted) } if (!message.gasUsed.isZero()) { - writer.uint32(48).int64(message.gasUsed); + writer.uint32(48).int64(message.gasUsed) } for (const v of message.events) { - Event.encode(v!, writer.uint32(58).fork()).ldelim(); + Event.encode(v!, writer.uint32(58).fork()).ldelim() } if (message.codespace !== "") { - writer.uint32(66).string(message.codespace); + writer.uint32(66).string(message.codespace) } if (message.sender !== "") { - writer.uint32(74).string(message.sender); + writer.uint32(74).string(message.sender) } if (!message.priority.isZero()) { - writer.uint32(80).int64(message.priority); + writer.uint32(80).int64(message.priority) } if (message.mempoolError !== "") { - writer.uint32(90).string(message.mempoolError); + writer.uint32(90).string(message.mempoolError) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): ResponseCheckTx { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseResponseCheckTx(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseResponseCheckTx() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.code = reader.uint32(); - break; + message.code = reader.uint32() + break case 2: - message.data = reader.bytes(); - break; + message.data = reader.bytes() + break case 3: - message.log = reader.string(); - break; + message.log = reader.string() + break case 4: - message.info = reader.string(); - break; + message.info = reader.string() + break case 5: - message.gasWanted = reader.int64() as Long; - break; + message.gasWanted = reader.int64() as Long + break case 6: - message.gasUsed = reader.int64() as Long; - break; + message.gasUsed = reader.int64() as Long + break case 7: - message.events.push(Event.decode(reader, reader.uint32())); - break; + message.events.push(Event.decode(reader, reader.uint32())) + break case 8: - message.codespace = reader.string(); - break; + message.codespace = reader.string() + break case 9: - message.sender = reader.string(); - break; + message.sender = reader.string() + break case 10: - message.priority = reader.int64() as Long; - break; + message.priority = reader.int64() as Long + break case 11: - message.mempoolError = reader.string(); - break; + message.mempoolError = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): ResponseCheckTx { @@ -2631,59 +2972,73 @@ export const ResponseCheckTx = { data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(), log: isSet(object.log) ? String(object.log) : "", info: isSet(object.info) ? String(object.info) : "", - gasWanted: isSet(object.gas_wanted) ? Long.fromValue(object.gas_wanted) : Long.ZERO, + gasWanted: isSet(object.gas_wanted) + ? Long.fromValue(object.gas_wanted) + : Long.ZERO, gasUsed: isSet(object.gas_used) ? Long.fromValue(object.gas_used) : Long.ZERO, - events: Array.isArray(object?.events) ? object.events.map((e: any) => Event.fromJSON(e)) : [], + events: Array.isArray(object?.events) + ? object.events.map((e: any) => Event.fromJSON(e)) + : [], codespace: isSet(object.codespace) ? String(object.codespace) : "", sender: isSet(object.sender) ? String(object.sender) : "", priority: isSet(object.priority) ? Long.fromValue(object.priority) : Long.ZERO, mempoolError: isSet(object.mempoolError) ? String(object.mempoolError) : "", - }; + } }, toJSON(message: ResponseCheckTx): unknown { - const obj: any = {}; - message.code !== undefined && (obj.code = Math.round(message.code)); + const obj: any = {} + message.code !== undefined && (obj.code = Math.round(message.code)) message.data !== undefined && - (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); - message.log !== undefined && (obj.log = message.log); - message.info !== undefined && (obj.info = message.info); - message.gasWanted !== undefined && (obj.gas_wanted = (message.gasWanted || Long.ZERO).toString()); - message.gasUsed !== undefined && (obj.gas_used = (message.gasUsed || Long.ZERO).toString()); + (obj.data = base64FromBytes( + message.data !== undefined ? message.data : new Uint8Array(), + )) + message.log !== undefined && (obj.log = message.log) + message.info !== undefined && (obj.info = message.info) + message.gasWanted !== undefined && + (obj.gas_wanted = (message.gasWanted || Long.ZERO).toString()) + message.gasUsed !== undefined && + (obj.gas_used = (message.gasUsed || Long.ZERO).toString()) if (message.events) { - obj.events = message.events.map((e) => e ? Event.toJSON(e) : undefined); + obj.events = message.events.map((e) => (e ? Event.toJSON(e) : undefined)) } else { - obj.events = []; - } - message.codespace !== undefined && (obj.codespace = message.codespace); - message.sender !== undefined && (obj.sender = message.sender); - message.priority !== undefined && (obj.priority = (message.priority || Long.ZERO).toString()); - message.mempoolError !== undefined && (obj.mempoolError = message.mempoolError); - return obj; - }, - - fromPartial, I>>(object: I): ResponseCheckTx { - const message = createBaseResponseCheckTx(); - message.code = object.code ?? 0; - message.data = object.data ?? new Uint8Array(); - message.log = object.log ?? ""; - message.info = object.info ?? ""; - message.gasWanted = (object.gasWanted !== undefined && object.gasWanted !== null) - ? Long.fromValue(object.gasWanted) - : Long.ZERO; - message.gasUsed = (object.gasUsed !== undefined && object.gasUsed !== null) - ? Long.fromValue(object.gasUsed) - : Long.ZERO; - message.events = object.events?.map((e) => Event.fromPartial(e)) || []; - message.codespace = object.codespace ?? ""; - message.sender = object.sender ?? ""; - message.priority = (object.priority !== undefined && object.priority !== null) - ? Long.fromValue(object.priority) - : Long.ZERO; - message.mempoolError = object.mempoolError ?? ""; - return message; - }, -}; + obj.events = [] + } + message.codespace !== undefined && (obj.codespace = message.codespace) + message.sender !== undefined && (obj.sender = message.sender) + message.priority !== undefined && + (obj.priority = (message.priority || Long.ZERO).toString()) + message.mempoolError !== undefined && (obj.mempoolError = message.mempoolError) + return obj + }, + + fromPartial, I>>( + object: I, + ): ResponseCheckTx { + const message = createBaseResponseCheckTx() + message.code = object.code ?? 0 + message.data = object.data ?? new Uint8Array() + message.log = object.log ?? "" + message.info = object.info ?? "" + message.gasWanted = + object.gasWanted !== undefined && object.gasWanted !== null + ? Long.fromValue(object.gasWanted) + : Long.ZERO + message.gasUsed = + object.gasUsed !== undefined && object.gasUsed !== null + ? Long.fromValue(object.gasUsed) + : Long.ZERO + message.events = object.events?.map((e) => Event.fromPartial(e)) || [] + message.codespace = object.codespace ?? "" + message.sender = object.sender ?? "" + message.priority = + object.priority !== undefined && object.priority !== null + ? Long.fromValue(object.priority) + : Long.ZERO + message.mempoolError = object.mempoolError ?? "" + return message + }, +} function createBaseResponseDeliverTx(): ResponseDeliverTx { return { @@ -2695,75 +3050,78 @@ function createBaseResponseDeliverTx(): ResponseDeliverTx { gasUsed: Long.ZERO, events: [], codespace: "", - }; + } } export const ResponseDeliverTx = { - encode(message: ResponseDeliverTx, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: ResponseDeliverTx, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.code !== 0) { - writer.uint32(8).uint32(message.code); + writer.uint32(8).uint32(message.code) } if (message.data.length !== 0) { - writer.uint32(18).bytes(message.data); + writer.uint32(18).bytes(message.data) } if (message.log !== "") { - writer.uint32(26).string(message.log); + writer.uint32(26).string(message.log) } if (message.info !== "") { - writer.uint32(34).string(message.info); + writer.uint32(34).string(message.info) } if (!message.gasWanted.isZero()) { - writer.uint32(40).int64(message.gasWanted); + writer.uint32(40).int64(message.gasWanted) } if (!message.gasUsed.isZero()) { - writer.uint32(48).int64(message.gasUsed); + writer.uint32(48).int64(message.gasUsed) } for (const v of message.events) { - Event.encode(v!, writer.uint32(58).fork()).ldelim(); + Event.encode(v!, writer.uint32(58).fork()).ldelim() } if (message.codespace !== "") { - writer.uint32(66).string(message.codespace); + writer.uint32(66).string(message.codespace) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): ResponseDeliverTx { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseResponseDeliverTx(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseResponseDeliverTx() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.code = reader.uint32(); - break; + message.code = reader.uint32() + break case 2: - message.data = reader.bytes(); - break; + message.data = reader.bytes() + break case 3: - message.log = reader.string(); - break; + message.log = reader.string() + break case 4: - message.info = reader.string(); - break; + message.info = reader.string() + break case 5: - message.gasWanted = reader.int64() as Long; - break; + message.gasWanted = reader.int64() as Long + break case 6: - message.gasUsed = reader.int64() as Long; - break; + message.gasUsed = reader.int64() as Long + break case 7: - message.events.push(Event.decode(reader, reader.uint32())); - break; + message.events.push(Event.decode(reader, reader.uint32())) + break case 8: - message.codespace = reader.string(); - break; + message.codespace = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): ResponseDeliverTx { @@ -2772,89 +3130,110 @@ export const ResponseDeliverTx = { data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(), log: isSet(object.log) ? String(object.log) : "", info: isSet(object.info) ? String(object.info) : "", - gasWanted: isSet(object.gas_wanted) ? Long.fromValue(object.gas_wanted) : Long.ZERO, + gasWanted: isSet(object.gas_wanted) + ? Long.fromValue(object.gas_wanted) + : Long.ZERO, gasUsed: isSet(object.gas_used) ? Long.fromValue(object.gas_used) : Long.ZERO, - events: Array.isArray(object?.events) ? object.events.map((e: any) => Event.fromJSON(e)) : [], + events: Array.isArray(object?.events) + ? object.events.map((e: any) => Event.fromJSON(e)) + : [], codespace: isSet(object.codespace) ? String(object.codespace) : "", - }; + } }, toJSON(message: ResponseDeliverTx): unknown { - const obj: any = {}; - message.code !== undefined && (obj.code = Math.round(message.code)); + const obj: any = {} + message.code !== undefined && (obj.code = Math.round(message.code)) message.data !== undefined && - (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); - message.log !== undefined && (obj.log = message.log); - message.info !== undefined && (obj.info = message.info); - message.gasWanted !== undefined && (obj.gas_wanted = (message.gasWanted || Long.ZERO).toString()); - message.gasUsed !== undefined && (obj.gas_used = (message.gasUsed || Long.ZERO).toString()); + (obj.data = base64FromBytes( + message.data !== undefined ? message.data : new Uint8Array(), + )) + message.log !== undefined && (obj.log = message.log) + message.info !== undefined && (obj.info = message.info) + message.gasWanted !== undefined && + (obj.gas_wanted = (message.gasWanted || Long.ZERO).toString()) + message.gasUsed !== undefined && + (obj.gas_used = (message.gasUsed || Long.ZERO).toString()) if (message.events) { - obj.events = message.events.map((e) => e ? Event.toJSON(e) : undefined); + obj.events = message.events.map((e) => (e ? Event.toJSON(e) : undefined)) } else { - obj.events = []; - } - message.codespace !== undefined && (obj.codespace = message.codespace); - return obj; - }, - - fromPartial, I>>(object: I): ResponseDeliverTx { - const message = createBaseResponseDeliverTx(); - message.code = object.code ?? 0; - message.data = object.data ?? new Uint8Array(); - message.log = object.log ?? ""; - message.info = object.info ?? ""; - message.gasWanted = (object.gasWanted !== undefined && object.gasWanted !== null) - ? Long.fromValue(object.gasWanted) - : Long.ZERO; - message.gasUsed = (object.gasUsed !== undefined && object.gasUsed !== null) - ? Long.fromValue(object.gasUsed) - : Long.ZERO; - message.events = object.events?.map((e) => Event.fromPartial(e)) || []; - message.codespace = object.codespace ?? ""; - return message; - }, -}; + obj.events = [] + } + message.codespace !== undefined && (obj.codespace = message.codespace) + return obj + }, + + fromPartial, I>>( + object: I, + ): ResponseDeliverTx { + const message = createBaseResponseDeliverTx() + message.code = object.code ?? 0 + message.data = object.data ?? new Uint8Array() + message.log = object.log ?? "" + message.info = object.info ?? "" + message.gasWanted = + object.gasWanted !== undefined && object.gasWanted !== null + ? Long.fromValue(object.gasWanted) + : Long.ZERO + message.gasUsed = + object.gasUsed !== undefined && object.gasUsed !== null + ? Long.fromValue(object.gasUsed) + : Long.ZERO + message.events = object.events?.map((e) => Event.fromPartial(e)) || [] + message.codespace = object.codespace ?? "" + return message + }, +} function createBaseResponseEndBlock(): ResponseEndBlock { - return { validatorUpdates: [], consensusParamUpdates: undefined, events: [] }; + return { validatorUpdates: [], consensusParamUpdates: undefined, events: [] } } export const ResponseEndBlock = { - encode(message: ResponseEndBlock, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: ResponseEndBlock, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { for (const v of message.validatorUpdates) { - ValidatorUpdate.encode(v!, writer.uint32(10).fork()).ldelim(); + ValidatorUpdate.encode(v!, writer.uint32(10).fork()).ldelim() } if (message.consensusParamUpdates !== undefined) { - ConsensusParams.encode(message.consensusParamUpdates, writer.uint32(18).fork()).ldelim(); + ConsensusParams.encode( + message.consensusParamUpdates, + writer.uint32(18).fork(), + ).ldelim() } for (const v of message.events) { - Event.encode(v!, writer.uint32(26).fork()).ldelim(); + Event.encode(v!, writer.uint32(26).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): ResponseEndBlock { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseResponseEndBlock(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseResponseEndBlock() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.validatorUpdates.push(ValidatorUpdate.decode(reader, reader.uint32())); - break; + message.validatorUpdates.push(ValidatorUpdate.decode(reader, reader.uint32())) + break case 2: - message.consensusParamUpdates = ConsensusParams.decode(reader, reader.uint32()); - break; + message.consensusParamUpdates = ConsensusParams.decode( + reader, + reader.uint32(), + ) + break case 3: - message.events.push(Event.decode(reader, reader.uint32())); - break; + message.events.push(Event.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): ResponseEndBlock { @@ -2865,578 +3244,674 @@ export const ResponseEndBlock = { consensusParamUpdates: isSet(object.consensusParamUpdates) ? ConsensusParams.fromJSON(object.consensusParamUpdates) : undefined, - events: Array.isArray(object?.events) ? object.events.map((e: any) => Event.fromJSON(e)) : [], - }; + events: Array.isArray(object?.events) + ? object.events.map((e: any) => Event.fromJSON(e)) + : [], + } }, toJSON(message: ResponseEndBlock): unknown { - const obj: any = {}; + const obj: any = {} if (message.validatorUpdates) { - obj.validatorUpdates = message.validatorUpdates.map((e) => e ? ValidatorUpdate.toJSON(e) : undefined); + obj.validatorUpdates = message.validatorUpdates.map((e) => + e ? ValidatorUpdate.toJSON(e) : undefined, + ) } else { - obj.validatorUpdates = []; + obj.validatorUpdates = [] } - message.consensusParamUpdates !== undefined && (obj.consensusParamUpdates = message.consensusParamUpdates - ? ConsensusParams.toJSON(message.consensusParamUpdates) - : undefined); + message.consensusParamUpdates !== undefined && + (obj.consensusParamUpdates = message.consensusParamUpdates + ? ConsensusParams.toJSON(message.consensusParamUpdates) + : undefined) if (message.events) { - obj.events = message.events.map((e) => e ? Event.toJSON(e) : undefined); + obj.events = message.events.map((e) => (e ? Event.toJSON(e) : undefined)) } else { - obj.events = []; + obj.events = [] } - return obj; + return obj }, - fromPartial, I>>(object: I): ResponseEndBlock { - const message = createBaseResponseEndBlock(); - message.validatorUpdates = object.validatorUpdates?.map((e) => ValidatorUpdate.fromPartial(e)) || []; + fromPartial, I>>( + object: I, + ): ResponseEndBlock { + const message = createBaseResponseEndBlock() + message.validatorUpdates = + object.validatorUpdates?.map((e) => ValidatorUpdate.fromPartial(e)) || [] message.consensusParamUpdates = - (object.consensusParamUpdates !== undefined && object.consensusParamUpdates !== null) + object.consensusParamUpdates !== undefined && + object.consensusParamUpdates !== null ? ConsensusParams.fromPartial(object.consensusParamUpdates) - : undefined; - message.events = object.events?.map((e) => Event.fromPartial(e)) || []; - return message; + : undefined + message.events = object.events?.map((e) => Event.fromPartial(e)) || [] + return message }, -}; +} function createBaseResponseCommit(): ResponseCommit { - return { data: new Uint8Array(), retainHeight: Long.ZERO }; + return { data: new Uint8Array(), retainHeight: Long.ZERO } } export const ResponseCommit = { - encode(message: ResponseCommit, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: ResponseCommit, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.data.length !== 0) { - writer.uint32(18).bytes(message.data); + writer.uint32(18).bytes(message.data) } if (!message.retainHeight.isZero()) { - writer.uint32(24).int64(message.retainHeight); + writer.uint32(24).int64(message.retainHeight) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): ResponseCommit { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseResponseCommit(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseResponseCommit() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 2: - message.data = reader.bytes(); - break; + message.data = reader.bytes() + break case 3: - message.retainHeight = reader.int64() as Long; - break; + message.retainHeight = reader.int64() as Long + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): ResponseCommit { return { data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(), - retainHeight: isSet(object.retainHeight) ? Long.fromValue(object.retainHeight) : Long.ZERO, - }; + retainHeight: isSet(object.retainHeight) + ? Long.fromValue(object.retainHeight) + : Long.ZERO, + } }, toJSON(message: ResponseCommit): unknown { - const obj: any = {}; + const obj: any = {} message.data !== undefined && - (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); - message.retainHeight !== undefined && (obj.retainHeight = (message.retainHeight || Long.ZERO).toString()); - return obj; - }, - - fromPartial, I>>(object: I): ResponseCommit { - const message = createBaseResponseCommit(); - message.data = object.data ?? new Uint8Array(); - message.retainHeight = (object.retainHeight !== undefined && object.retainHeight !== null) - ? Long.fromValue(object.retainHeight) - : Long.ZERO; - return message; + (obj.data = base64FromBytes( + message.data !== undefined ? message.data : new Uint8Array(), + )) + message.retainHeight !== undefined && + (obj.retainHeight = (message.retainHeight || Long.ZERO).toString()) + return obj + }, + + fromPartial, I>>( + object: I, + ): ResponseCommit { + const message = createBaseResponseCommit() + message.data = object.data ?? new Uint8Array() + message.retainHeight = + object.retainHeight !== undefined && object.retainHeight !== null + ? Long.fromValue(object.retainHeight) + : Long.ZERO + return message }, -}; +} function createBaseResponseListSnapshots(): ResponseListSnapshots { - return { snapshots: [] }; + return { snapshots: [] } } export const ResponseListSnapshots = { - encode(message: ResponseListSnapshots, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: ResponseListSnapshots, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { for (const v of message.snapshots) { - Snapshot.encode(v!, writer.uint32(10).fork()).ldelim(); + Snapshot.encode(v!, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): ResponseListSnapshots { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseResponseListSnapshots(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseResponseListSnapshots() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.snapshots.push(Snapshot.decode(reader, reader.uint32())); - break; + message.snapshots.push(Snapshot.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): ResponseListSnapshots { return { - snapshots: Array.isArray(object?.snapshots) ? object.snapshots.map((e: any) => Snapshot.fromJSON(e)) : [], - }; + snapshots: Array.isArray(object?.snapshots) + ? object.snapshots.map((e: any) => Snapshot.fromJSON(e)) + : [], + } }, toJSON(message: ResponseListSnapshots): unknown { - const obj: any = {}; + const obj: any = {} if (message.snapshots) { - obj.snapshots = message.snapshots.map((e) => e ? Snapshot.toJSON(e) : undefined); + obj.snapshots = message.snapshots.map((e) => (e ? Snapshot.toJSON(e) : undefined)) } else { - obj.snapshots = []; + obj.snapshots = [] } - return obj; + return obj }, - fromPartial, I>>(object: I): ResponseListSnapshots { - const message = createBaseResponseListSnapshots(); - message.snapshots = object.snapshots?.map((e) => Snapshot.fromPartial(e)) || []; - return message; + fromPartial, I>>( + object: I, + ): ResponseListSnapshots { + const message = createBaseResponseListSnapshots() + message.snapshots = object.snapshots?.map((e) => Snapshot.fromPartial(e)) || [] + return message }, -}; +} function createBaseResponseOfferSnapshot(): ResponseOfferSnapshot { - return { result: 0 }; + return { result: 0 } } export const ResponseOfferSnapshot = { - encode(message: ResponseOfferSnapshot, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: ResponseOfferSnapshot, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.result !== 0) { - writer.uint32(8).int32(message.result); + writer.uint32(8).int32(message.result) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): ResponseOfferSnapshot { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseResponseOfferSnapshot(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseResponseOfferSnapshot() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.result = reader.int32() as any; - break; + message.result = reader.int32() as any + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): ResponseOfferSnapshot { - return { result: isSet(object.result) ? responseOfferSnapshot_ResultFromJSON(object.result) : 0 }; + return { + result: isSet(object.result) + ? responseOfferSnapshot_ResultFromJSON(object.result) + : 0, + } }, toJSON(message: ResponseOfferSnapshot): unknown { - const obj: any = {}; - message.result !== undefined && (obj.result = responseOfferSnapshot_ResultToJSON(message.result)); - return obj; + const obj: any = {} + message.result !== undefined && + (obj.result = responseOfferSnapshot_ResultToJSON(message.result)) + return obj }, - fromPartial, I>>(object: I): ResponseOfferSnapshot { - const message = createBaseResponseOfferSnapshot(); - message.result = object.result ?? 0; - return message; + fromPartial, I>>( + object: I, + ): ResponseOfferSnapshot { + const message = createBaseResponseOfferSnapshot() + message.result = object.result ?? 0 + return message }, -}; +} function createBaseResponseLoadSnapshotChunk(): ResponseLoadSnapshotChunk { - return { chunk: new Uint8Array() }; + return { chunk: new Uint8Array() } } export const ResponseLoadSnapshotChunk = { - encode(message: ResponseLoadSnapshotChunk, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: ResponseLoadSnapshotChunk, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.chunk.length !== 0) { - writer.uint32(10).bytes(message.chunk); + writer.uint32(10).bytes(message.chunk) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): ResponseLoadSnapshotChunk { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseResponseLoadSnapshotChunk(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseResponseLoadSnapshotChunk() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.chunk = reader.bytes(); - break; + message.chunk = reader.bytes() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): ResponseLoadSnapshotChunk { - return { chunk: isSet(object.chunk) ? bytesFromBase64(object.chunk) : new Uint8Array() }; + return { + chunk: isSet(object.chunk) ? bytesFromBase64(object.chunk) : new Uint8Array(), + } }, toJSON(message: ResponseLoadSnapshotChunk): unknown { - const obj: any = {}; + const obj: any = {} message.chunk !== undefined && - (obj.chunk = base64FromBytes(message.chunk !== undefined ? message.chunk : new Uint8Array())); - return obj; + (obj.chunk = base64FromBytes( + message.chunk !== undefined ? message.chunk : new Uint8Array(), + )) + return obj }, - fromPartial, I>>(object: I): ResponseLoadSnapshotChunk { - const message = createBaseResponseLoadSnapshotChunk(); - message.chunk = object.chunk ?? new Uint8Array(); - return message; + fromPartial, I>>( + object: I, + ): ResponseLoadSnapshotChunk { + const message = createBaseResponseLoadSnapshotChunk() + message.chunk = object.chunk ?? new Uint8Array() + return message }, -}; +} function createBaseResponseApplySnapshotChunk(): ResponseApplySnapshotChunk { - return { result: 0, refetchChunks: [], rejectSenders: [] }; + return { result: 0, refetchChunks: [], rejectSenders: [] } } export const ResponseApplySnapshotChunk = { - encode(message: ResponseApplySnapshotChunk, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: ResponseApplySnapshotChunk, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.result !== 0) { - writer.uint32(8).int32(message.result); + writer.uint32(8).int32(message.result) } - writer.uint32(18).fork(); + writer.uint32(18).fork() for (const v of message.refetchChunks) { - writer.uint32(v); + writer.uint32(v) } - writer.ldelim(); + writer.ldelim() for (const v of message.rejectSenders) { - writer.uint32(26).string(v!); + writer.uint32(26).string(v!) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): ResponseApplySnapshotChunk { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseResponseApplySnapshotChunk(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseResponseApplySnapshotChunk() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.result = reader.int32() as any; - break; + message.result = reader.int32() as any + break case 2: if ((tag & 7) === 2) { - const end2 = reader.uint32() + reader.pos; + const end2 = reader.uint32() + reader.pos while (reader.pos < end2) { - message.refetchChunks.push(reader.uint32()); + message.refetchChunks.push(reader.uint32()) } } else { - message.refetchChunks.push(reader.uint32()); + message.refetchChunks.push(reader.uint32()) } - break; + break case 3: - message.rejectSenders.push(reader.string()); - break; + message.rejectSenders.push(reader.string()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): ResponseApplySnapshotChunk { return { - result: isSet(object.result) ? responseApplySnapshotChunk_ResultFromJSON(object.result) : 0, - refetchChunks: Array.isArray(object?.refetchChunks) ? object.refetchChunks.map((e: any) => Number(e)) : [], - rejectSenders: Array.isArray(object?.rejectSenders) ? object.rejectSenders.map((e: any) => String(e)) : [], - }; + result: isSet(object.result) + ? responseApplySnapshotChunk_ResultFromJSON(object.result) + : 0, + refetchChunks: Array.isArray(object?.refetchChunks) + ? object.refetchChunks.map((e: any) => Number(e)) + : [], + rejectSenders: Array.isArray(object?.rejectSenders) + ? object.rejectSenders.map((e: any) => String(e)) + : [], + } }, toJSON(message: ResponseApplySnapshotChunk): unknown { - const obj: any = {}; - message.result !== undefined && (obj.result = responseApplySnapshotChunk_ResultToJSON(message.result)); + const obj: any = {} + message.result !== undefined && + (obj.result = responseApplySnapshotChunk_ResultToJSON(message.result)) if (message.refetchChunks) { - obj.refetchChunks = message.refetchChunks.map((e) => Math.round(e)); + obj.refetchChunks = message.refetchChunks.map((e) => Math.round(e)) } else { - obj.refetchChunks = []; + obj.refetchChunks = [] } if (message.rejectSenders) { - obj.rejectSenders = message.rejectSenders.map((e) => e); + obj.rejectSenders = message.rejectSenders.map((e) => e) } else { - obj.rejectSenders = []; + obj.rejectSenders = [] } - return obj; + return obj }, - fromPartial, I>>(object: I): ResponseApplySnapshotChunk { - const message = createBaseResponseApplySnapshotChunk(); - message.result = object.result ?? 0; - message.refetchChunks = object.refetchChunks?.map((e) => e) || []; - message.rejectSenders = object.rejectSenders?.map((e) => e) || []; - return message; + fromPartial, I>>( + object: I, + ): ResponseApplySnapshotChunk { + const message = createBaseResponseApplySnapshotChunk() + message.result = object.result ?? 0 + message.refetchChunks = object.refetchChunks?.map((e) => e) || [] + message.rejectSenders = object.rejectSenders?.map((e) => e) || [] + return message }, -}; +} function createBaseConsensusParams(): ConsensusParams { - return { block: undefined, evidence: undefined, validator: undefined, version: undefined }; + return { + block: undefined, + evidence: undefined, + validator: undefined, + version: undefined, + } } export const ConsensusParams = { - encode(message: ConsensusParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: ConsensusParams, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.block !== undefined) { - BlockParams.encode(message.block, writer.uint32(10).fork()).ldelim(); + BlockParams.encode(message.block, writer.uint32(10).fork()).ldelim() } if (message.evidence !== undefined) { - EvidenceParams.encode(message.evidence, writer.uint32(18).fork()).ldelim(); + EvidenceParams.encode(message.evidence, writer.uint32(18).fork()).ldelim() } if (message.validator !== undefined) { - ValidatorParams.encode(message.validator, writer.uint32(26).fork()).ldelim(); + ValidatorParams.encode(message.validator, writer.uint32(26).fork()).ldelim() } if (message.version !== undefined) { - VersionParams.encode(message.version, writer.uint32(34).fork()).ldelim(); + VersionParams.encode(message.version, writer.uint32(34).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): ConsensusParams { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseConsensusParams(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseConsensusParams() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.block = BlockParams.decode(reader, reader.uint32()); - break; + message.block = BlockParams.decode(reader, reader.uint32()) + break case 2: - message.evidence = EvidenceParams.decode(reader, reader.uint32()); - break; + message.evidence = EvidenceParams.decode(reader, reader.uint32()) + break case 3: - message.validator = ValidatorParams.decode(reader, reader.uint32()); - break; + message.validator = ValidatorParams.decode(reader, reader.uint32()) + break case 4: - message.version = VersionParams.decode(reader, reader.uint32()); - break; + message.version = VersionParams.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): ConsensusParams { return { block: isSet(object.block) ? BlockParams.fromJSON(object.block) : undefined, - evidence: isSet(object.evidence) ? EvidenceParams.fromJSON(object.evidence) : undefined, - validator: isSet(object.validator) ? ValidatorParams.fromJSON(object.validator) : undefined, - version: isSet(object.version) ? VersionParams.fromJSON(object.version) : undefined, - }; + evidence: isSet(object.evidence) + ? EvidenceParams.fromJSON(object.evidence) + : undefined, + validator: isSet(object.validator) + ? ValidatorParams.fromJSON(object.validator) + : undefined, + version: isSet(object.version) + ? VersionParams.fromJSON(object.version) + : undefined, + } }, toJSON(message: ConsensusParams): unknown { - const obj: any = {}; - message.block !== undefined && (obj.block = message.block ? BlockParams.toJSON(message.block) : undefined); + const obj: any = {} + message.block !== undefined && + (obj.block = message.block ? BlockParams.toJSON(message.block) : undefined) message.evidence !== undefined && - (obj.evidence = message.evidence ? EvidenceParams.toJSON(message.evidence) : undefined); + (obj.evidence = message.evidence + ? EvidenceParams.toJSON(message.evidence) + : undefined) message.validator !== undefined && - (obj.validator = message.validator ? ValidatorParams.toJSON(message.validator) : undefined); + (obj.validator = message.validator + ? ValidatorParams.toJSON(message.validator) + : undefined) message.version !== undefined && - (obj.version = message.version ? VersionParams.toJSON(message.version) : undefined); - return obj; - }, - - fromPartial, I>>(object: I): ConsensusParams { - const message = createBaseConsensusParams(); - message.block = (object.block !== undefined && object.block !== null) - ? BlockParams.fromPartial(object.block) - : undefined; - message.evidence = (object.evidence !== undefined && object.evidence !== null) - ? EvidenceParams.fromPartial(object.evidence) - : undefined; - message.validator = (object.validator !== undefined && object.validator !== null) - ? ValidatorParams.fromPartial(object.validator) - : undefined; - message.version = (object.version !== undefined && object.version !== null) - ? VersionParams.fromPartial(object.version) - : undefined; - return message; - }, -}; + (obj.version = message.version + ? VersionParams.toJSON(message.version) + : undefined) + return obj + }, + + fromPartial, I>>( + object: I, + ): ConsensusParams { + const message = createBaseConsensusParams() + message.block = + object.block !== undefined && object.block !== null + ? BlockParams.fromPartial(object.block) + : undefined + message.evidence = + object.evidence !== undefined && object.evidence !== null + ? EvidenceParams.fromPartial(object.evidence) + : undefined + message.validator = + object.validator !== undefined && object.validator !== null + ? ValidatorParams.fromPartial(object.validator) + : undefined + message.version = + object.version !== undefined && object.version !== null + ? VersionParams.fromPartial(object.version) + : undefined + return message + }, +} function createBaseBlockParams(): BlockParams { - return { maxBytes: Long.ZERO, maxGas: Long.ZERO }; + return { maxBytes: Long.ZERO, maxGas: Long.ZERO } } export const BlockParams = { encode(message: BlockParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (!message.maxBytes.isZero()) { - writer.uint32(8).int64(message.maxBytes); + writer.uint32(8).int64(message.maxBytes) } if (!message.maxGas.isZero()) { - writer.uint32(16).int64(message.maxGas); + writer.uint32(16).int64(message.maxGas) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): BlockParams { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseBlockParams(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseBlockParams() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.maxBytes = reader.int64() as Long; - break; + message.maxBytes = reader.int64() as Long + break case 2: - message.maxGas = reader.int64() as Long; - break; + message.maxGas = reader.int64() as Long + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): BlockParams { return { maxBytes: isSet(object.maxBytes) ? Long.fromValue(object.maxBytes) : Long.ZERO, maxGas: isSet(object.maxGas) ? Long.fromValue(object.maxGas) : Long.ZERO, - }; + } }, toJSON(message: BlockParams): unknown { - const obj: any = {}; - message.maxBytes !== undefined && (obj.maxBytes = (message.maxBytes || Long.ZERO).toString()); - message.maxGas !== undefined && (obj.maxGas = (message.maxGas || Long.ZERO).toString()); - return obj; + const obj: any = {} + message.maxBytes !== undefined && + (obj.maxBytes = (message.maxBytes || Long.ZERO).toString()) + message.maxGas !== undefined && + (obj.maxGas = (message.maxGas || Long.ZERO).toString()) + return obj }, fromPartial, I>>(object: I): BlockParams { - const message = createBaseBlockParams(); - message.maxBytes = (object.maxBytes !== undefined && object.maxBytes !== null) - ? Long.fromValue(object.maxBytes) - : Long.ZERO; - message.maxGas = (object.maxGas !== undefined && object.maxGas !== null) - ? Long.fromValue(object.maxGas) - : Long.ZERO; - return message; + const message = createBaseBlockParams() + message.maxBytes = + object.maxBytes !== undefined && object.maxBytes !== null + ? Long.fromValue(object.maxBytes) + : Long.ZERO + message.maxGas = + object.maxGas !== undefined && object.maxGas !== null + ? Long.fromValue(object.maxGas) + : Long.ZERO + return message }, -}; +} function createBaseLastCommitInfo(): LastCommitInfo { - return { round: 0, votes: [] }; + return { round: 0, votes: [] } } export const LastCommitInfo = { - encode(message: LastCommitInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: LastCommitInfo, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.round !== 0) { - writer.uint32(8).int32(message.round); + writer.uint32(8).int32(message.round) } for (const v of message.votes) { - VoteInfo.encode(v!, writer.uint32(18).fork()).ldelim(); + VoteInfo.encode(v!, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): LastCommitInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseLastCommitInfo(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseLastCommitInfo() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.round = reader.int32(); - break; + message.round = reader.int32() + break case 2: - message.votes.push(VoteInfo.decode(reader, reader.uint32())); - break; + message.votes.push(VoteInfo.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): LastCommitInfo { return { round: isSet(object.round) ? Number(object.round) : 0, - votes: Array.isArray(object?.votes) ? object.votes.map((e: any) => VoteInfo.fromJSON(e)) : [], - }; + votes: Array.isArray(object?.votes) + ? object.votes.map((e: any) => VoteInfo.fromJSON(e)) + : [], + } }, toJSON(message: LastCommitInfo): unknown { - const obj: any = {}; - message.round !== undefined && (obj.round = Math.round(message.round)); + const obj: any = {} + message.round !== undefined && (obj.round = Math.round(message.round)) if (message.votes) { - obj.votes = message.votes.map((e) => e ? VoteInfo.toJSON(e) : undefined); + obj.votes = message.votes.map((e) => (e ? VoteInfo.toJSON(e) : undefined)) } else { - obj.votes = []; + obj.votes = [] } - return obj; + return obj }, - fromPartial, I>>(object: I): LastCommitInfo { - const message = createBaseLastCommitInfo(); - message.round = object.round ?? 0; - message.votes = object.votes?.map((e) => VoteInfo.fromPartial(e)) || []; - return message; + fromPartial, I>>( + object: I, + ): LastCommitInfo { + const message = createBaseLastCommitInfo() + message.round = object.round ?? 0 + message.votes = object.votes?.map((e) => VoteInfo.fromPartial(e)) || [] + return message }, -}; +} function createBaseEvent(): Event { - return { type: "", attributes: [] }; + return { type: "", attributes: [] } } export const Event = { encode(message: Event, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.type !== "") { - writer.uint32(10).string(message.type); + writer.uint32(10).string(message.type) } for (const v of message.attributes) { - EventAttribute.encode(v!, writer.uint32(18).fork()).ldelim(); + EventAttribute.encode(v!, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Event { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseEvent(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseEvent() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.type = reader.string(); - break; + message.type = reader.string() + break case 2: - message.attributes.push(EventAttribute.decode(reader, reader.uint32())); - break; + message.attributes.push(EventAttribute.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Event { @@ -3445,68 +3920,74 @@ export const Event = { attributes: Array.isArray(object?.attributes) ? object.attributes.map((e: any) => EventAttribute.fromJSON(e)) : [], - }; + } }, toJSON(message: Event): unknown { - const obj: any = {}; - message.type !== undefined && (obj.type = message.type); + const obj: any = {} + message.type !== undefined && (obj.type = message.type) if (message.attributes) { - obj.attributes = message.attributes.map((e) => e ? EventAttribute.toJSON(e) : undefined); + obj.attributes = message.attributes.map((e) => + e ? EventAttribute.toJSON(e) : undefined, + ) } else { - obj.attributes = []; + obj.attributes = [] } - return obj; + return obj }, fromPartial, I>>(object: I): Event { - const message = createBaseEvent(); - message.type = object.type ?? ""; - message.attributes = object.attributes?.map((e) => EventAttribute.fromPartial(e)) || []; - return message; + const message = createBaseEvent() + message.type = object.type ?? "" + message.attributes = + object.attributes?.map((e) => EventAttribute.fromPartial(e)) || [] + return message }, -}; +} function createBaseEventAttribute(): EventAttribute { - return { key: new Uint8Array(), value: new Uint8Array(), index: false }; + return { key: new Uint8Array(), value: new Uint8Array(), index: false } } export const EventAttribute = { - encode(message: EventAttribute, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: EventAttribute, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.key.length !== 0) { - writer.uint32(10).bytes(message.key); + writer.uint32(10).bytes(message.key) } if (message.value.length !== 0) { - writer.uint32(18).bytes(message.value); + writer.uint32(18).bytes(message.value) } if (message.index === true) { - writer.uint32(24).bool(message.index); + writer.uint32(24).bool(message.index) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): EventAttribute { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseEventAttribute(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseEventAttribute() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.key = reader.bytes(); - break; + message.key = reader.bytes() + break case 2: - message.value = reader.bytes(); - break; + message.value = reader.bytes() + break case 3: - message.index = reader.bool(); - break; + message.index = reader.bool() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): EventAttribute { @@ -3514,74 +3995,80 @@ export const EventAttribute = { key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array(), value: isSet(object.value) ? bytesFromBase64(object.value) : new Uint8Array(), index: isSet(object.index) ? Boolean(object.index) : false, - }; + } }, toJSON(message: EventAttribute): unknown { - const obj: any = {}; + const obj: any = {} message.key !== undefined && - (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); + (obj.key = base64FromBytes( + message.key !== undefined ? message.key : new Uint8Array(), + )) message.value !== undefined && - (obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array())); - message.index !== undefined && (obj.index = message.index); - return obj; - }, - - fromPartial, I>>(object: I): EventAttribute { - const message = createBaseEventAttribute(); - message.key = object.key ?? new Uint8Array(); - message.value = object.value ?? new Uint8Array(); - message.index = object.index ?? false; - return message; + (obj.value = base64FromBytes( + message.value !== undefined ? message.value : new Uint8Array(), + )) + message.index !== undefined && (obj.index = message.index) + return obj + }, + + fromPartial, I>>( + object: I, + ): EventAttribute { + const message = createBaseEventAttribute() + message.key = object.key ?? new Uint8Array() + message.value = object.value ?? new Uint8Array() + message.index = object.index ?? false + return message }, -}; +} function createBaseTxResult(): TxResult { - return { height: Long.ZERO, index: 0, tx: new Uint8Array(), result: undefined }; + return { height: Long.ZERO, index: 0, tx: new Uint8Array(), result: undefined } } export const TxResult = { encode(message: TxResult, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (!message.height.isZero()) { - writer.uint32(8).int64(message.height); + writer.uint32(8).int64(message.height) } if (message.index !== 0) { - writer.uint32(16).uint32(message.index); + writer.uint32(16).uint32(message.index) } if (message.tx.length !== 0) { - writer.uint32(26).bytes(message.tx); + writer.uint32(26).bytes(message.tx) } if (message.result !== undefined) { - ResponseDeliverTx.encode(message.result, writer.uint32(34).fork()).ldelim(); + ResponseDeliverTx.encode(message.result, writer.uint32(34).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): TxResult { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseTxResult(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseTxResult() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.height = reader.int64() as Long; - break; + message.height = reader.int64() as Long + break case 2: - message.index = reader.uint32(); - break; + message.index = reader.uint32() + break case 3: - message.tx = reader.bytes(); - break; + message.tx = reader.bytes() + break case 4: - message.result = ResponseDeliverTx.decode(reader, reader.uint32()); - break; + message.result = ResponseDeliverTx.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): TxResult { @@ -3589,359 +4076,416 @@ export const TxResult = { height: isSet(object.height) ? Long.fromValue(object.height) : Long.ZERO, index: isSet(object.index) ? Number(object.index) : 0, tx: isSet(object.tx) ? bytesFromBase64(object.tx) : new Uint8Array(), - result: isSet(object.result) ? ResponseDeliverTx.fromJSON(object.result) : undefined, - }; + result: isSet(object.result) + ? ResponseDeliverTx.fromJSON(object.result) + : undefined, + } }, toJSON(message: TxResult): unknown { - const obj: any = {}; - message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); - message.index !== undefined && (obj.index = Math.round(message.index)); - message.tx !== undefined && (obj.tx = base64FromBytes(message.tx !== undefined ? message.tx : new Uint8Array())); + const obj: any = {} + message.height !== undefined && + (obj.height = (message.height || Long.ZERO).toString()) + message.index !== undefined && (obj.index = Math.round(message.index)) + message.tx !== undefined && + (obj.tx = base64FromBytes( + message.tx !== undefined ? message.tx : new Uint8Array(), + )) message.result !== undefined && - (obj.result = message.result ? ResponseDeliverTx.toJSON(message.result) : undefined); - return obj; + (obj.result = message.result + ? ResponseDeliverTx.toJSON(message.result) + : undefined) + return obj }, fromPartial, I>>(object: I): TxResult { - const message = createBaseTxResult(); - message.height = (object.height !== undefined && object.height !== null) - ? Long.fromValue(object.height) - : Long.ZERO; - message.index = object.index ?? 0; - message.tx = object.tx ?? new Uint8Array(); - message.result = (object.result !== undefined && object.result !== null) - ? ResponseDeliverTx.fromPartial(object.result) - : undefined; - return message; - }, -}; + const message = createBaseTxResult() + message.height = + object.height !== undefined && object.height !== null + ? Long.fromValue(object.height) + : Long.ZERO + message.index = object.index ?? 0 + message.tx = object.tx ?? new Uint8Array() + message.result = + object.result !== undefined && object.result !== null + ? ResponseDeliverTx.fromPartial(object.result) + : undefined + return message + }, +} function createBaseValidator(): Validator { - return { address: new Uint8Array(), power: Long.ZERO }; + return { address: new Uint8Array(), power: Long.ZERO } } export const Validator = { encode(message: Validator, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.address.length !== 0) { - writer.uint32(10).bytes(message.address); + writer.uint32(10).bytes(message.address) } if (!message.power.isZero()) { - writer.uint32(24).int64(message.power); + writer.uint32(24).int64(message.power) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Validator { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseValidator(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseValidator() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.address = reader.bytes(); - break; + message.address = reader.bytes() + break case 3: - message.power = reader.int64() as Long; - break; + message.power = reader.int64() as Long + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Validator { return { - address: isSet(object.address) ? bytesFromBase64(object.address) : new Uint8Array(), + address: isSet(object.address) + ? bytesFromBase64(object.address) + : new Uint8Array(), power: isSet(object.power) ? Long.fromValue(object.power) : Long.ZERO, - }; + } }, toJSON(message: Validator): unknown { - const obj: any = {}; + const obj: any = {} message.address !== undefined && - (obj.address = base64FromBytes(message.address !== undefined ? message.address : new Uint8Array())); - message.power !== undefined && (obj.power = (message.power || Long.ZERO).toString()); - return obj; + (obj.address = base64FromBytes( + message.address !== undefined ? message.address : new Uint8Array(), + )) + message.power !== undefined && (obj.power = (message.power || Long.ZERO).toString()) + return obj }, fromPartial, I>>(object: I): Validator { - const message = createBaseValidator(); - message.address = object.address ?? new Uint8Array(); - message.power = (object.power !== undefined && object.power !== null) ? Long.fromValue(object.power) : Long.ZERO; - return message; + const message = createBaseValidator() + message.address = object.address ?? new Uint8Array() + message.power = + object.power !== undefined && object.power !== null + ? Long.fromValue(object.power) + : Long.ZERO + return message }, -}; +} function createBaseValidatorUpdate(): ValidatorUpdate { - return { pubKey: undefined, power: Long.ZERO }; + return { pubKey: undefined, power: Long.ZERO } } export const ValidatorUpdate = { - encode(message: ValidatorUpdate, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: ValidatorUpdate, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.pubKey !== undefined) { - PublicKey.encode(message.pubKey, writer.uint32(10).fork()).ldelim(); + PublicKey.encode(message.pubKey, writer.uint32(10).fork()).ldelim() } if (!message.power.isZero()) { - writer.uint32(16).int64(message.power); + writer.uint32(16).int64(message.power) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorUpdate { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseValidatorUpdate(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseValidatorUpdate() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.pubKey = PublicKey.decode(reader, reader.uint32()); - break; + message.pubKey = PublicKey.decode(reader, reader.uint32()) + break case 2: - message.power = reader.int64() as Long; - break; + message.power = reader.int64() as Long + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): ValidatorUpdate { return { pubKey: isSet(object.pubKey) ? PublicKey.fromJSON(object.pubKey) : undefined, power: isSet(object.power) ? Long.fromValue(object.power) : Long.ZERO, - }; + } }, toJSON(message: ValidatorUpdate): unknown { - const obj: any = {}; - message.pubKey !== undefined && (obj.pubKey = message.pubKey ? PublicKey.toJSON(message.pubKey) : undefined); - message.power !== undefined && (obj.power = (message.power || Long.ZERO).toString()); - return obj; + const obj: any = {} + message.pubKey !== undefined && + (obj.pubKey = message.pubKey ? PublicKey.toJSON(message.pubKey) : undefined) + message.power !== undefined && (obj.power = (message.power || Long.ZERO).toString()) + return obj + }, + + fromPartial, I>>( + object: I, + ): ValidatorUpdate { + const message = createBaseValidatorUpdate() + message.pubKey = + object.pubKey !== undefined && object.pubKey !== null + ? PublicKey.fromPartial(object.pubKey) + : undefined + message.power = + object.power !== undefined && object.power !== null + ? Long.fromValue(object.power) + : Long.ZERO + return message }, - - fromPartial, I>>(object: I): ValidatorUpdate { - const message = createBaseValidatorUpdate(); - message.pubKey = (object.pubKey !== undefined && object.pubKey !== null) - ? PublicKey.fromPartial(object.pubKey) - : undefined; - message.power = (object.power !== undefined && object.power !== null) ? Long.fromValue(object.power) : Long.ZERO; - return message; - }, -}; +} function createBaseVoteInfo(): VoteInfo { - return { validator: undefined, signedLastBlock: false }; + return { validator: undefined, signedLastBlock: false } } export const VoteInfo = { encode(message: VoteInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.validator !== undefined) { - Validator.encode(message.validator, writer.uint32(10).fork()).ldelim(); + Validator.encode(message.validator, writer.uint32(10).fork()).ldelim() } if (message.signedLastBlock === true) { - writer.uint32(16).bool(message.signedLastBlock); + writer.uint32(16).bool(message.signedLastBlock) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): VoteInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseVoteInfo(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseVoteInfo() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.validator = Validator.decode(reader, reader.uint32()); - break; + message.validator = Validator.decode(reader, reader.uint32()) + break case 2: - message.signedLastBlock = reader.bool(); - break; + message.signedLastBlock = reader.bool() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): VoteInfo { return { - validator: isSet(object.validator) ? Validator.fromJSON(object.validator) : undefined, - signedLastBlock: isSet(object.signedLastBlock) ? Boolean(object.signedLastBlock) : false, - }; + validator: isSet(object.validator) + ? Validator.fromJSON(object.validator) + : undefined, + signedLastBlock: isSet(object.signedLastBlock) + ? Boolean(object.signedLastBlock) + : false, + } }, toJSON(message: VoteInfo): unknown { - const obj: any = {}; + const obj: any = {} message.validator !== undefined && - (obj.validator = message.validator ? Validator.toJSON(message.validator) : undefined); - message.signedLastBlock !== undefined && (obj.signedLastBlock = message.signedLastBlock); - return obj; + (obj.validator = message.validator + ? Validator.toJSON(message.validator) + : undefined) + message.signedLastBlock !== undefined && + (obj.signedLastBlock = message.signedLastBlock) + return obj }, fromPartial, I>>(object: I): VoteInfo { - const message = createBaseVoteInfo(); - message.validator = (object.validator !== undefined && object.validator !== null) - ? Validator.fromPartial(object.validator) - : undefined; - message.signedLastBlock = object.signedLastBlock ?? false; - return message; + const message = createBaseVoteInfo() + message.validator = + object.validator !== undefined && object.validator !== null + ? Validator.fromPartial(object.validator) + : undefined + message.signedLastBlock = object.signedLastBlock ?? false + return message }, -}; +} function createBaseEvidence(): Evidence { - return { type: 0, validator: undefined, height: Long.ZERO, time: undefined, totalVotingPower: Long.ZERO }; + return { + type: 0, + validator: undefined, + height: Long.ZERO, + time: undefined, + totalVotingPower: Long.ZERO, + } } export const Evidence = { encode(message: Evidence, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.type !== 0) { - writer.uint32(8).int32(message.type); + writer.uint32(8).int32(message.type) } if (message.validator !== undefined) { - Validator.encode(message.validator, writer.uint32(18).fork()).ldelim(); + Validator.encode(message.validator, writer.uint32(18).fork()).ldelim() } if (!message.height.isZero()) { - writer.uint32(24).int64(message.height); + writer.uint32(24).int64(message.height) } if (message.time !== undefined) { - Timestamp.encode(toTimestamp(message.time), writer.uint32(34).fork()).ldelim(); + Timestamp.encode(toTimestamp(message.time), writer.uint32(34).fork()).ldelim() } if (!message.totalVotingPower.isZero()) { - writer.uint32(40).int64(message.totalVotingPower); + writer.uint32(40).int64(message.totalVotingPower) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Evidence { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseEvidence(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseEvidence() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.type = reader.int32() as any; - break; + message.type = reader.int32() as any + break case 2: - message.validator = Validator.decode(reader, reader.uint32()); - break; + message.validator = Validator.decode(reader, reader.uint32()) + break case 3: - message.height = reader.int64() as Long; - break; + message.height = reader.int64() as Long + break case 4: - message.time = fromTimestamp(Timestamp.decode(reader, reader.uint32())); - break; + message.time = fromTimestamp(Timestamp.decode(reader, reader.uint32())) + break case 5: - message.totalVotingPower = reader.int64() as Long; - break; + message.totalVotingPower = reader.int64() as Long + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Evidence { return { type: isSet(object.type) ? evidenceTypeFromJSON(object.type) : 0, - validator: isSet(object.validator) ? Validator.fromJSON(object.validator) : undefined, + validator: isSet(object.validator) + ? Validator.fromJSON(object.validator) + : undefined, height: isSet(object.height) ? Long.fromValue(object.height) : Long.ZERO, time: isSet(object.time) ? fromJsonTimestamp(object.time) : undefined, - totalVotingPower: isSet(object.totalVotingPower) ? Long.fromValue(object.totalVotingPower) : Long.ZERO, - }; + totalVotingPower: isSet(object.totalVotingPower) + ? Long.fromValue(object.totalVotingPower) + : Long.ZERO, + } }, toJSON(message: Evidence): unknown { - const obj: any = {}; - message.type !== undefined && (obj.type = evidenceTypeToJSON(message.type)); + const obj: any = {} + message.type !== undefined && (obj.type = evidenceTypeToJSON(message.type)) message.validator !== undefined && - (obj.validator = message.validator ? Validator.toJSON(message.validator) : undefined); - message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); - message.time !== undefined && (obj.time = message.time.toISOString()); + (obj.validator = message.validator + ? Validator.toJSON(message.validator) + : undefined) + message.height !== undefined && + (obj.height = (message.height || Long.ZERO).toString()) + message.time !== undefined && (obj.time = message.time.toISOString()) message.totalVotingPower !== undefined && - (obj.totalVotingPower = (message.totalVotingPower || Long.ZERO).toString()); - return obj; + (obj.totalVotingPower = (message.totalVotingPower || Long.ZERO).toString()) + return obj }, fromPartial, I>>(object: I): Evidence { - const message = createBaseEvidence(); - message.type = object.type ?? 0; - message.validator = (object.validator !== undefined && object.validator !== null) - ? Validator.fromPartial(object.validator) - : undefined; - message.height = (object.height !== undefined && object.height !== null) - ? Long.fromValue(object.height) - : Long.ZERO; - message.time = object.time ?? undefined; - message.totalVotingPower = (object.totalVotingPower !== undefined && object.totalVotingPower !== null) - ? Long.fromValue(object.totalVotingPower) - : Long.ZERO; - return message; - }, -}; + const message = createBaseEvidence() + message.type = object.type ?? 0 + message.validator = + object.validator !== undefined && object.validator !== null + ? Validator.fromPartial(object.validator) + : undefined + message.height = + object.height !== undefined && object.height !== null + ? Long.fromValue(object.height) + : Long.ZERO + message.time = object.time ?? undefined + message.totalVotingPower = + object.totalVotingPower !== undefined && object.totalVotingPower !== null + ? Long.fromValue(object.totalVotingPower) + : Long.ZERO + return message + }, +} function createBaseSnapshot(): Snapshot { - return { height: Long.UZERO, format: 0, chunks: 0, hash: new Uint8Array(), metadata: new Uint8Array() }; + return { + height: Long.UZERO, + format: 0, + chunks: 0, + hash: new Uint8Array(), + metadata: new Uint8Array(), + } } export const Snapshot = { encode(message: Snapshot, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (!message.height.isZero()) { - writer.uint32(8).uint64(message.height); + writer.uint32(8).uint64(message.height) } if (message.format !== 0) { - writer.uint32(16).uint32(message.format); + writer.uint32(16).uint32(message.format) } if (message.chunks !== 0) { - writer.uint32(24).uint32(message.chunks); + writer.uint32(24).uint32(message.chunks) } if (message.hash.length !== 0) { - writer.uint32(34).bytes(message.hash); + writer.uint32(34).bytes(message.hash) } if (message.metadata.length !== 0) { - writer.uint32(42).bytes(message.metadata); + writer.uint32(42).bytes(message.metadata) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Snapshot { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSnapshot(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseSnapshot() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.height = reader.uint64() as Long; - break; + message.height = reader.uint64() as Long + break case 2: - message.format = reader.uint32(); - break; + message.format = reader.uint32() + break case 3: - message.chunks = reader.uint32(); - break; + message.chunks = reader.uint32() + break case 4: - message.hash = reader.bytes(); - break; + message.hash = reader.bytes() + break case 5: - message.metadata = reader.bytes(); - break; + message.metadata = reader.bytes() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Snapshot { @@ -3950,255 +4494,309 @@ export const Snapshot = { format: isSet(object.format) ? Number(object.format) : 0, chunks: isSet(object.chunks) ? Number(object.chunks) : 0, hash: isSet(object.hash) ? bytesFromBase64(object.hash) : new Uint8Array(), - metadata: isSet(object.metadata) ? bytesFromBase64(object.metadata) : new Uint8Array(), - }; + metadata: isSet(object.metadata) + ? bytesFromBase64(object.metadata) + : new Uint8Array(), + } }, toJSON(message: Snapshot): unknown { - const obj: any = {}; - message.height !== undefined && (obj.height = (message.height || Long.UZERO).toString()); - message.format !== undefined && (obj.format = Math.round(message.format)); - message.chunks !== undefined && (obj.chunks = Math.round(message.chunks)); + const obj: any = {} + message.height !== undefined && + (obj.height = (message.height || Long.UZERO).toString()) + message.format !== undefined && (obj.format = Math.round(message.format)) + message.chunks !== undefined && (obj.chunks = Math.round(message.chunks)) message.hash !== undefined && - (obj.hash = base64FromBytes(message.hash !== undefined ? message.hash : new Uint8Array())); + (obj.hash = base64FromBytes( + message.hash !== undefined ? message.hash : new Uint8Array(), + )) message.metadata !== undefined && - (obj.metadata = base64FromBytes(message.metadata !== undefined ? message.metadata : new Uint8Array())); - return obj; + (obj.metadata = base64FromBytes( + message.metadata !== undefined ? message.metadata : new Uint8Array(), + )) + return obj }, fromPartial, I>>(object: I): Snapshot { - const message = createBaseSnapshot(); - message.height = (object.height !== undefined && object.height !== null) - ? Long.fromValue(object.height) - : Long.UZERO; - message.format = object.format ?? 0; - message.chunks = object.chunks ?? 0; - message.hash = object.hash ?? new Uint8Array(); - message.metadata = object.metadata ?? new Uint8Array(); - return message; - }, -}; + const message = createBaseSnapshot() + message.height = + object.height !== undefined && object.height !== null + ? Long.fromValue(object.height) + : Long.UZERO + message.format = object.format ?? 0 + message.chunks = object.chunks ?? 0 + message.hash = object.hash ?? new Uint8Array() + message.metadata = object.metadata ?? new Uint8Array() + return message + }, +} export interface ABCIApplication { - Echo(request: RequestEcho): Promise; - Flush(request: RequestFlush): Promise; - Info(request: RequestInfo): Promise; - SetOption(request: RequestSetOption): Promise; - DeliverTx(request: RequestDeliverTx): Promise; - CheckTx(request: RequestCheckTx): Promise; - Query(request: RequestQuery): Promise; - Commit(request: RequestCommit): Promise; - InitChain(request: RequestInitChain): Promise; - BeginBlock(request: RequestBeginBlock): Promise; - EndBlock(request: RequestEndBlock): Promise; - ListSnapshots(request: RequestListSnapshots): Promise; - OfferSnapshot(request: RequestOfferSnapshot): Promise; - LoadSnapshotChunk(request: RequestLoadSnapshotChunk): Promise; - ApplySnapshotChunk(request: RequestApplySnapshotChunk): Promise; + Echo(request: RequestEcho): Promise + Flush(request: RequestFlush): Promise + Info(request: RequestInfo): Promise + SetOption(request: RequestSetOption): Promise + DeliverTx(request: RequestDeliverTx): Promise + CheckTx(request: RequestCheckTx): Promise + Query(request: RequestQuery): Promise + Commit(request: RequestCommit): Promise + InitChain(request: RequestInitChain): Promise + BeginBlock(request: RequestBeginBlock): Promise + EndBlock(request: RequestEndBlock): Promise + ListSnapshots(request: RequestListSnapshots): Promise + OfferSnapshot(request: RequestOfferSnapshot): Promise + LoadSnapshotChunk( + request: RequestLoadSnapshotChunk, + ): Promise + ApplySnapshotChunk( + request: RequestApplySnapshotChunk, + ): Promise } export class ABCIApplicationClientImpl implements ABCIApplication { - private readonly rpc: Rpc; + private readonly rpc: Rpc constructor(rpc: Rpc) { - this.rpc = rpc; - this.Echo = this.Echo.bind(this); - this.Flush = this.Flush.bind(this); - this.Info = this.Info.bind(this); - this.SetOption = this.SetOption.bind(this); - this.DeliverTx = this.DeliverTx.bind(this); - this.CheckTx = this.CheckTx.bind(this); - this.Query = this.Query.bind(this); - this.Commit = this.Commit.bind(this); - this.InitChain = this.InitChain.bind(this); - this.BeginBlock = this.BeginBlock.bind(this); - this.EndBlock = this.EndBlock.bind(this); - this.ListSnapshots = this.ListSnapshots.bind(this); - this.OfferSnapshot = this.OfferSnapshot.bind(this); - this.LoadSnapshotChunk = this.LoadSnapshotChunk.bind(this); - this.ApplySnapshotChunk = this.ApplySnapshotChunk.bind(this); + this.rpc = rpc + this.Echo = this.Echo.bind(this) + this.Flush = this.Flush.bind(this) + this.Info = this.Info.bind(this) + this.SetOption = this.SetOption.bind(this) + this.DeliverTx = this.DeliverTx.bind(this) + this.CheckTx = this.CheckTx.bind(this) + this.Query = this.Query.bind(this) + this.Commit = this.Commit.bind(this) + this.InitChain = this.InitChain.bind(this) + this.BeginBlock = this.BeginBlock.bind(this) + this.EndBlock = this.EndBlock.bind(this) + this.ListSnapshots = this.ListSnapshots.bind(this) + this.OfferSnapshot = this.OfferSnapshot.bind(this) + this.LoadSnapshotChunk = this.LoadSnapshotChunk.bind(this) + this.ApplySnapshotChunk = this.ApplySnapshotChunk.bind(this) } Echo(request: RequestEcho): Promise { - const data = RequestEcho.encode(request).finish(); - const promise = this.rpc.request("tendermint.abci.ABCIApplication", "Echo", data); - return promise.then((data) => ResponseEcho.decode(new _m0.Reader(data))); + const data = RequestEcho.encode(request).finish() + const promise = this.rpc.request("tendermint.abci.ABCIApplication", "Echo", data) + return promise.then((data) => ResponseEcho.decode(new _m0.Reader(data))) } Flush(request: RequestFlush): Promise { - const data = RequestFlush.encode(request).finish(); - const promise = this.rpc.request("tendermint.abci.ABCIApplication", "Flush", data); - return promise.then((data) => ResponseFlush.decode(new _m0.Reader(data))); + const data = RequestFlush.encode(request).finish() + const promise = this.rpc.request("tendermint.abci.ABCIApplication", "Flush", data) + return promise.then((data) => ResponseFlush.decode(new _m0.Reader(data))) } Info(request: RequestInfo): Promise { - const data = RequestInfo.encode(request).finish(); - const promise = this.rpc.request("tendermint.abci.ABCIApplication", "Info", data); - return promise.then((data) => ResponseInfo.decode(new _m0.Reader(data))); + const data = RequestInfo.encode(request).finish() + const promise = this.rpc.request("tendermint.abci.ABCIApplication", "Info", data) + return promise.then((data) => ResponseInfo.decode(new _m0.Reader(data))) } SetOption(request: RequestSetOption): Promise { - const data = RequestSetOption.encode(request).finish(); - const promise = this.rpc.request("tendermint.abci.ABCIApplication", "SetOption", data); - return promise.then((data) => ResponseSetOption.decode(new _m0.Reader(data))); + const data = RequestSetOption.encode(request).finish() + const promise = this.rpc.request( + "tendermint.abci.ABCIApplication", + "SetOption", + data, + ) + return promise.then((data) => ResponseSetOption.decode(new _m0.Reader(data))) } DeliverTx(request: RequestDeliverTx): Promise { - const data = RequestDeliverTx.encode(request).finish(); - const promise = this.rpc.request("tendermint.abci.ABCIApplication", "DeliverTx", data); - return promise.then((data) => ResponseDeliverTx.decode(new _m0.Reader(data))); + const data = RequestDeliverTx.encode(request).finish() + const promise = this.rpc.request( + "tendermint.abci.ABCIApplication", + "DeliverTx", + data, + ) + return promise.then((data) => ResponseDeliverTx.decode(new _m0.Reader(data))) } CheckTx(request: RequestCheckTx): Promise { - const data = RequestCheckTx.encode(request).finish(); - const promise = this.rpc.request("tendermint.abci.ABCIApplication", "CheckTx", data); - return promise.then((data) => ResponseCheckTx.decode(new _m0.Reader(data))); + const data = RequestCheckTx.encode(request).finish() + const promise = this.rpc.request("tendermint.abci.ABCIApplication", "CheckTx", data) + return promise.then((data) => ResponseCheckTx.decode(new _m0.Reader(data))) } Query(request: RequestQuery): Promise { - const data = RequestQuery.encode(request).finish(); - const promise = this.rpc.request("tendermint.abci.ABCIApplication", "Query", data); - return promise.then((data) => ResponseQuery.decode(new _m0.Reader(data))); + const data = RequestQuery.encode(request).finish() + const promise = this.rpc.request("tendermint.abci.ABCIApplication", "Query", data) + return promise.then((data) => ResponseQuery.decode(new _m0.Reader(data))) } Commit(request: RequestCommit): Promise { - const data = RequestCommit.encode(request).finish(); - const promise = this.rpc.request("tendermint.abci.ABCIApplication", "Commit", data); - return promise.then((data) => ResponseCommit.decode(new _m0.Reader(data))); + const data = RequestCommit.encode(request).finish() + const promise = this.rpc.request("tendermint.abci.ABCIApplication", "Commit", data) + return promise.then((data) => ResponseCommit.decode(new _m0.Reader(data))) } InitChain(request: RequestInitChain): Promise { - const data = RequestInitChain.encode(request).finish(); - const promise = this.rpc.request("tendermint.abci.ABCIApplication", "InitChain", data); - return promise.then((data) => ResponseInitChain.decode(new _m0.Reader(data))); + const data = RequestInitChain.encode(request).finish() + const promise = this.rpc.request( + "tendermint.abci.ABCIApplication", + "InitChain", + data, + ) + return promise.then((data) => ResponseInitChain.decode(new _m0.Reader(data))) } BeginBlock(request: RequestBeginBlock): Promise { - const data = RequestBeginBlock.encode(request).finish(); - const promise = this.rpc.request("tendermint.abci.ABCIApplication", "BeginBlock", data); - return promise.then((data) => ResponseBeginBlock.decode(new _m0.Reader(data))); + const data = RequestBeginBlock.encode(request).finish() + const promise = this.rpc.request( + "tendermint.abci.ABCIApplication", + "BeginBlock", + data, + ) + return promise.then((data) => ResponseBeginBlock.decode(new _m0.Reader(data))) } EndBlock(request: RequestEndBlock): Promise { - const data = RequestEndBlock.encode(request).finish(); - const promise = this.rpc.request("tendermint.abci.ABCIApplication", "EndBlock", data); - return promise.then((data) => ResponseEndBlock.decode(new _m0.Reader(data))); + const data = RequestEndBlock.encode(request).finish() + const promise = this.rpc.request( + "tendermint.abci.ABCIApplication", + "EndBlock", + data, + ) + return promise.then((data) => ResponseEndBlock.decode(new _m0.Reader(data))) } ListSnapshots(request: RequestListSnapshots): Promise { - const data = RequestListSnapshots.encode(request).finish(); - const promise = this.rpc.request("tendermint.abci.ABCIApplication", "ListSnapshots", data); - return promise.then((data) => ResponseListSnapshots.decode(new _m0.Reader(data))); + const data = RequestListSnapshots.encode(request).finish() + const promise = this.rpc.request( + "tendermint.abci.ABCIApplication", + "ListSnapshots", + data, + ) + return promise.then((data) => ResponseListSnapshots.decode(new _m0.Reader(data))) } OfferSnapshot(request: RequestOfferSnapshot): Promise { - const data = RequestOfferSnapshot.encode(request).finish(); - const promise = this.rpc.request("tendermint.abci.ABCIApplication", "OfferSnapshot", data); - return promise.then((data) => ResponseOfferSnapshot.decode(new _m0.Reader(data))); + const data = RequestOfferSnapshot.encode(request).finish() + const promise = this.rpc.request( + "tendermint.abci.ABCIApplication", + "OfferSnapshot", + data, + ) + return promise.then((data) => ResponseOfferSnapshot.decode(new _m0.Reader(data))) } - LoadSnapshotChunk(request: RequestLoadSnapshotChunk): Promise { - const data = RequestLoadSnapshotChunk.encode(request).finish(); - const promise = this.rpc.request("tendermint.abci.ABCIApplication", "LoadSnapshotChunk", data); - return promise.then((data) => ResponseLoadSnapshotChunk.decode(new _m0.Reader(data))); + LoadSnapshotChunk( + request: RequestLoadSnapshotChunk, + ): Promise { + const data = RequestLoadSnapshotChunk.encode(request).finish() + const promise = this.rpc.request( + "tendermint.abci.ABCIApplication", + "LoadSnapshotChunk", + data, + ) + return promise.then((data) => + ResponseLoadSnapshotChunk.decode(new _m0.Reader(data)), + ) } - ApplySnapshotChunk(request: RequestApplySnapshotChunk): Promise { - const data = RequestApplySnapshotChunk.encode(request).finish(); - const promise = this.rpc.request("tendermint.abci.ABCIApplication", "ApplySnapshotChunk", data); - return promise.then((data) => ResponseApplySnapshotChunk.decode(new _m0.Reader(data))); + ApplySnapshotChunk( + request: RequestApplySnapshotChunk, + ): Promise { + const data = RequestApplySnapshotChunk.encode(request).finish() + const promise = this.rpc.request( + "tendermint.abci.ABCIApplication", + "ApplySnapshotChunk", + data, + ) + return promise.then((data) => + ResponseApplySnapshotChunk.decode(new _m0.Reader(data)), + ) } } interface Rpc { - request(service: string, method: string, data: Uint8Array): Promise; + request(service: string, method: string, data: Uint8Array): Promise } -declare var self: any | undefined; -declare var window: any | undefined; -declare var global: any | undefined; +declare var self: any | undefined +declare var window: any | undefined +declare var global: any | undefined var globalThis: any = (() => { - if (typeof globalThis !== "undefined") { - return globalThis; - } - if (typeof self !== "undefined") { - return self; - } - if (typeof window !== "undefined") { - return window; - } - if (typeof global !== "undefined") { - return global; - } - throw "Unable to locate global object"; -})(); - + if (typeof globalThis !== "undefined") return globalThis + if (typeof self !== "undefined") return self + if (typeof window !== "undefined") return window + if (typeof global !== "undefined") return global + throw "Unable to locate global object" +})() + +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")) function bytesFromBase64(b64: string): Uint8Array { - if (globalThis.Buffer) { - return Uint8Array.from(globalThis.Buffer.from(b64, "base64")); - } else { - const bin = globalThis.atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; + 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 } +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")) function base64FromBytes(arr: Uint8Array): string { - if (globalThis.Buffer) { - return globalThis.Buffer.from(arr).toString("base64"); - } else { - const bin: string[] = []; - arr.forEach((byte) => { - bin.push(String.fromCharCode(byte)); - }); - return globalThis.btoa(bin.join("")); - } + const bin: string[] = [] + arr.forEach((byte) => { + bin.push(String.fromCharCode(byte)) + }) + return btoa(bin.join("")) } -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > function toTimestamp(date: Date): Timestamp { - const seconds = numberToLong(date.getTime() / 1_000); - const nanos = (date.getTime() % 1_000) * 1_000_000; - return { seconds, nanos }; + const seconds = numberToLong(date.getTime() / 1_000) + const nanos = (date.getTime() % 1_000) * 1_000_000 + return { seconds, nanos } } function fromTimestamp(t: Timestamp): Date { - let millis = t.seconds.toNumber() * 1_000; - millis += t.nanos / 1_000_000; - return new Date(millis); + let millis = t.seconds.toNumber() * 1_000 + millis += t.nanos / 1_000_000 + return new Date(millis) } function fromJsonTimestamp(o: any): Date { if (o instanceof Date) { - return o; + return o } else if (typeof o === "string") { - return new Date(o); + return new Date(o) } else { - return fromTimestamp(Timestamp.fromJSON(o)); + return fromTimestamp(Timestamp.fromJSON(o)) } } function numberToLong(number: number) { - return Long.fromNumber(number); + return Long.fromNumber(number) } if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/tendermint/crypto/keys.ts b/packages/protojs/src/tendermint/crypto/keys.ts index f87ea39e..35102668 100644 --- a/packages/protojs/src/tendermint/crypto/keys.ts +++ b/packages/protojs/src/tendermint/crypto/keys.ts @@ -1,136 +1,140 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "tendermint.crypto"; +export const protobufPackage = "tendermint.crypto" /** PublicKey defines the keys available for use with Tendermint Validators */ export interface PublicKey { - ed25519: Uint8Array | undefined; - secp256k1: Uint8Array | undefined; + ed25519: Uint8Array | undefined + secp256k1: Uint8Array | undefined } function createBasePublicKey(): PublicKey { - return { ed25519: undefined, secp256k1: undefined }; + return { ed25519: undefined, secp256k1: undefined } } export const PublicKey = { encode(message: PublicKey, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.ed25519 !== undefined) { - writer.uint32(10).bytes(message.ed25519); + writer.uint32(10).bytes(message.ed25519) } if (message.secp256k1 !== undefined) { - writer.uint32(18).bytes(message.secp256k1); + writer.uint32(18).bytes(message.secp256k1) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): PublicKey { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBasePublicKey(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBasePublicKey() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.ed25519 = reader.bytes(); - break; + message.ed25519 = reader.bytes() + break case 2: - message.secp256k1 = reader.bytes(); - break; + message.secp256k1 = reader.bytes() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): PublicKey { return { ed25519: isSet(object.ed25519) ? bytesFromBase64(object.ed25519) : undefined, - secp256k1: isSet(object.secp256k1) ? bytesFromBase64(object.secp256k1) : undefined, - }; + secp256k1: isSet(object.secp256k1) + ? bytesFromBase64(object.secp256k1) + : undefined, + } }, toJSON(message: PublicKey): unknown { - const obj: any = {}; + const obj: any = {} message.ed25519 !== undefined && - (obj.ed25519 = message.ed25519 !== undefined ? base64FromBytes(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; + (obj.secp256k1 = + message.secp256k1 !== undefined + ? base64FromBytes(message.secp256k1) + : undefined) + return obj }, fromPartial, I>>(object: I): PublicKey { - const message = createBasePublicKey(); - message.ed25519 = object.ed25519 ?? undefined; - message.secp256k1 = object.secp256k1 ?? undefined; - return message; + const message = createBasePublicKey() + message.ed25519 = object.ed25519 ?? undefined + message.secp256k1 = object.secp256k1 ?? undefined + return message }, -}; +} -declare var self: any | undefined; -declare var window: any | undefined; -declare var global: any | undefined; +declare var self: any | undefined +declare var window: any | undefined +declare var global: any | undefined var globalThis: any = (() => { - if (typeof globalThis !== "undefined") { - return globalThis; - } - if (typeof self !== "undefined") { - return self; - } - if (typeof window !== "undefined") { - return window; - } - if (typeof global !== "undefined") { - return global; - } - throw "Unable to locate global object"; -})(); - + if (typeof globalThis !== "undefined") return globalThis + if (typeof self !== "undefined") return self + if (typeof window !== "undefined") return window + if (typeof global !== "undefined") return global + throw "Unable to locate global object" +})() + +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")) function bytesFromBase64(b64: string): Uint8Array { - if (globalThis.Buffer) { - return Uint8Array.from(globalThis.Buffer.from(b64, "base64")); - } else { - const bin = globalThis.atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; + 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 } +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")) function base64FromBytes(arr: Uint8Array): string { - if (globalThis.Buffer) { - return globalThis.Buffer.from(arr).toString("base64"); - } else { - const bin: string[] = []; - arr.forEach((byte) => { - bin.push(String.fromCharCode(byte)); - }); - return globalThis.btoa(bin.join("")); - } + const bin: string[] = [] + arr.forEach((byte) => { + bin.push(String.fromCharCode(byte)) + }) + return btoa(bin.join("")) } -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/tendermint/crypto/proof.ts b/packages/protojs/src/tendermint/crypto/proof.ts index f389dbce..140f1d9b 100644 --- a/packages/protojs/src/tendermint/crypto/proof.ts +++ b/packages/protojs/src/tendermint/crypto/proof.ts @@ -1,27 +1,27 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "tendermint.crypto"; +export const protobufPackage = "tendermint.crypto" export interface Proof { - total: Long; - index: Long; - leafHash: Uint8Array; - aunts: Uint8Array[]; + total: Long + index: Long + leafHash: Uint8Array + aunts: Uint8Array[] } export interface ValueOp { /** Encoded in ProofOp.Key. */ - key: Uint8Array; + key: Uint8Array /** To encode in ProofOp.Data */ - proof?: Proof; + proof?: Proof } export interface DominoOp { - key: string; - input: string; - output: string; + key: string + input: string + output: string } /** @@ -30,196 +30,216 @@ export interface DominoOp { * for example neighbouring node hash */ export interface ProofOp { - type: string; - key: Uint8Array; - data: Uint8Array; + type: string + key: Uint8Array + data: Uint8Array } /** ProofOps is Merkle proof defined by the list of ProofOps */ export interface ProofOps { - ops: ProofOp[]; + ops: ProofOp[] } function createBaseProof(): Proof { - return { total: Long.ZERO, index: Long.ZERO, leafHash: new Uint8Array(), aunts: [] }; + return { total: Long.ZERO, index: Long.ZERO, leafHash: new Uint8Array(), aunts: [] } } export const Proof = { encode(message: Proof, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (!message.total.isZero()) { - writer.uint32(8).int64(message.total); + writer.uint32(8).int64(message.total) } if (!message.index.isZero()) { - writer.uint32(16).int64(message.index); + writer.uint32(16).int64(message.index) } if (message.leafHash.length !== 0) { - writer.uint32(26).bytes(message.leafHash); + writer.uint32(26).bytes(message.leafHash) } for (const v of message.aunts) { - writer.uint32(34).bytes(v!); + writer.uint32(34).bytes(v!) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Proof { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseProof(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseProof() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.total = reader.int64() as Long; - break; + message.total = reader.int64() as Long + break case 2: - message.index = reader.int64() as Long; - break; + message.index = reader.int64() as Long + break case 3: - message.leafHash = reader.bytes(); - break; + message.leafHash = reader.bytes() + break case 4: - message.aunts.push(reader.bytes()); - break; + message.aunts.push(reader.bytes()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Proof { return { total: isSet(object.total) ? Long.fromValue(object.total) : Long.ZERO, index: isSet(object.index) ? Long.fromValue(object.index) : Long.ZERO, - leafHash: isSet(object.leafHash) ? bytesFromBase64(object.leafHash) : new Uint8Array(), - aunts: Array.isArray(object?.aunts) ? object.aunts.map((e: any) => bytesFromBase64(e)) : [], - }; + leafHash: isSet(object.leafHash) + ? bytesFromBase64(object.leafHash) + : new Uint8Array(), + aunts: Array.isArray(object?.aunts) + ? object.aunts.map((e: any) => bytesFromBase64(e)) + : [], + } }, toJSON(message: Proof): unknown { - const obj: any = {}; - message.total !== undefined && (obj.total = (message.total || Long.ZERO).toString()); - message.index !== undefined && (obj.index = (message.index || Long.ZERO).toString()); + const obj: any = {} + message.total !== undefined && (obj.total = (message.total || Long.ZERO).toString()) + message.index !== undefined && (obj.index = (message.index || Long.ZERO).toString()) message.leafHash !== undefined && - (obj.leafHash = base64FromBytes(message.leafHash !== undefined ? message.leafHash : new Uint8Array())); + (obj.leafHash = base64FromBytes( + message.leafHash !== undefined ? message.leafHash : new Uint8Array(), + )) if (message.aunts) { - obj.aunts = message.aunts.map((e) => base64FromBytes(e !== undefined ? e : new Uint8Array())); + obj.aunts = message.aunts.map((e) => + base64FromBytes(e !== undefined ? e : new Uint8Array()), + ) } else { - obj.aunts = []; + obj.aunts = [] } - return obj; + return obj }, fromPartial, I>>(object: I): Proof { - const message = createBaseProof(); - message.total = (object.total !== undefined && object.total !== null) ? Long.fromValue(object.total) : Long.ZERO; - message.index = (object.index !== undefined && object.index !== null) ? Long.fromValue(object.index) : Long.ZERO; - message.leafHash = object.leafHash ?? new Uint8Array(); - message.aunts = object.aunts?.map((e) => e) || []; - return message; + const message = createBaseProof() + message.total = + object.total !== undefined && object.total !== null + ? Long.fromValue(object.total) + : Long.ZERO + message.index = + object.index !== undefined && object.index !== null + ? Long.fromValue(object.index) + : Long.ZERO + message.leafHash = object.leafHash ?? new Uint8Array() + message.aunts = object.aunts?.map((e) => e) || [] + return message }, -}; +} function createBaseValueOp(): ValueOp { - return { key: new Uint8Array(), proof: undefined }; + return { key: new Uint8Array(), proof: undefined } } export const ValueOp = { encode(message: ValueOp, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.key.length !== 0) { - writer.uint32(10).bytes(message.key); + writer.uint32(10).bytes(message.key) } if (message.proof !== undefined) { - Proof.encode(message.proof, writer.uint32(18).fork()).ldelim(); + Proof.encode(message.proof, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): ValueOp { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseValueOp(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseValueOp() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.key = reader.bytes(); - break; + message.key = reader.bytes() + break case 2: - message.proof = Proof.decode(reader, reader.uint32()); - break; + message.proof = Proof.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): ValueOp { return { key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array(), proof: isSet(object.proof) ? Proof.fromJSON(object.proof) : undefined, - }; + } }, toJSON(message: ValueOp): unknown { - const obj: any = {}; + const obj: any = {} message.key !== undefined && - (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); - message.proof !== undefined && (obj.proof = message.proof ? Proof.toJSON(message.proof) : undefined); - return obj; + (obj.key = base64FromBytes( + message.key !== undefined ? message.key : new Uint8Array(), + )) + message.proof !== undefined && + (obj.proof = message.proof ? Proof.toJSON(message.proof) : undefined) + return obj }, fromPartial, I>>(object: I): ValueOp { - const message = createBaseValueOp(); - message.key = object.key ?? new Uint8Array(); - message.proof = (object.proof !== undefined && object.proof !== null) ? Proof.fromPartial(object.proof) : undefined; - return message; + const message = createBaseValueOp() + message.key = object.key ?? new Uint8Array() + message.proof = + object.proof !== undefined && object.proof !== null + ? Proof.fromPartial(object.proof) + : undefined + return message }, -}; +} function createBaseDominoOp(): DominoOp { - return { key: "", input: "", output: "" }; + return { key: "", input: "", output: "" } } export const DominoOp = { encode(message: DominoOp, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.key !== "") { - writer.uint32(10).string(message.key); + writer.uint32(10).string(message.key) } if (message.input !== "") { - writer.uint32(18).string(message.input); + writer.uint32(18).string(message.input) } if (message.output !== "") { - writer.uint32(26).string(message.output); + writer.uint32(26).string(message.output) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): DominoOp { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDominoOp(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseDominoOp() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.key = reader.string(); - break; + message.key = reader.string() + break case 2: - message.input = reader.string(); - break; + message.input = reader.string() + break case 3: - message.output = reader.string(); - break; + message.output = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): DominoOp { @@ -227,66 +247,66 @@ export const DominoOp = { key: isSet(object.key) ? String(object.key) : "", input: isSet(object.input) ? String(object.input) : "", output: isSet(object.output) ? String(object.output) : "", - }; + } }, toJSON(message: DominoOp): unknown { - const obj: any = {}; - message.key !== undefined && (obj.key = message.key); - message.input !== undefined && (obj.input = message.input); - message.output !== undefined && (obj.output = message.output); - return obj; + const obj: any = {} + message.key !== undefined && (obj.key = message.key) + message.input !== undefined && (obj.input = message.input) + message.output !== undefined && (obj.output = message.output) + return obj }, fromPartial, I>>(object: I): DominoOp { - const message = createBaseDominoOp(); - message.key = object.key ?? ""; - message.input = object.input ?? ""; - message.output = object.output ?? ""; - return message; + const message = createBaseDominoOp() + message.key = object.key ?? "" + message.input = object.input ?? "" + message.output = object.output ?? "" + return message }, -}; +} function createBaseProofOp(): ProofOp { - return { type: "", key: new Uint8Array(), data: new Uint8Array() }; + return { type: "", key: new Uint8Array(), data: new Uint8Array() } } export const ProofOp = { encode(message: ProofOp, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.type !== "") { - writer.uint32(10).string(message.type); + writer.uint32(10).string(message.type) } if (message.key.length !== 0) { - writer.uint32(18).bytes(message.key); + writer.uint32(18).bytes(message.key) } if (message.data.length !== 0) { - writer.uint32(26).bytes(message.data); + writer.uint32(26).bytes(message.data) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): ProofOp { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseProofOp(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseProofOp() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.type = reader.string(); - break; + message.type = reader.string() + break case 2: - message.key = reader.bytes(); - break; + message.key = reader.bytes() + break case 3: - message.data = reader.bytes(); - break; + message.data = reader.bytes() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): ProofOp { @@ -294,140 +314,146 @@ export const ProofOp = { type: isSet(object.type) ? String(object.type) : "", key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array(), data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(), - }; + } }, toJSON(message: ProofOp): unknown { - const obj: any = {}; - message.type !== undefined && (obj.type = message.type); + const obj: any = {} + message.type !== undefined && (obj.type = message.type) message.key !== undefined && - (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); + (obj.key = base64FromBytes( + message.key !== undefined ? message.key : new Uint8Array(), + )) message.data !== undefined && - (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); - return obj; + (obj.data = base64FromBytes( + message.data !== undefined ? message.data : new Uint8Array(), + )) + return obj }, fromPartial, I>>(object: I): ProofOp { - const message = createBaseProofOp(); - message.type = object.type ?? ""; - message.key = object.key ?? new Uint8Array(); - message.data = object.data ?? new Uint8Array(); - return message; + const message = createBaseProofOp() + message.type = object.type ?? "" + message.key = object.key ?? new Uint8Array() + message.data = object.data ?? new Uint8Array() + return message }, -}; +} function createBaseProofOps(): ProofOps { - return { ops: [] }; + return { ops: [] } } export const ProofOps = { encode(message: ProofOps, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.ops) { - ProofOp.encode(v!, writer.uint32(10).fork()).ldelim(); + ProofOp.encode(v!, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): ProofOps { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseProofOps(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseProofOps() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.ops.push(ProofOp.decode(reader, reader.uint32())); - break; + message.ops.push(ProofOp.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): ProofOps { - return { ops: Array.isArray(object?.ops) ? object.ops.map((e: any) => ProofOp.fromJSON(e)) : [] }; + return { + ops: Array.isArray(object?.ops) + ? object.ops.map((e: any) => ProofOp.fromJSON(e)) + : [], + } }, toJSON(message: ProofOps): unknown { - const obj: any = {}; + const obj: any = {} if (message.ops) { - obj.ops = message.ops.map((e) => e ? ProofOp.toJSON(e) : undefined); + obj.ops = message.ops.map((e) => (e ? ProofOp.toJSON(e) : undefined)) } else { - obj.ops = []; + obj.ops = [] } - return obj; + return obj }, fromPartial, I>>(object: I): ProofOps { - const message = createBaseProofOps(); - message.ops = object.ops?.map((e) => ProofOp.fromPartial(e)) || []; - return message; + const message = createBaseProofOps() + message.ops = object.ops?.map((e) => ProofOp.fromPartial(e)) || [] + return message }, -}; +} -declare var self: any | undefined; -declare var window: any | undefined; -declare var global: any | undefined; +declare var self: any | undefined +declare var window: any | undefined +declare var global: any | undefined var globalThis: any = (() => { - if (typeof globalThis !== "undefined") { - return globalThis; - } - if (typeof self !== "undefined") { - return self; - } - if (typeof window !== "undefined") { - return window; - } - if (typeof global !== "undefined") { - return global; - } - throw "Unable to locate global object"; -})(); - + if (typeof globalThis !== "undefined") return globalThis + if (typeof self !== "undefined") return self + if (typeof window !== "undefined") return window + if (typeof global !== "undefined") return global + throw "Unable to locate global object" +})() + +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")) function bytesFromBase64(b64: string): Uint8Array { - if (globalThis.Buffer) { - return Uint8Array.from(globalThis.Buffer.from(b64, "base64")); - } else { - const bin = globalThis.atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; + 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 } +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")) function base64FromBytes(arr: Uint8Array): string { - if (globalThis.Buffer) { - return globalThis.Buffer.from(arr).toString("base64"); - } else { - const bin: string[] = []; - arr.forEach((byte) => { - bin.push(String.fromCharCode(byte)); - }); - return globalThis.btoa(bin.join("")); - } + const bin: string[] = [] + arr.forEach((byte) => { + bin.push(String.fromCharCode(byte)) + }) + return btoa(bin.join("")) } -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/tendermint/libs/bits/types.ts b/packages/protojs/src/tendermint/libs/bits/types.ts index b499b032..c8490328 100644 --- a/packages/protojs/src/tendermint/libs/bits/types.ts +++ b/packages/protojs/src/tendermint/libs/bits/types.ts @@ -1,102 +1,117 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "tendermint.libs.bits"; +export const protobufPackage = "tendermint.libs.bits" export interface BitArray { - bits: Long; - elems: Long[]; + bits: Long + elems: Long[] } function createBaseBitArray(): BitArray { - return { bits: Long.ZERO, elems: [] }; + return { bits: Long.ZERO, elems: [] } } export const BitArray = { encode(message: BitArray, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (!message.bits.isZero()) { - writer.uint32(8).int64(message.bits); + writer.uint32(8).int64(message.bits) } - writer.uint32(18).fork(); + writer.uint32(18).fork() for (const v of message.elems) { - writer.uint64(v); + writer.uint64(v) } - writer.ldelim(); - return writer; + writer.ldelim() + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): BitArray { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseBitArray(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseBitArray() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.bits = reader.int64() as Long; - break; + message.bits = reader.int64() as Long + break case 2: if ((tag & 7) === 2) { - const end2 = reader.uint32() + reader.pos; + const end2 = reader.uint32() + reader.pos while (reader.pos < end2) { - message.elems.push(reader.uint64() as Long); + message.elems.push(reader.uint64() as Long) } } else { - message.elems.push(reader.uint64() as Long); + message.elems.push(reader.uint64() as Long) } - break; + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): BitArray { return { bits: isSet(object.bits) ? Long.fromValue(object.bits) : Long.ZERO, - elems: Array.isArray(object?.elems) ? object.elems.map((e: any) => Long.fromValue(e)) : [], - }; + elems: Array.isArray(object?.elems) + ? object.elems.map((e: any) => Long.fromValue(e)) + : [], + } }, toJSON(message: BitArray): unknown { - const obj: any = {}; - message.bits !== undefined && (obj.bits = (message.bits || Long.ZERO).toString()); + const obj: any = {} + message.bits !== undefined && (obj.bits = (message.bits || Long.ZERO).toString()) if (message.elems) { - obj.elems = message.elems.map((e) => (e || Long.UZERO).toString()); + obj.elems = message.elems.map((e) => (e || Long.UZERO).toString()) } else { - obj.elems = []; + obj.elems = [] } - return obj; + return obj }, fromPartial, I>>(object: I): BitArray { - const message = createBaseBitArray(); - message.bits = (object.bits !== undefined && object.bits !== null) ? Long.fromValue(object.bits) : Long.ZERO; - message.elems = object.elems?.map((e) => Long.fromValue(e)) || []; - return message; + const message = createBaseBitArray() + message.bits = + object.bits !== undefined && object.bits !== null + ? Long.fromValue(object.bits) + : Long.ZERO + message.elems = object.elems?.map((e) => Long.fromValue(e)) || [] + return message }, -}; +} -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/tendermint/p2p/types.ts b/packages/protojs/src/tendermint/p2p/types.ts index 750e62b7..8713f731 100644 --- a/packages/protojs/src/tendermint/p2p/types.ts +++ b/packages/protojs/src/tendermint/p2p/types.ts @@ -1,77 +1,77 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "tendermint.p2p"; +export const protobufPackage = "tendermint.p2p" export interface NetAddress { - id: string; - ip: string; - port: number; + id: string + ip: string + port: number } export interface ProtocolVersion { - p2p: Long; - block: Long; - app: Long; + p2p: Long + block: Long + app: Long } export interface DefaultNodeInfo { - protocolVersion?: ProtocolVersion; - defaultNodeId: string; - listenAddr: string; - network: string; - version: string; - channels: Uint8Array; - moniker: string; - other?: DefaultNodeInfoOther; + protocolVersion?: ProtocolVersion + defaultNodeId: string + listenAddr: string + network: string + version: string + channels: Uint8Array + moniker: string + other?: DefaultNodeInfoOther } export interface DefaultNodeInfoOther { - txIndex: string; - rpcAddress: string; + txIndex: string + rpcAddress: string } function createBaseNetAddress(): NetAddress { - return { id: "", ip: "", port: 0 }; + return { id: "", ip: "", port: 0 } } export const NetAddress = { encode(message: NetAddress, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.id !== "") { - writer.uint32(10).string(message.id); + writer.uint32(10).string(message.id) } if (message.ip !== "") { - writer.uint32(18).string(message.ip); + writer.uint32(18).string(message.ip) } if (message.port !== 0) { - writer.uint32(24).uint32(message.port); + writer.uint32(24).uint32(message.port) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): NetAddress { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseNetAddress(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseNetAddress() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.id = reader.string(); - break; + message.id = reader.string() + break case 2: - message.ip = reader.string(); - break; + message.ip = reader.string() + break case 3: - message.port = reader.uint32(); - break; + message.port = reader.uint32() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): NetAddress { @@ -79,66 +79,69 @@ export const NetAddress = { id: isSet(object.id) ? String(object.id) : "", ip: isSet(object.ip) ? String(object.ip) : "", port: isSet(object.port) ? Number(object.port) : 0, - }; + } }, toJSON(message: NetAddress): unknown { - const obj: any = {}; - message.id !== undefined && (obj.id = message.id); - message.ip !== undefined && (obj.ip = message.ip); - message.port !== undefined && (obj.port = Math.round(message.port)); - return obj; + const obj: any = {} + message.id !== undefined && (obj.id = message.id) + message.ip !== undefined && (obj.ip = message.ip) + message.port !== undefined && (obj.port = Math.round(message.port)) + return obj }, fromPartial, I>>(object: I): NetAddress { - const message = createBaseNetAddress(); - message.id = object.id ?? ""; - message.ip = object.ip ?? ""; - message.port = object.port ?? 0; - return message; + const message = createBaseNetAddress() + message.id = object.id ?? "" + message.ip = object.ip ?? "" + message.port = object.port ?? 0 + return message }, -}; +} function createBaseProtocolVersion(): ProtocolVersion { - return { p2p: Long.UZERO, block: Long.UZERO, app: Long.UZERO }; + return { p2p: Long.UZERO, block: Long.UZERO, app: Long.UZERO } } export const ProtocolVersion = { - encode(message: ProtocolVersion, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: ProtocolVersion, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (!message.p2p.isZero()) { - writer.uint32(8).uint64(message.p2p); + writer.uint32(8).uint64(message.p2p) } if (!message.block.isZero()) { - writer.uint32(16).uint64(message.block); + writer.uint32(16).uint64(message.block) } if (!message.app.isZero()) { - writer.uint32(24).uint64(message.app); + writer.uint32(24).uint64(message.app) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): ProtocolVersion { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseProtocolVersion(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseProtocolVersion() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.p2p = reader.uint64() as Long; - break; + message.p2p = reader.uint64() as Long + break case 2: - message.block = reader.uint64() as Long; - break; + message.block = reader.uint64() as Long + break case 3: - message.app = reader.uint64() as Long; - break; + message.app = reader.uint64() as Long + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): ProtocolVersion { @@ -146,25 +149,37 @@ export const ProtocolVersion = { p2p: isSet(object.p2p) ? Long.fromValue(object.p2p) : Long.UZERO, block: isSet(object.block) ? Long.fromValue(object.block) : Long.UZERO, app: isSet(object.app) ? Long.fromValue(object.app) : Long.UZERO, - }; + } }, toJSON(message: ProtocolVersion): unknown { - const obj: any = {}; - message.p2p !== undefined && (obj.p2p = (message.p2p || Long.UZERO).toString()); - message.block !== undefined && (obj.block = (message.block || Long.UZERO).toString()); - message.app !== undefined && (obj.app = (message.app || Long.UZERO).toString()); - return obj; + const obj: any = {} + message.p2p !== undefined && (obj.p2p = (message.p2p || Long.UZERO).toString()) + message.block !== undefined && + (obj.block = (message.block || Long.UZERO).toString()) + message.app !== undefined && (obj.app = (message.app || Long.UZERO).toString()) + return obj }, - fromPartial, I>>(object: I): ProtocolVersion { - const message = createBaseProtocolVersion(); - message.p2p = (object.p2p !== undefined && object.p2p !== null) ? Long.fromValue(object.p2p) : Long.UZERO; - message.block = (object.block !== undefined && object.block !== null) ? Long.fromValue(object.block) : Long.UZERO; - message.app = (object.app !== undefined && object.app !== null) ? Long.fromValue(object.app) : Long.UZERO; - return message; + fromPartial, I>>( + object: I, + ): ProtocolVersion { + const message = createBaseProtocolVersion() + message.p2p = + object.p2p !== undefined && object.p2p !== null + ? Long.fromValue(object.p2p) + : Long.UZERO + message.block = + object.block !== undefined && object.block !== null + ? Long.fromValue(object.block) + : Long.UZERO + message.app = + object.app !== undefined && object.app !== null + ? Long.fromValue(object.app) + : Long.UZERO + return message }, -}; +} function createBaseDefaultNodeInfo(): DefaultNodeInfo { return { @@ -176,242 +191,265 @@ function createBaseDefaultNodeInfo(): DefaultNodeInfo { channels: new Uint8Array(), moniker: "", other: undefined, - }; + } } export const DefaultNodeInfo = { - encode(message: DefaultNodeInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: DefaultNodeInfo, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.protocolVersion !== undefined) { - ProtocolVersion.encode(message.protocolVersion, writer.uint32(10).fork()).ldelim(); + ProtocolVersion.encode(message.protocolVersion, writer.uint32(10).fork()).ldelim() } if (message.defaultNodeId !== "") { - writer.uint32(18).string(message.defaultNodeId); + writer.uint32(18).string(message.defaultNodeId) } if (message.listenAddr !== "") { - writer.uint32(26).string(message.listenAddr); + writer.uint32(26).string(message.listenAddr) } if (message.network !== "") { - writer.uint32(34).string(message.network); + writer.uint32(34).string(message.network) } if (message.version !== "") { - writer.uint32(42).string(message.version); + writer.uint32(42).string(message.version) } if (message.channels.length !== 0) { - writer.uint32(50).bytes(message.channels); + writer.uint32(50).bytes(message.channels) } if (message.moniker !== "") { - writer.uint32(58).string(message.moniker); + writer.uint32(58).string(message.moniker) } if (message.other !== undefined) { - DefaultNodeInfoOther.encode(message.other, writer.uint32(66).fork()).ldelim(); + DefaultNodeInfoOther.encode(message.other, writer.uint32(66).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): DefaultNodeInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDefaultNodeInfo(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseDefaultNodeInfo() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.protocolVersion = ProtocolVersion.decode(reader, reader.uint32()); - break; + message.protocolVersion = ProtocolVersion.decode(reader, reader.uint32()) + break case 2: - message.defaultNodeId = reader.string(); - break; + message.defaultNodeId = reader.string() + break case 3: - message.listenAddr = reader.string(); - break; + message.listenAddr = reader.string() + break case 4: - message.network = reader.string(); - break; + message.network = reader.string() + break case 5: - message.version = reader.string(); - break; + message.version = reader.string() + break case 6: - message.channels = reader.bytes(); - break; + message.channels = reader.bytes() + break case 7: - message.moniker = reader.string(); - break; + message.moniker = reader.string() + break case 8: - message.other = DefaultNodeInfoOther.decode(reader, reader.uint32()); - break; + message.other = DefaultNodeInfoOther.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): DefaultNodeInfo { return { - protocolVersion: isSet(object.protocolVersion) ? ProtocolVersion.fromJSON(object.protocolVersion) : undefined, + protocolVersion: isSet(object.protocolVersion) + ? ProtocolVersion.fromJSON(object.protocolVersion) + : undefined, defaultNodeId: isSet(object.defaultNodeId) ? String(object.defaultNodeId) : "", listenAddr: isSet(object.listenAddr) ? String(object.listenAddr) : "", network: isSet(object.network) ? String(object.network) : "", version: isSet(object.version) ? String(object.version) : "", - channels: isSet(object.channels) ? bytesFromBase64(object.channels) : new Uint8Array(), + channels: isSet(object.channels) + ? bytesFromBase64(object.channels) + : new Uint8Array(), moniker: isSet(object.moniker) ? String(object.moniker) : "", - other: isSet(object.other) ? DefaultNodeInfoOther.fromJSON(object.other) : undefined, - }; + other: isSet(object.other) + ? DefaultNodeInfoOther.fromJSON(object.other) + : undefined, + } }, toJSON(message: DefaultNodeInfo): unknown { - const obj: any = {}; + const obj: any = {} message.protocolVersion !== undefined && - (obj.protocolVersion = message.protocolVersion ? ProtocolVersion.toJSON(message.protocolVersion) : undefined); - message.defaultNodeId !== undefined && (obj.defaultNodeId = message.defaultNodeId); - message.listenAddr !== undefined && (obj.listenAddr = message.listenAddr); - message.network !== undefined && (obj.network = message.network); - message.version !== undefined && (obj.version = message.version); + (obj.protocolVersion = message.protocolVersion + ? ProtocolVersion.toJSON(message.protocolVersion) + : undefined) + message.defaultNodeId !== undefined && (obj.defaultNodeId = message.defaultNodeId) + message.listenAddr !== undefined && (obj.listenAddr = message.listenAddr) + message.network !== undefined && (obj.network = message.network) + message.version !== undefined && (obj.version = message.version) message.channels !== undefined && - (obj.channels = base64FromBytes(message.channels !== undefined ? message.channels : new Uint8Array())); - message.moniker !== undefined && (obj.moniker = message.moniker); - message.other !== undefined && (obj.other = message.other ? DefaultNodeInfoOther.toJSON(message.other) : undefined); - return obj; + (obj.channels = base64FromBytes( + message.channels !== undefined ? message.channels : new Uint8Array(), + )) + message.moniker !== undefined && (obj.moniker = message.moniker) + message.other !== undefined && + (obj.other = message.other + ? DefaultNodeInfoOther.toJSON(message.other) + : undefined) + return obj }, - fromPartial, I>>(object: I): DefaultNodeInfo { - const message = createBaseDefaultNodeInfo(); - message.protocolVersion = (object.protocolVersion !== undefined && object.protocolVersion !== null) - ? ProtocolVersion.fromPartial(object.protocolVersion) - : undefined; - message.defaultNodeId = object.defaultNodeId ?? ""; - message.listenAddr = object.listenAddr ?? ""; - message.network = object.network ?? ""; - message.version = object.version ?? ""; - message.channels = object.channels ?? new Uint8Array(); - message.moniker = object.moniker ?? ""; - message.other = (object.other !== undefined && object.other !== null) - ? DefaultNodeInfoOther.fromPartial(object.other) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): DefaultNodeInfo { + const message = createBaseDefaultNodeInfo() + message.protocolVersion = + object.protocolVersion !== undefined && object.protocolVersion !== null + ? ProtocolVersion.fromPartial(object.protocolVersion) + : undefined + message.defaultNodeId = object.defaultNodeId ?? "" + message.listenAddr = object.listenAddr ?? "" + message.network = object.network ?? "" + message.version = object.version ?? "" + message.channels = object.channels ?? new Uint8Array() + message.moniker = object.moniker ?? "" + message.other = + object.other !== undefined && object.other !== null + ? DefaultNodeInfoOther.fromPartial(object.other) + : undefined + return message }, -}; +} function createBaseDefaultNodeInfoOther(): DefaultNodeInfoOther { - return { txIndex: "", rpcAddress: "" }; + return { txIndex: "", rpcAddress: "" } } export const DefaultNodeInfoOther = { - encode(message: DefaultNodeInfoOther, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: DefaultNodeInfoOther, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.txIndex !== "") { - writer.uint32(10).string(message.txIndex); + writer.uint32(10).string(message.txIndex) } if (message.rpcAddress !== "") { - writer.uint32(18).string(message.rpcAddress); + writer.uint32(18).string(message.rpcAddress) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): DefaultNodeInfoOther { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDefaultNodeInfoOther(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseDefaultNodeInfoOther() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.txIndex = reader.string(); - break; + message.txIndex = reader.string() + break case 2: - message.rpcAddress = reader.string(); - break; + message.rpcAddress = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): DefaultNodeInfoOther { return { txIndex: isSet(object.txIndex) ? String(object.txIndex) : "", rpcAddress: isSet(object.rpcAddress) ? String(object.rpcAddress) : "", - }; + } }, toJSON(message: DefaultNodeInfoOther): unknown { - const obj: any = {}; - message.txIndex !== undefined && (obj.txIndex = message.txIndex); - message.rpcAddress !== undefined && (obj.rpcAddress = message.rpcAddress); - return obj; + const obj: any = {} + message.txIndex !== undefined && (obj.txIndex = message.txIndex) + message.rpcAddress !== undefined && (obj.rpcAddress = message.rpcAddress) + return obj }, - fromPartial, I>>(object: I): DefaultNodeInfoOther { - const message = createBaseDefaultNodeInfoOther(); - message.txIndex = object.txIndex ?? ""; - message.rpcAddress = object.rpcAddress ?? ""; - return message; + fromPartial, I>>( + object: I, + ): DefaultNodeInfoOther { + const message = createBaseDefaultNodeInfoOther() + message.txIndex = object.txIndex ?? "" + message.rpcAddress = object.rpcAddress ?? "" + return message }, -}; +} -declare var self: any | undefined; -declare var window: any | undefined; -declare var global: any | undefined; +declare var self: any | undefined +declare var window: any | undefined +declare var global: any | undefined var globalThis: any = (() => { - if (typeof globalThis !== "undefined") { - return globalThis; - } - if (typeof self !== "undefined") { - return self; - } - if (typeof window !== "undefined") { - return window; - } - if (typeof global !== "undefined") { - return global; - } - throw "Unable to locate global object"; -})(); - + if (typeof globalThis !== "undefined") return globalThis + if (typeof self !== "undefined") return self + if (typeof window !== "undefined") return window + if (typeof global !== "undefined") return global + throw "Unable to locate global object" +})() + +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")) function bytesFromBase64(b64: string): Uint8Array { - if (globalThis.Buffer) { - return Uint8Array.from(globalThis.Buffer.from(b64, "base64")); - } else { - const bin = globalThis.atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; + 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 } +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")) function base64FromBytes(arr: Uint8Array): string { - if (globalThis.Buffer) { - return globalThis.Buffer.from(arr).toString("base64"); - } else { - const bin: string[] = []; - arr.forEach((byte) => { - bin.push(String.fromCharCode(byte)); - }); - return globalThis.btoa(bin.join("")); - } + const bin: string[] = [] + arr.forEach((byte) => { + bin.push(String.fromCharCode(byte)) + }) + return btoa(bin.join("")) } -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/tendermint/types/block.ts b/packages/protojs/src/tendermint/types/block.ts index 7bdfad08..f7e8de5e 100644 --- a/packages/protojs/src/tendermint/types/block.ts +++ b/packages/protojs/src/tendermint/types/block.ts @@ -1,119 +1,150 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { EvidenceList } from "./evidence"; -import { Commit, Data, Header } from "./types"; +import { Header, Data, Commit } from "./types" +import { EvidenceList } from "./evidence" +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "tendermint.types"; +export const protobufPackage = "tendermint.types" export interface Block { - header?: Header; - data?: Data; - evidence?: EvidenceList; - lastCommit?: Commit; + header?: Header + data?: Data + evidence?: EvidenceList + lastCommit?: Commit } function createBaseBlock(): Block { - return { header: undefined, data: undefined, evidence: undefined, lastCommit: undefined }; + return { + header: undefined, + data: undefined, + evidence: undefined, + lastCommit: undefined, + } } export const Block = { encode(message: Block, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.header !== undefined) { - Header.encode(message.header, writer.uint32(10).fork()).ldelim(); + Header.encode(message.header, writer.uint32(10).fork()).ldelim() } if (message.data !== undefined) { - Data.encode(message.data, writer.uint32(18).fork()).ldelim(); + Data.encode(message.data, writer.uint32(18).fork()).ldelim() } if (message.evidence !== undefined) { - EvidenceList.encode(message.evidence, writer.uint32(26).fork()).ldelim(); + EvidenceList.encode(message.evidence, writer.uint32(26).fork()).ldelim() } if (message.lastCommit !== undefined) { - Commit.encode(message.lastCommit, writer.uint32(34).fork()).ldelim(); + Commit.encode(message.lastCommit, writer.uint32(34).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Block { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseBlock(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseBlock() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.header = Header.decode(reader, reader.uint32()); - break; + message.header = Header.decode(reader, reader.uint32()) + break case 2: - message.data = Data.decode(reader, reader.uint32()); - break; + message.data = Data.decode(reader, reader.uint32()) + break case 3: - message.evidence = EvidenceList.decode(reader, reader.uint32()); - break; + message.evidence = EvidenceList.decode(reader, reader.uint32()) + break case 4: - message.lastCommit = Commit.decode(reader, reader.uint32()); - break; + message.lastCommit = Commit.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Block { return { header: isSet(object.header) ? Header.fromJSON(object.header) : undefined, data: isSet(object.data) ? Data.fromJSON(object.data) : undefined, - evidence: isSet(object.evidence) ? EvidenceList.fromJSON(object.evidence) : undefined, - lastCommit: isSet(object.lastCommit) ? Commit.fromJSON(object.lastCommit) : undefined, - }; + evidence: isSet(object.evidence) + ? EvidenceList.fromJSON(object.evidence) + : undefined, + lastCommit: isSet(object.lastCommit) + ? Commit.fromJSON(object.lastCommit) + : undefined, + } }, toJSON(message: Block): unknown { - const obj: any = {}; - message.header !== undefined && (obj.header = message.header ? Header.toJSON(message.header) : undefined); - message.data !== undefined && (obj.data = message.data ? Data.toJSON(message.data) : undefined); + const obj: any = {} + message.header !== undefined && + (obj.header = message.header ? Header.toJSON(message.header) : undefined) + message.data !== undefined && + (obj.data = message.data ? Data.toJSON(message.data) : undefined) message.evidence !== undefined && - (obj.evidence = message.evidence ? EvidenceList.toJSON(message.evidence) : undefined); + (obj.evidence = message.evidence + ? EvidenceList.toJSON(message.evidence) + : undefined) message.lastCommit !== undefined && - (obj.lastCommit = message.lastCommit ? Commit.toJSON(message.lastCommit) : undefined); - return obj; + (obj.lastCommit = message.lastCommit + ? Commit.toJSON(message.lastCommit) + : undefined) + return obj }, fromPartial, I>>(object: I): Block { - const message = createBaseBlock(); - message.header = (object.header !== undefined && object.header !== null) - ? Header.fromPartial(object.header) - : undefined; - message.data = (object.data !== undefined && object.data !== null) ? Data.fromPartial(object.data) : undefined; - message.evidence = (object.evidence !== undefined && object.evidence !== null) - ? EvidenceList.fromPartial(object.evidence) - : undefined; - message.lastCommit = (object.lastCommit !== undefined && object.lastCommit !== null) - ? Commit.fromPartial(object.lastCommit) - : undefined; - return message; + const message = createBaseBlock() + message.header = + object.header !== undefined && object.header !== null + ? Header.fromPartial(object.header) + : undefined + message.data = + object.data !== undefined && object.data !== null + ? Data.fromPartial(object.data) + : undefined + message.evidence = + object.evidence !== undefined && object.evidence !== null + ? EvidenceList.fromPartial(object.evidence) + : undefined + message.lastCommit = + object.lastCommit !== undefined && object.lastCommit !== null + ? Commit.fromPartial(object.lastCommit) + : undefined + return message }, -}; +} -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/tendermint/types/evidence.ts b/packages/protojs/src/tendermint/types/evidence.ts index 7fa45d00..d27ea90e 100644 --- a/packages/protojs/src/tendermint/types/evidence.ts +++ b/packages/protojs/src/tendermint/types/evidence.ts @@ -1,73 +1,85 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { Timestamp } from "../../google/protobuf/timestamp"; -import { LightBlock, Vote } from "./types"; -import { Validator } from "./validator"; +import { Vote, LightBlock } from "./types" +import { Timestamp } from "../../google/protobuf/timestamp" +import Long from "long" +import { Validator } from "./validator" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "tendermint.types"; +export const protobufPackage = "tendermint.types" export interface Evidence { - duplicateVoteEvidence?: DuplicateVoteEvidence | undefined; - lightClientAttackEvidence?: LightClientAttackEvidence | undefined; + duplicateVoteEvidence?: DuplicateVoteEvidence | undefined + lightClientAttackEvidence?: LightClientAttackEvidence | undefined } /** DuplicateVoteEvidence contains evidence of a validator signed two conflicting votes. */ export interface DuplicateVoteEvidence { - voteA?: Vote; - voteB?: Vote; - totalVotingPower: Long; - validatorPower: Long; - timestamp?: Date; + voteA?: Vote + voteB?: Vote + totalVotingPower: Long + validatorPower: Long + timestamp?: Date } /** LightClientAttackEvidence contains evidence of a set of validators attempting to mislead a light client. */ export interface LightClientAttackEvidence { - conflictingBlock?: LightBlock; - commonHeight: Long; - byzantineValidators: Validator[]; - totalVotingPower: Long; - timestamp?: Date; + conflictingBlock?: LightBlock + commonHeight: Long + byzantineValidators: Validator[] + totalVotingPower: Long + timestamp?: Date } export interface EvidenceList { - evidence: Evidence[]; + evidence: Evidence[] } function createBaseEvidence(): Evidence { - return { duplicateVoteEvidence: undefined, lightClientAttackEvidence: undefined }; + return { duplicateVoteEvidence: undefined, lightClientAttackEvidence: undefined } } export const Evidence = { encode(message: Evidence, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.duplicateVoteEvidence !== undefined) { - DuplicateVoteEvidence.encode(message.duplicateVoteEvidence, writer.uint32(10).fork()).ldelim(); + DuplicateVoteEvidence.encode( + message.duplicateVoteEvidence, + writer.uint32(10).fork(), + ).ldelim() } if (message.lightClientAttackEvidence !== undefined) { - LightClientAttackEvidence.encode(message.lightClientAttackEvidence, writer.uint32(18).fork()).ldelim(); + LightClientAttackEvidence.encode( + message.lightClientAttackEvidence, + writer.uint32(18).fork(), + ).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Evidence { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseEvidence(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseEvidence() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.duplicateVoteEvidence = DuplicateVoteEvidence.decode(reader, reader.uint32()); - break; + message.duplicateVoteEvidence = DuplicateVoteEvidence.decode( + reader, + reader.uint32(), + ) + break case 2: - message.lightClientAttackEvidence = LightClientAttackEvidence.decode(reader, reader.uint32()); - break; + message.lightClientAttackEvidence = LightClientAttackEvidence.decode( + reader, + reader.uint32(), + ) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Evidence { @@ -78,34 +90,37 @@ export const Evidence = { lightClientAttackEvidence: isSet(object.lightClientAttackEvidence) ? LightClientAttackEvidence.fromJSON(object.lightClientAttackEvidence) : undefined, - }; + } }, toJSON(message: Evidence): unknown { - const obj: any = {}; - message.duplicateVoteEvidence !== undefined && (obj.duplicateVoteEvidence = message.duplicateVoteEvidence - ? DuplicateVoteEvidence.toJSON(message.duplicateVoteEvidence) - : undefined); + const obj: any = {} + message.duplicateVoteEvidence !== undefined && + (obj.duplicateVoteEvidence = message.duplicateVoteEvidence + ? DuplicateVoteEvidence.toJSON(message.duplicateVoteEvidence) + : undefined) message.lightClientAttackEvidence !== undefined && (obj.lightClientAttackEvidence = message.lightClientAttackEvidence ? LightClientAttackEvidence.toJSON(message.lightClientAttackEvidence) - : undefined); - return obj; + : undefined) + return obj }, fromPartial, I>>(object: I): Evidence { - const message = createBaseEvidence(); + const message = createBaseEvidence() message.duplicateVoteEvidence = - (object.duplicateVoteEvidence !== undefined && object.duplicateVoteEvidence !== null) + object.duplicateVoteEvidence !== undefined && + object.duplicateVoteEvidence !== null ? DuplicateVoteEvidence.fromPartial(object.duplicateVoteEvidence) - : undefined; + : undefined message.lightClientAttackEvidence = - (object.lightClientAttackEvidence !== undefined && object.lightClientAttackEvidence !== null) + object.lightClientAttackEvidence !== undefined && + object.lightClientAttackEvidence !== null ? LightClientAttackEvidence.fromPartial(object.lightClientAttackEvidence) - : undefined; - return message; + : undefined + return message }, -}; +} function createBaseDuplicateVoteEvidence(): DuplicateVoteEvidence { return { @@ -114,94 +129,119 @@ function createBaseDuplicateVoteEvidence(): DuplicateVoteEvidence { totalVotingPower: Long.ZERO, validatorPower: Long.ZERO, timestamp: undefined, - }; + } } export const DuplicateVoteEvidence = { - encode(message: DuplicateVoteEvidence, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: DuplicateVoteEvidence, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.voteA !== undefined) { - Vote.encode(message.voteA, writer.uint32(10).fork()).ldelim(); + Vote.encode(message.voteA, writer.uint32(10).fork()).ldelim() } if (message.voteB !== undefined) { - Vote.encode(message.voteB, writer.uint32(18).fork()).ldelim(); + Vote.encode(message.voteB, writer.uint32(18).fork()).ldelim() } if (!message.totalVotingPower.isZero()) { - writer.uint32(24).int64(message.totalVotingPower); + writer.uint32(24).int64(message.totalVotingPower) } if (!message.validatorPower.isZero()) { - writer.uint32(32).int64(message.validatorPower); + writer.uint32(32).int64(message.validatorPower) } if (message.timestamp !== undefined) { - Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(42).fork()).ldelim(); + Timestamp.encode( + toTimestamp(message.timestamp), + writer.uint32(42).fork(), + ).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): DuplicateVoteEvidence { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDuplicateVoteEvidence(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseDuplicateVoteEvidence() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.voteA = Vote.decode(reader, reader.uint32()); - break; + message.voteA = Vote.decode(reader, reader.uint32()) + break case 2: - message.voteB = Vote.decode(reader, reader.uint32()); - break; + message.voteB = Vote.decode(reader, reader.uint32()) + break case 3: - message.totalVotingPower = reader.int64() as Long; - break; + message.totalVotingPower = reader.int64() as Long + break case 4: - message.validatorPower = reader.int64() as Long; - break; + message.validatorPower = reader.int64() as Long + break case 5: - message.timestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32())); - break; + message.timestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): DuplicateVoteEvidence { return { voteA: isSet(object.voteA) ? Vote.fromJSON(object.voteA) : undefined, voteB: isSet(object.voteB) ? Vote.fromJSON(object.voteB) : undefined, - totalVotingPower: isSet(object.totalVotingPower) ? Long.fromValue(object.totalVotingPower) : Long.ZERO, - validatorPower: isSet(object.validatorPower) ? Long.fromValue(object.validatorPower) : Long.ZERO, - timestamp: isSet(object.timestamp) ? fromJsonTimestamp(object.timestamp) : undefined, - }; + totalVotingPower: isSet(object.totalVotingPower) + ? Long.fromValue(object.totalVotingPower) + : Long.ZERO, + validatorPower: isSet(object.validatorPower) + ? Long.fromValue(object.validatorPower) + : Long.ZERO, + timestamp: isSet(object.timestamp) + ? fromJsonTimestamp(object.timestamp) + : undefined, + } }, toJSON(message: DuplicateVoteEvidence): unknown { - const obj: any = {}; - message.voteA !== undefined && (obj.voteA = message.voteA ? Vote.toJSON(message.voteA) : undefined); - message.voteB !== undefined && (obj.voteB = message.voteB ? Vote.toJSON(message.voteB) : undefined); + const obj: any = {} + message.voteA !== undefined && + (obj.voteA = message.voteA ? Vote.toJSON(message.voteA) : undefined) + message.voteB !== undefined && + (obj.voteB = message.voteB ? Vote.toJSON(message.voteB) : undefined) message.totalVotingPower !== undefined && - (obj.totalVotingPower = (message.totalVotingPower || Long.ZERO).toString()); - message.validatorPower !== undefined && (obj.validatorPower = (message.validatorPower || Long.ZERO).toString()); - message.timestamp !== undefined && (obj.timestamp = message.timestamp.toISOString()); - return obj; + (obj.totalVotingPower = (message.totalVotingPower || Long.ZERO).toString()) + message.validatorPower !== undefined && + (obj.validatorPower = (message.validatorPower || Long.ZERO).toString()) + message.timestamp !== undefined && (obj.timestamp = message.timestamp.toISOString()) + return obj }, - fromPartial, I>>(object: I): DuplicateVoteEvidence { - const message = createBaseDuplicateVoteEvidence(); - message.voteA = (object.voteA !== undefined && object.voteA !== null) ? Vote.fromPartial(object.voteA) : undefined; - message.voteB = (object.voteB !== undefined && object.voteB !== null) ? Vote.fromPartial(object.voteB) : undefined; - message.totalVotingPower = (object.totalVotingPower !== undefined && object.totalVotingPower !== null) - ? Long.fromValue(object.totalVotingPower) - : Long.ZERO; - message.validatorPower = (object.validatorPower !== undefined && object.validatorPower !== null) - ? Long.fromValue(object.validatorPower) - : Long.ZERO; - message.timestamp = object.timestamp ?? undefined; - return message; + fromPartial, I>>( + object: I, + ): DuplicateVoteEvidence { + const message = createBaseDuplicateVoteEvidence() + message.voteA = + object.voteA !== undefined && object.voteA !== null + ? Vote.fromPartial(object.voteA) + : undefined + message.voteB = + object.voteB !== undefined && object.voteB !== null + ? Vote.fromPartial(object.voteB) + : undefined + message.totalVotingPower = + object.totalVotingPower !== undefined && object.totalVotingPower !== null + ? Long.fromValue(object.totalVotingPower) + : Long.ZERO + message.validatorPower = + object.validatorPower !== undefined && object.validatorPower !== null + ? Long.fromValue(object.validatorPower) + : Long.ZERO + message.timestamp = object.timestamp ?? undefined + return message }, -}; +} function createBaseLightClientAttackEvidence(): LightClientAttackEvidence { return { @@ -210,198 +250,237 @@ function createBaseLightClientAttackEvidence(): LightClientAttackEvidence { byzantineValidators: [], totalVotingPower: Long.ZERO, timestamp: undefined, - }; + } } export const LightClientAttackEvidence = { - encode(message: LightClientAttackEvidence, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: LightClientAttackEvidence, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.conflictingBlock !== undefined) { - LightBlock.encode(message.conflictingBlock, writer.uint32(10).fork()).ldelim(); + LightBlock.encode(message.conflictingBlock, writer.uint32(10).fork()).ldelim() } if (!message.commonHeight.isZero()) { - writer.uint32(16).int64(message.commonHeight); + writer.uint32(16).int64(message.commonHeight) } for (const v of message.byzantineValidators) { - Validator.encode(v!, writer.uint32(26).fork()).ldelim(); + Validator.encode(v!, writer.uint32(26).fork()).ldelim() } if (!message.totalVotingPower.isZero()) { - writer.uint32(32).int64(message.totalVotingPower); + writer.uint32(32).int64(message.totalVotingPower) } if (message.timestamp !== undefined) { - Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(42).fork()).ldelim(); + Timestamp.encode( + toTimestamp(message.timestamp), + writer.uint32(42).fork(), + ).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): LightClientAttackEvidence { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseLightClientAttackEvidence(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseLightClientAttackEvidence() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.conflictingBlock = LightBlock.decode(reader, reader.uint32()); - break; + message.conflictingBlock = LightBlock.decode(reader, reader.uint32()) + break case 2: - message.commonHeight = reader.int64() as Long; - break; + message.commonHeight = reader.int64() as Long + break case 3: - message.byzantineValidators.push(Validator.decode(reader, reader.uint32())); - break; + message.byzantineValidators.push(Validator.decode(reader, reader.uint32())) + break case 4: - message.totalVotingPower = reader.int64() as Long; - break; + message.totalVotingPower = reader.int64() as Long + break case 5: - message.timestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32())); - break; + message.timestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): LightClientAttackEvidence { return { - conflictingBlock: isSet(object.conflictingBlock) ? LightBlock.fromJSON(object.conflictingBlock) : undefined, - commonHeight: isSet(object.commonHeight) ? Long.fromValue(object.commonHeight) : Long.ZERO, + conflictingBlock: isSet(object.conflictingBlock) + ? LightBlock.fromJSON(object.conflictingBlock) + : undefined, + commonHeight: isSet(object.commonHeight) + ? Long.fromValue(object.commonHeight) + : Long.ZERO, byzantineValidators: Array.isArray(object?.byzantineValidators) ? object.byzantineValidators.map((e: any) => Validator.fromJSON(e)) : [], - totalVotingPower: isSet(object.totalVotingPower) ? Long.fromValue(object.totalVotingPower) : Long.ZERO, - timestamp: isSet(object.timestamp) ? fromJsonTimestamp(object.timestamp) : undefined, - }; + totalVotingPower: isSet(object.totalVotingPower) + ? Long.fromValue(object.totalVotingPower) + : Long.ZERO, + timestamp: isSet(object.timestamp) + ? fromJsonTimestamp(object.timestamp) + : undefined, + } }, toJSON(message: LightClientAttackEvidence): unknown { - const obj: any = {}; + const obj: any = {} message.conflictingBlock !== undefined && - (obj.conflictingBlock = message.conflictingBlock ? LightBlock.toJSON(message.conflictingBlock) : undefined); - message.commonHeight !== undefined && (obj.commonHeight = (message.commonHeight || Long.ZERO).toString()); + (obj.conflictingBlock = message.conflictingBlock + ? LightBlock.toJSON(message.conflictingBlock) + : undefined) + message.commonHeight !== undefined && + (obj.commonHeight = (message.commonHeight || Long.ZERO).toString()) if (message.byzantineValidators) { - obj.byzantineValidators = message.byzantineValidators.map((e) => e ? Validator.toJSON(e) : undefined); + obj.byzantineValidators = message.byzantineValidators.map((e) => + e ? Validator.toJSON(e) : undefined, + ) } else { - obj.byzantineValidators = []; + obj.byzantineValidators = [] } message.totalVotingPower !== undefined && - (obj.totalVotingPower = (message.totalVotingPower || Long.ZERO).toString()); - message.timestamp !== undefined && (obj.timestamp = message.timestamp.toISOString()); - return obj; + (obj.totalVotingPower = (message.totalVotingPower || Long.ZERO).toString()) + message.timestamp !== undefined && (obj.timestamp = message.timestamp.toISOString()) + return obj }, - fromPartial, I>>(object: I): LightClientAttackEvidence { - const message = createBaseLightClientAttackEvidence(); - message.conflictingBlock = (object.conflictingBlock !== undefined && object.conflictingBlock !== null) - ? LightBlock.fromPartial(object.conflictingBlock) - : undefined; - message.commonHeight = (object.commonHeight !== undefined && object.commonHeight !== null) - ? Long.fromValue(object.commonHeight) - : Long.ZERO; - message.byzantineValidators = object.byzantineValidators?.map((e) => Validator.fromPartial(e)) || []; - message.totalVotingPower = (object.totalVotingPower !== undefined && object.totalVotingPower !== null) - ? Long.fromValue(object.totalVotingPower) - : Long.ZERO; - message.timestamp = object.timestamp ?? undefined; - return message; + fromPartial, I>>( + object: I, + ): LightClientAttackEvidence { + const message = createBaseLightClientAttackEvidence() + message.conflictingBlock = + object.conflictingBlock !== undefined && object.conflictingBlock !== null + ? LightBlock.fromPartial(object.conflictingBlock) + : undefined + message.commonHeight = + object.commonHeight !== undefined && object.commonHeight !== null + ? Long.fromValue(object.commonHeight) + : Long.ZERO + message.byzantineValidators = + object.byzantineValidators?.map((e) => Validator.fromPartial(e)) || [] + message.totalVotingPower = + object.totalVotingPower !== undefined && object.totalVotingPower !== null + ? Long.fromValue(object.totalVotingPower) + : Long.ZERO + message.timestamp = object.timestamp ?? undefined + return message }, -}; +} function createBaseEvidenceList(): EvidenceList { - return { evidence: [] }; + return { evidence: [] } } export const EvidenceList = { encode(message: EvidenceList, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.evidence) { - Evidence.encode(v!, writer.uint32(10).fork()).ldelim(); + Evidence.encode(v!, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): EvidenceList { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseEvidenceList(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseEvidenceList() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.evidence.push(Evidence.decode(reader, reader.uint32())); - break; + message.evidence.push(Evidence.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): EvidenceList { - return { evidence: Array.isArray(object?.evidence) ? object.evidence.map((e: any) => Evidence.fromJSON(e)) : [] }; + return { + evidence: Array.isArray(object?.evidence) + ? object.evidence.map((e: any) => Evidence.fromJSON(e)) + : [], + } }, toJSON(message: EvidenceList): unknown { - const obj: any = {}; + const obj: any = {} if (message.evidence) { - obj.evidence = message.evidence.map((e) => e ? Evidence.toJSON(e) : undefined); + obj.evidence = message.evidence.map((e) => (e ? Evidence.toJSON(e) : undefined)) } else { - obj.evidence = []; + obj.evidence = [] } - return obj; + return obj }, fromPartial, I>>(object: I): EvidenceList { - const message = createBaseEvidenceList(); - message.evidence = object.evidence?.map((e) => Evidence.fromPartial(e)) || []; - return message; + const message = createBaseEvidenceList() + message.evidence = object.evidence?.map((e) => Evidence.fromPartial(e)) || [] + return message }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; +} -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > function toTimestamp(date: Date): Timestamp { - const seconds = numberToLong(date.getTime() / 1_000); - const nanos = (date.getTime() % 1_000) * 1_000_000; - return { seconds, nanos }; + const seconds = numberToLong(date.getTime() / 1_000) + const nanos = (date.getTime() % 1_000) * 1_000_000 + return { seconds, nanos } } function fromTimestamp(t: Timestamp): Date { - let millis = t.seconds.toNumber() * 1_000; - millis += t.nanos / 1_000_000; - return new Date(millis); + let millis = t.seconds.toNumber() * 1_000 + millis += t.nanos / 1_000_000 + return new Date(millis) } function fromJsonTimestamp(o: any): Date { if (o instanceof Date) { - return o; + return o } else if (typeof o === "string") { - return new Date(o); + return new Date(o) } else { - return fromTimestamp(Timestamp.fromJSON(o)); + return fromTimestamp(Timestamp.fromJSON(o)) } } function numberToLong(number: number) { - return Long.fromNumber(number); + return Long.fromNumber(number) } if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/tendermint/types/params.ts b/packages/protojs/src/tendermint/types/params.ts index b7a04db6..0852e433 100644 --- a/packages/protojs/src/tendermint/types/params.ts +++ b/packages/protojs/src/tendermint/types/params.ts @@ -1,19 +1,19 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { Duration } from "../../google/protobuf/duration"; +import { Duration } from "../../google/protobuf/duration" +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "tendermint.types"; +export const protobufPackage = "tendermint.types" /** * ConsensusParams contains consensus critical parameters that determine the * validity of blocks. */ export interface ConsensusParams { - block?: BlockParams; - evidence?: EvidenceParams; - validator?: ValidatorParams; - version?: VersionParams; + block?: BlockParams + evidence?: EvidenceParams + validator?: ValidatorParams + version?: VersionParams } /** BlockParams contains limits on the block size. */ @@ -22,19 +22,19 @@ export interface BlockParams { * Max block size, in bytes. * Note: must be greater than 0 */ - maxBytes: Long; + maxBytes: Long /** * Max gas per block. * Note: must be greater or equal to -1 */ - maxGas: Long; + maxGas: Long /** * Minimum time increment between consecutive blocks (in milliseconds) If the * block header timestamp is ahead of the system clock, decrease this value. * * Not exposed to the application. */ - timeIotaMs: Long; + timeIotaMs: Long } /** EvidenceParams determine how we handle evidence of malfeasance. */ @@ -45,7 +45,7 @@ export interface EvidenceParams { * The basic formula for calculating this is: MaxAgeDuration / {average block * time}. */ - maxAgeNumBlocks: Long; + maxAgeNumBlocks: Long /** * Max age of evidence, in time. * @@ -53,13 +53,13 @@ export interface EvidenceParams { * mechanism for handling [Nothing-At-Stake * attacks](https://github.com/ethereum/wiki/wiki/Proof-of-Stake-FAQ#what-is-the-nothing-at-stake-problem-and-how-can-it-be-fixed). */ - maxAgeDuration?: Duration; + maxAgeDuration?: Duration /** * This sets the maximum size of total evidence in bytes that can be committed in a single block. * and should fall comfortably under the max block bytes. * Default is 1048576 or 1MB */ - maxBytes: Long; + maxBytes: Long } /** @@ -67,12 +67,12 @@ export interface EvidenceParams { * NOTE: uses ABCI pubkey naming, not Amino names. */ export interface ValidatorParams { - pubKeyTypes: string[]; + pubKeyTypes: string[] } /** VersionParams contains the ABCI application version. */ export interface VersionParams { - appVersion: Long; + appVersion: Long } /** @@ -81,423 +81,509 @@ export interface VersionParams { * It is hashed into the Header.ConsensusHash. */ export interface HashedParams { - blockMaxBytes: Long; - blockMaxGas: Long; + blockMaxBytes: Long + blockMaxGas: Long } function createBaseConsensusParams(): ConsensusParams { - return { block: undefined, evidence: undefined, validator: undefined, version: undefined }; + return { + block: undefined, + evidence: undefined, + validator: undefined, + version: undefined, + } } export const ConsensusParams = { - encode(message: ConsensusParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: ConsensusParams, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.block !== undefined) { - BlockParams.encode(message.block, writer.uint32(10).fork()).ldelim(); + BlockParams.encode(message.block, writer.uint32(10).fork()).ldelim() } if (message.evidence !== undefined) { - EvidenceParams.encode(message.evidence, writer.uint32(18).fork()).ldelim(); + EvidenceParams.encode(message.evidence, writer.uint32(18).fork()).ldelim() } if (message.validator !== undefined) { - ValidatorParams.encode(message.validator, writer.uint32(26).fork()).ldelim(); + ValidatorParams.encode(message.validator, writer.uint32(26).fork()).ldelim() } if (message.version !== undefined) { - VersionParams.encode(message.version, writer.uint32(34).fork()).ldelim(); + VersionParams.encode(message.version, writer.uint32(34).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): ConsensusParams { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseConsensusParams(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseConsensusParams() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.block = BlockParams.decode(reader, reader.uint32()); - break; + message.block = BlockParams.decode(reader, reader.uint32()) + break case 2: - message.evidence = EvidenceParams.decode(reader, reader.uint32()); - break; + message.evidence = EvidenceParams.decode(reader, reader.uint32()) + break case 3: - message.validator = ValidatorParams.decode(reader, reader.uint32()); - break; + message.validator = ValidatorParams.decode(reader, reader.uint32()) + break case 4: - message.version = VersionParams.decode(reader, reader.uint32()); - break; + message.version = VersionParams.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): ConsensusParams { return { block: isSet(object.block) ? BlockParams.fromJSON(object.block) : undefined, - evidence: isSet(object.evidence) ? EvidenceParams.fromJSON(object.evidence) : undefined, - validator: isSet(object.validator) ? ValidatorParams.fromJSON(object.validator) : undefined, - version: isSet(object.version) ? VersionParams.fromJSON(object.version) : undefined, - }; + evidence: isSet(object.evidence) + ? EvidenceParams.fromJSON(object.evidence) + : undefined, + validator: isSet(object.validator) + ? ValidatorParams.fromJSON(object.validator) + : undefined, + version: isSet(object.version) + ? VersionParams.fromJSON(object.version) + : undefined, + } }, toJSON(message: ConsensusParams): unknown { - const obj: any = {}; - message.block !== undefined && (obj.block = message.block ? BlockParams.toJSON(message.block) : undefined); + const obj: any = {} + message.block !== undefined && + (obj.block = message.block ? BlockParams.toJSON(message.block) : undefined) message.evidence !== undefined && - (obj.evidence = message.evidence ? EvidenceParams.toJSON(message.evidence) : undefined); + (obj.evidence = message.evidence + ? EvidenceParams.toJSON(message.evidence) + : undefined) message.validator !== undefined && - (obj.validator = message.validator ? ValidatorParams.toJSON(message.validator) : undefined); + (obj.validator = message.validator + ? ValidatorParams.toJSON(message.validator) + : undefined) message.version !== undefined && - (obj.version = message.version ? VersionParams.toJSON(message.version) : undefined); - return obj; + (obj.version = message.version + ? VersionParams.toJSON(message.version) + : undefined) + return obj }, - fromPartial, I>>(object: I): ConsensusParams { - const message = createBaseConsensusParams(); - message.block = (object.block !== undefined && object.block !== null) - ? BlockParams.fromPartial(object.block) - : undefined; - message.evidence = (object.evidence !== undefined && object.evidence !== null) - ? EvidenceParams.fromPartial(object.evidence) - : undefined; - message.validator = (object.validator !== undefined && object.validator !== null) - ? ValidatorParams.fromPartial(object.validator) - : undefined; - message.version = (object.version !== undefined && object.version !== null) - ? VersionParams.fromPartial(object.version) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): ConsensusParams { + const message = createBaseConsensusParams() + message.block = + object.block !== undefined && object.block !== null + ? BlockParams.fromPartial(object.block) + : undefined + message.evidence = + object.evidence !== undefined && object.evidence !== null + ? EvidenceParams.fromPartial(object.evidence) + : undefined + message.validator = + object.validator !== undefined && object.validator !== null + ? ValidatorParams.fromPartial(object.validator) + : undefined + message.version = + object.version !== undefined && object.version !== null + ? VersionParams.fromPartial(object.version) + : undefined + return message }, -}; +} function createBaseBlockParams(): BlockParams { - return { maxBytes: Long.ZERO, maxGas: Long.ZERO, timeIotaMs: Long.ZERO }; + return { maxBytes: Long.ZERO, maxGas: Long.ZERO, timeIotaMs: Long.ZERO } } export const BlockParams = { encode(message: BlockParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (!message.maxBytes.isZero()) { - writer.uint32(8).int64(message.maxBytes); + writer.uint32(8).int64(message.maxBytes) } if (!message.maxGas.isZero()) { - writer.uint32(16).int64(message.maxGas); + writer.uint32(16).int64(message.maxGas) } if (!message.timeIotaMs.isZero()) { - writer.uint32(24).int64(message.timeIotaMs); + writer.uint32(24).int64(message.timeIotaMs) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): BlockParams { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseBlockParams(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseBlockParams() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.maxBytes = reader.int64() as Long; - break; + message.maxBytes = reader.int64() as Long + break case 2: - message.maxGas = reader.int64() as Long; - break; + message.maxGas = reader.int64() as Long + break case 3: - message.timeIotaMs = reader.int64() as Long; - break; + message.timeIotaMs = reader.int64() as Long + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): BlockParams { return { maxBytes: isSet(object.maxBytes) ? Long.fromValue(object.maxBytes) : Long.ZERO, maxGas: isSet(object.maxGas) ? Long.fromValue(object.maxGas) : Long.ZERO, - timeIotaMs: isSet(object.timeIotaMs) ? Long.fromValue(object.timeIotaMs) : Long.ZERO, - }; + timeIotaMs: isSet(object.timeIotaMs) + ? Long.fromValue(object.timeIotaMs) + : Long.ZERO, + } }, toJSON(message: BlockParams): unknown { - const obj: any = {}; - message.maxBytes !== undefined && (obj.maxBytes = (message.maxBytes || Long.ZERO).toString()); - message.maxGas !== undefined && (obj.maxGas = (message.maxGas || Long.ZERO).toString()); - message.timeIotaMs !== undefined && (obj.timeIotaMs = (message.timeIotaMs || Long.ZERO).toString()); - return obj; + const obj: any = {} + message.maxBytes !== undefined && + (obj.maxBytes = (message.maxBytes || Long.ZERO).toString()) + message.maxGas !== undefined && + (obj.maxGas = (message.maxGas || Long.ZERO).toString()) + message.timeIotaMs !== undefined && + (obj.timeIotaMs = (message.timeIotaMs || Long.ZERO).toString()) + return obj }, fromPartial, I>>(object: I): BlockParams { - const message = createBaseBlockParams(); - message.maxBytes = (object.maxBytes !== undefined && object.maxBytes !== null) - ? Long.fromValue(object.maxBytes) - : Long.ZERO; - message.maxGas = (object.maxGas !== undefined && object.maxGas !== null) - ? Long.fromValue(object.maxGas) - : Long.ZERO; - message.timeIotaMs = (object.timeIotaMs !== undefined && object.timeIotaMs !== null) - ? Long.fromValue(object.timeIotaMs) - : Long.ZERO; - return message; + const message = createBaseBlockParams() + message.maxBytes = + object.maxBytes !== undefined && object.maxBytes !== null + ? Long.fromValue(object.maxBytes) + : Long.ZERO + message.maxGas = + object.maxGas !== undefined && object.maxGas !== null + ? Long.fromValue(object.maxGas) + : Long.ZERO + message.timeIotaMs = + object.timeIotaMs !== undefined && object.timeIotaMs !== null + ? Long.fromValue(object.timeIotaMs) + : Long.ZERO + return message }, -}; +} function createBaseEvidenceParams(): EvidenceParams { - return { maxAgeNumBlocks: Long.ZERO, maxAgeDuration: undefined, maxBytes: Long.ZERO }; + return { maxAgeNumBlocks: Long.ZERO, maxAgeDuration: undefined, maxBytes: Long.ZERO } } export const EvidenceParams = { - encode(message: EvidenceParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: EvidenceParams, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (!message.maxAgeNumBlocks.isZero()) { - writer.uint32(8).int64(message.maxAgeNumBlocks); + writer.uint32(8).int64(message.maxAgeNumBlocks) } if (message.maxAgeDuration !== undefined) { - Duration.encode(message.maxAgeDuration, writer.uint32(18).fork()).ldelim(); + Duration.encode(message.maxAgeDuration, writer.uint32(18).fork()).ldelim() } if (!message.maxBytes.isZero()) { - writer.uint32(24).int64(message.maxBytes); + writer.uint32(24).int64(message.maxBytes) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): EvidenceParams { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseEvidenceParams(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseEvidenceParams() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.maxAgeNumBlocks = reader.int64() as Long; - break; + message.maxAgeNumBlocks = reader.int64() as Long + break case 2: - message.maxAgeDuration = Duration.decode(reader, reader.uint32()); - break; + message.maxAgeDuration = Duration.decode(reader, reader.uint32()) + break case 3: - message.maxBytes = reader.int64() as Long; - break; + message.maxBytes = reader.int64() as Long + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): EvidenceParams { return { - maxAgeNumBlocks: isSet(object.maxAgeNumBlocks) ? Long.fromValue(object.maxAgeNumBlocks) : Long.ZERO, - maxAgeDuration: isSet(object.maxAgeDuration) ? Duration.fromJSON(object.maxAgeDuration) : undefined, + maxAgeNumBlocks: isSet(object.maxAgeNumBlocks) + ? Long.fromValue(object.maxAgeNumBlocks) + : Long.ZERO, + maxAgeDuration: isSet(object.maxAgeDuration) + ? Duration.fromJSON(object.maxAgeDuration) + : undefined, maxBytes: isSet(object.maxBytes) ? Long.fromValue(object.maxBytes) : Long.ZERO, - }; + } }, toJSON(message: EvidenceParams): unknown { - const obj: any = {}; - message.maxAgeNumBlocks !== undefined && (obj.maxAgeNumBlocks = (message.maxAgeNumBlocks || Long.ZERO).toString()); + const obj: any = {} + message.maxAgeNumBlocks !== undefined && + (obj.maxAgeNumBlocks = (message.maxAgeNumBlocks || Long.ZERO).toString()) message.maxAgeDuration !== undefined && - (obj.maxAgeDuration = message.maxAgeDuration ? Duration.toJSON(message.maxAgeDuration) : undefined); - message.maxBytes !== undefined && (obj.maxBytes = (message.maxBytes || Long.ZERO).toString()); - return obj; + (obj.maxAgeDuration = message.maxAgeDuration + ? Duration.toJSON(message.maxAgeDuration) + : undefined) + message.maxBytes !== undefined && + (obj.maxBytes = (message.maxBytes || Long.ZERO).toString()) + return obj }, - fromPartial, I>>(object: I): EvidenceParams { - const message = createBaseEvidenceParams(); - message.maxAgeNumBlocks = (object.maxAgeNumBlocks !== undefined && object.maxAgeNumBlocks !== null) - ? Long.fromValue(object.maxAgeNumBlocks) - : Long.ZERO; - message.maxAgeDuration = (object.maxAgeDuration !== undefined && object.maxAgeDuration !== null) - ? Duration.fromPartial(object.maxAgeDuration) - : undefined; - message.maxBytes = (object.maxBytes !== undefined && object.maxBytes !== null) - ? Long.fromValue(object.maxBytes) - : Long.ZERO; - return message; + fromPartial, I>>( + object: I, + ): EvidenceParams { + const message = createBaseEvidenceParams() + message.maxAgeNumBlocks = + object.maxAgeNumBlocks !== undefined && object.maxAgeNumBlocks !== null + ? Long.fromValue(object.maxAgeNumBlocks) + : Long.ZERO + message.maxAgeDuration = + object.maxAgeDuration !== undefined && object.maxAgeDuration !== null + ? Duration.fromPartial(object.maxAgeDuration) + : undefined + message.maxBytes = + object.maxBytes !== undefined && object.maxBytes !== null + ? Long.fromValue(object.maxBytes) + : Long.ZERO + return message }, -}; +} function createBaseValidatorParams(): ValidatorParams { - return { pubKeyTypes: [] }; + return { pubKeyTypes: [] } } export const ValidatorParams = { - encode(message: ValidatorParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: ValidatorParams, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { for (const v of message.pubKeyTypes) { - writer.uint32(10).string(v!); + writer.uint32(10).string(v!) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorParams { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseValidatorParams(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseValidatorParams() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.pubKeyTypes.push(reader.string()); - break; + message.pubKeyTypes.push(reader.string()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): ValidatorParams { - return { pubKeyTypes: Array.isArray(object?.pubKeyTypes) ? object.pubKeyTypes.map((e: any) => String(e)) : [] }; + return { + pubKeyTypes: Array.isArray(object?.pubKeyTypes) + ? object.pubKeyTypes.map((e: any) => String(e)) + : [], + } }, toJSON(message: ValidatorParams): unknown { - const obj: any = {}; + const obj: any = {} if (message.pubKeyTypes) { - obj.pubKeyTypes = message.pubKeyTypes.map((e) => e); + obj.pubKeyTypes = message.pubKeyTypes.map((e) => e) } else { - obj.pubKeyTypes = []; + obj.pubKeyTypes = [] } - return obj; + return obj }, - fromPartial, I>>(object: I): ValidatorParams { - const message = createBaseValidatorParams(); - message.pubKeyTypes = object.pubKeyTypes?.map((e) => e) || []; - return message; + fromPartial, I>>( + object: I, + ): ValidatorParams { + const message = createBaseValidatorParams() + message.pubKeyTypes = object.pubKeyTypes?.map((e) => e) || [] + return message }, -}; +} function createBaseVersionParams(): VersionParams { - return { appVersion: Long.UZERO }; + return { appVersion: Long.UZERO } } export const VersionParams = { encode(message: VersionParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (!message.appVersion.isZero()) { - writer.uint32(8).uint64(message.appVersion); + writer.uint32(8).uint64(message.appVersion) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): VersionParams { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseVersionParams(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseVersionParams() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.appVersion = reader.uint64() as Long; - break; + message.appVersion = reader.uint64() as Long + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): VersionParams { - return { appVersion: isSet(object.appVersion) ? Long.fromValue(object.appVersion) : Long.UZERO }; + return { + appVersion: isSet(object.appVersion) + ? Long.fromValue(object.appVersion) + : Long.UZERO, + } }, toJSON(message: VersionParams): unknown { - const obj: any = {}; - message.appVersion !== undefined && (obj.appVersion = (message.appVersion || Long.UZERO).toString()); - return obj; + const obj: any = {} + message.appVersion !== undefined && + (obj.appVersion = (message.appVersion || Long.UZERO).toString()) + return obj }, - fromPartial, I>>(object: I): VersionParams { - const message = createBaseVersionParams(); - message.appVersion = (object.appVersion !== undefined && object.appVersion !== null) - ? Long.fromValue(object.appVersion) - : Long.UZERO; - return message; + fromPartial, I>>( + object: I, + ): VersionParams { + const message = createBaseVersionParams() + message.appVersion = + object.appVersion !== undefined && object.appVersion !== null + ? Long.fromValue(object.appVersion) + : Long.UZERO + return message }, -}; +} function createBaseHashedParams(): HashedParams { - return { blockMaxBytes: Long.ZERO, blockMaxGas: Long.ZERO }; + return { blockMaxBytes: Long.ZERO, blockMaxGas: Long.ZERO } } export const HashedParams = { encode(message: HashedParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (!message.blockMaxBytes.isZero()) { - writer.uint32(8).int64(message.blockMaxBytes); + writer.uint32(8).int64(message.blockMaxBytes) } if (!message.blockMaxGas.isZero()) { - writer.uint32(16).int64(message.blockMaxGas); + writer.uint32(16).int64(message.blockMaxGas) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): HashedParams { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseHashedParams(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseHashedParams() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.blockMaxBytes = reader.int64() as Long; - break; + message.blockMaxBytes = reader.int64() as Long + break case 2: - message.blockMaxGas = reader.int64() as Long; - break; + message.blockMaxGas = reader.int64() as Long + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): HashedParams { return { - blockMaxBytes: isSet(object.blockMaxBytes) ? Long.fromValue(object.blockMaxBytes) : Long.ZERO, - blockMaxGas: isSet(object.blockMaxGas) ? Long.fromValue(object.blockMaxGas) : Long.ZERO, - }; + blockMaxBytes: isSet(object.blockMaxBytes) + ? Long.fromValue(object.blockMaxBytes) + : Long.ZERO, + blockMaxGas: isSet(object.blockMaxGas) + ? Long.fromValue(object.blockMaxGas) + : Long.ZERO, + } }, toJSON(message: HashedParams): unknown { - const obj: any = {}; - message.blockMaxBytes !== undefined && (obj.blockMaxBytes = (message.blockMaxBytes || Long.ZERO).toString()); - message.blockMaxGas !== undefined && (obj.blockMaxGas = (message.blockMaxGas || Long.ZERO).toString()); - return obj; + const obj: any = {} + message.blockMaxBytes !== undefined && + (obj.blockMaxBytes = (message.blockMaxBytes || Long.ZERO).toString()) + message.blockMaxGas !== undefined && + (obj.blockMaxGas = (message.blockMaxGas || Long.ZERO).toString()) + return obj }, fromPartial, I>>(object: I): HashedParams { - const message = createBaseHashedParams(); - message.blockMaxBytes = (object.blockMaxBytes !== undefined && object.blockMaxBytes !== null) - ? Long.fromValue(object.blockMaxBytes) - : Long.ZERO; - message.blockMaxGas = (object.blockMaxGas !== undefined && object.blockMaxGas !== null) - ? Long.fromValue(object.blockMaxGas) - : Long.ZERO; - return message; + const message = createBaseHashedParams() + message.blockMaxBytes = + object.blockMaxBytes !== undefined && object.blockMaxBytes !== null + ? Long.fromValue(object.blockMaxBytes) + : Long.ZERO + message.blockMaxGas = + object.blockMaxGas !== undefined && object.blockMaxGas !== null + ? Long.fromValue(object.blockMaxGas) + : Long.ZERO + return message }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; +} -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/tendermint/types/types.ts b/packages/protojs/src/tendermint/types/types.ts index 0401fd01..b41108f4 100644 --- a/packages/protojs/src/tendermint/types/types.ts +++ b/packages/protojs/src/tendermint/types/types.ts @@ -1,12 +1,12 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { Timestamp } from "../../google/protobuf/timestamp"; -import { Proof } from "../crypto/proof"; -import { Consensus } from "../version/types"; -import { ValidatorSet } from "./validator"; +import { Proof } from "../crypto/proof" +import { Consensus } from "../version/types" +import { ValidatorSet } from "./validator" +import { Timestamp } from "../../google/protobuf/timestamp" +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "tendermint.types"; +export const protobufPackage = "tendermint.types" /** BlockIdFlag indicates which BlcokID the signature is for */ export enum BlockIDFlag { @@ -21,36 +21,36 @@ export function blockIDFlagFromJSON(object: any): BlockIDFlag { switch (object) { case 0: case "BLOCK_ID_FLAG_UNKNOWN": - return BlockIDFlag.BLOCK_ID_FLAG_UNKNOWN; + return BlockIDFlag.BLOCK_ID_FLAG_UNKNOWN case 1: case "BLOCK_ID_FLAG_ABSENT": - return BlockIDFlag.BLOCK_ID_FLAG_ABSENT; + return BlockIDFlag.BLOCK_ID_FLAG_ABSENT case 2: case "BLOCK_ID_FLAG_COMMIT": - return BlockIDFlag.BLOCK_ID_FLAG_COMMIT; + return BlockIDFlag.BLOCK_ID_FLAG_COMMIT case 3: case "BLOCK_ID_FLAG_NIL": - return BlockIDFlag.BLOCK_ID_FLAG_NIL; + return BlockIDFlag.BLOCK_ID_FLAG_NIL case -1: case "UNRECOGNIZED": default: - return BlockIDFlag.UNRECOGNIZED; + return BlockIDFlag.UNRECOGNIZED } } export function blockIDFlagToJSON(object: BlockIDFlag): string { switch (object) { case BlockIDFlag.BLOCK_ID_FLAG_UNKNOWN: - return "BLOCK_ID_FLAG_UNKNOWN"; + return "BLOCK_ID_FLAG_UNKNOWN" case BlockIDFlag.BLOCK_ID_FLAG_ABSENT: - return "BLOCK_ID_FLAG_ABSENT"; + return "BLOCK_ID_FLAG_ABSENT" case BlockIDFlag.BLOCK_ID_FLAG_COMMIT: - return "BLOCK_ID_FLAG_COMMIT"; + return "BLOCK_ID_FLAG_COMMIT" case BlockIDFlag.BLOCK_ID_FLAG_NIL: - return "BLOCK_ID_FLAG_NIL"; + return "BLOCK_ID_FLAG_NIL" case BlockIDFlag.UNRECOGNIZED: default: - return "UNRECOGNIZED"; + return "UNRECOGNIZED" } } @@ -69,84 +69,84 @@ export function signedMsgTypeFromJSON(object: any): SignedMsgType { switch (object) { case 0: case "SIGNED_MSG_TYPE_UNKNOWN": - return SignedMsgType.SIGNED_MSG_TYPE_UNKNOWN; + return SignedMsgType.SIGNED_MSG_TYPE_UNKNOWN case 1: case "SIGNED_MSG_TYPE_PREVOTE": - return SignedMsgType.SIGNED_MSG_TYPE_PREVOTE; + return SignedMsgType.SIGNED_MSG_TYPE_PREVOTE case 2: case "SIGNED_MSG_TYPE_PRECOMMIT": - return SignedMsgType.SIGNED_MSG_TYPE_PRECOMMIT; + return SignedMsgType.SIGNED_MSG_TYPE_PRECOMMIT case 32: case "SIGNED_MSG_TYPE_PROPOSAL": - return SignedMsgType.SIGNED_MSG_TYPE_PROPOSAL; + return SignedMsgType.SIGNED_MSG_TYPE_PROPOSAL case -1: case "UNRECOGNIZED": default: - return SignedMsgType.UNRECOGNIZED; + return SignedMsgType.UNRECOGNIZED } } export function signedMsgTypeToJSON(object: SignedMsgType): string { switch (object) { case SignedMsgType.SIGNED_MSG_TYPE_UNKNOWN: - return "SIGNED_MSG_TYPE_UNKNOWN"; + return "SIGNED_MSG_TYPE_UNKNOWN" case SignedMsgType.SIGNED_MSG_TYPE_PREVOTE: - return "SIGNED_MSG_TYPE_PREVOTE"; + return "SIGNED_MSG_TYPE_PREVOTE" case SignedMsgType.SIGNED_MSG_TYPE_PRECOMMIT: - return "SIGNED_MSG_TYPE_PRECOMMIT"; + return "SIGNED_MSG_TYPE_PRECOMMIT" case SignedMsgType.SIGNED_MSG_TYPE_PROPOSAL: - return "SIGNED_MSG_TYPE_PROPOSAL"; + return "SIGNED_MSG_TYPE_PROPOSAL" case SignedMsgType.UNRECOGNIZED: default: - return "UNRECOGNIZED"; + return "UNRECOGNIZED" } } /** PartsetHeader */ export interface PartSetHeader { - total: number; - hash: Uint8Array; + total: number + hash: Uint8Array } export interface Part { - index: number; - bytes: Uint8Array; - proof?: Proof; + index: number + bytes: Uint8Array + proof?: Proof } /** BlockID */ export interface BlockID { - hash: Uint8Array; - partSetHeader?: PartSetHeader; + hash: Uint8Array + partSetHeader?: PartSetHeader } /** Header defines the structure of a Tendermint block header. */ export interface Header { /** basic block info */ - version?: Consensus; - chainId: string; - height: Long; - time?: Date; + version?: Consensus + chainId: string + height: Long + time?: Date /** prev block info */ - lastBlockId?: BlockID; + lastBlockId?: BlockID /** hashes of block data */ - lastCommitHash: Uint8Array; + lastCommitHash: Uint8Array /** transactions */ - dataHash: Uint8Array; + dataHash: Uint8Array /** hashes from the app output from the prev block */ - validatorsHash: Uint8Array; + validatorsHash: Uint8Array /** validators for the next block */ - nextValidatorsHash: Uint8Array; + nextValidatorsHash: Uint8Array /** consensus params for current block */ - consensusHash: Uint8Array; + consensusHash: Uint8Array /** state after txs from the previous block */ - appHash: Uint8Array; + appHash: Uint8Array /** root hash of all results from the txs from the previous block */ - lastResultsHash: Uint8Array; + lastResultsHash: Uint8Array /** consensus info */ - evidenceHash: Uint8Array; + evidenceHash: Uint8Array /** original proposer of the block */ - proposerAddress: Uint8Array; + proposerAddress: Uint8Array } /** Data contains the set of transactions included in the block */ @@ -156,7 +156,7 @@ export interface Data { * NOTE: not all txs here are valid. We're just agreeing on the order first. * This means that block.AppHash does not include these txs. */ - txs: Uint8Array[]; + txs: Uint8Array[] } /** @@ -164,166 +164,170 @@ export interface Data { * consensus. */ export interface Vote { - type: SignedMsgType; - height: Long; - round: number; + type: SignedMsgType + height: Long + round: number /** zero if vote is nil. */ - blockId?: BlockID; - timestamp?: Date; - validatorAddress: Uint8Array; - validatorIndex: number; - signature: Uint8Array; + blockId?: BlockID + timestamp?: Date + validatorAddress: Uint8Array + validatorIndex: number + signature: Uint8Array } /** Commit contains the evidence that a block was committed by a set of validators. */ export interface Commit { - height: Long; - round: number; - blockId?: BlockID; - signatures: CommitSig[]; + height: Long + round: number + blockId?: BlockID + signatures: CommitSig[] } /** CommitSig is a part of the Vote included in a Commit. */ export interface CommitSig { - blockIdFlag: BlockIDFlag; - validatorAddress: Uint8Array; - timestamp?: Date; - signature: Uint8Array; + blockIdFlag: BlockIDFlag + validatorAddress: Uint8Array + timestamp?: Date + signature: Uint8Array } export interface Proposal { - type: SignedMsgType; - height: Long; - round: number; - polRound: number; - blockId?: BlockID; - timestamp?: Date; - signature: Uint8Array; + type: SignedMsgType + height: Long + round: number + polRound: number + blockId?: BlockID + timestamp?: Date + signature: Uint8Array } export interface SignedHeader { - header?: Header; - commit?: Commit; + header?: Header + commit?: Commit } export interface LightBlock { - signedHeader?: SignedHeader; - validatorSet?: ValidatorSet; + signedHeader?: SignedHeader + validatorSet?: ValidatorSet } export interface BlockMeta { - blockId?: BlockID; - blockSize: Long; - header?: Header; - numTxs: Long; + blockId?: BlockID + blockSize: Long + header?: Header + numTxs: Long } /** TxProof represents a Merkle proof of the presence of a transaction in the Merkle tree. */ export interface TxProof { - rootHash: Uint8Array; - data: Uint8Array; - proof?: Proof; + rootHash: Uint8Array + data: Uint8Array + proof?: Proof } function createBasePartSetHeader(): PartSetHeader { - return { total: 0, hash: new Uint8Array() }; + return { total: 0, hash: new Uint8Array() } } export const PartSetHeader = { encode(message: PartSetHeader, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.total !== 0) { - writer.uint32(8).uint32(message.total); + writer.uint32(8).uint32(message.total) } if (message.hash.length !== 0) { - writer.uint32(18).bytes(message.hash); + writer.uint32(18).bytes(message.hash) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): PartSetHeader { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBasePartSetHeader(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBasePartSetHeader() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.total = reader.uint32(); - break; + message.total = reader.uint32() + break case 2: - message.hash = reader.bytes(); - break; + message.hash = reader.bytes() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): PartSetHeader { return { total: isSet(object.total) ? Number(object.total) : 0, hash: isSet(object.hash) ? bytesFromBase64(object.hash) : new Uint8Array(), - }; + } }, toJSON(message: PartSetHeader): unknown { - const obj: any = {}; - message.total !== undefined && (obj.total = Math.round(message.total)); + const obj: any = {} + message.total !== undefined && (obj.total = Math.round(message.total)) message.hash !== undefined && - (obj.hash = base64FromBytes(message.hash !== undefined ? message.hash : new Uint8Array())); - return obj; + (obj.hash = base64FromBytes( + message.hash !== undefined ? message.hash : new Uint8Array(), + )) + return obj }, - fromPartial, I>>(object: I): PartSetHeader { - const message = createBasePartSetHeader(); - message.total = object.total ?? 0; - message.hash = object.hash ?? new Uint8Array(); - return message; + fromPartial, I>>( + object: I, + ): PartSetHeader { + const message = createBasePartSetHeader() + message.total = object.total ?? 0 + message.hash = object.hash ?? new Uint8Array() + return message }, -}; +} function createBasePart(): Part { - return { index: 0, bytes: new Uint8Array(), proof: undefined }; + return { index: 0, bytes: new Uint8Array(), proof: undefined } } export const Part = { encode(message: Part, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.index !== 0) { - writer.uint32(8).uint32(message.index); + writer.uint32(8).uint32(message.index) } if (message.bytes.length !== 0) { - writer.uint32(18).bytes(message.bytes); + writer.uint32(18).bytes(message.bytes) } if (message.proof !== undefined) { - Proof.encode(message.proof, writer.uint32(26).fork()).ldelim(); + Proof.encode(message.proof, writer.uint32(26).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Part { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBasePart(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBasePart() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.index = reader.uint32(); - break; + message.index = reader.uint32() + break case 2: - message.bytes = reader.bytes(); - break; + message.bytes = reader.bytes() + break case 3: - message.proof = Proof.decode(reader, reader.uint32()); - break; + message.proof = Proof.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Part { @@ -331,88 +335,101 @@ export const Part = { index: isSet(object.index) ? Number(object.index) : 0, bytes: isSet(object.bytes) ? bytesFromBase64(object.bytes) : new Uint8Array(), proof: isSet(object.proof) ? Proof.fromJSON(object.proof) : undefined, - }; + } }, toJSON(message: Part): unknown { - const obj: any = {}; - message.index !== undefined && (obj.index = Math.round(message.index)); + const obj: any = {} + message.index !== undefined && (obj.index = Math.round(message.index)) message.bytes !== undefined && - (obj.bytes = base64FromBytes(message.bytes !== undefined ? message.bytes : new Uint8Array())); - message.proof !== undefined && (obj.proof = message.proof ? Proof.toJSON(message.proof) : undefined); - return obj; + (obj.bytes = base64FromBytes( + message.bytes !== undefined ? message.bytes : new Uint8Array(), + )) + message.proof !== undefined && + (obj.proof = message.proof ? Proof.toJSON(message.proof) : undefined) + return obj }, fromPartial, I>>(object: I): Part { - const message = createBasePart(); - message.index = object.index ?? 0; - message.bytes = object.bytes ?? new Uint8Array(); - message.proof = (object.proof !== undefined && object.proof !== null) ? Proof.fromPartial(object.proof) : undefined; - return message; + const message = createBasePart() + message.index = object.index ?? 0 + message.bytes = object.bytes ?? new Uint8Array() + message.proof = + object.proof !== undefined && object.proof !== null + ? Proof.fromPartial(object.proof) + : undefined + return message }, -}; +} function createBaseBlockID(): BlockID { - return { hash: new Uint8Array(), partSetHeader: undefined }; + return { hash: new Uint8Array(), partSetHeader: undefined } } export const BlockID = { encode(message: BlockID, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.hash.length !== 0) { - writer.uint32(10).bytes(message.hash); + writer.uint32(10).bytes(message.hash) } if (message.partSetHeader !== undefined) { - PartSetHeader.encode(message.partSetHeader, writer.uint32(18).fork()).ldelim(); + PartSetHeader.encode(message.partSetHeader, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): BlockID { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseBlockID(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseBlockID() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.hash = reader.bytes(); - break; + message.hash = reader.bytes() + break case 2: - message.partSetHeader = PartSetHeader.decode(reader, reader.uint32()); - break; + message.partSetHeader = PartSetHeader.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): BlockID { return { hash: isSet(object.hash) ? bytesFromBase64(object.hash) : new Uint8Array(), - partSetHeader: isSet(object.partSetHeader) ? PartSetHeader.fromJSON(object.partSetHeader) : undefined, - }; + partSetHeader: isSet(object.partSetHeader) + ? PartSetHeader.fromJSON(object.partSetHeader) + : undefined, + } }, toJSON(message: BlockID): unknown { - const obj: any = {}; + const obj: any = {} message.hash !== undefined && - (obj.hash = base64FromBytes(message.hash !== undefined ? message.hash : new Uint8Array())); + (obj.hash = base64FromBytes( + message.hash !== undefined ? message.hash : new Uint8Array(), + )) message.partSetHeader !== undefined && - (obj.partSetHeader = message.partSetHeader ? PartSetHeader.toJSON(message.partSetHeader) : undefined); - return obj; + (obj.partSetHeader = message.partSetHeader + ? PartSetHeader.toJSON(message.partSetHeader) + : undefined) + return obj }, fromPartial, I>>(object: I): BlockID { - const message = createBaseBlockID(); - message.hash = object.hash ?? new Uint8Array(); - message.partSetHeader = (object.partSetHeader !== undefined && object.partSetHeader !== null) - ? PartSetHeader.fromPartial(object.partSetHeader) - : undefined; - return message; + const message = createBaseBlockID() + message.hash = object.hash ?? new Uint8Array() + message.partSetHeader = + object.partSetHeader !== undefined && object.partSetHeader !== null + ? PartSetHeader.fromPartial(object.partSetHeader) + : undefined + return message }, -}; +} function createBaseHeader(): Header { return { @@ -430,111 +447,111 @@ function createBaseHeader(): Header { lastResultsHash: new Uint8Array(), evidenceHash: new Uint8Array(), proposerAddress: new Uint8Array(), - }; + } } export const Header = { encode(message: Header, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.version !== undefined) { - Consensus.encode(message.version, writer.uint32(10).fork()).ldelim(); + Consensus.encode(message.version, writer.uint32(10).fork()).ldelim() } if (message.chainId !== "") { - writer.uint32(18).string(message.chainId); + writer.uint32(18).string(message.chainId) } if (!message.height.isZero()) { - writer.uint32(24).int64(message.height); + writer.uint32(24).int64(message.height) } if (message.time !== undefined) { - Timestamp.encode(toTimestamp(message.time), writer.uint32(34).fork()).ldelim(); + Timestamp.encode(toTimestamp(message.time), writer.uint32(34).fork()).ldelim() } if (message.lastBlockId !== undefined) { - BlockID.encode(message.lastBlockId, writer.uint32(42).fork()).ldelim(); + BlockID.encode(message.lastBlockId, writer.uint32(42).fork()).ldelim() } if (message.lastCommitHash.length !== 0) { - writer.uint32(50).bytes(message.lastCommitHash); + writer.uint32(50).bytes(message.lastCommitHash) } if (message.dataHash.length !== 0) { - writer.uint32(58).bytes(message.dataHash); + writer.uint32(58).bytes(message.dataHash) } if (message.validatorsHash.length !== 0) { - writer.uint32(66).bytes(message.validatorsHash); + writer.uint32(66).bytes(message.validatorsHash) } if (message.nextValidatorsHash.length !== 0) { - writer.uint32(74).bytes(message.nextValidatorsHash); + writer.uint32(74).bytes(message.nextValidatorsHash) } if (message.consensusHash.length !== 0) { - writer.uint32(82).bytes(message.consensusHash); + writer.uint32(82).bytes(message.consensusHash) } if (message.appHash.length !== 0) { - writer.uint32(90).bytes(message.appHash); + writer.uint32(90).bytes(message.appHash) } if (message.lastResultsHash.length !== 0) { - writer.uint32(98).bytes(message.lastResultsHash); + writer.uint32(98).bytes(message.lastResultsHash) } if (message.evidenceHash.length !== 0) { - writer.uint32(106).bytes(message.evidenceHash); + writer.uint32(106).bytes(message.evidenceHash) } if (message.proposerAddress.length !== 0) { - writer.uint32(114).bytes(message.proposerAddress); + writer.uint32(114).bytes(message.proposerAddress) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Header { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseHeader(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseHeader() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.version = Consensus.decode(reader, reader.uint32()); - break; + message.version = Consensus.decode(reader, reader.uint32()) + break case 2: - message.chainId = reader.string(); - break; + message.chainId = reader.string() + break case 3: - message.height = reader.int64() as Long; - break; + message.height = reader.int64() as Long + break case 4: - message.time = fromTimestamp(Timestamp.decode(reader, reader.uint32())); - break; + message.time = fromTimestamp(Timestamp.decode(reader, reader.uint32())) + break case 5: - message.lastBlockId = BlockID.decode(reader, reader.uint32()); - break; + message.lastBlockId = BlockID.decode(reader, reader.uint32()) + break case 6: - message.lastCommitHash = reader.bytes(); - break; + message.lastCommitHash = reader.bytes() + break case 7: - message.dataHash = reader.bytes(); - break; + message.dataHash = reader.bytes() + break case 8: - message.validatorsHash = reader.bytes(); - break; + message.validatorsHash = reader.bytes() + break case 9: - message.nextValidatorsHash = reader.bytes(); - break; + message.nextValidatorsHash = reader.bytes() + break case 10: - message.consensusHash = reader.bytes(); - break; + message.consensusHash = reader.bytes() + break case 11: - message.appHash = reader.bytes(); - break; + message.appHash = reader.bytes() + break case 12: - message.lastResultsHash = reader.bytes(); - break; + message.lastResultsHash = reader.bytes() + break case 13: - message.evidenceHash = reader.bytes(); - break; + message.evidenceHash = reader.bytes() + break case 14: - message.proposerAddress = reader.bytes(); - break; + message.proposerAddress = reader.bytes() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Header { @@ -543,140 +560,185 @@ export const Header = { chainId: isSet(object.chainId) ? String(object.chainId) : "", height: isSet(object.height) ? Long.fromValue(object.height) : Long.ZERO, time: isSet(object.time) ? fromJsonTimestamp(object.time) : undefined, - lastBlockId: isSet(object.lastBlockId) ? BlockID.fromJSON(object.lastBlockId) : undefined, - lastCommitHash: isSet(object.lastCommitHash) ? bytesFromBase64(object.lastCommitHash) : new Uint8Array(), - dataHash: isSet(object.dataHash) ? bytesFromBase64(object.dataHash) : new Uint8Array(), - validatorsHash: isSet(object.validatorsHash) ? bytesFromBase64(object.validatorsHash) : new Uint8Array(), + lastBlockId: isSet(object.lastBlockId) + ? BlockID.fromJSON(object.lastBlockId) + : undefined, + lastCommitHash: isSet(object.lastCommitHash) + ? bytesFromBase64(object.lastCommitHash) + : new Uint8Array(), + dataHash: isSet(object.dataHash) + ? bytesFromBase64(object.dataHash) + : new Uint8Array(), + validatorsHash: isSet(object.validatorsHash) + ? bytesFromBase64(object.validatorsHash) + : new Uint8Array(), nextValidatorsHash: isSet(object.nextValidatorsHash) ? bytesFromBase64(object.nextValidatorsHash) : new Uint8Array(), - consensusHash: isSet(object.consensusHash) ? bytesFromBase64(object.consensusHash) : new Uint8Array(), - appHash: isSet(object.appHash) ? bytesFromBase64(object.appHash) : new Uint8Array(), - lastResultsHash: isSet(object.lastResultsHash) ? bytesFromBase64(object.lastResultsHash) : new Uint8Array(), - evidenceHash: isSet(object.evidenceHash) ? bytesFromBase64(object.evidenceHash) : new Uint8Array(), - proposerAddress: isSet(object.proposerAddress) ? bytesFromBase64(object.proposerAddress) : new Uint8Array(), - }; + consensusHash: isSet(object.consensusHash) + ? bytesFromBase64(object.consensusHash) + : new Uint8Array(), + appHash: isSet(object.appHash) + ? bytesFromBase64(object.appHash) + : new Uint8Array(), + lastResultsHash: isSet(object.lastResultsHash) + ? bytesFromBase64(object.lastResultsHash) + : new Uint8Array(), + evidenceHash: isSet(object.evidenceHash) + ? bytesFromBase64(object.evidenceHash) + : new Uint8Array(), + proposerAddress: isSet(object.proposerAddress) + ? bytesFromBase64(object.proposerAddress) + : new Uint8Array(), + } }, toJSON(message: Header): unknown { - const obj: any = {}; - message.version !== undefined && (obj.version = message.version ? Consensus.toJSON(message.version) : undefined); - message.chainId !== undefined && (obj.chainId = message.chainId); - message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); - message.time !== undefined && (obj.time = message.time.toISOString()); + const obj: any = {} + message.version !== undefined && + (obj.version = message.version ? Consensus.toJSON(message.version) : undefined) + message.chainId !== undefined && (obj.chainId = message.chainId) + message.height !== undefined && + (obj.height = (message.height || Long.ZERO).toString()) + message.time !== undefined && (obj.time = message.time.toISOString()) message.lastBlockId !== undefined && - (obj.lastBlockId = message.lastBlockId ? BlockID.toJSON(message.lastBlockId) : undefined); + (obj.lastBlockId = message.lastBlockId + ? BlockID.toJSON(message.lastBlockId) + : undefined) message.lastCommitHash !== undefined && (obj.lastCommitHash = base64FromBytes( - message.lastCommitHash !== undefined ? message.lastCommitHash : new Uint8Array(), - )); + message.lastCommitHash !== undefined + ? message.lastCommitHash + : new Uint8Array(), + )) message.dataHash !== undefined && - (obj.dataHash = base64FromBytes(message.dataHash !== undefined ? message.dataHash : new Uint8Array())); + (obj.dataHash = base64FromBytes( + message.dataHash !== undefined ? message.dataHash : new Uint8Array(), + )) message.validatorsHash !== undefined && (obj.validatorsHash = base64FromBytes( - message.validatorsHash !== undefined ? message.validatorsHash : new Uint8Array(), - )); + message.validatorsHash !== undefined + ? message.validatorsHash + : new Uint8Array(), + )) message.nextValidatorsHash !== undefined && (obj.nextValidatorsHash = base64FromBytes( - message.nextValidatorsHash !== undefined ? message.nextValidatorsHash : new Uint8Array(), - )); + message.nextValidatorsHash !== undefined + ? message.nextValidatorsHash + : new Uint8Array(), + )) message.consensusHash !== undefined && (obj.consensusHash = base64FromBytes( message.consensusHash !== undefined ? message.consensusHash : new Uint8Array(), - )); + )) message.appHash !== undefined && - (obj.appHash = base64FromBytes(message.appHash !== undefined ? message.appHash : new Uint8Array())); + (obj.appHash = base64FromBytes( + message.appHash !== undefined ? message.appHash : new Uint8Array(), + )) message.lastResultsHash !== undefined && (obj.lastResultsHash = base64FromBytes( - message.lastResultsHash !== undefined ? message.lastResultsHash : new Uint8Array(), - )); + message.lastResultsHash !== undefined + ? message.lastResultsHash + : new Uint8Array(), + )) message.evidenceHash !== undefined && (obj.evidenceHash = base64FromBytes( message.evidenceHash !== undefined ? message.evidenceHash : new Uint8Array(), - )); + )) message.proposerAddress !== undefined && (obj.proposerAddress = base64FromBytes( - message.proposerAddress !== undefined ? message.proposerAddress : new Uint8Array(), - )); - return obj; + message.proposerAddress !== undefined + ? message.proposerAddress + : new Uint8Array(), + )) + return obj }, fromPartial, I>>(object: I): Header { - const message = createBaseHeader(); - message.version = (object.version !== undefined && object.version !== null) - ? Consensus.fromPartial(object.version) - : undefined; - message.chainId = object.chainId ?? ""; - message.height = (object.height !== undefined && object.height !== null) - ? Long.fromValue(object.height) - : Long.ZERO; - message.time = object.time ?? undefined; - message.lastBlockId = (object.lastBlockId !== undefined && object.lastBlockId !== null) - ? BlockID.fromPartial(object.lastBlockId) - : undefined; - message.lastCommitHash = object.lastCommitHash ?? new Uint8Array(); - message.dataHash = object.dataHash ?? new Uint8Array(); - message.validatorsHash = object.validatorsHash ?? new Uint8Array(); - message.nextValidatorsHash = object.nextValidatorsHash ?? new Uint8Array(); - message.consensusHash = object.consensusHash ?? new Uint8Array(); - message.appHash = object.appHash ?? new Uint8Array(); - message.lastResultsHash = object.lastResultsHash ?? new Uint8Array(); - message.evidenceHash = object.evidenceHash ?? new Uint8Array(); - message.proposerAddress = object.proposerAddress ?? new Uint8Array(); - return message; - }, -}; + const message = createBaseHeader() + message.version = + object.version !== undefined && object.version !== null + ? Consensus.fromPartial(object.version) + : undefined + message.chainId = object.chainId ?? "" + message.height = + object.height !== undefined && object.height !== null + ? Long.fromValue(object.height) + : Long.ZERO + message.time = object.time ?? undefined + message.lastBlockId = + object.lastBlockId !== undefined && object.lastBlockId !== null + ? BlockID.fromPartial(object.lastBlockId) + : undefined + message.lastCommitHash = object.lastCommitHash ?? new Uint8Array() + message.dataHash = object.dataHash ?? new Uint8Array() + message.validatorsHash = object.validatorsHash ?? new Uint8Array() + message.nextValidatorsHash = object.nextValidatorsHash ?? new Uint8Array() + message.consensusHash = object.consensusHash ?? new Uint8Array() + message.appHash = object.appHash ?? new Uint8Array() + message.lastResultsHash = object.lastResultsHash ?? new Uint8Array() + message.evidenceHash = object.evidenceHash ?? new Uint8Array() + message.proposerAddress = object.proposerAddress ?? new Uint8Array() + return message + }, +} function createBaseData(): Data { - return { txs: [] }; + return { txs: [] } } export const Data = { encode(message: Data, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.txs) { - writer.uint32(10).bytes(v!); + writer.uint32(10).bytes(v!) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Data { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseData(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseData() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.txs.push(reader.bytes()); - break; + message.txs.push(reader.bytes()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Data { - return { txs: Array.isArray(object?.txs) ? object.txs.map((e: any) => bytesFromBase64(e)) : [] }; + return { + txs: Array.isArray(object?.txs) + ? object.txs.map((e: any) => bytesFromBase64(e)) + : [], + } }, toJSON(message: Data): unknown { - const obj: any = {}; + const obj: any = {} if (message.txs) { - obj.txs = message.txs.map((e) => base64FromBytes(e !== undefined ? e : new Uint8Array())); + obj.txs = message.txs.map((e) => + base64FromBytes(e !== undefined ? e : new Uint8Array()), + ) } else { - obj.txs = []; + obj.txs = [] } - return obj; + return obj }, fromPartial, I>>(object: I): Data { - const message = createBaseData(); - message.txs = object.txs?.map((e) => e) || []; - return message; + const message = createBaseData() + message.txs = object.txs?.map((e) => e) || [] + return message }, -}; +} function createBaseVote(): Vote { return { @@ -688,75 +750,78 @@ function createBaseVote(): Vote { validatorAddress: new Uint8Array(), validatorIndex: 0, signature: new Uint8Array(), - }; + } } export const Vote = { encode(message: Vote, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.type !== 0) { - writer.uint32(8).int32(message.type); + writer.uint32(8).int32(message.type) } if (!message.height.isZero()) { - writer.uint32(16).int64(message.height); + writer.uint32(16).int64(message.height) } if (message.round !== 0) { - writer.uint32(24).int32(message.round); + writer.uint32(24).int32(message.round) } if (message.blockId !== undefined) { - BlockID.encode(message.blockId, writer.uint32(34).fork()).ldelim(); + BlockID.encode(message.blockId, writer.uint32(34).fork()).ldelim() } if (message.timestamp !== undefined) { - Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(42).fork()).ldelim(); + Timestamp.encode( + toTimestamp(message.timestamp), + writer.uint32(42).fork(), + ).ldelim() } if (message.validatorAddress.length !== 0) { - writer.uint32(50).bytes(message.validatorAddress); + writer.uint32(50).bytes(message.validatorAddress) } if (message.validatorIndex !== 0) { - writer.uint32(56).int32(message.validatorIndex); + writer.uint32(56).int32(message.validatorIndex) } if (message.signature.length !== 0) { - writer.uint32(66).bytes(message.signature); + writer.uint32(66).bytes(message.signature) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Vote { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseVote(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseVote() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.type = reader.int32() as any; - break; + message.type = reader.int32() as any + break case 2: - message.height = reader.int64() as Long; - break; + message.height = reader.int64() as Long + break case 3: - message.round = reader.int32(); - break; + message.round = reader.int32() + break case 4: - message.blockId = BlockID.decode(reader, reader.uint32()); - break; + message.blockId = BlockID.decode(reader, reader.uint32()) + break case 5: - message.timestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32())); - break; + message.timestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32())) + break case 6: - message.validatorAddress = reader.bytes(); - break; + message.validatorAddress = reader.bytes() + break case 7: - message.validatorIndex = reader.int32(); - break; + message.validatorIndex = reader.int32() + break case 8: - message.signature = reader.bytes(); - break; + message.signature = reader.bytes() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Vote { @@ -765,94 +830,109 @@ export const Vote = { height: isSet(object.height) ? Long.fromValue(object.height) : Long.ZERO, round: isSet(object.round) ? Number(object.round) : 0, blockId: isSet(object.blockId) ? BlockID.fromJSON(object.blockId) : undefined, - timestamp: isSet(object.timestamp) ? fromJsonTimestamp(object.timestamp) : undefined, - validatorAddress: isSet(object.validatorAddress) ? bytesFromBase64(object.validatorAddress) : new Uint8Array(), + timestamp: isSet(object.timestamp) + ? fromJsonTimestamp(object.timestamp) + : undefined, + validatorAddress: isSet(object.validatorAddress) + ? bytesFromBase64(object.validatorAddress) + : new Uint8Array(), validatorIndex: isSet(object.validatorIndex) ? Number(object.validatorIndex) : 0, - signature: isSet(object.signature) ? bytesFromBase64(object.signature) : new Uint8Array(), - }; + signature: isSet(object.signature) + ? bytesFromBase64(object.signature) + : new Uint8Array(), + } }, toJSON(message: Vote): unknown { - const obj: any = {}; - message.type !== undefined && (obj.type = signedMsgTypeToJSON(message.type)); - message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); - message.round !== undefined && (obj.round = Math.round(message.round)); - message.blockId !== undefined && (obj.blockId = message.blockId ? BlockID.toJSON(message.blockId) : undefined); - message.timestamp !== undefined && (obj.timestamp = message.timestamp.toISOString()); + const obj: any = {} + message.type !== undefined && (obj.type = signedMsgTypeToJSON(message.type)) + message.height !== undefined && + (obj.height = (message.height || Long.ZERO).toString()) + message.round !== undefined && (obj.round = Math.round(message.round)) + message.blockId !== undefined && + (obj.blockId = message.blockId ? BlockID.toJSON(message.blockId) : undefined) + message.timestamp !== undefined && (obj.timestamp = message.timestamp.toISOString()) message.validatorAddress !== undefined && (obj.validatorAddress = base64FromBytes( - message.validatorAddress !== undefined ? message.validatorAddress : new Uint8Array(), - )); - message.validatorIndex !== undefined && (obj.validatorIndex = Math.round(message.validatorIndex)); + message.validatorAddress !== undefined + ? message.validatorAddress + : new Uint8Array(), + )) + message.validatorIndex !== undefined && + (obj.validatorIndex = Math.round(message.validatorIndex)) message.signature !== undefined && - (obj.signature = base64FromBytes(message.signature !== undefined ? message.signature : new Uint8Array())); - return obj; + (obj.signature = base64FromBytes( + message.signature !== undefined ? message.signature : new Uint8Array(), + )) + return obj }, fromPartial, I>>(object: I): Vote { - const message = createBaseVote(); - message.type = object.type ?? 0; - message.height = (object.height !== undefined && object.height !== null) - ? Long.fromValue(object.height) - : Long.ZERO; - message.round = object.round ?? 0; - message.blockId = (object.blockId !== undefined && object.blockId !== null) - ? BlockID.fromPartial(object.blockId) - : undefined; - message.timestamp = object.timestamp ?? undefined; - message.validatorAddress = object.validatorAddress ?? new Uint8Array(); - message.validatorIndex = object.validatorIndex ?? 0; - message.signature = object.signature ?? new Uint8Array(); - return message; - }, -}; + const message = createBaseVote() + message.type = object.type ?? 0 + message.height = + object.height !== undefined && object.height !== null + ? Long.fromValue(object.height) + : Long.ZERO + message.round = object.round ?? 0 + message.blockId = + object.blockId !== undefined && object.blockId !== null + ? BlockID.fromPartial(object.blockId) + : undefined + message.timestamp = object.timestamp ?? undefined + message.validatorAddress = object.validatorAddress ?? new Uint8Array() + message.validatorIndex = object.validatorIndex ?? 0 + message.signature = object.signature ?? new Uint8Array() + return message + }, +} function createBaseCommit(): Commit { - return { height: Long.ZERO, round: 0, blockId: undefined, signatures: [] }; + return { height: Long.ZERO, round: 0, blockId: undefined, signatures: [] } } export const Commit = { encode(message: Commit, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (!message.height.isZero()) { - writer.uint32(8).int64(message.height); + writer.uint32(8).int64(message.height) } if (message.round !== 0) { - writer.uint32(16).int32(message.round); + writer.uint32(16).int32(message.round) } if (message.blockId !== undefined) { - BlockID.encode(message.blockId, writer.uint32(26).fork()).ldelim(); + BlockID.encode(message.blockId, writer.uint32(26).fork()).ldelim() } for (const v of message.signatures) { - CommitSig.encode(v!, writer.uint32(34).fork()).ldelim(); + CommitSig.encode(v!, writer.uint32(34).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Commit { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseCommit(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseCommit() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.height = reader.int64() as Long; - break; + message.height = reader.int64() as Long + break case 2: - message.round = reader.int32(); - break; + message.round = reader.int32() + break case 3: - message.blockId = BlockID.decode(reader, reader.uint32()); - break; + message.blockId = BlockID.decode(reader, reader.uint32()) + break case 4: - message.signatures.push(CommitSig.decode(reader, reader.uint32())); - break; + message.signatures.push(CommitSig.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Commit { @@ -860,116 +940,145 @@ export const Commit = { height: isSet(object.height) ? Long.fromValue(object.height) : Long.ZERO, round: isSet(object.round) ? Number(object.round) : 0, blockId: isSet(object.blockId) ? BlockID.fromJSON(object.blockId) : undefined, - signatures: Array.isArray(object?.signatures) ? object.signatures.map((e: any) => CommitSig.fromJSON(e)) : [], - }; + signatures: Array.isArray(object?.signatures) + ? object.signatures.map((e: any) => CommitSig.fromJSON(e)) + : [], + } }, toJSON(message: Commit): unknown { - const obj: any = {}; - message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); - message.round !== undefined && (obj.round = Math.round(message.round)); - message.blockId !== undefined && (obj.blockId = message.blockId ? BlockID.toJSON(message.blockId) : undefined); + const obj: any = {} + message.height !== undefined && + (obj.height = (message.height || Long.ZERO).toString()) + message.round !== undefined && (obj.round = Math.round(message.round)) + message.blockId !== undefined && + (obj.blockId = message.blockId ? BlockID.toJSON(message.blockId) : undefined) if (message.signatures) { - obj.signatures = message.signatures.map((e) => e ? CommitSig.toJSON(e) : undefined); + obj.signatures = message.signatures.map((e) => + e ? CommitSig.toJSON(e) : undefined, + ) } else { - obj.signatures = []; + obj.signatures = [] } - return obj; + return obj }, fromPartial, I>>(object: I): Commit { - const message = createBaseCommit(); - message.height = (object.height !== undefined && object.height !== null) - ? Long.fromValue(object.height) - : Long.ZERO; - message.round = object.round ?? 0; - message.blockId = (object.blockId !== undefined && object.blockId !== null) - ? BlockID.fromPartial(object.blockId) - : undefined; - message.signatures = object.signatures?.map((e) => CommitSig.fromPartial(e)) || []; - return message; - }, -}; + const message = createBaseCommit() + message.height = + object.height !== undefined && object.height !== null + ? Long.fromValue(object.height) + : Long.ZERO + message.round = object.round ?? 0 + message.blockId = + object.blockId !== undefined && object.blockId !== null + ? BlockID.fromPartial(object.blockId) + : undefined + message.signatures = object.signatures?.map((e) => CommitSig.fromPartial(e)) || [] + return message + }, +} function createBaseCommitSig(): CommitSig { - return { blockIdFlag: 0, validatorAddress: new Uint8Array(), timestamp: undefined, signature: new Uint8Array() }; + return { + blockIdFlag: 0, + validatorAddress: new Uint8Array(), + timestamp: undefined, + signature: new Uint8Array(), + } } export const CommitSig = { encode(message: CommitSig, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.blockIdFlag !== 0) { - writer.uint32(8).int32(message.blockIdFlag); + writer.uint32(8).int32(message.blockIdFlag) } if (message.validatorAddress.length !== 0) { - writer.uint32(18).bytes(message.validatorAddress); + writer.uint32(18).bytes(message.validatorAddress) } if (message.timestamp !== undefined) { - Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(26).fork()).ldelim(); + Timestamp.encode( + toTimestamp(message.timestamp), + writer.uint32(26).fork(), + ).ldelim() } if (message.signature.length !== 0) { - writer.uint32(34).bytes(message.signature); + writer.uint32(34).bytes(message.signature) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): CommitSig { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseCommitSig(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseCommitSig() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.blockIdFlag = reader.int32() as any; - break; + message.blockIdFlag = reader.int32() as any + break case 2: - message.validatorAddress = reader.bytes(); - break; + message.validatorAddress = reader.bytes() + break case 3: - message.timestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32())); - break; + message.timestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32())) + break case 4: - message.signature = reader.bytes(); - break; + message.signature = reader.bytes() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): CommitSig { return { - blockIdFlag: isSet(object.blockIdFlag) ? blockIDFlagFromJSON(object.blockIdFlag) : 0, - validatorAddress: isSet(object.validatorAddress) ? bytesFromBase64(object.validatorAddress) : new Uint8Array(), - timestamp: isSet(object.timestamp) ? fromJsonTimestamp(object.timestamp) : undefined, - signature: isSet(object.signature) ? bytesFromBase64(object.signature) : new Uint8Array(), - }; + blockIdFlag: isSet(object.blockIdFlag) + ? blockIDFlagFromJSON(object.blockIdFlag) + : 0, + validatorAddress: isSet(object.validatorAddress) + ? bytesFromBase64(object.validatorAddress) + : new Uint8Array(), + timestamp: isSet(object.timestamp) + ? fromJsonTimestamp(object.timestamp) + : undefined, + signature: isSet(object.signature) + ? bytesFromBase64(object.signature) + : new Uint8Array(), + } }, toJSON(message: CommitSig): unknown { - const obj: any = {}; - message.blockIdFlag !== undefined && (obj.blockIdFlag = blockIDFlagToJSON(message.blockIdFlag)); + const obj: any = {} + message.blockIdFlag !== undefined && + (obj.blockIdFlag = blockIDFlagToJSON(message.blockIdFlag)) message.validatorAddress !== undefined && (obj.validatorAddress = base64FromBytes( - message.validatorAddress !== undefined ? message.validatorAddress : new Uint8Array(), - )); - message.timestamp !== undefined && (obj.timestamp = message.timestamp.toISOString()); + message.validatorAddress !== undefined + ? message.validatorAddress + : new Uint8Array(), + )) + message.timestamp !== undefined && (obj.timestamp = message.timestamp.toISOString()) message.signature !== undefined && - (obj.signature = base64FromBytes(message.signature !== undefined ? message.signature : new Uint8Array())); - return obj; + (obj.signature = base64FromBytes( + message.signature !== undefined ? message.signature : new Uint8Array(), + )) + return obj }, fromPartial, I>>(object: I): CommitSig { - const message = createBaseCommitSig(); - message.blockIdFlag = object.blockIdFlag ?? 0; - message.validatorAddress = object.validatorAddress ?? new Uint8Array(); - message.timestamp = object.timestamp ?? undefined; - message.signature = object.signature ?? new Uint8Array(); - return message; + const message = createBaseCommitSig() + message.blockIdFlag = object.blockIdFlag ?? 0 + message.validatorAddress = object.validatorAddress ?? new Uint8Array() + message.timestamp = object.timestamp ?? undefined + message.signature = object.signature ?? new Uint8Array() + return message }, -}; +} function createBaseProposal(): Proposal { return { @@ -980,69 +1089,72 @@ function createBaseProposal(): Proposal { blockId: undefined, timestamp: undefined, signature: new Uint8Array(), - }; + } } export const Proposal = { encode(message: Proposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.type !== 0) { - writer.uint32(8).int32(message.type); + writer.uint32(8).int32(message.type) } if (!message.height.isZero()) { - writer.uint32(16).int64(message.height); + writer.uint32(16).int64(message.height) } if (message.round !== 0) { - writer.uint32(24).int32(message.round); + writer.uint32(24).int32(message.round) } if (message.polRound !== 0) { - writer.uint32(32).int32(message.polRound); + writer.uint32(32).int32(message.polRound) } if (message.blockId !== undefined) { - BlockID.encode(message.blockId, writer.uint32(42).fork()).ldelim(); + BlockID.encode(message.blockId, writer.uint32(42).fork()).ldelim() } if (message.timestamp !== undefined) { - Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(50).fork()).ldelim(); + Timestamp.encode( + toTimestamp(message.timestamp), + writer.uint32(50).fork(), + ).ldelim() } if (message.signature.length !== 0) { - writer.uint32(58).bytes(message.signature); + writer.uint32(58).bytes(message.signature) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Proposal { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseProposal(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseProposal() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.type = reader.int32() as any; - break; + message.type = reader.int32() as any + break case 2: - message.height = reader.int64() as Long; - break; + message.height = reader.int64() as Long + break case 3: - message.round = reader.int32(); - break; + message.round = reader.int32() + break case 4: - message.polRound = reader.int32(); - break; + message.polRound = reader.int32() + break case 5: - message.blockId = BlockID.decode(reader, reader.uint32()); - break; + message.blockId = BlockID.decode(reader, reader.uint32()) + break case 6: - message.timestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32())); - break; + message.timestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32())) + break case 7: - message.signature = reader.bytes(); - break; + message.signature = reader.bytes() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Proposal { @@ -1052,213 +1164,242 @@ export const Proposal = { round: isSet(object.round) ? Number(object.round) : 0, polRound: isSet(object.polRound) ? Number(object.polRound) : 0, blockId: isSet(object.blockId) ? BlockID.fromJSON(object.blockId) : undefined, - timestamp: isSet(object.timestamp) ? fromJsonTimestamp(object.timestamp) : undefined, - signature: isSet(object.signature) ? bytesFromBase64(object.signature) : new Uint8Array(), - }; + timestamp: isSet(object.timestamp) + ? fromJsonTimestamp(object.timestamp) + : undefined, + signature: isSet(object.signature) + ? bytesFromBase64(object.signature) + : new Uint8Array(), + } }, toJSON(message: Proposal): unknown { - const obj: any = {}; - message.type !== undefined && (obj.type = signedMsgTypeToJSON(message.type)); - message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); - message.round !== undefined && (obj.round = Math.round(message.round)); - message.polRound !== undefined && (obj.polRound = Math.round(message.polRound)); - message.blockId !== undefined && (obj.blockId = message.blockId ? BlockID.toJSON(message.blockId) : undefined); - message.timestamp !== undefined && (obj.timestamp = message.timestamp.toISOString()); + const obj: any = {} + message.type !== undefined && (obj.type = signedMsgTypeToJSON(message.type)) + message.height !== undefined && + (obj.height = (message.height || Long.ZERO).toString()) + message.round !== undefined && (obj.round = Math.round(message.round)) + message.polRound !== undefined && (obj.polRound = Math.round(message.polRound)) + message.blockId !== undefined && + (obj.blockId = message.blockId ? BlockID.toJSON(message.blockId) : undefined) + message.timestamp !== undefined && (obj.timestamp = message.timestamp.toISOString()) message.signature !== undefined && - (obj.signature = base64FromBytes(message.signature !== undefined ? message.signature : new Uint8Array())); - return obj; + (obj.signature = base64FromBytes( + message.signature !== undefined ? message.signature : new Uint8Array(), + )) + return obj }, fromPartial, I>>(object: I): Proposal { - const message = createBaseProposal(); - message.type = object.type ?? 0; - message.height = (object.height !== undefined && object.height !== null) - ? Long.fromValue(object.height) - : Long.ZERO; - message.round = object.round ?? 0; - message.polRound = object.polRound ?? 0; - message.blockId = (object.blockId !== undefined && object.blockId !== null) - ? BlockID.fromPartial(object.blockId) - : undefined; - message.timestamp = object.timestamp ?? undefined; - message.signature = object.signature ?? new Uint8Array(); - return message; - }, -}; + const message = createBaseProposal() + message.type = object.type ?? 0 + message.height = + object.height !== undefined && object.height !== null + ? Long.fromValue(object.height) + : Long.ZERO + message.round = object.round ?? 0 + message.polRound = object.polRound ?? 0 + message.blockId = + object.blockId !== undefined && object.blockId !== null + ? BlockID.fromPartial(object.blockId) + : undefined + message.timestamp = object.timestamp ?? undefined + message.signature = object.signature ?? new Uint8Array() + return message + }, +} function createBaseSignedHeader(): SignedHeader { - return { header: undefined, commit: undefined }; + return { header: undefined, commit: undefined } } export const SignedHeader = { encode(message: SignedHeader, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.header !== undefined) { - Header.encode(message.header, writer.uint32(10).fork()).ldelim(); + Header.encode(message.header, writer.uint32(10).fork()).ldelim() } if (message.commit !== undefined) { - Commit.encode(message.commit, writer.uint32(18).fork()).ldelim(); + Commit.encode(message.commit, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): SignedHeader { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSignedHeader(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseSignedHeader() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.header = Header.decode(reader, reader.uint32()); - break; + message.header = Header.decode(reader, reader.uint32()) + break case 2: - message.commit = Commit.decode(reader, reader.uint32()); - break; + message.commit = Commit.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): SignedHeader { return { header: isSet(object.header) ? Header.fromJSON(object.header) : undefined, commit: isSet(object.commit) ? Commit.fromJSON(object.commit) : undefined, - }; + } }, toJSON(message: SignedHeader): unknown { - const obj: any = {}; - message.header !== undefined && (obj.header = message.header ? Header.toJSON(message.header) : undefined); - message.commit !== undefined && (obj.commit = message.commit ? Commit.toJSON(message.commit) : undefined); - return obj; + const obj: any = {} + message.header !== undefined && + (obj.header = message.header ? Header.toJSON(message.header) : undefined) + message.commit !== undefined && + (obj.commit = message.commit ? Commit.toJSON(message.commit) : undefined) + return obj }, fromPartial, I>>(object: I): SignedHeader { - const message = createBaseSignedHeader(); - message.header = (object.header !== undefined && object.header !== null) - ? Header.fromPartial(object.header) - : undefined; - message.commit = (object.commit !== undefined && object.commit !== null) - ? Commit.fromPartial(object.commit) - : undefined; - return message; + const message = createBaseSignedHeader() + message.header = + object.header !== undefined && object.header !== null + ? Header.fromPartial(object.header) + : undefined + message.commit = + object.commit !== undefined && object.commit !== null + ? Commit.fromPartial(object.commit) + : undefined + return message }, -}; +} function createBaseLightBlock(): LightBlock { - return { signedHeader: undefined, validatorSet: undefined }; + return { signedHeader: undefined, validatorSet: undefined } } export const LightBlock = { encode(message: LightBlock, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.signedHeader !== undefined) { - SignedHeader.encode(message.signedHeader, writer.uint32(10).fork()).ldelim(); + SignedHeader.encode(message.signedHeader, writer.uint32(10).fork()).ldelim() } if (message.validatorSet !== undefined) { - ValidatorSet.encode(message.validatorSet, writer.uint32(18).fork()).ldelim(); + ValidatorSet.encode(message.validatorSet, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): LightBlock { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseLightBlock(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseLightBlock() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.signedHeader = SignedHeader.decode(reader, reader.uint32()); - break; + message.signedHeader = SignedHeader.decode(reader, reader.uint32()) + break case 2: - message.validatorSet = ValidatorSet.decode(reader, reader.uint32()); - break; + message.validatorSet = ValidatorSet.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): LightBlock { return { - signedHeader: isSet(object.signedHeader) ? SignedHeader.fromJSON(object.signedHeader) : undefined, - validatorSet: isSet(object.validatorSet) ? ValidatorSet.fromJSON(object.validatorSet) : undefined, - }; + signedHeader: isSet(object.signedHeader) + ? SignedHeader.fromJSON(object.signedHeader) + : undefined, + validatorSet: isSet(object.validatorSet) + ? ValidatorSet.fromJSON(object.validatorSet) + : undefined, + } }, toJSON(message: LightBlock): unknown { - const obj: any = {}; + const obj: any = {} message.signedHeader !== undefined && - (obj.signedHeader = message.signedHeader ? SignedHeader.toJSON(message.signedHeader) : undefined); + (obj.signedHeader = message.signedHeader + ? SignedHeader.toJSON(message.signedHeader) + : undefined) message.validatorSet !== undefined && - (obj.validatorSet = message.validatorSet ? ValidatorSet.toJSON(message.validatorSet) : undefined); - return obj; + (obj.validatorSet = message.validatorSet + ? ValidatorSet.toJSON(message.validatorSet) + : undefined) + return obj }, fromPartial, I>>(object: I): LightBlock { - const message = createBaseLightBlock(); - message.signedHeader = (object.signedHeader !== undefined && object.signedHeader !== null) - ? SignedHeader.fromPartial(object.signedHeader) - : undefined; - message.validatorSet = (object.validatorSet !== undefined && object.validatorSet !== null) - ? ValidatorSet.fromPartial(object.validatorSet) - : undefined; - return message; + const message = createBaseLightBlock() + message.signedHeader = + object.signedHeader !== undefined && object.signedHeader !== null + ? SignedHeader.fromPartial(object.signedHeader) + : undefined + message.validatorSet = + object.validatorSet !== undefined && object.validatorSet !== null + ? ValidatorSet.fromPartial(object.validatorSet) + : undefined + return message }, -}; +} function createBaseBlockMeta(): BlockMeta { - return { blockId: undefined, blockSize: Long.ZERO, header: undefined, numTxs: Long.ZERO }; + return { + blockId: undefined, + blockSize: Long.ZERO, + header: undefined, + numTxs: Long.ZERO, + } } export const BlockMeta = { encode(message: BlockMeta, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.blockId !== undefined) { - BlockID.encode(message.blockId, writer.uint32(10).fork()).ldelim(); + BlockID.encode(message.blockId, writer.uint32(10).fork()).ldelim() } if (!message.blockSize.isZero()) { - writer.uint32(16).int64(message.blockSize); + writer.uint32(16).int64(message.blockSize) } if (message.header !== undefined) { - Header.encode(message.header, writer.uint32(26).fork()).ldelim(); + Header.encode(message.header, writer.uint32(26).fork()).ldelim() } if (!message.numTxs.isZero()) { - writer.uint32(32).int64(message.numTxs); + writer.uint32(32).int64(message.numTxs) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): BlockMeta { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseBlockMeta(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseBlockMeta() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.blockId = BlockID.decode(reader, reader.uint32()); - break; + message.blockId = BlockID.decode(reader, reader.uint32()) + break case 2: - message.blockSize = reader.int64() as Long; - break; + message.blockSize = reader.int64() as Long + break case 3: - message.header = Header.decode(reader, reader.uint32()); - break; + message.header = Header.decode(reader, reader.uint32()) + break case 4: - message.numTxs = reader.int64() as Long; - break; + message.numTxs = reader.int64() as Long + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): BlockMeta { @@ -1267,192 +1408,208 @@ export const BlockMeta = { blockSize: isSet(object.blockSize) ? Long.fromValue(object.blockSize) : Long.ZERO, header: isSet(object.header) ? Header.fromJSON(object.header) : undefined, numTxs: isSet(object.numTxs) ? Long.fromValue(object.numTxs) : Long.ZERO, - }; + } }, toJSON(message: BlockMeta): unknown { - const obj: any = {}; - message.blockId !== undefined && (obj.blockId = message.blockId ? BlockID.toJSON(message.blockId) : undefined); - message.blockSize !== undefined && (obj.blockSize = (message.blockSize || Long.ZERO).toString()); - message.header !== undefined && (obj.header = message.header ? Header.toJSON(message.header) : undefined); - message.numTxs !== undefined && (obj.numTxs = (message.numTxs || Long.ZERO).toString()); - return obj; + const obj: any = {} + message.blockId !== undefined && + (obj.blockId = message.blockId ? BlockID.toJSON(message.blockId) : undefined) + message.blockSize !== undefined && + (obj.blockSize = (message.blockSize || Long.ZERO).toString()) + message.header !== undefined && + (obj.header = message.header ? Header.toJSON(message.header) : undefined) + message.numTxs !== undefined && + (obj.numTxs = (message.numTxs || Long.ZERO).toString()) + return obj }, fromPartial, I>>(object: I): BlockMeta { - const message = createBaseBlockMeta(); - message.blockId = (object.blockId !== undefined && object.blockId !== null) - ? BlockID.fromPartial(object.blockId) - : undefined; - message.blockSize = (object.blockSize !== undefined && object.blockSize !== null) - ? Long.fromValue(object.blockSize) - : Long.ZERO; - message.header = (object.header !== undefined && object.header !== null) - ? Header.fromPartial(object.header) - : undefined; - message.numTxs = (object.numTxs !== undefined && object.numTxs !== null) - ? Long.fromValue(object.numTxs) - : Long.ZERO; - return message; - }, -}; + const message = createBaseBlockMeta() + message.blockId = + object.blockId !== undefined && object.blockId !== null + ? BlockID.fromPartial(object.blockId) + : undefined + message.blockSize = + object.blockSize !== undefined && object.blockSize !== null + ? Long.fromValue(object.blockSize) + : Long.ZERO + message.header = + object.header !== undefined && object.header !== null + ? Header.fromPartial(object.header) + : undefined + message.numTxs = + object.numTxs !== undefined && object.numTxs !== null + ? Long.fromValue(object.numTxs) + : Long.ZERO + return message + }, +} function createBaseTxProof(): TxProof { - return { rootHash: new Uint8Array(), data: new Uint8Array(), proof: undefined }; + return { rootHash: new Uint8Array(), data: new Uint8Array(), proof: undefined } } export const TxProof = { encode(message: TxProof, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.rootHash.length !== 0) { - writer.uint32(10).bytes(message.rootHash); + writer.uint32(10).bytes(message.rootHash) } if (message.data.length !== 0) { - writer.uint32(18).bytes(message.data); + writer.uint32(18).bytes(message.data) } if (message.proof !== undefined) { - Proof.encode(message.proof, writer.uint32(26).fork()).ldelim(); + Proof.encode(message.proof, writer.uint32(26).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): TxProof { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseTxProof(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseTxProof() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.rootHash = reader.bytes(); - break; + message.rootHash = reader.bytes() + break case 2: - message.data = reader.bytes(); - break; + message.data = reader.bytes() + break case 3: - message.proof = Proof.decode(reader, reader.uint32()); - break; + message.proof = Proof.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): TxProof { return { - rootHash: isSet(object.rootHash) ? bytesFromBase64(object.rootHash) : new Uint8Array(), + rootHash: isSet(object.rootHash) + ? bytesFromBase64(object.rootHash) + : new Uint8Array(), data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(), proof: isSet(object.proof) ? Proof.fromJSON(object.proof) : undefined, - }; + } }, toJSON(message: TxProof): unknown { - const obj: any = {}; + const obj: any = {} message.rootHash !== undefined && - (obj.rootHash = base64FromBytes(message.rootHash !== undefined ? message.rootHash : new Uint8Array())); + (obj.rootHash = base64FromBytes( + message.rootHash !== undefined ? message.rootHash : new Uint8Array(), + )) message.data !== undefined && - (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); - message.proof !== undefined && (obj.proof = message.proof ? Proof.toJSON(message.proof) : undefined); - return obj; + (obj.data = base64FromBytes( + message.data !== undefined ? message.data : new Uint8Array(), + )) + message.proof !== undefined && + (obj.proof = message.proof ? Proof.toJSON(message.proof) : undefined) + return obj }, fromPartial, I>>(object: I): TxProof { - const message = createBaseTxProof(); - message.rootHash = object.rootHash ?? new Uint8Array(); - message.data = object.data ?? new Uint8Array(); - message.proof = (object.proof !== undefined && object.proof !== null) ? Proof.fromPartial(object.proof) : undefined; - return message; + const message = createBaseTxProof() + message.rootHash = object.rootHash ?? new Uint8Array() + message.data = object.data ?? new Uint8Array() + message.proof = + object.proof !== undefined && object.proof !== null + ? Proof.fromPartial(object.proof) + : undefined + return message }, -}; +} -declare var self: any | undefined; -declare var window: any | undefined; -declare var global: any | undefined; +declare var self: any | undefined +declare var window: any | undefined +declare var global: any | undefined var globalThis: any = (() => { - if (typeof globalThis !== "undefined") { - return globalThis; - } - if (typeof self !== "undefined") { - return self; - } - if (typeof window !== "undefined") { - return window; - } - if (typeof global !== "undefined") { - return global; - } - throw "Unable to locate global object"; -})(); - + if (typeof globalThis !== "undefined") return globalThis + if (typeof self !== "undefined") return self + if (typeof window !== "undefined") return window + if (typeof global !== "undefined") return global + throw "Unable to locate global object" +})() + +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")) function bytesFromBase64(b64: string): Uint8Array { - if (globalThis.Buffer) { - return Uint8Array.from(globalThis.Buffer.from(b64, "base64")); - } else { - const bin = globalThis.atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; + 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 } +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")) function base64FromBytes(arr: Uint8Array): string { - if (globalThis.Buffer) { - return globalThis.Buffer.from(arr).toString("base64"); - } else { - const bin: string[] = []; - arr.forEach((byte) => { - bin.push(String.fromCharCode(byte)); - }); - return globalThis.btoa(bin.join("")); - } + const bin: string[] = [] + arr.forEach((byte) => { + bin.push(String.fromCharCode(byte)) + }) + return btoa(bin.join("")) } -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > function toTimestamp(date: Date): Timestamp { - const seconds = numberToLong(date.getTime() / 1_000); - const nanos = (date.getTime() % 1_000) * 1_000_000; - return { seconds, nanos }; + const seconds = numberToLong(date.getTime() / 1_000) + const nanos = (date.getTime() % 1_000) * 1_000_000 + return { seconds, nanos } } function fromTimestamp(t: Timestamp): Date { - let millis = t.seconds.toNumber() * 1_000; - millis += t.nanos / 1_000_000; - return new Date(millis); + let millis = t.seconds.toNumber() * 1_000 + millis += t.nanos / 1_000_000 + return new Date(millis) } function fromJsonTimestamp(o: any): Date { if (o instanceof Date) { - return o; + return o } else if (typeof o === "string") { - return new Date(o); + return new Date(o) } else { - return fromTimestamp(Timestamp.fromJSON(o)); + return fromTimestamp(Timestamp.fromJSON(o)) } } function numberToLong(number: number) { - return Long.fromNumber(number); + return Long.fromNumber(number) } if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/tendermint/types/validator.ts b/packages/protojs/src/tendermint/types/validator.ts index 78fe8e40..fcde54ce 100644 --- a/packages/protojs/src/tendermint/types/validator.ts +++ b/packages/protojs/src/tendermint/types/validator.ts @@ -1,312 +1,349 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { PublicKey } from "../crypto/keys"; +import { PublicKey } from "../crypto/keys" +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "tendermint.types"; +export const protobufPackage = "tendermint.types" export interface ValidatorSet { - validators: Validator[]; - proposer?: Validator; - totalVotingPower: Long; + validators: Validator[] + proposer?: Validator + totalVotingPower: Long } export interface Validator { - address: Uint8Array; - pubKey?: PublicKey; - votingPower: Long; - proposerPriority: Long; + address: Uint8Array + pubKey?: PublicKey + votingPower: Long + proposerPriority: Long } export interface SimpleValidator { - pubKey?: PublicKey; - votingPower: Long; + pubKey?: PublicKey + votingPower: Long } function createBaseValidatorSet(): ValidatorSet { - return { validators: [], proposer: undefined, totalVotingPower: Long.ZERO }; + return { validators: [], proposer: undefined, totalVotingPower: Long.ZERO } } export const ValidatorSet = { encode(message: ValidatorSet, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.validators) { - Validator.encode(v!, writer.uint32(10).fork()).ldelim(); + Validator.encode(v!, writer.uint32(10).fork()).ldelim() } if (message.proposer !== undefined) { - Validator.encode(message.proposer, writer.uint32(18).fork()).ldelim(); + Validator.encode(message.proposer, writer.uint32(18).fork()).ldelim() } if (!message.totalVotingPower.isZero()) { - writer.uint32(24).int64(message.totalVotingPower); + writer.uint32(24).int64(message.totalVotingPower) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorSet { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseValidatorSet(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseValidatorSet() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.validators.push(Validator.decode(reader, reader.uint32())); - break; + message.validators.push(Validator.decode(reader, reader.uint32())) + break case 2: - message.proposer = Validator.decode(reader, reader.uint32()); - break; + message.proposer = Validator.decode(reader, reader.uint32()) + break case 3: - message.totalVotingPower = reader.int64() as Long; - break; + message.totalVotingPower = reader.int64() as Long + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): ValidatorSet { return { - validators: Array.isArray(object?.validators) ? object.validators.map((e: any) => Validator.fromJSON(e)) : [], - proposer: isSet(object.proposer) ? Validator.fromJSON(object.proposer) : undefined, - totalVotingPower: isSet(object.totalVotingPower) ? Long.fromValue(object.totalVotingPower) : Long.ZERO, - }; + validators: Array.isArray(object?.validators) + ? object.validators.map((e: any) => Validator.fromJSON(e)) + : [], + proposer: isSet(object.proposer) + ? Validator.fromJSON(object.proposer) + : undefined, + totalVotingPower: isSet(object.totalVotingPower) + ? Long.fromValue(object.totalVotingPower) + : Long.ZERO, + } }, toJSON(message: ValidatorSet): unknown { - const obj: any = {}; + const obj: any = {} if (message.validators) { - obj.validators = message.validators.map((e) => e ? Validator.toJSON(e) : undefined); + obj.validators = message.validators.map((e) => + e ? Validator.toJSON(e) : undefined, + ) } else { - obj.validators = []; + obj.validators = [] } message.proposer !== undefined && - (obj.proposer = message.proposer ? Validator.toJSON(message.proposer) : undefined); + (obj.proposer = message.proposer ? Validator.toJSON(message.proposer) : undefined) message.totalVotingPower !== undefined && - (obj.totalVotingPower = (message.totalVotingPower || Long.ZERO).toString()); - return obj; + (obj.totalVotingPower = (message.totalVotingPower || Long.ZERO).toString()) + return obj }, fromPartial, I>>(object: I): ValidatorSet { - const message = createBaseValidatorSet(); - message.validators = object.validators?.map((e) => Validator.fromPartial(e)) || []; - message.proposer = (object.proposer !== undefined && object.proposer !== null) - ? Validator.fromPartial(object.proposer) - : undefined; - message.totalVotingPower = (object.totalVotingPower !== undefined && object.totalVotingPower !== null) - ? Long.fromValue(object.totalVotingPower) - : Long.ZERO; - return message; + const message = createBaseValidatorSet() + message.validators = object.validators?.map((e) => Validator.fromPartial(e)) || [] + message.proposer = + object.proposer !== undefined && object.proposer !== null + ? Validator.fromPartial(object.proposer) + : undefined + message.totalVotingPower = + object.totalVotingPower !== undefined && object.totalVotingPower !== null + ? Long.fromValue(object.totalVotingPower) + : Long.ZERO + return message }, -}; +} function createBaseValidator(): Validator { - return { address: new Uint8Array(), pubKey: undefined, votingPower: Long.ZERO, proposerPriority: Long.ZERO }; + return { + address: new Uint8Array(), + pubKey: undefined, + votingPower: Long.ZERO, + proposerPriority: Long.ZERO, + } } export const Validator = { encode(message: Validator, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.address.length !== 0) { - writer.uint32(10).bytes(message.address); + writer.uint32(10).bytes(message.address) } if (message.pubKey !== undefined) { - PublicKey.encode(message.pubKey, writer.uint32(18).fork()).ldelim(); + PublicKey.encode(message.pubKey, writer.uint32(18).fork()).ldelim() } if (!message.votingPower.isZero()) { - writer.uint32(24).int64(message.votingPower); + writer.uint32(24).int64(message.votingPower) } if (!message.proposerPriority.isZero()) { - writer.uint32(32).int64(message.proposerPriority); + writer.uint32(32).int64(message.proposerPriority) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Validator { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseValidator(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseValidator() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.address = reader.bytes(); - break; + message.address = reader.bytes() + break case 2: - message.pubKey = PublicKey.decode(reader, reader.uint32()); - break; + message.pubKey = PublicKey.decode(reader, reader.uint32()) + break case 3: - message.votingPower = reader.int64() as Long; - break; + message.votingPower = reader.int64() as Long + break case 4: - message.proposerPriority = reader.int64() as Long; - break; + message.proposerPriority = reader.int64() as Long + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Validator { return { - address: isSet(object.address) ? bytesFromBase64(object.address) : new Uint8Array(), + address: isSet(object.address) + ? bytesFromBase64(object.address) + : new Uint8Array(), pubKey: isSet(object.pubKey) ? PublicKey.fromJSON(object.pubKey) : undefined, - votingPower: isSet(object.votingPower) ? Long.fromValue(object.votingPower) : Long.ZERO, - proposerPriority: isSet(object.proposerPriority) ? Long.fromValue(object.proposerPriority) : Long.ZERO, - }; + votingPower: isSet(object.votingPower) + ? Long.fromValue(object.votingPower) + : Long.ZERO, + proposerPriority: isSet(object.proposerPriority) + ? Long.fromValue(object.proposerPriority) + : Long.ZERO, + } }, toJSON(message: Validator): unknown { - const obj: any = {}; + const obj: any = {} message.address !== undefined && - (obj.address = base64FromBytes(message.address !== undefined ? message.address : new Uint8Array())); - message.pubKey !== undefined && (obj.pubKey = message.pubKey ? PublicKey.toJSON(message.pubKey) : undefined); - message.votingPower !== undefined && (obj.votingPower = (message.votingPower || Long.ZERO).toString()); + (obj.address = base64FromBytes( + message.address !== undefined ? message.address : new Uint8Array(), + )) + message.pubKey !== undefined && + (obj.pubKey = message.pubKey ? PublicKey.toJSON(message.pubKey) : undefined) + message.votingPower !== undefined && + (obj.votingPower = (message.votingPower || Long.ZERO).toString()) message.proposerPriority !== undefined && - (obj.proposerPriority = (message.proposerPriority || Long.ZERO).toString()); - return obj; + (obj.proposerPriority = (message.proposerPriority || Long.ZERO).toString()) + return obj }, fromPartial, I>>(object: I): Validator { - const message = createBaseValidator(); - message.address = object.address ?? new Uint8Array(); - message.pubKey = (object.pubKey !== undefined && object.pubKey !== null) - ? PublicKey.fromPartial(object.pubKey) - : undefined; - message.votingPower = (object.votingPower !== undefined && object.votingPower !== null) - ? Long.fromValue(object.votingPower) - : Long.ZERO; - message.proposerPriority = (object.proposerPriority !== undefined && object.proposerPriority !== null) - ? Long.fromValue(object.proposerPriority) - : Long.ZERO; - return message; + const message = createBaseValidator() + message.address = object.address ?? new Uint8Array() + message.pubKey = + object.pubKey !== undefined && object.pubKey !== null + ? PublicKey.fromPartial(object.pubKey) + : undefined + message.votingPower = + object.votingPower !== undefined && object.votingPower !== null + ? Long.fromValue(object.votingPower) + : Long.ZERO + message.proposerPriority = + object.proposerPriority !== undefined && object.proposerPriority !== null + ? Long.fromValue(object.proposerPriority) + : Long.ZERO + return message }, -}; +} function createBaseSimpleValidator(): SimpleValidator { - return { pubKey: undefined, votingPower: Long.ZERO }; + return { pubKey: undefined, votingPower: Long.ZERO } } export const SimpleValidator = { - encode(message: SimpleValidator, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: SimpleValidator, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.pubKey !== undefined) { - PublicKey.encode(message.pubKey, writer.uint32(10).fork()).ldelim(); + PublicKey.encode(message.pubKey, writer.uint32(10).fork()).ldelim() } if (!message.votingPower.isZero()) { - writer.uint32(16).int64(message.votingPower); + writer.uint32(16).int64(message.votingPower) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): SimpleValidator { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSimpleValidator(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseSimpleValidator() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.pubKey = PublicKey.decode(reader, reader.uint32()); - break; + message.pubKey = PublicKey.decode(reader, reader.uint32()) + break case 2: - message.votingPower = reader.int64() as Long; - break; + message.votingPower = reader.int64() as Long + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): SimpleValidator { return { pubKey: isSet(object.pubKey) ? PublicKey.fromJSON(object.pubKey) : undefined, - votingPower: isSet(object.votingPower) ? Long.fromValue(object.votingPower) : Long.ZERO, - }; + votingPower: isSet(object.votingPower) + ? Long.fromValue(object.votingPower) + : Long.ZERO, + } }, toJSON(message: SimpleValidator): unknown { - const obj: any = {}; - message.pubKey !== undefined && (obj.pubKey = message.pubKey ? PublicKey.toJSON(message.pubKey) : undefined); - message.votingPower !== undefined && (obj.votingPower = (message.votingPower || Long.ZERO).toString()); - return obj; + const obj: any = {} + message.pubKey !== undefined && + (obj.pubKey = message.pubKey ? PublicKey.toJSON(message.pubKey) : undefined) + message.votingPower !== undefined && + (obj.votingPower = (message.votingPower || Long.ZERO).toString()) + return obj }, - fromPartial, I>>(object: I): SimpleValidator { - const message = createBaseSimpleValidator(); - message.pubKey = (object.pubKey !== undefined && object.pubKey !== null) - ? PublicKey.fromPartial(object.pubKey) - : undefined; - message.votingPower = (object.votingPower !== undefined && object.votingPower !== null) - ? Long.fromValue(object.votingPower) - : Long.ZERO; - return message; + fromPartial, I>>( + object: I, + ): SimpleValidator { + const message = createBaseSimpleValidator() + message.pubKey = + object.pubKey !== undefined && object.pubKey !== null + ? PublicKey.fromPartial(object.pubKey) + : undefined + message.votingPower = + object.votingPower !== undefined && object.votingPower !== null + ? Long.fromValue(object.votingPower) + : Long.ZERO + return message }, -}; +} -declare var self: any | undefined; -declare var window: any | undefined; -declare var global: any | undefined; +declare var self: any | undefined +declare var window: any | undefined +declare var global: any | undefined var globalThis: any = (() => { - if (typeof globalThis !== "undefined") { - return globalThis; - } - if (typeof self !== "undefined") { - return self; - } - if (typeof window !== "undefined") { - return window; - } - if (typeof global !== "undefined") { - return global; - } - throw "Unable to locate global object"; -})(); + if (typeof globalThis !== "undefined") return globalThis + if (typeof self !== "undefined") return self + if (typeof window !== "undefined") return window + if (typeof global !== "undefined") return global + throw "Unable to locate global object" +})() +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")) function bytesFromBase64(b64: string): Uint8Array { - if (globalThis.Buffer) { - return Uint8Array.from(globalThis.Buffer.from(b64, "base64")); - } else { - const bin = globalThis.atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; + 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 } +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")) function base64FromBytes(arr: Uint8Array): string { - if (globalThis.Buffer) { - return globalThis.Buffer.from(arr).toString("base64"); - } else { - const bin: string[] = []; - arr.forEach((byte) => { - bin.push(String.fromCharCode(byte)); - }); - return globalThis.btoa(bin.join("")); - } + const bin: string[] = [] + arr.forEach((byte) => { + bin.push(String.fromCharCode(byte)) + }) + return btoa(bin.join("")) } -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/tendermint/version/types.ts b/packages/protojs/src/tendermint/version/types.ts index 8400baab..56ba2972 100644 --- a/packages/protojs/src/tendermint/version/types.ts +++ b/packages/protojs/src/tendermint/version/types.ts @@ -1,8 +1,8 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "tendermint.version"; +export const protobufPackage = "tendermint.version" /** * App includes the protocol and software version for the application. @@ -10,8 +10,8 @@ export const protobufPackage = "tendermint.version"; * updated in ResponseEndBlock. */ export interface App { - protocol: Long; - software: string; + protocol: Long + software: string } /** @@ -20,145 +20,164 @@ export interface App { * state transition machine. */ export interface Consensus { - block: Long; - app: Long; + block: Long + app: Long } function createBaseApp(): App { - return { protocol: Long.UZERO, software: "" }; + return { protocol: Long.UZERO, software: "" } } export const App = { encode(message: App, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (!message.protocol.isZero()) { - writer.uint32(8).uint64(message.protocol); + writer.uint32(8).uint64(message.protocol) } if (message.software !== "") { - writer.uint32(18).string(message.software); + writer.uint32(18).string(message.software) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): App { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseApp(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseApp() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.protocol = reader.uint64() as Long; - break; + message.protocol = reader.uint64() as Long + break case 2: - message.software = reader.string(); - break; + message.software = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): App { return { protocol: isSet(object.protocol) ? Long.fromValue(object.protocol) : Long.UZERO, software: isSet(object.software) ? String(object.software) : "", - }; + } }, toJSON(message: App): unknown { - const obj: any = {}; - message.protocol !== undefined && (obj.protocol = (message.protocol || Long.UZERO).toString()); - message.software !== undefined && (obj.software = message.software); - return obj; + const obj: any = {} + message.protocol !== undefined && + (obj.protocol = (message.protocol || Long.UZERO).toString()) + message.software !== undefined && (obj.software = message.software) + return obj }, fromPartial, I>>(object: I): App { - const message = createBaseApp(); - message.protocol = (object.protocol !== undefined && object.protocol !== null) - ? Long.fromValue(object.protocol) - : Long.UZERO; - message.software = object.software ?? ""; - return message; + const message = createBaseApp() + message.protocol = + object.protocol !== undefined && object.protocol !== null + ? Long.fromValue(object.protocol) + : Long.UZERO + message.software = object.software ?? "" + return message }, -}; +} function createBaseConsensus(): Consensus { - return { block: Long.UZERO, app: Long.UZERO }; + return { block: Long.UZERO, app: Long.UZERO } } export const Consensus = { encode(message: Consensus, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (!message.block.isZero()) { - writer.uint32(8).uint64(message.block); + writer.uint32(8).uint64(message.block) } if (!message.app.isZero()) { - writer.uint32(16).uint64(message.app); + writer.uint32(16).uint64(message.app) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Consensus { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseConsensus(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseConsensus() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.block = reader.uint64() as Long; - break; + message.block = reader.uint64() as Long + break case 2: - message.app = reader.uint64() as Long; - break; + message.app = reader.uint64() as Long + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Consensus { return { block: isSet(object.block) ? Long.fromValue(object.block) : Long.UZERO, app: isSet(object.app) ? Long.fromValue(object.app) : Long.UZERO, - }; + } }, toJSON(message: Consensus): unknown { - const obj: any = {}; - message.block !== undefined && (obj.block = (message.block || Long.UZERO).toString()); - message.app !== undefined && (obj.app = (message.app || Long.UZERO).toString()); - return obj; + const obj: any = {} + message.block !== undefined && + (obj.block = (message.block || Long.UZERO).toString()) + message.app !== undefined && (obj.app = (message.app || Long.UZERO).toString()) + return obj }, fromPartial, I>>(object: I): Consensus { - const message = createBaseConsensus(); - message.block = (object.block !== undefined && object.block !== null) ? Long.fromValue(object.block) : Long.UZERO; - message.app = (object.app !== undefined && object.app !== null) ? Long.fromValue(object.app) : Long.UZERO; - return message; + const message = createBaseConsensus() + message.block = + object.block !== undefined && object.block !== null + ? Long.fromValue(object.block) + : Long.UZERO + message.app = + object.app !== undefined && object.app !== null + ? Long.fromValue(object.app) + : Long.UZERO + return message }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; +} -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/util/v1/query.ts b/packages/protojs/src/util/v1/query.ts index 02a8d25b..c1f9e9d0 100644 --- a/packages/protojs/src/util/v1/query.ts +++ b/packages/protojs/src/util/v1/query.ts @@ -1,226 +1,263 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { Coin } from "../../cosmos/base/v1beta1/coin"; +import Long from "long" +import { Coin } from "../../cosmos/base/v1beta1/coin" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "nibiru.util.v1"; +export const protobufPackage = "nibiru.util.v1" -export interface QueryModuleAccountsRequest { -} +export interface QueryModuleAccountsRequest {} export interface QueryModuleAccountsResponse { - accounts: AccountWithBalance[]; + accounts: AccountWithBalance[] } export interface AccountWithBalance { - name: string; - address: string; - balance: Coin[]; + name: string + address: string + balance: Coin[] } function createBaseQueryModuleAccountsRequest(): QueryModuleAccountsRequest { - return {}; + return {} } export const QueryModuleAccountsRequest = { - encode(_: QueryModuleAccountsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; + encode( + _: QueryModuleAccountsRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryModuleAccountsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryModuleAccountsRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryModuleAccountsRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(_: any): QueryModuleAccountsRequest { - return {}; + return {} }, toJSON(_: QueryModuleAccountsRequest): unknown { - const obj: any = {}; - return obj; + const obj: any = {} + return obj }, - fromPartial, I>>(_: I): QueryModuleAccountsRequest { - const message = createBaseQueryModuleAccountsRequest(); - return message; + fromPartial, I>>( + _: I, + ): QueryModuleAccountsRequest { + const message = createBaseQueryModuleAccountsRequest() + return message }, -}; +} function createBaseQueryModuleAccountsResponse(): QueryModuleAccountsResponse { - return { accounts: [] }; + return { accounts: [] } } export const QueryModuleAccountsResponse = { - encode(message: QueryModuleAccountsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryModuleAccountsResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { for (const v of message.accounts) { - AccountWithBalance.encode(v!, writer.uint32(10).fork()).ldelim(); + AccountWithBalance.encode(v!, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryModuleAccountsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryModuleAccountsResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryModuleAccountsResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.accounts.push(AccountWithBalance.decode(reader, reader.uint32())); - break; + message.accounts.push(AccountWithBalance.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryModuleAccountsResponse { return { - accounts: Array.isArray(object?.accounts) ? object.accounts.map((e: any) => AccountWithBalance.fromJSON(e)) : [], - }; + accounts: Array.isArray(object?.accounts) + ? object.accounts.map((e: any) => AccountWithBalance.fromJSON(e)) + : [], + } }, toJSON(message: QueryModuleAccountsResponse): unknown { - const obj: any = {}; + const obj: any = {} if (message.accounts) { - obj.accounts = message.accounts.map((e) => e ? AccountWithBalance.toJSON(e) : undefined); + obj.accounts = message.accounts.map((e) => + e ? AccountWithBalance.toJSON(e) : undefined, + ) } else { - obj.accounts = []; + obj.accounts = [] } - return obj; + return obj }, - fromPartial, I>>(object: I): QueryModuleAccountsResponse { - const message = createBaseQueryModuleAccountsResponse(); - message.accounts = object.accounts?.map((e) => AccountWithBalance.fromPartial(e)) || []; - return message; + fromPartial, I>>( + object: I, + ): QueryModuleAccountsResponse { + const message = createBaseQueryModuleAccountsResponse() + message.accounts = + object.accounts?.map((e) => AccountWithBalance.fromPartial(e)) || [] + return message }, -}; +} function createBaseAccountWithBalance(): AccountWithBalance { - return { name: "", address: "", balance: [] }; + return { name: "", address: "", balance: [] } } export const AccountWithBalance = { - encode(message: AccountWithBalance, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: AccountWithBalance, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.name !== "") { - writer.uint32(10).string(message.name); + writer.uint32(10).string(message.name) } if (message.address !== "") { - writer.uint32(18).string(message.address); + writer.uint32(18).string(message.address) } for (const v of message.balance) { - Coin.encode(v!, writer.uint32(26).fork()).ldelim(); + Coin.encode(v!, writer.uint32(26).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): AccountWithBalance { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseAccountWithBalance(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseAccountWithBalance() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.name = reader.string(); - break; + message.name = reader.string() + break case 2: - message.address = reader.string(); - break; + message.address = reader.string() + break case 3: - message.balance.push(Coin.decode(reader, reader.uint32())); - break; + message.balance.push(Coin.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): AccountWithBalance { return { name: isSet(object.name) ? String(object.name) : "", address: isSet(object.address) ? String(object.address) : "", - balance: Array.isArray(object?.balance) ? object.balance.map((e: any) => Coin.fromJSON(e)) : [], - }; + balance: Array.isArray(object?.balance) + ? object.balance.map((e: any) => Coin.fromJSON(e)) + : [], + } }, toJSON(message: AccountWithBalance): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.address !== undefined && (obj.address = message.address); + const obj: any = {} + message.name !== undefined && (obj.name = message.name) + message.address !== undefined && (obj.address = message.address) if (message.balance) { - obj.balance = message.balance.map((e) => e ? Coin.toJSON(e) : undefined); + obj.balance = message.balance.map((e) => (e ? Coin.toJSON(e) : undefined)) } else { - obj.balance = []; + obj.balance = [] } - return obj; + return obj }, - fromPartial, I>>(object: I): AccountWithBalance { - const message = createBaseAccountWithBalance(); - message.name = object.name ?? ""; - message.address = object.address ?? ""; - message.balance = object.balance?.map((e) => Coin.fromPartial(e)) || []; - return message; + fromPartial, I>>( + object: I, + ): AccountWithBalance { + const message = createBaseAccountWithBalance() + message.name = object.name ?? "" + message.address = object.address ?? "" + message.balance = object.balance?.map((e) => Coin.fromPartial(e)) || [] + return message }, -}; +} /** Query defines the gRPC querier service. */ export interface Query { /** Queries the reserve assets in a given pool, identified by a token pair. */ - ModuleAccounts(request: QueryModuleAccountsRequest): Promise; + ModuleAccounts( + request: QueryModuleAccountsRequest, + ): Promise } export class QueryClientImpl implements Query { - private readonly rpc: Rpc; + private readonly rpc: Rpc constructor(rpc: Rpc) { - this.rpc = rpc; - this.ModuleAccounts = this.ModuleAccounts.bind(this); + this.rpc = rpc + this.ModuleAccounts = this.ModuleAccounts.bind(this) } - ModuleAccounts(request: QueryModuleAccountsRequest): Promise { - const data = QueryModuleAccountsRequest.encode(request).finish(); - const promise = this.rpc.request("nibiru.util.v1.Query", "ModuleAccounts", data); - return promise.then((data) => QueryModuleAccountsResponse.decode(new _m0.Reader(data))); + ModuleAccounts( + request: QueryModuleAccountsRequest, + ): Promise { + const data = QueryModuleAccountsRequest.encode(request).finish() + const promise = this.rpc.request("nibiru.util.v1.Query", "ModuleAccounts", data) + return promise.then((data) => + QueryModuleAccountsResponse.decode(new _m0.Reader(data)), + ) } } interface Rpc { - request(service: string, method: string, data: Uint8Array): Promise; + request(service: string, method: string, data: Uint8Array): Promise } -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/vpool/v1/event.ts b/packages/protojs/src/vpool/v1/event.ts index 2ebaf8c7..9324a07f 100644 --- a/packages/protojs/src/vpool/v1/event.ts +++ b/packages/protojs/src/vpool/v1/event.ts @@ -1,21 +1,21 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { Timestamp } from "../../google/protobuf/timestamp"; +import { Timestamp } from "../../google/protobuf/timestamp" +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "nibiru.vpool.v1"; +export const protobufPackage = "nibiru.vpool.v1" export interface ReserveSnapshotSavedEvent { - pair: string; - quoteReserve: string; - baseReserve: string; + pair: string + quoteReserve: string + baseReserve: string /** * MarkPrice at the end of the block. * (instantaneous) markPrice := quoteReserve / baseReserve */ - markPrice: string; - blockHeight: Long; - blockTimestamp?: Date; + markPrice: string + blockHeight: Long + blockTimestamp?: Date } /** @@ -24,17 +24,17 @@ export interface ReserveSnapshotSavedEvent { * a negative quote means the trader has gained quote and the vpool lost quote. */ export interface SwapOnVpoolEvent { - pair: string; + pair: string /** delta in the quote reserves of the vpool */ - quoteAmount: string; + quoteAmount: string /** delta in the base reserves of the vpool */ - baseAmount: string; + baseAmount: string } export interface MarkPriceChangedEvent { - pair: string; - price: string; - blockTimestamp?: Date; + pair: string + price: string + blockTimestamp?: Date } function createBaseReserveSnapshotSavedEvent(): ReserveSnapshotSavedEvent { @@ -45,63 +45,71 @@ function createBaseReserveSnapshotSavedEvent(): ReserveSnapshotSavedEvent { markPrice: "", blockHeight: Long.ZERO, blockTimestamp: undefined, - }; + } } export const ReserveSnapshotSavedEvent = { - encode(message: ReserveSnapshotSavedEvent, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: ReserveSnapshotSavedEvent, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.pair !== "") { - writer.uint32(10).string(message.pair); + writer.uint32(10).string(message.pair) } if (message.quoteReserve !== "") { - writer.uint32(18).string(message.quoteReserve); + writer.uint32(18).string(message.quoteReserve) } if (message.baseReserve !== "") { - writer.uint32(26).string(message.baseReserve); + writer.uint32(26).string(message.baseReserve) } if (message.markPrice !== "") { - writer.uint32(34).string(message.markPrice); + writer.uint32(34).string(message.markPrice) } if (!message.blockHeight.isZero()) { - writer.uint32(40).int64(message.blockHeight); + writer.uint32(40).int64(message.blockHeight) } if (message.blockTimestamp !== undefined) { - Timestamp.encode(toTimestamp(message.blockTimestamp), writer.uint32(50).fork()).ldelim(); + Timestamp.encode( + toTimestamp(message.blockTimestamp), + writer.uint32(50).fork(), + ).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): ReserveSnapshotSavedEvent { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseReserveSnapshotSavedEvent(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseReserveSnapshotSavedEvent() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.pair = reader.string(); - break; + message.pair = reader.string() + break case 2: - message.quoteReserve = reader.string(); - break; + message.quoteReserve = reader.string() + break case 3: - message.baseReserve = reader.string(); - break; + message.baseReserve = reader.string() + break case 4: - message.markPrice = reader.string(); - break; + message.markPrice = reader.string() + break case 5: - message.blockHeight = reader.int64() as Long; - break; + message.blockHeight = reader.int64() as Long + break case 6: - message.blockTimestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32())); - break; + message.blockTimestamp = fromTimestamp( + Timestamp.decode(reader, reader.uint32()), + ) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): ReserveSnapshotSavedEvent { @@ -110,76 +118,88 @@ export const ReserveSnapshotSavedEvent = { quoteReserve: isSet(object.quoteReserve) ? String(object.quoteReserve) : "", baseReserve: isSet(object.baseReserve) ? String(object.baseReserve) : "", markPrice: isSet(object.markPrice) ? String(object.markPrice) : "", - blockHeight: isSet(object.blockHeight) ? Long.fromValue(object.blockHeight) : Long.ZERO, - blockTimestamp: isSet(object.blockTimestamp) ? fromJsonTimestamp(object.blockTimestamp) : undefined, - }; + blockHeight: isSet(object.blockHeight) + ? Long.fromValue(object.blockHeight) + : Long.ZERO, + blockTimestamp: isSet(object.blockTimestamp) + ? fromJsonTimestamp(object.blockTimestamp) + : undefined, + } }, toJSON(message: ReserveSnapshotSavedEvent): unknown { - const obj: any = {}; - message.pair !== undefined && (obj.pair = message.pair); - message.quoteReserve !== undefined && (obj.quoteReserve = message.quoteReserve); - message.baseReserve !== undefined && (obj.baseReserve = message.baseReserve); - message.markPrice !== undefined && (obj.markPrice = message.markPrice); - message.blockHeight !== undefined && (obj.blockHeight = (message.blockHeight || Long.ZERO).toString()); - message.blockTimestamp !== undefined && (obj.blockTimestamp = message.blockTimestamp.toISOString()); - return obj; + const obj: any = {} + message.pair !== undefined && (obj.pair = message.pair) + message.quoteReserve !== undefined && (obj.quoteReserve = message.quoteReserve) + message.baseReserve !== undefined && (obj.baseReserve = message.baseReserve) + message.markPrice !== undefined && (obj.markPrice = message.markPrice) + message.blockHeight !== undefined && + (obj.blockHeight = (message.blockHeight || Long.ZERO).toString()) + message.blockTimestamp !== undefined && + (obj.blockTimestamp = message.blockTimestamp.toISOString()) + return obj }, - fromPartial, I>>(object: I): ReserveSnapshotSavedEvent { - const message = createBaseReserveSnapshotSavedEvent(); - message.pair = object.pair ?? ""; - message.quoteReserve = object.quoteReserve ?? ""; - message.baseReserve = object.baseReserve ?? ""; - message.markPrice = object.markPrice ?? ""; - message.blockHeight = (object.blockHeight !== undefined && object.blockHeight !== null) - ? Long.fromValue(object.blockHeight) - : Long.ZERO; - message.blockTimestamp = object.blockTimestamp ?? undefined; - return message; + fromPartial, I>>( + object: I, + ): ReserveSnapshotSavedEvent { + const message = createBaseReserveSnapshotSavedEvent() + message.pair = object.pair ?? "" + message.quoteReserve = object.quoteReserve ?? "" + message.baseReserve = object.baseReserve ?? "" + message.markPrice = object.markPrice ?? "" + message.blockHeight = + object.blockHeight !== undefined && object.blockHeight !== null + ? Long.fromValue(object.blockHeight) + : Long.ZERO + message.blockTimestamp = object.blockTimestamp ?? undefined + return message }, -}; +} function createBaseSwapOnVpoolEvent(): SwapOnVpoolEvent { - return { pair: "", quoteAmount: "", baseAmount: "" }; + return { pair: "", quoteAmount: "", baseAmount: "" } } export const SwapOnVpoolEvent = { - encode(message: SwapOnVpoolEvent, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: SwapOnVpoolEvent, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.pair !== "") { - writer.uint32(10).string(message.pair); + writer.uint32(10).string(message.pair) } if (message.quoteAmount !== "") { - writer.uint32(18).string(message.quoteAmount); + writer.uint32(18).string(message.quoteAmount) } if (message.baseAmount !== "") { - writer.uint32(26).string(message.baseAmount); + writer.uint32(26).string(message.baseAmount) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): SwapOnVpoolEvent { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSwapOnVpoolEvent(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseSwapOnVpoolEvent() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.pair = reader.string(); - break; + message.pair = reader.string() + break case 2: - message.quoteAmount = reader.string(); - break; + message.quoteAmount = reader.string() + break case 3: - message.baseAmount = reader.string(); - break; + message.baseAmount = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): SwapOnVpoolEvent { @@ -187,136 +207,161 @@ export const SwapOnVpoolEvent = { pair: isSet(object.pair) ? String(object.pair) : "", quoteAmount: isSet(object.quoteAmount) ? String(object.quoteAmount) : "", baseAmount: isSet(object.baseAmount) ? String(object.baseAmount) : "", - }; + } }, toJSON(message: SwapOnVpoolEvent): unknown { - const obj: any = {}; - message.pair !== undefined && (obj.pair = message.pair); - message.quoteAmount !== undefined && (obj.quoteAmount = message.quoteAmount); - message.baseAmount !== undefined && (obj.baseAmount = message.baseAmount); - return obj; + const obj: any = {} + message.pair !== undefined && (obj.pair = message.pair) + message.quoteAmount !== undefined && (obj.quoteAmount = message.quoteAmount) + message.baseAmount !== undefined && (obj.baseAmount = message.baseAmount) + return obj }, - fromPartial, I>>(object: I): SwapOnVpoolEvent { - const message = createBaseSwapOnVpoolEvent(); - message.pair = object.pair ?? ""; - message.quoteAmount = object.quoteAmount ?? ""; - message.baseAmount = object.baseAmount ?? ""; - return message; + fromPartial, I>>( + object: I, + ): SwapOnVpoolEvent { + const message = createBaseSwapOnVpoolEvent() + message.pair = object.pair ?? "" + message.quoteAmount = object.quoteAmount ?? "" + message.baseAmount = object.baseAmount ?? "" + return message }, -}; +} function createBaseMarkPriceChangedEvent(): MarkPriceChangedEvent { - return { pair: "", price: "", blockTimestamp: undefined }; + return { pair: "", price: "", blockTimestamp: undefined } } export const MarkPriceChangedEvent = { - encode(message: MarkPriceChangedEvent, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: MarkPriceChangedEvent, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.pair !== "") { - writer.uint32(10).string(message.pair); + writer.uint32(10).string(message.pair) } if (message.price !== "") { - writer.uint32(18).string(message.price); + writer.uint32(18).string(message.price) } if (message.blockTimestamp !== undefined) { - Timestamp.encode(toTimestamp(message.blockTimestamp), writer.uint32(26).fork()).ldelim(); + Timestamp.encode( + toTimestamp(message.blockTimestamp), + writer.uint32(26).fork(), + ).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MarkPriceChangedEvent { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMarkPriceChangedEvent(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMarkPriceChangedEvent() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.pair = reader.string(); - break; + message.pair = reader.string() + break case 2: - message.price = reader.string(); - break; + message.price = reader.string() + break case 3: - message.blockTimestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32())); - break; + message.blockTimestamp = fromTimestamp( + Timestamp.decode(reader, reader.uint32()), + ) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): MarkPriceChangedEvent { return { pair: isSet(object.pair) ? String(object.pair) : "", price: isSet(object.price) ? String(object.price) : "", - blockTimestamp: isSet(object.blockTimestamp) ? fromJsonTimestamp(object.blockTimestamp) : undefined, - }; + blockTimestamp: isSet(object.blockTimestamp) + ? fromJsonTimestamp(object.blockTimestamp) + : undefined, + } }, toJSON(message: MarkPriceChangedEvent): unknown { - const obj: any = {}; - message.pair !== undefined && (obj.pair = message.pair); - message.price !== undefined && (obj.price = message.price); - message.blockTimestamp !== undefined && (obj.blockTimestamp = message.blockTimestamp.toISOString()); - return obj; + const obj: any = {} + message.pair !== undefined && (obj.pair = message.pair) + message.price !== undefined && (obj.price = message.price) + message.blockTimestamp !== undefined && + (obj.blockTimestamp = message.blockTimestamp.toISOString()) + return obj }, - fromPartial, I>>(object: I): MarkPriceChangedEvent { - const message = createBaseMarkPriceChangedEvent(); - message.pair = object.pair ?? ""; - message.price = object.price ?? ""; - message.blockTimestamp = object.blockTimestamp ?? undefined; - return message; + fromPartial, I>>( + object: I, + ): MarkPriceChangedEvent { + const message = createBaseMarkPriceChangedEvent() + message.pair = object.pair ?? "" + message.price = object.price ?? "" + message.blockTimestamp = object.blockTimestamp ?? undefined + return message }, -}; +} -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > function toTimestamp(date: Date): Timestamp { - const seconds = numberToLong(date.getTime() / 1_000); - const nanos = (date.getTime() % 1_000) * 1_000_000; - return { seconds, nanos }; + const seconds = numberToLong(date.getTime() / 1_000) + const nanos = (date.getTime() % 1_000) * 1_000_000 + return { seconds, nanos } } function fromTimestamp(t: Timestamp): Date { - let millis = t.seconds.toNumber() * 1_000; - millis += t.nanos / 1_000_000; - return new Date(millis); + let millis = t.seconds.toNumber() * 1_000 + millis += t.nanos / 1_000_000 + return new Date(millis) } function fromJsonTimestamp(o: any): Date { if (o instanceof Date) { - return o; + return o } else if (typeof o === "string") { - return new Date(o); + return new Date(o) } else { - return fromTimestamp(Timestamp.fromJSON(o)); + return fromTimestamp(Timestamp.fromJSON(o)) } } function numberToLong(number: number) { - return Long.fromNumber(number); + return Long.fromNumber(number) } if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/vpool/v1/genesis.ts b/packages/protojs/src/vpool/v1/genesis.ts index ebdff45f..3cadd97e 100644 --- a/packages/protojs/src/vpool/v1/genesis.ts +++ b/packages/protojs/src/vpool/v1/genesis.ts @@ -1,79 +1,93 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { Vpool } from "./state"; +import Long from "long" +import { Vpool } from "./state" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "nibiru.vpool.v1"; +export const protobufPackage = "nibiru.vpool.v1" /** GenesisState defines the vpool module's genesis state. */ export interface GenesisState { - vpools: Vpool[]; + vpools: Vpool[] } function createBaseGenesisState(): GenesisState { - return { vpools: [] }; + return { vpools: [] } } export const GenesisState = { encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.vpools) { - Vpool.encode(v!, writer.uint32(10).fork()).ldelim(); + Vpool.encode(v!, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGenesisState(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseGenesisState() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.vpools.push(Vpool.decode(reader, reader.uint32())); - break; + message.vpools.push(Vpool.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): GenesisState { - return { vpools: Array.isArray(object?.vpools) ? object.vpools.map((e: any) => Vpool.fromJSON(e)) : [] }; + return { + vpools: Array.isArray(object?.vpools) + ? object.vpools.map((e: any) => Vpool.fromJSON(e)) + : [], + } }, toJSON(message: GenesisState): unknown { - const obj: any = {}; + const obj: any = {} if (message.vpools) { - obj.vpools = message.vpools.map((e) => e ? Vpool.toJSON(e) : undefined); + obj.vpools = message.vpools.map((e) => (e ? Vpool.toJSON(e) : undefined)) } else { - obj.vpools = []; + obj.vpools = [] } - return obj; + return obj }, fromPartial, I>>(object: I): GenesisState { - const message = createBaseGenesisState(); - message.vpools = object.vpools?.map((e) => Vpool.fromPartial(e)) || []; - return message; + const message = createBaseGenesisState() + message.vpools = object.vpools?.map((e) => Vpool.fromPartial(e)) || [] + return message }, -}; +} -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } diff --git a/packages/protojs/src/vpool/v1/gov.ts b/packages/protojs/src/vpool/v1/gov.ts index 0b1a0318..07bbb50c 100644 --- a/packages/protojs/src/vpool/v1/gov.ts +++ b/packages/protojs/src/vpool/v1/gov.ts @@ -1,27 +1,27 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { VpoolConfig } from "./state"; +import { VpoolConfig } from "./state" +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "nibiru.vpool.v1"; +export const protobufPackage = "nibiru.vpool.v1" export interface CreatePoolProposal { - title: string; - description: string; + title: string + description: string /** pair represents the pair of the vpool. */ - pair: string; + pair: string /** quote_asset_reserve is the amount of quote asset the pool will be initialized with. */ - quoteAssetReserve: string; + quoteAssetReserve: string /** base_asset_reserve is the amount of base asset the pool will be initialized with. */ - baseAssetReserve: string; - config?: VpoolConfig; + baseAssetReserve: string + config?: VpoolConfig } export interface EditPoolConfigProposal { - title: string; - description: string; - pair: string; - config?: VpoolConfig; + title: string + description: string + pair: string + config?: VpoolConfig } /** @@ -29,8 +29,8 @@ export interface EditPoolConfigProposal { * invariant of the virtual pool for one or more trading pairs. */ export interface EditSwapInvariantsProposal { - title: string; - description: string; + title: string + description: string /** * Map from pair ID to a multiple on the swap invariant. For example, a proposal containing * "swap_invariant_maps": [{ "uatom:unusd": "5" }, { "uosmo:unusd": "0.9" }] @@ -38,78 +38,88 @@ export interface EditSwapInvariantsProposal { * 5 and 0.9 respectively. The price at which k changes is the instantaneous * mark price at the time of the proposal's execution. */ - swapInvariantMaps: EditSwapInvariantsProposal_SwapInvariantMultiple[]; + swapInvariantMaps: EditSwapInvariantsProposal_SwapInvariantMultiple[] } /** A map between a trading pair and a desired multiplier for its swap invariant. */ export interface EditSwapInvariantsProposal_SwapInvariantMultiple { /** Pair is a string identifier for an asset pair. */ - pair: string; + pair: string /** * Multiplier is a number representing the desired percentage change to the * swap invariant of the AMM pool underlying 'pair' */ - multiplier: string; + multiplier: string } function createBaseCreatePoolProposal(): CreatePoolProposal { - return { title: "", description: "", pair: "", quoteAssetReserve: "", baseAssetReserve: "", config: undefined }; + return { + title: "", + description: "", + pair: "", + quoteAssetReserve: "", + baseAssetReserve: "", + config: undefined, + } } export const CreatePoolProposal = { - encode(message: CreatePoolProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: CreatePoolProposal, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.title !== "") { - writer.uint32(10).string(message.title); + writer.uint32(10).string(message.title) } if (message.description !== "") { - writer.uint32(18).string(message.description); + writer.uint32(18).string(message.description) } if (message.pair !== "") { - writer.uint32(26).string(message.pair); + writer.uint32(26).string(message.pair) } if (message.quoteAssetReserve !== "") { - writer.uint32(42).string(message.quoteAssetReserve); + writer.uint32(42).string(message.quoteAssetReserve) } if (message.baseAssetReserve !== "") { - writer.uint32(50).string(message.baseAssetReserve); + writer.uint32(50).string(message.baseAssetReserve) } if (message.config !== undefined) { - VpoolConfig.encode(message.config, writer.uint32(58).fork()).ldelim(); + VpoolConfig.encode(message.config, writer.uint32(58).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): CreatePoolProposal { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseCreatePoolProposal(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseCreatePoolProposal() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.title = reader.string(); - break; + message.title = reader.string() + break case 2: - message.description = reader.string(); - break; + message.description = reader.string() + break case 3: - message.pair = reader.string(); - break; + message.pair = reader.string() + break case 5: - message.quoteAssetReserve = reader.string(); - break; + message.quoteAssetReserve = reader.string() + break case 6: - message.baseAssetReserve = reader.string(); - break; + message.baseAssetReserve = reader.string() + break case 7: - message.config = VpoolConfig.decode(reader, reader.uint32()); - break; + message.config = VpoolConfig.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): CreatePoolProposal { @@ -117,83 +127,96 @@ export const CreatePoolProposal = { title: isSet(object.title) ? String(object.title) : "", description: isSet(object.description) ? String(object.description) : "", pair: isSet(object.pair) ? String(object.pair) : "", - quoteAssetReserve: isSet(object.quoteAssetReserve) ? String(object.quoteAssetReserve) : "", - baseAssetReserve: isSet(object.baseAssetReserve) ? String(object.baseAssetReserve) : "", + quoteAssetReserve: isSet(object.quoteAssetReserve) + ? String(object.quoteAssetReserve) + : "", + baseAssetReserve: isSet(object.baseAssetReserve) + ? String(object.baseAssetReserve) + : "", config: isSet(object.config) ? VpoolConfig.fromJSON(object.config) : undefined, - }; + } }, toJSON(message: CreatePoolProposal): unknown { - const obj: any = {}; - message.title !== undefined && (obj.title = message.title); - message.description !== undefined && (obj.description = message.description); - message.pair !== undefined && (obj.pair = message.pair); - message.quoteAssetReserve !== undefined && (obj.quoteAssetReserve = message.quoteAssetReserve); - message.baseAssetReserve !== undefined && (obj.baseAssetReserve = message.baseAssetReserve); - message.config !== undefined && (obj.config = message.config ? VpoolConfig.toJSON(message.config) : undefined); - return obj; + const obj: any = {} + message.title !== undefined && (obj.title = message.title) + message.description !== undefined && (obj.description = message.description) + message.pair !== undefined && (obj.pair = message.pair) + message.quoteAssetReserve !== undefined && + (obj.quoteAssetReserve = message.quoteAssetReserve) + message.baseAssetReserve !== undefined && + (obj.baseAssetReserve = message.baseAssetReserve) + message.config !== undefined && + (obj.config = message.config ? VpoolConfig.toJSON(message.config) : undefined) + return obj }, - fromPartial, I>>(object: I): CreatePoolProposal { - const message = createBaseCreatePoolProposal(); - message.title = object.title ?? ""; - message.description = object.description ?? ""; - message.pair = object.pair ?? ""; - message.quoteAssetReserve = object.quoteAssetReserve ?? ""; - message.baseAssetReserve = object.baseAssetReserve ?? ""; - message.config = (object.config !== undefined && object.config !== null) - ? VpoolConfig.fromPartial(object.config) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): CreatePoolProposal { + const message = createBaseCreatePoolProposal() + message.title = object.title ?? "" + message.description = object.description ?? "" + message.pair = object.pair ?? "" + message.quoteAssetReserve = object.quoteAssetReserve ?? "" + message.baseAssetReserve = object.baseAssetReserve ?? "" + message.config = + object.config !== undefined && object.config !== null + ? VpoolConfig.fromPartial(object.config) + : undefined + return message }, -}; +} function createBaseEditPoolConfigProposal(): EditPoolConfigProposal { - return { title: "", description: "", pair: "", config: undefined }; + return { title: "", description: "", pair: "", config: undefined } } export const EditPoolConfigProposal = { - encode(message: EditPoolConfigProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: EditPoolConfigProposal, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.title !== "") { - writer.uint32(10).string(message.title); + writer.uint32(10).string(message.title) } if (message.description !== "") { - writer.uint32(18).string(message.description); + writer.uint32(18).string(message.description) } if (message.pair !== "") { - writer.uint32(26).string(message.pair); + writer.uint32(26).string(message.pair) } if (message.config !== undefined) { - VpoolConfig.encode(message.config, writer.uint32(34).fork()).ldelim(); + VpoolConfig.encode(message.config, writer.uint32(34).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): EditPoolConfigProposal { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseEditPoolConfigProposal(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseEditPoolConfigProposal() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.title = reader.string(); - break; + message.title = reader.string() + break case 2: - message.description = reader.string(); - break; + message.description = reader.string() + break case 3: - message.pair = reader.string(); - break; + message.pair = reader.string() + break case 4: - message.config = VpoolConfig.decode(reader, reader.uint32()); - break; + message.config = VpoolConfig.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): EditPoolConfigProposal { @@ -202,72 +225,85 @@ export const EditPoolConfigProposal = { description: isSet(object.description) ? String(object.description) : "", pair: isSet(object.pair) ? String(object.pair) : "", config: isSet(object.config) ? VpoolConfig.fromJSON(object.config) : undefined, - }; + } }, toJSON(message: EditPoolConfigProposal): unknown { - const obj: any = {}; - message.title !== undefined && (obj.title = message.title); - message.description !== undefined && (obj.description = message.description); - message.pair !== undefined && (obj.pair = message.pair); - message.config !== undefined && (obj.config = message.config ? VpoolConfig.toJSON(message.config) : undefined); - return obj; + const obj: any = {} + message.title !== undefined && (obj.title = message.title) + message.description !== undefined && (obj.description = message.description) + message.pair !== undefined && (obj.pair = message.pair) + message.config !== undefined && + (obj.config = message.config ? VpoolConfig.toJSON(message.config) : undefined) + return obj }, - fromPartial, I>>(object: I): EditPoolConfigProposal { - const message = createBaseEditPoolConfigProposal(); - message.title = object.title ?? ""; - message.description = object.description ?? ""; - message.pair = object.pair ?? ""; - message.config = (object.config !== undefined && object.config !== null) - ? VpoolConfig.fromPartial(object.config) - : undefined; - return message; + fromPartial, I>>( + object: I, + ): EditPoolConfigProposal { + const message = createBaseEditPoolConfigProposal() + message.title = object.title ?? "" + message.description = object.description ?? "" + message.pair = object.pair ?? "" + message.config = + object.config !== undefined && object.config !== null + ? VpoolConfig.fromPartial(object.config) + : undefined + return message }, -}; +} function createBaseEditSwapInvariantsProposal(): EditSwapInvariantsProposal { - return { title: "", description: "", swapInvariantMaps: [] }; + return { title: "", description: "", swapInvariantMaps: [] } } export const EditSwapInvariantsProposal = { - encode(message: EditSwapInvariantsProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: EditSwapInvariantsProposal, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.title !== "") { - writer.uint32(10).string(message.title); + writer.uint32(10).string(message.title) } if (message.description !== "") { - writer.uint32(18).string(message.description); + writer.uint32(18).string(message.description) } for (const v of message.swapInvariantMaps) { - EditSwapInvariantsProposal_SwapInvariantMultiple.encode(v!, writer.uint32(42).fork()).ldelim(); + EditSwapInvariantsProposal_SwapInvariantMultiple.encode( + v!, + writer.uint32(42).fork(), + ).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): EditSwapInvariantsProposal { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseEditSwapInvariantsProposal(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseEditSwapInvariantsProposal() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.title = reader.string(); - break; + message.title = reader.string() + break case 2: - message.description = reader.string(); - break; + message.description = reader.string() + break case 5: message.swapInvariantMaps.push( - EditSwapInvariantsProposal_SwapInvariantMultiple.decode(reader, reader.uint32()), - ); - break; + EditSwapInvariantsProposal_SwapInvariantMultiple.decode( + reader, + reader.uint32(), + ), + ) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): EditSwapInvariantsProposal { @@ -275,37 +311,43 @@ export const EditSwapInvariantsProposal = { title: isSet(object.title) ? String(object.title) : "", description: isSet(object.description) ? String(object.description) : "", swapInvariantMaps: Array.isArray(object?.swapInvariantMaps) - ? object.swapInvariantMaps.map((e: any) => EditSwapInvariantsProposal_SwapInvariantMultiple.fromJSON(e)) + ? object.swapInvariantMaps.map((e: any) => + EditSwapInvariantsProposal_SwapInvariantMultiple.fromJSON(e), + ) : [], - }; + } }, toJSON(message: EditSwapInvariantsProposal): unknown { - const obj: any = {}; - message.title !== undefined && (obj.title = message.title); - message.description !== undefined && (obj.description = message.description); + const obj: any = {} + message.title !== undefined && (obj.title = message.title) + message.description !== undefined && (obj.description = message.description) if (message.swapInvariantMaps) { obj.swapInvariantMaps = message.swapInvariantMaps.map((e) => - e ? EditSwapInvariantsProposal_SwapInvariantMultiple.toJSON(e) : undefined - ); + e ? EditSwapInvariantsProposal_SwapInvariantMultiple.toJSON(e) : undefined, + ) } else { - obj.swapInvariantMaps = []; + obj.swapInvariantMaps = [] } - return obj; + return obj }, - fromPartial, I>>(object: I): EditSwapInvariantsProposal { - const message = createBaseEditSwapInvariantsProposal(); - message.title = object.title ?? ""; - message.description = object.description ?? ""; + fromPartial, I>>( + object: I, + ): EditSwapInvariantsProposal { + const message = createBaseEditSwapInvariantsProposal() + message.title = object.title ?? "" + message.description = object.description ?? "" message.swapInvariantMaps = - object.swapInvariantMaps?.map((e) => EditSwapInvariantsProposal_SwapInvariantMultiple.fromPartial(e)) || []; - return message; + object.swapInvariantMaps?.map((e) => + EditSwapInvariantsProposal_SwapInvariantMultiple.fromPartial(e), + ) || [] + return message }, -}; +} function createBaseEditSwapInvariantsProposal_SwapInvariantMultiple(): EditSwapInvariantsProposal_SwapInvariantMultiple { - return { pair: "", multiplier: "" }; + return { pair: "", multiplier: "" } } export const EditSwapInvariantsProposal_SwapInvariantMultiple = { @@ -314,76 +356,89 @@ export const EditSwapInvariantsProposal_SwapInvariantMultiple = { writer: _m0.Writer = _m0.Writer.create(), ): _m0.Writer { if (message.pair !== "") { - writer.uint32(26).string(message.pair); + writer.uint32(26).string(message.pair) } if (message.multiplier !== "") { - writer.uint32(34).string(message.multiplier); + writer.uint32(34).string(message.multiplier) } - return writer; + return writer }, - decode(input: _m0.Reader | Uint8Array, length?: number): EditSwapInvariantsProposal_SwapInvariantMultiple { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseEditSwapInvariantsProposal_SwapInvariantMultiple(); + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): EditSwapInvariantsProposal_SwapInvariantMultiple { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseEditSwapInvariantsProposal_SwapInvariantMultiple() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 3: - message.pair = reader.string(); - break; + message.pair = reader.string() + break case 4: - message.multiplier = reader.string(); - break; + message.multiplier = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): EditSwapInvariantsProposal_SwapInvariantMultiple { return { pair: isSet(object.pair) ? String(object.pair) : "", multiplier: isSet(object.multiplier) ? String(object.multiplier) : "", - }; + } }, toJSON(message: EditSwapInvariantsProposal_SwapInvariantMultiple): unknown { - const obj: any = {}; - message.pair !== undefined && (obj.pair = message.pair); - message.multiplier !== undefined && (obj.multiplier = message.multiplier); - return obj; + const obj: any = {} + message.pair !== undefined && (obj.pair = message.pair) + message.multiplier !== undefined && (obj.multiplier = message.multiplier) + return obj }, - fromPartial, I>>( - object: I, - ): EditSwapInvariantsProposal_SwapInvariantMultiple { - const message = createBaseEditSwapInvariantsProposal_SwapInvariantMultiple(); - message.pair = object.pair ?? ""; - message.multiplier = object.multiplier ?? ""; - return message; + fromPartial< + I extends Exact, I>, + >(object: I): EditSwapInvariantsProposal_SwapInvariantMultiple { + const message = createBaseEditSwapInvariantsProposal_SwapInvariantMultiple() + message.pair = object.pair ?? "" + message.multiplier = object.multiplier ?? "" + return message }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; +} -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/vpool/v1/query.ts b/packages/protojs/src/vpool/v1/query.ts index 2d7c7bb1..4a7c7d0b 100644 --- a/packages/protojs/src/vpool/v1/query.ts +++ b/packages/protojs/src/vpool/v1/query.ts @@ -1,423 +1,499 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { Direction, directionFromJSON, directionToJSON, PoolPrices, Vpool } from "./state"; - -export const protobufPackage = "nibiru.vpool.v1"; +import { + Direction, + Vpool, + PoolPrices, + directionFromJSON, + directionToJSON, +} from "./state" +import Long from "long" +import * as _m0 from "protobufjs/minimal" + +export const protobufPackage = "nibiru.vpool.v1" export interface QueryReserveAssetsRequest { /** always BASE:QUOTE, e.g. BTC:NUSD or ETH:NUSD */ - pair: string; + pair: string } export interface QueryReserveAssetsResponse { /** base asset is the crypto asset, e.g. BTC or ETH */ - baseAssetReserve: string; + baseAssetReserve: string /** quote asset is usually stablecoin, in our case NUSD */ - quoteAssetReserve: string; + quoteAssetReserve: string } -export interface QueryAllPoolsRequest { -} +export interface QueryAllPoolsRequest {} export interface QueryAllPoolsResponse { - pools: Vpool[]; - prices: PoolPrices[]; + pools: Vpool[] + prices: PoolPrices[] } export interface QueryBaseAssetPriceRequest { - pair: string; - direction: Direction; + pair: string + direction: Direction /** base asset is the crypto asset, e.g. BTC or ETH */ - baseAssetAmount: string; + baseAssetAmount: string } export interface QueryBaseAssetPriceResponse { - priceInQuoteDenom: string; + priceInQuoteDenom: string } function createBaseQueryReserveAssetsRequest(): QueryReserveAssetsRequest { - return { pair: "" }; + return { pair: "" } } export const QueryReserveAssetsRequest = { - encode(message: QueryReserveAssetsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryReserveAssetsRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.pair !== "") { - writer.uint32(10).string(message.pair); + writer.uint32(10).string(message.pair) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryReserveAssetsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryReserveAssetsRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryReserveAssetsRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.pair = reader.string(); - break; + message.pair = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryReserveAssetsRequest { - return { pair: isSet(object.pair) ? String(object.pair) : "" }; + return { + pair: isSet(object.pair) ? String(object.pair) : "", + } }, toJSON(message: QueryReserveAssetsRequest): unknown { - const obj: any = {}; - message.pair !== undefined && (obj.pair = message.pair); - return obj; + const obj: any = {} + message.pair !== undefined && (obj.pair = message.pair) + return obj }, - fromPartial, I>>(object: I): QueryReserveAssetsRequest { - const message = createBaseQueryReserveAssetsRequest(); - message.pair = object.pair ?? ""; - return message; + fromPartial, I>>( + object: I, + ): QueryReserveAssetsRequest { + const message = createBaseQueryReserveAssetsRequest() + message.pair = object.pair ?? "" + return message }, -}; +} function createBaseQueryReserveAssetsResponse(): QueryReserveAssetsResponse { - return { baseAssetReserve: "", quoteAssetReserve: "" }; + return { baseAssetReserve: "", quoteAssetReserve: "" } } export const QueryReserveAssetsResponse = { - encode(message: QueryReserveAssetsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryReserveAssetsResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.baseAssetReserve !== "") { - writer.uint32(10).string(message.baseAssetReserve); + writer.uint32(10).string(message.baseAssetReserve) } if (message.quoteAssetReserve !== "") { - writer.uint32(18).string(message.quoteAssetReserve); + writer.uint32(18).string(message.quoteAssetReserve) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryReserveAssetsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryReserveAssetsResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryReserveAssetsResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.baseAssetReserve = reader.string(); - break; + message.baseAssetReserve = reader.string() + break case 2: - message.quoteAssetReserve = reader.string(); - break; + message.quoteAssetReserve = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryReserveAssetsResponse { return { - baseAssetReserve: isSet(object.baseAssetReserve) ? String(object.baseAssetReserve) : "", - quoteAssetReserve: isSet(object.quoteAssetReserve) ? String(object.quoteAssetReserve) : "", - }; + baseAssetReserve: isSet(object.baseAssetReserve) + ? String(object.baseAssetReserve) + : "", + quoteAssetReserve: isSet(object.quoteAssetReserve) + ? String(object.quoteAssetReserve) + : "", + } }, toJSON(message: QueryReserveAssetsResponse): unknown { - const obj: any = {}; - message.baseAssetReserve !== undefined && (obj.baseAssetReserve = message.baseAssetReserve); - message.quoteAssetReserve !== undefined && (obj.quoteAssetReserve = message.quoteAssetReserve); - return obj; + const obj: any = {} + message.baseAssetReserve !== undefined && + (obj.baseAssetReserve = message.baseAssetReserve) + message.quoteAssetReserve !== undefined && + (obj.quoteAssetReserve = message.quoteAssetReserve) + return obj }, - fromPartial, I>>(object: I): QueryReserveAssetsResponse { - const message = createBaseQueryReserveAssetsResponse(); - message.baseAssetReserve = object.baseAssetReserve ?? ""; - message.quoteAssetReserve = object.quoteAssetReserve ?? ""; - return message; + fromPartial, I>>( + object: I, + ): QueryReserveAssetsResponse { + const message = createBaseQueryReserveAssetsResponse() + message.baseAssetReserve = object.baseAssetReserve ?? "" + message.quoteAssetReserve = object.quoteAssetReserve ?? "" + return message }, -}; +} function createBaseQueryAllPoolsRequest(): QueryAllPoolsRequest { - return {}; + return {} } export const QueryAllPoolsRequest = { - encode(_: QueryAllPoolsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; + encode( + _: QueryAllPoolsRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllPoolsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryAllPoolsRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryAllPoolsRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(_: any): QueryAllPoolsRequest { - return {}; + return {} }, toJSON(_: QueryAllPoolsRequest): unknown { - const obj: any = {}; - return obj; + const obj: any = {} + return obj }, - fromPartial, I>>(_: I): QueryAllPoolsRequest { - const message = createBaseQueryAllPoolsRequest(); - return message; + fromPartial, I>>( + _: I, + ): QueryAllPoolsRequest { + const message = createBaseQueryAllPoolsRequest() + return message }, -}; +} function createBaseQueryAllPoolsResponse(): QueryAllPoolsResponse { - return { pools: [], prices: [] }; + return { pools: [], prices: [] } } export const QueryAllPoolsResponse = { - encode(message: QueryAllPoolsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryAllPoolsResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { for (const v of message.pools) { - Vpool.encode(v!, writer.uint32(10).fork()).ldelim(); + Vpool.encode(v!, writer.uint32(10).fork()).ldelim() } for (const v of message.prices) { - PoolPrices.encode(v!, writer.uint32(18).fork()).ldelim(); + PoolPrices.encode(v!, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllPoolsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryAllPoolsResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryAllPoolsResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.pools.push(Vpool.decode(reader, reader.uint32())); - break; + message.pools.push(Vpool.decode(reader, reader.uint32())) + break case 2: - message.prices.push(PoolPrices.decode(reader, reader.uint32())); - break; + message.prices.push(PoolPrices.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryAllPoolsResponse { return { - pools: Array.isArray(object?.pools) ? object.pools.map((e: any) => Vpool.fromJSON(e)) : [], - prices: Array.isArray(object?.prices) ? object.prices.map((e: any) => PoolPrices.fromJSON(e)) : [], - }; + pools: Array.isArray(object?.pools) + ? object.pools.map((e: any) => Vpool.fromJSON(e)) + : [], + prices: Array.isArray(object?.prices) + ? object.prices.map((e: any) => PoolPrices.fromJSON(e)) + : [], + } }, toJSON(message: QueryAllPoolsResponse): unknown { - const obj: any = {}; + const obj: any = {} if (message.pools) { - obj.pools = message.pools.map((e) => e ? Vpool.toJSON(e) : undefined); + obj.pools = message.pools.map((e) => (e ? Vpool.toJSON(e) : undefined)) } else { - obj.pools = []; + obj.pools = [] } if (message.prices) { - obj.prices = message.prices.map((e) => e ? PoolPrices.toJSON(e) : undefined); + obj.prices = message.prices.map((e) => (e ? PoolPrices.toJSON(e) : undefined)) } else { - obj.prices = []; + obj.prices = [] } - return obj; + return obj }, - fromPartial, I>>(object: I): QueryAllPoolsResponse { - const message = createBaseQueryAllPoolsResponse(); - message.pools = object.pools?.map((e) => Vpool.fromPartial(e)) || []; - message.prices = object.prices?.map((e) => PoolPrices.fromPartial(e)) || []; - return message; + fromPartial, I>>( + object: I, + ): QueryAllPoolsResponse { + const message = createBaseQueryAllPoolsResponse() + message.pools = object.pools?.map((e) => Vpool.fromPartial(e)) || [] + message.prices = object.prices?.map((e) => PoolPrices.fromPartial(e)) || [] + return message }, -}; +} function createBaseQueryBaseAssetPriceRequest(): QueryBaseAssetPriceRequest { - return { pair: "", direction: 0, baseAssetAmount: "" }; + return { pair: "", direction: 0, baseAssetAmount: "" } } export const QueryBaseAssetPriceRequest = { - encode(message: QueryBaseAssetPriceRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryBaseAssetPriceRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.pair !== "") { - writer.uint32(10).string(message.pair); + writer.uint32(10).string(message.pair) } if (message.direction !== 0) { - writer.uint32(16).int32(message.direction); + writer.uint32(16).int32(message.direction) } if (message.baseAssetAmount !== "") { - writer.uint32(26).string(message.baseAssetAmount); + writer.uint32(26).string(message.baseAssetAmount) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryBaseAssetPriceRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryBaseAssetPriceRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryBaseAssetPriceRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.pair = reader.string(); - break; + message.pair = reader.string() + break case 2: - message.direction = reader.int32() as any; - break; + message.direction = reader.int32() as any + break case 3: - message.baseAssetAmount = reader.string(); - break; + message.baseAssetAmount = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryBaseAssetPriceRequest { return { pair: isSet(object.pair) ? String(object.pair) : "", direction: isSet(object.direction) ? directionFromJSON(object.direction) : 0, - baseAssetAmount: isSet(object.baseAssetAmount) ? String(object.baseAssetAmount) : "", - }; + baseAssetAmount: isSet(object.baseAssetAmount) + ? String(object.baseAssetAmount) + : "", + } }, toJSON(message: QueryBaseAssetPriceRequest): unknown { - const obj: any = {}; - message.pair !== undefined && (obj.pair = message.pair); - message.direction !== undefined && (obj.direction = directionToJSON(message.direction)); - message.baseAssetAmount !== undefined && (obj.baseAssetAmount = message.baseAssetAmount); - return obj; + const obj: any = {} + message.pair !== undefined && (obj.pair = message.pair) + message.direction !== undefined && + (obj.direction = directionToJSON(message.direction)) + message.baseAssetAmount !== undefined && + (obj.baseAssetAmount = message.baseAssetAmount) + return obj }, - fromPartial, I>>(object: I): QueryBaseAssetPriceRequest { - const message = createBaseQueryBaseAssetPriceRequest(); - message.pair = object.pair ?? ""; - message.direction = object.direction ?? 0; - message.baseAssetAmount = object.baseAssetAmount ?? ""; - return message; + fromPartial, I>>( + object: I, + ): QueryBaseAssetPriceRequest { + const message = createBaseQueryBaseAssetPriceRequest() + message.pair = object.pair ?? "" + message.direction = object.direction ?? 0 + message.baseAssetAmount = object.baseAssetAmount ?? "" + return message }, -}; +} function createBaseQueryBaseAssetPriceResponse(): QueryBaseAssetPriceResponse { - return { priceInQuoteDenom: "" }; + return { priceInQuoteDenom: "" } } export const QueryBaseAssetPriceResponse = { - encode(message: QueryBaseAssetPriceResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryBaseAssetPriceResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.priceInQuoteDenom !== "") { - writer.uint32(10).string(message.priceInQuoteDenom); + writer.uint32(10).string(message.priceInQuoteDenom) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryBaseAssetPriceResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryBaseAssetPriceResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryBaseAssetPriceResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.priceInQuoteDenom = reader.string(); - break; + message.priceInQuoteDenom = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryBaseAssetPriceResponse { - return { priceInQuoteDenom: isSet(object.priceInQuoteDenom) ? String(object.priceInQuoteDenom) : "" }; + return { + priceInQuoteDenom: isSet(object.priceInQuoteDenom) + ? String(object.priceInQuoteDenom) + : "", + } }, toJSON(message: QueryBaseAssetPriceResponse): unknown { - const obj: any = {}; - message.priceInQuoteDenom !== undefined && (obj.priceInQuoteDenom = message.priceInQuoteDenom); - return obj; + const obj: any = {} + message.priceInQuoteDenom !== undefined && + (obj.priceInQuoteDenom = message.priceInQuoteDenom) + return obj }, - fromPartial, I>>(object: I): QueryBaseAssetPriceResponse { - const message = createBaseQueryBaseAssetPriceResponse(); - message.priceInQuoteDenom = object.priceInQuoteDenom ?? ""; - return message; + fromPartial, I>>( + object: I, + ): QueryBaseAssetPriceResponse { + const message = createBaseQueryBaseAssetPriceResponse() + message.priceInQuoteDenom = object.priceInQuoteDenom ?? "" + return message }, -}; +} /** Query defines the gRPC querier service. */ export interface Query { /** Queries the reserve assets in a given pool, identified by a token pair. */ - ReserveAssets(request: QueryReserveAssetsRequest): Promise; + ReserveAssets(request: QueryReserveAssetsRequest): Promise /** Queries all virtual pools. */ - AllPools(request: QueryAllPoolsRequest): Promise; + AllPools(request: QueryAllPoolsRequest): Promise /** Queries prices */ - BaseAssetPrice(request: QueryBaseAssetPriceRequest): Promise; + BaseAssetPrice( + request: QueryBaseAssetPriceRequest, + ): Promise } export class QueryClientImpl implements Query { - private readonly rpc: Rpc; + private readonly rpc: Rpc constructor(rpc: Rpc) { - this.rpc = rpc; - this.ReserveAssets = this.ReserveAssets.bind(this); - this.AllPools = this.AllPools.bind(this); - this.BaseAssetPrice = this.BaseAssetPrice.bind(this); + this.rpc = rpc + this.ReserveAssets = this.ReserveAssets.bind(this) + this.AllPools = this.AllPools.bind(this) + this.BaseAssetPrice = this.BaseAssetPrice.bind(this) } - ReserveAssets(request: QueryReserveAssetsRequest): Promise { - const data = QueryReserveAssetsRequest.encode(request).finish(); - const promise = this.rpc.request("nibiru.vpool.v1.Query", "ReserveAssets", data); - return promise.then((data) => QueryReserveAssetsResponse.decode(new _m0.Reader(data))); + ReserveAssets( + request: QueryReserveAssetsRequest, + ): Promise { + const data = QueryReserveAssetsRequest.encode(request).finish() + const promise = this.rpc.request("nibiru.vpool.v1.Query", "ReserveAssets", data) + return promise.then((data) => + QueryReserveAssetsResponse.decode(new _m0.Reader(data)), + ) } AllPools(request: QueryAllPoolsRequest): Promise { - const data = QueryAllPoolsRequest.encode(request).finish(); - const promise = this.rpc.request("nibiru.vpool.v1.Query", "AllPools", data); - return promise.then((data) => QueryAllPoolsResponse.decode(new _m0.Reader(data))); + const data = QueryAllPoolsRequest.encode(request).finish() + const promise = this.rpc.request("nibiru.vpool.v1.Query", "AllPools", data) + return promise.then((data) => QueryAllPoolsResponse.decode(new _m0.Reader(data))) } - BaseAssetPrice(request: QueryBaseAssetPriceRequest): Promise { - const data = QueryBaseAssetPriceRequest.encode(request).finish(); - const promise = this.rpc.request("nibiru.vpool.v1.Query", "BaseAssetPrice", data); - return promise.then((data) => QueryBaseAssetPriceResponse.decode(new _m0.Reader(data))); + BaseAssetPrice( + request: QueryBaseAssetPriceRequest, + ): Promise { + const data = QueryBaseAssetPriceRequest.encode(request).finish() + const promise = this.rpc.request("nibiru.vpool.v1.Query", "BaseAssetPrice", data) + return promise.then((data) => + QueryBaseAssetPriceResponse.decode(new _m0.Reader(data)), + ) } } interface Rpc { - request(service: string, method: string, data: Uint8Array): Promise; + request(service: string, method: string, data: Uint8Array): Promise } -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protojs/src/vpool/v1/state.ts b/packages/protojs/src/vpool/v1/state.ts index 6519ee10..22fa8ef4 100644 --- a/packages/protojs/src/vpool/v1/state.ts +++ b/packages/protojs/src/vpool/v1/state.ts @@ -1,8 +1,8 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; +import Long from "long" +import * as _m0 from "protobufjs/minimal" -export const protobufPackage = "nibiru.vpool.v1"; +export const protobufPackage = "nibiru.vpool.v1" export enum Direction { DIRECTION_UNSPECIFIED = 0, @@ -15,31 +15,31 @@ export function directionFromJSON(object: any): Direction { switch (object) { case 0: case "DIRECTION_UNSPECIFIED": - return Direction.DIRECTION_UNSPECIFIED; + return Direction.DIRECTION_UNSPECIFIED case 1: case "ADD_TO_POOL": - return Direction.ADD_TO_POOL; + return Direction.ADD_TO_POOL case 2: case "REMOVE_FROM_POOL": - return Direction.REMOVE_FROM_POOL; + return Direction.REMOVE_FROM_POOL case -1: case "UNRECOGNIZED": default: - return Direction.UNRECOGNIZED; + return Direction.UNRECOGNIZED } } export function directionToJSON(object: Direction): string { switch (object) { case Direction.DIRECTION_UNSPECIFIED: - return "DIRECTION_UNSPECIFIED"; + return "DIRECTION_UNSPECIFIED" case Direction.ADD_TO_POOL: - return "ADD_TO_POOL"; + return "ADD_TO_POOL" case Direction.REMOVE_FROM_POOL: - return "REMOVE_FROM_POOL"; + return "REMOVE_FROM_POOL" case Direction.UNRECOGNIZED: default: - return "UNRECOGNIZED"; + return "UNRECOGNIZED" } } @@ -59,36 +59,36 @@ export function twapCalcOptionFromJSON(object: any): TwapCalcOption { switch (object) { case 0: case "TWAP_CALC_OPTION_UNSPECIFIED": - return TwapCalcOption.TWAP_CALC_OPTION_UNSPECIFIED; + return TwapCalcOption.TWAP_CALC_OPTION_UNSPECIFIED case 1: case "SPOT": - return TwapCalcOption.SPOT; + return TwapCalcOption.SPOT case 2: case "QUOTE_ASSET_SWAP": - return TwapCalcOption.QUOTE_ASSET_SWAP; + return TwapCalcOption.QUOTE_ASSET_SWAP case 3: case "BASE_ASSET_SWAP": - return TwapCalcOption.BASE_ASSET_SWAP; + return TwapCalcOption.BASE_ASSET_SWAP case -1: case "UNRECOGNIZED": default: - return TwapCalcOption.UNRECOGNIZED; + return TwapCalcOption.UNRECOGNIZED } } export function twapCalcOptionToJSON(object: TwapCalcOption): string { switch (object) { case TwapCalcOption.TWAP_CALC_OPTION_UNSPECIFIED: - return "TWAP_CALC_OPTION_UNSPECIFIED"; + return "TWAP_CALC_OPTION_UNSPECIFIED" case TwapCalcOption.SPOT: - return "SPOT"; + return "SPOT" case TwapCalcOption.QUOTE_ASSET_SWAP: - return "QUOTE_ASSET_SWAP"; + return "QUOTE_ASSET_SWAP" case TwapCalcOption.BASE_ASSET_SWAP: - return "BASE_ASSET_SWAP"; + return "BASE_ASSET_SWAP" case TwapCalcOption.UNRECOGNIZED: default: - return "UNRECOGNIZED"; + return "UNRECOGNIZED" } } @@ -98,43 +98,43 @@ export function twapCalcOptionToJSON(object: TwapCalcOption): string { */ export interface Vpool { /** always BASE:QUOTE, e.g. BTC:NUSD or ETH:NUSD */ - pair: string; + pair: string /** base asset is the crypto asset, e.g. BTC or ETH */ - baseAssetReserve: string; + baseAssetReserve: string /** quote asset is usually stablecoin, in our case NUSD */ - quoteAssetReserve: string; - config?: VpoolConfig; + quoteAssetReserve: string + config?: VpoolConfig } export interface VpoolConfig { /** ratio applied to reserves in order not to over trade */ - tradeLimitRatio: string; + tradeLimitRatio: string /** percentage that a single open or close position can alter the reserve amounts */ - fluctuationLimitRatio: string; + fluctuationLimitRatio: string /** max_oracle_spread_ratio */ - maxOracleSpreadRatio: string; + maxOracleSpreadRatio: string /** maintenance_margin_ratio */ - maintenanceMarginRatio: string; + maintenanceMarginRatio: string /** max_leverage */ - maxLeverage: string; + maxLeverage: string } /** CurrentTWAP states defines the numerator and denominator for the TWAP calculation */ export interface CurrentTWAP { - pairId: string; - numerator: string; - denominator: string; - price: string; + pairId: string + numerator: string + denominator: string + price: string } /** a snapshot of the vpool's reserves at a given point in time */ export interface ReserveSnapshot { - pair: string; - baseAssetReserve: string; + pair: string + baseAssetReserve: string /** quote asset is usually the margin asset, e.g. NUSD */ - quoteAssetReserve: string; + quoteAssetReserve: string /** milliseconds since unix epoch */ - timestampMs: Long; + timestampMs: Long } /** @@ -144,99 +144,107 @@ export interface ReserveSnapshot { */ export interface PoolPrices { /** Pair identifier for the two assets. Always in format 'base:quote' */ - pair: string; + pair: string /** * MarkPrice is the instantaneous price of the perp. * Equivalent to quoteAssetReserve / baseAssetReserve. */ - markPrice: string; + markPrice: string /** IndexPrice is the price of the "underlying" for the perp */ - indexPrice: string; + indexPrice: string /** TwapMark is the time-weighted average (mark) price. */ - twapMark: string; + twapMark: string /** SwapInvariant is the product of the reserves, commonly referred to as "k". */ - swapInvariant: string; + swapInvariant: string /** The block number corresponding to each price */ - blockNumber: Long; + blockNumber: Long } function createBaseVpool(): Vpool { - return { pair: "", baseAssetReserve: "", quoteAssetReserve: "", config: undefined }; + return { pair: "", baseAssetReserve: "", quoteAssetReserve: "", config: undefined } } export const Vpool = { encode(message: Vpool, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.pair !== "") { - writer.uint32(10).string(message.pair); + writer.uint32(10).string(message.pair) } if (message.baseAssetReserve !== "") { - writer.uint32(18).string(message.baseAssetReserve); + writer.uint32(18).string(message.baseAssetReserve) } if (message.quoteAssetReserve !== "") { - writer.uint32(26).string(message.quoteAssetReserve); + writer.uint32(26).string(message.quoteAssetReserve) } if (message.config !== undefined) { - VpoolConfig.encode(message.config, writer.uint32(34).fork()).ldelim(); + VpoolConfig.encode(message.config, writer.uint32(34).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Vpool { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseVpool(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseVpool() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.pair = reader.string(); - break; + message.pair = reader.string() + break case 2: - message.baseAssetReserve = reader.string(); - break; + message.baseAssetReserve = reader.string() + break case 3: - message.quoteAssetReserve = reader.string(); - break; + message.quoteAssetReserve = reader.string() + break case 4: - message.config = VpoolConfig.decode(reader, reader.uint32()); - break; + message.config = VpoolConfig.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Vpool { return { pair: isSet(object.pair) ? String(object.pair) : "", - baseAssetReserve: isSet(object.baseAssetReserve) ? String(object.baseAssetReserve) : "", - quoteAssetReserve: isSet(object.quoteAssetReserve) ? String(object.quoteAssetReserve) : "", + baseAssetReserve: isSet(object.baseAssetReserve) + ? String(object.baseAssetReserve) + : "", + quoteAssetReserve: isSet(object.quoteAssetReserve) + ? String(object.quoteAssetReserve) + : "", config: isSet(object.config) ? VpoolConfig.fromJSON(object.config) : undefined, - }; + } }, toJSON(message: Vpool): unknown { - const obj: any = {}; - message.pair !== undefined && (obj.pair = message.pair); - message.baseAssetReserve !== undefined && (obj.baseAssetReserve = message.baseAssetReserve); - message.quoteAssetReserve !== undefined && (obj.quoteAssetReserve = message.quoteAssetReserve); - message.config !== undefined && (obj.config = message.config ? VpoolConfig.toJSON(message.config) : undefined); - return obj; + const obj: any = {} + message.pair !== undefined && (obj.pair = message.pair) + message.baseAssetReserve !== undefined && + (obj.baseAssetReserve = message.baseAssetReserve) + message.quoteAssetReserve !== undefined && + (obj.quoteAssetReserve = message.quoteAssetReserve) + message.config !== undefined && + (obj.config = message.config ? VpoolConfig.toJSON(message.config) : undefined) + return obj }, fromPartial, I>>(object: I): Vpool { - const message = createBaseVpool(); - message.pair = object.pair ?? ""; - message.baseAssetReserve = object.baseAssetReserve ?? ""; - message.quoteAssetReserve = object.quoteAssetReserve ?? ""; - message.config = (object.config !== undefined && object.config !== null) - ? VpoolConfig.fromPartial(object.config) - : undefined; - return message; + const message = createBaseVpool() + message.pair = object.pair ?? "" + message.baseAssetReserve = object.baseAssetReserve ?? "" + message.quoteAssetReserve = object.quoteAssetReserve ?? "" + message.config = + object.config !== undefined && object.config !== null + ? VpoolConfig.fromPartial(object.config) + : undefined + return message }, -}; +} function createBaseVpoolConfig(): VpoolConfig { return { @@ -245,136 +253,148 @@ function createBaseVpoolConfig(): VpoolConfig { maxOracleSpreadRatio: "", maintenanceMarginRatio: "", maxLeverage: "", - }; + } } export const VpoolConfig = { encode(message: VpoolConfig, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.tradeLimitRatio !== "") { - writer.uint32(10).string(message.tradeLimitRatio); + writer.uint32(10).string(message.tradeLimitRatio) } if (message.fluctuationLimitRatio !== "") { - writer.uint32(18).string(message.fluctuationLimitRatio); + writer.uint32(18).string(message.fluctuationLimitRatio) } if (message.maxOracleSpreadRatio !== "") { - writer.uint32(26).string(message.maxOracleSpreadRatio); + writer.uint32(26).string(message.maxOracleSpreadRatio) } if (message.maintenanceMarginRatio !== "") { - writer.uint32(34).string(message.maintenanceMarginRatio); + writer.uint32(34).string(message.maintenanceMarginRatio) } if (message.maxLeverage !== "") { - writer.uint32(42).string(message.maxLeverage); + writer.uint32(42).string(message.maxLeverage) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): VpoolConfig { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseVpoolConfig(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseVpoolConfig() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.tradeLimitRatio = reader.string(); - break; + message.tradeLimitRatio = reader.string() + break case 2: - message.fluctuationLimitRatio = reader.string(); - break; + message.fluctuationLimitRatio = reader.string() + break case 3: - message.maxOracleSpreadRatio = reader.string(); - break; + message.maxOracleSpreadRatio = reader.string() + break case 4: - message.maintenanceMarginRatio = reader.string(); - break; + message.maintenanceMarginRatio = reader.string() + break case 5: - message.maxLeverage = reader.string(); - break; + message.maxLeverage = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): VpoolConfig { return { - tradeLimitRatio: isSet(object.tradeLimitRatio) ? String(object.tradeLimitRatio) : "", - fluctuationLimitRatio: isSet(object.fluctuationLimitRatio) ? String(object.fluctuationLimitRatio) : "", - maxOracleSpreadRatio: isSet(object.maxOracleSpreadRatio) ? String(object.maxOracleSpreadRatio) : "", - maintenanceMarginRatio: isSet(object.maintenanceMarginRatio) ? String(object.maintenanceMarginRatio) : "", + tradeLimitRatio: isSet(object.tradeLimitRatio) + ? String(object.tradeLimitRatio) + : "", + fluctuationLimitRatio: isSet(object.fluctuationLimitRatio) + ? String(object.fluctuationLimitRatio) + : "", + maxOracleSpreadRatio: isSet(object.maxOracleSpreadRatio) + ? String(object.maxOracleSpreadRatio) + : "", + maintenanceMarginRatio: isSet(object.maintenanceMarginRatio) + ? String(object.maintenanceMarginRatio) + : "", maxLeverage: isSet(object.maxLeverage) ? String(object.maxLeverage) : "", - }; + } }, toJSON(message: VpoolConfig): unknown { - const obj: any = {}; - message.tradeLimitRatio !== undefined && (obj.tradeLimitRatio = message.tradeLimitRatio); - message.fluctuationLimitRatio !== undefined && (obj.fluctuationLimitRatio = message.fluctuationLimitRatio); - message.maxOracleSpreadRatio !== undefined && (obj.maxOracleSpreadRatio = message.maxOracleSpreadRatio); - message.maintenanceMarginRatio !== undefined && (obj.maintenanceMarginRatio = message.maintenanceMarginRatio); - message.maxLeverage !== undefined && (obj.maxLeverage = message.maxLeverage); - return obj; + const obj: any = {} + message.tradeLimitRatio !== undefined && + (obj.tradeLimitRatio = message.tradeLimitRatio) + message.fluctuationLimitRatio !== undefined && + (obj.fluctuationLimitRatio = message.fluctuationLimitRatio) + message.maxOracleSpreadRatio !== undefined && + (obj.maxOracleSpreadRatio = message.maxOracleSpreadRatio) + message.maintenanceMarginRatio !== undefined && + (obj.maintenanceMarginRatio = message.maintenanceMarginRatio) + message.maxLeverage !== undefined && (obj.maxLeverage = message.maxLeverage) + return obj }, fromPartial, I>>(object: I): VpoolConfig { - const message = createBaseVpoolConfig(); - message.tradeLimitRatio = object.tradeLimitRatio ?? ""; - message.fluctuationLimitRatio = object.fluctuationLimitRatio ?? ""; - message.maxOracleSpreadRatio = object.maxOracleSpreadRatio ?? ""; - message.maintenanceMarginRatio = object.maintenanceMarginRatio ?? ""; - message.maxLeverage = object.maxLeverage ?? ""; - return message; + const message = createBaseVpoolConfig() + message.tradeLimitRatio = object.tradeLimitRatio ?? "" + message.fluctuationLimitRatio = object.fluctuationLimitRatio ?? "" + message.maxOracleSpreadRatio = object.maxOracleSpreadRatio ?? "" + message.maintenanceMarginRatio = object.maintenanceMarginRatio ?? "" + message.maxLeverage = object.maxLeverage ?? "" + return message }, -}; +} function createBaseCurrentTWAP(): CurrentTWAP { - return { pairId: "", numerator: "", denominator: "", price: "" }; + return { pairId: "", numerator: "", denominator: "", price: "" } } export const CurrentTWAP = { encode(message: CurrentTWAP, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.pairId !== "") { - writer.uint32(10).string(message.pairId); + writer.uint32(10).string(message.pairId) } if (message.numerator !== "") { - writer.uint32(18).string(message.numerator); + writer.uint32(18).string(message.numerator) } if (message.denominator !== "") { - writer.uint32(26).string(message.denominator); + writer.uint32(26).string(message.denominator) } if (message.price !== "") { - writer.uint32(34).string(message.price); + writer.uint32(34).string(message.price) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): CurrentTWAP { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseCurrentTWAP(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseCurrentTWAP() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.pairId = reader.string(); - break; + message.pairId = reader.string() + break case 2: - message.numerator = reader.string(); - break; + message.numerator = reader.string() + break case 3: - message.denominator = reader.string(); - break; + message.denominator = reader.string() + break case 4: - message.price = reader.string(); - break; + message.price = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): CurrentTWAP { @@ -383,164 +403,191 @@ export const CurrentTWAP = { numerator: isSet(object.numerator) ? String(object.numerator) : "", denominator: isSet(object.denominator) ? String(object.denominator) : "", price: isSet(object.price) ? String(object.price) : "", - }; + } }, toJSON(message: CurrentTWAP): unknown { - const obj: any = {}; - message.pairId !== undefined && (obj.pairId = message.pairId); - message.numerator !== undefined && (obj.numerator = message.numerator); - message.denominator !== undefined && (obj.denominator = message.denominator); - message.price !== undefined && (obj.price = message.price); - return obj; + const obj: any = {} + message.pairId !== undefined && (obj.pairId = message.pairId) + message.numerator !== undefined && (obj.numerator = message.numerator) + message.denominator !== undefined && (obj.denominator = message.denominator) + message.price !== undefined && (obj.price = message.price) + return obj }, fromPartial, I>>(object: I): CurrentTWAP { - const message = createBaseCurrentTWAP(); - message.pairId = object.pairId ?? ""; - message.numerator = object.numerator ?? ""; - message.denominator = object.denominator ?? ""; - message.price = object.price ?? ""; - return message; + const message = createBaseCurrentTWAP() + message.pairId = object.pairId ?? "" + message.numerator = object.numerator ?? "" + message.denominator = object.denominator ?? "" + message.price = object.price ?? "" + return message }, -}; +} function createBaseReserveSnapshot(): ReserveSnapshot { - return { pair: "", baseAssetReserve: "", quoteAssetReserve: "", timestampMs: Long.ZERO }; + return { + pair: "", + baseAssetReserve: "", + quoteAssetReserve: "", + timestampMs: Long.ZERO, + } } export const ReserveSnapshot = { - encode(message: ReserveSnapshot, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: ReserveSnapshot, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { if (message.pair !== "") { - writer.uint32(42).string(message.pair); + writer.uint32(42).string(message.pair) } if (message.baseAssetReserve !== "") { - writer.uint32(10).string(message.baseAssetReserve); + writer.uint32(10).string(message.baseAssetReserve) } if (message.quoteAssetReserve !== "") { - writer.uint32(18).string(message.quoteAssetReserve); + writer.uint32(18).string(message.quoteAssetReserve) } if (!message.timestampMs.isZero()) { - writer.uint32(24).int64(message.timestampMs); + writer.uint32(24).int64(message.timestampMs) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): ReserveSnapshot { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseReserveSnapshot(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseReserveSnapshot() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 5: - message.pair = reader.string(); - break; + message.pair = reader.string() + break case 1: - message.baseAssetReserve = reader.string(); - break; + message.baseAssetReserve = reader.string() + break case 2: - message.quoteAssetReserve = reader.string(); - break; + message.quoteAssetReserve = reader.string() + break case 3: - message.timestampMs = reader.int64() as Long; - break; + message.timestampMs = reader.int64() as Long + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): ReserveSnapshot { return { pair: isSet(object.pair) ? String(object.pair) : "", - baseAssetReserve: isSet(object.baseAssetReserve) ? String(object.baseAssetReserve) : "", - quoteAssetReserve: isSet(object.quoteAssetReserve) ? String(object.quoteAssetReserve) : "", - timestampMs: isSet(object.timestampMs) ? Long.fromValue(object.timestampMs) : Long.ZERO, - }; + baseAssetReserve: isSet(object.baseAssetReserve) + ? String(object.baseAssetReserve) + : "", + quoteAssetReserve: isSet(object.quoteAssetReserve) + ? String(object.quoteAssetReserve) + : "", + timestampMs: isSet(object.timestampMs) + ? Long.fromValue(object.timestampMs) + : Long.ZERO, + } }, toJSON(message: ReserveSnapshot): unknown { - const obj: any = {}; - message.pair !== undefined && (obj.pair = message.pair); - message.baseAssetReserve !== undefined && (obj.baseAssetReserve = message.baseAssetReserve); - message.quoteAssetReserve !== undefined && (obj.quoteAssetReserve = message.quoteAssetReserve); - message.timestampMs !== undefined && (obj.timestampMs = (message.timestampMs || Long.ZERO).toString()); - return obj; + const obj: any = {} + message.pair !== undefined && (obj.pair = message.pair) + message.baseAssetReserve !== undefined && + (obj.baseAssetReserve = message.baseAssetReserve) + message.quoteAssetReserve !== undefined && + (obj.quoteAssetReserve = message.quoteAssetReserve) + message.timestampMs !== undefined && + (obj.timestampMs = (message.timestampMs || Long.ZERO).toString()) + return obj }, - fromPartial, I>>(object: I): ReserveSnapshot { - const message = createBaseReserveSnapshot(); - message.pair = object.pair ?? ""; - message.baseAssetReserve = object.baseAssetReserve ?? ""; - message.quoteAssetReserve = object.quoteAssetReserve ?? ""; - message.timestampMs = (object.timestampMs !== undefined && object.timestampMs !== null) - ? Long.fromValue(object.timestampMs) - : Long.ZERO; - return message; + fromPartial, I>>( + object: I, + ): ReserveSnapshot { + const message = createBaseReserveSnapshot() + message.pair = object.pair ?? "" + message.baseAssetReserve = object.baseAssetReserve ?? "" + message.quoteAssetReserve = object.quoteAssetReserve ?? "" + message.timestampMs = + object.timestampMs !== undefined && object.timestampMs !== null + ? Long.fromValue(object.timestampMs) + : Long.ZERO + return message }, -}; +} function createBasePoolPrices(): PoolPrices { - return { pair: "", markPrice: "", indexPrice: "", twapMark: "", swapInvariant: "", blockNumber: Long.ZERO }; + return { + pair: "", + markPrice: "", + indexPrice: "", + twapMark: "", + swapInvariant: "", + blockNumber: Long.ZERO, + } } export const PoolPrices = { encode(message: PoolPrices, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.pair !== "") { - writer.uint32(74).string(message.pair); + writer.uint32(74).string(message.pair) } if (message.markPrice !== "") { - writer.uint32(82).string(message.markPrice); + writer.uint32(82).string(message.markPrice) } if (message.indexPrice !== "") { - writer.uint32(90).string(message.indexPrice); + writer.uint32(90).string(message.indexPrice) } if (message.twapMark !== "") { - writer.uint32(98).string(message.twapMark); + writer.uint32(98).string(message.twapMark) } if (message.swapInvariant !== "") { - writer.uint32(106).string(message.swapInvariant); + writer.uint32(106).string(message.swapInvariant) } if (!message.blockNumber.isZero()) { - writer.uint32(112).int64(message.blockNumber); + writer.uint32(112).int64(message.blockNumber) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): PoolPrices { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBasePoolPrices(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBasePoolPrices() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 9: - message.pair = reader.string(); - break; + message.pair = reader.string() + break case 10: - message.markPrice = reader.string(); - break; + message.markPrice = reader.string() + break case 11: - message.indexPrice = reader.string(); - break; + message.indexPrice = reader.string() + break case 12: - message.twapMark = reader.string(); - break; + message.twapMark = reader.string() + break case 13: - message.swapInvariant = reader.string(); - break; + message.swapInvariant = reader.string() + break case 14: - message.blockNumber = reader.int64() as Long; - break; + message.blockNumber = reader.int64() as Long + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): PoolPrices { @@ -550,52 +597,66 @@ export const PoolPrices = { indexPrice: isSet(object.indexPrice) ? String(object.indexPrice) : "", twapMark: isSet(object.twapMark) ? String(object.twapMark) : "", swapInvariant: isSet(object.swapInvariant) ? String(object.swapInvariant) : "", - blockNumber: isSet(object.blockNumber) ? Long.fromValue(object.blockNumber) : Long.ZERO, - }; + blockNumber: isSet(object.blockNumber) + ? Long.fromValue(object.blockNumber) + : Long.ZERO, + } }, toJSON(message: PoolPrices): unknown { - const obj: any = {}; - message.pair !== undefined && (obj.pair = message.pair); - message.markPrice !== undefined && (obj.markPrice = message.markPrice); - message.indexPrice !== undefined && (obj.indexPrice = message.indexPrice); - message.twapMark !== undefined && (obj.twapMark = message.twapMark); - message.swapInvariant !== undefined && (obj.swapInvariant = message.swapInvariant); - message.blockNumber !== undefined && (obj.blockNumber = (message.blockNumber || Long.ZERO).toString()); - return obj; + const obj: any = {} + message.pair !== undefined && (obj.pair = message.pair) + message.markPrice !== undefined && (obj.markPrice = message.markPrice) + message.indexPrice !== undefined && (obj.indexPrice = message.indexPrice) + message.twapMark !== undefined && (obj.twapMark = message.twapMark) + message.swapInvariant !== undefined && (obj.swapInvariant = message.swapInvariant) + message.blockNumber !== undefined && + (obj.blockNumber = (message.blockNumber || Long.ZERO).toString()) + return obj }, fromPartial, I>>(object: I): PoolPrices { - const message = createBasePoolPrices(); - message.pair = object.pair ?? ""; - message.markPrice = object.markPrice ?? ""; - message.indexPrice = object.indexPrice ?? ""; - message.twapMark = object.twapMark ?? ""; - message.swapInvariant = object.swapInvariant ?? ""; - message.blockNumber = (object.blockNumber !== undefined && object.blockNumber !== null) - ? Long.fromValue(object.blockNumber) - : Long.ZERO; - return message; + const message = createBasePoolPrices() + message.pair = object.pair ?? "" + message.markPrice = object.markPrice ?? "" + message.indexPrice = object.indexPrice ?? "" + message.twapMark = object.twapMark ?? "" + message.swapInvariant = object.swapInvariant ?? "" + message.blockNumber = + object.blockNumber !== undefined && object.blockNumber !== null + ? Long.fromValue(object.blockNumber) + : Long.ZERO + return message }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; +} -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/scripts/protocgen.sh b/scripts/protocgen.sh index 733c9390..cf72cccc 100755 --- a/scripts/protocgen.sh +++ b/scripts/protocgen.sh @@ -72,7 +72,7 @@ echo "Grabbing all of the Cosmos-SDK and third party protos" echo "current dir: $(pwd)" cd -; echo "current dir: $(pwd)" -proto_dirs=$(find $cosmos_sdk_dir/proto $cosmos_sdk_dir/third_party/proto/ ./proto -path -prune -o -name '*.proto' -print0 | xargs -0 -n1 dirname | sort | uniq) +proto_dirs=$(find $cosmos_sdk_dir/proto $cosmos_sdk_dir/third_party/proto proto -path -prune -o -name '*.proto' -print0 | xargs -0 -n1 dirname | uniq | sort) echo "Proto Directories: " for dir in $proto_dirs; do \ echo $dir @@ -85,15 +85,14 @@ rm -rf $PKG_OUT_DIR/* skip_line for dir in $proto_dirs; do \ - string=$dir prefix=$HOME/go/pkg/mod/github.com - prefix_removed_string=${string/#$prefix} + prefix_removed_string=${dir/#$prefix} echo "generating $prefix_removed_string ----------------------------------------" protoc \ --plugin=./node_modules/.bin/protoc-gen-ts_proto \ -I "$cosmos_sdk_dir/third_party/proto" \ -I "$cosmos_sdk_dir/proto" \ - -I proto/proto \ + -I proto \ --ts_proto_opt="esModuleInterop=true,forceLong=long,useOptionals=messages" \ --ts_proto_out=$PKG_OUT_DIR \ $(find "${dir}" -type f -name '*.proto') diff --git a/yarn.lock b/yarn.lock index db2d976a..ffc44ad6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -202,6 +202,13 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.0" +"@babel/plugin-syntax-jsx@^7.7.2": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.18.6.tgz#a8feef63b010150abd97f1649ec296e849943ca0" + integrity sha512-6mmljtAedFGTWu2p/8WIORGwy+61PLgOMPOdazc7YoJ9ZCWUyFy3A6CpPkRKLKD1ToAesxX8KGEViAiLo9N+7Q== + dependencies: + "@babel/helper-plugin-utils" "^7.18.6" + "@babel/plugin-syntax-logical-assignment-operators@^7.8.3": version "7.10.4" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz#ca91ef46303530448b906652bac2e9fe9941f699" @@ -835,6 +842,18 @@ jest-util "^28.1.3" slash "^3.0.0" +"@jest/console@^29.5.0": + version "29.5.0" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-29.5.0.tgz#593a6c5c0d3f75689835f1b3b4688c4f8544cb57" + integrity sha512-NEpkObxPwyw/XxZVLPmAGKE89IQRp4puc6IQRPru6JKd1M3fW9v1xM1AnzIJE65hbCkzQAdnL8P47e9hzhiYLQ== + dependencies: + "@jest/types" "^29.5.0" + "@types/node" "*" + chalk "^4.0.0" + jest-message-util "^29.5.0" + jest-util "^29.5.0" + slash "^3.0.0" + "@jest/core@^27.5.1": version "27.5.1" resolved "https://registry.yarnpkg.com/@jest/core/-/core-27.5.1.tgz#267ac5f704e09dc52de2922cbf3af9edcd64b626" @@ -904,6 +923,40 @@ slash "^3.0.0" strip-ansi "^6.0.0" +"@jest/core@^29.5.0": + version "29.5.0" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-29.5.0.tgz#76674b96904484e8214614d17261cc491e5f1f03" + integrity sha512-28UzQc7ulUrOQw1IsN/kv1QES3q2kkbl/wGslyhAclqZ/8cMdB5M68BffkIdSJgKBUt50d3hbwJ92XESlE7LiQ== + dependencies: + "@jest/console" "^29.5.0" + "@jest/reporters" "^29.5.0" + "@jest/test-result" "^29.5.0" + "@jest/transform" "^29.5.0" + "@jest/types" "^29.5.0" + "@types/node" "*" + ansi-escapes "^4.2.1" + chalk "^4.0.0" + ci-info "^3.2.0" + exit "^0.1.2" + graceful-fs "^4.2.9" + jest-changed-files "^29.5.0" + jest-config "^29.5.0" + jest-haste-map "^29.5.0" + jest-message-util "^29.5.0" + jest-regex-util "^29.4.3" + jest-resolve "^29.5.0" + jest-resolve-dependencies "^29.5.0" + jest-runner "^29.5.0" + jest-runtime "^29.5.0" + jest-snapshot "^29.5.0" + jest-util "^29.5.0" + jest-validate "^29.5.0" + jest-watcher "^29.5.0" + micromatch "^4.0.4" + pretty-format "^29.5.0" + slash "^3.0.0" + strip-ansi "^6.0.0" + "@jest/environment@^27.5.1": version "27.5.1" resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-27.5.1.tgz#d7425820511fe7158abbecc010140c3fd3be9c74" @@ -924,6 +977,16 @@ "@types/node" "*" jest-mock "^28.1.3" +"@jest/environment@^29.5.0": + version "29.5.0" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-29.5.0.tgz#9152d56317c1fdb1af389c46640ba74ef0bb4c65" + integrity sha512-5FXw2+wD29YU1d4I2htpRX7jYnAyTRjP2CsXQdo9SAM8g3ifxWPSV0HnClSn71xwctr0U3oZIIH+dtbfmnbXVQ== + dependencies: + "@jest/fake-timers" "^29.5.0" + "@jest/types" "^29.5.0" + "@types/node" "*" + jest-mock "^29.5.0" + "@jest/expect-utils@^28.1.3": version "28.1.3" resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-28.1.3.tgz#58561ce5db7cd253a7edddbc051fb39dda50f525" @@ -938,6 +1001,13 @@ dependencies: jest-get-type "^29.0.0" +"@jest/expect-utils@^29.5.0": + version "29.5.0" + resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-29.5.0.tgz#f74fad6b6e20f924582dc8ecbf2cb800fe43a036" + integrity sha512-fmKzsidoXQT2KwnrwE0SQq3uj8Z763vzR8LnLBwC2qYWEFpjX8daRsk6rHUM1QvNlEW/UJXNXm59ztmJJWs2Mg== + dependencies: + jest-get-type "^29.4.3" + "@jest/expect@^28.1.3": version "28.1.3" resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-28.1.3.tgz#9ac57e1d4491baca550f6bdbd232487177ad6a72" @@ -946,6 +1016,14 @@ expect "^28.1.3" jest-snapshot "^28.1.3" +"@jest/expect@^29.5.0": + version "29.5.0" + resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-29.5.0.tgz#80952f5316b23c483fbca4363ce822af79c38fba" + integrity sha512-PueDR2HGihN3ciUNGr4uelropW7rqUfTiOn+8u0leg/42UhblPxHkfoh0Ruu3I9Y1962P3u2DY4+h7GVTSVU6g== + dependencies: + expect "^29.5.0" + jest-snapshot "^29.5.0" + "@jest/fake-timers@^27.5.1": version "27.5.1" resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-27.5.1.tgz#76979745ce0579c8a94a4678af7a748eda8ada74" @@ -970,6 +1048,18 @@ jest-mock "^28.1.3" jest-util "^28.1.3" +"@jest/fake-timers@^29.5.0": + version "29.5.0" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-29.5.0.tgz#d4d09ec3286b3d90c60bdcd66ed28d35f1b4dc2c" + integrity sha512-9ARvuAAQcBwDAqOnglWq2zwNIRUDtk/SCkp/ToGEhFv5r86K21l+VEs0qNTaXtyiY0lEePl3kylijSYJQqdbDg== + dependencies: + "@jest/types" "^29.5.0" + "@sinonjs/fake-timers" "^10.0.2" + "@types/node" "*" + jest-message-util "^29.5.0" + jest-mock "^29.5.0" + jest-util "^29.5.0" + "@jest/globals@^27.5.1": version "27.5.1" resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-27.5.1.tgz#7ac06ce57ab966566c7963431cef458434601b2b" @@ -988,6 +1078,16 @@ "@jest/expect" "^28.1.3" "@jest/types" "^28.1.3" +"@jest/globals@^29.5.0": + version "29.5.0" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-29.5.0.tgz#6166c0bfc374c58268677539d0c181f9c1833298" + integrity sha512-S02y0qMWGihdzNbUiqSAiKSpSozSuHX5UYc7QbnHP+D9Lyw8DgGGCinrN9uSuHPeKgSSzvPom2q1nAtBvUsvPQ== + dependencies: + "@jest/environment" "^29.5.0" + "@jest/expect" "^29.5.0" + "@jest/types" "^29.5.0" + jest-mock "^29.5.0" + "@jest/reporters@^27.5.1": version "27.5.1" resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-27.5.1.tgz#ceda7be96170b03c923c37987b64015812ffec04" @@ -1050,6 +1150,36 @@ terminal-link "^2.0.0" v8-to-istanbul "^9.0.1" +"@jest/reporters@^29.5.0": + version "29.5.0" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-29.5.0.tgz#985dfd91290cd78ddae4914ba7921bcbabe8ac9b" + integrity sha512-D05STXqj/M8bP9hQNSICtPqz97u7ffGzZu+9XLucXhkOFBqKcXe04JLZOgIekOxdb73MAoBUFnqvf7MCpKk5OA== + dependencies: + "@bcoe/v8-coverage" "^0.2.3" + "@jest/console" "^29.5.0" + "@jest/test-result" "^29.5.0" + "@jest/transform" "^29.5.0" + "@jest/types" "^29.5.0" + "@jridgewell/trace-mapping" "^0.3.15" + "@types/node" "*" + chalk "^4.0.0" + collect-v8-coverage "^1.0.0" + exit "^0.1.2" + glob "^7.1.3" + graceful-fs "^4.2.9" + istanbul-lib-coverage "^3.0.0" + istanbul-lib-instrument "^5.1.0" + istanbul-lib-report "^3.0.0" + istanbul-lib-source-maps "^4.0.0" + istanbul-reports "^3.1.3" + jest-message-util "^29.5.0" + jest-util "^29.5.0" + jest-worker "^29.5.0" + slash "^3.0.0" + string-length "^4.0.1" + strip-ansi "^6.0.0" + v8-to-istanbul "^9.0.1" + "@jest/schemas@^28.1.3": version "28.1.3" resolved "https://registry.yarnpkg.com/@jest/schemas/-/schemas-28.1.3.tgz#ad8b86a66f11f33619e3d7e1dcddd7f2d40ff905" @@ -1064,6 +1194,13 @@ dependencies: "@sinclair/typebox" "^0.24.1" +"@jest/schemas@^29.4.3": + version "29.4.3" + resolved "https://registry.yarnpkg.com/@jest/schemas/-/schemas-29.4.3.tgz#39cf1b8469afc40b6f5a2baaa146e332c4151788" + integrity sha512-VLYKXQmtmuEz6IxJsrZwzG9NvtkQsWNnWMsKxqWNu3+CnfzJQhp0WDDKWLVV9hLKr0l3SLLFRqcYHjhtyuDVxg== + dependencies: + "@sinclair/typebox" "^0.25.16" + "@jest/source-map@^27.5.1": version "27.5.1" resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-27.5.1.tgz#6608391e465add4205eae073b55e7f279e04e8cf" @@ -1082,6 +1219,15 @@ callsites "^3.0.0" graceful-fs "^4.2.9" +"@jest/source-map@^29.4.3": + version "29.4.3" + resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-29.4.3.tgz#ff8d05cbfff875d4a791ab679b4333df47951d20" + integrity sha512-qyt/mb6rLyd9j1jUts4EQncvS6Yy3PM9HghnNv86QBlV+zdL2inCdK1tuVlL+J+lpiw2BI67qXOrX3UurBqQ1w== + dependencies: + "@jridgewell/trace-mapping" "^0.3.15" + callsites "^3.0.0" + graceful-fs "^4.2.9" + "@jest/test-result@^27.5.1": version "27.5.1" resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-27.5.1.tgz#56a6585fa80f7cdab72b8c5fc2e871d03832f5bb" @@ -1102,6 +1248,16 @@ "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" +"@jest/test-result@^29.5.0": + version "29.5.0" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-29.5.0.tgz#7c856a6ca84f45cc36926a4e9c6b57f1973f1408" + integrity sha512-fGl4rfitnbfLsrfx1uUpDEESS7zM8JdgZgOCQuxQvL1Sn/I6ijeAVQWGfXI9zb1i9Mzo495cIpVZhA0yr60PkQ== + dependencies: + "@jest/console" "^29.5.0" + "@jest/types" "^29.5.0" + "@types/istanbul-lib-coverage" "^2.0.0" + collect-v8-coverage "^1.0.0" + "@jest/test-sequencer@^27.5.1": version "27.5.1" resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-27.5.1.tgz#4057e0e9cea4439e544c6353c6affe58d095745b" @@ -1122,6 +1278,16 @@ jest-haste-map "^28.1.3" slash "^3.0.0" +"@jest/test-sequencer@^29.5.0": + version "29.5.0" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-29.5.0.tgz#34d7d82d3081abd523dbddc038a3ddcb9f6d3cc4" + integrity sha512-yPafQEcKjkSfDXyvtgiV4pevSeyuA6MQr6ZIdVkWJly9vkqjnFfcfhRQqpD5whjoU8EORki752xQmjaqoFjzMQ== + dependencies: + "@jest/test-result" "^29.5.0" + graceful-fs "^4.2.9" + jest-haste-map "^29.5.0" + slash "^3.0.0" + "@jest/transform@^27.5.1": version "27.5.1" resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-27.5.1.tgz#6c3501dcc00c4c08915f292a600ece5ecfe1f409" @@ -1164,6 +1330,27 @@ slash "^3.0.0" write-file-atomic "^4.0.1" +"@jest/transform@^29.5.0": + version "29.5.0" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-29.5.0.tgz#cf9c872d0965f0cbd32f1458aa44a2b1988b00f9" + integrity sha512-8vbeZWqLJOvHaDfeMuoHITGKSz5qWc9u04lnWrQE3VyuSw604PzQM824ZeX9XSjUCeDiE3GuxZe5UKa8J61NQw== + dependencies: + "@babel/core" "^7.11.6" + "@jest/types" "^29.5.0" + "@jridgewell/trace-mapping" "^0.3.15" + babel-plugin-istanbul "^6.1.1" + chalk "^4.0.0" + convert-source-map "^2.0.0" + fast-json-stable-stringify "^2.1.0" + graceful-fs "^4.2.9" + jest-haste-map "^29.5.0" + jest-regex-util "^29.4.3" + jest-util "^29.5.0" + micromatch "^4.0.4" + pirates "^4.0.4" + slash "^3.0.0" + write-file-atomic "^4.0.2" + "@jest/types@^27.5.1": version "27.5.1" resolved "https://registry.yarnpkg.com/@jest/types/-/types-27.5.1.tgz#3c79ec4a8ba61c170bf937bcf9e98a9df175ec80" @@ -1199,6 +1386,18 @@ "@types/yargs" "^17.0.8" chalk "^4.0.0" +"@jest/types@^29.5.0": + version "29.5.0" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.5.0.tgz#f59ef9b031ced83047c67032700d8c807d6e1593" + integrity sha512-qbu7kN6czmVRc3xWFQcAN03RAUamgppVUdXrvl1Wr3jlNF93o9mJbGcDWrwGB6ht44u7efB1qCFgVQmca24Uog== + dependencies: + "@jest/schemas" "^29.4.3" + "@types/istanbul-lib-coverage" "^2.0.0" + "@types/istanbul-reports" "^3.0.0" + "@types/node" "*" + "@types/yargs" "^17.0.8" + chalk "^4.0.0" + "@jridgewell/gen-mapping@^0.1.0": version "0.1.1" resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.1.1.tgz#e5d2e450306a9491e3bd77e323e38d7aff315996" @@ -1216,7 +1415,7 @@ "@jridgewell/sourcemap-codec" "^1.4.10" "@jridgewell/trace-mapping" "^0.3.9" -"@jridgewell/resolve-uri@^3.0.3": +"@jridgewell/resolve-uri@3.1.0", "@jridgewell/resolve-uri@^3.0.3": version "3.1.0" resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz#2203b118c157721addfe69d47b70465463066d78" integrity sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w== @@ -1226,7 +1425,7 @@ resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.1.2.tgz#7c6cf998d6d20b914c0a55a91ae928ff25965e72" integrity sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw== -"@jridgewell/sourcemap-codec@^1.4.10": +"@jridgewell/sourcemap-codec@1.4.14", "@jridgewell/sourcemap-codec@^1.4.10": version "1.4.14" resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz#add4c98d341472a289190b424efbdb096991bb24" integrity sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw== @@ -1247,6 +1446,14 @@ "@jridgewell/resolve-uri" "^3.0.3" "@jridgewell/sourcemap-codec" "^1.4.10" +"@jridgewell/trace-mapping@^0.3.15": + version "0.3.17" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.17.tgz#793041277af9073b0951a7fe0f0d8c4c98c36985" + integrity sha512-MCNzAp77qzKca9+W/+I0+sEpaUnZoeasnghNeVc41VZCEKaCH73Vq3BZZ/SzWIgrqE4H4ceI+p+b6C0mHf9T4g== + dependencies: + "@jridgewell/resolve-uri" "3.1.0" + "@jridgewell/sourcemap-codec" "1.4.14" + "@keplr-wallet/types@^0.10.13": version "0.10.24" resolved "https://registry.yarnpkg.com/@keplr-wallet/types/-/types-0.10.24.tgz#b795f3f45ccad852803c726812625c61ff2b4a29" @@ -1731,6 +1938,11 @@ resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.24.44.tgz#0a0aa3bf4a155a678418527342a3ee84bd8caa5c" integrity sha512-ka0W0KN5i6LfrSocduwliMMpqVgohtPFidKdMEOUjoOFCHcOOYkKsPRxfs5f15oPNHTm6ERAm0GV/+/LTKeiWg== +"@sinclair/typebox@^0.25.16": + version "0.25.24" + resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.25.24.tgz#8c7688559979f7079aacaf31aa881c3aa410b718" + integrity sha512-XJfwUVUKDHF5ugKwIcxEgc9k8b7HbznCp6eUfWgu710hMPNIO4aw4/zB5RogDQz8nd6gyCDpU9O/m6qYEWY6yQ== + "@sinonjs/commons@^1.7.0": version "1.8.3" resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.8.3.tgz#3802ddd21a50a949b6721ddd72da36e67e7f1b2d" @@ -1738,6 +1950,20 @@ dependencies: type-detect "4.0.8" +"@sinonjs/commons@^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-2.0.0.tgz#fd4ca5b063554307e8327b4564bd56d3b73924a3" + integrity sha512-uLa0j859mMrg2slwQYdO/AkrOfmH+X6LTVmNTS9CqexuE2IvVORIkSpJLqePAbEnKJ77aMmCwr1NUZ57120Xcg== + dependencies: + type-detect "4.0.8" + +"@sinonjs/fake-timers@^10.0.2": + version "10.0.2" + resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-10.0.2.tgz#d10549ed1f423d80639c528b6c7f5a1017747d0c" + integrity sha512-SwUDyjWnah1AaNl7kxsa7cfLhlTYoiyhDAIgyh+El30YvXs/o7OLXpYH88Zdhyx9JExKrmHDJ+10bwIcY80Jmw== + dependencies: + "@sinonjs/commons" "^2.0.0" + "@sinonjs/fake-timers@^8.0.1": version "8.1.0" resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-8.1.0.tgz#3fdc2b6cb58935b21bfb8d1625eb1300484316e7" @@ -2164,7 +2390,7 @@ abbrev@1, abbrev@^1.0.0: resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== -accepts@~1.3.4, accepts@~1.3.5: +accepts@~1.3.5: version "1.3.8" resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.8.tgz#0bf0be125b67014adcb0b0921e62db7bffe16b2e" integrity sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw== @@ -2266,7 +2492,7 @@ ansi-colors@^4.1.1: resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.3.tgz#37611340eb2243e70cc604cad35d63270d48781b" integrity sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw== -ansi-escapes@^4.2.1, ansi-escapes@^4.3.0: +ansi-escapes@^4.2.1: version "4.3.2" resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.2.tgz#6b2291d1db7d98b6521d5f1efa42d0f3a9feb65e" integrity sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ== @@ -2307,14 +2533,6 @@ ansi-styles@^5.0.0: resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-5.2.0.tgz#07449690ad45777d1924ac2abb2fc8895dba836b" integrity sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA== -anymatch@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-2.0.0.tgz#bcb24b4f37934d9aa7ac17b4adaf89e7c76ef2eb" - integrity sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw== - dependencies: - micromatch "^3.1.4" - normalize-path "^2.1.1" - anymatch@^3.0.3, anymatch@~3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.2.tgz#c0557c096af32f106198f4f4e2a383537e378716" @@ -2323,18 +2541,6 @@ anymatch@^3.0.3, anymatch@~3.1.2: normalize-path "^3.0.0" picomatch "^2.0.4" -apache-crypt@^1.1.2: - version "1.2.6" - resolved "https://registry.yarnpkg.com/apache-crypt/-/apache-crypt-1.2.6.tgz#c3f9b98318b447f0a878b54e2cb113bbb8539698" - integrity sha512-072WetlM4blL8PREJVeY+WHiUh1R5VNt2HfceGS8aKqttPHcmqE5pkKuXPz/ULmJOFkc8Hw3kfKl6vy7Qka6DA== - dependencies: - unix-crypt-td-js "^1.1.4" - -apache-md5@^1.0.6: - version "1.1.8" - resolved "https://registry.yarnpkg.com/apache-md5/-/apache-md5-1.1.8.tgz#ea79c6feb03abfed42b2830dde06f75df5e3bbd9" - integrity sha512-FCAJojipPn0bXjuEpjOOOMN8FZDkxfWWp4JGN9mifU2IhxvKyXZYqpzPHdnTSUpmPDy+tsslB6Z1g+Vg6nVbYA== - "aproba@^1.0.3 || ^2.0.0", aproba@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/aproba/-/aproba-2.0.0.tgz#52520b8ae5b569215b354efc0caa3fe1e45a8adc" @@ -2375,21 +2581,6 @@ argparse@^2.0.1: resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== -arr-diff@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" - integrity sha512-YVIQ82gZPGBebQV/a8dar4AitzCQs0jjXwMPZllpXMaGjXPYVUawSxQrRsjhjupyVxEvbHgUmIhKVlND+j02kA== - -arr-flatten@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" - integrity sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg== - -arr-union@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" - integrity sha512-sKpyeERZ02v1FeCZT8lrfJq5u6goHCtpTAzPwJYe7c8SPFOboNjNg1vz2L4VTn9T4PQxEx13TbXLmYUcS6Ug7Q== - array-differ@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/array-differ/-/array-differ-3.0.0.tgz#3cbb3d0f316810eafcc47624734237d6aee4ae6b" @@ -2416,11 +2607,6 @@ array-union@^2.1.0: resolved "https://registry.yarnpkg.com/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d" integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw== -array-unique@^0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" - integrity sha512-SleRWjh9JUud2wH1hPs9rZBZ33H6T9HOiL0uwGnGx9FpE6wKGyfWugmbkEOIs6qWrZhg0LWeLziLrEwQJhs5mQ== - array.prototype.flat@^1.2.5: version "1.3.0" resolved "https://registry.yarnpkg.com/array.prototype.flat/-/array.prototype.flat-1.3.0.tgz#0b0c1567bf57b38b56b4c97b8aa72ab45e4adc7b" @@ -2446,21 +2632,11 @@ asap@^2.0.0: resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46" integrity sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA== -assign-symbols@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" - integrity sha512-Q+JC7Whu8HhmTdBph/Tq59IoRtoy6KAm5zzPv00WdujX82lbAL8K7WVjne7vdCsAmbF4AYaDOPyO3k0kl8qIrw== - astral-regex@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-2.0.0.tgz#483143c567aeed4785759c0865786dc77d7d2e31" integrity sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ== -async-each@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.3.tgz#b727dbf87d7651602f06f4d4ac387f47d91b0cbf" - integrity sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ== - async@^3.2.3: version "3.2.4" resolved "https://registry.yarnpkg.com/async/-/async-3.2.4.tgz#2d22e00f8cddeb5fde5dd33522b56d1cf569a81c" @@ -2476,11 +2652,6 @@ at-least-node@^1.0.0: resolved "https://registry.yarnpkg.com/at-least-node/-/at-least-node-1.0.0.tgz#602cd4b46e844ad4effc92a8011a3c46e0238dc2" integrity sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg== -atob@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" - integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg== - axios@0.21.1: version "0.21.1" resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.1.tgz#22563481962f4d6bde9a76d516ef0e5d3c09b2b8" @@ -2539,6 +2710,19 @@ babel-jest@^28.1.3: graceful-fs "^4.2.9" slash "^3.0.0" +babel-jest@^29.5.0: + version "29.5.0" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.5.0.tgz#3fe3ddb109198e78b1c88f9ebdecd5e4fc2f50a5" + integrity sha512-mA4eCDh5mSo2EcA9xQjVTpmbbNk32Zb3Q3QFQsNhaK56Q+yoXowzFodLux30HRgyOho5rsQ6B0P9QpMkvvnJ0Q== + dependencies: + "@jest/transform" "^29.5.0" + "@types/babel__core" "^7.1.14" + babel-plugin-istanbul "^6.1.1" + babel-preset-jest "^29.5.0" + chalk "^4.0.0" + graceful-fs "^4.2.9" + slash "^3.0.0" + babel-plugin-istanbul@^6.1.1: version "6.1.1" resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz#fa88ec59232fd9b4e36dbbc540a8ec9a9b47da73" @@ -2570,6 +2754,16 @@ babel-plugin-jest-hoist@^28.1.3: "@types/babel__core" "^7.1.14" "@types/babel__traverse" "^7.0.6" +babel-plugin-jest-hoist@^29.5.0: + version "29.5.0" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.5.0.tgz#a97db437936f441ec196990c9738d4b88538618a" + integrity sha512-zSuuuAlTMT4mzLj2nPnUm6fsE6270vdOfnpbJ+RmruU75UhLFvL0N2NgI7xpeS7NaB6hGqmd5pVpGTDYvi4Q3w== + dependencies: + "@babel/template" "^7.3.3" + "@babel/types" "^7.3.3" + "@types/babel__core" "^7.1.14" + "@types/babel__traverse" "^7.0.6" + babel-preset-current-node-syntax@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.1.tgz#b4399239b89b2a011f9ddbe3e4f401fc40cff73b" @@ -2604,6 +2798,14 @@ babel-preset-jest@^28.1.3: babel-plugin-jest-hoist "^28.1.3" babel-preset-current-node-syntax "^1.0.0" +babel-preset-jest@^29.5.0: + version "29.5.0" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-29.5.0.tgz#57bc8cc88097af7ff6a5ab59d1cd29d52a5916e2" + integrity sha512-JOMloxOqdiBSxMAzjRaH023/vvcaSaec49zvg+2LmNsktC7ei39LTJGw02J+9uUtTZUq6xbLyJ4dxe9sSmIuAg== + dependencies: + babel-plugin-jest-hoist "^29.5.0" + babel-preset-current-node-syntax "^1.0.0" + balanced-match@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" @@ -2614,36 +2816,6 @@ base64-js@^1.0.2, base64-js@^1.3.0, base64-js@^1.3.1: resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== -base@^0.11.1: - version "0.11.2" - resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f" - integrity sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg== - dependencies: - cache-base "^1.0.1" - class-utils "^0.3.5" - component-emitter "^1.2.1" - define-property "^1.0.0" - isobject "^3.0.1" - mixin-deep "^1.2.0" - pascalcase "^0.1.1" - -basic-auth@~2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/basic-auth/-/basic-auth-2.0.1.tgz#b998279bf47ce38344b4f3cf916d4679bbf51e3a" - integrity sha512-NF+epuEdnUYVlGuhaxbbq+dvJttwLnGY+YixlXlME5KpQ5W3CnXA5cVTneY3SPbPDRkcjMbifrwmFYcClgOZeg== - dependencies: - safe-buffer "5.1.2" - -batch@0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/batch/-/batch-0.6.1.tgz#dc34314f4e679318093fc760272525f94bf25c16" - integrity sha512-x+VAiMRL6UPkx+kudNvxTl6hB2XNNCG2r+7wixVfIYwu/2HKRXimwQyaumLjMveWvT2Hkd/cAJw+QBMfJ/EKVw== - -bcryptjs@^2.3.0: - version "2.4.3" - resolved "https://registry.yarnpkg.com/bcryptjs/-/bcryptjs-2.4.3.tgz#9ab5627b93e60621ff7cdac5da9733027df1d0cb" - integrity sha512-V/Hy/X9Vt7f3BbPJEi8BdVFMByHi+jNXrYkW3huaybV/kQ0KJg0Y6PkEMbn+zeT+i+SiKZ/HMqJGIIt4LZDqNQ== - bech32@^1.1.3, bech32@^1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/bech32/-/bech32-1.1.4.tgz#e38c9f37bf179b8eb16ae3a772b40c356d4832e9" @@ -2666,23 +2838,11 @@ bin-links@^3.0.0: rimraf "^3.0.0" write-file-atomic "^4.0.0" -binary-extensions@^1.0.0: - version "1.13.1" - resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.13.1.tgz#598afe54755b2868a5330d2aff9d4ebb53209b65" - integrity sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw== - binary-extensions@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d" integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== -bindings@^1.5.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.5.0.tgz#10353c9e945334bc0511a6d90b38fbc7c9c504df" - integrity sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ== - dependencies: - file-uri-to-path "1.0.0" - bip39@^3.0.2: version "3.0.4" resolved "https://registry.yarnpkg.com/bip39/-/bip39-3.0.4.tgz#5b11fed966840b5e1b8539f0f54ab6392969b2a0" @@ -2740,22 +2900,6 @@ brace-expansion@^2.0.1: dependencies: balanced-match "^1.0.0" -braces@^2.3.1, braces@^2.3.2: - version "2.3.2" - resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729" - integrity sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w== - dependencies: - arr-flatten "^1.1.0" - array-unique "^0.3.2" - extend-shallow "^2.0.1" - fill-range "^4.0.0" - isobject "^3.0.1" - repeat-element "^1.1.2" - snapdragon "^0.8.1" - snapdragon-node "^2.0.1" - split-string "^3.0.2" - to-regex "^3.0.1" - braces@^3.0.2, braces@~3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" @@ -2872,21 +3016,6 @@ cacache@^16.0.0, cacache@^16.0.6, cacache@^16.1.0: tar "^6.1.11" unique-filename "^2.0.0" -cache-base@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2" - integrity sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ== - dependencies: - collection-visit "^1.0.0" - component-emitter "^1.2.1" - get-value "^2.0.6" - has-value "^1.0.0" - isobject "^3.0.1" - set-value "^2.0.0" - to-object-path "^0.3.0" - union-value "^1.0.0" - unset-value "^1.0.0" - cachedir@2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/cachedir/-/cachedir-2.3.0.tgz#0c75892a052198f0b21c7c1804d8331edfcae0e8" @@ -2998,25 +3127,6 @@ charenc@~0.0.1: resolved "https://registry.yarnpkg.com/charenc/-/charenc-0.0.2.tgz#c0a1d2f3a7092e03774bfa83f14c0fc5790a8667" integrity sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA== -chokidar@^2.0.4: - version "2.1.8" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.1.8.tgz#804b3a7b6a99358c3c5c61e71d8728f041cff917" - integrity sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg== - dependencies: - anymatch "^2.0.0" - async-each "^1.0.1" - braces "^2.3.2" - glob-parent "^3.1.0" - inherits "^2.0.3" - is-binary-path "^1.0.0" - is-glob "^4.0.0" - normalize-path "^3.0.0" - path-is-absolute "^1.0.0" - readdirp "^2.2.1" - upath "^1.1.1" - optionalDependencies: - fsevents "^1.2.7" - chokidar@^3.5.1: version "3.5.3" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd" @@ -3060,16 +3170,6 @@ cjs-module-lexer@^1.0.0: resolved "https://registry.yarnpkg.com/cjs-module-lexer/-/cjs-module-lexer-1.2.2.tgz#9f84ba3244a512f3a54e5277e8eef4c489864e40" integrity sha512-cOU9usZw8/dXIXKtwa8pM0OTJQuJkxMN6w30csNRUerHfeQ5R6U3kkU/FtJeIf3M202OHfY2U8ccInBG7/xogA== -class-utils@^0.3.5: - version "0.3.6" - resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" - integrity sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg== - dependencies: - arr-union "^3.1.0" - define-property "^0.2.5" - isobject "^3.0.0" - static-extend "^0.1.1" - clean-stack@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-2.2.0.tgz#ee8472dbb129e727b31e8a10a427dee9dfe4008b" @@ -3097,14 +3197,6 @@ cli-spinners@^2.5.0: resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-2.7.0.tgz#f815fd30b5f9eaac02db604c7a231ed7cb2f797a" integrity sha512-qu3pN8Y3qHNgE2AFweciB1IfMnmZ/fsNTEE+NOFjmGB2F/7rLhnhzppvpCnN4FovtP26k8lHyy9ptEbNwWFLzw== -cli-truncate@2.1.0, cli-truncate@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/cli-truncate/-/cli-truncate-2.1.0.tgz#c39e28bf05edcde5be3b98992a22deed5a2b93c7" - integrity sha512-n8fOixwDD6b/ObinzTrp1ZKFzbgvKZvuz/TvejnLn1aQfC6r52XEx85FmuC+3HI+JM7coBRXUvNqEU2PHVrHpg== - dependencies: - slice-ansi "^3.0.0" - string-width "^4.2.0" - cli-width@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-3.0.0.tgz#a2f48437a2caa9a22436e794bf071ec9e61cedf6" @@ -3168,14 +3260,6 @@ collect-v8-coverage@^1.0.0: resolved "https://registry.yarnpkg.com/collect-v8-coverage/-/collect-v8-coverage-1.0.1.tgz#cc2c8e94fc18bbdffe64d6534570c8a673b27f59" integrity sha512-iBPtljfCNcTKNAto0KEtDfZ3qzjJvqE3aTGZsbhjSBlorqpXJlaWWtPO35D+ZImoC3KWejX64o+yPGxhWSTzfg== -collection-visit@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" - integrity sha512-lNkKvzEeMBBjUGHZ+q6z9pSJla0KWAQPvtzhEV9+iGyQYG+pBpl7xKDhxoNSOZH2hhv0v5k0y2yAM4o4SjoSkw== - dependencies: - map-visit "^1.0.0" - object-visit "^1.0.0" - color-convert@^1.9.0: version "1.9.3" resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" @@ -3205,21 +3289,6 @@ color-support@^1.1.3: resolved "https://registry.yarnpkg.com/color-support/-/color-support-1.1.3.tgz#93834379a1cc9a0c61f82f52f0d04322251bd5a2" integrity sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg== -colorette@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/colorette/-/colorette-1.4.0.tgz#5190fbb87276259a86ad700bff2c6d6faa3fca40" - integrity sha512-Y2oEozpomLn7Q3HFP7dpww7AtMJplbM9lGZP6RDfHqmbeRjiwRg4n6VM6j4KLmRke85uWEI7JqF17f3pqdRA0g== - -colorette@^2.0.16: - version "2.0.19" - resolved "https://registry.yarnpkg.com/colorette/-/colorette-2.0.19.tgz#cdf044f47ad41a0f4b56b3a0d5b4e6e1a2d5a798" - integrity sha512-3tlv/dIP7FWvj3BsbHrGLJ6l/oKh1O3TcgBqMn+yyCagOxc23fyzDS6HypQbgxWbkpDnf52p1LuR4eWDQ/K9WQ== - -colors@1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/colors/-/colors-1.4.0.tgz#c50491479d4c1bdaed2c9ced32cf7c7dc2360f78" - integrity sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA== - columnify@1.6.0: version "1.6.0" resolved "https://registry.yarnpkg.com/columnify/-/columnify-1.6.0.tgz#6989531713c9008bb29735e61e37acf5bd553cf3" @@ -3235,11 +3304,6 @@ combined-stream@^1.0.8: dependencies: delayed-stream "~1.0.0" -commander@^8.2.0: - version "8.3.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-8.3.0.tgz#4837ea1b2da67b9c616a67afbb0fafee567bca66" - integrity sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww== - commander@~8.0.0: version "8.0.0" resolved "https://registry.yarnpkg.com/commander/-/commander-8.0.0.tgz#1da2139548caef59bd23e66d18908dfb54b02258" @@ -3278,11 +3342,6 @@ compare-func@^2.0.0: array-ify "^1.0.0" dot-prop "^5.1.0" -component-emitter@^1.2.1: - version "1.3.0" - resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0" - integrity sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg== - compressible@~2.0.14: version "2.0.18" resolved "https://registry.yarnpkg.com/compressible/-/compressible-2.0.18.tgz#af53cca6b070d4c3c0750fbd77286a6d7cc46fba" @@ -3331,16 +3390,6 @@ confusing-browser-globals@^1.0.10: resolved "https://registry.yarnpkg.com/confusing-browser-globals/-/confusing-browser-globals-1.0.11.tgz#ae40e9b57cdd3915408a2805ebd3a5585608dc81" integrity sha512-JsPKdmh8ZkmnHxDk55FZ1TqVLvEQTvoByJZRN9jzI0UjxK/QgAmsphz7PGtqgPieQZ/CQcHWXCR7ATDNhGe+YA== -connect@^3.6.6: - version "3.7.0" - resolved "https://registry.yarnpkg.com/connect/-/connect-3.7.0.tgz#5d49348910caa5e07a01800b030d0c35f20484f8" - integrity sha512-ZqRXc+tZukToSNmh5C2iWMSoV3X1YUcPbqEM4DkEG5tNQXrQUZCNVGGv3IuicnkMtPfGf3Xtp8WCXs295iQ1pQ== - dependencies: - debug "2.6.9" - finalhandler "1.1.2" - parseurl "~1.3.3" - utils-merge "1.0.1" - console-control-strings@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" @@ -3462,24 +3511,16 @@ convert-source-map@^1.4.0, convert-source-map@^1.6.0, convert-source-map@^1.7.0: dependencies: safe-buffer "~5.1.1" -copy-descriptor@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" - integrity sha512-XgZ0pFcakEUlbwQEVNg3+QAis1FyTL3Qel9FYy8pSkQqoG3PNoT0bOCQtOXcOkur21r2Eq2kI+IE+gsmAEVlYw== +convert-source-map@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-2.0.0.tgz#4b560f649fc4e918dd0ab75cf4961e8bc882d82a" + integrity sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg== core-util-is@~1.0.0: version "1.0.3" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.3.tgz#a6042d3634c2b27e9328f837b965fac83808db85" integrity sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ== -cors@latest: - version "2.8.5" - resolved "https://registry.yarnpkg.com/cors/-/cors-2.8.5.tgz#eac11da51592dd86b9f06f6e7ac293b3df875d29" - integrity sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g== - dependencies: - object-assign "^4" - vary "^1" - cosmiconfig-typescript-loader@^4.0.0: version "4.1.1" resolved "https://registry.yarnpkg.com/cosmiconfig-typescript-loader/-/cosmiconfig-typescript-loader-4.1.1.tgz#38dd3578344038dae40fdf09792bc2e9df529f78" @@ -3496,7 +3537,7 @@ cosmiconfig@7.0.0: path-type "^4.0.0" yaml "^1.10.0" -cosmiconfig@^7.0.0, cosmiconfig@^7.0.1: +cosmiconfig@^7.0.0: version "7.0.1" resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-7.0.1.tgz#714d756522cace867867ccb4474c5d01bbae5d6d" integrity sha512-a1YWNUV2HwGimB7dU2s1wUMurNKjpx60HxBB6xUM8Re+2s1g1IIfJvFR0/iCF+XHdE0GMTKTuLR32UQff4TEyQ== @@ -3659,14 +3700,14 @@ dateformat@^3.0.0: resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-3.0.3.tgz#a6e37499a4d9a9cf85ef5872044d62901c9889ae" integrity sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q== -debug@2.6.9, debug@^2.2.0, debug@^2.3.3, debug@^2.6.9: +debug@2.6.9, debug@^2.6.9: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== dependencies: ms "2.0.0" -debug@4, debug@^4.0.0, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.3, debug@^4.3.4: +debug@4, debug@^4.0.0, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.3, debug@^4.3.4: version "4.3.4" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== @@ -3703,11 +3744,6 @@ decimal.js@^10.2.1: resolved "https://registry.yarnpkg.com/decimal.js/-/decimal.js-10.4.1.tgz#be75eeac4a2281aace80c1a8753587c27ef053e7" integrity sha512-F29o+vci4DodHYT9UrR5IEbfBw9pE5eSapIJdTqXK5+6hq+t8VRxwQyKlW2i+KDKFkkJQRvFyI/QXD83h8LyQw== -decode-uri-component@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" - integrity sha512-hjf+xovcEn31w/EUYdTXQh/8smFL/dzYjohQGEIgjyNavaJfBY2p5F527Bo1VPATxv0VYTUC2bOcXvqFwk78Og== - dedent@0.7.0, dedent@^0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/dedent/-/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c" @@ -3748,28 +3784,6 @@ define-properties@^1.1.3, define-properties@^1.1.4: has-property-descriptors "^1.0.0" object-keys "^1.1.1" -define-property@^0.2.5: - version "0.2.5" - resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" - integrity sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA== - dependencies: - is-descriptor "^0.1.0" - -define-property@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/define-property/-/define-property-1.0.0.tgz#769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6" - integrity sha512-cZTYKFWspt9jZsMscWo8sc/5lbPC9Q0N5nBLgb+Yd915iL3udB1uFgS3B8YCx66UVHq018DAVFoee7x+gxggeA== - dependencies: - is-descriptor "^1.0.0" - -define-property@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/define-property/-/define-property-2.0.2.tgz#d459689e8d654ba77e02a817f8710d702cb16e9d" - integrity sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ== - dependencies: - is-descriptor "^1.0.2" - isobject "^3.0.1" - delayed-stream@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" @@ -3780,26 +3794,16 @@ delegates@^1.0.0: resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" integrity sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ== -depd@2.0.0, depd@^2.0.0, depd@~2.0.0: +depd@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/depd/-/depd-2.0.0.tgz#b696163cc757560d09cf22cc8fad1571b79e76df" integrity sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw== -depd@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" - integrity sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ== - deprecation@^2.0.0, deprecation@^2.3.1: version "2.3.1" resolved "https://registry.yarnpkg.com/deprecation/-/deprecation-2.3.1.tgz#6368cbdb40abf3373b525ac87e4a260c3a700919" integrity sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ== -destroy@1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.2.0.tgz#4803735509ad8be552934c67df614f94e66fa015" - integrity sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg== - detect-file@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/detect-file/-/detect-file-1.0.0.tgz#f0d66d03672a825cb1b73bdb3fe62310c8e552b7" @@ -3815,11 +3819,6 @@ detect-indent@^5.0.0: resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-5.0.0.tgz#3871cc0a6a002e8c3e5b3cf7f336264675f06b9d" integrity sha512-rlpvsxUtM0PQvy9iZe640/IWwWYyBsTApREbA1pHOpmOUIl9MkP/U4z7vTtg4Oaojvqhxt7sdufnT0EzGaR31g== -detect-libc@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" - integrity sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg== - detect-newline@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-3.1.0.tgz#576f5dfc63ae1a192ff192d8ad3af6308991b651" @@ -3848,6 +3847,11 @@ diff-sequences@^29.0.0: resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-29.0.0.tgz#bae49972ef3933556bcb0800b72e8579d19d9e4f" integrity sha512-7Qe/zd1wxSDL4D/X/FPjOMB+ZMDt71W94KYaq05I2l0oQqgXgs7s4ftYYmV38gBSrPz2vcygxfs1xn0FT+rKNA== +diff-sequences@^29.4.3: + version "29.4.3" + resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-29.4.3.tgz#9314bc1fabe09267ffeca9cbafc457d8499a13f2" + integrity sha512-ofrBgwpPhCD85kMKtE9RYFFq6OC1A89oW2vvgWZNCwxrUpRUILopY7lsYyMDSjc8g6U6aiO0Qubg6r4Wgt5ZnA== + diff@^4.0.1: version "4.0.2" resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" @@ -3895,24 +3899,12 @@ dot-prop@^5.1.0: dependencies: is-obj "^2.0.0" -dotenv@^16.0.2: - version "16.0.3" - resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.0.3.tgz#115aec42bac5053db3c456db30cc243a5a836a07" - integrity sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ== - dotenv@~10.0.0: version "10.0.0" resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-10.0.0.tgz#3d4227b8fb95f81096cdd2b66653fb2c7085ba81" integrity sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q== -dprint-node@^1.0.7: - version "1.0.7" - resolved "https://registry.yarnpkg.com/dprint-node/-/dprint-node-1.0.7.tgz#f571eaf61affb3a696cff1bdde78a021875ba540" - integrity sha512-NTZOW9A7ipb0n7z7nC3wftvsbceircwVHSgzobJsEQa+7RnOMbhrfX5IflA6CtC4GA63DSAiHYXa4JKEy9F7cA== - dependencies: - detect-libc "^1.0.3" - -duplexer@^0.1.1, duplexer@~0.1.1: +duplexer@^0.1.1: version "0.1.2" resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.2.tgz#3abe43aef3835f8ae077d136ddce0f276b0400e6" integrity sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg== @@ -3924,11 +3916,6 @@ dynamic-dedupe@^0.3.0: dependencies: xtend "^4.0.0" -ee-first@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" - integrity sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow== - ejs@^3.1.7: version "3.1.8" resolved "https://registry.yarnpkg.com/ejs/-/ejs-3.1.8.tgz#758d32910c78047585c7ef1f92f9ee041c1c190b" @@ -3959,6 +3946,11 @@ emittery@^0.10.2: resolved "https://registry.yarnpkg.com/emittery/-/emittery-0.10.2.tgz#902eec8aedb8c41938c46e9385e9db7e03182933" integrity sha512-aITqOwnLanpHLNXZJENbOgjUBeHocD+xsSJmNrjovKBW5HbSpW3d1pEls7GFQPUWXiwG9+0P4GtHfEqC/4M0Iw== +emittery@^0.13.1: + version "0.13.1" + resolved "https://registry.yarnpkg.com/emittery/-/emittery-0.13.1.tgz#c04b8c3457490e0847ae51fced3af52d338e3dad" + integrity sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ== + emittery@^0.8.1: version "0.8.1" resolved "https://registry.yarnpkg.com/emittery/-/emittery-0.8.1.tgz#bb23cc86d03b30aa75a7f734819dee2e1ba70860" @@ -3969,11 +3961,6 @@ emoji-regex@^8.0.0: resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== -encodeurl@~1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" - integrity sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w== - encoding@^0.1.13: version "0.1.13" resolved "https://registry.yarnpkg.com/encoding/-/encoding-0.1.13.tgz#56574afdd791f54a8e9b2785c0582a2d26210fa9" @@ -3988,7 +3975,7 @@ end-of-stream@^1.1.0, end-of-stream@^1.4.1: dependencies: once "^1.4.0" -enquirer@^2.3.5, enquirer@^2.3.6, enquirer@~2.3.6: +enquirer@^2.3.5, enquirer@~2.3.6: version "2.3.6" resolved "https://registry.yarnpkg.com/enquirer/-/enquirer-2.3.6.tgz#2a7fe5dd634a1e4125a975ec994ff5456dc3734d" integrity sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg== @@ -4073,11 +4060,6 @@ escalade@^3.1.1: resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== -escape-html@~1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" - integrity sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow== - escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" @@ -4337,24 +4319,6 @@ esutils@^2.0.2: resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== -etag@~1.8.1: - version "1.8.1" - resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" - integrity sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg== - -event-stream@3.3.4: - version "3.3.4" - resolved "https://registry.yarnpkg.com/event-stream/-/event-stream-3.3.4.tgz#4ab4c9a0f5a54db9338b4c34d86bfce8f4b35571" - integrity sha512-QHpkERcGsR0T7Qm3HNJSyXKEEj8AHNxkY3PK8TS2KJvQ7NiSHe3DDpwVKKtoYprL/AreyzFBeIkBIWChAqn60g== - dependencies: - duplexer "~0.1.1" - from "~0" - map-stream "~0.1.0" - pause-stream "0.0.11" - split "0.3" - stream-combiner "~0.0.4" - through "~2.3.1" - eventemitter3@^4.0.4: version "4.0.7" resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.7.tgz#2de9b68f6528d5644ef5c59526a1b4a07306169f" @@ -4401,7 +4365,7 @@ execa@^1.0.0: signal-exit "^3.0.0" strip-eof "^1.0.0" -execa@^5.0.0, execa@^5.1.1: +execa@^5.0.0: version "5.1.1" resolved "https://registry.yarnpkg.com/execa/-/execa-5.1.1.tgz#f80ad9cbf4298f7bd1d4c9555c21e93741c411dd" integrity sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg== @@ -4421,19 +4385,6 @@ exit@^0.1.2: resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" integrity sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ== -expand-brackets@^2.1.4: - version "2.1.4" - resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622" - integrity sha512-w/ozOKR9Obk3qoWeY/WDi6MFta9AoMR+zud60mdnbniMcBxRuFJyDt2LdX/14A1UABeqk+Uk+LDfUpvoGKppZA== - dependencies: - debug "^2.3.3" - define-property "^0.2.5" - extend-shallow "^2.0.1" - posix-character-classes "^0.1.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - expand-tilde@^2.0.0, expand-tilde@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/expand-tilde/-/expand-tilde-2.0.2.tgz#97e801aa052df02454de46b02bf621642cdc8502" @@ -4473,20 +4424,16 @@ expect@^29.0.0: jest-message-util "^29.1.2" jest-util "^29.1.2" -extend-shallow@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" - integrity sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug== - dependencies: - is-extendable "^0.1.0" - -extend-shallow@^3.0.0, extend-shallow@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8" - integrity sha512-BwY5b5Ql4+qZoefgMj2NUmx+tehVTH/Kf4k1ZEtOHNFcm2wSxMRo992l6X3TIgni2eZVTZ85xMOjF31fwZAj6Q== +expect@^29.5.0: + version "29.5.0" + resolved "https://registry.yarnpkg.com/expect/-/expect-29.5.0.tgz#68c0509156cb2a0adb8865d413b137eeaae682f7" + integrity sha512-yM7xqUrCO2JdpFo4XpM82t+PJBFybdqoQuJLDGeDX2ij8NZzqRHyu3Hp188/JX7SWqud+7t4MUdvcgGBICMHZg== dependencies: - assign-symbols "^1.0.0" - is-extendable "^1.0.1" + "@jest/expect-utils" "^29.5.0" + jest-get-type "^29.4.3" + jest-matcher-utils "^29.5.0" + jest-message-util "^29.5.0" + jest-util "^29.5.0" external-editor@^3.0.3: version "3.1.0" @@ -4497,20 +4444,6 @@ external-editor@^3.0.3: iconv-lite "^0.4.24" tmp "^0.0.33" -extglob@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" - integrity sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw== - dependencies: - array-unique "^0.3.2" - define-property "^1.0.0" - expand-brackets "^2.1.4" - extend-shallow "^2.0.1" - fragment-cache "^0.2.1" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - fast-deep-equal@3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz#545145077c501491e33b15ec408c294376e94ae4" @@ -4548,7 +4481,7 @@ fast-glob@^3.2.9: merge2 "^1.3.0" micromatch "^4.0.4" -fast-json-stable-stringify@2.x, fast-json-stable-stringify@^2.0.0: +fast-json-stable-stringify@2.x, fast-json-stable-stringify@^2.0.0, fast-json-stable-stringify@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== @@ -4572,13 +4505,6 @@ fastq@^1.6.0: dependencies: reusify "^1.0.4" -faye-websocket@0.11.x: - version "0.11.4" - resolved "https://registry.yarnpkg.com/faye-websocket/-/faye-websocket-0.11.4.tgz#7f0d9275cfdd86a1c963dc8b65fcc451edcbb1da" - integrity sha512-CzbClwlXAuiRQAlUyfqPgvPoNKTckTPGfwZV4ZdAhVcP2lh9KUxJg2b5GkE7XbjKQ3YJnQ9z6D9ntLAlB+tP8g== - dependencies: - websocket-driver ">=0.5.1" - fb-watchman@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-2.0.2.tgz#e9524ee6b5c77e9e5001af0f85f3adbb8623255c" @@ -4600,11 +4526,6 @@ file-entry-cache@^6.0.1: dependencies: flat-cache "^3.0.4" -file-uri-to-path@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz#553a7b8446ff6f684359c445f1e37a05dacc33dd" - integrity sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw== - filelist@^1.0.1: version "1.0.4" resolved "https://registry.yarnpkg.com/filelist/-/filelist-1.0.4.tgz#f78978a1e944775ff9e62e744424f215e58352b5" @@ -4612,16 +4533,6 @@ filelist@^1.0.1: dependencies: minimatch "^5.0.1" -fill-range@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" - integrity sha512-VcpLTWqWDiTerugjj8e3+esbg+skS3M9e54UuR3iCeIDMXCLTsAH8hTSzDQU/X6/6t3eYkOKoZSef2PlU6U1XQ== - dependencies: - extend-shallow "^2.0.1" - is-number "^3.0.0" - repeat-string "^1.6.1" - to-regex-range "^2.1.0" - fill-range@^7.0.1: version "7.0.1" resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" @@ -4629,19 +4540,6 @@ fill-range@^7.0.1: dependencies: to-regex-range "^5.0.1" -finalhandler@1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.1.2.tgz#b7e7d000ffd11938d0fdb053506f6ebabe9f587d" - integrity sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA== - dependencies: - debug "2.6.9" - encodeurl "~1.0.2" - escape-html "~1.0.3" - on-finished "~2.3.0" - parseurl "~1.3.3" - statuses "~1.5.0" - unpipe "~1.0.0" - find-node-modules@^2.1.2: version "2.1.3" resolved "https://registry.yarnpkg.com/find-node-modules/-/find-node-modules-2.1.3.tgz#3c976cff2ca29ee94b4f9eafc613987fc4c0ee44" @@ -4711,11 +4609,6 @@ follow-redirects@^1.10.0, follow-redirects@^1.14.0, follow-redirects@^1.14.9, fo resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.2.tgz#b460864144ba63f2681096f274c4e57026da2c13" integrity sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA== -for-in@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" - integrity sha512-7EwmXrOjyL+ChxMhmG5lnW9MPt1aIeZEwKhQzoBUdTV0N3zuwWDZYVJatDvZ2OyzPUvdIAZDsCetk3coyMfcnQ== - form-data@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/form-data/-/form-data-3.0.1.tgz#ebd53791b78356a99af9a300d4282c4d5eb9755f" @@ -4734,23 +4627,6 @@ form-data@^4.0.0: combined-stream "^1.0.8" mime-types "^2.1.12" -fragment-cache@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19" - integrity sha512-GMBAbW9antB8iZRHLoGw0b3HANt57diZYFO/HL1JGIC1MjKrdmhxvrJbupnVvpys0zsz7yBApXdQyfepKly2kA== - dependencies: - map-cache "^0.2.2" - -fresh@0.5.2: - version "0.5.2" - resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" - integrity sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q== - -from@~0: - version "0.1.7" - resolved "https://registry.yarnpkg.com/from/-/from-0.1.7.tgz#83c60afc58b9c56997007ed1a768b3ab303a44fe" - integrity sha512-twe20eF1OxVxp/ML/kq2p1uc6KvFK/+vs8WjEbeKmV2He22MKm7YF2ANIt+EOqhJ5L3K/SuuPhk0hWQDjOM23g== - fs-constants@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs-constants/-/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad" @@ -4796,14 +4672,6 @@ fs.realpath@^1.0.0: resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== -fsevents@^1.2.7: - version "1.2.13" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.13.tgz#f325cb0455592428bcf11b383370ef70e3bfcc38" - integrity sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw== - dependencies: - bindings "^1.5.0" - nan "^2.12.1" - fsevents@^2.3.2, fsevents@~2.3.2: version "2.3.2" resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" @@ -4867,11 +4735,6 @@ get-intrinsic@^1.0.2, get-intrinsic@^1.1.0, get-intrinsic@^1.1.1, get-intrinsic@ has "^1.0.3" has-symbols "^1.0.3" -get-own-enumerable-property-symbols@^3.0.0: - version "3.0.2" - resolved "https://registry.yarnpkg.com/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-3.0.2.tgz#b5fde77f22cbe35f390b4e089922c50bce6ef664" - integrity sha512-I0UBV/XOz1XkIJHEUDMZAbzCThU/H8DxmSfmdGcKPnVhu2VfFqr34jr9777IyaTYvxjedWhqVIilEDsCdP5G6g== - get-package-type@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/get-package-type/-/get-package-type-0.1.0.tgz#8de2d803cff44df3bc6c456e6668b36c3926e11a" @@ -4927,11 +4790,6 @@ get-symbol-description@^1.0.0: call-bind "^1.0.2" get-intrinsic "^1.1.1" -get-value@^2.0.3, get-value@^2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" - integrity sha512-Ln0UQDlxH1BapMu3GPtf7CuYNwRZf2gwCuPqbyG6pB8WfmFpzqcy4xtAaAMUhnNqjMKTiCPZG2oMT3YSx8U2NA== - git-raw-commits@^2.0.0, git-raw-commits@^2.0.8: version "2.0.11" resolved "https://registry.yarnpkg.com/git-raw-commits/-/git-raw-commits-2.0.11.tgz#bc3576638071d18655e1cc60d7f524920008d723" @@ -4988,14 +4846,6 @@ glob-parent@5.1.2, glob-parent@^5.1.2, glob-parent@~5.1.2: dependencies: is-glob "^4.0.1" -glob-parent@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-3.1.0.tgz#9e6af6299d8d3bd2bd40430832bd113df906c5ae" - integrity sha512-E8Ak/2+dZY6fnzlR7+ueWvhsH1SjHr4jjss4YS/h4py44jY9MhK/VFdaZJAWDz6BbL21KeteKxFSFpq8OS5gVA== - dependencies: - is-glob "^3.1.0" - path-dirname "^1.0.0" - glob@7.1.4: version "7.1.4" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.4.tgz#aa608a2f6c577ad357e1ae5a5c26d9a8d1969255" @@ -5162,41 +5012,10 @@ has-unicode@2.0.1, has-unicode@^2.0.1: resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" integrity sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ== -has-value@^0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" - integrity sha512-gpG936j8/MzaeID5Yif+577c17TxaDmhuyVgSwtnL/q8UUTySg8Mecb+8Cf1otgLoD7DDH75axp86ER7LFsf3Q== - dependencies: - get-value "^2.0.3" - has-values "^0.1.4" - isobject "^2.0.0" - -has-value@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-value/-/has-value-1.0.0.tgz#18b281da585b1c5c51def24c930ed29a0be6b177" - integrity sha512-IBXk4GTsLYdQ7Rvt+GRBrFSVEkmuOUy4re0Xjd9kJSUQpnTrWR4/y9RpfexN9vkAPMFuQoeWKwqzPozRTlasGw== - dependencies: - get-value "^2.0.6" - has-values "^1.0.0" - isobject "^3.0.0" - -has-values@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771" - integrity sha512-J8S0cEdWuQbqD9//tlZxiMuMNmxB8PlEwvYwuxsTmR1G5RXUePEX/SJn7aD0GMLieuZYSwNH0cQuJGwnYunXRQ== - -has-values@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-values/-/has-values-1.0.0.tgz#95b0b63fec2146619a6fe57fe75628d5a39efe4f" - integrity sha512-ODYZC64uqzmtfGMEAX/FvZiRyWLpAC3vYnNunURUnkGVTS+mI0smVsWaPydRBsE3g+ok7h960jChO8mFcWlHaQ== - dependencies: - is-number "^3.0.0" - kind-of "^4.0.0" - -has@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" - integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== +has@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" + integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== dependencies: function-bind "^1.1.1" @@ -5271,47 +5090,11 @@ html-escaper@^2.0.0: resolved "https://registry.yarnpkg.com/html-escaper/-/html-escaper-2.0.2.tgz#dfd60027da36a36dfcbe236262c00a5822681453" integrity sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg== -http-auth@3.1.x: - version "3.1.3" - resolved "https://registry.yarnpkg.com/http-auth/-/http-auth-3.1.3.tgz#945cfadd66521eaf8f7c84913d377d7b15f24e31" - integrity sha512-Jbx0+ejo2IOx+cRUYAGS1z6RGc6JfYUNkysZM4u4Sfk1uLlGv814F7/PIjQQAuThLdAWxb74JMGd5J8zex1VQg== - dependencies: - apache-crypt "^1.1.2" - apache-md5 "^1.0.6" - bcryptjs "^2.3.0" - uuid "^3.0.0" - http-cache-semantics@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz#49e91c5cbf36c9b94bcfcd71c23d5249ec74e390" integrity sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ== -http-errors@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-2.0.0.tgz#b7774a1486ef73cf7667ac9ae0858c012c57b9d3" - integrity sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ== - dependencies: - depd "2.0.0" - inherits "2.0.4" - setprototypeof "1.2.0" - statuses "2.0.1" - toidentifier "1.0.1" - -http-errors@~1.6.2: - version "1.6.3" - resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.6.3.tgz#8b55680bb4be283a0b5bf4ea2e38580be1d9320d" - integrity sha512-lks+lVC8dgGyh97jxvxeYTWQFvh4uw4yC12gVl63Cg30sjPX4wuGcdkICVXDAESr6OJGjqGA8Iz5mkeN6zlD7A== - dependencies: - depd "~1.1.2" - inherits "2.0.3" - setprototypeof "1.1.0" - statuses ">= 1.4.0 < 2" - -http-parser-js@>=0.5.1: - version "0.5.8" - resolved "https://registry.yarnpkg.com/http-parser-js/-/http-parser-js-0.5.8.tgz#af23090d9ac4e24573de6f6aecc9d84a48bf20e3" - integrity sha512-SGeBX54F94Wgu5RH3X5jsDtf4eHyRogWX1XGT3b4HuW3tQPM4AaBzoUji/4AAJNXCEOWZ5O0DgZmJw1947gD5Q== - http-proxy-agent@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz#8a8c8ef7f5932ccf953c296ca8291b95aa74aa3a" @@ -5440,16 +5223,11 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@2, inherits@2.0.4, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.3: +inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.3: version "2.0.4" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== -inherits@2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" - integrity sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw== - ini@^1.3.2, ini@^1.3.4, ini@~1.3.0: version "1.3.8" resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.8.tgz#a29da425b48806f34767a4efce397269af28432c" @@ -5529,20 +5307,6 @@ ip@^2.0.0: resolved "https://registry.yarnpkg.com/ip/-/ip-2.0.0.tgz#4cf4ab182fee2314c75ede1276f8c80b479936da" integrity sha512-WKa+XuLG1A1R0UWhl2+1XQSi+fZWMsYKffMZTTYsiZaUD8k2yDAj5atimTUD2TZkyCkNEeYE5NhFZmupOGtjYQ== -is-accessor-descriptor@^0.1.6: - version "0.1.6" - resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" - integrity sha512-e1BM1qnDbMRG3ll2U9dSK0UMHuWOs3pY3AtcFsmvwPtKL3MML/Q86i+GilLfvqEs4GW+ExB91tQ3Ig9noDIZ+A== - dependencies: - kind-of "^3.0.2" - -is-accessor-descriptor@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz#169c2f6d3df1f992618072365c9b0ea1f6878656" - integrity sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ== - dependencies: - kind-of "^6.0.0" - is-alphabetical@^1.0.0: version "1.0.4" resolved "https://registry.yarnpkg.com/is-alphabetical/-/is-alphabetical-1.0.4.tgz#9e7d6b94916be22153745d184c298cbf986a686d" @@ -5568,13 +5332,6 @@ is-bigint@^1.0.1: dependencies: has-bigints "^1.0.1" -is-binary-path@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-1.0.1.tgz#75f16642b480f187a711c814161fd3a4a7655898" - integrity sha512-9fRVlXc0uCxEDj1nQzaWONSpbTfx0FmJfzHF7pwlI8DkWGoHBBea4Pg5Ky0ojwwxQmnSifgbKkI06Qv0Ljgj+Q== - dependencies: - binary-extensions "^1.0.0" - is-binary-path@~2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" @@ -5590,7 +5347,7 @@ is-boolean-object@^1.1.0: call-bind "^1.0.2" has-tostringtag "^1.0.0" -is-buffer@^1.1.5, is-buffer@~1.1.1: +is-buffer@~1.1.1: version "1.1.6" resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== @@ -5614,20 +5371,6 @@ is-core-module@^2.5.0, is-core-module@^2.8.1, is-core-module@^2.9.0: dependencies: has "^1.0.3" -is-data-descriptor@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" - integrity sha512-+w9D5ulSoBNlmw9OHn3U2v51SyoCd0he+bB3xMl62oijhrspxowjU+AIcDY0N3iEJbUEkB15IlMASQsxYigvXg== - dependencies: - kind-of "^3.0.2" - -is-data-descriptor@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz#d84876321d0e7add03990406abbbbd36ba9268c7" - integrity sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ== - dependencies: - kind-of "^6.0.0" - is-date-object@^1.0.1: version "1.0.5" resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.5.tgz#0841d5536e724c25597bf6ea62e1bd38298df31f" @@ -5640,42 +5383,12 @@ is-decimal@^1.0.0: resolved "https://registry.yarnpkg.com/is-decimal/-/is-decimal-1.0.4.tgz#65a3a5958a1c5b63a706e1b333d7cd9f630d3fa5" integrity sha512-RGdriMmQQvZ2aqaQq3awNA6dCGtKpiDFcOzrTWrDAT2MiWrKQVPmxLGHl7Y2nNu6led0kEyoX0enY0qXYsv9zw== -is-descriptor@^0.1.0: - version "0.1.6" - resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca" - integrity sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg== - dependencies: - is-accessor-descriptor "^0.1.6" - is-data-descriptor "^0.1.4" - kind-of "^5.0.0" - -is-descriptor@^1.0.0, is-descriptor@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-1.0.2.tgz#3b159746a66604b04f8c81524ba365c5f14d86ec" - integrity sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg== - dependencies: - is-accessor-descriptor "^1.0.0" - is-data-descriptor "^1.0.0" - kind-of "^6.0.2" - is-docker@^2.0.0, is-docker@^2.1.1: version "2.2.1" resolved "https://registry.yarnpkg.com/is-docker/-/is-docker-2.2.1.tgz#33eeabe23cfe86f14bde4408a02c0cfb853acdaa" integrity sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ== -is-extendable@^0.1.0, is-extendable@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" - integrity sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw== - -is-extendable@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4" - integrity sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA== - dependencies: - is-plain-object "^2.0.4" - -is-extglob@^2.1.0, is-extglob@^2.1.1: +is-extglob@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== @@ -5695,13 +5408,6 @@ is-generator-fn@^2.0.0: resolved "https://registry.yarnpkg.com/is-generator-fn/-/is-generator-fn-2.1.0.tgz#7d140adc389aaf3011a8f2a2a4cfa6faadffb118" integrity sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ== -is-glob@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-3.1.0.tgz#7ba5ae24217804ac70707b96922567486cc3e84a" - integrity sha512-UFpDDrPgM6qpnFNI+rh/p3bUaq9hKLZN8bMUWzxmcnZVS3omf4IPK+BrewlnWjO1WmUsMYuSjKh4UJuV4+Lqmw== - dependencies: - is-extglob "^2.1.0" - is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3, is-glob@~4.0.1: version "4.0.3" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" @@ -5736,23 +5442,11 @@ is-number-object@^1.0.4: dependencies: has-tostringtag "^1.0.0" -is-number@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" - integrity sha512-4cboCqIpliH+mAvFNegjZQ4kgKc3ZUhQVr3HvWbSh5q3WH2v82ct+T2Y1hdU5Gdtorx/cLifQjqCbL7bpznLTg== - dependencies: - kind-of "^3.0.2" - is-number@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== -is-obj@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-1.0.1.tgz#3e4729ac1f5fde025cd7d83a896dab9f4f67db0f" - integrity sha512-l4RyHgRqGN4Y3+9JHVrNqO+tN0rV5My76uW5/nuO4K1b6vw5G8d/cmFjP9tRfEsdhZNt0IFdZuK/c2Vr4Nb+Qg== - is-obj@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-2.0.0.tgz#473fb05d973705e3fd9620545018ca8e22ef4982" @@ -5763,7 +5457,7 @@ is-plain-obj@^1.0.0, is-plain-obj@^1.1.0: resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" integrity sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg== -is-plain-object@^2.0.3, is-plain-object@^2.0.4: +is-plain-object@^2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== @@ -5788,11 +5482,6 @@ is-regex@^1.1.4: call-bind "^1.0.2" has-tostringtag "^1.0.0" -is-regexp@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-regexp/-/is-regexp-1.0.0.tgz#fd2d883545c46bac5a633e7b9a09e87fa2cb5069" - integrity sha512-7zjFAPO4/gwyQAAgRRmqeEeyIICSdmCqa3tsVHMdBzaXXRiqopZL4Cyghg/XulGWrtABTpbnYYzzIRffLkP4oA== - is-shared-array-buffer@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz#8f259c573b60b6a32d4058a1a07430c0a7344c79" @@ -5865,16 +5554,11 @@ is-weakref@^1.0.2: dependencies: call-bind "^1.0.2" -is-windows@^1.0.1, is-windows@^1.0.2: +is-windows@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA== -is-wsl@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-1.1.0.tgz#1f16e4aa22b04d1336b66188a66af3c600c3a66d" - integrity sha512-gfygJYZ2gLTDlmbWMI0CE2MwnFzSN/2SZfkMlItC4K/JBlsWVDB0bO6XhqcY13YXE7iMcAJnzTCJjPiTeJJ0Mw== - is-wsl@^2.1.1, is-wsl@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-2.2.0.tgz#74a4c76e77ca9fd3f932f290c17ea326cd157271" @@ -5882,7 +5566,7 @@ is-wsl@^2.1.1, is-wsl@^2.2.0: dependencies: is-docker "^2.0.0" -isarray@1.0.0, isarray@~1.0.0: +isarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" integrity sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ== @@ -5892,14 +5576,7 @@ isexe@^2.0.0: resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== -isobject@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" - integrity sha512-+OUdGJlgjOBZDfxnDjYYG6zp487z0JGNQq3cYQYg5f5hKR+syHMsaztzGeml/4kGG55CSpKSpWTY+jYGgsHLgA== - dependencies: - isarray "1.0.0" - -isobject@^3.0.0, isobject@^3.0.1: +isobject@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" integrity sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg== @@ -5978,6 +5655,14 @@ jest-changed-files@^28.1.3: execa "^5.0.0" p-limit "^3.1.0" +jest-changed-files@^29.5.0: + version "29.5.0" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-29.5.0.tgz#e88786dca8bf2aa899ec4af7644e16d9dcf9b23e" + integrity sha512-IFG34IUMUaNBIxjQXF/iu7g6EcdMrGRRxaUSw92I/2g2YC6vCdTltl4nHvt7Ci5nSJwXIkCu8Ka1DKF+X7Z1Ag== + dependencies: + execa "^5.0.0" + p-limit "^3.1.0" + jest-circus@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-27.5.1.tgz#37a5a4459b7bf4406e53d637b49d22c65d125ecc" @@ -6028,6 +5713,32 @@ jest-circus@^28.1.3: slash "^3.0.0" stack-utils "^2.0.3" +jest-circus@^29.5.0: + version "29.5.0" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-29.5.0.tgz#b5926989449e75bff0d59944bae083c9d7fb7317" + integrity sha512-gq/ongqeQKAplVxqJmbeUOJJKkW3dDNPY8PjhJ5G0lBRvu0e3EWGxGy5cI4LAGA7gV2UHCtWBI4EMXK8c9nQKA== + dependencies: + "@jest/environment" "^29.5.0" + "@jest/expect" "^29.5.0" + "@jest/test-result" "^29.5.0" + "@jest/types" "^29.5.0" + "@types/node" "*" + chalk "^4.0.0" + co "^4.6.0" + dedent "^0.7.0" + is-generator-fn "^2.0.0" + jest-each "^29.5.0" + jest-matcher-utils "^29.5.0" + jest-message-util "^29.5.0" + jest-runtime "^29.5.0" + jest-snapshot "^29.5.0" + jest-util "^29.5.0" + p-limit "^3.1.0" + pretty-format "^29.5.0" + pure-rand "^6.0.0" + slash "^3.0.0" + stack-utils "^2.0.3" + jest-cli@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-27.5.1.tgz#278794a6e6458ea8029547e6c6cbf673bd30b145" @@ -6064,6 +5775,24 @@ jest-cli@^28.1.3: prompts "^2.0.1" yargs "^17.3.1" +jest-cli@^29.5.0: + version "29.5.0" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-29.5.0.tgz#b34c20a6d35968f3ee47a7437ff8e53e086b4a67" + integrity sha512-L1KcP1l4HtfwdxXNFCL5bmUbLQiKrakMUriBEcc1Vfz6gx31ORKdreuWvmQVBit+1ss9NNR3yxjwfwzZNdQXJw== + dependencies: + "@jest/core" "^29.5.0" + "@jest/test-result" "^29.5.0" + "@jest/types" "^29.5.0" + chalk "^4.0.0" + exit "^0.1.2" + graceful-fs "^4.2.9" + import-local "^3.0.2" + jest-config "^29.5.0" + jest-util "^29.5.0" + jest-validate "^29.5.0" + prompts "^2.0.1" + yargs "^17.3.1" + jest-config@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-27.5.1.tgz#5c387de33dca3f99ad6357ddeccd91bf3a0e4a41" @@ -6122,6 +5851,34 @@ jest-config@^28.1.3: slash "^3.0.0" strip-json-comments "^3.1.1" +jest-config@^29.5.0: + version "29.5.0" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-29.5.0.tgz#3cc972faec8c8aaea9ae158c694541b79f3748da" + integrity sha512-kvDUKBnNJPNBmFFOhDbm59iu1Fii1Q6SxyhXfvylq3UTHbg6o7j/g8k2dZyXWLvfdKB1vAPxNZnMgtKJcmu3kA== + dependencies: + "@babel/core" "^7.11.6" + "@jest/test-sequencer" "^29.5.0" + "@jest/types" "^29.5.0" + babel-jest "^29.5.0" + chalk "^4.0.0" + ci-info "^3.2.0" + deepmerge "^4.2.2" + glob "^7.1.3" + graceful-fs "^4.2.9" + jest-circus "^29.5.0" + jest-environment-node "^29.5.0" + jest-get-type "^29.4.3" + jest-regex-util "^29.4.3" + jest-resolve "^29.5.0" + jest-runner "^29.5.0" + jest-util "^29.5.0" + jest-validate "^29.5.0" + micromatch "^4.0.4" + parse-json "^5.2.0" + pretty-format "^29.5.0" + slash "^3.0.0" + strip-json-comments "^3.1.1" + jest-diff@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.5.1.tgz#a07f5011ac9e6643cf8a95a462b7b1ecf6680def" @@ -6152,6 +5909,16 @@ jest-diff@^29.1.2: jest-get-type "^29.0.0" pretty-format "^29.1.2" +jest-diff@^29.5.0: + version "29.5.0" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-29.5.0.tgz#e0d83a58eb5451dcc1fa61b1c3ee4e8f5a290d63" + integrity sha512-LtxijLLZBduXnHSniy0WMdaHjmQnt3g5sa16W4p0HqukYTTsyTW3GD1q41TyGl5YFXj/5B2U6dlh5FM1LIMgxw== + dependencies: + chalk "^4.0.0" + diff-sequences "^29.4.3" + jest-get-type "^29.4.3" + pretty-format "^29.5.0" + jest-docblock@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-27.5.1.tgz#14092f364a42c6108d42c33c8cf30e058e25f6c0" @@ -6166,6 +5933,13 @@ jest-docblock@^28.1.1: dependencies: detect-newline "^3.0.0" +jest-docblock@^29.4.3: + version "29.4.3" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-29.4.3.tgz#90505aa89514a1c7dceeac1123df79e414636ea8" + integrity sha512-fzdTftThczeSD9nZ3fzA/4KkHtnmllawWrXO69vtI+L9WjEIuXWs4AmyME7lN5hU7dB0sHhuPfcKofRsUb/2Fg== + dependencies: + detect-newline "^3.0.0" + jest-each@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-27.5.1.tgz#5bc87016f45ed9507fed6e4702a5b468a5b2c44e" @@ -6188,6 +5962,17 @@ jest-each@^28.1.3: jest-util "^28.1.3" pretty-format "^28.1.3" +jest-each@^29.5.0: + version "29.5.0" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-29.5.0.tgz#fc6e7014f83eac68e22b7195598de8554c2e5c06" + integrity sha512-HM5kIJ1BTnVt+DQZ2ALp3rzXEl+g726csObrW/jpEGl+CDSSQpOJJX2KE/vEg8cxcMXdyEPu6U4QX5eruQv5hA== + dependencies: + "@jest/types" "^29.5.0" + chalk "^4.0.0" + jest-get-type "^29.4.3" + jest-util "^29.5.0" + pretty-format "^29.5.0" + jest-environment-jsdom@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-27.5.1.tgz#ea9ccd1fc610209655a77898f86b2b559516a546" @@ -6225,6 +6010,18 @@ jest-environment-node@^28.1.3: jest-mock "^28.1.3" jest-util "^28.1.3" +jest-environment-node@^29.5.0: + version "29.5.0" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-29.5.0.tgz#f17219d0f0cc0e68e0727c58b792c040e332c967" + integrity sha512-ExxuIK/+yQ+6PRGaHkKewYtg6hto2uGCgvKdb2nfJfKXgZ17DfXjvbZ+jA1Qt9A8EQSfPnt5FKIfnOO3u1h9qw== + dependencies: + "@jest/environment" "^29.5.0" + "@jest/fake-timers" "^29.5.0" + "@jest/types" "^29.5.0" + "@types/node" "*" + jest-mock "^29.5.0" + jest-util "^29.5.0" + jest-expect-message@*, jest-expect-message@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/jest-expect-message/-/jest-expect-message-1.1.3.tgz#a3f6bd4503f5bd5d2e37b70d3126a2bdb215ec58" @@ -6245,6 +6042,11 @@ jest-get-type@^29.0.0: resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-29.0.0.tgz#843f6c50a1b778f7325df1129a0fd7aa713aef80" integrity sha512-83X19z/HuLKYXYHskZlBAShO7UfLFXu/vWajw9ZNJASN32li8yHMaVGAQqxFW1RCFOkB7cubaL6FaJVQqqJLSw== +jest-get-type@^29.4.3: + version "29.4.3" + resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-29.4.3.tgz#1ab7a5207c995161100b5187159ca82dd48b3dd5" + integrity sha512-J5Xez4nRRMjk8emnTpWrlkyb9pfRQQanDrvWHhsR1+VUfbwxi30eVcZFlcdGInRibU4G5LwHXpI7IRHU0CY+gg== + jest-haste-map@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-27.5.1.tgz#9fd8bd7e7b4fa502d9c6164c5640512b4e811e7f" @@ -6284,6 +6086,25 @@ jest-haste-map@^28.1.3: optionalDependencies: fsevents "^2.3.2" +jest-haste-map@^29.5.0: + version "29.5.0" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-29.5.0.tgz#69bd67dc9012d6e2723f20a945099e972b2e94de" + integrity sha512-IspOPnnBro8YfVYSw6yDRKh/TiCdRngjxeacCps1cQ9cgVN6+10JUcuJ1EabrgYLOATsIAigxA0rLR9x/YlrSA== + dependencies: + "@jest/types" "^29.5.0" + "@types/graceful-fs" "^4.1.3" + "@types/node" "*" + anymatch "^3.0.3" + fb-watchman "^2.0.0" + graceful-fs "^4.2.9" + jest-regex-util "^29.4.3" + jest-util "^29.5.0" + jest-worker "^29.5.0" + micromatch "^4.0.4" + walker "^1.0.8" + optionalDependencies: + fsevents "^2.3.2" + jest-jasmine2@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-27.5.1.tgz#a037b0034ef49a9f3d71c4375a796f3b230d1ac4" @@ -6333,6 +6154,14 @@ jest-leak-detector@^28.1.3: jest-get-type "^28.0.2" pretty-format "^28.1.3" +jest-leak-detector@^29.5.0: + version "29.5.0" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-29.5.0.tgz#cf4bdea9615c72bac4a3a7ba7e7930f9c0610c8c" + integrity sha512-u9YdeeVnghBUtpN5mVxjID7KbkKE1QU4f6uUwuxiY0vYRi9BUCLKlPEZfDGR67ofdFmDz9oPAy2G92Ujrntmow== + dependencies: + jest-get-type "^29.4.3" + pretty-format "^29.5.0" + jest-matcher-utils@^27.0.0, jest-matcher-utils@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-27.5.1.tgz#9c0cdbda8245bc22d2331729d1091308b40cf8ab" @@ -6363,6 +6192,16 @@ jest-matcher-utils@^29.1.2: jest-get-type "^29.0.0" pretty-format "^29.1.2" +jest-matcher-utils@^29.5.0: + version "29.5.0" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.5.0.tgz#d957af7f8c0692c5453666705621ad4abc2c59c5" + integrity sha512-lecRtgm/rjIK0CQ7LPQwzCs2VwW6WAahA55YBuI+xqmhm7LAaxokSB8C97yJeYyT+HvQkH741StzpU41wohhWw== + dependencies: + chalk "^4.0.0" + jest-diff "^29.5.0" + jest-get-type "^29.4.3" + pretty-format "^29.5.0" + jest-message-util@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-27.5.1.tgz#bdda72806da10d9ed6425e12afff38cd1458b6cf" @@ -6408,6 +6247,21 @@ jest-message-util@^29.1.2: slash "^3.0.0" stack-utils "^2.0.3" +jest-message-util@^29.5.0: + version "29.5.0" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-29.5.0.tgz#1f776cac3aca332ab8dd2e3b41625435085c900e" + integrity sha512-Kijeg9Dag6CKtIDA7O21zNTACqD5MD/8HfIV8pdD94vFyFuer52SigdC3IQMhab3vACxXMiFk+yMHNdbqtyTGA== + dependencies: + "@babel/code-frame" "^7.12.13" + "@jest/types" "^29.5.0" + "@types/stack-utils" "^2.0.0" + chalk "^4.0.0" + graceful-fs "^4.2.9" + micromatch "^4.0.4" + pretty-format "^29.5.0" + slash "^3.0.0" + stack-utils "^2.0.3" + jest-mock@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-27.5.1.tgz#19948336d49ef4d9c52021d34ac7b5f36ff967d6" @@ -6424,6 +6278,15 @@ jest-mock@^28.1.3: "@jest/types" "^28.1.3" "@types/node" "*" +jest-mock@^29.5.0: + version "29.5.0" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-29.5.0.tgz#26e2172bcc71d8b0195081ff1f146ac7e1518aed" + integrity sha512-GqOzvdWDE4fAV2bWQLQCkujxYWL7RxjCnj71b5VhDAGOevB3qj3Ovg26A5NI84ZpODxyzaozXLOh2NCgkbvyaw== + dependencies: + "@jest/types" "^29.5.0" + "@types/node" "*" + jest-util "^29.5.0" + jest-pnp-resolver@^1.2.2: version "1.2.2" resolved "https://registry.yarnpkg.com/jest-pnp-resolver/-/jest-pnp-resolver-1.2.2.tgz#b704ac0ae028a89108a4d040b3f919dfddc8e33c" @@ -6439,6 +6302,11 @@ jest-regex-util@^28.0.2: resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-28.0.2.tgz#afdc377a3b25fb6e80825adcf76c854e5bf47ead" integrity sha512-4s0IgyNIy0y9FK+cjoVYoxamT7Zeo7MhzqRGx7YDYmaQn1wucY9rotiGkBzzcMXTtjrCAP/f7f+E0F7+fxPNdw== +jest-regex-util@^29.4.3: + version "29.4.3" + resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-29.4.3.tgz#a42616141e0cae052cfa32c169945d00c0aa0bb8" + integrity sha512-O4FglZaMmWXbGHSQInfXewIsd1LMn9p3ZXB/6r4FOkyhX2/iP/soMG98jGvk/A3HAN78+5VWcBGO0BJAPRh4kg== + jest-resolve-dependencies@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-27.5.1.tgz#d811ecc8305e731cc86dd79741ee98fed06f1da8" @@ -6456,6 +6324,14 @@ jest-resolve-dependencies@^28.1.3: jest-regex-util "^28.0.2" jest-snapshot "^28.1.3" +jest-resolve-dependencies@^29.5.0: + version "29.5.0" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-29.5.0.tgz#f0ea29955996f49788bf70996052aa98e7befee4" + integrity sha512-sjV3GFr0hDJMBpYeUuGduP+YeCRbd7S/ck6IvL3kQ9cpySYKqcqhdLLC2rFwrcL7tz5vYibomBrsFYWkIGGjOg== + dependencies: + jest-regex-util "^29.4.3" + jest-snapshot "^29.5.0" + jest-resolve@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-27.5.1.tgz#a2f1c5a0796ec18fe9eb1536ac3814c23617b384" @@ -6487,6 +6363,21 @@ jest-resolve@^28.1.3: resolve.exports "^1.1.0" slash "^3.0.0" +jest-resolve@^29.5.0: + version "29.5.0" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-29.5.0.tgz#b053cc95ad1d5f6327f0ac8aae9f98795475ecdc" + integrity sha512-1TzxJ37FQq7J10jPtQjcc+MkCkE3GBpBecsSUWJ0qZNJpmg6m0D9/7II03yJulm3H/fvVjgqLh/k2eYg+ui52w== + dependencies: + chalk "^4.0.0" + graceful-fs "^4.2.9" + jest-haste-map "^29.5.0" + jest-pnp-resolver "^1.2.2" + jest-util "^29.5.0" + jest-validate "^29.5.0" + resolve "^1.20.0" + resolve.exports "^2.0.0" + slash "^3.0.0" + jest-runner@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-27.5.1.tgz#071b27c1fa30d90540805c5645a0ec167c7b62e5" @@ -6541,6 +6432,33 @@ jest-runner@^28.1.3: p-limit "^3.1.0" source-map-support "0.5.13" +jest-runner@^29.5.0: + version "29.5.0" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-29.5.0.tgz#6a57c282eb0ef749778d444c1d758c6a7693b6f8" + integrity sha512-m7b6ypERhFghJsslMLhydaXBiLf7+jXy8FwGRHO3BGV1mcQpPbwiqiKUR2zU2NJuNeMenJmlFZCsIqzJCTeGLQ== + dependencies: + "@jest/console" "^29.5.0" + "@jest/environment" "^29.5.0" + "@jest/test-result" "^29.5.0" + "@jest/transform" "^29.5.0" + "@jest/types" "^29.5.0" + "@types/node" "*" + chalk "^4.0.0" + emittery "^0.13.1" + graceful-fs "^4.2.9" + jest-docblock "^29.4.3" + jest-environment-node "^29.5.0" + jest-haste-map "^29.5.0" + jest-leak-detector "^29.5.0" + jest-message-util "^29.5.0" + jest-resolve "^29.5.0" + jest-runtime "^29.5.0" + jest-util "^29.5.0" + jest-watcher "^29.5.0" + jest-worker "^29.5.0" + p-limit "^3.1.0" + source-map-support "0.5.13" + jest-runtime@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-27.5.1.tgz#4896003d7a334f7e8e4a53ba93fb9bcd3db0a1af" @@ -6597,6 +6515,34 @@ jest-runtime@^28.1.3: slash "^3.0.0" strip-bom "^4.0.0" +jest-runtime@^29.5.0: + version "29.5.0" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-29.5.0.tgz#c83f943ee0c1da7eb91fa181b0811ebd59b03420" + integrity sha512-1Hr6Hh7bAgXQP+pln3homOiEZtCDZFqwmle7Ew2j8OlbkIu6uE3Y/etJQG8MLQs3Zy90xrp2C0BRrtPHG4zryw== + dependencies: + "@jest/environment" "^29.5.0" + "@jest/fake-timers" "^29.5.0" + "@jest/globals" "^29.5.0" + "@jest/source-map" "^29.4.3" + "@jest/test-result" "^29.5.0" + "@jest/transform" "^29.5.0" + "@jest/types" "^29.5.0" + "@types/node" "*" + chalk "^4.0.0" + cjs-module-lexer "^1.0.0" + collect-v8-coverage "^1.0.0" + glob "^7.1.3" + graceful-fs "^4.2.9" + jest-haste-map "^29.5.0" + jest-message-util "^29.5.0" + jest-mock "^29.5.0" + jest-regex-util "^29.4.3" + jest-resolve "^29.5.0" + jest-snapshot "^29.5.0" + jest-util "^29.5.0" + slash "^3.0.0" + strip-bom "^4.0.0" + jest-serializer@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-27.5.1.tgz#81438410a30ea66fd57ff730835123dea1fb1f64" @@ -6662,6 +6608,35 @@ jest-snapshot@^28.1.3: pretty-format "^28.1.3" semver "^7.3.5" +jest-snapshot@^29.5.0: + version "29.5.0" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-29.5.0.tgz#c9c1ce0331e5b63cd444e2f95a55a73b84b1e8ce" + integrity sha512-x7Wolra5V0tt3wRs3/ts3S6ciSQVypgGQlJpz2rsdQYoUKxMxPNaoHMGJN6qAuPJqS+2iQ1ZUn5kl7HCyls84g== + dependencies: + "@babel/core" "^7.11.6" + "@babel/generator" "^7.7.2" + "@babel/plugin-syntax-jsx" "^7.7.2" + "@babel/plugin-syntax-typescript" "^7.7.2" + "@babel/traverse" "^7.7.2" + "@babel/types" "^7.3.3" + "@jest/expect-utils" "^29.5.0" + "@jest/transform" "^29.5.0" + "@jest/types" "^29.5.0" + "@types/babel__traverse" "^7.0.6" + "@types/prettier" "^2.1.5" + babel-preset-current-node-syntax "^1.0.0" + chalk "^4.0.0" + expect "^29.5.0" + graceful-fs "^4.2.9" + jest-diff "^29.5.0" + jest-get-type "^29.4.3" + jest-matcher-utils "^29.5.0" + jest-message-util "^29.5.0" + jest-util "^29.5.0" + natural-compare "^1.4.0" + pretty-format "^29.5.0" + semver "^7.3.5" + jest-util@^27.0.0, jest-util@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-27.5.1.tgz#3ba9771e8e31a0b85da48fe0b0891fb86c01c2f9" @@ -6698,6 +6673,18 @@ jest-util@^29.1.2: graceful-fs "^4.2.9" picomatch "^2.2.3" +jest-util@^29.5.0: + version "29.5.0" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.5.0.tgz#24a4d3d92fc39ce90425311b23c27a6e0ef16b8f" + integrity sha512-RYMgG/MTadOr5t8KdhejfvUU82MxsCu5MF6KuDUHl+NuwzUt+Sm6jJWxTJVrDR1j5M/gJVCPKQEpWXY+yIQ6lQ== + dependencies: + "@jest/types" "^29.5.0" + "@types/node" "*" + chalk "^4.0.0" + ci-info "^3.2.0" + graceful-fs "^4.2.9" + picomatch "^2.2.3" + jest-validate@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-27.5.1.tgz#9197d54dc0bdb52260b8db40b46ae668e04df067" @@ -6722,6 +6709,18 @@ jest-validate@^28.1.3: leven "^3.1.0" pretty-format "^28.1.3" +jest-validate@^29.5.0: + version "29.5.0" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-29.5.0.tgz#8e5a8f36178d40e47138dc00866a5f3bd9916ffc" + integrity sha512-pC26etNIi+y3HV8A+tUGr/lph9B18GnzSRAkPaaZJIE1eFdiYm6/CewuiJQ8/RlfHd1u/8Ioi8/sJ+CmbA+zAQ== + dependencies: + "@jest/types" "^29.5.0" + camelcase "^6.2.0" + chalk "^4.0.0" + jest-get-type "^29.4.3" + leven "^3.1.0" + pretty-format "^29.5.0" + jest-watcher@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-27.5.1.tgz#71bd85fb9bde3a2c2ec4dc353437971c43c642a2" @@ -6749,6 +6748,20 @@ jest-watcher@^28.1.3: jest-util "^28.1.3" string-length "^4.0.1" +jest-watcher@^29.5.0: + version "29.5.0" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-29.5.0.tgz#cf7f0f949828ba65ddbbb45c743a382a4d911363" + integrity sha512-KmTojKcapuqYrKDpRwfqcQ3zjMlwu27SYext9pt4GlF5FUgB+7XE1mcCnSm6a4uUpFyQIkb6ZhzZvHl+jiBCiA== + dependencies: + "@jest/test-result" "^29.5.0" + "@jest/types" "^29.5.0" + "@types/node" "*" + ansi-escapes "^4.2.1" + chalk "^4.0.0" + emittery "^0.13.1" + jest-util "^29.5.0" + string-length "^4.0.1" + jest-worker@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.5.1.tgz#8d146f0900e8973b106b6f73cc1e9a8cb86f8db0" @@ -6767,6 +6780,16 @@ jest-worker@^28.1.3: merge-stream "^2.0.0" supports-color "^8.0.0" +jest-worker@^29.5.0: + version "29.5.0" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-29.5.0.tgz#bdaefb06811bd3384d93f009755014d8acb4615d" + integrity sha512-NcrQnevGoSp4b5kg+akIpthoAFHxPBcb5P6mYPY0fUNT+sSvmtu6jlkEle3anczUKIKEbMxFimk9oTP/tpIPgA== + dependencies: + "@types/node" "*" + jest-util "^29.5.0" + merge-stream "^2.0.0" + supports-color "^8.0.0" + jest@^27.2.0: version "27.5.1" resolved "https://registry.yarnpkg.com/jest/-/jest-27.5.1.tgz#dadf33ba70a779be7a6fc33015843b51494f63fc" @@ -6786,6 +6809,16 @@ jest@^28.1.3: import-local "^3.0.2" jest-cli "^28.1.3" +jest@^29.0.0: + version "29.5.0" + resolved "https://registry.yarnpkg.com/jest/-/jest-29.5.0.tgz#f75157622f5ce7ad53028f2f8888ab53e1f1f24e" + integrity sha512-juMg3he2uru1QoXX078zTa7pO85QyB9xajZc6bU+d9yEGwrKX6+vGmJQ3UdVZsvTEUARIdObzH68QItim6OSSQ== + dependencies: + "@jest/core" "^29.5.0" + "@jest/types" "^29.5.0" + import-local "^3.0.2" + jest-cli "^29.5.0" + js-crypto-env@^0.3.2: version "0.3.2" resolved "https://registry.yarnpkg.com/js-crypto-env/-/js-crypto-env-0.3.2.tgz#02195723469da14449338ca2789fd7ff6784c533" @@ -6981,26 +7014,7 @@ just-diff@^5.0.1: resolved "https://registry.yarnpkg.com/just-diff/-/just-diff-5.2.0.tgz#60dca55891cf24cd4a094e33504660692348a241" integrity sha512-6ufhP9SHjb7jibNFrNxyFZ6od3g+An6Ai9mhGRvcYe8UJlH0prseN64M+6ZBBUoKYHZsitDP42gAJ8+eVWr3lw== -kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: - version "3.2.2" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" - integrity sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ== - dependencies: - is-buffer "^1.1.5" - -kind-of@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" - integrity sha512-24XsCxmEbRwEDbz/qz3stgin8TTzZ1ESR56OMCN0ujYg+vRutNSiOj9bHH9u85DKgXguraugV5sFuvbD4FW/hw== - dependencies: - is-buffer "^1.1.5" - -kind-of@^5.0.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d" - integrity sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw== - -kind-of@^6.0.0, kind-of@^6.0.2, kind-of@^6.0.3: +kind-of@^6.0.2, kind-of@^6.0.3: version "6.0.3" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== @@ -7163,59 +7177,6 @@ linkify-it@^3.0.1: dependencies: uc.micro "^1.0.1" -lint-staged@^11.1.2: - version "11.2.6" - resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-11.2.6.tgz#f477b1af0294db054e5937f171679df63baa4c43" - integrity sha512-Vti55pUnpvPE0J9936lKl0ngVeTdSZpEdTNhASbkaWX7J5R9OEifo1INBGQuGW4zmy6OG+TcWPJ3m5yuy5Q8Tg== - dependencies: - cli-truncate "2.1.0" - colorette "^1.4.0" - commander "^8.2.0" - cosmiconfig "^7.0.1" - debug "^4.3.2" - enquirer "^2.3.6" - execa "^5.1.1" - listr2 "^3.12.2" - micromatch "^4.0.4" - normalize-path "^3.0.0" - please-upgrade-node "^3.2.0" - string-argv "0.3.1" - stringify-object "3.3.0" - supports-color "8.1.1" - -listr2@^3.12.2: - version "3.14.0" - resolved "https://registry.yarnpkg.com/listr2/-/listr2-3.14.0.tgz#23101cc62e1375fd5836b248276d1d2b51fdbe9e" - integrity sha512-TyWI8G99GX9GjE54cJ+RrNMcIFBfwMPxc3XTFiAYGN4s10hWROGtOg7+O6u6LE3mNkyld7RSLE6nrKBvTfcs3g== - dependencies: - cli-truncate "^2.1.0" - colorette "^2.0.16" - log-update "^4.0.0" - p-map "^4.0.0" - rfdc "^1.3.0" - rxjs "^7.5.1" - through "^2.3.8" - wrap-ansi "^7.0.0" - -live-server@^1.2.1: - version "1.2.2" - resolved "https://registry.yarnpkg.com/live-server/-/live-server-1.2.2.tgz#20b4fe5c2ca886faa61813310e28680804f48dad" - integrity sha512-t28HXLjITRGoMSrCOv4eZ88viHaBVIjKjdI5PO92Vxlu+twbk6aE0t7dVIaz6ZWkjPilYFV6OSdMYl9ybN2B4w== - dependencies: - chokidar "^2.0.4" - colors "1.4.0" - connect "^3.6.6" - cors latest - event-stream "3.3.4" - faye-websocket "0.11.x" - http-auth "3.1.x" - morgan "^1.9.1" - object-assign latest - opn latest - proxy-middleware latest - send latest - serve-index "^1.9.1" - load-json-file@6.2.0: version "6.2.0" resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-6.2.0.tgz#5c7770b42cafa97074ca2848707c61662f4251a1" @@ -7311,16 +7272,6 @@ log-symbols@^4.1.0: chalk "^4.1.0" is-unicode-supported "^0.1.0" -log-update@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/log-update/-/log-update-4.0.0.tgz#589ecd352471f2a1c0c570287543a64dfd20e0a1" - integrity sha512-9fkkDevMefjg0mmzWFBW8YkFP91OrizzkW3diF7CpG+S2EYdy4+TVfGwz1zeF8x7hCx1ovSPTOE9Ngib74qqUg== - dependencies: - ansi-escapes "^4.3.0" - cli-cursor "^3.1.0" - slice-ansi "^4.0.0" - wrap-ansi "^6.2.0" - long@*, long@^5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/long/-/long-5.2.0.tgz#2696dadf4b4da2ce3f6f6b89186085d94d52fd61" @@ -7410,11 +7361,6 @@ makeerror@1.0.12: dependencies: tmpl "1.0.5" -map-cache@^0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" - integrity sha512-8y/eV9QQZCiyn1SprXSrCmqJN0yNRATe+PO8ztwqrvrbdRLA3eYJF0yaR0YayLWkMbsQSKWS9N2gPcGEc4UsZg== - map-obj@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-1.0.1.tgz#d933ceb9205d82bdcf4886f6742bdc2b4dea146d" @@ -7425,18 +7371,6 @@ map-obj@^4.0.0: resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-4.3.0.tgz#9304f906e93faae70880da102a9f1df0ea8bb05a" integrity sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ== -map-stream@~0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/map-stream/-/map-stream-0.1.0.tgz#e56aa94c4c8055a16404a0674b78f215f7c8e194" - integrity sha512-CkYQrPYZfWnu/DAmVCpTSX/xHpKZ80eKh2lAkyA6AJTef6bW+6JpbQZN5rofum7da+SyN1bi5ctTm+lTfcCW3g== - -map-visit@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/map-visit/-/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f" - integrity sha512-4y7uGv8bd2WdM9vpQsiQNo41Ln1NvhvDRuVt0k2JZQ+ezN2uaQes7lZeZ+QQUHOLQAtDaBJ+7wCbi+ab/KFs+w== - dependencies: - object-visit "^1.0.0" - markdown-it@12.0.4: version "12.0.4" resolved "https://registry.yarnpkg.com/markdown-it/-/markdown-it-12.0.4.tgz#eec8247d296327eac3ba9746bdeec9cfcc751e33" @@ -7564,25 +7498,6 @@ micromark@~2.11.0: debug "^4.0.0" parse-entities "^2.0.0" -micromatch@^3.1.10, micromatch@^3.1.4: - version "3.1.10" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" - integrity sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg== - dependencies: - arr-diff "^4.0.0" - array-unique "^0.3.2" - braces "^2.3.1" - define-property "^2.0.2" - extend-shallow "^3.0.2" - extglob "^2.0.4" - fragment-cache "^0.2.1" - kind-of "^6.0.2" - nanomatch "^1.2.9" - object.pick "^1.3.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.2" - micromatch@^4.0.2, micromatch@^4.0.4: version "4.0.5" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.5.tgz#bc8999a7cbbf77cdc89f132f6e467051b49090c6" @@ -7608,18 +7523,13 @@ mime-types@2.1.18: dependencies: mime-db "~1.33.0" -mime-types@^2.1.12, mime-types@~2.1.17, mime-types@~2.1.34: +mime-types@^2.1.12, mime-types@~2.1.34: version "2.1.35" resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== dependencies: mime-db "1.52.0" -mime@1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" - integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg== - mimic-fn@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" @@ -7775,14 +7685,6 @@ miscreant@0.3.2: resolved "https://registry.yarnpkg.com/miscreant/-/miscreant-0.3.2.tgz#a91c046566cca70bd6b5e9fbdd3f67617fa85034" integrity sha512-fL9KxsQz9BJB2KGPMHFrReioywkiomBiuaLk6EuChijK0BsJsIKJXdVomR+/bPj5mvbFD6wM0CM3bZio9g7OHA== -mixin-deep@^1.2.0: - version "1.3.2" - resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.2.tgz#1120b43dc359a785dce65b55b82e257ccf479566" - integrity sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA== - dependencies: - for-in "^1.0.2" - is-extendable "^1.0.1" - mkdirp-infer-owner@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/mkdirp-infer-owner/-/mkdirp-infer-owner-2.0.0.tgz#55d3b368e7d89065c38f32fd38e638f0ab61d316" @@ -7802,17 +7704,6 @@ modify-values@^1.0.0: resolved "https://registry.yarnpkg.com/modify-values/-/modify-values-1.0.1.tgz#b3939fa605546474e3e3e3c63d64bd43b4ee6022" integrity sha512-xV2bxeN6F7oYjZWTe/YPAy6MN2M+sL4u/Rlm2AHCIVGfo2p1yGmBHQ6vHehl4bRTZBdHu3TSkWdYgkwpYzAGSw== -morgan@^1.9.1: - version "1.10.0" - resolved "https://registry.yarnpkg.com/morgan/-/morgan-1.10.0.tgz#091778abc1fc47cd3509824653dae1faab6b17d7" - integrity sha512-AbegBVI4sh6El+1gNwvD5YIck7nSA36weD7xvIxG4in80j/UoK8AEGaWnnz8v1GxonMCltmlNs5ZKbGvl9b1XQ== - dependencies: - basic-auth "~2.0.1" - debug "2.6.9" - depd "~2.0.0" - on-finished "~2.3.0" - on-headers "~1.0.2" - ms@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" @@ -7823,7 +7714,7 @@ ms@2.1.2: resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== -ms@2.1.3, ms@^2.0.0, ms@^2.1.1: +ms@^2.0.0, ms@^2.1.1: version "2.1.3" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== @@ -7844,28 +7735,6 @@ mute-stream@0.0.8, mute-stream@~0.0.4: resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.8.tgz#1630c42b2251ff81e2a283de96a5497ea92e5e0d" integrity sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA== -nan@^2.12.1: - version "2.16.0" - resolved "https://registry.yarnpkg.com/nan/-/nan-2.16.0.tgz#664f43e45460fb98faf00edca0bb0d7b8dce7916" - integrity sha512-UdAqHyFngu7TfQKsCBgAA6pWDkT8MAO7d0jyOecVhN5354xbLqdn8mV9Tat9gepAupm0bt2DbeaSC8vS52MuFA== - -nanomatch@^1.2.9: - version "1.2.13" - resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" - integrity sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA== - dependencies: - arr-diff "^4.0.0" - array-unique "^0.3.2" - define-property "^2.0.2" - extend-shallow "^3.0.2" - fragment-cache "^0.2.1" - is-windows "^1.0.2" - kind-of "^6.0.2" - object.pick "^1.3.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" @@ -7973,13 +7842,6 @@ normalize-package-data@^4.0.0: semver "^7.3.5" validate-npm-package-license "^3.0.4" -normalize-path@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" - integrity sha512-3pKJwH184Xo/lnH6oyP1q2pMd7HcypqqmRs91/6/i2CGtWwIKGCkOOMTm/zXbgTEWHw1uNpNi/igc3ePOYHb6w== - dependencies: - remove-trailing-separator "^1.0.1" - normalize-path@^3.0.0, normalize-path@~3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" @@ -8171,20 +8033,6 @@ nx@15.8.6, "nx@>=15.5.2 < 16": "@nrwl/nx-win32-arm64-msvc" "15.8.6" "@nrwl/nx-win32-x64-msvc" "15.8.6" -object-assign@^4, object-assign@latest: - version "4.1.1" - resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" - integrity sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg== - -object-copy@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c" - integrity sha512-79LYn6VAb63zgtmAteVOWo9Vdj71ZVBy3Pbse+VqxDpEP83XuujMrGqHIwAXJ5I/aM0zU7dIyIAhifVTPrNItQ== - dependencies: - copy-descriptor "^0.1.0" - define-property "^0.2.5" - kind-of "^3.0.3" - object-hash@^1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/object-hash/-/object-hash-1.3.1.tgz#fde452098a951cb145f039bb7d455449ddc126df" @@ -8200,13 +8048,6 @@ object-keys@^1.1.1: resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== -object-visit@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb" - integrity sha512-GBaMwwAVK9qbQN3Scdo0OyvgPW7l3lnaVMj84uTOZlswkX0KpF6fyDBJhtTthf7pymztoN36/KEr1DyhF96zEA== - dependencies: - isobject "^3.0.0" - object.assign@^4.1.2, object.assign@^4.1.4: version "4.1.4" resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.4.tgz#9673c7c7c351ab8c4d0b516f4343ebf4dfb7799f" @@ -8226,13 +8067,6 @@ object.entries@^1.1.2, object.entries@^1.1.5: define-properties "^1.1.3" es-abstract "^1.19.1" -object.pick@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" - integrity sha512-tqa/UMy/CCoYmj+H5qc07qvSL9dqcs/WZENZ1JbtWBlATP+iVOe778gE6MSijnyCnORzDuX6hU+LA4SZ09YjFQ== - dependencies: - isobject "^3.0.1" - object.values@^1.1.5: version "1.1.5" resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.1.5.tgz#959f63e3ce9ef108720333082131e4a459b716ac" @@ -8242,21 +8076,7 @@ object.values@^1.1.5: define-properties "^1.1.3" es-abstract "^1.19.1" -on-finished@2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.4.1.tgz#58c8c44116e54845ad57f14ab10b03533184ac3f" - integrity sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg== - dependencies: - ee-first "1.1.1" - -on-finished@~2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947" - integrity sha512-ikqdkGAAyf/X/gPhXGvfgAytDZtDbr+bkNUJ0N9h5MI/dmdgCs3l6hoHrcUv41sRKew3jIwrp4qQDXiK99Utww== - dependencies: - ee-first "1.1.1" - -on-headers@~1.0.1, on-headers@~1.0.2: +on-headers@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/on-headers/-/on-headers-1.0.2.tgz#772b0ae6aaa525c399e489adfad90c403eb3c28f" integrity sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA== @@ -8284,13 +8104,6 @@ open@^8.4.0: is-docker "^2.1.1" is-wsl "^2.2.0" -opn@latest: - version "6.0.0" - resolved "https://registry.yarnpkg.com/opn/-/opn-6.0.0.tgz#3c5b0db676d5f97da1233d1ed42d182bc5a27d2d" - integrity sha512-I9PKfIZC+e4RXZ/qr1RhgyCnGgYX0UEIlXgWnCOVACIvFgaC9rz6Won7xbdhoHrd8IIhV7YEpHjreNUNkqCGkQ== - dependencies: - is-wsl "^1.1.0" - optionator@^0.8.1: version "0.8.3" resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.3.tgz#84fa1d036fe9d3c7e21d99884b601167ec8fb495" @@ -8565,21 +8378,6 @@ parse5@6.0.1: resolved "https://registry.yarnpkg.com/parse5/-/parse5-6.0.1.tgz#e1a1c085c569b3dc08321184f19a39cc27f7c30b" integrity sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw== -parseurl@~1.3.2, parseurl@~1.3.3: - version "1.3.3" - resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4" - integrity sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ== - -pascalcase@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" - integrity sha512-XHXfu/yOQRy9vYOtUDVMN60OEJjW013GoObG1o+xwQTpB9eYJX/BjXMsdW13ZDPruFhYYn0AG22w0xgQMwl3Nw== - -path-dirname@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/path-dirname/-/path-dirname-1.0.2.tgz#cc33d24d525e099a5388c0336c6e32b9160609e0" - integrity sha512-ALzNPpyNq9AqXMBjeymIjFDAkAFH06mHJH/cSBHAgU0s4vfpBn6b2nf8tiRLvagKD8RbTpq2FKTBg7cl9l3c7Q== - path-exists@4.0.0, path-exists@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" @@ -8632,13 +8430,6 @@ path-type@^4.0.0: resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== -pause-stream@0.0.11: - version "0.0.11" - resolved "https://registry.yarnpkg.com/pause-stream/-/pause-stream-0.0.11.tgz#fe5a34b0cbce12b5aa6a2b403ee2e73b602f1445" - integrity sha512-e3FBlXLmN/D1S+zHzanP4E/4Z60oFAa3O051qt1pxa7DEJWKAyil6upYVXCWadEnuoqa4Pkc9oUx9zsxYeRv8A== - dependencies: - through "~2.3" - pbkdf2@^3.0.16, pbkdf2@^3.0.9, pbkdf2@^3.1.1: version "3.1.2" resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.1.2.tgz#dd822aa0887580e52f1a039dc3eda108efae3075" @@ -8692,18 +8483,6 @@ pkg-dir@^4.2.0: dependencies: find-up "^4.0.0" -please-upgrade-node@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz#aeddd3f994c933e4ad98b99d9a556efa0e2fe942" - integrity sha512-gQR3WpIgNIKwBMVLkpMUeR3e1/E1y42bqDQZfql+kDeXd8COYfM8PQA4X6y7a8u9Ua9FHmsrrmirW2vHs45hWg== - dependencies: - semver-compare "^1.0.0" - -posix-character-classes@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" - integrity sha512-xTgYBc3fuo7Yt7JbiuFxSYGToMoz8fLoE6TC9Wx1P/u+LfeThMOAqmuyECnlBaaJb+u1m9hHiXUEtwW4OzfUJg== - prelude-ls@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" @@ -8726,6 +8505,11 @@ prettier@^2.4.1: resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.7.1.tgz#e235806850d057f97bb08368a4f7d899f7760c64" integrity sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g== +prettier@^2.5.1: + version "2.8.7" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.7.tgz#bb79fc8729308549d28fe3a98fce73d2c0656450" + integrity sha512-yPngTo3aXUUmyuTjeTUT75txrf+aMh9FiD7q9ZE/i6r0bPb22g4FsE6Y338PQX1bmfy08i9QQCB7/rcUAVntfw== + pretty-format@^27.0.0, pretty-format@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.5.1.tgz#2181879fdea51a7a5851fb39d920faa63f01d88e" @@ -8754,6 +8538,15 @@ pretty-format@^29.0.0, pretty-format@^29.1.2: ansi-styles "^5.0.0" react-is "^18.0.0" +pretty-format@^29.5.0: + version "29.5.0" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.5.0.tgz#283134e74f70e2e3e7229336de0e4fce94ccde5a" + integrity sha512-V2mGkI31qdttvTFX7Mt4efOqHXqJWMu4/r66Xh3Z3BwZaPfPJgp6/gbwoujRpPUtfEF6AUUWx3Jim3GCw5g/Qw== + dependencies: + "@jest/schemas" "^29.4.3" + ansi-styles "^5.0.0" + react-is "^18.0.0" + proc-log@^2.0.0, proc-log@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/proc-log/-/proc-log-2.0.1.tgz#8f3f69a1f608de27878f91f5c688b225391cb685" @@ -8860,11 +8653,6 @@ proxy-from-env@^1.1.0: resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2" integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg== -proxy-middleware@latest: - version "0.15.0" - resolved "https://registry.yarnpkg.com/proxy-middleware/-/proxy-middleware-0.15.0.tgz#a3fdf1befb730f951965872ac2f6074c61477a56" - integrity sha512-EGCG8SeoIRVMhsqHQUdDigB2i7qU7fCsWASwn54+nPutYO8n4q6EiwMzyfWlC+dzRFExP+kvcnDFdBDHoZBU7Q== - pseudomap@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" @@ -8893,6 +8681,11 @@ punycode@^2.1.0, punycode@^2.1.1: resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== +pure-rand@^6.0.0: + version "6.0.1" + resolved "https://registry.yarnpkg.com/pure-rand/-/pure-rand-6.0.1.tgz#31207dddd15d43f299fdcdb2f572df65030c19af" + integrity sha512-t+x1zEHDjBwkDGY5v5ApnZ/utcd4XYDiJsaQQoptTXgUXX95sDg1elCdJghzicm7n2mbCBJ3uYWr6M22SO19rg== + q@^1.5.1: version "1.5.1" resolved "https://registry.yarnpkg.com/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7" @@ -8925,11 +8718,6 @@ range-parser@1.2.0: resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.0.tgz#f49be6b487894ddc40dcc94a322f611092e00d5e" integrity sha512-kA5WQoNVo4t9lNx2kQNFCxKeBl5IbbSNBl1M/tLkw9WCn+hxNBAW5Qh8gdhs63CJnhjJ2zQWFoqPJP2sK1AV5A== -range-parser@~1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031" - integrity sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg== - rc@^1.0.1, rc@^1.1.6: version "1.2.8" resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" @@ -9040,7 +8828,16 @@ readable-stream@3, readable-stream@^3.0.0, readable-stream@^3.0.2, readable-stre string_decoder "^1.1.1" util-deprecate "^1.0.1" -readable-stream@^2.0.2, readable-stream@~2.3.6: +readable-stream@^3.1.1: + version "3.6.2" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.2.tgz#56a9b36ea965c00c5a93ef31eb111a0f11056967" + integrity sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA== + dependencies: + inherits "^2.0.3" + string_decoder "^1.1.1" + util-deprecate "^1.0.1" + +readable-stream@~2.3.6: version "2.3.7" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57" integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw== @@ -9053,15 +8850,6 @@ readable-stream@^2.0.2, readable-stream@~2.3.6: string_decoder "~1.1.1" util-deprecate "~1.0.1" -readable-stream@^3.1.1: - version "3.6.2" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.2.tgz#56a9b36ea965c00c5a93ef31eb111a0f11056967" - integrity sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA== - dependencies: - inherits "^2.0.3" - string_decoder "^1.1.1" - util-deprecate "^1.0.1" - readdir-scoped-modules@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/readdir-scoped-modules/-/readdir-scoped-modules-1.1.0.tgz#8d45407b4f870a0dcaebc0e28670d18e74514309" @@ -9072,15 +8860,6 @@ readdir-scoped-modules@^1.1.0: graceful-fs "^4.1.2" once "^1.3.0" -readdirp@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.2.1.tgz#0e87622a3325aa33e892285caf8b4e846529a525" - integrity sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ== - dependencies: - graceful-fs "^4.1.11" - micromatch "^3.1.10" - readable-stream "^2.0.2" - readdirp@~3.6.0: version "3.6.0" resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" @@ -9101,14 +8880,6 @@ redent@^3.0.0: indent-string "^4.0.0" strip-indent "^3.0.0" -regex-not@^1.0.0, regex-not@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" - integrity sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A== - dependencies: - extend-shallow "^3.0.2" - safe-regex "^1.1.0" - regexp.prototype.flags@^1.4.3: version "1.4.3" resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.4.3.tgz#87cab30f80f66660181a3bb7bf5981a872b367ac" @@ -9138,21 +8909,6 @@ registry-url@3.1.0: dependencies: rc "^1.0.1" -remove-trailing-separator@^1.0.1: - version "1.1.0" - resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" - integrity sha512-/hS+Y0u3aOfIETiaiirUFwDBDzmXPvO+jAfKTitUngIPzdKc6Z0LoFjM/CK5PL4C+eKwHohlHAb6H0VFfmmUsw== - -repeat-element@^1.1.2: - version "1.1.4" - resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.4.tgz#be681520847ab58c7568ac75fbfad28ed42d39e9" - integrity sha512-LFiNfRcSu7KK3evMyYOuCzv3L10TW7yC1G2/+StMjK8Y6Vqd2MG7r/Qjw4ghtuCOjFvlnms/iMmLqpvW/ES/WQ== - -repeat-string@^1.6.1: - version "1.6.1" - resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" - integrity sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w== - require-directory@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" @@ -9200,16 +8956,16 @@ resolve-global@1.0.0, resolve-global@^1.0.0: dependencies: global-dirs "^0.1.1" -resolve-url@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" - integrity sha512-ZuF55hVUQaaczgOIwqWzkEcEidmlD/xl44x1UZnhOXcYuFN2S6+rcxpG+C1N3So0wvNI3DmJICUFfu2SxhBmvg== - resolve.exports@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/resolve.exports/-/resolve.exports-1.1.0.tgz#5ce842b94b05146c0e03076985d1d0e7e48c90c9" integrity sha512-J1l+Zxxp4XK3LUDZ9m60LRJF/mAe4z6a4xyabPHk7pvK5t35dACV32iIjJDFeWZFfZlO29w6SZ67knR0tHzJtQ== +resolve.exports@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/resolve.exports/-/resolve.exports-2.0.2.tgz#f8c934b8e6a13f539e38b7098e2e36134f01e800" + integrity sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg== + resolve@^1.0.0, resolve@^1.10.0, resolve@^1.20.0, resolve@^1.22.0: version "1.22.1" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.1.tgz#27cb2ebb53f91abb49470a928bba7558066ac177" @@ -9227,11 +8983,6 @@ restore-cursor@^3.1.0: onetime "^5.1.0" signal-exit "^3.0.2" -ret@~0.1.10: - version "0.1.15" - resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" - integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg== - retry@^0.12.0: version "0.12.0" resolved "https://registry.yarnpkg.com/retry/-/retry-0.12.0.tgz#1b42a6266a21f07421d1b0b54b7dc167b01c013b" @@ -9242,11 +8993,6 @@ reusify@^1.0.4: resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== -rfdc@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/rfdc/-/rfdc-1.3.0.tgz#d0b7c441ab2720d05dc4cf26e01c89631d9da08b" - integrity sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA== - rimraf@^2.6.1: version "2.7.1" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" @@ -9291,7 +9037,7 @@ run-parallel@^1.1.9: dependencies: queue-microtask "^1.2.2" -rxjs@^7.5.1, rxjs@^7.5.5: +rxjs@^7.5.5: version "7.5.7" resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.5.7.tgz#2ec0d57fdc89ece220d2e702730ae8f1e49def39" integrity sha512-z9MzKh/UcOqB3i20H6rtrlaE/CgjLOvheWK/9ILrbhROGTweAi1BaFsTT9FbwZi5Trr1qNRs+MXkhmR06awzQA== @@ -9303,7 +9049,7 @@ safe-buffer@5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== -safe-buffer@>=5.1.0, safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@~5.2.0: +safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@~5.2.0: version "5.2.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== @@ -9317,13 +9063,6 @@ safe-regex-test@^1.0.0: get-intrinsic "^1.1.3" is-regex "^1.1.4" -safe-regex@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" - integrity sha512-aJXcif4xnaNUzvUuC5gcb46oTS7zvg4jpMTnuqtrEPlR3vFr4pxtdTwaF1Qs3Enjn9HK+ZlwQui+a7z0SywIzg== - dependencies: - ret "~0.1.10" - "safer-buffer@>= 2.1.2 < 3", "safer-buffer@>= 2.1.2 < 3.0.0": version "2.1.2" resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" @@ -9358,11 +9097,6 @@ secure-random@1.1.2: resolved "https://registry.yarnpkg.com/secure-random/-/secure-random-1.1.2.tgz#ed103b460a851632d420d46448b2a900a41e7f7c" integrity sha512-H2bdSKERKdBV1SwoqYm6C0y+9EA94v6SUBOWO8kDndc4NoUih7Dv6Tsgma7zO1lv27wIvjlD0ZpMQk7um5dheQ== -semver-compare@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/semver-compare/-/semver-compare-1.0.0.tgz#0dee216a1c941ab37e9efb1788f6afc5ff5537fc" - integrity sha512-YM3/ITh2MJ5MtzaM429anh+x2jiLVjqILF4m4oyQB18W7Ggea7BfqdH/wGMK7dDiMghv/6WG7znWMwUDzJiXow== - "semver@2 || 3 || 4 || 5", semver@^5.5.0, semver@^5.6.0: version "5.7.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" @@ -9394,25 +9128,6 @@ semver@^6.0.0, semver@^6.3.0: resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== -send@latest: - version "0.18.0" - resolved "https://registry.yarnpkg.com/send/-/send-0.18.0.tgz#670167cc654b05f5aa4a767f9113bb371bc706be" - integrity sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg== - dependencies: - debug "2.6.9" - depd "2.0.0" - destroy "1.2.0" - encodeurl "~1.0.2" - escape-html "~1.0.3" - etag "~1.8.1" - fresh "0.5.2" - http-errors "2.0.0" - mime "1.6.0" - ms "2.1.3" - on-finished "2.4.1" - range-parser "~1.2.1" - statuses "2.0.1" - serve-handler@6.1.3: version "6.1.3" resolved "https://registry.yarnpkg.com/serve-handler/-/serve-handler-6.1.3.tgz#1bf8c5ae138712af55c758477533b9117f6435e8" @@ -9427,19 +9142,6 @@ serve-handler@6.1.3: path-to-regexp "2.2.1" range-parser "1.2.0" -serve-index@^1.9.1: - version "1.9.1" - resolved "https://registry.yarnpkg.com/serve-index/-/serve-index-1.9.1.tgz#d3768d69b1e7d82e5ce050fff5b453bea12a9239" - integrity sha512-pXHfKNP4qujrtteMrSBb0rc8HJ9Ms/GrXwcUtUtD5s4ewDJI8bT3Cz2zTVRMKtri49pLx2e0Ya8ziP5Ya2pZZw== - dependencies: - accepts "~1.3.4" - batch "0.6.1" - debug "2.6.9" - escape-html "~1.0.3" - http-errors "~1.6.2" - mime-types "~2.1.17" - parseurl "~1.3.2" - serve@^12.0.1: version "12.0.1" resolved "https://registry.yarnpkg.com/serve/-/serve-12.0.1.tgz#5b0e05849f5ed9b8aab0f30a298c3664bba052bb" @@ -9460,26 +9162,6 @@ set-blocking@^2.0.0: resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" integrity sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw== -set-value@^2.0.0, set-value@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.1.tgz#a18d40530e6f07de4228c7defe4227af8cad005b" - integrity sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw== - dependencies: - extend-shallow "^2.0.1" - is-extendable "^0.1.1" - is-plain-object "^2.0.3" - split-string "^3.0.1" - -setprototypeof@1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.0.tgz#d0bd85536887b6fe7c0d818cb962d9d91c54e656" - integrity sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ== - -setprototypeof@1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.2.0.tgz#66c9a24a73f9fc28cbe66b09fed3d33dcaf1b424" - integrity sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw== - sha.js@^2.4.0, sha.js@^2.4.11, sha.js@^2.4.8: version "2.4.11" resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.11.tgz#37a5cf0b81ecbc6943de109ba2960d1b26584ae7" @@ -9559,15 +9241,6 @@ slash@3.0.0, slash@^3.0.0: resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== -slice-ansi@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-3.0.0.tgz#31ddc10930a1b7e0b67b08c96c2f49b77a789787" - integrity sha512-pSyv7bSTC7ig9Dcgbw9AuRNUb5k5V6oDudjZoMBSr13qpLBG7tB+zgCkARjq7xIUgdz5P1Qe8u+rSGdouOOIyQ== - dependencies: - ansi-styles "^4.0.0" - astral-regex "^2.0.0" - is-fullwidth-code-point "^3.0.0" - slice-ansi@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-4.0.0.tgz#500e8dd0fd55b05815086255b3195adf2a45fe6b" @@ -9582,36 +9255,6 @@ smart-buffer@^4.2.0: resolved "https://registry.yarnpkg.com/smart-buffer/-/smart-buffer-4.2.0.tgz#6e1d71fa4f18c05f7d0ff216dd16a481d0e8d9ae" integrity sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg== -snapdragon-node@^2.0.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" - integrity sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw== - dependencies: - define-property "^1.0.0" - isobject "^3.0.0" - snapdragon-util "^3.0.1" - -snapdragon-util@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/snapdragon-util/-/snapdragon-util-3.0.1.tgz#f956479486f2acd79700693f6f7b805e45ab56e2" - integrity sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ== - dependencies: - kind-of "^3.2.0" - -snapdragon@^0.8.1: - version "0.8.2" - resolved "https://registry.yarnpkg.com/snapdragon/-/snapdragon-0.8.2.tgz#64922e7c565b0e14204ba1aa7d6964278d25182d" - integrity sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg== - dependencies: - base "^0.11.1" - debug "^2.2.0" - define-property "^0.2.5" - extend-shallow "^2.0.1" - map-cache "^0.2.2" - source-map "^0.5.6" - source-map-resolve "^0.5.0" - use "^3.1.0" - socks-proxy-agent@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/socks-proxy-agent/-/socks-proxy-agent-7.0.0.tgz#dc069ecf34436621acb41e3efa66ca1b5fed15b6" @@ -9636,17 +9279,6 @@ sort-keys@^2.0.0: dependencies: is-plain-obj "^1.0.0" -source-map-resolve@^0.5.0: - version "0.5.3" - resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.3.tgz#190866bece7553e1f8f267a2ee82c606b5509a1a" - integrity sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw== - dependencies: - atob "^2.1.2" - decode-uri-component "^0.2.0" - resolve-url "^0.2.1" - source-map-url "^0.4.0" - urix "^0.1.0" - source-map-support@0.5.13: version "0.5.13" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.13.tgz#31b24a9c2e73c2de85066c0feb7d44767ed52932" @@ -9663,16 +9295,6 @@ source-map-support@^0.5.12, source-map-support@^0.5.17, source-map-support@^0.5. buffer-from "^1.0.0" source-map "^0.6.0" -source-map-url@^0.4.0: - version "0.4.1" - resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.1.tgz#0af66605a745a5a2f91cf1bbf8a7afbc283dec56" - integrity sha512-cPiFOTLUKvJFIg4SKVScy4ilPPW6rFgMgfuZJPNoDuMs3nC1HbMUycBoJw77xFIp6z1UJQJOfx6C9GMH80DiTw== - -source-map@^0.5.6: - version "0.5.7" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" - integrity sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ== - source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" @@ -9709,13 +9331,6 @@ spdx-license-ids@^3.0.0: resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.12.tgz#69077835abe2710b65f03969898b6637b505a779" integrity sha512-rr+VVSXtRhO4OHbXUiAF7xW3Bo9DuuF6C5jH+q/x15j2jniycgKbxU09Hr0WqlSLUs4i4ltHGXqTe7VHclYWyA== -split-string@^3.0.1, split-string@^3.0.2: - version "3.1.0" - resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2" - integrity sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw== - dependencies: - extend-shallow "^3.0.0" - split2@^3.0.0: version "3.2.2" resolved "https://registry.yarnpkg.com/split2/-/split2-3.2.2.tgz#bf2cf2a37d838312c249c89206fd7a17dd12365f" @@ -9723,13 +9338,6 @@ split2@^3.0.0: dependencies: readable-stream "^3.0.0" -split@0.3: - version "0.3.3" - resolved "https://registry.yarnpkg.com/split/-/split-0.3.3.tgz#cd0eea5e63a211dfff7eb0f091c4133e2d0dd28f" - integrity sha512-wD2AeVmxXRBoX44wAycgjVpMhvbwdI2aZjCkvfNcH1YqHQvJVa1duWc73OyVGJUc05fhFaTZeQ/PYsrmyH0JVA== - dependencies: - through "2" - split@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/split/-/split-1.0.1.tgz#605bd9be303aa59fb35f9229fbea0ddec9ea07d9" @@ -9756,36 +9364,6 @@ stack-utils@^2.0.3: dependencies: escape-string-regexp "^2.0.0" -static-extend@^0.1.1: - version "0.1.2" - resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" - integrity sha512-72E9+uLc27Mt718pMHt9VMNiAL4LMsmDbBva8mxWUCkT07fSzEGMYUCk0XWY6lp0j6RBAG4cJ3mWuZv2OE3s0g== - dependencies: - define-property "^0.2.5" - object-copy "^0.1.0" - -statuses@2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/statuses/-/statuses-2.0.1.tgz#55cb000ccf1d48728bd23c685a063998cf1a1b63" - integrity sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ== - -"statuses@>= 1.4.0 < 2", statuses@~1.5.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" - integrity sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA== - -stream-combiner@~0.0.4: - version "0.0.4" - resolved "https://registry.yarnpkg.com/stream-combiner/-/stream-combiner-0.0.4.tgz#4d5e433c185261dde623ca3f44c586bcf5c4ad14" - integrity sha512-rT00SPnTVyRsaSz5zgSPma/aHSOic5U1prhYdRy5HS2kTZviFpmDgzilbtsJsxiroqACmayynDN/9VzIbX5DOw== - dependencies: - duplexer "~0.1.1" - -string-argv@0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/string-argv/-/string-argv-0.3.1.tgz#95e2fbec0427ae19184935f816d74aaa4c5c19da" - integrity sha512-a1uQGz7IyVy9YwhqjZIZu1c8JO8dNIe20xBmSS6qu9kv++k3JGzCVmprbNN5Kn+BgzD5E7YYwg1CcjuJMRNsvg== - string-length@^4.0.1: version "4.0.2" resolved "https://registry.yarnpkg.com/string-length/-/string-length-4.0.2.tgz#a8a8dc7bd5c1a82b9b3c8b87e125f66871b6e57a" @@ -9843,15 +9421,6 @@ string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" -stringify-object@3.3.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/stringify-object/-/stringify-object-3.3.0.tgz#703065aefca19300d3ce88af4f5b3956d7556629" - integrity sha512-rHqiFh1elqCQ9WPLIC8I0Q/g/wj5J1eMkyoiD6eoQApWHP0FtlK7rqnhmabL5VUY9JQCcqwwvlOaSuutekgyrw== - dependencies: - get-own-enumerable-property-symbols "^3.0.0" - is-obj "^1.0.1" - is-regexp "^1.0.0" - strip-ansi@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" @@ -9919,13 +9488,6 @@ strong-log-transformer@2.1.0, strong-log-transformer@^2.1.0: minimist "^1.2.0" through "^2.3.4" -supports-color@8.1.1, supports-color@^8.0.0: - version "8.1.1" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" - integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== - dependencies: - has-flag "^4.0.0" - supports-color@^5.3.0: version "5.5.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" @@ -9940,6 +9502,13 @@ supports-color@^7.0.0, supports-color@^7.1.0: dependencies: has-flag "^4.0.0" +supports-color@^8.0.0: + version "8.1.1" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" + integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== + dependencies: + has-flag "^4.0.0" + supports-hyperlinks@^2.0.0: version "2.3.0" resolved "https://registry.yarnpkg.com/supports-hyperlinks/-/supports-hyperlinks-2.3.0.tgz#3943544347c1ff90b15effb03fc14ae45ec10624" @@ -10068,7 +9637,7 @@ through2@^4.0.0: dependencies: readable-stream "3" -through@2, "through@>=2.2.7 <3", through@^2.3.4, through@^2.3.6, through@^2.3.8, through@~2.3, through@~2.3.1: +through@2, "through@>=2.2.7 <3", through@^2.3.4, through@^2.3.6: version "2.3.8" resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" integrity sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg== @@ -10097,21 +9666,6 @@ to-fast-properties@^2.0.0: resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" integrity sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog== -to-object-path@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" - integrity sha512-9mWHdnGRuh3onocaHzukyvCZhzvr6tiflAy/JRFXcJX0TjgfWA9pk9t8CMbzmBE4Jfw58pXbkngtBtqYxzNEyg== - dependencies: - kind-of "^3.0.2" - -to-regex-range@^2.1.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38" - integrity sha512-ZZWNfCjUokXXDGXFpZehJIkZqq91BcULFq/Pi7M5i4JnxXdhMKAK682z8bCW3o8Hj1wuuzoKcW3DfVzaP6VuNg== - dependencies: - is-number "^3.0.0" - repeat-string "^1.6.1" - to-regex-range@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" @@ -10119,21 +9673,6 @@ to-regex-range@^5.0.1: dependencies: is-number "^7.0.0" -to-regex@^3.0.1, to-regex@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce" - integrity sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw== - dependencies: - define-property "^2.0.2" - extend-shallow "^3.0.2" - regex-not "^1.0.2" - safe-regex "^1.1.0" - -toidentifier@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.1.tgz#3be34321a88a820ed1bd80dfaa33e479fbb8dd35" - integrity sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA== - tough-cookie@^4.0.0: version "4.1.2" resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-4.1.2.tgz#e53e84b85f24e0b65dd526f46628db6c85f6b874" @@ -10246,12 +9785,13 @@ ts-node@^9, ts-node@^9.0.0: source-map-support "^0.5.17" yn "3.1.1" -ts-poet@^6.1.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/ts-poet/-/ts-poet-6.1.0.tgz#c5c3d679dfce1fe39acb5f5415275c5d6a598cb7" - integrity sha512-PFwbNJjGrb44wzHUGQicG2/nhjR+3+k7zYLDTa8D61NVUitl7K/JgIc9/P+8oMNenntKzLc8tjLDOkPrxIhm6A== +ts-poet@^4.15.0: + version "4.15.0" + resolved "https://registry.yarnpkg.com/ts-poet/-/ts-poet-4.15.0.tgz#637145fa554d3b27c56541578df0ce08cd9eb328" + integrity sha512-sLLR8yQBvHzi9d4R1F4pd+AzQxBfzOSSjfxiJxQhkUoH5bL7RsAC6wgvtVUQdGqiCsyS9rT6/8X2FI7ipdir5g== dependencies: - dprint-node "^1.0.7" + lodash "^4.17.15" + prettier "^2.5.1" ts-proto-descriptors@1.7.1: version "1.7.1" @@ -10261,16 +9801,16 @@ ts-proto-descriptors@1.7.1: long "^4.0.0" protobufjs "^6.8.8" -ts-proto@^1.117.0: - version "1.126.1" - resolved "https://registry.yarnpkg.com/ts-proto/-/ts-proto-1.126.1.tgz#ad016943709a23d755bb18b8bed6154e1b412348" - integrity sha512-PKrcgd0mCQJDY7tp+th349uYhnjs2Tz7wSqm9+DBcodl3YCKPt1pFtFmApOZdQ8WlghhgKAuJDIRQJBd6jD5YA== +ts-proto@1.117.0: + version "1.117.0" + resolved "https://registry.yarnpkg.com/ts-proto/-/ts-proto-1.117.0.tgz#9186c36b7d71153fd65dc8f18c28defe54be65d7" + integrity sha512-htGXhOsq1oZ7T13YeNjpm4xYxniTk+tsdEX2/KQVg+2ycTjMw1POk7gI4B2agp1ABxv+Qwe5/QuLIf8fQQ72dw== dependencies: "@types/object-hash" "^1.3.0" dataloader "^1.4.0" object-hash "^1.3.1" protobufjs "^6.11.3" - ts-poet "^6.1.0" + ts-poet "^4.15.0" ts-proto-descriptors "1.7.1" tsconfig-paths@^3.14.1: @@ -10446,16 +9986,6 @@ unbox-primitive@^1.0.2: has-symbols "^1.0.3" which-boxed-primitive "^1.0.2" -union-value@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.1.tgz#0b6fe7b835aecda61c6ea4d4f02c14221e109847" - integrity sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg== - dependencies: - arr-union "^3.1.0" - get-value "^2.0.6" - is-extendable "^0.1.1" - set-value "^2.0.1" - unique-filename@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/unique-filename/-/unique-filename-2.0.1.tgz#e785f8675a9a7589e0ac77e0b5c34d2eaeac6da2" @@ -10492,34 +10022,11 @@ universalify@^2.0.0: resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.0.tgz#75a4984efedc4b08975c5aeb73f530d02df25717" integrity sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ== -unix-crypt-td-js@^1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/unix-crypt-td-js/-/unix-crypt-td-js-1.1.4.tgz#4912dfad1c8aeb7d20fa0a39e4c31918c1d5d5dd" - integrity sha512-8rMeVYWSIyccIJscb9NdCfZKSRBKYTeVnwmiRYT2ulE3qd1RaDQ0xQDP+rI3ccIWbhu/zuo5cgN8z73belNZgw== - unorm@^1.5.0: version "1.6.0" resolved "https://registry.yarnpkg.com/unorm/-/unorm-1.6.0.tgz#029b289661fba714f1a9af439eb51d9b16c205af" integrity sha512-b2/KCUlYZUeA7JFUuRJZPUtr4gZvBh7tavtv4fvk4+KV9pfGiR6CQAQAWl49ZpR3ts2dk4FYkP7EIgDJoiOLDA== -unpipe@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" - integrity sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ== - -unset-value@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559" - integrity sha512-PcA2tsuGSF9cnySLHTLSh2qrQiJ70mn+r+Glzxv2TWZblxsxCC52BDlZoPCsz7STd9pN7EZetkWZBAvk4cgZdQ== - dependencies: - has-value "^0.3.1" - isobject "^3.0.0" - -upath@^1.1.1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/upath/-/upath-1.2.0.tgz#8f66dbcd55a883acdae4408af8b035a5044c1894" - integrity sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg== - upath@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/upath/-/upath-2.0.1.tgz#50c73dea68d6f6b990f51d279ce6081665d61a8b" @@ -10548,11 +10055,6 @@ uri-js@^4.2.2: dependencies: punycode "^2.1.0" -urix@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" - integrity sha512-Am1ousAhSLBeB9cG/7k7r2R0zj50uDRlZHPGbazid5s9rlF1F/QKYObEKSIunSjIOkJZqwRRLpvewjEkM7pSqg== - url-parse@^1.5.3: version "1.5.10" resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.5.10.tgz#9d3c2f736c1d75dd3bd2be507dcc111f1e2ea9c1" @@ -10561,31 +10063,16 @@ url-parse@^1.5.3: querystringify "^2.1.1" requires-port "^1.0.0" -use@^3.1.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" - integrity sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ== - util-deprecate@^1.0.1, util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== -utils-merge@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" - integrity sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA== - uuid@8.3.2, uuid@^8.3.2: version "8.3.2" resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== -uuid@^3.0.0: - version "3.4.0" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" - integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== - v8-compile-cache-lib@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz#6336e8d71965cb3d35a1bbb7868445a7c05264bf" @@ -10636,7 +10123,7 @@ validate-npm-package-name@^3.0.0: dependencies: builtins "^1.0.3" -vary@^1, vary@~1.1.2: +vary@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" integrity sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg== @@ -10699,20 +10186,6 @@ webidl-conversions@^6.1.0: resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-6.1.0.tgz#9111b4d7ea80acd40f5270d666621afa78b69514" integrity sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w== -websocket-driver@>=0.5.1: - version "0.7.4" - resolved "https://registry.yarnpkg.com/websocket-driver/-/websocket-driver-0.7.4.tgz#89ad5295bbf64b480abcba31e4953aca706f5760" - integrity sha512-b17KeDIQVjvb0ssuSDF2cYXSg2iztliJ4B9WdsuB6J952qCPKmnVq4DyW5motImXHDC1cBT/1UezrJVsKw5zjg== - dependencies: - http-parser-js ">=0.5.1" - safe-buffer ">=5.1.0" - websocket-extensions ">=0.1.1" - -websocket-extensions@>=0.1.1: - version "0.1.4" - resolved "https://registry.yarnpkg.com/websocket-extensions/-/websocket-extensions-0.1.4.tgz#7f8473bc839dfd87608adb95d7eb075211578a42" - integrity sha512-OqedPIGOfsDlo31UNwYbCFMSaO9m9G/0faIHj5/dZFDMFqPTcx6UwqyOy3COEaEOg/9VsGIpdqn62W5KhoKSpg== - whatwg-encoding@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz#5abacf777c32166a51d085d6b4f3e7d27113ddb0" @@ -10791,15 +10264,6 @@ wordwrap@^1.0.0: resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" integrity sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q== -wrap-ansi@^6.2.0: - version "6.2.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-6.2.0.tgz#e9393ba07102e6c91a3b221478f0257cd2856e53" - integrity sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" @@ -10841,7 +10305,7 @@ write-file-atomic@^3.0.0: signal-exit "^3.0.2" typedarray-to-buffer "^3.1.5" -write-file-atomic@^4.0.0, write-file-atomic@^4.0.1: +write-file-atomic@^4.0.0, write-file-atomic@^4.0.1, write-file-atomic@^4.0.2: version "4.0.2" resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-4.0.2.tgz#a9df01ae5b77858a027fd2e80768ee433555fcfd" integrity sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==